query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
dda368cbaa2e2111dca9ad42aeb676d5
tenth checkbox group with name of priority
[ { "docid": "786056c1f0ff22a616c82283b9d448f2", "score": "0.52531534", "text": "function selectOnlyThis9(id) {\n var myCheckbox = document.getElementsByName(\"priority\");\n Array.prototype.forEach.call(myCheckbox, function (el) {\n el.checked = false;\n });\n id.checked = true;\n}", "title": "" } ]
[ { "docid": "82e30de2e97c209e97fea6a0bffa61ea", "score": "0.59423435", "text": "function countChecked(which_group) {\n var n = $(\"#\" + which_group + \" input:checked\").length;\n if (n === 0) {\n $(\"#\" + which_group + \" input[type=checkbox].default\").prop(\"checked\", true);\n }\n }", "title": "" }, { "docid": "2e55df65899efbf4ecc29ddc94876c37", "score": "0.5904106", "text": "function weightsShowCheckBoxes()\n\t{\n\t\tvar count = getPropertyGroupCount();\n\t\tvar columnCount = 2;\n\t\tvar itemsPerColumn = Math.floor(count / columnCount);\n\t\t\n\t\tvar markup = '<table width=\"100%\"><tr>';\n\t\t\n\t\tif (count % columnCount != 0) // Properties cannot exactly be divided over the columns, add one (round 'up')\n\t\t{\n\t\t\titemsPerColumn += 1;\n\t\t}\n\t\tfor (var i = 0; i < count; i++)\n\t\t{\n\t\t\tif (i % itemsPerColumn == 0)\n\t\t\t{\n\t\t\t\tmarkup += '<td width=\"48%\"><table>';\n\t\t\t}\n\t\t\tvar lID = 'Cat' + i;\n\t\t\tmarkup += '<tr><td><input id=\"' + lID + '\" type=\"checkbox\"' +\n\t\t\t\t(getPropertyGroupWeight(i) != 1 ? ' checked' : '') +\n\t\t\t\t'></td><td width=\"100%\"' +\n\t\t\t\t'><label for=\"' + lID + '\" title=\"' + getPropertyDesc(i) + '\">' +\n\t\t\t\tgetPropertyGroupDesc(i) + '&nbsp;</label></td></tr>';\n\t\t\t\t\t\n\t\t\tif ((i+1) % itemsPerColumn == 0)\n\t\t\t{\n\t\t\t\tmarkup += '</table></td>';\n\t\t\t}\n\t\t}\n\t\t// Finally add empty rows to fill up last column.\n\t\tvar lastColumnMissingRows = count % columnCount;\n\t\tif (lastColumnMissingRows > 0)\n\t\t{\n\t\t\tfor (var j = 0; j < lastColumnMissingRows; j++)\n\t\t\t{\n\t\t\t\tmarkup += '<tr><td colspan=\"2\">&nbsp;</td></tr>';\n\t\t\t}\n\t\t\tmarkup += '</table></td>';\n\t\t}\n\t\tmarkup += '</tr></table>';\n\t\treturn markup;\n\t}", "title": "" }, { "docid": "53e5f3665219b1d952ba5ab45c53278d", "score": "0.5828381", "text": "function selectGroupByAvailable(value, label){\n var html= \"<li><input checked type='checkbox' data-label='\" + label + \"' value='\" + value + \"'> \" + label\n //+ \"<span class='glyphicon glyphicon-menu-down' aria-hidden='true'></span>\"\n //+ \"<span class='glyphicon glyphicon-menu-up' aria-hidden='true'></span>\"\n + \"</li>\";\n $(\"#groupby_selected\").append(html);\n $(\"#groupby_available LI INPUT[value='\" + value+ \"']\").parent().remove();\n $(\"#groupby_selected LI INPUT[value='\" + value+ \"']\").parent().click(function(){\n $checkBox = $(this).find(\"INPUT\");\n selectGroupBySelected($checkBox.val(), $checkBox.attr(\"data-label\"));\n });\n addGroupByItemVal(value);\n}", "title": "" }, { "docid": "0930181a0d8d72f7332a967325c7e7d4", "score": "0.5740363", "text": "function ponerDatos9(t,opt){\r\n var checkboxContainer=document.getElementById(\"checkboxDiv3\");\r\n document.getElementById(\"titulo9\").innerHTML = t;\r\n for (i = 0; i < opt.length; i++) {\r\n var input = document.createElement(\"input\");\r\n var label = document.createElement(\"label\");\r\n label.innerHTML=opt[i];\r\n label.setAttribute(\"for\", \"expr_\"+i);\r\n input.type=\"checkbox\";\r\n input.name=\"expr\";\r\n input.id=\"expr_\"+i;\r\n checkboxContainer.appendChild(input);\r\n checkboxContainer.appendChild(label);\r\n checkboxContainer.appendChild(document.createElement(\"br\"));\r\n }\r\n}", "title": "" }, { "docid": "25535156964e2619a17d9e747847c9f4", "score": "0.5733941", "text": "function selectOpts(name, n) {\n let opts = `\n <ul class=\"dropdown\">\n `;\n for (let i = 1; i <= numbells; i++) {\n let s = n.includes(i) ? \" checked \" : \"\";\n opts += `<li><input type=\"checkbox\" id=\"${name+\"-\"+i}\" value=\"${i}\"${s} /><label for=\"${name+\"-\"+i}\">${i}</label></li>\n`\n }\n opts += `</ul>`;\n return opts;\n }", "title": "" }, { "docid": "648cff0a07a3f301fa64368a420d39ea", "score": "0.57296044", "text": "function checkboxlimit(checkgroup, limit, locale){\n\tvar checkgroup = checkgroup;\n\tvar limit = limit;\n\tfor (var i=0; i<checkgroup.length; i++){\n\t\tcheckgroup[i].onclick=function(){\n\t\tvar checkedcount = 0;\n\t\tfor (var i = 0; i < checkgroup.length; i++)\n\t\t\tcheckedcount += (checkgroup[i].checked)? 1 : 0\n\t\t if (checkedcount > limit){\n\t\t \tif (locale == \"en\") {\n\t\t \t alert(\"You can only select a maximum of \" + limit + \" checkboxes\");\n\t\t \t} else {\n\t\t \t alert(\"ليس بإمكانك الإختيار أكثر من \" + limit + \" خانات\");\n\t\t \t}\n\t\t\t this.checked = false;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7ecf793ace341860054b98f4ccb87ba9", "score": "0.5661995", "text": "function is_group(obj){\n\n if ($(obj).is(\":checked\")) {\n for (var i = 5; i <= 6; i++)\n {\n $('#select_no_user').append($('<option>',\n {\n value: (i === 0) ? \"\" : i,\n text: (i === 0) ? \"Select No of user\" : i,\n }));\n }\n } else {\n $(\"#select_no_user option[value='5']\").remove();\n $(\"#select_no_user option[value='6']\").remove();\n }\n\n}", "title": "" }, { "docid": "936aa4f8fe5a91b508996d481a9abb00", "score": "0.561817", "text": "function ponerDatos3(t,opt){\r\n var checkboxContainer=document.getElementById(\"checkboxDiv1\");\r\n document.getElementById(\"titulo3\").innerHTML = t;\r\n for (i = 0; i < opt.length; i++) {\r\n var input = document.createElement(\"input\");\r\n var label = document.createElement(\"label\");\r\n label.innerHTML=opt[i];\r\n label.setAttribute(\"for\", \"licor_\"+i);\r\n input.type=\"checkbox\";\r\n input.name=\"licor\";\r\n input.id=\"licor_\"+i;\r\n checkboxContainer.appendChild(input);\r\n checkboxContainer.appendChild(label);\r\n checkboxContainer.appendChild(document.createElement(\"br\"));\r\n }\r\n}", "title": "" }, { "docid": "cf60c8811278be89fc2d9df8d19ca1d9", "score": "0.55988055", "text": "function selectGroupBySelected(value, label){\n var html= \"<li><input type='checkbox' data-label='\" + label + \"' value='\" + value + \"'> \" + label + \"</li>\";\n $(\"#groupby_available\").append(html);\n $(\"#groupby_selected LI INPUT[value='\" + value+ \"']\").parent().remove();\n $(\"#groupby_available LI INPUT[value='\" + value+ \"']\").parent().click(function(){\n $checkBox = $(this).find(\"INPUT\");\n selectGroupByAvailable($checkBox.val(), $checkBox.attr(\"data-label\"));\n });\n removeGroupByItemVal(value);\n}", "title": "" }, { "docid": "acebade76882b9f5e1a654ec605cd120", "score": "0.5588551", "text": "function ponerDatos6(t,opt){\r\n var checkboxContainer=document.getElementById(\"checkboxDiv2\");\r\n document.getElementById(\"titulo6\").innerHTML = t;\r\n for (i = 0; i < opt.length; i++) {\r\n var input = document.createElement(\"input\");\r\n var label = document.createElement(\"label\");\r\n label.innerHTML=opt[i];\r\n label.setAttribute(\"for\", \"instrument_\"+i);\r\n input.type=\"checkbox\";\r\n input.name=\"instrument\";\r\n input.id=\"instrument_\"+i;\r\n checkboxContainer.appendChild(input);\r\n checkboxContainer.appendChild(label);\r\n checkboxContainer.appendChild(document.createElement(\"br\"));\r\n }\r\n}", "title": "" }, { "docid": "e5914f5342dcb10c4ecee7ea71a79ff0", "score": "0.5580332", "text": "renderCheckboxField(parentKey, questionOptions) {\n let choices = questionOptions.attributes.choices;\n let options = [];\n choices.map(function(obj, key) {\n options.push(\n <label key = {key} className=\"dynamic-radio\">\n <input type=\"checkbox\" name={parentKey + \"_\" + questionOptions.id} value={obj.id} checked = {obj.checked} onClick={(e) => this.handleCheckboxChange(e, parentKey, questionOptions, obj)}/>\n <span className=\"treatmentLabel\"> {obj.name} </span>\n </label>\n );\n }, this);\n return options;\n }", "title": "" }, { "docid": "3ae63af3b11f32884182a2cd5c7b0a17", "score": "0.551104", "text": "function checkboxOccurrencesTypes(i, type){\n if($(\"#OccurrencesType\"+i+type).prop(\"checked\"))\n $(\"#OccurrencesType\"+i+type).prop('checked', false);\n else\n $(\"#OccurrencesType\"+i+type).prop('checked', true);\n}", "title": "" }, { "docid": "71d45a9a1279a71d2aab76418cc7b388", "score": "0.54972225", "text": "function validateCheckBoxGrp(elem, minreq, maxreq){\n\tchecknum = 0;\n\tcheckmax = true;\n\tformObj = elem.form;\n\trequiredid = elem.id;\n\t\n\tfor (var i=0; i < (formObj.elements.length -1); i++) {\n\t\tif (formObj.elements[i].id == requiredid && formObj.elements[i].checked == true) {\n\t\t\tchecknum++;\n\t\t}\n\t}\n\t\t\n\tif (checknum > maxreq && maxreq > 0) {\n\t\tcheckmax = false;\n\t}\n\t\n\t//logic to determine if a field is checked...\n\tif (checknum < minreq || !checkmax) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "e6976155182b8c7ef2dd146651014d93", "score": "0.5439649", "text": "function getCheckBoxes(){\n var paragraph = $('<p/>');\n $('<label/>', {'for':'interests', 'text':'Your Interests: (Check all that apply)'}).appendTo(paragraph);\n var table = $('<table/>').appendTo(paragraph);\n var firstRow = $(getCheckBoxRow('sports', 'Sports', 'art', 'Art')).appendTo(table);\n var secondRow = $(getCheckBoxRow('programming', 'Programming', 'philosophy', 'Philosophy')).appendTo(table);\n var thirdRow = $(getCheckBoxRow('music', 'Music', 'nature', 'Nature')).appendTo(table);\n return paragraph;\n }", "title": "" }, { "docid": "80a777a458edf4315ec8fa4635d135e7", "score": "0.54382175", "text": "function updateNSelected(checkboxes, htmlElement) {\r\n var n=0;\r\n jQuery(checkboxes).each(function() { n += this.checked; });\r\n htmlElement.html (n==0 ? 'Select all that apply' : n + \" selected\");\r\n return (n === jQuery(checkboxes).length);\r\n}", "title": "" }, { "docid": "9e830d308268da1a90b4d8d60fa577a7", "score": "0.5414038", "text": "function generateCheckBoxesLegend() {\n for (var i = 0; i < numOfUnique; i++) {\n if (unique[i] != 'end') {\n var label = document.createElement(\"label\");\n var checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\"; // make the element a checkbox\n checkbox.id = unique[i]; // give it a name we can check on the server side\n checkbox.setAttribute(\"style\", \"margin-top:10px\");\n checkbox.checked = true;\n\n //If checkbox is checked make item visible\n checkbox.onclick = function() {\n if (this.checked) {\n checkedItems[this.id] = null;\n } else {\n delete checkedItems[this.id];\n }\n //Redraw vis\n var json = buildHierarchy(csv);\n createVisualization(json, false);\n }\n label.appendChild(checkbox); // add the box to the element\n\n // add the label element to your div\n document.getElementById('boxes').appendChild(label);\n }\n }\n}", "title": "" }, { "docid": "8c24bef541128ab4ab71ab4ecf0beeaa", "score": "0.5402894", "text": "function checkcontrol_sci(j) {\n \"use strict\";\n var total = 0, i;\n for (i = 0; i < document.passives.sci.length; i += 1) {\n if (document.passives.sci[i].checked) {\n total += 1;\n }\n if (total > 3) {\n alert(\"Maximum number is three\")\n document.passives.sci[j].checked = false ;\n return false;\n }\n }\n}", "title": "" }, { "docid": "8a3a73042fdac0a572ce3446e2b511ef", "score": "0.5400264", "text": "function setGraphicRadiosCheckboxes() {\n\t\t\n\t\t$('.graphic-radio label, .graphic-checkbox label').each(function (index, elem) {\n\t\t\tif ($(elem).find('i').length > 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$(elem).contents().eq(2).wrap('<span/>');\n\t\t});\n\n\t\t$('.graphic-radio label input[type=\"radio\"]').each(function (index, elem) {\n\t\t\tif ($(elem).parent().find('i').length > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$(elem).after('<i class=\"fa fa-circle-o\"></i><i class=\"fa fa-dot-circle-o\"></i>');\n\t\t});\n\n\t\t$('.graphic-checkbox label input[type=\"checkbox\"]').each(function (index, elem) {\n\t\t\tif ($(elem).parent().find('i').length > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$(elem).after('<i class=\"fa fa-fw fa-square-o\"></i><i class=\"fa fa-fw fa-check-square-o\"></i>');\n\t\t});\n\n\t}", "title": "" }, { "docid": "8dd8cd452369b10a037bca288979f542", "score": "0.5383626", "text": "function checkboxSeleccionar(obj,ncheckbox) {\n if (obj.checked==true) for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=true; \n else for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=false; \n}", "title": "" }, { "docid": "8dd8cd452369b10a037bca288979f542", "score": "0.5383626", "text": "function checkboxSeleccionar(obj,ncheckbox) {\n if (obj.checked==true) for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=true; \n else for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=false; \n}", "title": "" }, { "docid": "8dd8cd452369b10a037bca288979f542", "score": "0.5383626", "text": "function checkboxSeleccionar(obj,ncheckbox) {\n if (obj.checked==true) for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=true; \n else for(i=1;i<=ncheckbox;i++) document.getElementById('check'+ i ).checked=false; \n}", "title": "" }, { "docid": "eda6436ce38f843acf98c6e7fb546c36", "score": "0.5379675", "text": "function whichAreChecked(checkboxGroup) {\n var group = [];\n for (var i = 0; i < checkboxGroup.length; i++) {\n if (checkboxGroup[i].checked) {\n group[group.length] = checkboxGroup[i];\n }\n }\n return group;\n}", "title": "" }, { "docid": "e186552103cf8edf210e1d8250af9160", "score": "0.53332", "text": "function styleCheckbox() {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n \n \n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "ee4038a0750eadbae9d0e205ed693ade", "score": "0.5332251", "text": "setParentCheckboxes(props = this.props) {\n const stateToSet = {};\n props.languageGroups.data.forEach((group) => {\n let allGroupChildrenSelected = true;\n props.item.data.some((itemData) => {\n if ((itemData.group === group.code) && !itemData.isSelected) {\n allGroupChildrenSelected = false;\n return true;\n }\n return false;\n });\n stateToSet[group.id] = allGroupChildrenSelected;\n });\n this.setState(stateToSet);\n }", "title": "" }, { "docid": "b6818b4b22b212e826a0e4436ae3bf56", "score": "0.5323494", "text": "function groupByTissues() {\n var checkbox = $('#isoform-barplot-groupByTissues-on');\n var cx = $('#isoform-barplot-canvas').data('canvasxpress');\n if (checkbox.is(':checked')) {\n cx.groupSamples([\"Tissue_Group\"]);\n } else {\n cx.groupSamples([]);\n }\n}", "title": "" }, { "docid": "9cc7c0cc3fd86862f52cf115e96f5d90", "score": "0.5306853", "text": "function questionsCheckBox(surveys, survey_from, survey_to) {\n for (i = survey_from; i <= survey_to; i++) {\n var name = 'survey.' + i;\n surveys.push({\n type:\"checkbox\",choices:[\n { value: I18n.t(name + '_question.1_choice_value'),\n text: I18n.t(name + '_question.1_choice_text')},\n { value: I18n.t(name + \"_question.2_choice_value\"),\n text: I18n.t(name + \"_question.2_choice_text\")},\n { value: I18n.t(name + \"_question.3_choice_value\"),\n text: I18n.t(name + \"_question.3_choice_text\")}],\n choicesOrder:\"random\",\n colCount:3,\n name: I18n.t(name + \"_question.name\"),\n title: I18n.t(name + \"_question.title\"),\n otherText: I18n.t(name + \"_question.other_text\")\n });\n };\n return surveys;\n}", "title": "" }, { "docid": "7e415e5121493e1684d5af995a9d5c29", "score": "0.5283463", "text": "function checkCheckBoxGroup(groupName) {\n var g = document.getElementsByName(groupName);\n\n for(var i = 0;i<g.length;i++) {\n if (g[i].checked) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "233f0cdc063963e8940cbda17a1f4c20", "score": "0.5277085", "text": "function setorder(chkbx){\r\n if(chkbx.checked)\r\n {\r\n\r\n chkorder = parseInt(chkorder+1) ;\r\n\r\n if (chkorder === 3){\r\n alert(\"Please, only check two files.\");\r\n chkbx.checked = 0;\r\n chkbx.parentElement.children[0].textContent = \"\";\r\n chkorder = chkorder -1;\r\n }else{\r\n // Set order to lable\r\n chkbx.parentElement.children[0].textContent = String(chkorder);\r\n // Add path files to array\r\n files_to_procces[chkorder-1] = chkbx.parentElement.parentElement.parentElement.getAttribute(\"row-id\");\r\n // Add checkbox element to array\r\n check_boxes[chkorder-1]= chkbx;\r\n \r\n }\r\n }\r\n else\r\n {\r\n //Getting id\r\n var id = parseInt(chkbx.parentElement.children[0].textContent)-1;\r\n\r\n\r\n // Cleaning label\r\n chkbx.parentElement.children[0].textContent= \"\";\r\n\r\n if(check_boxes.length == 2 && id == 0){\r\n\r\n \tfiles_to_procces= [files_to_procces[1]];\r\n \tcheck_boxes = [check_boxes[1]];\r\n \tcheck_boxes[0].parentElement.children[0].textContent = \"1\";\r\n\r\n\t }else{\r\n \tif (check_boxes.length == 2 && id == 1){\r\n \t\tfiles_to_procces = [files_to_procces[0]];\r\n\t\t\tcheck_boxes= [check_boxes[0]];\r\n\t\t\tcheck_boxes[0].parentElement.children[0].textContent = \"1\";\r\n\t\t}else{\r\n \t\tfiles_to_procces = []\r\n\t\t\tcheck_boxes = []\r\n\t\t}\r\n\t }\r\n chkorder = files_to_procces.length;\r\n }\r\n}", "title": "" }, { "docid": "3a1a731b3967ab6880ca3b9d341eb1b6", "score": "0.5254023", "text": "function updateCheckbox( addOrRemove, toCheck )\n{\n var dep = parseInt( toCheck.substring( 0, toCheck.indexOf( 'x' ) ) ); \n var num = toCheck.substring( toCheck.indexOf( 'x' ) + 1 ).toUpperCase();\n\n /*\n for ( var i = 0; i < currMajorArray[ 1 ].length; i++ )\n {\n for ( var k = 0; k < currMajorArray[ 1 ][ i ].length; k++ )\n {\n thisClass = currMajorArray[ 1 ][ i ][ k ];\n var thisDep = parseInt( thisClass.substring( 0, thisClass.indexOf( 'e' ) ) );\n var thisNum = thisClass.substring( thisClass.indexOf( 'e' ) + 1 );\n\n if ( dep == thisDep && num == thisNum )\n {\n $( '#' + thisClass ).prop( \"checked\", addOrRemove ).checkboxradio( \"refresh\" );\n break;\n }\n }\n }\n */\n var key = dep + \"r\" + num;\n if ( key in majorClassDictionary )\n {\n var infoArray = majorClassDictionary[ key ].split( \"_\" );\n\n if ( infoArray[ 3 ] == \"true\" )\n {\n switch ( infoArray[ 1 ] )\n {\n case \"A\":\n alert( \"You broke something here...\" );\n break;\n\n case \"C\":\n var numChecked = $( '#cc_' + infoArray[ 0 ] + ' input:checked' ).length;\n if ( numChecked < infoArray[ 2 ] )\n {\n $( '#cat' + infoArray[ 0 ] + '_' + numChecked ).prop( \"checked\", addOrRemove ).checkboxradio( \"refresh\" );\n }\n break;\n }\n }\n else\n {\n switch ( infoArray[ 1 ] )\n {\n case \"A\":\n var thisClass = dep + \"e\" + num;\n $( '#' + thisClass ).prop( \"checked\", addOrRemove ).checkboxradio( \"refresh\" );\n break;\n\n case \"C\":\n var thatClass = dep + \"c\" + num;\n\n if ( $( '#choiceC_' + infoArray[ 0 ] + ' input' ).length < infoArray[ 2 ] && $( '#' + thatClass ).length == 0 )\n {\n $( '#choiceC_' + infoArray[ 0 ] ).append( '<input id=\"' + thatClass + '\" type=\"checkbox\"><label for=\"' + thatClass + '\">' + majorArray[ dep ] + ' ' + num + '</label>' );\n $( '#' + thatClass ).prop( \"checked\", true ).checkboxradio().checkboxradio( \"refresh\" );\n $( '#page3' ).trigger( 'create' );\n updateDisable();\n }\n break;\n\n case \"U\":\n var thereClass = dep + \"u\" + num;\n if ( typeof currReqUnitArray[infoArray[0]] == \"undefined\" )\n {\n currReqUnitArray[infoArray[0]] = 0;\n }\n\n if ( currReqUnitArray[ infoArray[0] ] < infoArray[ 2 ] && $( '#' + thereClass ).length == 0 )\n {\n $( '#choiceU_' + infoArray[ 0 ] ).append( '<input id=\"' + thereClass + '\" type=\"checkbox\"><label for=\"' + thereClass + '\">' + majorArray[ dep ] + ' ' + num + '</label>' );\n $( '#' + thereClass ).prop( \"checked\", true ).checkboxradio().checkboxradio( \"refresh\" );\n $( '#page3' ).trigger( 'create' );\n currReqUnitArray[infoArray[0]] += getUnitsFromID( dep + \"d\" + num );\n updateDisable();\n }\n break;\n\n default:\n alert( \"Error: FindBoxException\" );\n break;\n }\n }\n }\n\n updateSlider();\n updatePreMajorTransition();\n}", "title": "" }, { "docid": "ca55a6deb9910405d1f199fffe1ee598", "score": "0.5248307", "text": "function populateCheckBox(subj) {\n for (let i = 0; i < subj.length; i++) {\n addCheckBoxInput(subj[i]);\n }\n}", "title": "" }, { "docid": "7b8217eff0a0a4ea7f780977a0f78a67", "score": "0.5236302", "text": "checkboxLabel(row) {\n if (!row) {\n return `${this.isAllSelected() ? 'select' : 'deselect'} all`;\n }\n return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;\n }", "title": "" }, { "docid": "7b8217eff0a0a4ea7f780977a0f78a67", "score": "0.5236302", "text": "checkboxLabel(row) {\n if (!row) {\n return `${this.isAllSelected() ? 'select' : 'deselect'} all`;\n }\n return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;\n }", "title": "" }, { "docid": "7b8217eff0a0a4ea7f780977a0f78a67", "score": "0.5236302", "text": "checkboxLabel(row) {\n if (!row) {\n return `${this.isAllSelected() ? 'select' : 'deselect'} all`;\n }\n return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;\n }", "title": "" }, { "docid": "658c0aa5fe9fd13fef0c0ee2c1cefdda", "score": "0.5234229", "text": "function createCheckboxes() {\n\t\tvar block_headers = document.querySelectorAll('.accordion-header');\n\t\t[].forEach.call(block_headers, function (el) {\n\t\t\tvar checkbox = document.createElement('input');\n\t\t\tcheckbox.type = 'checkbox';\n\t\t\tcheckbox.value = '1';\n\t\t\tcheckbox.style.float = 'right';\n\t\t\tcheckbox.style.display = 'none';\n\t\t\tcheckbox.checked = 'true';\n\t\t\tcheckbox.addEventListener('click', hideBlocks);\n\t\t\tel.appendChild(checkbox);\n\t\t});\n\t}", "title": "" }, { "docid": "a355d29b1e15dfb5ab7c573708fba098", "score": "0.52232486", "text": "function multiCheck(e) {\n\n let checked = [];\n \n if(e.shiftKey === true && e.target.checked === false) {\n for(let box of checkboxes) {\n box.checked = false;\n }\n } else if(e.shiftKey === true) {\n for(let box of checkboxes) {\n if(box.checked === true) {\n checked.push(checkboxes.indexOf(box));\n }\n }\n for(let i = checked[0]; i <= checked[1]; i++) {\n checkboxes[i].checked = true;\n }\n }\n}", "title": "" }, { "docid": "9b14f5f24731311ec54b4f55601623a6", "score": "0.52198017", "text": "function cbCheckAllRowsAndSubTask( cb, n, fldName, subtaskName, subtaskValue ) {\n if (!fldName) {\n fldName = 'cb';\n }\n f = cbParentForm( cb );\n for ( var i = 0; i < n; i++ ) {\n box = f.elements[fldName+i];\n if ( box.checked == false ) {\n box.checked = true;\n }\n }\n\tif (subtaskName && subtaskValue) {\n\t\tf.elements[subtaskName].value = subtaskValue;\n\t}\n}", "title": "" }, { "docid": "052224fb1e86f3db15080f6bcdce1e60", "score": "0.5212892", "text": "function enhanceCheckboxes(parent) {\n\tparent._shiftKey = false;\n\tparent._lastCheck = null;\n\n\taddEventSimple(parent,\"click\",function(event) { parent._shiftKey = event.shiftKey; });\n\taddEventSimple(parent,\"change\",function(event) {\n\t\t\tvar currentIndex, checkbox, start, end;\n\n\t\t\tif (event.target.nodeName.toLowerCase() == \"label\") {\n\t\t\t\tif (event.target.hasAttribute(\"for\"))\n\t\t\t\t\tcheckbox = document.getElementById(event.target.getAttribute(\"for\")) || document.getElementsByName(event.target.getAttribute(\"for\")).item(0);\n\t\t\t\telse\n\t\t\t\t\tcheckbox = event.target.getElementsByTagName(\"input\").item(0);\n\t\t\t} else\n\t\t\t\tcheckbox = event.target;\n\n\t\t\tif (parent._shiftKey && parent._lastCheck != null && parent._lastCheck != checkbox) {\n\t\t\t\tfor (var i = 0; i < checkbox.form.elements.length; i++) {\n\t\t\t\t\tif (checkbox.form.elements[i] == checkbox) {\n\t\t\t\t\t\tstart = checkbox;\n\t\t\t\t\t\tend = parent._lastCheck;\n\t\t\t\t\t\tcurrentIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if (checkbox.form.elements[i] == parent._lastCheck) {\n\t\t\t\t\t\tstart = parent._lastCheck;\n\t\t\t\t\t\tend = checkbox;\n\t\t\t\t\t\tcurrentIndex = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check for multicolumn environment\n\t\t\t\tvar check_column = function(node) {\n\t\t\t\t\tvar classes = node.className.split(\" \");\n\t\t\t\t\tfor (i in classes) {\n\t\t\t\t\t\tvar t = /^column(\\d+)$/.exec(classes[i]);\n\t\t\t\t\t\tif (t != null) {\n\t\t\t\t\t\t\treturn t[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\tif (!checkbox._inColumn)\n\t\t\t\t\tcheckbox._inColumn = check_column(checkbox);\n\n\t\t\t\tfor (currentIndex += 1; currentIndex < checkbox.form.elements.length && checkbox.form.elements[currentIndex] != end; currentIndex++) {\n\t\t\t\t\tif (checkbox.form.elements[currentIndex].type == \"checkbox\" && !checkbox.form.elements[currentIndex].disabled) {\n\t\t\t\t\t\tif (!checkbox._inColumn || checkbox._inColumn == check_column(checkbox.form.elements[currentIndex])) {\n\t\t\t\t\t\t\tcheckbox.form.elements[currentIndex].checked = checkbox.checked;\n\t\t\t\t\t\t\tckChangeEvnt(null,checkbox.form.elements[currentIndex]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tparent._lastCheck = end;\n\t\t\t} else\n\t\t\t\tparent._lastCheck = checkbox;\n\n\t\t\tparent._shiftKey = false;\n\t\t}\n\t);\n}", "title": "" }, { "docid": "5381bdb6f284734d6d3e7783a6f15c96", "score": "0.5177166", "text": "function CreateArraysOptional(checkboxNum)\n{\n optionalArray[checkboxNum] = 1;\n}", "title": "" }, { "docid": "5381bdb6f284734d6d3e7783a6f15c96", "score": "0.5177166", "text": "function CreateArraysOptional(checkboxNum)\n{\n optionalArray[checkboxNum] = 1;\n}", "title": "" }, { "docid": "0f65664552381abb0722d5aeee3b3f35", "score": "0.5168341", "text": "function checkButtonList() {\n var edit = listSortable.option(\"group\"),\n children = $(\"#notification_buttons\").children();\n edit.pull = children.length > 3 ? false : \"clone\";\n listSortable.option(\"group\", edit);\n }", "title": "" }, { "docid": "7f911225c1ef683e0393c56874be5fd1", "score": "0.5168232", "text": "function checkTheBoxes(checkboxes, index1, index2) {\n let index = 1;\n checkboxes.forEach((check) => {\n if (index2 > index1) {\n if (index >= index1 && index <= index2) check.checked = true;\n } else {\n if (index >= index2 && index <= index1) check.checked = true;\n }\n index++;\n });\n}", "title": "" }, { "docid": "d64c0b04294f25da3e5aec4a1867b894", "score": "0.515529", "text": "function createRadioButtons(count) {\n\tvar form = document.getElementById(\"piece-count-form\");\n\tfor(var i = 1; i <= count; i++) {\n\t\tvar label = document.createElement(\"LABEL\");\n\t\tvar labelText = document.createTextNode(i);\n\t\tvar button = document.createElement(\"INPUT\");\n\t\tbutton.setAttribute(\"type\", \"radio\");\n\t\tbutton.setAttribute(\"value\", i);\n\t\tbutton.setAttribute(\"name\", \"piece-count\");\n\t\tif(i == 3) button.setAttribute(\"checked\", \"checked\");\n\t\tlabel.appendChild(labelText);\n\t\tlabel.appendChild(button);\n\t\tform.appendChild(label);\n\t\tform.appendChild(document.createElement(\"BR\"));\n\t}\n}", "title": "" }, { "docid": "16818dc88208621c0b82f4259be32d1b", "score": "0.5152696", "text": "function validateCheckboxes() {\n for (let i = 0; i < groupOfCheckboxes.length; i++) {\n groupOfCheckboxes[i].addEventListener(\"change\", checkCheckbox);\n }\n}", "title": "" }, { "docid": "e6a2bcb1d6c80547c6ae60698daed412", "score": "0.51215583", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "title": "" }, { "docid": "e6a2bcb1d6c80547c6ae60698daed412", "score": "0.51215583", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "title": "" }, { "docid": "e6a2bcb1d6c80547c6ae60698daed412", "score": "0.51215583", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n}", "title": "" }, { "docid": "3486d4d2f95e0a20a5cc0ba9977596b7", "score": "0.5111569", "text": "function _countGroupLabelsBeforeOption2(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n var optionsArray = options.toArray();\n var groups = optionGroups.toArray();\n var groupCounter = 0;\n\n for (var i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n\n return groupCounter;\n }\n\n return 0;\n }", "title": "" }, { "docid": "3486d4d2f95e0a20a5cc0ba9977596b7", "score": "0.5111569", "text": "function _countGroupLabelsBeforeOption2(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n var optionsArray = options.toArray();\n var groups = optionGroups.toArray();\n var groupCounter = 0;\n\n for (var i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n\n return groupCounter;\n }\n\n return 0;\n }", "title": "" }, { "docid": "4a29a0e731d38a01cb1ad4568cc2ff6e", "score": "0.5081937", "text": "function countSelected(formElement, inputType, inputName) {\r\n if (inputType == null) inputType = 'checkbox';\r\n var returnValue = 0;\r\n for (var loopCounter = 0; loopCounter < formElement.length; loopCounter++) {\r\n var element = formElement.elements[loopCounter];\r\n if (element.type == inputType && element.checked == true) {\r\n if (inputName.length > 0)\r\n if (element.name == inputName)\r\n returnValue++;\r\n else\r\n returnValue++;\r\n }\r\n }\r\n return returnValue;\r\n }", "title": "" }, { "docid": "e1c284f4cc924778d695aa747e34a328", "score": "0.5080062", "text": "function displayOnOptions_fn() {\r\n var mybox = document.createElement(\"div\");\r\n mybox.setAttribute(\"id\", \"scoreOptions\");\r\n mybox.setAttribute(\"style\", \"text-align: left;\");\r\n var opt_out = \"\\n\\n<h3>Opciones del Script</h3>\";\r\n opt_out += \"\\n<table border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\">\";\r\n opt_out += \"\\n<tr>\";\r\n opt_out += \"\\n<td style=\\\"width:43%;text-align:right\\\">Ver clasificacion total:</td>\";\r\n opt_out += \"<td style=\\\"width:57%;\\\"><input type=\\\"checkbox\\\" id=\\\"scoreTotalOption\\\" \";\r\n if (whatToShow in {1:'', 3:'', 5:'', 7:''}) {\r\n opt_out += \"checked=\\\"checked\\\" \";\r\n }\r\n opt_out += \"/></td>\\n</tr>\";\r\n opt_out += \"\\n<tr>\";\r\n opt_out += \"<td style=\\\"width:43%;text-align:right\\\">Ver clasificacion de generales:</td>\";\r\n opt_out += \"<td><input type=\\\"checkbox\\\" id=\\\"scoreMilOption\\\" \";\r\n if (whatToShow in {2:'', 3:'', 6:'', 7:''}) {\r\n opt_out += \"checked=\\\"checked\\\" \";\r\n }\r\n opt_out += \"/></td>\\n</tr>\";\r\n opt_out += \"\\n<tr>\";\r\n opt_out += \"<td style=\\\"width:43%;text-align:right\\\">Ver cantidad de oro:</td>\";\r\n opt_out += \"<td><input type=\\\"checkbox\\\" id=\\\"scoreMonOption\\\" \";\r\n if (whatToShow in {4:'', 5:'', 6:'', 7:''}) {\r\n opt_out += \"checked=\\\"checked\\\" \";\r\n }\r\n opt_out += \"/></td>\\n</tr>\";\r\n opt_out += \"\\n<tr>\";\r\n opt_out += \"<td style=\\\"width:43%;text-align:right\\\">Ver las clasificaciones en linea:</td>\";\r\n opt_out += \"<td><input type=\\\"checkbox\\\" id=\\\"inline_score\\\" \";\r\n if (inlineScore) {\r\n opt_out += \"checked=\\\"checked\\\" \";\r\n }\r\n opt_out += \"/></td>\\n</tr>\";\r\n opt_out += \"\\n</table>\";\r\n mybox.innerHTML = opt_out;\r\n document.getElementById('options_changePass').appendChild(mybox);\r\n var inputs = document.getElementsByTagName('input');\r\n for (e = 0; e < inputs.length; e++) {\r\n if (inputs[e].getAttribute('type') == \"submit\") {\r\n inputs[e].setAttribute('type', 'button');\r\n inputs[e].addEventListener('click', function() { changeShow_fn() }, true);\r\n inputs[e].parentNode.id = \"optionsForm\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "514d2f157fd4172e6d2e3e1cd8a95b16", "score": "0.50739914", "text": "function FormCheckboxes({ category, limit, size }) {\n const classes = useStyles();\n const dispatch = useDispatch();\n const { user_type } = useSelector((store) => store.user);\n const { preferences_array } =\n user_type === 'client'\n ? useSelector((store) => store.forms.clientAnswers)\n : useSelector((store) => store.forms.providerAnswers);\n // Filters to a list of the category of preferences set down from the \n // parent component via props\n const filteredPreferences = useSelector((store) => store.preferences).filter(\n (item) => item.category === category\n );\n\n // If a limit is sent down from parent component via props, will turn the \n // FormHelperText red to denote an error\n const showError =\n filteredPreferences.filter((item) => preferences_array?.includes(item.id))\n .length > limit;\n\n // Dispatch to toggle a selected checkbox in redux\n const handleCheck = (id) => {\n const whichType =\n user_type === 'client'\n ? 'SET_CLIENT_PREFERENCES'\n : 'SET_PROVIDER_PREFERENCES';\n dispatch({\n type: whichType,\n payload: id,\n });\n };\n\n // If a size is sent down from the parent component via props, it will\n // set the maxHeight of the box of checks here\n const whatSize =\n size === 'sm' ? 200 : size === 'md' ? 300 : size === 'lg' ? 400 : 500;\n\n return (\n <FormControl error={showError}>\n {limit && <FormHelperText>Please choose up to {limit}.</FormHelperText>}\n <Box className={classes.checkboxBox} maxHeight={whatSize}>\n {filteredPreferences.map((item) => (\n <FormControlLabel\n key={item.id}\n control={\n <Checkbox\n checked={preferences_array?.includes(item.id)}\n onChange={() => handleCheck(item.id)}\n />\n }\n label={\n user_type === 'client' && item.name === 'Prefer not to respond'\n ? 'No preference'\n : item.name\n }\n />\n ))}\n </Box>\n </FormControl>\n );\n}", "title": "" }, { "docid": "ebe1f78889d647c54ec8c1d713545f25", "score": "0.5072708", "text": "function actDesSelNECon() {\n name = '';\n ncks = 0;\n $('[name$=-ck]').click(function () {\n if ($(this)[0].checked === true) {\n ncks++;\n sel = $(this).parent().next();\n $(sel).prop('disabled', false);\n } else {\n sel = $(this).parent().next();\n $(sel).prop('disabled', true);\n ncks--;\n }\n });\n } //checkbox del listado", "title": "" }, { "docid": "a6a94abdb407fd66937529a54d1fa72c", "score": "0.50614256", "text": "function checkboxFormatter(label,key) {\n if (label.substring(0,8) === \"Upstream\") {\n return '<input class=\"checkbox\" type=\"checkbox\" name=\"' + label + '\" id=\"' + key + label + '\"><label for=\"' + key + label +'\">' + label + ' </label>';\n } else {\n return '<input class=\"checkbox\" type=\"checkbox\" name=\"' + label + '\" id=\"' + key + label + '\" checked><label for=\"' + key + label +'\">' + label + ' </label>';\n }\n}", "title": "" }, { "docid": "3cdbfa27778e2bd98ae778977862a5ab", "score": "0.5058408", "text": "function getPriority() {\n var radio = document.forms[0].priority;\n console.log(radio);\n console.log(radio.checked);\n for (var i=0 , rl=radio.length; i<rl ; i++) {\n if (radio[i].checked) {\n priority = radio[i].value\n }\n }\n }", "title": "" }, { "docid": "eee6c8466b358e69ea421a9e7ca171bf", "score": "0.5041025", "text": "function setSeleGroup(setObj,GroupMark,GroupBgColor,GroupColor)\r\n{//if(!GroupMark) GroupMark=\"--\";\r\n\t \r\n with(setObj)\r\n for(var i=options.length-1;i>=0;i--)\r\n// if(options[i].disabled||(GroupHead&&options[i].value.indexOf(GroupHead)==0)) //Head\r\n// if(options[i].disabled||(GroupHead&&options[i].value.indexOf(GroupHead)>=0)) //Any\r\n if(options[i].disabled||(GroupMark&&options[i].value.indexOf(GroupMark)==options[i].value.length-GroupMark.length)) //Last\r\n { var Obj=document.createElement(\"optgroup\"); \r\n Obj.label=options[i].text;\r\n if(GroupBgColor) Obj.style.background=GroupBgColor;\r\n if(GroupColor) Obj.style.color=GroupColor;\r\n insertBefore(Obj,options[i]);\r\n options.remove(i); \r\n }\r\n}", "title": "" }, { "docid": "22bffd16e5b2c4dfb2acb16bb47fa545", "score": "0.5040978", "text": "function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n let optionsArray = options.toArray();\n let groups = optionGroups.toArray();\n let groupCounter = 0;\n for (let i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n return groupCounter;\n }\n return 0;\n}", "title": "" }, { "docid": "22bffd16e5b2c4dfb2acb16bb47fa545", "score": "0.5040978", "text": "function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n let optionsArray = options.toArray();\n let groups = optionGroups.toArray();\n let groupCounter = 0;\n for (let i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n return groupCounter;\n }\n return 0;\n}", "title": "" }, { "docid": "3bb14c42b06de10a16452468e435982a", "score": "0.50388306", "text": "function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n var optionsArray = options.toArray();\n var groups = optionGroups.toArray();\n var groupCounter = 0;\n for (var i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n return groupCounter;\n }\n return 0;\n}", "title": "" }, { "docid": "a7e21e0c22a3fa278871e637777d9c80", "score": "0.50320953", "text": "getCheckBoxes() {\n var jobs = [\"Rigger\", \"Loft Head\", \"Loft Employee\", \"Tandem Instructor\",\n \"AFP Instructor\", \"Packer\", \"Manifest\", \"Videographer\",\n \"Hanger Master\", \"Administrator\"];\n var col1 = [];\n var col2 = [];\n var col3 = [];\n\n for (var i = 0; i < jobs.length; i++) {\n var nextJob = jobs[i];\n var t = true;\n var nextItem = <Checkbox isChecked={false} key={i} label={nextJob} updateCheckBoxArray={this.jobsChanged} />\n\n if (i % 3 === 0) {\n col1.push(nextItem);\n } else if (i % 3 === 1) {\n col2.push(nextItem);\n } else if (i % 3 === 2) {\n col3.push(nextItem);\n }\n }\n return (<div>\n <div>{col1}</div>\n <div>{col2}</div>\n <div>{col3}</div>\n </div>\n );\n }", "title": "" }, { "docid": "227cdb9b1c3562542c56a2011744a8da", "score": "0.5030694", "text": "function countCheckedBoxes() {\n if (getCheckboxes(true, false).length > 3) {\n this.checked = !this.checked;\n let message = `Only ${getCheckboxes(true, false).length} days can be selected. You have already selected ${getCheckboxes(true, false)[0].value}, ${getCheckboxes(true, false)[1].value}, and ${getCheckboxes(true, false)[2].value}`;\n alert(message);\n showAlert(message);\n //disableAllUncheckedBoxes(getCheckboxes(false, false));\n } else {\n clearAlert();\n }\n invertSelectionDayNone();\n}", "title": "" }, { "docid": "805fa8157eda08caa4a872de905e7386", "score": "0.5029662", "text": "function CheckAllCheckBox(strDtgName, strOptionName, intStart, intMax)\n{\n\n var intCounter;\t\n\tvar blnStatus;\t\n\tblnStatus = false;\n\tif (eval('document.forms[0].ctl00_ContentPlaceHolder1_'+strDtgName+'_ctl02_cbxCheckAll')) {\n\t\tif (eval('document.forms[0].ctl00_ContentPlaceHolder1_'+strDtgName+'_ctl02_cbxCheckAll').checked)\n\t\t\tblnStatus = true;\n\t}\n\telse {\n\t\tif (eval('document.forms[0].ctl00_ContentPlaceHolder1_'+strDtgName+'_ctl03_cbxCheckAll')) {\n\t\t\tif (eval('document.forms[0].ctl00_ContentPlaceHolder1_'+strDtgName+'_ctl03_cbxCheckAll').checked)\n\t\t\t\tblnStatus = true;\n\t\t}\n\t}\t\n\n\tfor(intCounter = intStart; intCounter <= intMax + intStart - 1; intCounter++) {\t\n\t \t\n\tif (intCounter <10)\n\t{\t\t \n\t if (eval('document.forms[0].ctl00_ContentPlaceHolder1_' + strDtgName + '_ctl0' + intCounter + '_' + strOptionName)){\n\t\t\teval('document.forms[0].ctl00_ContentPlaceHolder1_' + strDtgName + '_ctl0' + intCounter + '_' + strOptionName).checked = blnStatus;\t\t\t\n\t\t}\n\t\t\t\t\t\n\t}\n\telse\n\t{\n\t if (eval('document.forms[0].ctl00_ContentPlaceHolder1_' + strDtgName + '_ctl' + intCounter + '_' + strOptionName)){\t\t\t\n\t\t\teval('document.forms[0].ctl00_ContentPlaceHolder1_' + strDtgName + '_ctl' + intCounter + '_' + strOptionName).checked = blnStatus;\t\t\t\n\t\t}\n\t}\n\t}\n}", "title": "" }, { "docid": "e21f559bddff6ca6f13beb099db2d206", "score": "0.50198406", "text": "function styleCheckbox(table) {\n /**\n $(table).find('input:checkbox').addClass('ace')\n .wrap('<label />')\n .after('<span class=\"lbl align-top\" />')\n\n\n $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n .find('input.cbox[type=checkbox]').addClass('ace')\n .wrap('<label />').after('<span class=\"lbl align-top\" />');\n */\n }", "title": "" }, { "docid": "4dce91353f16acce63a5bbf2cad4993f", "score": "0.5014862", "text": "function updateSelectedFlags() {\n\tvar i;\n\tterm_selected = false;\n\thas_term_left = false;\n\tif (group_chosen) {\n\t\tvar terms = group_chosen.getElementsByClassName('term');\n\t\tfor (i = 0; i < terms.length; i++) {\n\t\t\tvar checkbox = terms[i].getElementsByTagName('input');\n\t\t\tif (checkbox && checkbox[0].type == \"checkbox\") {\n\t\t\t\tif (term_selected == false) {\n\t\t\t\t\tif (checkbox[0].checked == true) {\n\t\t\t\t\t\t// has checked terms\n\t\t\t\t\t\tterm_selected = true;\n\t\t\t\t\t\t// alert(\"find checked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (has_term_left == false) {\n\t\t\t\t\tif (checkbox[0].checked == false) {\n\t\t\t\t\t\thas_term_left = true;\n\t\t\t\t\t\t// alert(\"find unchecked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "895b9702dd21c3750fdd95004b656da9", "score": "0.5013672", "text": "function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {\n if (optionGroups.length) {\n var optionsArray = options.toArray();\n var groups = optionGroups.toArray();\n var groupCounter = 0;\n\n for (var i = 0; i < optionIndex + 1; i++) {\n if (optionsArray[i].group && optionsArray[i].group === groups[groupCounter]) {\n groupCounter++;\n }\n }\n\n return groupCounter;\n }\n\n return 0;\n}", "title": "" }, { "docid": "2f3f1c4ae2464b0d6b8412be7fab0506", "score": "0.50118595", "text": "function selectAll(prefix, min, max, value){\r\n\tfor(i=min; i<=max; i++){\r\n\t\tdocument.getElementById(prefix+i).checked = value;\r\n\t\tcolorizeRow(prefix+i, 't_'+prefix+i, value);\r\n\t}\r\n}", "title": "" }, { "docid": "33fc1ebf9ab67041b680781ff2d0d620", "score": "0.50104296", "text": "function styleCheckbox(table) {\r\n\t\t/**\r\n\t\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\r\n\t\t * .after('<span class=\"lbl align-top\" />')\r\n\t\t * \r\n\t\t * \r\n\t\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\r\n\t\t * />').after('<span class=\"lbl align-top\" />');\r\n\t\t */\r\n\t}", "title": "" }, { "docid": "2cb0a5fefd5929fe3221cd9d26fd2fbb", "score": "0.500827", "text": "function doGroupBy() {\r\n // retrieve view by param\r\n placeView = d3.select(\"#chart-type\").property(\"value\");\r\n console.log(\"Change View by: \", placeView);\r\n // show or hide the \"with USA\" checkbox\r\n if (placeView === viewsOpts[0]) {\r\n $(\".form-check-toggle-label\").text(\"Include born in Nevada\")\r\n } else {\r\n $(\".form-check-toggle-label\").text(\"Include born in USA\")\r\n }\r\n updateVisualizationHook();\r\n}", "title": "" }, { "docid": "b7099ffb131ff5dd48af4291cd67a223", "score": "0.5008171", "text": "function checkBox(set,appender) {\n var _structure = \"<div class='cell'><label for='filter_1' ></label> \" +\n \"<div class='checkbox_container'><input id='filter_1' type='checkbox' name='filter' value='Monochrome' /> </div>\"+\"</div>\" ;\n\n for (var i = 0; i < set.length; ++i) {\n $(_structure)\n .find('label') // get 'img' object\n .html(set[i])\n .attr('for',set[i])\n .end()\n .find('input')\n .attr('id',set[i])\n .attr('value',set[i])\n .end() // end selection of 'img' object\n .appendTo(appender);\n };\n\n} // End checkBox method", "title": "" }, { "docid": "d314488006a6afa556ef9200ee568b2a", "score": "0.499507", "text": "function countChecked() {\n var count = document.querySelectorAll('.rowcheckbox:checked').length;\n \n var goDisabled = ((count === 0) | (count > 1000));\n if (count > 5000) {\n count = \"Too many selected\";\n }\n $('#id-count').text(count)\n $('#id_action').prop('disabled', goDisabled);\n $('#id_go').prop('disabled', goDisabled);\n}", "title": "" }, { "docid": "91d75928cd02eacc55222272c9edb429", "score": "0.49942014", "text": "function styleCheckbox(table) {\n\t\t/**\n\t\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\n\t\t * .after('<span class=\"lbl align-top\" />')\n\t\t * \n\t\t * \n\t\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\n\t\t * />').after('<span class=\"lbl align-top\" />');\n\t\t */\n\t}", "title": "" }, { "docid": "91d75928cd02eacc55222272c9edb429", "score": "0.49942014", "text": "function styleCheckbox(table) {\n\t\t/**\n\t\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\n\t\t * .after('<span class=\"lbl align-top\" />')\n\t\t * \n\t\t * \n\t\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\n\t\t * />').after('<span class=\"lbl align-top\" />');\n\t\t */\n\t}", "title": "" }, { "docid": "69e29d2c6ca4e92faa295fb0e197a1a4", "score": "0.49924314", "text": "function _addFieldGroups() {\n var dialog = $('#perc-edit-section-dialog');\n var fieldGroups = [\n { groupName : \"perc-section-general-container\", groupLabel : \"Section\"},\n { groupName : \"perc-section-users-container\", groupLabel : \"Users\"},\n { groupName : \"perc-section-security-container\", groupLabel : \"Security\"}\n ];\n $.each(fieldGroups, function(index) {\n // Create HTML markup with the groupName minimizer/maximizer and\n // insert it before the 1st field in each group\n var minmaxClass = (index === 0) ? \"perc-items-minimizer\" : \"perc-items-maximizer\";\n var groupHtml =\n \"<div class='perc-section-header'>\" +\n \"<div class='perc-section-label' groupName='\" + this.groupName + \"'>\" +\n \"<span class='perc-min-max \" + minmaxClass + \"' ></span>\" + this.groupLabel +\n \"</div>\" +\n \"</div>\";\n dialog.find('#' + this.groupName).before(groupHtml);\n // The first group will be the only one expanded (hide all others)\n index !== 0 && dialog.find('#' + this.groupName).hide();\n });\n\n // Bind collapsible event\n dialog.find(\".perc-section-label\").off(\"click\").on(\"click\",function() {\n var self = $(this);\n self.find(\".perc-min-max\")\n .toggleClass('perc-items-minimizer')\n .toggleClass('perc-items-maximizer');\n dialog.find('#' + self.attr('groupName')).toggle();\n });\n }", "title": "" }, { "docid": "c4e5a094d3322b4be2be2c3da1222887", "score": "0.49881804", "text": "function increment_counter(class_name) {\n let all_checkboxes = document.getElementsByClassName(class_name);\n let total_fields = all_checkboxes.length;\n let selected_fields = 0;\n let visible_fields = 0;\n for (let i = 0; i < total_fields; i++) {\n if (all_checkboxes[i].checked == true) {\n selected_fields += 1;\n }\n let element_display = $(all_checkboxes[i]).parent().css('display');\n if (element_display != 'none') {\n visible_fields += 1;\n }\n }\n return {visible_fields, selected_fields};\n}", "title": "" }, { "docid": "03a76b3a5017ade5598fa8449489b98d", "score": "0.4983325", "text": "function set_gselected(name/*the group name*/,value/*the group tem to be checked*/) {\n \n if( ne(name) || ne(value) ) return;\n \n var nobj = document.getElementsByName(name),i=0;\n for(;i<nobj.length;++i) {\n if(nobj[i].value==value) {\n nobj[i].checked=1;\n }\n else {\n nobj[i].checked=0;\n }\n } \n}", "title": "" }, { "docid": "0835b669ae550622457cf8825feb3731", "score": "0.4981931", "text": "function createCheckBoxes(name) {\n container = $('#checkbox');\n $(\"<input />\", {\n type: \"checkbox\",\n id: name,\n value: name\n }).appendTo(container);\n $(\"<label />\", {\n \"for\": name,\n text: name\n }).appendTo(container);\n $(\"<div />\").appendTo(container);\n}", "title": "" }, { "docid": "cc83fe45607114960b0ae9408f1e8b75", "score": "0.49814653", "text": "getBoxesChecked() {\n const optionsToAdd = []; \n [...elements.filterOptions.children].forEach((element) => {\n if (element.children[0].checked) {\n optionsToAdd.push(element.children[0].value);\n }\n });\n return optionsToAdd;\n }", "title": "" }, { "docid": "ad56b47bef4013ae5b26e7d6a7b421a2", "score": "0.4972026", "text": "function createCheckBox(index) {\r\n var radioList = $('<ul>');\r\n var item;\r\n var input = '';\r\n for (var i = 0; i < questions[index].choices.length; i++) {\r\n item = $('<li>');\r\n input = '<input type=\"checkbox\" name=\"answer\" value=' + i + ' />';\r\n input += questions[index].choices[i];\r\n item.append(input);\r\n radioList.append(item);\r\n }\r\n return radioList;\r\n }", "title": "" }, { "docid": "21a5ff7c7a0ed0a6e1b855a144d79a54", "score": "0.49706712", "text": "function choose_mission(){//handle checkbox\n let obj=document.getElementsByName(\"choose_mission\");\n let len = obj.length;\n $(\"#chat-choose-missions\").removeClass(\"hidden\").addClass(\"show\");\n $(\".chat-cover\").removeClass(\"hidden\").addClass(\"show\");\n for(let i=len-1;i>=0;i--){\n console.log(\"stop?\");\n if(obj[i].checked==true){\n console.log(i+\"missions\");\n output_mission.push(\"任務選項\"+i)//mission_list[i]);\n }else{\n }\n }\n \n}", "title": "" }, { "docid": "fe08e277348e22f07ec1f0f4860286a6", "score": "0.49695656", "text": "function styleCheckbox(table) {\n/**\n\t$(table).find('input:checkbox').addClass('ace')\n\t.wrap('<label />')\n\t.after('<span class=\"lbl align-top\" />')\n\n\n\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n*/\n}", "title": "" }, { "docid": "51be0d67bcc7672a52a78867fb5abf2e", "score": "0.49687344", "text": "function getChkCount() {\n var checkedCount = 0;\n for (i = 0; i < checkBoxCount && checkedCount < 2; i++) {\n if (document.getElementById(checkBoxId + i).checked) {\n checkedCount++;\n }\n }\n return checkedCount;\n}", "title": "" }, { "docid": "4e00c08113c7f0b1753313d2edddbe5b", "score": "0.4967572", "text": "function checkboxSelected(){\n var ckTrue=0;\n for (var i=0; i < ckBox.length; i++) {\n ckTrue += ckBox[i].checked;\n }\n if (ckTrue > 1) {\n for (var i = 0; i < ckBox.length; i++){\n // set enabled here\n ckBox[i].disabled=false;\n }\n }else {\n for (var i = 0; i < ckBox.length; i++){\n // set Disabled here\n if (ckBox[i].checked){\n ckBox[i].disabled=true;\n }\n }\n }\n} //End of function", "title": "" }, { "docid": "d92931625c641b2f499167231784a65c", "score": "0.49643385", "text": "function handleAddCheckbox(el) {\n\t\tvar checkboxVal = $(el).parent().find('.addCheckbox').val();\n\t\tvar checkboxesTotal = 0;\n\t\t$(el).parent().find('.checkboxesWrapper input').each(function() {\n\t\t\tif($(this).prop('checked')) {\n\t\t\t\tcheckboxesTotal += 1;\n\t\t\t}\n\t\t});\n\t\tvar max = $(el).parent().attr('data-maxvalues');\n\t\tvar name = $(el).parent().find('legend > b').text();\n\t\tif(checkboxVal && max && checkboxesTotal < max) {\n\t\t\t// check if such checkbox already exists\n\t\t\tvar found=0;\n\t\t\t$(el).parent().find('.checkboxesWrapper input[type=checkbox]').each(function() {\n\t\t\t\tif($(this).val() && $(this).val().toUpperCase() === checkboxVal.toUpperCase()) {\n\t\t\t\t\tfound=1;\n\t\t\t\t\tif($(this).prop('checked')) {\n\t\t\t\t\t\tshowErrorBalloon(el,'Value \"'+checkboxVal+'\" already exists');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// mark the checkbox and show it's label if it was hidden \n\t\t\t\t\t\t// (<label class=\"checkbox\"><input type=checkbox value=\"Value\">Value</label>)\n\t\t\t\t\t\t$(this).prop('checked',true).parent().show();\n\t\t\t\t\t\t$(el).parent().find('.addCheckbox').val('');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(!found) {\n\t\t\t\tvar $checkbox = $('<input type=\"checkbox\" checked />').attr('name',name).val(checkboxVal);\n\t\t\t\tvar $label = $('<label></label>').append($checkbox).append(checkboxVal);\n\t\t\t\t$(el).parent().find('.checkboxesWrapper').append($label);\n\t\t\t\t$(el).parent().find('.addCheckbox').val('');\n\t\t\t}\n\t\t}\n\n\t\tif(checkboxesTotal >= max) {\n\t\t\tshowErrorBalloon(el,'Too many checkboxes already. eBay only allows '+max+' for this specific');\n\t\t}\n\n\t\tif(!checkboxVal) {\n\t\t\tshowErrorBalloon(el,'Please, enter some value');\n\t\t}\n\t}", "title": "" }, { "docid": "630ba2265668560b344bbac131f2e32c", "score": "0.49600577", "text": "function fillCheckboxes(cName, array) {\n var asList = document.getElementsByClassName(cName);\n\n for (var i = 0; i<array.length; i++) {\n var isProf = array[i].isProficient;\n var el = asList[i];\n\n if (isProf) {\n el.checked = true;\n }\n else {\n el.checked = false;\n }\n }\n}", "title": "" }, { "docid": "32ae454ee3763ec24a080439cabd966f", "score": "0.49593127", "text": "function calcoloValoriCheckbox()\n{\n treOre = controlloCheckbox(\"3ore\");\n altoRischio = controlloCheckbox(\"Rischio\");\n ecg = controlloCheckbox(\"ECG\");\n\n /*\n console.log(\"3ore: \", treOre);\n console.log(\"altoRischio: \", altoRischio);\n console.log(\"ECG: \", ecg);\n */\n}", "title": "" }, { "docid": "046afb0d6ff36afa06ab69cb77278738", "score": "0.4955431", "text": "function changeAllCheck(checked) {\n for (var i = 0; i < Object.keys(TAGS).length; i++) {\n var tagCheck = document.getElementById(Object.keys(TAGS)[i] + \"-check\");\n tagCheck.checked = !tagCheck.checked;\n var smallTagCheck = document.getElementById(\n \"sm-\" + Object.keys(TAGS)[i] + \"-check\"\n );\n smallTagCheck.checked = !smallTagCheck.checked;\n }\n\n changeSelectedTags();\n}", "title": "" }, { "docid": "87afb622c1a5473bba872c0950377d15", "score": "0.49504086", "text": "function recountCheckboxes(dataTable){\n var table = $('tbody',dataTable);\n var context = table.parents('form');\n var nodes = $('tr',table); //visible nodes\n var total_length = nodes.length;\n var checked_length = $('input:checked',nodes).length;\n var last_action_b = $('.last_action_button',context);\n\n if (checked_length) { //at least 1 element checked\n //enable action buttons\n $('.top_button, .list_button',context).button(\"enable\");\n //check if the last_action_button should be enabled\n if (last_action_b.length && last_action_b.val().length){\n last_action_b.button(\"enable\");\n };\n //enable checkall box\n if (total_length == checked_length){\n $('.check_all',dataTable).attr(\"checked\",\"checked\");\n };\n } else { //no elements cheked\n //disable action buttons, uncheck checkAll\n $('.check_all',dataTable).removeAttr(\"checked\");\n $('.top_button, .list_button',context).button(\"disable\");\n last_action_b.button(\"disable\");\n };\n\n //any case the create dialog buttons should always be enabled.\n $('.create_dialog_button',context).button(\"enable\");\n $('.alwaysActive',context).button(\"enable\");\n}", "title": "" }, { "docid": "f5146f972c1cb3eb2d9efaa03a000665", "score": "0.49499705", "text": "function get_num_grouped_images(){\n var num_grouped_images = 0;\n for (var i=0; i<num_name+1; i++){\n for (var j=0; j<actual_num_img_loaded; j++){\n if (grouping_array[i][j] == true){\n num_grouped_images++;\n }\n }\n }\n // if there is no unselected image, enable NEXT button\n if (num_grouped_images == actual_num_img_loaded){\n document.getElementById('next_task').disabled = false;\n document.getElementById('give_name').disabled = true;\n }\n}", "title": "" }, { "docid": "2e62dde55e9e67c79a7c876195f5e8c1", "score": "0.49480122", "text": "function insertCheckBoxes(div, data, key) {\n for (var i=0; i<data.length; ++i) {\n if (data[i].data && data[i].label) {\n if (data[i].data.length > 0) {\n $(div).append(checkboxFormatter(data[i].label,key));\n }\n }\n }\n}", "title": "" }, { "docid": "f2d27c8f12f65b53391072a95803a0c1", "score": "0.49477124", "text": "function styleCheckbox(table) {\n\t/**\n\t * $(table).find('input:checkbox').addClass('ace') .wrap('<label />')\n\t * .after('<span class=\"lbl align-top\" />')\n\t * \n\t * \n\t * $('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t * .find('input.cbox[type=checkbox]').addClass('ace') .wrap('<label\n\t * />').after('<span class=\"lbl align-top\" />');\n\t */\n}", "title": "" }, { "docid": "5ce349eae18f23a6acef97b213c3f960", "score": "0.49466848", "text": "function styleCheckbox(table) {\r\n\t\r\n\t\t$(table).find('input:checkbox').addClass('ace')\r\n\t\t.wrap('<label />')\r\n\t\t.after('<span class=\"lbl align-top\" />')\r\n\r\n\r\n\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\r\n\t\t.find('input.cbox[type=checkbox]').addClass('ace')\r\n\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\r\n\t\r\n\t}", "title": "" }, { "docid": "b3302bca2e42292e000e6e5bbb612e98", "score": "0.4942238", "text": "function choose_level() {\n if (document.getElementById(\"easy\").checked)\n rows = 2;\n else if (document.getElementById(\"medium\").checked)\n rows = 6;\n else if (document.getElementById(\"hard\").checked)\n rows = 10;\n\n var lower_limit = 0.95 - rows * 0.1;\n lower_limit = Math.round(lower_limit * 100) / 100;\n for (var i = 0; i < existing_bubbles.length; i++) {\n if (existing_bubbles[i][1] <= lower_limit) {\n existing_bubbles.splice(i, 1);\n bubble_colors.splice(i, 1);\n i--;\n }\n }\n}", "title": "" }, { "docid": "f48a2f3ebb9ef0cb4d710bc752e46337", "score": "0.4941588", "text": "function setGroupCanCheck(){\n //select all\n if($('#date-select-type').val() == 0){\n $('.select-group input[shiftwork=\"0\"]').prop('disabled', false).closest('div.checkbox').show();\n }else{//type = 1 => select shift\n $('.select-group input[shiftwork=\"0\"]').prop('disabled', true).prop('checked', false).closest('div.checkbox').hide();\n }\n\n}", "title": "" }, { "docid": "0e493d1a2ce13b6c5799b89b76d9de0d", "score": "0.49414146", "text": "function setCountRangeFn() {\n if (!vm.question.controlList || vm.question.controlList.length === 0) {\n vm.question.controlList = [];\n\n setUpUids(0, vm.countRange);\n return;\n }\n\n if (vm.question.controlList.length > vm.countRange) {\n vm.question.controlList.splice(vm.countRange);\n\n if (!_.isNil(vm.question.config) && vm.question.config.rules.isOtherCheckbox) {\n addOtherCheckbox();\n }\n\n return;\n }\n\n if (!_.isNil(vm.question.config) && vm.question.config.rules.isOtherCheckbox) {\n vm.question.controlList = deleteOtherCheckboxes(vm.question.controlList);\n\n setUpUids(vm.question.controlList.length, vm.countRange);\n\n addOtherCheckbox();\n return;\n }\n\n setUpUids(vm.question.controlList.length, vm.countRange);\n }", "title": "" }, { "docid": "bb88a39413145d03ebb2ee96efa10772", "score": "0.4936676", "text": "function prepareCheckboxHTML () {\n document.querySelectorAll(\".checkbox\").forEach(function(item) { \n let checkmark = document.createElement(\"label\");\n checkmark.setAttribute(\"class\", \"checkbox-checkmark\");\n checkmark.setAttribute(\"for\", item.children[0].children[0].getAttribute(\"id\"));\n checkmark.addEventListener(\"click\", () => item.children[0].children[0].click());\n\n item.children[0].setAttribute(\"class\", \"checkbox-container\");\n item.children[0].style.setProperty(\"padding\", \"0px\", \"important\");\n item.children[0].appendChild(checkmark);\n });\n}", "title": "" }, { "docid": "bda383ab8fd3fbe42c064fe51bbd1c42", "score": "0.4934658", "text": "function updateSelectedFlags() {\n\tterm_selected = false;\n\thas_term_left = false;\n\tif (group_chosen) {\n\t\tvar terms = group_chosen.getElementsByClassName('term');\n\t\tfor (i = 0; i < terms.length; i++) {\n\t\t\tvar checkbox = terms[i].getElementsByTagName('input');\n\t\t\tif (checkbox && checkbox[0].type == \"checkbox\") {\n\t\t\t\tif (term_selected == false) {\n\t\t\t\t\tif (checkbox[0].checked == true) {\n\t\t\t\t\t\t// has checked terms\n\t\t\t\t\t\tterm_selected = true;\n\t\t\t\t\t\t// alert(\"find checked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (has_term_left == false) {\n\t\t\t\t\tif (checkbox[0].checked == false) {\n\t\t\t\t\t\thas_term_left = true;\n\t\t\t\t\t\t// alert(\"find unchecked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "49ae032896db79fa509dc6e018bda2af", "score": "0.49289468", "text": "function chekB(arrayMembers) {\n document.getElementById(\"rep\").checked = true;\n document.getElementById(\"dem\").checked = true;\n document.getElementById(\"ind\").checked = true;\n\n}", "title": "" }, { "docid": "ee9ff970503fefe76fbea127fda8eae7", "score": "0.4926076", "text": "function FormSelectFunctions(data){\n\t$(\"div.contain:nth-child(3)\").css(\"display\",\"block\");\n\tvar fieldset= document.createElement(\"fieldset\");\n\tvar idSMARTs= data[4];\n\t$(data[0]).each(function(index,element){\n\t\tif(index == data[0].length-1) return false;\n\t\tvar label= document.createElement(\"label\");\n\t\tvar inputBox= document.createElement(\"input\");\n\t\tvar span= document.createElement(\"span\");\n\t\tlabel.setAttribute(\"class\",\"avalaibleFunc\");\n\t\tinputBox.setAttribute(\"type\",\"checkbox\");\n\t\tinputBox.setAttribute(\"name\",\"listIdSMARTs[]\");\n\t\tinputBox.setAttribute(\"value\",\"\"+idSMARTs[index]+\"\");\n\t\tconsole.log(element);\n\t\tif(element[3] == \"priority\"){\n\t\t\tinputBox.setAttribute(\"checked\",\"checked\");\n\t\t\tlabel.setAttribute(\"class\",\"avalaibleFunc \"+element[3]);\n\t\t}\n\t\tinputBox.setAttribute(\"id\",\"\"+element[0].replace(/ /g, \"\")+\"\");\t\n\t\tspan.setAttribute(\"class\",\"checkCustomized\");\t\n\t\tlabel.setAttribute(\"for\",\"\"+element[0].replace(/ /g, \"\")+\"\");\n\t\tfieldset.appendChild(label);\n\t\tlabel.appendChild(inputBox);\n\t\tlabel.appendChild(span);\n\t\tlabel.insertAdjacentHTML('beforeend',element[0]);\n\t});\n\tvar inputSubmit= document.getElementById('selectFunctions').children[1];\n\tinputSubmit.before(fieldset);\t\t\t\t\n}", "title": "" }, { "docid": "58237a4992810e7528e52332ddfa97d2", "score": "0.49214724", "text": "function selectAll(checkboxGroup) {\n for (var i = 0; i < checkboxGroup.length; i++) {\n checkboxGroup[i].checked = true;\n }\n}", "title": "" }, { "docid": "aa15a3344a1ee85d7c0af6a080341fb9", "score": "0.4919559", "text": "function styleCheckbox(table) {\n\t\t\t\t/**\n\t\t\t\t\t$(table).find('input:checkbox').addClass('ace')\n\t\t\t\t\t.wrap('<label />')\n\t\t\t\t\t.after('<span class=\"lbl align-top\" />')\n\t\t\t\n\t\t\t\n\t\t\t\t\t$('.ui-jqgrid-labels th[id*=\"_cb\"]:first-child')\n\t\t\t\t\t.find('input.cbox[type=checkbox]').addClass('ace')\n\t\t\t\t\t.wrap('<label />').after('<span class=\"lbl align-top\" />');\n\t\t\t\t*/\n\t\t\t\t}", "title": "" }, { "docid": "da62ddbd5d4da3e0658c9214509f8f19", "score": "0.4917441", "text": "function checkBox(){ \n\t $('#accordion .card .card-body table thead tr th label.selection input.selectAll').click(function(e) {\n\t\tvar parentBox = e.target;\n\t if(!parentBox.classList.contains(\"view\") && !parentBox.classList.contains(\"add\") && !parentBox.classList.contains(\"edit\")){\n\t\tif ($(this).is(':checked')) {\n\t\t\t$(this).parents(\"thead\").next().find(\"tr td label.selection input.justOne:not(:disabled)\").prop('checked', true);\n\t\t} else {\n\t\t\t$(this).parents(\"thead\").next().find(\"tr td label.selection input.justOne:not(:disabled)\").prop('checked', false);\n\t\t}\n\t }\n\t else{ \n\t\tvar actionClass = parentBox.classList.item(1); \n\t\t if ($(this).is(':checked')) {\n\t\t\t\t$(this).parents(\"thead\").next().find(\"tr td label.selection input.justOne.\"+actionClass+\":not(:disabled)\").prop('checked', true); \n\t\t \n\t\t} else { \n\t\t\t$(this).parents(\"thead\").next().find(\"tr td label.selection input.justOne.\"+actionClass+\":not(:disabled)\").prop('checked', false);\n\t\t} \n\t }\n\t});\n\t\n\t$(\"#accordion .card .card-body table tbody tr td label.selection input.justOne\").change(function(e){\n\t\tvar childBox = e.target; \n\t\tif(!childBox.classList.contains(\"view\") && !childBox.classList.contains(\"add\") && !childBox.classList.contains(\"edit\")){\n\t\tvar total = $(this).parents(\"tbody\").find(\"label.selection input.justOne\").length; \n\t\tvar checked = $(this).parents(\"tbody\").find(\"label.selection input.justOne:checked\").length; \n\t\t\n\t\tif(total == checked){\n\t\t\t$(this).parents(\"tbody\").prev().find(\"label.selection input.selectAll\").prop('checked', true);\n\t\t}\n\t\telse {\n\t\t\t$(this).parents(\"tbody\").prev().find(\"label.selection input.selectAll\").prop('checked', false);\n\t\t}\n\t\t}\n\t\telse{ \n\t\t\tvar c_actionClass = childBox.classList.item(1); \n\t\t\tvar total = $(this).parents(\"tbody\").find(\"label.selection input.justOne.\"+c_actionClass+\":not(:disabled)\").length; \n\t\tvar checked = $(this).parents(\"tbody\").find(\"label.selection input.justOne.\"+c_actionClass+\":checked\").length; \n\t\t\n\t\tif(total == checked){\n\t\t\t$(this).parents(\"tbody\").prev().find(\"label.selection input.selectAll.\"+c_actionClass+\":not(:disabled)\").prop('checked', true);\n\t\t}\n\t\telse {\n\t\t\t$(this).parents(\"tbody\").prev().find(\"label.selection input.selectAll.\"+c_actionClass+\":not(:disabled)\").prop('checked', false);\n\t\t}\n\t\t} \n\t});\n}", "title": "" } ]
1dea626953fe284c5d9528663e35301f
Description This file implements notes for standard notation. This consists of one or more `NoteHeads`, an optional stem, and an optional flag. Throughout these comments, a "note" refers to the entire `StaveNote`, and a "key" refers to a specific pitch/notehead within a note. See `tests/stavenote_tests.js` for usage examples. To enable logging for this class. Set `Vex.Flow.StaveNote.DEBUG` to `true`.
[ { "docid": "819d2afb470777e0bf62dbbbc8c39833", "score": "0.61381006", "text": "function L() {\n\t\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t args[_key] = arguments[_key];\n\t\t }\n\t\t\n\t\t if (StaveNote.DEBUG) _vex.Vex.L('Vex.Flow.StaveNote', args);\n\t\t}", "title": "" } ]
[ { "docid": "5c90697edb3b0bdfb0a4122e1603d32c", "score": "0.6157083", "text": "function Note() {\n this.maintype = '';\n this.subtype = '';\n this.text = '';\n this.xml_id = '';\n this.custom = '';\n }", "title": "" }, { "docid": "66c6fd68c95312f1469b20363001719d", "score": "0.6072579", "text": "function Note(note_struct) {\n if (arguments.length > 0) this.init(note_struct);\n }", "title": "" }, { "docid": "3c94d626ea5b98d923540f87f0a5572a", "score": "0.6057096", "text": "function note(keys, duration, isBass) {\n // hack, manually translate treble location to bass location\n\n if (isBass) {\n var newKeys = [];\n // console.log(\"manually translating note \" + keys[0] + \" to bass clef\");\n // iterate through note array to modify keys\n for (var i = 0; i < keys.length; i++) {\n newKeys.push(translateTrebleToBass(keys[i]));\n }\n keys = newKeys;\n }\n return new Vex.Flow.StaveNote({ keys: keys, duration: duration.toString() });\n}", "title": "" }, { "docid": "4bf86c6c4eb017db5c45167a743263d0", "score": "0.57890445", "text": "function Note(props) {\n _classCallCheck(this, Note);\n\n return _possibleConstructorReturn(this, (Note.__proto__ || Object.getPrototypeOf(Note)).call(this, props));\n }", "title": "" }, { "docid": "6e346588151a84c2258952d8471cbf79", "score": "0.5765975", "text": "addNoteToStaff(pitchNum) {\n let pitch = pitchNumbertoStaffNote(pitchNum); \n let note = new VF.StaveNote({\n keys: [pitch.pitchClass + pitch.accidental + '/' + pitch.octave],\n duration: 'q',\n clef: 'treble'\n }).setContext(this.context)\n .setStave(this.stave);\n\n this.tickContext.addTickable(note);\n\n if (pitch.accidental) {\n note.addAccidental(0, new VF.Accidental(pitch.accidental));\n } else if (pitch.pitchClass == this.lastPitch.pitchClass &&\n this.lastPitch.accidental) {\n note.addAccidental(0, new VF.Accidental('n'));\n }\n\n note.preFormat();\n this.notes.push(note);\n\n const group = this.context.openGroup();\n this.visibleNoteGroups.push(group);\n note.draw();\n this.context.closeGroup();\n\n this.tickContext.x += this.noteSpacing;\n\n // Prepare for next pitch addition\n this.lastPitch = pitch;\n }", "title": "" }, { "docid": "c6f375b5bce66030ecab6d9fce315d79", "score": "0.5729637", "text": "function Note(title, content, date) {\n this.id;\n this.title = title || \"\";\n this.content = content || \"\";\n this.date = date || \"\";\n}", "title": "" }, { "docid": "7aec1663e4a40dfcc774fa77f6a15966", "score": "0.56183136", "text": "function exNote() { \n this.t = 0.0; \n this.midi = 60; \n\n this.fret = 0;\n this.string = -1; \n\n this.measure = 0; \n this.beatInMeasure = 0; \n\n this.tg = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; \n // 10 random things to remember\n // part#? difficulty? place in chord?\n}", "title": "" }, { "docid": "a1e78f9352e1863c349019db3b6adc03", "score": "0.55858856", "text": "function Note(noteId, content, status, week, batch,\n\t\t\t\t\ttrainee, maxVisibility, type, qcFeedback) {\n\t\t\t\tthis.noteId = noteId;\n\t\t\t\tthis.content = content;\n\t\t\t\tthis.week = week;\n\t\t\t\tthis.batch = batch;\n\t\t\t\tthis.trainee = trainee;\n\t\t\t\tthis.maxVisibility = maxVisibility;\n\t\t\t\tthis.type = type;\n\t\t\t\tthis.qcFeedback = qcFeedback;\n\t\t\t\tthis.qcStatus = status;\n\t\t\t}", "title": "" }, { "docid": "a1e67ff9329077627b1e6e3a1ff701fd", "score": "0.5543674", "text": "function Note(ptitle, pDetail, pPriority) {\n this.title= ptitle;\n this.detail = pDetail;\n this.priority = pPriority;\n }", "title": "" }, { "docid": "ce33fdc6444ecff7c61e6290f2221fc1", "score": "0.5504661", "text": "function Note(event) {\n this.keyValue = event.keyValue;\n this.tickstart = event.tickstart;\n this.tickduration = event.tickduration;\n this.velocity = event.velocity;\n this.color = event.color;\n this.outlinecolor = event.outlinecolor;\n this.ID = event.ID;\n this.rnote = event.rnote;\n this.isValid = event.isValid;\n this.Xoffset = event.Xoffset;\n}", "title": "" }, { "docid": "514199ca6f4aa0fb37340ea02bcd3abb", "score": "0.5422772", "text": "playNote() {\n const noteNumber = this.getNoteNumber();\n const velocity = this.getVelocity();\n const duration = this.getDuration();\n\n playNote({ note: noteNumber, velocity, channel: this.channel, duration });\n\n this.addOnNote(noteNumber, duration);\n const lines = [\n ``,\n `address: ${this.getAddress()}`,\n `note: ${noteNumber}`,\n `velocity: ${velocity}`,\n `channel: ${this.channel}`,\n `duration: ${duration}`,\n `rootOffset: ${this.rootManager.getOffset()}`,\n ``,\n `*******************************************`,\n ];\n console.log(lines.join('\\n'));\n }", "title": "" }, { "docid": "c1f748762e57aa1990d016c1215624e4", "score": "0.5341321", "text": "function notes(options) {\r\n this.options = (options === undefined) ? {} : options;\r\n\r\n this.setAttributes();\r\n}", "title": "" }, { "docid": "436034131957cc216e7ff6797471a661", "score": "0.5226363", "text": "function Note(id, note, time){\n\tthis.id = id;\n\tthis.note = note;\n\tthis.time = time;\n}", "title": "" }, { "docid": "15c9a59af90443740dbd6c222af916d7", "score": "0.5205385", "text": "addTargetMelodyToStaff(targetNotes) {\n let pitch, note;\n this.notes = [];\n for (let n = 0; n < targetNotes.length; n++) {\n console.log(targetNotes[n] + 60);\n pitch = pitchNumbertoStaffNote(targetNotes[n]+ 60); \n note = new VF.StaveNote({\n keys:[pitch.pitchClass + pitch.accidental + '/' + pitch.octave],\n duration: 'q',\n clef: 'treble'\n });\n\n if (pitch.accidental) {\n note.addAccidental(0, new VF.Accidental(pitch.accidental));\n } else if (pitch.pitchClass == this.lastPitch.pitchClass\n && this.lastPitch.accidental) {\n note.addAccidental(0, new VF.Accidental('n'));\n }\n\n this.notes.push(note);\n this.lastPitch = pitch;\n }\n console.log(this.notes);\n this.voice = new VF.Voice({\n num_beats: targetNotes.length,\n beat_value: 4\n });\n this.voice.addTickables(this.notes);\n const formatter = new VF.Formatter()\n .joinVoices([this.voice])\n .format([this.voice], 200);\n this.visibleNoteGroup = this.context.openGroup();\n\n this.voice.draw(this.context, this.stave);\n this.context.closeGroup();\n this.loaded = true;\n }", "title": "" }, { "docid": "9f2477df92a40481ff18186c035974d0", "score": "0.51973444", "text": "function formatSciNote(value, flags, block)\n{\n\t// Determine the number of significant figures to use\n\tvar sigFigs = getSNSigFigs(value, flags, block);\n\n\t// Convert the value to a string in scientific notation, with the desired number\n\t// of significant figures\n\tvar str = sciNoteString(value, sigFigs);\n\n\t// If the string ends in \"e0\", remove it. It's redundant.\n\t// Note that any trailing zeroes created due to significant figures will be maintained\n\tstr = removeE0(str);\n\n\t// Remove the plus from positive exponents (e.g., 3e+5 -> 3e5)\n\treturn fixPositiveExponents(str);\n}", "title": "" }, { "docid": "8e49abbf96805fa52552d91cfb439f0a", "score": "0.51808405", "text": "function createNote(note) {\n\tnoteStore.createNote(note, function(err, createdNote) {\n\t\tconsole.log();\n\t\tconsole.log(\"Creating a new note in the default notebook\");\n\t\tconsole.log();\n\t\tconsole.log(\"Successfully created a new note with GUID: \" + createdNote.guid);\n\t});\n}", "title": "" }, { "docid": "7c2d431ff691fb14af57f163a84d547f", "score": "0.5173682", "text": "handler(argv) {\n notes.addNote(argv.title, argv.body)\n }", "title": "" }, { "docid": "d09e889e1a724fe054daf72ba0bb5ec6", "score": "0.51594913", "text": "function Note(freq, duration, block){\n\n\tthis.freq = freq;\n\tthis.duration = duration;\n\tthis.block = new ElementNode(block);\n\n}", "title": "" }, { "docid": "6071e78225cdf61499b7f4587ba43549", "score": "0.5134851", "text": "get note () {\r\n\t\treturn this._note;\r\n\t}", "title": "" }, { "docid": "dce538ed813607bdb7d3226b5535107e", "score": "0.5127533", "text": "function Notes(notes) {\n notes.forEach(Note.validate)\n this._notes = notes\n}", "title": "" }, { "docid": "d919be3731ccd72f0a8414f95b83adc3", "score": "0.5117139", "text": "constructor(note) {\n super();\n this.rest = note.rest;\n this.chord = note.chord;\n this.divisions = note.divisions;\n this.duration = note.duration;\n this.pitch = note.pitch;\n }", "title": "" }, { "docid": "700527ebb8e8f58aff74259635b13c64", "score": "0.5092182", "text": "get note () {\n\t\treturn this._note;\n\t}", "title": "" }, { "docid": "700527ebb8e8f58aff74259635b13c64", "score": "0.5092182", "text": "get note () {\n\t\treturn this._note;\n\t}", "title": "" }, { "docid": "700527ebb8e8f58aff74259635b13c64", "score": "0.5092182", "text": "get note () {\n\t\treturn this._note;\n\t}", "title": "" }, { "docid": "1df7043fc65bcd022af9705262438715", "score": "0.50915337", "text": "handler(argv){ \n notesUtils.addNote(argv.title, argv.body)\n }", "title": "" }, { "docid": "330fc88b66fa0f5e8187c5e7b9dc4f07", "score": "0.5089305", "text": "function showNote (noteObj) {\n\t\tsb.fadeInView(\"#displayNote\");\n\t\tsb.insertData(noteObj.title, titleBar);\n\t\tsb.insertData(noteObj.description, descriptionArea);\n\t}", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5075544", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5075544", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5075544", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "8253a51f7d7c7169dc764cc7aa2bb5cf", "score": "0.50672203", "text": "function L() {\n\t\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t args[_key] = arguments[_key];\n\t\t }\n\t\t\n\t\t if (NoteHead.DEBUG) _vex.Vex.L('Vex.Flow.NoteHead', args);\n\t\t}", "title": "" }, { "docid": "9c78ded7a9f5bc4a67941149c3cdfd04", "score": "0.50633013", "text": "function checkSciNote(value, flags)\n{\n\t// Highest priority: SN flag.\n\tif (typeof flags.SN !== 'undefined')\n\t\treturn (flags.SN === 'T' || flags.SN === 'TRUE' || flags.SN === 'Y')\n\n\t// Check the ruleset to determine how to proceed next\n\tif (ruleSets[curRules].sciNoteByMag)\n\t\treturn (Math.abs(value) >= snRules.useSNAtOrAbove) ||\n\t\t\t (Math.abs(value) < snRules.useSNBelow)\n\n\t// Finally, the default. Don't use scientific notation.\n\treturn false;\n}", "title": "" }, { "docid": "e3b862204ef2419361f9f35e16d3523c", "score": "0.50538975", "text": "function notes(ctx, node, _index, parent) {\n var macro = ctx.footnote || defaultMacro$4;\n var protect = !!node.inHeading;\n var identifier = autoId(node);\n return macro(identifier, all_1(ctx, node).trim(), protect);\n}", "title": "" }, { "docid": "2cd044901f3af58f27b32e0c4a71cca8", "score": "0.50516534", "text": "function logNote(message)\n {\n if (log && logging && takeNotes)\n log.write(\"Note: \" + message);\n }", "title": "" }, { "docid": "9f87fd84c626fc81763e03fbe463b664", "score": "0.50500345", "text": "function noteToString(note, offset)\n{\n \n //Determine representation for note\n var writtenNote = note + offset;\n var octave = Math.floor(writtenNote / 12)-1;//60 (middleC) maps to octave 4\n var pitchClass = writtenNote % 12;\n\n //here's the base note\n var writtenNoteString = pitchClassNames[pitchClass];\n \n //if offset is negative then just add sharps\n if(offset < 0){\n for(var i = 0; i < -offset; i++){\n writtenNoteString = writtenNoteString.concat(\"#\");\n }\n }\n else if(offset > 0){\n if(writtenNoteString.length == 2){\n //start by stripping sharp\n writtenNoteString = writtenNoteString.charAt(0);\n for(var i = 0; i < (offset-1); i++){\n writtenNoteString = writtenNoteString.concat(\"b\");\n }\n }\n else{//no starting sharp so just add that many flats\n for(var i = 0; i < offset; i++){\n writtenNoteString = writtenNoteString.concat(\"b\");\n }\n }\n }\n \n //add octave string\n writtenNoteString = writtenNoteString.concat(\"/\",octave);\n \n return writtenNoteString;\n}", "title": "" }, { "docid": "be1803cd6708fa38940cf83c371834e0", "score": "0.50040907", "text": "function genStave(stave, measures){\n var genString = \"\";\n var curLineLength = 0; //current number of notes in line (to keep track of when to start new line)\n var m = measures;\n while (m > 0){\n var measure = genMeasure(stave);\n m--;\n genString = genString + measure.measureString;\n curLineLength += measure.numNotes;\n\n //start new line if we're past MAX_LINE_LENGTH, but only if we have some measures left.\n if (curLineLength >= MAX_LINE_LENGTH && m > 0){\n curLineLength = 0;\n genString = genString + \"\\n\";\n }\n }\n return genString;\n }", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "6474dca4adfe8f4a6b3993bf12808e2b", "score": "0.49950215", "text": "function parse_NoteSh(blob, length, opts) {\n\tif(opts.biff < 8) return;\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\tif(opts.biff < 8) blob.read_shift(1);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}", "title": "" }, { "docid": "4b14be232202d8c4b7b7ddd1badfced0", "score": "0.49948636", "text": "function exNoteList() {\n this.ns = []; // notes\n}", "title": "" }, { "docid": "c6b4fbff48c1dca0b0b27c3a21554162", "score": "0.49856514", "text": "static getDefaultNotes(params) {\n let beamBeats = 0;\n let beats = 0;\n let i = 0;\n let ticks = {\n numerator: 4096,\n denominator: 1,\n remainder: 0\n };\n if (params === null) {\n params = {};\n }\n params.timeSignature = params.timeSignature ? params.timeSignature : '4/4';\n params.clef = params.clef ? params.clef : 'treble';\n const meterNumbers = params.timeSignature.split('/').map(number => parseInt(number, 10));\n beamBeats = ticks.numerator;\n beats = meterNumbers[0];\n if (meterNumbers[1] === 8) {\n ticks = {\n numerator: 2048,\n denominator: 1,\n remainder: 0\n };\n if (meterNumbers[0] % 3 === 0) {\n ticks.numerator = 2048 * 3;\n beats = meterNumbers[0] / 3;\n }\n beamBeats = 2048 * 3;\n }\n const pitches =\n JSON.parse(JSON.stringify(SmoMeasure.defaultPitchForClef[params.clef]));\n const rv = [];\n\n // Treat 2/2 like 4/4 time.\n if (meterNumbers[1] === 2) {\n beats = beats * 2;\n }\n\n for (i = 0; i < beats; ++i) {\n const note = new SmoNote({\n clef: params.clef,\n pitches: [pitches],\n ticks,\n timeSignature: params.timeSignature,\n beamBeats,\n noteType: SmoMeasure.emptyMeasureNoteType\n });\n rv.push(note);\n }\n return rv;\n }", "title": "" }, { "docid": "7c3d2f83186d5c8f6af6315436ca81a2", "score": "0.4969094", "text": "function displayNote(note) {\n \n}", "title": "" }, { "docid": "5a7e7a3e9e03022899920d20dcd13a50", "score": "0.49657714", "text": "handler(argv) {\n\t\tnotes.addNote(argv.title, argv.body);\n\t}", "title": "" }, { "docid": "9a9c50b612aa435a13d5c1eacac5493a", "score": "0.495169", "text": "function parse_NoteSh(blob, length, opts) {\n if (opts.biff < 8) return;\n var row = blob.read_shift(2),\n col = blob.read_shift(2);\n var flags = blob.read_shift(2),\n idObj = blob.read_shift(2);\n var stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n if (opts.biff < 8) blob.read_shift(1);\n return [{\n r: row,\n c: col\n }, stAuthor, idObj, flags];\n }", "title": "" }, { "docid": "d42b6d14d47979dab4fef27beda42507", "score": "0.49390578", "text": "function addNameNote(strName, strNote) {\n log(\"functiontrace\", \"Start Function\");\n if (strNote.trim() === \"\") {\n delete nameNotes[strName];\n }\n else {\n var nameNote = {};\n nameNote.id = strName;\n nameNote.note = strNote;\n nameNotes[strName] = nameNote;\n }\n}", "title": "" }, { "docid": "c27ec5f6f8660c408204122fd81cbc0d", "score": "0.49214974", "text": "static getDefaultNotes(params) {\n\t\tif (params == null) {\n\t\t\tparams = {};\n\t\t}\n\t\tparams.timeSignature = params.timeSignature ? params.timeSignature : '4/4';\n\t\tparams.clef = params.clef ? params.clef : 'treble';\n\t\tvar meterNumbers = params.timeSignature.split('/').map(number => parseInt(number, 10));\n\t\tvar ticks = {\n\t\t\tnumerator: 4096,\n\t\t\tdenominator: 1,\n\t\t\tremainder: 0\n\t\t};\n var beamBeats = ticks.numerator;\n\t\tif (meterNumbers[1] == 8) {\n\t\t\tticks = {\n\t\t\t\tnumerator: 2048,\n\t\t\t\tdenominator: 1,\n\t\t\t\tremainder: 0\n\t\t\t};\n beamBeats = 2048*3;\n\t\t}\n\t\tvar pitches =\n JSON.parse(JSON.stringify(SmoMeasure.defaultPitchForClef[params.clef]));\n\t\tvar rv = [];\n var beats = meterNumbers[0];\n\n // Treat 2/2 like 4/4 time.\n if (meterNumbers[1] == 2) {\n beats = beats * 2;\n }\n\n\t\tfor (var i = 0; i < beats; ++i) {\n\t\t\tvar note = new SmoNote({\n\t\t\t\tclef: params.clef,\n\t\t\t\tpitches: [pitches],\n\t\t\t\tticks: ticks,\n\t\t\t\ttimeSignature: params.timeSignature,\n beamBeats:beamBeats,\n noteType:'r'\n\t\t\t});\n\t\t\trv.push(note);\n\t\t}\n\t\treturn rv;\n\t}", "title": "" }, { "docid": "9b99f348a02047321e57d4fbefae5113", "score": "0.49112472", "text": "function writeNote(notes){\n notes = JSON.stringify(notes);\n fs.writeFileSync(\"./db/db.json\", notes, function(err){\n if(err){\n return console.log(err);\n }\n });\n }", "title": "" }, { "docid": "78552968466a328cbc0a0814889511d0", "score": "0.48839554", "text": "function onUpdateNote(index, note) {\n globals.notes.splice(index, 1);\n globals.notes = mergeNotes(globals.notes, [note]);\n notedisplay.showNotes(globals.notes, globals.audioBuffer);\n }", "title": "" }, { "docid": "aa27662c9dd9c4d1c6502b506719490e", "score": "0.48828977", "text": "function GetNote(stringIndex){\n //Store random note\n var note = modeNotes[stringIndex][(Math.random() * modeNotes.length) | 0];\n\n //This conditional adds a dash if the note is a single character\n //Else, if the note pulles is -1, then it's changed to '--'\n if (note.toString().length < 2){\n note = `${note}-`;\n } else if (note == -1){\n note = \"--\";\n }\n return note;\n}", "title": "" }, { "docid": "20d10882626773df8a2db6e32955f31c", "score": "0.48812047", "text": "function synth(frequency, noteIndex, period)\n{\n //for toggle\n globalNoteIndex = noteIndex;\n //for detune\n globalFrequency = frequency;\n //for colorDetune\n referencePitches[globalNoteIndex] = globalFrequency;\n \n //variable we'll use to reference this synth\n var synth;\n \n //if this key already has a synth, use that one\n if (synths[noteIndex] != null)\n {\n synth = synths[noteIndex];\n } \n else \n { \n //otherwise, make a new Tone.Synth object and add it to the array\n synth = new Tone.Synth().toDestination();\n synths[noteIndex] = synth;\n }\n\n //if edit on\n if (document.getElementById('edit').value == '{edit on}')\n {\n var periodLock = priorEditIndex;\n while (periodLock < keys.length)\n {\n if (periodLock % period == 0)\n {\n keys[periodLock].classList.remove('editPeriod');\n }\n else \n {\n keys[periodLock].classList.remove('edit');\n }\n periodLock += period;\n }\n\n //set index for next edit(modulo the period to index by the first period)\n priorEditIndex = noteIndex % period;\n \n\n //loop to lock octaves, starting from lowest period \n periodLock = noteIndex % period;\n while (periodLock < keys.length)\n {\n \n if (periodLock % period == 0)\n {\n\n keys[periodLock].classList.add('editPeriod');\n }\n else\n {\n keys[periodLock].classList.add('edit');\n }\n periodLock += period;\n }\n \n //return without triggering synth\n return;\n }\n //if edit off\n else\n {\n //if sustain on\n if (document.getElementById('sustain').value == '{sustain on}')\n {\n //if uninitialized\n if (sustain[noteIndex] == null)\n {\n //update css class\n ////if special case (modulo the size of pitch class set)\n if(noteIndex % period == 0)\n {\n keys[noteIndex].classList.add('periodPushed');\n }\n //base case\n else\n {\n keys[noteIndex].classList.add('pushed');\n }\n\n //update index of sustaining pitches\n sustain[noteIndex] = true; \n\n //trigger oscilator\n synth.triggerAttack(frequency);\n\n //initialize synth, and push into indexed array,\n \n synths[noteIndex] = synth;\n\n }\n //if note already sustaining\n else\n {\n //if special case (modulo the period)\n if(noteIndex % period == 0)\n {\n keys[noteIndex].classList.remove('periodPushed');\n }\n\n //base case\n else\n {\n keys[noteIndex].classList.remove('pushed');\n }\n\n //turn note off, index null\n sustain[noteIndex] = null;\n synths[noteIndex].triggerRelease();\n }\n\n //if sustain is off, give trigger attack-release\n }\n else\n {\n synth.triggerAttackRelease(frequency, '4n');\n }\n }\n}", "title": "" }, { "docid": "c476f180afbf6a99facfdf7ffcb6eb90", "score": "0.48795247", "text": "function saveNote(title, content){\n\t\t\t\t//define a note\n\t\t\t\tvar note = {\n\t\t\t\t\ttitle:title,\n\t\t\t\t note:content\n\t\t\t\t}\n\t\t\t\t// create transaction\n\t\t\t\tvar dbTransaction = db.transaction([\"422os\"],\"readwrite\");\n\t\t\t\t// define data object store\n\t\t\t\tvar dataStore = dbTransaction.objectStore(\"422os\");\n\t\t\t\t// add data to store\n\t\t\t\tvar addRequest = dataStore.add(note);\n\t\t\t\t// success handler\n\t\t\t\taddRequest.onsuccess = function(e) {\n\t\t\t\t console.log(\"data stored...\");\n\t\t\t\t // do something...\n\t\t\t\t}\n\t\t\t\t// error handler\n\t\t\t\taddRequest.onerror = function(e) {\n\t\t\t\tconsole.log(e.target.error.name);\n\t\t\t\t// handle error...\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "04c6cf77aa95ff2e400ff1529a0654c7", "score": "0.4869025", "text": "notesTrack(section, notes) {\n var blankTrack = htmlFuncs.blankNotesTrack(section);\n ui.insertNotes(blankTrack, notes); // Shouldn't have a dependency on ui, must restructure this later\n return blankTrack;\n }", "title": "" }, { "docid": "9e6992ae298097335d9d78f9ebf04cf9", "score": "0.4859953", "text": "constructor(name, note) {\n this.Name = name !== null && name !== void 0 ? name : 'Undefined';\n this.Note = note !== null && note !== void 0 ? note : 'This is as mysterious as it gets.';\n }", "title": "" }, { "docid": "eca5418863b57efe73f3d1366ecd0abc", "score": "0.48588097", "text": "function addNotesFromText(line){\n\n// var instrument = (Math.floor((Math.random()*119)+1));\n// track.setInstrument(10,instrument.toString(16));\n\n Object.keys(line.chars).forEach(function(key) {\n\n var velocity = Math.floor((((line.chars[key]/line.charsTotal)*100)/100)*128) -1;\n if(velocity < 40) {\n velocity = 100 - velocity;\n }\n\n var rand = (Math.floor((Math.random()*8)+1)) - 1;\n\n console.log(\"Note on [0, \" + scale[key.toLowerCase()] + \", \" + rand*64 + \", \" + velocity + \" ]\");\n\n if( S(key).isUpper() ){\n track.addNoteOn(0, scale[key.toLowerCase()], rand*64 , velocity);\n } else {\n track.addNoteOn(0, scale[key.toLowerCase()], 0, velocity);\n\n }\n\n//// console.log(\"Node off [0, \" + scale[key] + \", \" + 64 * line.chars[key] + \" ]\");\n//\n// track.addNoteOff(0, scale[key.toLowerCase()], 64 * line.chars[key]);\n });\n\n Object.keys(line.chars).forEach(function(key) {\n\n if( S(key).isUpper() ){\n //track.addNoteOff(0, scale[key.toLowerCase()], 64 * line.chars[key]);\n } else {\n track.addNoteOff(0, scale[key.toLowerCase()]);\n\n }\n });\n\n\n}", "title": "" }, { "docid": "245911968ddb2223e410239e96d4af29", "score": "0.4857841", "text": "set note(note) {\n\t\tif (Array.isArray(note)) {\n\t\t\tthis._note = note.map((i) => new Annotation(i));\n\t\t} else {\n\t\t\tthis._note = [new Annotation(note)];\n\t\t}\n\t}", "title": "" }, { "docid": "b71dc3f5fd5e003781de0e7f7b52c106", "score": "0.48567185", "text": "async writeNotes(note) {\n //update to read first and then add new note with id\n await writeFileAsync(\"db/db.json\", JSON.stringify(note))\n //reads new notes\n const notes = await this.readNotes()\n\n console.log(notes);\n return\n }", "title": "" }, { "docid": "79cbcf33e8581f4f96bf858942abb286", "score": "0.48530328", "text": "function readNoteTag(note, mode) {\n let option = {};\n // set defaults\n option[\"SEED\"] = undefined;\n\n option[\"ADD_A_OBJ\"] = true;\n option[\"ADD_W_OBJ\"] = true;\n option[\"ADD_U_OBJ\"] = true;\n option[\"ADD_WALL\"] = true;\n option[\"ADD_TREE\"] = true;\n\n option[\"BLOCK_A_OBJ_X\"] = 10;\n option[\"BLOCK_A_OBJ_Y\"] = 10;\n option[\"BLOCK_W_OBJ_X\"] = 5;\n option[\"BLOCK_W_OBJ_Y\"] = 5;\n option[\"BLOCK_U_OBJ_X\"] = 10;\n option[\"BLOCK_U_OBJ_Y\"] = 10;\n option[\"BLOCK_WALL_X\"] = 10;\n option[\"BLOCK_WALL_Y\"] = 10;\n\n option[\"LIMIT_U_OBJ\"] = 1;\n option[\"LIMIT_A_OBJ\"] = 2;\n option[\"LIMIT_W_OBJ\"] = 3;\n option[\"LIMIT_WALL\"] = 4;\n option[\"LIMIT_TREE\"] = 5;\n\n option[\"SHIELD_MAX_DEPTH\"] = 4;\n option[\"SHIELD_RELIEF_X\"] = 20;\n option[\"SHIELD_RELIEF_Y\"] = 20;\n option[\"TERRACE_MAX_DEPTH\"] = 4;\n option[\"TERRACE_RELIEF_X\"] = 10;\n option[\"TERRACE_RELIEF_Y\"] = 10;\n\n option[\"TREE_DENSITY_X\"] = 6;\n option[\"TREE_DENSITY_Y\"] = 6;\n option[\"TREE_SIZE\"] = 25;\n\n option[\"DUNGEON_SYMMETRY\"] = false;\n\n option[\"FIELD_TYPE\"] = \"shield\";\n option[\"TERRACE_DEFORM\"] = 8;\n\n let notedata = note.split(/[\\r\\n]+/);\n for (let i=0; i<notedata.length; i++) {\n let line = notedata[i];\n if (line.match(/<SEED:[ ]*(\\d+)>/i)) { option[\"SEED\"] = parseInt(RegExp.$1); }\n\n if (line.match(/<ADD_ALL:[ ]*(?:OFF|FALSE)>/i)) { \n option[\"ADD_A_OBJ\"] = false;\n option[\"ADD_W_OBJ\"] = false;\n option[\"ADD_U_OBJ\"] = false;\n option[\"ADD_WALL\"] = false;\n option[\"ADD_TREE\"] = false;\n }\n if (line.match(/<ADD_A_OBJ:[ ]*(?:OFF|FALSE)>/i)) { option[\"ADD_A_OBJ\"] = false;}\n if (line.match(/<ADD_W_OBJ:[ ]*(?:OFF|FALSE)>/i)) { option[\"ADD_W_OBJ\"] = false;}\n if (line.match(/<ADD_WALL:[ ]*(?:OFF|FALSE)>/i)) { option[\"ADD_WALL\"] = false;}\n if (line.match(/<ADD_U_OBJ:[ ]*(?:OFF|FALSE)>/i)) { option[\"ADD_U_OBJ\"] = false;}\n if (line.match(/<ADD_TREE:[ ]*(?:OFF|FALSE)>/i)) { option[\"ADD_TREE\"] = false;}\n\n if (line.match(/<BLOCK_A_OBJ:[ ]*(\\d+)>/i)) { option[\"BLOCK_A_OBJ_X\"] = parseInt(RegExp.$1); option[\"BLOCK_A_OBJ_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_A_OBJ_X:[ ]*(\\d+)>/i)) { option[\"BLOCK_A_OBJ_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_A_OBJ_Y:[ ]*(\\d+)>/i)) { option[\"BLOCK_A_OBJ_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_W_OBJ:[ ]*(\\d+)>/i)) { option[\"BLOCK_W_OBJ_X\"] = parseInt(RegExp.$1); option[\"BLOCK_W_OBJ_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_W_OBJ_X:[ ]*(\\d+)>/i)) { option[\"BLOCK_W_OBJ_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_W_OBJ_Y:[ ]*(\\d+)>/i)) { option[\"BLOCK_W_OBJ_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_U_OBJ:[ ]*(\\d+)>/i)) { option[\"BLOCK_U_OBJ_X\"] = parseInt(RegExp.$1); option[\"BLOCK_U_OBJ_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_U_OBJ_X:[ ]*(\\d+)>/i)) { option[\"BLOCK_U_OBJ_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_U_OBJ_Y:[ ]*(\\d+)>/i)) { option[\"BLOCK_U_OBJ_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_WALL:[ ]*(\\d+)>/i)) { option[\"BLOCK_WALL_X\"] = parseInt(RegExp.$1); option[\"BLOCK_WALL_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_WALL_X:[ ]*(\\d+)>/i)) { option[\"BLOCK_WALL_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<BLOCK_WALL_Y:[ ]*(\\d+)>/i)) { option[\"BLOCK_WALL_Y\"] = parseInt(RegExp.$1);}\n\n if (line.match(/<LIMIT_A_OBJ:[ ]*(\\d+)>/i)) { option[\"LIMIT_A_OBJ\"] = parseInt(RegExp.$1);}\n if (line.match(/<LIMIT_W_OBJ:[ ]*(\\d+)>/i)) { option[\"LIMIT_W_OBJ\"] = parseInt(RegExp.$1);}\n if (line.match(/<LIMIT_U_OBJ:[ ]*(\\d+)>/i)) { option[\"LIMIT_U_OBJ\"] = parseInt(RegExp.$1);}\n if (line.match(/<LIMIT_WALL:[ ]*(\\d+)>/i)) { option[\"LIMIT_WALL\"] = parseInt(RegExp.$1);}\n if (line.match(/<LIMIT_TREE:[ ]*(\\d+)>/i)) { option[\"LIMIT_TREE\"] = parseInt(RegExp.$1);}\n\n if (line.match(/<RELIEF:[ ]*(\\d+)>/i)){\n option[\"SHIELD_RELIEF_X\"] = parseInt(RegExp.$1);\n option[\"SHIELD_RELIEF_Y\"] = parseInt(RegExp.$1);\n option[\"TERRACE_RELIEF_X\"] = parseInt(RegExp.$1);\n option[\"TERRACE_RELIEF_Y\"] = parseInt(RegExp.$1);\n }\n if (line.match(/<RELIEF_X:[ ]*(\\d+)>/i)){\n option[\"SHIELD_RELIEF_X\"] = parseInt(RegExp.$1);\n option[\"TERRACE_RELIEF_X\"] = parseInt(RegExp.$1);\n }\n if (line.match(/<RELIEF_Y:[ ]*(\\d+)>/i)){\n option[\"SHIELD_RELIEF_Y\"] = parseInt(RegExp.$1);\n option[\"TERRACE_RELIEF_Y\"] = parseInt(RegExp.$1);\n }\n if (line.match(/<SHIELD_RELIEF:[ ]*(\\d+)>/i)){\n option[\"SHIELD_RELIEF_X\"] = parseInt(RegExp.$1);\n option[\"SHIELD_RELIEF_Y\"] = parseInt(RegExp.$1);\n }\n if (line.match(/<SHIELD_RELIEF_X:[ ]*(\\d+)>/i)){option[\"SHIELD_RELIEF_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<SHIELD_RELIEF_Y:[ ]*(\\d+)>/i)){option[\"SHIELD_RELIEF_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<TERRACE_RELIEF:[ ]*(\\d+)>/i)){\n option[\"TERRACE_RELIEF_X\"] = parseInt(RegExp.$1);\n option[\"TERRACE_RELIEF_Y\"] = parseInt(RegExp.$1);\n }\n if (line.match(/<TERRACE_RELIEF_X:[ ]*(\\d+)>/i)){option[\"TERRACE_RELIEF_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<TERRACE_RELIEF_Y:[ ]*(\\d+)>/i)){option[\"TERRACE_RELIEF_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<MAX_DEPTH:[ ]*(\\d+)>/i)) { option[\"SHIELD_MAX_DEPTH\"] = option[\"TERRACE_MAX_DEPTH\"] = parseInt(RegExp.$1);}\n if (line.match(/<SHIELD_MAX_DEPTH:[ ]*(\\d+)>/i)) { option[\"SHIELD_MAX_DEPTH\"] = parseInt(RegExp.$1);}\n if (line.match(/<TERRACE_MAX_DEPTH:[ ]*(\\d+)>/i)) { option[\"TERRACE_MAX_DEPTH\"] = parseInt(RegExp.$1);}\n\n if (line.match(/<TREE_DENSITY:[ ]*(\\d+)>/i)) { option[\"TREE_DENSITY_X\"] = parseInt(RegExp.$1); option[\"TREE_DENSITY_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<TREE_DENSITY_X:[ ]*(\\d+)>/i)) { option[\"TREE_DENSITY_X\"] = parseInt(RegExp.$1);}\n if (line.match(/<TREE_DENSITY_Y:[ ]*(\\d+)>/i)) { option[\"TREE_DENSITY_Y\"] = parseInt(RegExp.$1);}\n if (line.match(/<TREE_SIZE:[ ]*(\\d+)>/i)) { option[\"TREE_SIZE\"] = parseInt(RegExp.$1);}\n\n if (line.match(/<DUNGEON_SYMMETRY:[ ]*(?:ON|TRUE)>/i)) { option[\"DUNGEON_SYMMETRY\"] = true;}\n\n if (line.match(/<FIELD_TYPE:[ ]*(?:TERRACE)>/i)) { option[\"FIELD_TYPE\"] = \"terrace\";}\n if (line.match(/<FIELD_TYPE:[ ]*(?:MIX)>/i)) { option[\"FIELD_TYPE\"] = \"mix\";}\n if (line.match(/<TERRACE_DEFORM:[ ]*(\\d+)>/i)) { option[\"TERRACE_DEFORM\"] = parseInt(RegExp.$1);}\n }\n return option;\n }", "title": "" }, { "docid": "45aa614cb90678fcaa1686765b5d8a2b", "score": "0.48479515", "text": "function JSXNote(props) {\n var note = props.note,\n dx = props.dx,\n dy = props.dy,\n editMode = props.editMode,\n dragStart = props.dragStart,\n dragEnd = props.dragEnd,\n dragNote = props.dragNote;\n var handle;\n\n if (editMode) {\n handle = _react.default.createElement(_Handle.default, {\n handleStart: dragStart,\n handleStop: dragEnd,\n handleDrag: dragNote\n });\n }\n\n return _react.default.createElement(\"g\", {\n className: \"annotation-note\",\n transform: \"translate(\".concat(dx, \", \").concat(dy, \")\")\n }, typeof note === \"function\" ? note(props) : note, handle);\n}", "title": "" }, { "docid": "96ed7dac0aadbf6f685fad1a14a1420e", "score": "0.483723", "text": "function NoteList() {\n this._notes = [];\n }", "title": "" }, { "docid": "6f029efc8c124a035ccc2331e00fbe26", "score": "0.48187584", "text": "function createNote(noteTitle, noteContent) {\n return {\n id: Date.now().toString(),\n pinned: false,\n archived: false,\n title: noteTitle,\n content: noteContent\n }\n}", "title": "" }, { "docid": "d9f190763132a1f070feaaea47b3019f", "score": "0.48161605", "text": "constructor(params) {\n Vex.Merge(this, SmoNote.defaults);\n smoSerialize.serializedMerge(SmoNote.parameterArray, params, this);\n\n // this.keys=JSON.parse(JSON.stringify(this.keys));\n\n if (!this['attrs']) {\n this.attrs = {\n id: VF.Element.newID(),\n type: 'SmoNote'\n };\n } else {\n // inherit attrs id for deserialized\n }\n }", "title": "" }, { "docid": "dc0e25d9f499940611ae6e1c8b09317c", "score": "0.48140338", "text": "function saveNotes(notes) {\n fs.writeFileSync('data/notes-data.json', JSON.stringify(notes));\n}", "title": "" }, { "docid": "bcd4374002b22109d31f3c72ad699061", "score": "0.4812793", "text": "addNote(note) {\n return this.read()\n .then(data => JSON.parse(data))\n .then(notes =>\n [...notes, note]\n ).then((newnotes) =>\n this.write(newnotes),\n );\n }", "title": "" }, { "docid": "24c996339bade89e915cbe9dc159e20a", "score": "0.4807837", "text": "updateNote(note) {\n\t\tnote.shortCut = note.content ? note.content.substr(0, 10) : ''\n\t\tnote.updatedAt = new Date()\n\t\tlet obj = {}\n\t\tobj[note.id] = note\n\t\tstate.notes = Object.assign({}, state.notes, obj)\n\t\tstate.editing = false\n\t\t\n\t\tstate.total = Object.keys(state.notes).length\n\n\t\tthis.syncNote(note.id)\n\t\tthis.syncSnapshot()\n\t}", "title": "" }, { "docid": "f79368b5ea17dd13088f0100ff885ca0", "score": "0.48005137", "text": "function createNote() {\n let title = document.getElementById(\"note-title\").value,\n body = document.getElementById(\"note-body\").value;\n title = sanitize(title, true);\n body = sanitize(body);\n\n if (title === \"\" || body === \"\") return; // if title or body are empty, do nothing\n\n currentNoteIndex = notes.index;\n notes.add(title, body);\n notes.save();\n formContainerNode.innerHTML = \"\";\n createNoteList();\n printNote(currentNoteIndex);\n selectNote(currentNoteIndex);\n }", "title": "" }, { "docid": "d37899282ae16dbca53a13b43fd1ad18", "score": "0.47989923", "text": "function FootNote(id, verseId, content) {\n // Public properties, assigned to the instance ('this')\n this.id = id;\n this.verseId = verseId;\n this.content = content;\n }", "title": "" }, { "docid": "401e9e9ed4b4d07fc9385ca0bdb52db6", "score": "0.47837782", "text": "function loadDocument(note) {\n\n if (note === null) return;\n\n $(\"#note_title\").val(note.title);\n $(\"#note_body\").val(note.body);\n\n $(\"#word_count\").text(countWords(note.body));\n\n if (note.title !== \"\") {\n document.title = `simple note - ${note.title}`;\n }\n\n}", "title": "" }, { "docid": "cb930474b9d928c15529d98a6ccf5f38", "score": "0.47759622", "text": "function genRandomNote(stave, poly){\n var noteString = \"[\";\n\n //stores midi representation of notes\n var notes = [];\n\n var absMinPitch, absMaxPitch;\n absMinPitch = stave.absRange[0];\n absMaxPitch = stave.absRange[1];\n \n //add notes 'poly' times\n while (poly > 0){\n poly--;\n \n //loop until we find a note that isn't in note array yet\n var posNote = randInt(absMaxPitch - absMinPitch + 1) + absMinPitch;\n while (notes.indexOf(posNote) > -1){\n posNote = randInt(absMaxPitch - absMinPitch + 1) + absMinPitch;\n }\n notes[notes.length] = posNote;\n }\n\n //create string from midi notes in 'note' array\n for (var i = 0; i < notes.length; i++){\n noteString = noteString + midiToAbc(notes[i]);\n }\n noteString = noteString + \"]\";\n return noteString;\n }", "title": "" }, { "docid": "79bae17c785fc8bc3baa4012fcd7bba9", "score": "0.47755104", "text": "function noteTextInjector (){\n lines.reverse()\n for (i = 0; i < state.notes.length; i++){\n if (state.notes[i].record){\n for (ii = 0; ii < state.notesRecord.length; ii++){\n if(state.notes[i].record == state.notesRecord[ii].record){\n if(state.outputCount < state.notesRecord[ii].endBy && state.outputCount >= state.notesRecord[ii].beginAt && !state.notesRecord[ii].once){\n if(lines.length > (state.notes[i].line - 1)){\n lines[state.notes[i].line] += `\\n${state.notes[i].note}`\n }\n } else if (state.notesRecord[ii].once){\n if (state.outputCount <= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 2) {\n state.notesRecord[ii].once = 1\n }\n if (state.outputCount >= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 1){\n state.notesRecord[ii].once = 2\n if(lines.length > (state.notes[i].line - 1)){\n lines[state.notes[i].line] += `\\n${state.notes[i].note}`\n }\n }\n }\n }\n }\n } else if (lines.length > (state.notes[i].line - 1)){\n lines[state.notes[i].line] += `\\n${state.notes[i].note}`\n }\n }\n lines.reverse()\n //this records the last model input for the /lmi command\n state.lmi = lines.join(\"\\n\").slice(-(info.maxChars))\n}", "title": "" }, { "docid": "10e32e5514798af72a63ec98f279ed5c", "score": "0.4771515", "text": "function drawNote(note, index, velocity) {\r\n let newNote = document.createElement(\"div\");\r\n var noteName = noteList[index % 12];\r\n var noteString = noteName.replace(\"#\", \"sharp\");\r\n const noteClass = noteString + index;\r\n newNote.classList.add(\"note\");\r\n newNote.classList.add(noteString);\r\n newNote.classList.add(\"held\");\r\n let newNoteImage = document.createElement(\"img\");\r\n newNoteImage.setAttribute(\"src\", \"collage-images/\" + collageImages[index % 12]);\r\n newNoteImage.setAttribute(\"index\", index);\r\n newNoteImage.style.filter = \"blur(0px)\";\r\n let newNoteLabel = document.createElement(\"h1\");\r\n newNoteLabel.classList.add(\"noteLabel\");\r\n newNoteLabel.innerHTML = noteName;\r\n if (view == \"focus\") {\r\n newNoteLabel.style.display = \"none\";\r\n }\r\n newNote.appendChild(newNoteImage);\r\n newNote.appendChild(newNoteLabel);\r\n document.body.appendChild(newNote);\r\n\r\n newNote.style.left = random(20, 80) + \"%\";\r\n newNote.style.top = Math.floor(map(index, 60 - (keys / 2), 60 + (keys / 2), 80, 20) + random(-5, 5)) + \"%\";\r\n newNote.style.width = velocity * 3 + 50 + \"px\";\r\n newNote.style.height = velocity * 3 + 50 + \"px\";\r\n newNote.style.transform = \"translate(-50%, -50%) rotate(\" + random(0, 360) + \"deg)\";\r\n\r\n blurNotes();\r\n }", "title": "" }, { "docid": "f2639e1934dca6b300133dc3bd960932", "score": "0.4769222", "text": "addNoteToStave(){\n\n var noteToAdd = new NoteComponent((this.gap/2), (this.x +(this.length/2)), this.context);\n noteToAdd.setLinePosition(this.currentNote.getLinePosition());//needs to be set for drawing the note relative to the canvas // drawing Method of NoteComponent is used\n noteToAdd.setLineNumber(this.currentNote.getLineNumber());\n noteToAdd.setNoteValue(this.returnSelectedNote());\n this.addedNotes.push(noteToAdd);\n //console.log(\"x of mouse with formula:\" + this.mouse.returnX());\n }", "title": "" }, { "docid": "2b26f3f992382d9b52ea6b84572bc7c6", "score": "0.47646376", "text": "function Skidmark(descr) {\r\n\r\n // Common inherited setup logic from Entity\r\n this.setup(descr);\r\n\r\n // Make a noise when I am created (i.e. fired)\r\n //this.fireSound.play();\r\n \r\n/*\r\n // Diagnostics to check inheritance stuff\r\n this._bulletProperty = true;\r\n console.dir(this);\r\n*/\r\n\r\n}", "title": "" }, { "docid": "5e229dcf842f36f4c4ac8a3f79856ba0", "score": "0.47618103", "text": "function addNote(note){\r\n notepad.push(note);\r\n }", "title": "" }, { "docid": "100a01abf085ebbcbc4b26949f671fea", "score": "0.47588828", "text": "function NoteClip() {\n this._init();\n}", "title": "" }, { "docid": "f6cc67c33d2c11f79d2035ba99a5ca08", "score": "0.47569823", "text": "constructor(x,y,length,gap,context2d, mouse){\n this.context = context2d;\n this.mouse = mouse;\n this.x = x;\n this.y = y;//represents the y position of the first Line\n this.yFirstLine = y + (gap/2)*5;//represents the y lineposition of the first VISIBLE line (treble f)\n this.yTrebleLastHelpLine = this.y + gap* 13;\n this.yBassLastHelpLine = this.y + (gap/2)*38;\n this.trebleNotes = [\"D\",\"C\",\"H\",\"A\",\"G\",\"F\",\"E\",\"D\",\"C\",\"H\",\"A\",\"G\",\"F\",\"E\",\"D\",\"C\",\"H\",\"A\",\"G\"];\n this.bassNotes = [\"G\",\"F\",\"E\",\"D\",\"C\",\"H\",\"A\",\"G\",\"F\",\"E\",\"D\",\"C\",\"H\",\"A\",\"G\",\"F\",\"E\",\"D\",\"C\",\"H\"];\n this.gap = gap;\n this.currentNote = new NoteComponent((gap/2), (this.x +(length/2)), this.context);\n this.length = length;\n this.addedNotes = [];\n this.sharps = [\"F\",\"C\",\"G\",\"D\",\"A\",\"E\"];\n this.flats = [\"H\",\"E\",\"A\",\"D\",\"G\",\"C\"];\n this.numberOfSharps = 0;\n this.numberOfFlats = 0;\n this.isSelectable = true;\n }", "title": "" }, { "docid": "ac18059d1393953dd00061615e1ac0fe", "score": "0.47525755", "text": "function parseNote(noteString) {\n const noteRegex = /lightening-(?<currency>\\w+)-(?<amount>[\\d.]+)-(?<netId>\\d+)-0x(?<note>[0-9a-fA-F]{124})/g\n const match = noteRegex.exec(noteString)\n if (!match) {\n throw new Error('The note has invalid format')\n }\n\n const buf = Buffer.from(match.groups.note, 'hex')\n const nullifier = bigInt.leBuff2int(buf.slice(0, 31))\n const secret = bigInt.leBuff2int(buf.slice(31, 62))\n const deposit = createDeposit({ nullifier, secret })\n const netId = Number(match.groups.netId)\n\n return { currency: match.groups.currency, amount: match.groups.amount, netId, deposit }\n}", "title": "" }, { "docid": "3fc106059dc03eac13d4deace39ae3ef", "score": "0.47507077", "text": "noteOn(pitch, velocity = 60) {\n if (this.notes[pitch]) return;\n if (!this.context) this.initAudio();\n let a = this.context.createOscillator();\n let oscGain = this.context.createGain();\n a.frequency.value = tune.Util.ETToFreq(pitch);\n a.type = 'sawtooth';\n a.start();\n oscGain.gain.value = velocity / 127;\n a.connect(oscGain).connect(this.gainNode);\n this.notes[pitch] = a;\n }", "title": "" }, { "docid": "bf75b3c6d425ce06ad166aee933b4289", "score": "0.4747353", "text": "function listNotes(){\n const notes = getNotes();\n // list the notes if there are any; else display msg\n if(notes.length > 0){\n console.log(chalk.yellow.inverse.bold(\" Your Notes \"));\n notes.forEach(function(note, index){\n console.log(\"--------------------------\");\n console.log(`${index+1}. ${chalk.bold(note.title)}`);\n });\n console.log(\"--------------------------\");\n console.log(chalk.white.inverse('Hint!'), chalk.white(\"To read a note run 'read [note title]' command.\"))\n } else {\n console.log(chalk.white.inverse.bold(\"OHH!\"), chalk.white(\"You don't have any notes saved in your notebook. Please add a note.\"))\n }\n}", "title": "" }, { "docid": "47e75ea5f06fed520590a07c8a967cc5", "score": "0.4740596", "text": "function noteOutputSpecial(){\n notesTextTemp = \"\"\n notesPrefixTemp = \"\"\n notesSuffixTemp = \"\"\n for (i = 0; i < state.notesOO.length; i++){\n if (state.notesOO[i].record){\n for (ii = 0; ii < state.notesRecord.length; ii++){\n if(state.notesOO[i].record == state.notesRecord[ii].record){\n if(state.outputCount < state.notesRecord[ii].endBy && state.outputCount >= state.notesRecord[ii].beginAt && !state.notesRecord[ii].once){\n notesTextTemp += state.notesOO[i].note \n } else if (state.notesRecord[ii].once){\n if (state.outputCount <= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 2) {\n state.notesRecord[ii].once = 1\n }\n if (state.outputCount >= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 1){\n state.notesRecord[ii].once = 2\n notesTextTemp += state.notesOO[i].note \n }\n }\n }\n }\n } else {\n notesTextTemp += state.notesOO[i].note \n }\n }\n if (notesTextTemp){\n text = notesTextTemp\n }\n for (i = 0; i < state.notesOP.length; i++){\n if (state.notesOP[i].record){\n for (ii = 0; ii < state.notesRecord.length; ii++){\n if(state.notesOP[i].record == state.notesRecord[ii].record){\n if(state.outputCount < state.notesRecord[ii].endBy && state.outputCount >= state.notesRecord[ii].beginAt && !state.notesRecord[ii].once){\n notesPrefixTemp += state.notesOP[i].note\n } else if (state.notesRecord[ii].once){\n if (state.outputCount <= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 2) {\n state.notesRecord[ii].once = 1\n }\n if (state.outputCount >= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 1){\n state.notesRecord[ii].once = 2\n notesPrefixTemp += state.notesOP[i].note\n }\n }\n }\n }\n } else {\n notesPrefixTemp += state.notesOP[i].note\n }\n }\n text = notesPrefixTemp + text\n for (i = 0; i < state.notesOS.length; i++){\n if (state.notesOS[i].record){\n for (ii = 0; ii < state.notesRecord.length; ii++){\n if(state.notesOS[i].record == state.notesRecord[ii].record){\n if(state.outputCount < state.notesRecord[ii].endBy && state.outputCount >= state.notesRecord[ii].beginAt && !state.notesRecord[ii].once){\n notesSuffixTemp += state.notesOS[i].note\n } else if (state.notesRecord[ii].once){\n if (state.outputCount <= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 2) {\n state.notesRecord[ii].once = 1\n }\n if (state.outputCount >= state.notesRecord[ii].beginAt && state.notesRecord[ii].once == 1){\n state.notesRecord[ii].once = 2\n notesSuffixTemp += state.notesOS[i].note\n }\n }\n }\n }\n } else {\n notesSuffixTemp += state.notesOS[i].note \n }\n }\n text = text + notesSuffixTemp\n}", "title": "" }, { "docid": "0040d2d5d5f36e58cb09c50c985ddc7d", "score": "0.47389793", "text": "_createVexNote(smoNote, tickIndex,voiceIx,x_shift) {\n \t// If this is a tuplet, we only get the duration so the appropriate stem\n \t// can be rendered. Vex calculates the actual ticks later when the tuplet is made\n \tvar duration =\n \t smoNote.isTuplet ?\n \t smoMusic.closestVexDuration(smoNote.tickCount) :\n \t\t smoMusic.ticksToDuration[smoNote.tickCount];\n\n \t// transpose for instrument-specific keys\n \tvar keys=smoMusic.smoPitchesToVexKeys(smoNote.pitches,0,smoNote.noteHead);\n var noteParams = {\n clef: smoNote.clef,\n keys: keys,\n duration: duration + smoNote.noteType\n };\n\n this.applyStemDirection(noteParams,voiceIx,smoNote.flagState);\n var vexNote = new VF.StaveNote(noteParams);\n vexNote.attrs.classes = 'voice-'+voiceIx;\n if (smoNote.tickCount >= 4096) {\n var stemDirection = smoNote.flagState == SmoNote.flagStates.auto ?\n vexNote.getStemDirection() : smoNote.toVexStemDirection();\n vexNote.setStemDirection(stemDirection);\n }\n smoNote.renderId = 'vf-' + vexNote.attrs.id; // where does 'vf' come from?\n\n \tthis._createAccidentals(smoNote,vexNote,tickIndex,voiceIx);\n this._createLyric(smoNote,vexNote,x_shift);\n this._createOrnaments(smoNote,vexNote);\n this._createJazzOrnaments(smoNote,vexNote);\n this._createGraceNotes(smoNote,vexNote);\n\n return vexNote;\n }", "title": "" }, { "docid": "19d2146ebb52fd1aa181a7ea56df6b55", "score": "0.47343734", "text": "function usesSciNote(n)\n{\n\treturn (n.toString().indexOf('e') !== -1)\t// This is a bit slow. Is there a quicker method?\n}", "title": "" }, { "docid": "e3bba9d523a70aa45d0a34ec4d32169d", "score": "0.47343358", "text": "function Note(pitch, noteLength, instrumentChannel, isChord) {\n if (Array.isArray(pitch)) {\n this.note = []\n for(var i = 0; i < pitch.length; i++) {\n this.note.push(MIDI.keyToNote[pitch[i]]);\n }\n } else {\n this.note = MIDI.keyToNote[pitch];\n }\n this.noteLength = noteLength;\n this.instrumentChannel = instrumentChannel;\n this.isChord = isChord\n this.lastDegreesRotated = 0;\n this.initialRotation = true;\n this.measureCurrentlyPlaying = false;\n this.size = 20;\n\n switch(noteLength) {\n case 1:\n this.picture = sixteenth;\n break;\n case 2:\n this.picture = eighth;\n break;\n case 3:\n this.picture = dottedEighth;\n break;\n case 4:\n this.picture = quarter;\n break;\n case 5:\n this.picture = quarterTiedToSixteenth;\n break;\n case 6:\n this.picture = dottedQuarter;\n break;\n case 7:\n this.picture = quarterTiedToDottedEighth;\n break;\n case 8:\n this.picture = half;\n break;\n case 12:\n this.picture = dottedHalf;\n break;\n case 13:\n this.picture = dottedHalfTiedToSixteenth;\n break;\n case 16:\n this.picture = whole;\n break;\n default:\n this.picture = timeSignature;\n }\n\n this.play = function() {\n var velocity = 127; // how hard the note hits\n var duration = 1.0 / (bpm / 60.0) * (this.noteLength / 4.0); // converts the note length into seconds\n if (this.isChord) {\n midi.chordOn(this.instrumentChannel, this.note, velocity, 0);\n midi.chordOff(this.instrumentChannel, this.note, duration);\n } else {\n midi.noteOn(this.instrumentChannel, this.note, velocity, 0);\n midi.noteOff(this.instrumentChannel, this.note, duration);\n }\n\n this.measureCurrentlyPlaying = false;\n }\n\n this.display = function(degreesRotated) {\n music.cx.rotate(90*(Math.PI/180))\n var ratio = this.picture.width/this.picture.height;\n if (this.size > 20) {\n this.size -= 1;\n }\n\n // Play note if it passes the top position\n if (this.initialRotation) {\n this.lastDegreesRotated = degreesRotated;\n this.initialRotation = false;\n }\n if ( ( ((degreesRotated + 90) % 360) < ((this.lastDegreesRotated + 90) % 360) ) && (this.measureCurrentlyPlaying)) {\n this.play();\n this.size = 40;\n music.cx.drawImage(this.picture, 0 - this.size*ratio/2, 0 - this.size, this.size*ratio, this.size);\n } else {\n music.cx.drawImage(this.picture, 0 - this.size*ratio/2, 0 - this.size, this.size*ratio, this.size);\n }\n this.lastDegreesRotated = degreesRotated;\n }\n}", "title": "" }, { "docid": "8b6fdb2bb2427bb46599f8af15054761", "score": "0.47321424", "text": "function playNote() {\n // Pick a random frequency from the array\n let frequency = frequencies[Math.floor(Math.random() * frequencies.length)];\n // Set the synth's frequency\n synth.frequency = frequency;\n // If the frequency is 'stop', stop the sound\n if (frequency === 0.0) {\n synth.stop();\n }\n else {\n // If it's note already play, play the synth\n synth.play();\n }\n}", "title": "" }, { "docid": "f9c314c9381d8a163b19adf6d5374a83", "score": "0.47260168", "text": "function showNotes(e) {\n if (notesEditor?.offsetParent) return;\n let id = e.target.id || e.target.parentNode.id || e.target.parentNode.parentNode.id;\n if (e.target.parentNode.parentNode.id === \"burgLabels\") id = \"burg\" + e.target.dataset.id;\n else if (e.target.parentNode.parentNode.id === \"burgIcons\") id = \"burg\" + e.target.dataset.id;\n\n const note = notes.find(note => note.id === id);\n if (note !== undefined && note.legend !== \"\") {\n document.getElementById(\"notes\").style.display = \"block\";\n document.getElementById(\"notesHeader\").innerHTML = note.name;\n document.getElementById(\"notesBody\").innerHTML = note.legend;\n } else if (!options.pinNotes && !markerEditor?.offsetParent) {\n document.getElementById(\"notes\").style.display = \"none\";\n document.getElementById(\"notesHeader\").innerHTML = \"\";\n document.getElementById(\"notesBody\").innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "1a150c06b032605c03ceadab872f316f", "score": "0.4724661", "text": "handler(argv) {\n notesFile.addNotes(argv.title, argv.body, argv.author)\n\n }", "title": "" }, { "docid": "e4886519d6b4b91712a6b7137ccbc870", "score": "0.47223106", "text": "addDefaultMeasureWithNotes(measureIndex, parameters) {\n this.staves.forEach((staff) => {\n var defaultMeasure =\n SmoMeasure.getDefaultMeasureWithNotes(parameters);\n staff.addMeasure(measureIndex, defaultMeasure);\n });\n }", "title": "" }, { "docid": "e6ba93523f687d519389fff9b27d5a3d", "score": "0.4721449", "text": "function playSound() {\n //create three variables from the skeleton \n //phaser changes the phase of diff frequency components of an incoming signal\n const phaser = new Tone.Phaser({\n frequency: 15,\n octaves: 5,\n baseFrequency: 1000\n }).toMaster();\n\n /********\n const noise = new Tone.Noise(\"pink\").toMaster().start();\n noise.volume.value = -26;\n noise.stop(\"+2n\");//set the stop time for noise \n */\n let val1;\n //val1 determines the melody of the note? \n let val3 = 2.5;\n let val2 = 200; //can change from 100 to 1000\n\n const feedbackDelay = new Tone.FeedbackDelay(\"8n\", 0.5).toMaster();\n const pingPong = new Tone.PingPongDelay(\"2\", 0.2).toMaster();\n const filter = new Tone.Filter(val2, \"lowpass\").toMaster();\n const tremolo = new Tone.Tremolo(9, 0.75).toMaster();\n const reverb = new Tone.JCReverb(0.8).toMaster();\n const chorus = new Tone.Chorus(8, val3, 0.5); //change val3 from 2 - 10\n\n const metalSynth = new Tone.MetalSynth().chain(chorus, filter, feedbackDelay, tremolo, phaser, pingPong, reverb, Tone.Master);\n metalSynth.triggerAttackRelease(\"E3\", 1);\n metalSynth.volume.value = 5;\n\n const polySynth = new Tone.PolySynth().chain(chorus, filter, feedbackDelay, tremolo, phaser, pingPong, reverb, Tone.Master);\n // PolySynth.set({ detune: -1200 });\n polySynth.triggerAttackRelease([\"C4\", \"E4\", \"A4\"], 1);\n polySynth.volume.value = -23;\n\n const duoSynth = new Tone.DuoSynth().chain(chorus, filter, feedbackDelay, tremolo, phaser, pingPong, reverb, Tone.Master);\n duoSynth.triggerAttackRelease(\"G3\", \".5\");\n duoSynth.volume.value = -26;\n\n}", "title": "" }, { "docid": "865ac79cca62caec6a39aa6b86696eb5", "score": "0.471474", "text": "function createNoteText() {\n let text = closeNote;\n text += \"<h2>Note for footnote: \" + (parseInt(footnoteNum) + 1) + \"</h2>\";\n text += \"<div class='notetext'>\"\n if (\"eliot\" in TextOfFootnotes[footnoteNum]) {\n text += \"<h3>Eliot's note: </h3><p>\" + TextOfFootnotes[footnoteNum][\"eliot\"] + \"</p>\";\n }\n if (\"context\" in TextOfFootnotes[footnoteNum]) {\n text += \"<h3>Context note: </h3><p>\" + TextOfFootnotes[footnoteNum][\"context\"] + \"</p></div>\";\n }\n return text;\n }", "title": "" }, { "docid": "32231841a5e436434f6d68e4b616c156", "score": "0.47070575", "text": "function onDeleteNote(note) {\n for (var i=0; i<globals.notes.length; i++) {\n if (noteEquals(note, globals.notes[i])) {\n globals.notes.splice(i, 1);\n break;\n }\n }\n notedisplay.showNotes(globals.notes, globals.audioBuffer);\n }", "title": "" }, { "docid": "4dc149517d94a0b3821cf6730cbbfea6", "score": "0.470562", "text": "function saveNote(nObject){\n\tvar db = Ti.Database.install('dog.sqlite', 'db');\n\t\n\tdb.execute('insert into passport (title, note_id, description, date, remind_flag, completed) values (?,?,?,?,?,?)', nObject.title, nObject.note_id, nObject.description, nObject.date, nObject.remind_flag, nObject.completed);\n\tvar noteId = db.lastInsertRowId;\n\t\n\tTi.API.info('note stored in DB with id: ' + noteId+' date '+nObject.date);\n\t\n\tdb.close();\n}", "title": "" }, { "docid": "60bf202a28ecbf4c3ee441e566931149", "score": "0.4702572", "text": "set notes(val) {\n this._notes = val || '';\n }", "title": "" }, { "docid": "60bf202a28ecbf4c3ee441e566931149", "score": "0.4702572", "text": "set notes(val) {\n this._notes = val || '';\n }", "title": "" }, { "docid": "11672059268ec6c1f8521df845bef9fd", "score": "0.46910104", "text": "function saveNotes(notes) {\n const dataJSON = JSON.stringify(notes);\n fs.writeFileSync('notes.json', dataJSON);\n}", "title": "" }, { "docid": "8c780557f6b6d2996b45477d62a76677", "score": "0.46887004", "text": "addNote(note, id){\n if (note == undefined){\n console.log(\"A new note must contain text - the note paramater can not be empty\");\n }\n else if (id == undefined){\n console.log(\"A new note must have an ID - id paramater can not be empty\");\n }\n else{\n console.log(\"Adding a note to notesheet \" + this.noteSheetID +\" with text: \" + note);\n this.notes.push(note);\n this.notesIDs.push(id);\n }\n }", "title": "" }, { "docid": "939506e6e5349118e8d4b6bf3223a83e", "score": "0.4683679", "text": "function playRandomNote() {\n // Chose a random note\n let note = random(notes);\n // Play it\n synth.play(note, 1, 0, 1);\n}", "title": "" }, { "docid": "c9df95c23a60880013e1ebee74736c53", "score": "0.46812087", "text": "playNote(note, start = 0, end = 2.0) {\n let time = playback.position / editor.zoomX;\n let offset = playback.MIDITimeToSeconds(time);\n let relativeStart = Math.max(0, start - offset);\n let relativeEnd = end - offset;\n if (relativeEnd < 0) return;\n if (!this.context) this.initAudio();\n let a = this.context.createOscillator();\n let oscGain = this.context.createGain();\n a.frequency.value = note.frequency;\n a.type = 'sawtooth';\n let crossFadeDur = 0.1;\n a.start(this.now + relativeStart);\n a.stop(this.now + relativeEnd + crossFadeDur);\n\n a.onended = ø => void this.playingNotes.delete(a); // Fade in\n\n\n oscGain.gain.setValueAtTime(0, this.now + relativeStart);\n oscGain.gain.linearRampToValueAtTime(note.velocity / 128, this.now + relativeStart + crossFadeDur); // hold\n\n oscGain.gain.setValueAtTime(note.velocity / 128, this.now + relativeEnd); // Fade out\n\n oscGain.gain.linearRampToValueAtTime(0.01, this.now + relativeEnd + crossFadeDur);\n a.connect(oscGain).connect(this.gainNode);\n this.playingNotes.add([a, oscGain]);\n\n for (let gliss of note.glissOutputs) {\n this.playGliss(gliss, end, playback.MIDITimeToSeconds(gliss.endNote.start));\n }\n }", "title": "" } ]
076319de10df51e22f186801cf70c685
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
[ { "docid": "4246185e7b4eec9a8b4fc8bbbbc01447", "score": "0.0", "text": "function dateFromConfig(config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = dfl(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n config._pf._overflowDayOfYear = true;\n }\n\n date = makeUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" } ]
[ { "docid": "55adace34cfbb59d5bc15406f75a8fa0", "score": "0.7140785", "text": "function dateFromArray(input) {\r\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\r\n }", "title": "" }, { "docid": "8a43c30d1c500d17ac19ae322663dc25", "score": "0.70556146", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "title": "" }, { "docid": "adcd4fbe1bd993f1dc37b158f2e7f9ae", "score": "0.6907885", "text": "function formatData(array) {\r\n\tfor (var i in array) {\r\n var a = array[i][0];\r\n array[i][0] = new Date(array[i][1]);\r\n array[i][1] = a;\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "a4dd06ea8e2da035cd456e5089c658b3", "score": "0.60638297", "text": "function dateFromArray( config ){\n\t\tvar i, date, input = [];\n\n\t\tif( config._d ){\n\t\t\treturn;\n\t\t}\n\n\t\tfor( i = 0; i < 7; i++ ){\n\t\t\tconfig._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t\t}\n\n\t\t// add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n\t\tinput[3] += config._tzh || 0;\n\t\tinput[4] += config._tzm || 0;\n\n\t\tdate = new Date(0);\n\n\t\tif( config._useUTC ){\n\t\t\tdate.setUTCFullYear(input[0], input[1], input[2]);\n\t\t\tdate.setUTCHours(input[3], input[4], input[5], input[6]);\n\t\t} else{\n\t\t\tdate.setFullYear(input[0], input[1], input[2]);\n\t\t\tdate.setHours(input[3], input[4], input[5], input[6]);\n\t\t}\n\n\t\tconfig._d = date;\n\t}", "title": "" }, { "docid": "f6cfc5bd59a35f50703f786b3c55bed7", "score": "0.60386264", "text": "function dateToNumber(array, array2){\n array.forEach(function(element){\n array2.push(parseInt(element))\n });\n return array2;\n}", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6015293", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6015293", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6015293", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6015293", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "4d3741365a47c70385726d29fff4a36a", "score": "0.5994394", "text": "function firstDate(){\r\n var firstYear = 10000;\r\n var x;\r\n for(x in dayArray){\r\n if(dayArray.hasOwnProperty(x)){\r\n if(+x < firstYear){\r\n firstYear = +x;\r\n }\r\n }\r\n }\r\n\r\n var firstMonth = 0;\r\n while(!dayArray[firstYear][firstMonth]){\r\n firstMonth++;\r\n }\r\n\r\n\r\n var i;\r\n for(i = 0; i<dayArray[firstYear][firstMonth].length; i++){\r\n if(dayArray[firstYear][firstMonth][i]){\r\n break;\r\n }\r\n }\r\n\r\n\r\n return new Date(firstYear, firstMonth, i+1);\r\n }", "title": "" }, { "docid": "3d0dff0ea89ea37baff83153e8a8a8e4", "score": "0.59921587", "text": "function friendly(arr) {\n var date1 = /(\\d{4})[-](\\d{2})[-](\\d{2})/.exec(arr[0]);\n // [ '2016-07-01', '2016', '07', '01', index: 0, input: '2016-07-01' ]\n var date2 = /(\\d{4})[-](\\d{2})[-](\\d{2})/.exec(arr[1]);\n\n function year(date) {\n return date[1];\n }\n\n function month(date) {\n var month = date[2];\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n return months[(+month - 1)];\n }\n\n function day(date) {\n var day = date[3];\n\n // remove leading zero\n day = day.replace(/^0/, '');\n if (day == 1) {\n return \"1st\";\n } else if (day == 2) {\n return \"2nd\";\n } else if (day == 3) {\n return \"3rd\";\n } else {\n return day + \"th\";\n }\n }\n\n date1 = month(date1) + \" \" + day(date1) + \", \" + year(date1);\n date2 = month(date2) + \" \" + day(date2) + \", \" + year(date2);\n\n return [date1, date2];\n}", "title": "" }, { "docid": "cc2b0f761bc1176f72e0d084e34124f7", "score": "0.59616965", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "cc2b0f761bc1176f72e0d084e34124f7", "score": "0.59616965", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "dba15261fddb02b8f0a89926a0680e15", "score": "0.59537125", "text": "function bcdToDate(bcdArray) {\n return new Date(\n bcdToInt(bcdArray[0])*100 + bcdToInt(bcdArray[1]), // Year\n bcdToInt(bcdArray[2]), // Month\n bcdToInt(bcdArray[3]), // Day\n bcdToInt(bcdArray[4]), // Hour\n bcdToInt(bcdArray[5]), // Minute\n bcdToInt(bcdArray[6]) // Second\n );\n}", "title": "" }, { "docid": "1801d06a432653a549db0ed908597673", "score": "0.58766466", "text": "function dateFromArray(config) {\n var i, date, input = [], currentDate;\n\n if (config._d) {\n return;\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n currentDate = currentDateArray(config);\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "4b514a659609429f8748c1e2934528f5", "score": "0.5858501", "text": "function convertDates(data)\n{\n\tfor (i = 0; i < data.length; i++)\n\t{\n\t\tvar original = data[i][\"date\"]\n\t\tdata[i][\"date\"] = new Date(original);\n\t\tif (\"onlyYear\" in data[i] && data[i][\"onlyYear\"])\n\t\t{\n\t\t\tdata[i][\"sDate\"] = original;\n\t\t\tdata[i][\"date\"].setDate(data[i][\"date\"].getDate() + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdata[i][\"sDate\"] = formatDate(data[i][\"date\"]);\n\t\t}\n\t}\t\n\treturn data;\n}", "title": "" }, { "docid": "62c80df5d872dd1293a84e382b17007e", "score": "0.5846582", "text": "function fixTimes(array){\n for (var i=0;i<array.length;i++){\n array[i].time = new Date(array[i].time);\n }\n}", "title": "" }, { "docid": "a432a81433903bbfefbe8b36b12387a6", "score": "0.5808588", "text": "function textifyDates1D(myArr){\n \n for(var r=0; r < myArr.length; r++){\n if (Object.prototype.toString.call(myArr[r]) === '[object Date]'){\n try {\n //myArr[r] = myArr[r].toString();\n myArr[r] = Utilities.formatDate(myArr[r], \"GMT+08:00\", \"dd-MMM-yyyy\")\n } \n catch(err) { myArr[r] = err};\n }\n \n }\n return myArr;\n}", "title": "" }, { "docid": "68ef38734a8a224b6fa30543d53f46ad", "score": "0.5799322", "text": "function makeFriendlyDates(arr) {\n var begDate = new Date(arr[0].split('-')), //put the array into dates format\n endDate = new Date(arr[1].split('-')),\n begYear = begDate.getFullYear(), //assign separate variables for year,month, date\n endYear = endDate.getFullYear(),\n begMonth = begDate.getMonth(),\n endMonth = endDate.getMonth(),\n begDays = begDate.getUTCDate(),\n endDays = endDate.getUTCDate(),\n curDate = new Date();\n months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n \n function corDate(n){ //depending on the days, assign appropriate ordinal dates\n if (n === 1 || n === 21 || n === 31){\n return n + 'st';\n }\n else if (n === 2 || n === 22){\n return n + 'nd';\n }\n else if (n === 3 || n === 23){\n return n + 'rd';\n }\n else {\n return n + 'th';\n }\n }\n \n if (begDate.getTime() === endDate.getTime()){ //exact same beginning and end date\n return [months[begMonth] + ' ' + corDate(begDays) + ', ' + begYear];\n }\n \n else if (begMonth === endMonth && begYear === endYear){ //same month, same year\n return [months[begDate.getUTCMonth()] + ' ' + corDate(begDays) , corDate(endDays)];\n }\n \n else if (begYear === endYear && begMonth != endMonth) { //same year, different month\n return [months[begMonth] + ' ' + corDate(begDays) + ', ' + begYear, months[endMonth] + ' ' + corDate(endDays)];\n }\n \n else if (begYear === curDate.getFullYear() && begMonth >= endMonth && endYear - begYear < 2) { //starts at current year and then ends within a year\n return [months[begMonth] + ' ' + corDate(begDays), months[endMonth] + ' ' + corDate(endDays)];\n }\n \n else if (endYear - begYear === 1 && begMonth === endMonth && begDays > endDays) {//begins and ends within a year.\n return [months[begMonth] + ' ' + corDate(begDays) + ', ' + begYear, months[endMonth] + ' ' + corDate(endDays)];\n }\n\n else {//more than 365 days difference\n return [months[begDate.getUTCMonth()] + ' ' + corDate(begDays) + ', ' + begYear, months[endDate.getUTCMonth()] + ' ' + corDate(endDays) + ', ' + endYear];\n }\n \n}", "title": "" }, { "docid": "5afed5ee655549ca9132ae93e03401d7", "score": "0.56858903", "text": "function dateFromArray(input, asUTC, hoursOffset, minutesOffset) {\n var i, date, forValid = [];\n for (i = 0; i < 7; i++) {\n forValid[i] = input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];\n }\n // we store whether we used utc or not in the input array\n input[7] = forValid[7] = asUTC;\n // if the parser flagged the input as invalid, we pass the value along\n if (input[8] != null) {\n forValid[8] = input[8];\n }\n // add the offsets to the time to be parsed so that we can have a clean array\n // for checking isValid\n input[3] += hoursOffset || 0;\n input[4] += minutesOffset || 0;\n date = new Date(0);\n if (asUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n date._a = forValid;\n return date;\n }", "title": "" }, { "docid": "5afed5ee655549ca9132ae93e03401d7", "score": "0.56858903", "text": "function dateFromArray(input, asUTC, hoursOffset, minutesOffset) {\n var i, date, forValid = [];\n for (i = 0; i < 7; i++) {\n forValid[i] = input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];\n }\n // we store whether we used utc or not in the input array\n input[7] = forValid[7] = asUTC;\n // if the parser flagged the input as invalid, we pass the value along\n if (input[8] != null) {\n forValid[8] = input[8];\n }\n // add the offsets to the time to be parsed so that we can have a clean array\n // for checking isValid\n input[3] += hoursOffset || 0;\n input[4] += minutesOffset || 0;\n date = new Date(0);\n if (asUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n date._a = forValid;\n return date;\n }", "title": "" }, { "docid": "e265997c3686ea2f68b351e49575cf7e", "score": "0.5578778", "text": "function formatDateToDatepicker(arr) {\n var ret = arr.map(function (cc) {\n cc.ClosedDateDP = new Date(cc.ClosedDate);\n return cc;\n })\n return ret;\n }", "title": "" }, { "docid": "4e5b66c8d3f0f5c3bd5d0e07609c96ee", "score": "0.55664146", "text": "function StringtoDateArray(Acc){\n let timeArray=new Array();\n for(var i=0;i<Acc.length;i++){\n var d = new Date(Acc[i]);\n timeArray.push(d);\n }\n return timeArray; \n}", "title": "" }, { "docid": "d9eec07c65228bd9452b9fa628a1c240", "score": "0.55297476", "text": "function arrayToTimeSeries(tsArray,yearsArray,possibleYears,bandName){\r\n //Set up dummy image for handling null values\r\n var noDateValue = -32768;\r\n var dummyImage = ee.Image(noDateValue).toArray();\r\n \r\n //Ierate across years\r\n var tsC = possibleYears.map(function(yr){\r\n yr = ee.Number(yr);\r\n \r\n //Pull out given year\r\n var yrMask = yearsArray.eq(yr);\r\n \r\n //Mask array for that given year\r\n var masked = tsArray.arrayMask(yrMask);\r\n \r\n \r\n //Find null pixels\r\n var l = masked.arrayLength(0);\r\n \r\n //Fill null values and convert to regular image\r\n masked = masked.where(l.eq(0),dummyImage).arrayGet([-1]);\r\n \r\n //Remask nulls\r\n masked = masked.updateMask(masked.neq(noDateValue)).rename([bandName]) \r\n .set('system:time_start',ee.Date.fromYMD(yr,6,1).millis());\r\n \r\n return masked;\r\n \r\n \r\n });\r\n return ee.ImageCollection(tsC);\r\n }", "title": "" }, { "docid": "970a75fb4e04189aab2f2770d84869a3", "score": "0.550721", "text": "function getYear1(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[0];\n\n}", "title": "" }, { "docid": "fd6f0a8a33274f48299dd24c689da1fc", "score": "0.5500014", "text": "function arrayToTimeSeries(tsArray,yearsArray,possibleYears,bandName){\n //Set up dummy image for handling null values\n var noDateValue = -32768;\n var dummyImage = ee.Image(noDateValue).toArray();\n \n //Ierate across years\n var tsC = possibleYears.map(function(yr){\n yr = ee.Number(yr);\n \n //Pull out given year\n var yrMask = yearsArray.eq(yr);\n \n //Mask array for that given year\n var masked = tsArray.arrayMask(yrMask);\n \n \n //Find null pixels\n var l = masked.arrayLength(0);\n \n //Fill null values and convert to regular image\n masked = masked.where(l.eq(0),dummyImage).arrayGet([-1]);\n \n //Remask nulls\n masked = masked.updateMask(masked.neq(noDateValue)).rename([bandName]) \n .set('system:time_start',ee.Date.fromYMD(yr,6,1).millis());\n \n return masked;\n \n \n });\n return ee.ImageCollection(tsC);\n }", "title": "" }, { "docid": "d59d66a177dd69e3292a387f9da3d8e9", "score": "0.5498786", "text": "function getYears(array,func) {\n\nlet newarray = func(array);\nlet yearArray = [];\nfor(let i = 0; i < newarray.length; i++){\n yearArray.push(newarray[i].Year);\n}\nreturn yearArray\n}", "title": "" }, { "docid": "78348708b36a289e6a6f97f449f6a0fa", "score": "0.54922795", "text": "function yyyy_mm(data, headers) {\n headers.forEach(function(header) {\n data.forEach(function(item) {\n data_string = item[header];\n item[header] = new Date(data_string + \"-01T00:00:00Z\");\n });\n });\n return data;\n}", "title": "" }, { "docid": "8da0811fa4505eed21e9758c37c31637", "score": "0.5487692", "text": "function linearOK(array){if(!array)return false;for(var i=0;i<array.length;i++){if(isNumeric(array[i]))return true;}return false;}// does the array a have mostly dates rather than numbers?", "title": "" }, { "docid": "460193c5941219f3a4864f9d689dfacc", "score": "0.54181075", "text": "function getYear2(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[1];\n\n}", "title": "" }, { "docid": "3529801a6ed8f15a28e02e8df606fa44", "score": "0.53914696", "text": "function arrayOfAllYears(array){\n return array.map(function(item){\n return item.year;\n });\n}", "title": "" }, { "docid": "91b925394dd033b5a951e56f82a5a2a2", "score": "0.53860015", "text": "function textifyDates(myArr){\n \n \n for(var r=0; r < myArr.length; r++){\n for(var c=0; c < myArr[r].length; c++){\n if (Object.prototype.toString.call(myArr[r][c]) === '[object Date]'){\n try { \n //myArr[r] = myArr[r].toString();\n myArr[r][c] = Utilities.formatDate(myArr[r][c], \"GMT+08:00\", \"dd-MMM-yyyy hh:mm:ss\")\n } \n catch(err) { myArr[r][c] = err};\n }\n }\n }\n return myArr;\n}", "title": "" }, { "docid": "2de21e8b2f177c23056ea33d6f275dfb", "score": "0.5378394", "text": "function singleDayProccessor(dateArray, priceArray){\n const newDateArray = [];\n const newPriceArray = [];\n const tempDateArray = MStoDate(dateArray);\n // dateArray.map(ms => new Date(parseInt(ms)));\n \n\n if(tempDateArray.length === 1) {\n newPriceArray.push(priceArray[0]);\n newDateArray.push(tempDateArray[0])\n } else {\n for(var i = 0; i < tempDateArray.length; i++) {\n\n //if got two prices recorded for the same day\n if(i !== tempDateArray.length - 1 &&\n tempDateArray[i].getDate() === tempDateArray[i+1].getDate() &&\n tempDateArray[i].getMonth() === tempDateArray[i+1].getMonth() &&\n tempDateArray[i].getFullYear() === tempDateArray[i+1].getFullYear()) {\n\n //if the price for the current entry is lower\n if(priceArray[i] < priceArray[i + 1]) {\n newPriceArray.push(priceArray[i]);\n newDateArray.push(tempDateArray[i])\n i++;\n // if the price for the next entry is lower, record that one\n } else {\n newDateArray.push(tempDateArray[i + 1])\n newPriceArray.push(priceArray[i + 1]);\n i++;\n }\n\n\n // if no two prices on the same day, just record the entry \n } else {\n newPriceArray.push(priceArray[i]);\n newDateArray.push(tempDateArray[i])\n }\n }\n }\n\n // newDateArray.map(date => date.getTime().toString())\n \n return [dateToMS(newDateArray), newPriceArray];\n }", "title": "" }, { "docid": "e647d8c36eae2a938f41abf3a7682892", "score": "0.5374509", "text": "function getYear3(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[2];\n\n}", "title": "" }, { "docid": "a4665d97e023b7a6f47f5fe7c97d94b2", "score": "0.5366269", "text": "function makeDateFromStringAndArray(config) {\nvar tempConfig,\nbestMoment,\nscoreToBeat,\ni,\ncurrentScore;\nif (config._f.length === 0) {\nconfig._pf.invalidFormat = true;\nconfig._d = new Date(NaN);\nreturn;\n}\nfor (i = 0; i < config._f.length; i++) {\ncurrentScore = 0;\ntempConfig = copyConfig({}, config);\nif (config._useUTC != null) {\ntempConfig._useUTC = config._useUTC;\n}\ntempConfig._pf = defaultParsingFlags();\ntempConfig._f = config._f[i];\nmakeDateFromStringAndFormat(tempConfig);\nif (!isValid(tempConfig)) {\ncontinue;\n}\n// if there is any input that was not parsed add a penalty for that format\ncurrentScore += tempConfig._pf.charsLeftOver;\n//or tokens\ncurrentScore += tempConfig._pf.unusedTokens.length * 10;\ntempConfig._pf.score = currentScore;\nif (scoreToBeat == null || currentScore < scoreToBeat) {\nscoreToBeat = currentScore;\nbestMoment = tempConfig;\n}\n}\nextend(config, bestMoment || tempConfig);\n}", "title": "" }, { "docid": "0102d9e4910041ba84249b17461bbc84", "score": "0.53439677", "text": "function bestYearAvg(arr) {\n \n}", "title": "" }, { "docid": "91975edc13990608ce782f06b32bff75", "score": "0.5337342", "text": "function validGetTime(validDateArray) {\n // if (!arrayOfNums[2])\n let dateInstance = new Date(validDateArray[2], (validDateArray[0] - 1),\n validDateArray[1]);\n return dateInstance.getTime();\n}", "title": "" }, { "docid": "daeb8a059d2a12db506ff51258a48a13", "score": "0.53321636", "text": "function dateSortArray(arr) {\n const sortedArray = arr.sort((a, b) => b.timestamp - a.timestamp);\n return sortedArray;\n}", "title": "" }, { "docid": "df2e3a7e37b61dea060b56baecd3f576", "score": "0.53228664", "text": "function bestYearAvg(arr) {}", "title": "" }, { "docid": "6cd3446ee85337eaa0b6db2cbb792b43", "score": "0.53126293", "text": "function makeArray(firstYear, secondYear, thirdYear) {\n let myArray = new Array;\n myArray = '(' + firstYear + ',' + secondYear + ',' + thirdYear + ')';\n\n return myArray;\n}", "title": "" }, { "docid": "c068bd41a42bbed945c3350799a8379b", "score": "0.5301201", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "fa2144d287bd9244d4eaa01f83230f46", "score": "0.5298851", "text": "function WantedDate(ROCdate) {\n const ROCdateArr = ROCdate.split(\"/\");\n const year = Number(ROCdateArr[0]) + 1911\n const month = ROCdateArr[1] - 1\n const day = ROCdateArr[2]\n return [year, month, day]\n}", "title": "" }, { "docid": "ef71de57a3dcf20808e44df04f055d57", "score": "0.5297469", "text": "function getYear4(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[3];\n\n}", "title": "" }, { "docid": "3135cb2d59a8dacd0ab737b3658d68f5", "score": "0.52968556", "text": "function orderByYear (arr){\n\n }", "title": "" }, { "docid": "83cc91d58bf5857ca49c3dbfb39febf4", "score": "0.5293231", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "c55c6e9b14ee68d338d14c1b7f9348e0", "score": "0.52870214", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" }, { "docid": "c55c6e9b14ee68d338d14c1b7f9348e0", "score": "0.52870214", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.52870214", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.52870214", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.52870214", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "7bb6d7d2e45a40fe0c518a0b824dd7f1", "score": "0.52656853", "text": "function monthArray(array){\n var ageMonth = array;\n for (var i=0; i<rabbitLifeMonths; i+= 1)\n {\n ageMonth.push(0);\n }\n return ageMonth;\n}", "title": "" }, { "docid": "14d9b9002798ccc2ab518bf582a4d412", "score": "0.5259648", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "14d9b9002798ccc2ab518bf582a4d412", "score": "0.5259648", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5248654", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" } ]
75b1984d37e656bad424fe1c3f252c5d
we have 3 dots
[ { "docid": "a908cbf1b84bdb1a985d733d919f86a5", "score": "0.0", "text": "function dotSet(dotNr, color){\n document.getElementById('d-dot' + dotNr).setAttribute('fill', color);\n}", "title": "" } ]
[ { "docid": "b393b92b7c1fb7d80ec37cd622b1ba99", "score": "0.64410275", "text": "function addDot() {\n\t\tdiv.innerHTML = div.innerHTML + '. ';\n\t\t//on incrémente dots\n\t\tdots++;\n\t\t//la fonction s'appelle elle même\n\t\tdotLoader();\n\t}", "title": "" }, { "docid": "bd5722eb71c8c9b14cce19ea25265cf4", "score": "0.6406797", "text": "getDots() {\n\t\treturn this.dots;\n\t}", "title": "" }, { "docid": "e18d08ce033c87953d27814119534209", "score": "0.62799096", "text": "function t(e, t) { for (var n = 0, r = e.length - 1; r >= 0; r--) { var o = e[r]; \".\" === o ? e.splice(r, 1):'..'===o ? (e.splice(r, 1), n++):n && (e.splice(r, 1), n--);} if (t) for (;n--; n)e.unshift('..'); return e }", "title": "" }, { "docid": "533eae1954ad014db5f6057aa11500e1", "score": "0.6258354", "text": "function t(e,t){for(var n=0,r=e.length-1,o;0<=r;r--)o=e[r],\".\"===o?e.splice(r,1):\"..\"===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--);if(t)for(;n--;n)e.unshift(\"..\");return e}", "title": "" }, { "docid": "c444f37f1aa1ab6fc1b225ff8751225f", "score": "0.6116969", "text": "renderThree(selected) {\n return (\n <div className=\"dots\">\n {this.renderDot(0, selected)}\n {this.renderDot(1, selected)}\n {this.renderDot(2, selected)}\n </div>\n );\n }", "title": "" }, { "docid": "c95f7e14501998c3d03b55062ffab931", "score": "0.6079315", "text": "render() {\n const numDots = this.state.frame + 1\n const dots = Array(numDots).join('.')\n\n const numBlanks = (this.props.numDots - this.state.frame + 1) + 1\n const blanks = Array(numBlanks).join('\\u00a0')\n \n return <span>{dots}{blanks}</span>\n }", "title": "" }, { "docid": "760d69f73efa23a539d8401774071e1b", "score": "0.59989", "text": "function showDot(str, strLength) {\n\tif (str.length > strLength) return (str.slice(0, strLength) + '... ')\n\telse return str;\n}", "title": "" }, { "docid": "ca8e94a387ad00f818e02db120acd2a1", "score": "0.59861535", "text": "function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];\".\"===o?e.splice(r,1):\"..\"===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift(\"..\");return e}", "title": "" }, { "docid": "a4be6a2ab992656fdc6cc91d27cbd984", "score": "0.597277", "text": "function adddot1(dotdata){\n\tvar dotstring = \"(\" + dotdata + \"),\";\n\tpl1 += dotstring;\n\t}", "title": "" }, { "docid": "a8c7cc17a0d6b169e515a72576b1f3f7", "score": "0.5955701", "text": "function t(e,t){for(var i=0,n=e.length-1;n>=0;n--){var o=e[n];\".\"===o?e.splice(n,1):\"..\"===o?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(t)for(;i--;i)e.unshift(\"..\");return e}", "title": "" }, { "docid": "7be5ea0afcf9ffa6fc8892ea96c11a63", "score": "0.5910013", "text": "function\ton_decs3(str21){\n \n \n\tvar str=new String(str21);\n\t\n var dot=str.indexOf(\".\");\n var str1;\n\t\n\tif(dot>0) \n\t\tstr1=str.slice(0,dot);\n\telse\n\t\tstr1=str;\n\t\t\n var size=str1.length;\n \n\tvar new_str='';\n var i;\n\t\n\tfor(i=size;i>0&&i>3;i-=3){\n\t \n\t new_str=str1.slice(i-3,i)+new_str;\n \t new_str=\" \"+new_str;\n\t}\n\tnew_str=str.slice(0,i)+new_str;\n\tif(dot>0)\n\t new_str=new_str+str.slice(dot);\n\treturn new_str;\n }", "title": "" }, { "docid": "3b2a8b7e44ecfd530afaeef488f79823", "score": "0.59008217", "text": "function dots(date) {\n var dot = []\n for (const i in date) {\n if(date[i] == \".\") dot.push(i)\n } // position 3 and 6\n if( JSON.stringify(dot) == JSON.stringify([\"2\",\"5\"])) { // if dot is position 3 and 6 true\n return true\n } else { // if dot not at position 3 and 6 false\n return false\n }\n}", "title": "" }, { "docid": "087dd86c0283e67fb50465e7d37f13ce", "score": "0.5866838", "text": "function adddot0(dotdata){\n\tvar dotstring = \"(\" + dotdata + \"),\";\n\tpl0 += dotstring;\n\t}", "title": "" }, { "docid": "e4e02cba886c42c182e618e5b86196d4", "score": "0.58234036", "text": "function paginationDots() {\n\t\t\tvar $pagination = $('.pagination');\n\t\t\tvar $pageItem = $pagination.find('.pagin-item');\n\t\t\tvar $pagePrev = $pagination.find('.pagin-prev');\n\t\t\tvar $pageNext = $pagination.find('.pagin-next');\n\n\t\t\tif ($pagePrev.length && $pageNext.length) {\n\t\t\t\tif ($pageItem.length > 7) { // items > 7\n\t\t\t\t\tinsertDots(2, true, true); // insert dots before last 2 items\n\t\t\t\t}\n\t\t\t} else if ($pagePrev.length && !$pageNext.length) {\n\t\t\t\tif ($pageItem.length > 6) { // items > 6\n\t\t\t\t\tinsertDots(1, true, false); // insert dots before last item\n\t\t\t\t}\n\n\t\t\t} else if (!$pagePrev.length && $pageNext.length) {\n\t\t\t\tif ($pageItem.length > 6) { // items > 6\n\t\t\t\t\tinsertDots(2, false, true); // insert dots before last 2 item\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction insertDots(nthLastChild, first, last) {\n\t\t\t\tvar calcLastChild = $pageItem.length - nthLastChild;\n\n\t\t\t\tif (first == true && last == true) {\n\t\t\t\t\t$pageItem.eq(3).nextAll().not($pageItem.slice(-2)).addClass('hide');\n\t\t\t\t} else if (first == true && last == false) {\n\t\t\t\t\t$pageItem.eq(3).nextAll().not($pageItem.slice(-1)).addClass('hide');\n\t\t\t\t} else if (first == false && last == true) {\n\t\t\t\t\t$pageItem.eq(2).nextAll().not($pageItem.slice(-2)).addClass('hide');\n\t\t\t\t}\n\n\t\t\t\t$('<li class=\"pagin-item pagin-dots\">').text('...').insertAfter($pageItem.eq(calcLastChild - 1));\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7f20a8d0d44173338b3d4af47c6a8b1", "score": "0.5795393", "text": "function pointNumber( n ){ \r\n\t\tn = n + \"\";\r\n\t\tvar i = n.length-3;\r\n\t\twhile( i > 0 ){ n = n.substring( 0, i )+ \".\" + n.substring( i, n.length ); i=i-3; }\r\n\t\treturn( n );\r\n\t}", "title": "" }, { "docid": "5c2818e12643e70d236459a8493e440c", "score": "0.5773844", "text": "function boxEllipsis(_) {\n\t return (_ + \"...\");\n\t }", "title": "" }, { "docid": "7d9b004a4ee626db74430f74508a6b61", "score": "0.5763503", "text": "function dotsGen (dots) {\n switch (dots) {\n case 1:\n return oneDot;\n case 2:\n return twoDots\n case 3: \n return threeDots;\n case 4: \n return fourDots;\n case 5: \n return fiveDots;\n case 6:\n return sixDots;\n default:\n break;\n }\n}", "title": "" }, { "docid": "214faaa5e83bde2260e278ca6d02b105", "score": "0.5725521", "text": "function isDotPossible() {\n\n if (currentDisplay.innerHTML.lastIndexOf(\".\") < currentDisplay.innerHTML.lastIndexOf(\"+\")) {\n return true;\n } else if (currentDisplay.innerHTML.lastIndexOf(\".\") < currentDisplay.innerHTML.lastIndexOf(\"-\")) {\n return true;\n } else if (currentDisplay.innerHTML.lastIndexOf(\".\") < currentDisplay.innerHTML.lastIndexOf(\"*\")) {\n return true;\n } else if (currentDisplay.innerHTML.lastIndexOf(\".\") < currentDisplay.innerHTML.lastIndexOf(\"/\")) {\n return true;\n } else return false;\n\n}", "title": "" }, { "docid": "2248d4a36656d64cd974123bda053634", "score": "0.5701703", "text": "function ThreeDot() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 512 512\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M288 384C288 366.327 273.673 352 256 352C238.327 352 224 366.327 224 384C224 401.673 238.327 416 256 416C273.673 416 288 401.673 288 384Z\" fill=\"#011B53\"/>\n <path d=\"M288 256C288 238.327 273.673 224 256 224C238.327 224 224 238.327 224 256C224 273.673 238.327 288 256 288C273.673 288 288 273.673 288 256Z\" fill=\"#011B53\"/>\n <path d=\"M288 128C288 110.327 273.673 96 256 96C238.327 96 224 110.327 224 128C224 145.673 238.327 160 256 160C273.673 160 288 145.673 288 128Z\" fill=\"#011B53\"/>\n </svg>\n )\n}", "title": "" }, { "docid": "d2ad6cebbe14815c73bd4713ac693cb8", "score": "0.5697779", "text": "function placeDots() {\n dots = [];\n var ci = 0;\n for (var x = 14; x < width; x = x + 30) {\n for (var y = 14; y < height; y = y + 30) {\n var d = new Dot(x, y, colors[ci%colors.length]);\n dots.push(d);\n ci++;\n }\n }\n}", "title": "" }, { "docid": "42951d902131818d0cf688e80d45000e", "score": "0.5669869", "text": "function clearDotsJquey(val){\n\treturn val.split('.').join('\\\\.');\n}", "title": "" }, { "docid": "f922ecddb6da7d1c9b5807dbabb73a79", "score": "0.56502575", "text": "visitDotted_name(ctx) {\r\n console.log(\"visitDotted_name\");\r\n let str = \"\";\r\n for (var i = 0; i < ctx.getChildCount(); i++) {\r\n str = str + ctx.getChild(i).getText();\r\n }\r\n return str;\r\n }", "title": "" }, { "docid": "36cc3d1f85d1d319f89b14e02e19d6c7", "score": "0.5636806", "text": "function Dot() { \n\t \n\t if ( Current.length == 0) \n\t\t{ Current = \"0.\";\n\t\t} else\n\t\t{ if ( ( Current.indexOf(\".\") == -1)\n\t\t\t\t&&( Current.indexOf(\"e\") == -1)\n\t\t\t )\n\t\t\t { Current = Current + \".\";\n\t\t}; };\n\t document.getElementById(\"Disp\").value = Current;\n\t }", "title": "" }, { "docid": "2b8fbc11b1026063c0fc10ffad5b483f", "score": "0.56333005", "text": "function getDotName()\n\t\t{\n\t\t\treturn nestedKeys.join('.').replace(/\\.\\[/g, '[');\n\t\t}", "title": "" }, { "docid": "2b8fbc11b1026063c0fc10ffad5b483f", "score": "0.56333005", "text": "function getDotName()\n\t\t{\n\t\t\treturn nestedKeys.join('.').replace(/\\.\\[/g, '[');\n\t\t}", "title": "" }, { "docid": "d7ff5c0049dffc001665901893af90e4", "score": "0.5605693", "text": "function maybe_add_dot() {\n if (string_to_eval.length > 59) {\n return;\n }\n change_font_size_if_over_20();\n\n if (last_nums_in_string.length === 0) {\n return;\n }\n if (last_nums_in_string.indexOf(\".\") > -1) {\n return;\n } else {\n string_to_eval += \".\";\n last_nums_in_string += \".\";\n }\n convert_correct_symb();\n answer_.innerHTML = answer_html;\n //answer_.innerHTML = string_to_eval;\n }", "title": "" }, { "docid": "83dc4dfe106c91fc35cc97ec96309f48", "score": "0.5579138", "text": "addRandomDots(n_dots){\n for(let i= 0; i<n_dots;i++){\n this.addRandomDot();\n }\n }", "title": "" }, { "docid": "82c65b55a53dac527bd67bee49c0dfa8", "score": "0.55613804", "text": "function constroiStringDot(dots, iniciais, finais, primeiraExec) {\r\n let legenda = \"\";\r\n if (!primeiraExec) {\r\n legenda = dots.pop();\r\n }\r\n const str = `digraph automato {\r\n rankdir=LR;\r\n size=\"8.5\";\r\n subgraph cluster{\r\n label=\"${primeiraExec ? STR_INICIAL : legenda}\";\r\n ${iniciais\r\n .map(() => {\r\n return `node [shape = none]; \"\";`;\r\n })\r\n .join(\"\\r\\n\")}\r\n node [shape = doublecircle]; ${finais.join(\" \")};\r\n node [shape = circle]; \r\n ${iniciais\r\n .map((s) => {\r\n return `\"\" -> ${s};`;\r\n })\r\n .join(\"\\r\\n\")}\r\n ${dots.join(\"\\r\\n\")}\r\n ${\r\n primeiraExec\r\n ? \"\"\r\n : legenda.split(\"/\")[0].substring(1) +\r\n \" [ style = filled fillcolor = dimgrey ];\"\r\n } \r\n }\r\n}`;\r\n return str;\r\n}", "title": "" }, { "docid": "8dd8be1081e7fb5975cef8a3bef08b39", "score": "0.55502665", "text": "function dotsArrows(num, pos) {\r\n\tlet slide = document.getElementsByClassName('mySlides')[num].clientHeight;\r\n\tlet img = document.getElementsByTagName('img')[num].clientHeight;\r\n\tlet nrs = document.getElementsByClassName('numbertext')[num].clientHeight;\t\r\n\tlet dot = document.querySelector('#dotjes').style;\r\n\tif (document.querySelector('main').clientWidth < 450) {\r\n\t\tdot.top = \"\";\r\n\t\tdot.bottom = (slide - nrs - img) - 10 + 'px';\r\n\t}\r\n\telse {\r\n\t\tdot.bottom = \"\";\r\n\t\tdot.top = pos - slide + nrs + img + 10 + 'px';\t\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "6c58b44315ca95efedddbbfbea9963d8", "score": "0.55349356", "text": "function addDot(value, selection) {\n if (config.currencyCents === 0) {\n return value;\n }\n var dotPos = value.length - config.currencyCents;\n if (selection.start > dotPos) {\n selection.start = selection.start + 1;\n }\n if (selection.end > dotPos) {\n selection.end = selection.end + 1;\n }\n var end = value.substring(dotPos);\n for (var i = end.length; i < config.currencyCents; i++) {\n end = '0' + end;\n }\n return value.substring(0, dotPos) + '.' + end;\n }", "title": "" }, { "docid": "a3437e2367b9fb3b6723ed04734eca90", "score": "0.552615", "text": "function addDots() {\n\t\t\t$('.post-body').each(function() {\n\t\t\t\tvar $this = $(this);\n\n\t\t\t\t$(this).dotdotdot({\n\t\t\t\t\twatch: true\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t$('.post-head').each(function() {\n\t\t\t\tvar $this = $(this);\n\n\t\t\t\t$(this).dotdotdot({\n\t\t\t\t\twatch: true\n\t\t\t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "471228919fbfec6cc8b5c279aafa3991", "score": "0.5510564", "text": "incGhostsDots() {\n if (this.inPen.length > 0) {\n this.inPen[0].increaseDots();\n this.checkDotLimit();\n }\n }", "title": "" }, { "docid": "b5c42c2b3e2641dfbe748529fabe70c6", "score": "0.5505658", "text": "function cuantosTienenTres(fort) {\nvar i = 0\nvar palabras = 0\nvar palabrasLargas = 0\nwhile(fort[i] != \".\"){\n while(fort[i] == \" \"){ i++;}\n palabras = \"\";\n while(fort[i] != \" \" && fort[i] != \".\"){\n palabras = palabras + fort[i];\n i++;\n }\n if(palabras.length > 3){\n palabrasLargas++;\n }\n} return palabrasLargas;\n}", "title": "" }, { "docid": "df3890892e18dfb478fccf9e20fc2422", "score": "0.54959804", "text": "function get_dot( number ){\n\t\tif( number == 1) return { x : p1x, y : p1y}\n\t\tif( number == 2) return { x : p2x, y : p2y}\n\t\treturn {}\n\t}", "title": "" }, { "docid": "74d649676104d51d03af4e47c93d9265", "score": "0.548269", "text": "function transformDotsDashes(theMorseText) {\n const dot = '.';\n const dash = '_';\n const svgDash = morseSVG.dashSVG;\n const svgDot = morseSVG.dotSVG;\n let incomingMorse = theMorseText;\n console.log('transformDotsDashes() is logging this: ' + theMorseText);\n console.log(theMorseText);\n //console.log(dot, dash, svgDot, svgDash);\n // for (dot = 0; dot < theMorseText.length; dot++) {\n // let theSVGDots = alphaMorse[0][theMorseText][dot];\n // console.log(theSVGDots);\n // };\n //return svgDotsAndDashes;\n }", "title": "" }, { "docid": "b5f8c7536345b2522cc737ecd76ccc7a", "score": "0.54820055", "text": "function addDots(scope) {\n scope.List.push({\n value: scope.dots\n });\n }", "title": "" }, { "docid": "0db20538dd829775aa9df91136493173", "score": "0.5470264", "text": "function addDots(num) {\n return String(num).replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, \"$1.\");\n //return parseFloat(num, 10).toFixed(2).replace(/\\./g, \",\").toString().replace(/(\\d)(?=(\\d{3})+\\,)/g, \"$1.\").toString()\n}", "title": "" }, { "docid": "75c7f783ec15733354eea1fd4d6cc60f", "score": "0.5460431", "text": "function notef2(n,s,c,d,cc)\n{\n var note=(n ? (notelist[n%12]+Math.floor(1+n/12)) : (\"...\"));\n var smpl=(s ? (hb(s)) : (\"..\"));\n var cmd=c.toString(16)+hb(d);\n if(cmd=='000')cmd='...';\n return note+\" \"+smpl+\" \"+cmd;\n}", "title": "" }, { "docid": "0b9bbe40afb12432387b49263084e25a", "score": "0.5458953", "text": "function addDots(scope) {\r\n scope.List.push({\r\n value: scope.dots\r\n });\r\n }", "title": "" }, { "docid": "751bd739da29fbe4dcd50314f5886021", "score": "0.54434466", "text": "typingInDots() {\n //-1 makes the animation appear later\n this.typingInDotsFade = Math.sin(this.typingInDotsFadeVariable - 1);\n this.typingInDotsFadeVariable += 0.1;\n\n noStroke();\n //sinus is from 0 to 1 – so it has to be multiplied with 255 (color). Then it is from 0 to 255\n //the first value is delaying the appearence of the dots / I just experimented some time\n\n //first dot\n fill(62, 19, 118, 150 + this.typingInDotsFade * 255);\n ellipse(-463, -150, 8, 8);\n //second dot\n fill(62, 19, 118, 75 + this.typingInDotsFade * 255);\n ellipse(-450, -150, 8, 8);\n //third dot\n fill(62, 19, 118, this.typingInDotsFade * 255);\n ellipse(-437, -150, 8, 8);\n }", "title": "" }, { "docid": "976c67bd0ca64678bd249b9b1949c6b2", "score": "0.54390144", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n return '';\n}", "title": "" }, { "docid": "976c67bd0ca64678bd249b9b1949c6b2", "score": "0.54390144", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n return '';\n}", "title": "" }, { "docid": "5179b1ff325190b9dfe137d7a9acc4a9", "score": "0.5422476", "text": "function next() {\n\t index++;\n\t c = dot.charAt(index);\n\t }", "title": "" }, { "docid": "8e2ac0cc2449a8353e86c2b92c2ffaf7", "score": "0.5414993", "text": "function addNewDot() {\n random(dots).setAlive();\n}", "title": "" }, { "docid": "885c11a1282280f929f93031174a2c7f", "score": "0.54140735", "text": "function eatDot() {\r\n\tscore++;\r\n\tlength += 3 + (score > 5 ? score - 5 : 0) ;\r\n\tlet makingDot = true;\r\n\twhile(makingDot) {\r\n\t\txDot = floor(random(10, WIDTH - 10));\r\n\t\tyDot = floor(random(10, HEIGHT - 10));\r\n\t\tmakingDot = !testPoint(xDot, yDot);\r\n\t}\r\n}", "title": "" }, { "docid": "d0fa070da2f54d0a55ef66a8fe666882", "score": "0.54072016", "text": "function formatResult(num) {\n num = num.toString();\n\n let start = num.indexOf(\".\");\n if (start === -1) return +num;\n\n let repeatNum = num[start];\n let count = 0;\n\n for (let i = start; i < num.length; i++) {\n if (num[i] === repeatNum) {\n count++;\n if (count === 3) {\n return +num.slice(0, start + 2);\n }\n } else {\n start = i;\n repeatNum = num[i];\n count = 1;\n }\n }\n return +num;\n}", "title": "" }, { "docid": "c49f6b581da6e7ae0223613829889e59", "score": "0.53910524", "text": "function setNumbers(a){\n if (a == \".\" && pointSet){\n return;\n }\n else {\n currentDisplayValue += a;\n line.textContent = line.textContent + a;\n }\n if (a == \".\") pointSet = true;\n }", "title": "" }, { "docid": "e038f728ff6b1fefb04cc471e7facdcc", "score": "0.5387032", "text": "function Dot(x,y){\n\tthis.x = x;\n\tthis.y = y;\n\n\tthis.element = document.createElement(\"div\");\n\n\tthis.element.className = \"dots\";\n\tthis.element.style.height = \"15px\";\n\tthis.element.style.width = \"15px\";\n\tthis.element.style.borderRadius = \"50%\";\n\tthis.element.style.position = \"absolute\";\n\tthis.element.style.backgroundColor = \"orangered\";\n\tthis.element.style.transform = \"translate(-50%, -50%)\";\n\n\tthis.element.style.left = x + 'px';\n\tthis.element.style.top = y + 'px';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "0c34c4ee863c186b6269e4543ecf0271", "score": "0.5379474", "text": "function dotsReplacer(match) {\n if (match.length > 1) {\n return match;\n }\n\n return '';\n}", "title": "" }, { "docid": "f82a32932d7a0a91402ec192fbdb05f2", "score": "0.5367123", "text": "function doua_zecimale(unRouned, nrOfDecimals) \n{ \n var unRounedString = unRouned.toString();\n var parts = unRounedString.split(\".\");\n \n if (parts.length != 2) \n { \n return unRounedString;\n }\n\n var newDecimals = parts[1].slice(0, nrOfDecimals),\n newString = parts[0].concat('.');\n newString = newString.concat(newDecimals);\n\t \n return newString;\n}", "title": "" }, { "docid": "44669d100d62c6da726bccf5aa987e8a", "score": "0.53537536", "text": "function addDots(scope) {\n scope.List.push({\n value: scope.dots\n });\n }", "title": "" }, { "docid": "44669d100d62c6da726bccf5aa987e8a", "score": "0.53537536", "text": "function addDots(scope) {\n scope.List.push({\n value: scope.dots\n });\n }", "title": "" }, { "docid": "7068789db1a7383a1431d9a5e6b26c8b", "score": "0.533216", "text": "makeText(numWords = 100) {\n const numWordsAv = Object.keys(this.chains).length;\n let randNum, text;\n \n do {\n randNum = Math.floor(Math.random() * numWordsAv);\n text = [Object.keys(this.chains)[randNum]];\n } while (text[0][0] === text[0][0].toLowerCase())\n\n if (text[0].slice(-1) === '.') {\n return text.toString();\n }\n text = text[0].split(\" \");\n\n for (let i = 0; i < numWords - 2; i++) {\n let pair = text.slice(i, i+2).join(\" \");\n\n let randNum = Math.floor(Math.random() * this.chains[pair].length);\n if (this.chains[pair][randNum] === null ) {\n break;\n } else {\n text.push(this.chains[pair][randNum])\n if (this.chains[pair][randNum].slice(-1) ==='.') break;\n }\n }\n return text.join(\" \")\n }", "title": "" }, { "docid": "3edbe34e5d51f78e73a56dca75fad17b", "score": "0.53311133", "text": "function pivot(word){\n var length = word.length;\n\n // Longer words are \"right-weighted\" for easier readability.\n if(length<6){\n\n var bit = 1;\n while(word.length < 22){\n if(bit > 0){\n word = word + '.';\n }\n else{\n word = '.' + word;\n }\n bit = bit * -1;\n }\n\n var start = '';\n var end = '';\n if((length % 2) === 0){\n start = word.slice(0, word.length/2);\n end = word.slice(word.length/2, word.length);\n } else{\n start = word.slice(0, word.length/2);\n end = word.slice(word.length/2, word.length);\n }\n\n var result = [];\n result.push(start.slice(0, start.length -1));\n result.push(start.slice(start.length-1, start.length));\n result.push(end);\n }\n\n else{\n\n var tail = 22 - (word.length + 7);\n word = '.......' + word + ('.'.repeat(tail));\n\n var start = word.slice(0, word.length/2);\n var end = word.slice(word.length/2, word.length);\n\n var result = [];\n result.push(start.slice(0, start.length -1));\n result.push(start.slice(start.length-1, start.length));\n result.push(end);\n\n }\n\n result.forEach(function(item,index,array){\n array[index] = array[index].replace(/\\./g, \"<span class='invisible'>.</span>\")\n });\n\n return result;\n}", "title": "" }, { "docid": "7f6dba81837d7191ae63d6d82382aabf", "score": "0.531484", "text": "function padPeriods(rawText) {\n return String(rawText).split('.').join(' . ')\n}", "title": "" }, { "docid": "3a9d38c665860d330ae10e9dd32a56aa", "score": "0.53118825", "text": "function get_total_bullets(values) {\n\tvar count = 0;\n\tfor (var c1 = 0; c1 < values.length; c1++) {\n\t\tif (values[c1] == \".\") count -= 2;\n\t\telse if (values[c1] != w) count++\n\t\t\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "65b676813058fd3b93ff0611e6297393", "score": "0.5306621", "text": "function addDots(width){\n const height = document.getElementById('canvas').offsetHeight;\n if (dotArray.length < maxDots){\n dotArray.push(new Dot(height, width));\n }\n }", "title": "" }, { "docid": "28da1f1851663054476fab5b9e49a560", "score": "0.53011245", "text": "static Dot(left, right) {\n return left.x * right.x + left.y * right.y + left.z * right.z;\n }", "title": "" }, { "docid": "c0ee680ccbe415207b3368afebbbe559", "score": "0.5299239", "text": "function formattedDivision2(num1, num2) {\n var dividedNum = num1 / num2;\n dividedNum = dividedNum.toFixed(4);\n console.log(dividedNum);\n var leftSide = dividedNum.substring(0, dividedNum.indexOf('.'));\n leftSide = leftSide.split('');\n console.log(leftSide);\n var count = 0;\n var tempList = [];\n for (var i = leftSide.length-1; i >=0; i--) {\n tempList.unshift(leftSide[i]);\n count++;\n if (count === 3) {\n tempList.unshift(',');\n count = 0;\n }\n }\n leftSide = tempList.join('');\n return leftSide + dividedNum.substring(dividedNum.indexOf('.'));\n\n}", "title": "" }, { "docid": "01a6b1a778c6bfcbd6d052717228b1a7", "score": "0.5276911", "text": "function breakDots(val){\r\n \r\n var replacedDollar = val.replace(\"$\", \"\")\r\n\r\n var varTree = replacedDollar.split('.')\r\n var TMP = null\r\n for(let index of varTree){\r\n // console.log('rangeeeeeeeeeeeeeeeeeeeeeee ',range.field)\r\n\r\n if(TMP=== null){\r\n\r\n\r\n if (range[index] == undefined){\r\n console.log('error value does not exist in range')\r\n TMP = null\r\n break\r\n }\r\n\r\n TMP = range[index]\r\n }else{\r\n\r\n if (TMP[index] == undefined){\r\n console.log('error value does not exist in range')\r\n TMP = null\r\n break\r\n }\r\n\r\n TMP = TMP[index]\r\n }\r\n\r\n }\r\n return TMP\r\n }", "title": "" }, { "docid": "050d3d1cbf0a87f7c59c50b6489e92fc", "score": "0.5263342", "text": "function currentDot (n) {\n currentSlide = n;\n showSlide(currentSlide);\n}", "title": "" }, { "docid": "a53d2c7f9cf0900f1c8db956b5be8e8f", "score": "0.526158", "text": "function threeNums(elem){\n var val = elem.value.replace(/[^0-9]/g, \"\");\n elem.value = \"(\" + val.substr(0, 3) + \") -\";\n setCaretPosition(elem, elem.value.length - 3);\n }", "title": "" }, { "docid": "ef9e96346e4688b8e9a34ce191ea6077", "score": "0.5259263", "text": "function pointNumber(number) {\r\n var sep; if(LID === \"de\"){ sep = \".\"; } else { sep = \",\";}\r\n \r\n number = number.toString();\r\n if (number.length > 3) { \r\n var mod = number.length % 3; \r\n var output = (mod > 0 ? (number.substring(0,mod)) : '');\r\n \r\n for (var i=0 ; i < Math.floor(number.length / 3); i++) { \r\n if ((mod == 0) && (i == 0)) {\r\n output += number.substring(mod+ 3 * i, mod + 3 * i + 3); \r\n } else {\r\n output+= sep + number.substring(mod + 3 * i, mod + 3 * i + 3); \r\n }\r\n } \r\n number = output;\r\n }\r\n return number;\r\n}", "title": "" }, { "docid": "bd420b4c5ee52331c806e658bc751a97", "score": "0.5255003", "text": "incDotCounter() {\n if (!this.penType) {\n this.incGhostsDots();\n } else {\n this.incGlobalDots();\n }\n }", "title": "" }, { "docid": "dbde469d773a8d4abff54b022d834a0d", "score": "0.52269554", "text": "function updateDOT() {\r\n for (let i = 0; i < dots.length; i++) {\r\n dots[i].move(changeMNLT);\r\n dots[i].show();\r\n\r\n }\r\n console.log(dots.length);\r\n}", "title": "" }, { "docid": "0005f94b655f95c6e666e597320a15ef", "score": "0.5213976", "text": "function outerEllipsisCommaSeparate(data) {\n const cpData = [...data];\n return cpData.map(el =>\n el.replace(/\\[+(.+?)]+([0-9]+)\\.\\.\\.([0-9]+)/g, (m, _b2, _n, _k) => {\n // m entire matched string\n // b2 square brackets (interior only)\n // n high number\n // k low number\n let n = parseInt(_n, 10); // get the first number\n const k = parseInt(_k, 10);\n const b2 = _b2 === undefined ? '' : _b2;\n\n if (n >= k) {\n // decreasing list\n const a = new Array(n - k + 1).fill(b2);\n return a\n .map(str =>\n str\n .replace(/(\\*)(?!#)/g, n--) // eslint-disable-line no-plusplus\n .replace(/(#)/g, '')\n .toString(),\n )\n .join(', ');\n /*\n Replace a * symbol with a number.\n If there is a sequence *#, then on the first pass, we won't replace it with a number just yet. We'll remove the # symbol on the first pass, so that on the next iteration through outerEllipsisNewLine, we'll make the replacement of *.\n This enables nesting of [ * [ *# ]] (only one level of nesting). First the standalone * is replaced with a number. Then the *# is replaced with *. Then on the next pass, the * is replaced with a number.\n */\n }\n const a = new Array(k - n + 1).fill(b2);\n return a\n .map(str =>\n str\n .replace(/(\\*)(?!#)/g, n++) // eslint-disable-line no-plusplus\n .replace(/(#)/g, '')\n .toString(),\n )\n .join(', ');\n /*\n Replace a * symbol with a number.\n If there is a sequence *#, then on the first pass, we won't replace it with a number just yet. We'll remove the # symbol on the first pass, so that on the next iteration through outerEllipsisNewLine, we'll make the replacement of *.\n This enables nesting of [ * [ *# ]] (only one level of nesting). First the standalone * is replaced with a number. Then the *# is replaced with *. Then on the next pass, the * is replaced with a number.\n */\n }),\n );\n}", "title": "" }, { "docid": "53616b4830436c6b8661aed5f68e5c36", "score": "0.52064794", "text": "function bulletPoints(list) {\r\n return '\\n - ' + list.join('\\n - ')\r\n}", "title": "" }, { "docid": "8e7360861f909e32f8638c77e5488e2a", "score": "0.5203669", "text": "dotEaten() {\n this.remainingDots -= 1;\n\n this.soundManager.playDotSound();\n\n if (this.remainingDots === 174 || this.remainingDots === 74) {\n this.createFruit();\n }\n\n if (this.remainingDots === 40 || this.remainingDots === 20) {\n this.speedUpBlinky();\n }\n\n if (this.remainingDots === 0) {\n this.advanceLevel();\n }\n }", "title": "" }, { "docid": "be1c1b1b36278d51c1fb06ea11e0f94b", "score": "0.5201937", "text": "function addDot() {\n const dot = document.createElement('div');\n dot.id = 'etave-recorder-dot';\n document.body.appendChild(dot);\n}", "title": "" }, { "docid": "facea01c6182a314bb6e2a44eff2b5c1", "score": "0.5196148", "text": "function Dot(props) {\n var isActive = props.isActive === \"true\";\n\n if (isActive) {\n return <span className=\"dot active \"></span>;\n } else {\n return <span className=\"dot\"></span>;\n }\n}", "title": "" }, { "docid": "12869ad57736f2adf0f79d4be9d91a55", "score": "0.519114", "text": "function next() {\n index++;\n c = dot.charAt(index);\n }", "title": "" }, { "docid": "abe23eb02a8c091b9214ca291eb94479", "score": "0.5184321", "text": "function twoLinesEllipsesFunction(description, textValue){ \n \n var twoLinesEllipses = description; \n twoLinesEllipsesText = twoLinesEllipses; \n var twoLinesEllipsesSubStr = twoLinesEllipsesText.substr(0, textValue);\n return twoLinesEllipsesSubStr.trim() + \"...\";\n \n}", "title": "" }, { "docid": "2f58b202197a56f90ffcb7179ac7a928", "score": "0.5177053", "text": "function activeDot() {\n dots.forEach((item) => item.classList.remove(\"active\"));\n dots[index - 1].classList.add(\"active\");\n }", "title": "" }, { "docid": "c9457333e9f73df029b40c963f097e62", "score": "0.5167885", "text": "function addCommas(num) {\n var result=\"\";\n \n var str = num.toString();\n \n var splitStr = str.split(\".\");\n var charsAfterDot = splitStr[1];\n var charsBeforeDot = splitStr[0];\n \n var counter=1;\n for (let i=charsBeforeDot.length-1; i>=0; i--){\n result = charsBeforeDot[i] + result;\n if (counter === 3 && i!== 0){\n result = \",\" + result;\n counter = 0;\n }\n counter++;\n }\n if (str.includes(\".\")) return result + \".\" + charsAfterDot;\n \n return result;\n}", "title": "" }, { "docid": "82bf63390cdb606abd25556b9f150aaf", "score": "0.5165986", "text": "wrapHeadline(){\n let headlineTitle = $(this.selector).find(\".headline .headline-title\");\n headlineTitle.dotdotdot({\n truncate: \"letter\",\n watch: true\n });\n }", "title": "" }, { "docid": "bc7c1f55f4d7ce649c789562ea09ff6f", "score": "0.51621383", "text": "function dotFunc(dotNumber){\n return function(){\n showSlides(index = dotNumber);\n dotActive(index);\n }\n}", "title": "" }, { "docid": "21222fcb3ebbd2f2aa1648e9dd50b776", "score": "0.5160077", "text": "function stringLimitDots(input,length){\n\tif(input!=undefined){\n\t\tif(input.length>length)\n\t\t\treturn input.substring(0,length)+'...';\n\t\treturn input;\n\t}\n\telse return '';\n}", "title": "" }, { "docid": "9d87f81d3a40d06747df3c7cbcdedb65", "score": "0.5156054", "text": "function dottedLine(x, y, w, h) {\r\n fill(\"grey\");\r\n rect(x, y - 4, 800, 5);\r\n for (line = 0; line < 15; line++) {\r\n lineSegment(line * 80 + 1, y, 40, 5);\r\n }\r\n}", "title": "" }, { "docid": "ada96fedf4785ee020b5ae97c190b6df", "score": "0.5152318", "text": "function formataCEP(valor) {\n\tvar valorCep;\n \tif (valor.length == 8) {\n \t/*valor.substring(0,2) + \".\" + */ \n \t\tvalorCep = valor.substring(0,5) + \"-\" + valor.substring(5,8);\n \t} else {\n \t\treturn valor;\n \t}\n \treturn valorCep;\n}", "title": "" }, { "docid": "ad308ecb4a3eb1f351ff8c41e381199d", "score": "0.51457983", "text": "function createDot (left, top) {\n var dot = document.createElement('div')\n dot.className = 'dot'\n dot.style.left = left + 'px'\n dot.style.top = top + 'px'\n dot.style.width = 8 + 'px'\n dot.style.height = 8 + 'px'\n dot.style.borderRadius = 5 + 'px'\n gameboard.appendChild(dot)\n dots.push(dot)\n }", "title": "" }, { "docid": "4433502d9e39330c3ffbc207836eac4d", "score": "0.5141942", "text": "function displayShow(str) {\n if(str.indexOf(\".\") < 0){\n display.textContent = str;\n } else {\n display.textContent = str.substring(0, str.indexOf(\".\") + 4);\n }\n}", "title": "" }, { "docid": "72cfc26860efa26a1f873d362b6de931", "score": "0.5132947", "text": "function analyzeHumanDots() {\n const newTarget = [];\n for (let i = 0; i < blueDots.length; i++) {\n let countDots = 0;\n const pos = blueDots[i];\n const shift = [[20, 0], [- 20, 0], [0, 20], [0, - 20]]\n const dotsAround = [];\n shift.forEach((singleShift) => {\n const neighborDot = [pos[0] + singleShift[0], pos[1] + singleShift[1]];\n dotsAround.push(neighborDot);\n if (redDots.includeElement(neighborDot)) {\n countDots += 1;\n }\n });\n if (countDots === 3) {\n dotsAround.forEach((dot) => {\n if (empty(dot)) {\n newTarget.push(dot);\n }\n });\n }\n }\n return newTarget;\n}", "title": "" }, { "docid": "f58340b43783cc59a2882e4cfee16202", "score": "0.51278526", "text": "function dotAtomText() {\n var s, maybeText;\n s = wrap('dot-atom-text', star(atext, 1)());\n if (s === null) { return s; }\n maybeText = star(and(literal('.'), star(atext, 1)))();\n if (maybeText !== null) {\n add(s, maybeText);\n }\n return s;\n }", "title": "" }, { "docid": "31b92075c6bb44ed205ff21829a0e4fb", "score": "0.51193684", "text": "static Dot(left, right) {\n return (left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w);\n }", "title": "" }, { "docid": "cb75b1d4db47084f02aa005c1263f558", "score": "0.5115059", "text": "function Separator() {\n}", "title": "" }, { "docid": "7ab89fd0527d1ad29d1bc1ecba511ddf", "score": "0.5112989", "text": "function pad3(word) {\r\n\tword=word.toLowerCase();\r\n \tvar m=word.length % 3;\r\n\r\n \tif (m==0) {return word;}\r\n \tif (m==1) {return word+' ';}\r\n \tif (m==2) {return word+' ';}\r\n \tthrow(\"WTF\");\r\n}", "title": "" }, { "docid": "8336b3832429d2177336733eb86104d4", "score": "0.511221", "text": "function colorTheDots(d) {\n if( d.color == \"\") {\n return \"#aaa\";\n } else {\n return d.color; }\n }", "title": "" }, { "docid": "1ee05871ba2178e9504101ff722a29b5", "score": "0.5108276", "text": "function dotAtom() {\n return wrap('dot-atom', and(invis(opt(cfws)), dotAtomText, invis(opt(cfws)))());\n }", "title": "" }, { "docid": "a2e838c77d067da85a421f1b5d2650e7", "score": "0.5086482", "text": "function elipsisTimer() {\n\tconsole.log(\"elipsisTimer tic\");\n\tvar elipsisCnt = 0;\n\t\n\telipsisInterval = setInterval(function(){\n\t\tif (elipsisCnt < 3) {\n\t\t\t$(\".elipsis\").append(\".\");\n\t\t\telipsisCnt++;\n\t\t} else {\n\t\t\t$(\".elipsis\").empty();\n\t\t\telipsisCnt = 0;\n\t\t}\n\t},500);\n}", "title": "" }, { "docid": "f337c67a1b1b74fbb8ff3f3e40963d00", "score": "0.50838065", "text": "function r(e,t){const n=t.split(\".\"),r=n.length;let o=n[0];for(let t=1;t<r;++t){if(null!=e[o])return!0;o+=\".\"+n[t]}return null!=e[o]}", "title": "" }, { "docid": "2ce1907e4e43d33928fc7fca68210c48", "score": "0.5082739", "text": "function dot(v:V3) : number {\r\n\t return this.x * v.x + this.y * v.y + this.z * v.z;\r\n\t}", "title": "" }, { "docid": "c9d493db9b525e906bcb1284ca180fdd", "score": "0.5076316", "text": "function multiplePresentation(item, decimals) {\n var output = []\n if (item == \"NA\" || item == \"NM\" || item == \"Infinity\") {\n output.push(\"-\")\n } else {\n output.push(item.toFixed(decimals)+\"x\")\n }\n return output\n}", "title": "" }, { "docid": "d0a7dbafc3bc3e3831f3fcc66811c312", "score": "0.5073139", "text": "function readToken_dot() {\n var next = input.charCodeAt(tokPos+1);\n if (next >= 48 && next <= 57) return readNumber(true);\n ++tokPos;\n return finishToken(_dot);\n }", "title": "" }, { "docid": "7532add3864be7b343855fd289b05722", "score": "0.50721854", "text": "function darFormato(precio) {\n\n\tvar number = precio.toString();\n\tvar result = '';\n\n\twhile(number.length > 3 ){\n\t result = '.' + number.substr(number.length - 3) + result;\n\t number = number.substring(0, number.length - 3);\n\t}\n\n\tresult = number + result;\n\n\treturn result;\n}", "title": "" }, { "docid": "a78ab54dec7db0c8232fd7ec9dae07c9", "score": "0.50720894", "text": "function firstSentence(text){\n return text.split(\".\",2)[0] + \".\";\n}", "title": "" } ]
0780135f4cdb930dd8ff90dc125810b3
Functions used across Carousels Prepends navigation arrows to the element
[ { "docid": "d6f9e9188ba60ee19871df08aaadb66f", "score": "0.7208837", "text": "function prependNavigation(el) {\n if (settings.navPrev) {\n var prevNav = $(\"<button class='carousel-nav prev' aria-label='Previous'></button>\")\n .addClass(settings.navPrevClass)\n .html(settings.navPrevContent);\n el.prepend(prevNav);\n }\n if (settings.navNext) {\n var nextNav = $(\"<button class='carousel-nav next' aria-label='Next'></button>\")\n .addClass(settings.navNextClass)\n .html(settings.navNextContent);\n el.prepend(nextNav);\n }\n }", "title": "" } ]
[ { "docid": "afaee550f1e0288bb02c2467e230e668", "score": "0.71639585", "text": "function appendArrows() {\n var wrapper = create('div', {\n \"class\": classes.arrows\n });\n append(wrapper, prev);\n append(wrapper, next);\n var slider = Elements.slider;\n var parent = Splide.options.arrows === 'slider' && slider ? slider : root;\n before(wrapper, parent.firstElementChild);\n }", "title": "" }, { "docid": "e328f1742aae6fca3e498402aff4383a", "score": "0.70579463", "text": "function product_slider_arrows($product_list_slider){\n\n if( !$product_list_slider.length ){ return; }\n\n // controler\n $('.products_list_slider_prev').click(function(e){\n e.preventDefault();\n $product_list_slider.slick('slickPrev');\n });\n $('.products_list_slider_next').click(function(e){\n e.preventDefault();\n $product_list_slider.slick('slickNext');\n });\n\n}", "title": "" }, { "docid": "457845155c9241f8c53e5b74b85f5f12", "score": "0.6809646", "text": "function showArrows() {\n var arrowsContainer = document.createElement('div');\n arrowsContainer.classList.add(genericArrowsContainerClass, crslArrowsContainerClass);\n if(options.elem === 'topBannerSlider') {\n element.parentElement.appendChild(arrowsContainer);\n } else {\n element.appendChild(arrowsContainer);\n }\n var buttonPrev = document.createElement('span');\n buttonPrev.classList.add(genericArrowPrevClass, crslArrowPrevClass);\n var buttonNext = document.createElement('span');\n buttonNext.classList.add(genericArrowNextClass, crslArrowNextClass);\n buttonPrev.addEventListener('click', showPrev);\n buttonNext.addEventListener('click', showNext);\n arrowsContainer.appendChild(buttonPrev);\n arrowsContainer.appendChild(buttonNext);\n }", "title": "" }, { "docid": "a35405fbe0ac77f1834f963b599a4c5e", "score": "0.68055445", "text": "createNavigation() {\n\t\tlet nextButton = this.createDivWithClass('carousel__next');\n\t\tlet prevButton = this.createDivWithClass('carousel__prev');\n\t\tthis.root.appendChild(nextButton);\n\t\tthis.root.appendChild(prevButton);\n\n\t\tnextButton.addEventListener('click', this.next.bind(this));\n\t\tprevButton.addEventListener('click', this.prev.bind(this));\n\n\t\tif (this.options.loop === true) {\n\t\t\treturn;\n\t\t}\n\t\tthis.onMove((index) => {\n\t\t\tif (index === 0) {\n\t\t\t\tprevButton.classList.add('carousel__prev--hidden');\n\t\t\t} else {\n\t\t\t\tprevButton.classList.remove('carousel__prev--hidden');\n\t\t\t}\n\n\t\t\tif (this.items[this.currentItem + this.slidesVisible] === undefined) {\n\t\t\t\tnextButton.classList.add('carousel__next--hidden');\n\t\t\t} else {\n\t\t\t\tnextButton.classList.remove('carousel__next--hidden');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "8799b44a0d2b8064ef4e563b923203fc", "score": "0.6764991", "text": "function buildArrows() {\n if (SETTINGS.arrows) {\n prevBtn = element.appendChild(createButton(SETTINGS.prevBtn, '&lt;'));\n nextBtn = element.appendChild(createButton(SETTINGS.nextBtn, '&gt;'));\n }\n }", "title": "" }, { "docid": "67861258cbe8ad2400aa3590f9a17b22", "score": "0.67335945", "text": "function enableArrowNav() {\n\t$('.slick-list').first().attr('tabindex', 0).focus();\n}", "title": "" }, { "docid": "b50f999b4315f65c98d5a225b5ee525c", "score": "0.66146785", "text": "function createArrows () {\n\t var leftArrow = template({ direction: 'left' })\n\t var rightArrow = template({ direction: 'right' })\n\n\t indicatorEl.insertAdjacentHTML('afterbegin', leftArrow)\n\t indicatorEl.insertAdjacentHTML('beforeend', rightArrow)\n\n\t var arrows = indicatorEl.querySelectorAll('.ds-carousel-arrow')\n\n\t return Array.prototype.slice.call(arrows)\n\t }", "title": "" }, { "docid": "493412e92a7f6529565ccc2e9533c160", "score": "0.6602079", "text": "function arrowNavigate( forward ){\n\t\t\t\tif( forward ){\n\t\t\t\t\tnext();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprev();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "0282eb4762dc06b57f2283201266b561", "score": "0.6569163", "text": "function createSlideArrows(section){\r\n var prev = document.createElement('div');\r\n prev.className = SLIDES_ARROW_PREV;\r\n\r\n var next = document.createElement('div');\r\n next.className = SLIDES_ARROW_NEXT;\r\n\r\n var slides = $(SLIDES_WRAPPER_SEL, section);\r\n\r\n if(options.controlArrowColor != '#fff'){\r\n setCss(next, 'border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n setCss(prev, 'border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n slides.parentNode.appendChild(prev);\r\n slides.parentNode.appendChild(next);\r\n\r\n if(!options.loopHorizontal){\r\n $(SLIDES_ARROW_PREV_SEL, section).style.display = 'none';\r\n }\r\n }", "title": "" }, { "docid": "d6b1e12c0f75377d984abdb37375ab67", "score": "0.65379906", "text": "function createSlideArrows(section){\n\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n\n\n if(options.controlArrowColor !== '#fff'){\n\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n\n }\n\n\n\n if(!options.loopHorizontal){\n\n hide($(SLIDES_ARROW_PREV_SEL, section));\n\n }\n\n }", "title": "" }, { "docid": "616d87a4559774e381c0feda0d1759eb", "score": "0.64915097", "text": "function showArrows() {\n var buttonPrev = document.createElement('button');\n buttonPrev.innerHTML = arrPrevText;\n buttonPrev.classList.add(crslArrowPrevClass);\n\n var buttonNext = document.createElement('button');\n buttonNext.innerHTML = arrNextText;\n buttonNext.classList.add(crslArrowNextClass);\n\n buttonPrev.addEventListener('click', showPrev);\n buttonNext.addEventListener('click', showNext);\n\n element.appendChild(buttonPrev);\n element.appendChild(buttonNext);\n }", "title": "" }, { "docid": "3554f77e39252f6090950632d9975a12", "score": "0.64902693", "text": "function shiftCarousel(arrow) {\n\n if (arrow.hasClass('inactive')) {\n return false;\n }\n\n //updateCarDims();\n\n updateCarPos();\n\n // Prev / Next\n if (arrow.hasClass('arrow-prev')) {\n\n // <<< Prev\n nextPos = curPos + shiftSize;\n if (nextPos >= arrowSize) {\n nextPos = arrowSize;\n }\n\n // move carousel\n carousel.css(tabDir, nextPos + 'px');\n } else {\n\n // >>> Next\n nextPos = curPos - shiftSize;\n carLimit = -(carSize + arrowSize - carWrapSize);\n if (nextPos <= carLimit) {\n nextPos = carLimit;\n }\n\n // move carousel\n carousel.css(tabDir, nextPos + 'px');\n }\n\n // update arrow classes\n updateArrowClass();\n }", "title": "" }, { "docid": "fb6617a7e0f747bf3eec46bde8ed49fd", "score": "0.6487083", "text": "function setCarouselArrows() {\n\tvar windowW = window.innerWidth || $j(window).width();\n\tvar setArrowPos = function(windowW) {\n\t\tif (windowW < 480) {\n\t\t\tif ($j('.carousel-products-mobile.slick-initialized').length || $j('.carousel-products.slick-initialized').length){\n\t\t\t\t$j('.carousel-products-mobile').each(function() {\n\t\t\t\t\tvar imgH = $j(this).find('.slick-list .slick-track .slick-slide:first-child img').height();\n\t\t\t\t\t$j(this).find('.slick-arrow').css({'top': imgH/2 + 'px'});\n\t\t\t\t})\t\t\t\t\t\n\t\t\t\t$j('.carousel-products').each(function() {\n\t\t\t\t\tif ($j(this).parent().parent().find('.carousel-products__button').length > 0) {\n\t\t\t\t\t\tvar imgH = $j(this).find('.slick-list .slick-track .slick-slide:first-child img').height();\n\t\t\t\t\t\tvar titleH = $j(this).parent().parent().find('.title-with-button').height();\n\t\t\t\t\t\t$j(this).parent().parent().find('.carousel-products__button').css({'top': imgH/2 + titleH + 'px'});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t} else {\n\t\t\t$j('.carousel-products').each(function() {\n\t\t\t\tif ($j(this).parent().parent().find('.carousel-products__button').length > 0) {\n\t\t\t\t\t$j(this).parent().parent().find('.carousel-products__button').css({'top': ''});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar imgH = $j(this).find('.slick-list .slick-track .slick-slide:first-child img').height();\n\t\t\t\t\t$j(this).find('.slick-arrow').css({'top': imgH/2 + 'px'});\n\t\t\t\t}\n\t\t\t})\n\t\t}\t\t\n\t}\n\tsetArrowPos(windowW);\n\t$j(window).resize(debouncer(function(e) {\n\t\tvar currentW = window.innerWidth || $j(window).width();\n\t\tsetArrowPos(currentW);\n\t}))\n}", "title": "" }, { "docid": "11ce4725b19ed6f3d2a47240c2c36d25", "score": "0.645097", "text": "function setNavigation(){\n oSlider.oSliderWrapper.find('.quick-slider-nav-dots').removeClass('active');\n $(oSlider.oSliderWrapper.find('.quick-slider-nav-dots').get(oSlider.iNextSlide)).addClass('active');\n }", "title": "" }, { "docid": "b678f57989d34203eca2727cea76fc17", "score": "0.64488685", "text": "renderArrows() {\n if (this.props.options.arrows) {\n return (\n <>\n <Arrow\n direction=\"left\"\n clickFunction={this.previousSlide}\n glyph=\"&#9664;\"\n />\n\n <ImageSlide url={this.props.imgUrls[this.state.currentImageIndex]} />\n\n <Arrow\n direction=\"right\"\n clickFunction={this.nextSlide}\n glyph=\"&#9654;\"\n />\n </>\n );\n } else {\n //This is for the auto slide function, the delay is for a smooth fade in/out transition\n return (\n <ImageSlide\n url={this.props.imgUrls[this.state.currentImageIndex]}\n transitionDelay={this.props.options.transitionDelay}\n />\n );\n }\n }", "title": "" }, { "docid": "bda16ee4fd871d944ec9104db346f6e9", "score": "0.6422049", "text": "function basicCarouselNav(){\n let idx=this.getAttribute(\"index\")\n let classStr = basicImages[topIdx].className;\n classStr = classStr.replace(\"top\", \"\");\n basicImages[topIdx].className=classStr;\n classStr = basicNavDots[topIdx].className;\n classStr= classStr.replace(\"active\", \"\");\n basicNavDots[topIdx].className=classStr\n topIdx=idx;\n activateElements(topIdx);\n}", "title": "" }, { "docid": "95a9eecc946a94d9eea28d3d4bbef2ba", "score": "0.6401884", "text": "function createNavigationArrows() {\t\t\t\t\t\t\n\t\t\tvar initialOpacity = self.settings.hideNavigationArrows == true ? 0 : 1,\n\t\t\t\n\t\t\t\tarrowNavigation = $('<div class=\"arrow-navigation\"></div>').appendTo(slider),\n\t\t\t\n\t\t\t\tleftArrow = $('<a class=\"left-arrow\"></a>').css('opacity', initialOpacity)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .mouseover(function(){$(this).stop().css('opacity', 1)})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .click(function(){previousSlide();})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .appendTo(arrowNavigation),\n\t\t\t\n\t\t\t\trightArrow = $('<a class=\"right-arrow\"></a>').css('opacity', initialOpacity)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .mouseover(function(){$(this).stop().css('opacity', 1)})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .click(function(){nextSlide();})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .appendTo(arrowNavigation);\n\t\t}", "title": "" }, { "docid": "c7c763e5177955205c0b1020b457057a", "score": "0.6397029", "text": "function addNavigation() {\n let length = this.innerElements.length;\n const BUTTONS = document.querySelectorAll('.slider__navigation-button');\n for (let i = 0; i < length; i++) {\n BUTTONS[i].addEventListener('click', () => this.goTo(i));\n }\n }", "title": "" }, { "docid": "70fa40087deee2e1a114cc65ab72c550", "score": "0.63653076", "text": "_onPrev(e) {\n this.goToItem(parseInt(this.$.carouselprev.getAttribute(\"index\")));\n }", "title": "" }, { "docid": "17b150a3c132276906f0d523ef51482b", "score": "0.6359887", "text": "function movearrows() {\n\t\tvar $vitarr = $('.html5 .vitalii a.arrow');\n\n\t\t$vitarr.transition({\n\t\t\tx: 10\n\t\t}, 1500).transition({\n\t\t\tx: 0\n\t\t}, 1500, movearrows);\n\t}", "title": "" }, { "docid": "bbdf2069c472c3d443082f653aee288c", "score": "0.6328379", "text": "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 }", "title": "" }, { "docid": "bbdf2069c472c3d443082f653aee288c", "score": "0.6328379", "text": "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 }", "title": "" }, { "docid": "7a51567236f2782de0ff9740a5f9be11", "score": "0.6319916", "text": "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 }", "title": "" }, { "docid": "7a51567236f2782de0ff9740a5f9be11", "score": "0.6319916", "text": "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 }", "title": "" }, { "docid": "7a51567236f2782de0ff9740a5f9be11", "score": "0.6319916", "text": "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 }", "title": "" }, { "docid": "7a51567236f2782de0ff9740a5f9be11", "score": "0.6319916", "text": "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 }", "title": "" }, { "docid": "7a51567236f2782de0ff9740a5f9be11", "score": "0.6319916", "text": "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 }", "title": "" }, { "docid": "7a51567236f2782de0ff9740a5f9be11", "score": "0.6319916", "text": "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 }", "title": "" }, { "docid": "9ef0fd789670945e4ce47daacf47e1e2", "score": "0.6314174", "text": "function appendarrowControls()\n\t{\n\t\tvar prev = jQuery(\"<a href='#'>\").addClass('q-prev');\n\t\tparent.append(prev);\n\t\tvar next = jQuery(\"<a href='#'>\").addClass('q-next');\n\t\tparent.append(next);\n\t\t\n\t\tparent.find(\".q-prev\").bind(\"click\",function(e){\n\t\t\t var index = current.index()-1;\n\t\t\t if(first_bool==true&&index==0)\n\t\t\t index = 4; \n\t\t\t \n\t\t\t if(index<0)\n\t\t\t index = li.length-1;\n\t\t\t setImage(index); \n\t\t\t e.preventDefault();\n\t\t\t});\n\t\tparent.find(\".q-next\").bind(\"click\",function(e){\n\t\t\t var index = current.index()+1;\n\t\t\t if(first_bool==true&&index==2)\n\t\t\t index = 1; \n\t\t\t \n\t\t\t if(index>li.length-1)\n\t\t\t index = 0;\n\t\t\t setImage(index); \n\t\t\t e.preventDefault();\n\t\t\t});\t\n\t\t\n\t}", "title": "" }, { "docid": "ce68a5854b64513ec1be553793433688", "score": "0.6283574", "text": "function pressNavigeer() {\n if (e.keyCode == '37') {\n fotoCarousel.style.transform = \"translateX(312px)\";\n // linker pijl\n } else(e.keyCode == '39') {\n fotoCarousel.style.transform = \"translateX(-312px)\";\n // rechter pijl\n }\n}", "title": "" }, { "docid": "5273ce9e38632c7c4872a07d91bcfc9c", "score": "0.6250399", "text": "function createSlideArrows(section) {\n\t\t\tsection.find('.fp-slides').after('<div class=\"fp-controlArrow fp-prev\"></div><div class=\"fp-controlArrow fp-next\"></div>');\n\n\t\t\tif (options.controlArrowColor != '#fff') {\n\t\t\t\tsection.find('.fp-controlArrow.fp-next').css('border-color', 'transparent transparent transparent ' + options.controlArrowColor);\n\t\t\t\tsection.find('.fp-controlArrow.fp-prev').css('border-color', 'transparent ' + options.controlArrowColor + ' transparent transparent');\n\t\t\t}\n\n\t\t\tif (!options.loopHorizontal) {\n\t\t\t\tsection.find('.fp-controlArrow.fp-prev').hide();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e50493258a2a15d06384d2b3b1b4635b", "score": "0.62283427", "text": "function initCarousel() { \r\n let carousels = document.getElementsByClassName(\"carousel\"); //gets the class from dom\r\n carousels.length && Array.from(carousels).forEach(function (carousel) {\r\n let slides = carousel.querySelectorAll(\".slide\"); //slide is the class given to all the carousel divs\r\n let slideCount = Math.min(slides.length, 6); // gets all the divs\r\n let currentPosition = 0;\r\n let prevButton = carousel.querySelector(\"#next-button\"); // ID of \"->\"\r\n let nextButton = carousel.querySelector(\"#prev-button\");// ID of \"<-\"\r\n function removeSlides() { // Function that removes slides\r\n Array.from(slides).forEach(slide => {\r\n if (slide.parentElement) {\r\n slide.parentElement.removeChild(slide);\r\n }\r\n });\r\n }\r\n\r\n function renderSlides() {\r\n removeSlides(); // Function that renders slides in different order(+1 pos to prev positions)\r\n for (let index = 0; index < slideCount; index++) {\r\n let slide = slides[(index + currentPosition) % slides.length];\r\n carousel.insertBefore(slide, nextButton);\r\n }\r\n }\r\n\r\n prevButton.onclick = function () { //when \"<-\" is clicked \r\n currentPosition = (currentPosition - 1 + slides.length) % slides.length;\r\n renderSlides(); //function call\r\n }\r\n nextButton.onclick = function () { //when \"->\" is clicked \r\n currentPosition = (currentPosition + 1) % slides.length;\r\n renderSlides(); //function call\r\n }\r\n removeSlides();\r\n renderSlides();\r\n })\r\n}", "title": "" }, { "docid": "b3c73142f1250f3ac5d2515141a4af8e", "score": "0.6210197", "text": "function navHorizontal(forward) {\n if (!app.isInputFocused() && !app.fullAdVisible) {\n app.updateNavItems();\n // jump to array index for continuous horizontal navigation\n var currentTabIndex = app.currentNavId;\n for (var i = 0; i < app.navItems.length; i++) {\n if (getNavTabIndex(i) == currentTabIndex) {\n var next = i;\n next += forward ? 1 : -1;\n if (next >= app.navItems.length) {\n next = 0;\n } else if (next < 0) {\n next = app.navItems.length - 1;\n }\n focusActiveButton(app.navItems[next]);\n break;\n }\n }\n }\n }", "title": "" }, { "docid": "b6ee362477ae23fb057d9b04c6ae8a06", "score": "0.6194444", "text": "function addNavigation(tl) {\n if (tl.items.length > tl.settings.visibleItems) {\n var prevArrow = document.createElement('button');\n var nextArrow = document.createElement('button');\n var topPosition = tl.items[0].offsetHeight;\n prevArrow.className = 'timeline-nav-button timeline-nav-button--prev';\n nextArrow.className = 'timeline-nav-button timeline-nav-button--next';\n prevArrow.textContent = 'Previous';\n nextArrow.textContent = 'Next';\n prevArrow.style.top = topPosition + 'px';\n nextArrow.style.top = topPosition + 'px';\n if (currentIndex === 0) {\n prevArrow.disabled = true;\n } else if (currentIndex === tl.items.length - tl.settings.visibleItems) {\n nextArrow.disabled = true;\n }\n tl.timelineEl.appendChild(prevArrow);\n tl.timelineEl.appendChild(nextArrow);\n }\n }", "title": "" }, { "docid": "04260d154ef4ee47fe76804c6bc95804", "score": "0.61828876", "text": "function createArrows(conveyorEl, numSlides) {\n\t\t\tdestroyArrows(); // re-draw arrows in case number of slides has changed\n\t\t\tif (numSlides < 2) {\n\t\t\t\treturn; // Only show arrows if more than one slide\n\t\t\t}\n\t\t\tconveyorEl.innerHTML += \"<div class='conveyor-ctrl-left'><a class='conveyor-prev'>\" +\n \t\t\t\t\"<span class='icon icon-arrow-left'></span>\" +\n \t\t\t\t\t\"</a></div>\" +\n\t\t\t\t\t\t\t\t\t\"<div class='conveyor-ctrl-right'><a class='conveyor-next'>\" +\n \t\t\t\t\"<span class='icon icon-arrow-right'></span>\" +\n \t\t\t\t\t\"</a></div>\";\n\n\t\t\tvar prevArrow = conveyorEl.getElementsByClassName(\"conveyor-prev\")[0];\n\t\t\tvar nextArrow = conveyorEl.getElementsByClassName(\"conveyor-next\")[0];\n\n\t\t\tif (!prevArrow || !nextArrow) {\n throw {error: \"Conveyor: Unable to create arrows\"};\n\t\t\t}\n\t\t\tprevArrow.addEventListener(\"click\", prevArrowClickHandler);\n\t\t\tnextArrow.addEventListener(\"click\", nextArrowClickHandler);\n\t\t}", "title": "" }, { "docid": "1ac2dee3425c06c8e7af145b9f10e0ec", "score": "0.61573184", "text": "goPrev() {\n\t\tthis.carouselIndex--;\n\t\tthis.navigate();\n\t}", "title": "" }, { "docid": "6fdf469e5db83cac10a0bb1c2d65696d", "score": "0.6148546", "text": "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 }", "title": "" }, { "docid": "6fdf469e5db83cac10a0bb1c2d65696d", "score": "0.6148546", "text": "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 }", "title": "" }, { "docid": "6fdf469e5db83cac10a0bb1c2d65696d", "score": "0.6148546", "text": "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 }", "title": "" }, { "docid": "6fdf469e5db83cac10a0bb1c2d65696d", "score": "0.6148546", "text": "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 }", "title": "" }, { "docid": "6fdf469e5db83cac10a0bb1c2d65696d", "score": "0.6148546", "text": "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 }", "title": "" }, { "docid": "325db4255bc7bee4c75c4e926fbcfe25", "score": "0.61430484", "text": "toggleArrows () {\n //no left arrow past index 0\n this.currentIndex === 0 ? \n $('#left-arrow').css('display','none') : $('#left-arrow').css('display','');\n //no right arrow past last index\n (this.currentIndex === this.dataLength - 1) || (this.dataLength < 1) ? \n $('#right-arrow').css('display','none') : $('#right-arrow').css('display','');\n }", "title": "" }, { "docid": "48b3ed66bc90e736120e1d37c0ff9ef0", "score": "0.6126375", "text": "function updateArrowUpdater(){\n\n if(pageNodeCounter >= pages.length - 1){\n rightArrow.style.display = 'none';\n leftArrow.style.display = 'inline';\n }\n else if(pageNodeCounter == 0){\n leftArrow.style.display = 'none';\n rightArrow.style.display = 'inline'\n }\n else if(pageNodeCounter != 0){\n leftArrow.style.display = 'inline';\n rightArrow.style.display = 'inline';\n }\n changeSliderColor();\n}", "title": "" }, { "docid": "39fbfcc9c63baabf25a2bbebd2781d7d", "score": "0.61217207", "text": "function carousel_initCallback(carousel) {\n jQuery('#slideshow_nav_wrapper .next_button').bind('click', function() {\n carousel.next();\n return false;\n });\n \n jQuery('#slideshow_nav_wrapper .previous_button').bind('click', function() {\n carousel.prev();\n return false;\n });\n }", "title": "" }, { "docid": "3d62d9e68e66d5185073ab7fb4c9bd63", "score": "0.61214423", "text": "function updateArrowClass() {\n\n updateCarPos();\n\n // Prev Arrow\n if (nextPos >= arrowSize) {\n $('.arrow-prev').removeClass('active');\n $('.arrow-prev').addClass('inactive');\n } else {\n $('.arrow-prev').removeClass('inactive');\n $('.arrow-prev').addClass('active');\n }\n\n // Next Arrow\n carLimit = -(carSize + arrowSize - carWrapSize);\n\n if (nextPos <= carLimit) {\n $('.arrow-next').removeClass('active');\n $('.arrow-next').addClass('inactive');\n } else {\n $('.arrow-next').removeClass('inactive');\n $('.arrow-next').addClass('active');\n }\n }", "title": "" }, { "docid": "fbdf70ed474363657e49b3515587bcb0", "score": "0.6114022", "text": "function carouselLinksApproach() {\n $('#approach-interior .carousel-linked-nav > li > a').click(function() {\n var item = Number($(this).attr('href').substring(1));\n $('#approach-interior .carousel').carousel(item - 1);\n $('#approach-interior .carousel-linked-nav .active').removeClass('active');\n $(this).parent().addClass('active');\n return false;\n });\n }", "title": "" }, { "docid": "637b1ec0a6dfec0a50254393f7de6096", "score": "0.6108474", "text": "function arrow(slideNumber) {\n displaySlide(slideIndex += slideNumber);\n}", "title": "" }, { "docid": "e3d0d2407493b67ef1e67841baff8d4e", "score": "0.6102646", "text": "function sliderArrow(div_container, index, timer, dots, arrows, counter, limit) {\n var container = '';\n if (typeof div_container !== 'string') { container = div_container.id.toString(); } else { container = div_container; }\n //Validating the arrows index.\n if (index < 0) { index = (parseInt(limit) - 1); }\n if (index >= limit) { index = 0; }\n //Removing the current slide\n document.querySelector('.mySlides').remove();\n document.querySelector('.dot_container').remove();\n //Create the new one.\n ARC.slider(slide_pictures, container, index, timer, dots, arrows, counter, slide_captions);\n}", "title": "" }, { "docid": "35413d902c3d3d7cae5952abd3f87b16", "score": "0.60897", "text": "function moveCarousel(activeItem, nextItem) {\n\t\ttl1.to(activeItem, 0.3, { autoAlpha:0, display:'none' })\n\t\t.to(nextItem, 0.3, { display:'block', autoAlpha:1 })\n\t}", "title": "" }, { "docid": "58599ee68d788ae63da2fbb5252bb001", "score": "0.60834724", "text": "function setPrevNextArrows(currentPage, moveDirection){\n var prevNextPages = getPrevNextPages(currentPage),\n pageControlPrev = $('#pages .page-control.prev'),\n pageControlNext = $('#pages .page-control.next');\n \n pageControlPrev.fadeOut(100);\n pageControlNext.fadeOut(100);\n \n //If the previous link should be shown change the text and fade it in.\n if(prevNextPages['prev'] != false){\n pageControlPrev.html(getLinkString(prevNextPages['prev']));\n pageControlPrev.fadeIn(100);\n }\n \n //If the next link should be showng change the text and fade it in.\n if(prevNextPages['next'] != false){\n pageControlNext.html(getLinkString(prevNextPages['next']));\n pageControlNext.fadeIn(100);\n } \n}", "title": "" }, { "docid": "16e3345c630777a960c6d95c81bf8168", "score": "0.60738635", "text": "function setProductArrows() {\n\tvar windowW = window.innerWidth || $j(window).width();\n\tvar setArrowPos = function(windowW) {\n\t\tif (windowW > 1199) {\n\t\t\tvar imgH = $j('.product-main-image img').height();\n\t\t\t$j('#productPrevNext > a').css({'top': imgH/2 + 'px'});\n\t\t}\n\t}\n\tsetArrowPos(windowW);\n\t$j(window).resize(debouncer(function(e) {\n\t\tvar currentW = window.innerWidth || $j(window).width();\n\t\tsetArrowPos(currentW);\n\t}))\n}", "title": "" }, { "docid": "82af61e06a51f62c5dab61595e3552e0", "score": "0.6072045", "text": "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 }", "title": "" }, { "docid": "e9f67e6b34b29f1ad706d37909f0ac95", "score": "0.6069383", "text": "function createNavButtons($el){\n $el.append(\"<div id='prev' class ='nav-button'>Left</div>\");\n $el.append(\"<div id = 'next' class ='nav-button'>Right</div>\");\n\n\n}", "title": "" }, { "docid": "3bf7f5460494c7f9c6792ee7aa886ccf", "score": "0.6064099", "text": "function MakePagerNavigation(container, className) {\r\n\tcontainer.find('.' + className + '.next').click(function () {\r\n next();\r\n });\r\n\r\n container.find('.' + className + '.previous').click(function () {\r\n previous();\r\n });\r\n\r\n function next() {\r\n if (current < length) {\r\n current += 1;\r\n container.animate({ left: '-=100%' });\r\n\r\n }\r\n };\r\n\r\n function previous() {\r\n if (current > 0) {\r\n current -= 1;\r\n container.animate({ left: '+=100%' });\r\n }\r\n };\r\n}", "title": "" }, { "docid": "50bd33594aa8e2f40fc889af1aa2bcca", "score": "0.6053919", "text": "navigate() {\n\t\tconst dots = document.querySelectorAll('.zwing__dot');\n\t\t\n\t\t// Loop!\n\t\tif (this.carouselIndex < 0) { this.carouselIndex = this.children.length - 1; }\n\t\tif (this.carouselIndex === this.children.length) { this.carouselIndex = 0; }\n\t\t\n\t\t// Reset!\n\t\tArray.from(this.children).forEach((child, index) => {\n\t\t\tchild.classList.remove('zwing__active', 'zwing__prev', 'zwing__next');\n\t\t\tdots && dots[index] && dots[index].classList.remove(this.activeDotClass);\n\t\t});\n\t\t\n\t\t// Set classes!\n\t\tconst _el = this.children && this.children[this.carouselIndex];\n\t\tconst _prev = _el && _el.previousElementSibling;\n\t\tconst _next = _el && _el.nextElementSibling;\n\t\t\n\t\t_el && _el.classList.add('zwing__active');\n\t\t_prev && _prev.classList.add('zwing__prev');\n\t\t_next && _next.classList.add('zwing__next');\n\t\t\n\t\t// Set dots!\n\t\tif (this.dots) {\n\t\t\tdots && dots[this.carouselIndex] && dots[this.carouselIndex].classList.add(this.activeDotClass);\n\t\t}\n\t\t\n\t\t// Dynamic height, with Web Animations (if allowed)!\n\t\tif (!this.context.animate) {\n\t\t\tthis.context.animate({\n\t\t\t\t\theight: [`${this.context.offsetHeight}px`, `${_el.offsetHeight + 16}px`]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tduration: 300,\n\t\t\t\t\teasing: 'ease',\n\t\t\t\t\tfill: 'both',\n\t\t\t\t});\n\t\t} else {\n\t\t\tthis.context.style.height = `${_el.offsetHeight + 16}px`;\n\t\t}\n\t}", "title": "" }, { "docid": "aa2c3ab19da46e667ddd7a5ffd56e661", "score": "0.6050388", "text": "function changeNavsThump() {\n var activeItemIndex = parseInt(\n $(\".main-owl-carou .owl-item.active\").index()\n ),\n // if active item is first item then set last item bg-image in .owl-prev-thump\n // else set previous item bg-image\n prevItemIndex = activeItemIndex != 0 ? activeItemIndex - 1 : owlLen - 1,\n // if active item is last item then set first item bg-image in .owl-next-thump\n // else set next item bg-image\n nextItemIndex = activeItemIndex != owlLen - 1 ? activeItemIndex + 1 : 0;\n\n $(\".main-owl-carou.owl-carousel .owl-prev-thump\").css({\n backgroundImage: \"url(\" + itemsBgArray[prevItemIndex] + \")\",\n });\n\n $(\".main-owl-carou.owl-carousel .owl-next-thump\").css({\n backgroundImage: \"url(\" + itemsBgArray[nextItemIndex] + \")\",\n });\n }", "title": "" }, { "docid": "3d65e5447faf68f204d25fa1a33009c1", "score": "0.60496217", "text": "function setArrowState($el) {\n\t\t\t// old api helper here. \n\t\t\tif( $el.closest( \"[data-snapper-loop], [data-loop]\" ).length ){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar pane = $el.find(\".snapper_pane\");\n\t\t\tvar nextLink = $el.find(\".snapper_nextprev_next\");\n\t\t\tvar prevLink = $el.find(\".snapper_nextprev_prev\");\n\t\t\tvar currScroll = pane[0].scrollLeft;\n\t\t\tvar scrollWidth = pane[0].scrollWidth;\n\t\t\tvar width = pane.width();\n\n\t\t\tvar noScrollAvailable = (width === scrollWidth);\n\n\t\t\tvar maxScroll = scrollWidth - width;\n\t\t\tif (currScroll >= maxScroll - 3 || noScrollAvailable ) { // 3 here is arbitrary tolerance\n\t\t\t\tnextLink\n\t\t\t\t\t.addClass(\"snapper_nextprev-disabled\")\n\t\t\t\t\t.attr(\"tabindex\", -1);\n\t\t\t} else {\n\t\t\t\tnextLink\n\t\t\t\t\t.removeClass(\"snapper_nextprev-disabled\")\n\t\t\t\t\t.attr(\"tabindex\", 0);\n\t\t\t}\n\n\t\t\tif (currScroll > 3 && !noScrollAvailable ) { // 3 is arbitrary tolerance\n\t\t\t\tprevLink\n\t\t\t\t\t.removeClass(\"snapper_nextprev-disabled\")\n\t\t\t\t\t.attr(\"tabindex\", 0);\n\t\t\t} else {\n\t\t\t\tprevLink\n\t\t\t\t\t.addClass(\"snapper_nextprev-disabled\")\n\t\t\t\t\t.attr(\"tabindex\", -1);\n\t\t\t}\n\n\t\t\tif( noScrollAvailable ){\n\t\t\t\t$el.addClass( \"snapper-hide-nav\" );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$el.removeClass( \"snapper-hide-nav\" );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "af13b76fee5a8ebe964ac166b84863be", "score": "0.60360104", "text": "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 FP.moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n FP.moveSlideRight(section);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d724f1db638cc7b883dc384abd3fcc67", "score": "0.6035644", "text": "function MenuArrow() {\n\n\t\t$('#menu > li')\n\t\t\t\t.each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\tif ($(this).find('> ul').length) {\n\n\t\t\t\t\t\t\t\t$(this)\n\t\t\t\t\t\t\t\t\t\t.append(\n\t\t\t\t\t\t\t\t\t\t\t\t'<span><i class=\"fa fa-angle-down\"></i></span>');\n\n\t\t\t\t\t\t\t\t$(this)\n\t\t\t\t\t\t\t\t\t\t.find('li')\n\t\t\t\t\t\t\t\t\t\t.each(\n\t\t\t\t\t\t\t\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($(this).find('ul').length) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(this)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.append(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<span><i class=\"fa fa-angle-right\"></i></span>');\n\n\t\t\t\t\t\t\t\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\t}\n\t\t\t\t\t\t});\n\n\t\t$('.navigation ul li').each(function() {\n\t\t\tif ($(this).find('ul').length) {\n\t\t\t\t$(this).addClass('menu-parent');\n\t\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "16cc9c001c154e14302ae4d696af9cd1", "score": "0.6024572", "text": "function createNavigation(item,opt) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar toolbox = $('<div id=\"toolbox\" style=\"opacity:0\"></div>');\n\t\t\t\t\t\t\t\tif ($.browser.msie && $.browser.version >= 7 && $.browser.version < 9 ) {\n\t\t\t\t\t\t\t\t\ttoolbox.css({'z-index':'4200'});\n\t\t\t\t\t\t\t\t\ttoolbox.addClass('noFilterClass');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttoolbox.css({'z-index':'4200'});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\titem.append(toolbox);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//var toolboxWidth = 3 + item.find(\"li\").size() ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//toolbox.css({'z-index':'4051'});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\tvar prev=$(\"<div id='previous'></div>\");\n\t\t\t\t\t\t\t\tvar next=$(\"<div id='next'></div>\");\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t////////////////////////////////////\n\t\t\t\t\t\t\t\t// HOVERING OVER THE ARROWS EVENT //\n\t\t\t\t\t\t\t\t////////////////////////////////////\n\t\t\t\t\t\t\t\tvar hoverInit=function(button) {\n\t\t\t\t\t\t\t\t\tbutton.hover(\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\tif ($this.attr('id')=='previous')\n\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'bottom right'});\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'bottom left'});\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t$this=$(this);\n\t\t\t\t\t\t\t\t\t\t\tif ($this.attr('id')=='previous')\n\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'top right'});\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'top left'});\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t///////////////////////////////\n\t\t\t\t\t\t\t\t// CLICK ON THE ARROWS EVENT //\n\t\t\t\t\t\t\t\t///////////////////////////////\n\t\t\t\t\t\t\t\tvar clickInit=function(button) {\n\t\t\t\t\t\t\t\t\tbutton.click(\n\t\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\t\tvar newId = item.data('currentSlide').index();\n\t\t\t\t\t\t\t\t\t\t\t\tif ($this.attr('id')==\"previous\")\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewId++;\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewId--;\n\t\t\t\t\t\t\t\t\t\t\t\tif (newId==item.data('currentSlide').parent().find(\"li\").size()) newId=0;\n\t\t\t\t\t\t\t\t\t\t\t\tif (newId==-1) newId=item.data('currentSlide').parent().find(\"li\").size()-1;\t\t\t\t\t\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\t\t\t\t\t\t\tvar newcurrentSlide = item.find(\"li\").each(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(i) {\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this=$(this);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (i == newId) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswapBanner(item.data('currentSlide'),$this,item,opt);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\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\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\t\t) //End of Button Click\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\thoverInit(prev);clickInit(prev);\n\t\t\t\t\t\t\t\thoverInit(next);clickInit(next);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttoolbox.append(prev);\n\t\t\t\t\t\t\t\ttoolbox.append(next);\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar thdivider=$(\"<div id='mini_divider'></div>\");\n\t\t\t\t\t\t\t\ttoolbox.append(thdivider);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t///////////////////////////\n\t\t\t\t\t\t\t\t// CREATE THE THUMBNAILS //\n\t\t\t\t\t\t\t\t///////////////////////////\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\titem.find(\"li\").each(\n\t\t\t\t\t\t\t\t\tfunction(i) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\tvar nums = $this.parent().find(\"li\").size()-1;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tvar thumbnail=$(\"<div id='\"+(nums-i)+\"' class='mini_thumbnail_buttons'></div>\");\n\t\t\t\t\t\t\t\t\t\ttoolbox.append(thumbnail);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (item.data('currentSlide').index() == (nums-i)) {\n\t\t\t\t\t\t\t\t\t\t\tthumbnail.data('on',true);\n\t\t\t\t\t\t\t\t\t\t\tthumbnail.css({'background-position':'bottom left'});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tvar cd=$('<div id=\"cd\" class=\"countdown\" style=\"display:none;background-position:0px 0px\"></div>');\t\t\t\t\t\t\t\t\t\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\t\t\t\t\t\t\tcd.data('idNum',(nums-i));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tthumbnail.append(cd);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ($.browser.msie && $.browser.version >= 7 && $.browser.version < 9 )\n\t\t\t\t\t\t\t\t\t\t\tcd.addClass('noFilterClass');\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ((nums-i)==0) {\n\t\t\t\t\t\t\t\t\t\t\tcd.css({'display':'block'});\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tthumbnail.hover(\n\t\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'top right'});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($this.data().on == true) \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'bottom right'});\n\t\t\t\t\t\t\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\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\t\t\t\t\t\tvar it =$('<div id=\"image_thumbnail\" style=\"opacity:0.0;left:'+$this.position().left+'px;top:'+($this.position().top + 10)+'px\"></div>');\n\t\t\t\t\t\t\t\t\t\t\t\t$this.parent().append(it);\n\t\t\t\t\t\t\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\t\t\t\t\t\tif ($this.hasClass('wedding_mini_thumbnail_buttons')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tit.addClass('wedding_image_thumbnail');\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this.hasClass('fashion_mini_thumbnail_buttons')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tit.addClass('fashion_image_thumbnail');\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this.hasClass('custom_mini_thumbnail_buttons')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tit.addClass('custom_image_thumbnail');\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\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\t\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\t\t\t\t\t\tvar searchedID = $(this).attr('id');\n\t\t\t\t\t\t\t\t\t\t\t\tvar imgsrc=\"\";\n\t\t\t\t\t\t\t\t\t\t\t\tvar imgw=0;\n\t\t\t\t\t\t\t\t\t\t\t\tvar imgh=0;\n\t\t\t\t\t\t\t\t\t\t\t\titem.find('li').each(function() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this.index() == searchedID) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar bef=$this.find(\"#before\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timgsrc= bef.attr('src');\t\t\t\t\t\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\t\t\t\t\t\t\t\t\t\t\tif ($this.data('orgWidth')==undefined) $this.data('orgWidth',bef.width());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this.data('orgHeight')==undefined) $this.data('orgHeight',bef.height());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timgw = $this.data('orgWidth');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timgh = $this.data('orgHeight');\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t });\n\t\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\t\t\t\t\t\t\t\t\tif (it.width()==0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\timgw = imgw/5;\n\t\t\t\t\t\t\t\t\t\t\t\t\timgh = imgh/5;\n\t\t\t\t\t\t\t\t\t\t\t\t\tit.css({'width':imgw+'px','height':imgh+'px'});\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\timgw=it.width();\n\t\t\t\t\t\t\t\t\t\t\t\t\timgh=it.height();\n\t\t\t\t\t\t\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\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tvar newWidth =imgw-6;\n\t\t\t\t\t\t\t\t\t\t\t\tvar newHeight = imgh-6;\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tvar mt = parseInt(it.css('margin-top'),0);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif (mt==0) mt = 0-newHeight-6;\n\t\t\t\t\t\t\t\t\t\t\t\tit.css({'left':($this.position().left+10+-newWidth/2)+'px','width':newWidth+6+'px','height':newHeight+6+'px','margin-top':mt+'px'});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tit.append('<div><div><img id=\"thimg\" style=\"position:absolute;top:3px;left:3px;width:'+newWidth+'px;height:'+newHeight+'px\" src=\"'+imgsrc+'\"></div></div>');\t\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\t\t\t\t\t\t\t\t\tit.append('<div id=\"loader\" style=\"loader\"></div>');\t\n\t\t\t\t\t\t\t\t\t\t\t\tit.append('<div id=\"image_thumbnail_arrow\" style=\"position:absolute;left:'+(imgw/2 - 4)+'px;top:'+(imgh-1)+'px\"></div>');\t\t\t\t\t\t\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\t\t\t\t\t\tif ($this.hasClass('wedding_mini_thumbnail_buttons')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tit.find('#image_thumbnail_arrow').addClass('wedding_image_thumbnail_arrow');\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this.hasClass('fashion_mini_thumbnail_buttons')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tit.find('#image_thumbnail_arrow').addClass('fashion_image_thumbnail_arrow');\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($this.hasClass('custom_mini_thumbnail_buttons')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tit.find('#image_thumbnail_arrow').addClass('custom_image_thumbnail_arrow');\n\t\t\t\t\t\t\t\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\t\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\t\t\t\t\t\tit.animate({'opacity':1.0,'top':+1},{duration:200});\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'top left'});\n\t\t\t\t\t\t\t\t\t\t\t\tif ($this.data().on == true) \n\t\t\t\t\t\t\t\t\t\t\t\t\t$this.css({'background-position':'bottom left'});\n\t\t\t\t\t\t\t\t\t\t\t\t$this.parent().find(\"#image_thumbnail\").remove();\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\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\t\t\t\tthumbnail.click(\n\t\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($this.data().on != true) {\t\t\t\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\t\t\t\t\t\t\t\t\t\tvar newId = $(this).attr('id');\t\t\t\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\t\t\t\t\t\t\t\t\t\tvar newcurrentSlide = item.find(\"li\").each(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(i) {\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar $this=$(this);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (i == newId) {\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tswapBanner(item.data('currentSlide'),$this,item,opt);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\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\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\t\t\t\t\t}) //End of Thumbnail Click\n\t\t\t\t\t\t\t\t\t}) // End of Creating Thumbnails\t\n\t\t\t\t\t\titem.find('#toolbox').css({'width':item.find(\"#toolbox\").width()+'px'});\n\t\t\t\t\t\t\n\t\t\t\t\t\t} // End of Creating Navigation", "title": "" }, { "docid": "505c4b9a99fdf97faa35c5c45a42719c", "score": "0.599836", "text": "function leftArrow() {\n if (slideIndex === 1) {\n slideIndex = slides.length;\n } else {\n slideIndex -= 1;\n }\n showSlide();\n resetTimer();\n}", "title": "" }, { "docid": "cb0224db0d4d5a7a27251e138c576a9d", "score": "0.5992471", "text": "function clickKeyArrows(event){\n if (event.key === \"ArrowLeft\"){\n goToPreviousSlide();\n }\n if (event.key === \"ArrowRight\"){\n goToNextSlide();\n }\n}", "title": "" }, { "docid": "657c597525775443dc1d396194a7abc8", "score": "0.59924537", "text": "function carouselLinksAbout() {\n $('#about-interior .carousel-linked-nav > li > a').click(function() {\n var item = Number($(this).attr('href').substring(1));\n $('#about-interior .carousel').carousel(item - 1);\n $('#about-interior .carousel-linked-nav .active').removeClass('active');\n $(this).parent().addClass('active');\n return false;\n });\n }", "title": "" }, { "docid": "3adf6678e2ca998b469659f302da10d1", "score": "0.5968962", "text": "function setUpArrows(globals, divElem){\n var newHTML = [];\n var cardArray = globals.cardArray;\n for (var i = 0; i < globals.NUM_CARDS; i++) {\n newHTML.push('<span class=\"glyphicon glyphicon-arrow-right\" id=\"r' + i\n + '\" style=\"display: none; position:absolute; top:0px; left:' +\n (cardArray[i].xPos + 0.5*globals.CARD_WIDTH) + 'px\"></span>');\n newHTML.push('<span class=\"glyphicon glyphicon-arrow-left\" id=\"l' +\n (i + globals.NUM_CARDS) +\n '\" style=\"display: none; position:absolute; top:0px; left:' +\n (cardArray[i].xPos + 0.5*globals.CARD_WIDTH) + 'px\"></span>');\n }\n $(divElem).html(newHTML.join(''));\n}", "title": "" }, { "docid": "0b5dea349e38667df933d397faabc7db", "score": "0.5964631", "text": "function handleClickNext(carousel, slider, direction, translate) {\n // if change direction_carousel_1 there already happend child append \n // to the end of the slider so we need to revert it back\n if (direction === 1 ) {\n direction = -1 \n slider.prepend(slider.lastElementChild)\n }\n carousel.style.justifyContent = \"flex-start\"\n slider.style.transform = `translate(-${translate}%)`\n}", "title": "" }, { "docid": "f5f15a47c474388729785b456869afdf", "score": "0.59639853", "text": "function clickKeyArrows(event){\n\tif (event.key === \"ArrowLeft\"){\n\t goToPreviousSlide();\n\t}\n\tif (event.key === \"ArrowRight\"){\n\t goToNextSlide();\n\t}\n}", "title": "" }, { "docid": "5541e934e942231c00f8906b704c5c34", "score": "0.5935683", "text": "function initGuidedTourNavigation()\n\t\t{\n\t\t\t$(\".guided_tour_arrow\").click(function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar current_step = parseInt($(\".guided_tour_current_step\").text());\n\t\t\t\tvar previous_step = current_step;\n\t\t\t\t\n\t\t\t\tif($(this).hasClass(\"guided_tour_next\")){current_step++;}\n\t\t\t\telse {current_step--;}\n\t\t\t\t\n\t\t\t\tif(current_step > 0 && current_step <= number_of_steps){\n\t\t\t\t\tselectStep(current_step);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (tour_id == 6) {\n\t\t\t\t\t// cases to change tabs\n\t\t\t\t\t// 3 -> 4, 6 -> 7, 4 -> 3, 7 -> 6\n\t\t\t\t\tif ((previous_step == 3 && current_step == 4) || (previous_step == 6 && current_step == 7) || (previous_step == 4 && current_step == 3) || (previous_step == 7 && current_step == 6)) {\n\t\t\t\t\t\thandleTabTriggersForAddShift();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}", "title": "" }, { "docid": "cbbcf91212e66fe99fbe07806f9e4255", "score": "0.5931814", "text": "function slideArrowHandler(){\n\n /*jshint validthis:true */\n\n var section = closest(this, SECTION_SEL);\n\n\n\n /*jshint validthis:true */\n\n if (hasClass(this, SLIDES_PREV)) {\n\n if(isScrollAllowed.m.left){\n\n moveSlideLeft(section);\n\n }\n\n } else {\n\n if(isScrollAllowed.m.right){\n\n moveSlideRight(section);\n\n }\n\n }\n\n }", "title": "" }, { "docid": "07f1dc82c5897250a92f2787e966b2fd", "score": "0.5924807", "text": "function carouselInit() {\n $('.carousel').carousel({\n shift: 50,\n })\n\n}", "title": "" }, { "docid": "06ef20617f463e77ea7ff16b4d56f5c8", "score": "0.59067315", "text": "function navigatePrev() {\n\n if( availableRoutes().up ) {\n navigateUp();\n }\n else {\n // Fetch the previous horizontal slide, if there is one\n var previousSlide;\n\n if( config.rtl ) {\n previousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.future' ) ).pop();\n }\n else {\n previousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.past' ) ).pop();\n }\n\n if( previousSlide ) {\n var v = ( previousSlide.querySelectorAll( '.slide' ).length - 1 ) || undefined;\n var h = indexh - 1;\n slide( h, v );\n }\n }\n\n }", "title": "" }, { "docid": "ef019d26245c70fffc3eeb42ce82a57a", "score": "0.58722305", "text": "function carouselLinksSolutions() {\n $('#solutions-interior .carousel-linked-nav > li > a').click(function() {\n var item = Number($(this).attr('href').substring(1));\n $('#solutions-interior .carousel').carousel(item - 1);\n $('#solutions-interior .carousel-linked-nav .active').removeClass('active');\n $(this).parent().addClass('active');\n return false;\n });\n }", "title": "" }, { "docid": "de8d20e3cc29f38d0987599a281b1356", "score": "0.58592147", "text": "function arrowsKeyHandler () {\n let that = this\n\n document.addEventListener('keydown', (e) => {\n let { activeIndex } = that\n let { keyCode } = e\n\n // Determine direction (it's -1 for the left and +1 for right)\n let direction = keyCode - 38\n \n // Run the function only on arrow keys\n if (keyCode === 37 || keyCode === 39)\n slideSwitcher.call(that, activeIndex + direction, direction)\n })\n }", "title": "" }, { "docid": "f7aeb960ad0b5d17747750cc5fc01533", "score": "0.5850238", "text": "function createDownArrow(){\n $(\".mobile-search\").removeClass(\"active\");\n $(\".header-section > .search-wrapper\").hide();\n\n /**\n * loop through navigation li\n * add icon arrow down on list which has sub menu\n */\n $(\"#navigation > li\").each(function(){\n if($(this).find(\".sf-mega\").length){\n if(!$(this).find(\"a\").first().find(\"i.fa-angle-down\").length){\n $(this).find(\"a\").first().append(\"<i class='fa fa-angle-down'></i>\");\n }\n }\n });\n }", "title": "" }, { "docid": "b69603e055d64f92dea85b520917a0fd", "score": "0.58454907", "text": "function init($carousel) {\n var $activeSlide = $carousel.find('[aria-hidden=\"false\"]');\n var slideIndex = getCurrentSlideIndex($carousel);\n\n function plusSlides(n, direction) {\n showSlides(slideIndex += n, direction);\n }\n\n function currentSlide(n, direction) {\n showSlides(slideIndex = n, direction);\n }\n\n function showSlides(n, direction) {\n var $slides = $carousel.find(SELECTOR_CAROUSEL_SLIDE);\n var $bullets = $carousel.find(SELECTOR_CAROUSEL_CONTROLS_BULLET);\n var index = slideIndex - 1;\n var transform;\n var flag = false;\n\n if (n > $slides.length) {\n slideIndex = 1;\n index = 0;\n }\n\n if (n < 1) {\n slideIndex = $slides.length;\n index = $slides.length - 1;\n }\n\n transform = index === 0 ? 'translateX(0%)' : 'translateX'.concat('(-', 100 * index, '%)');\n $slides.attr('aria-hidden', 'true').removeClass('invisible');\n $activeSlide.focus();\n $slides.css('transform', transform);\n $activeSlide = $slides.eq(index);\n $activeSlide.attr('aria-hidden', 'false');\n $bullets.eq(index).addClass(CLASS_BULLET_ACTIVE).siblings().removeClass(CLASS_BULLET_ACTIVE);\n $carousel.find(SELECTOR_CAROUSEL_STATUS).text(slideIndex);\n $carousel.on(whichAnimationEvent(), function (e) {\n if (e.originalEvent.propertyName === 'transform' && !flag) {\n flag = true;\n $.publish('carousel:changeSlide', {\n id: $carousel.attr('id'),\n slideIndex: index\n });\n $activeSlide.siblings().addClass('invisible');\n $activeSlide.focus();\n }\n });\n }\n\n carouselEvent($carousel, SELECTOR_CAROUSEL_CONTROLS_PREVIOUS, function () {\n plusSlides(-1, 'left');\n });\n carouselEvent($carousel, SELECTOR_CAROUSEL_CONTROLS_NEXT, function () {\n plusSlides(1, 'right');\n });\n carouselEvent($carousel, SELECTOR_CAROUSEL_CONTROLS_BULLET, function (ev) {\n var index = $carousel.find(SELECTOR_CAROUSEL_CONTROLS_BULLET).index(ev.currentTarget) + 1;\n var direction = slideIndex < index ? 'right' : 'left';\n currentSlide(index, direction);\n });\n }", "title": "" }, { "docid": "8126ed3d754ac7704a2a1db056abc7b2", "score": "0.5828181", "text": "onLeftArrowKeypress() {\n this.currentDirection === \"rtl\" ? this.next() : this.prev();\n }", "title": "" }, { "docid": "f6835294d3b576d99b17fe1f7e6f0783", "score": "0.58229375", "text": "get SlideArrow() {}", "title": "" }, { "docid": "7493b80d14757fb9fb976fe2ddd75a17", "score": "0.58229136", "text": "function createRightArrow(){\n /**\n * make sure navigation is hidden, waiting for user click the navigation menu\n * by default it's hidden by css media query, but it's okay to recheck\n */\n $(\"#navigation\").hide();\n\n /**\n * loop through navigation li\n * add icon arrow right on list which has sub menu\n */\n $(\"#navigation > li\").each(function(){\n if($(this).find(\".sf-mega\").length){\n if(!$(this).find(\"a\").first().find(\"i.fa-angle-right\").length){\n $(this).find(\"a\").first().append(\"<i class='fa fa-angle-right'></i>\");\n }\n }\n });\n }", "title": "" }, { "docid": "1560972cd9f43cebf3363abbce741325", "score": "0.58212066", "text": "function lampLinksApproach() {\n $('#approach-interior .lamp-linked-nav > li > a').click(function() {\n var item = Number($(this).attr('href').substring(1));\n $('#approach-interior .carousel').carousel(item - 1);\n $('#approach-interior .lamp-linked-nav .active').removeClass('active');\n $(this).parent().addClass('active');\n return false;\n });\n }", "title": "" }, { "docid": "20637c00c889c63048f88ccc6339cd17", "score": "0.5812704", "text": "function setArrowSlides(e) {\n\t// if nothing clicked yet, setup the active and nonactive elemnts\n\tif (!slideClicked) {\n\t\t// remove active from current slide and add it to the next one\n\t\t($('.list-group li.active')).removeClass('active').next().addClass('active');\n\t\t// see if at max slide, if so set first slide as active\n\t\tif(($('.list-group').children().length - 1) == (parseInt(($('.list-group li.active')).data('slide-to')))) {\n\t\t\t$('.list-group li').first().addClass('active');\n\t\t}\n\t}\n\tslideClicked = false;\n}", "title": "" }, { "docid": "98b9aec3604414dcfcaca59012b01395", "score": "0.5810169", "text": "static _vs_go_prev() {\n this.pos -= 1;\n if (this.pos < 1) {\n this.slide = 2;\n this.x = -1 * this.sliderWrapWidth * 4;\n this.itemsBox.style.transition = 'all 0s';\n this.itemsBox.style.marginLeft = `${this.x}px`;\n this.pos = 3;\n\n setTimeout(() => {\n this.itemsBox.style.transition = 'all 0.4s ease';\n this.x += this.sliderWrapWidth;\n this.itemsBox.style.marginLeft = `${this.x}px`;\n }, 15);\n } else {\n this.slide -= 1;\n this.x += this.sliderWrapWidth;\n this.itemsBox.style.marginLeft = `${this.x}px`;\n }\n\n this.navAnimation();\n }", "title": "" }, { "docid": "5c417fc6155a32e7ffa3948caa4b5697", "score": "0.58060503", "text": "function Arrow(props) {\n if (props.variant === \"up\") {\n return \"↑\";\n } else if (props.variant === \"down\") {\n return \"↓\";\n }\n return null;\n}", "title": "" }, { "docid": "a33463363a3be10cad3423a6fec1cb93", "score": "0.58014023", "text": "attach(){\n document.getElementById(`${this.name}-next`).addEventListener(\n 'click',\n (e)=>{return this.slide(e.target, this.name)}\n )\n document.getElementById(`${this.name}-prev`).addEventListener(\n 'click',\n (e)=>{return this.slide(e.target, this.name)}\n );\n\n }", "title": "" }, { "docid": "f35a8df46ef16547f08a4785b871c205", "score": "0.5794497", "text": "set SlideArrow(value) {}", "title": "" }, { "docid": "4637c3f3c3ba72c6f98e6c799e662ca6", "score": "0.5784155", "text": "function addMouseNavEvents() {\n\t\t\tvar that = this,\n\t\t\t\tbothNavElms = $(this._navPrev).push(this._navNext);\n\t\t\t\t\n\t\t\t// add navigational events\n\t\t\tevents.addListener(bothNavElms, \"click\", function(e) {\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tevents.addListener(bothNavElms, \"mouseup\", function(e) {\n\t\t\t\tstopRepeatOrSlide.call(that);\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tevents.addListener(bothNavElms, \"mouseleave\", function(e){\n\t\t\t\tstopRepeatOrSlide.call(that);\n\t\t\t});\n\t\t\tevents.addListener(this._navPrev, \"mousedown\", function(e) {\n\t\t\t\tthat.prev();\n\t\t\t\tstartRepeatOrSlide.call(that, true);\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tevents.addListener(this._navNext, \"mousedown\", function(e){\n\t\t\t\tthat.next();\n\t\t\t\tstartRepeatOrSlide.call(that);\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "7ee3ae4d147aea91c4aed31fb5004f38", "score": "0.5776687", "text": "prevSlide() {\n this.nav.prevSlide();\n }", "title": "" }, { "docid": "c36b991b8e777391e59afc5e0bb36c03", "score": "0.57741547", "text": "function leftcarousel(){\n var e = similarItems[7];\n similarItems.splice(similarItems.length-1, 1);\n similarItems.unshift(e);\n similarItemsList();\n}", "title": "" }, { "docid": "03b6528cb95f8d763235549332bcf812", "score": "0.57581174", "text": "function navSliderImg() {\n $('.navslider-img').remove();\n if ($('.hero-slider').find('.owl-item.active').next().length === 0) {\n $('.hero-slider')\n .find('.owl-next .icon')\n .before(function () {\n var imgfirst = $('.hero-slider').find('.owl-item').first().find('img').attr('src');\n return '<div class=\"navslider-img\" style=\"background-image: url(' + imgfirst + ')\">';\n });\n } else {\n $('.hero-slider')\n .find('.owl-next .icon')\n .before(function () {\n var imgnext = $('.hero-slider').find('.owl-item.active').next().find('img').attr('src');\n return '<div class=\"navslider-img\" style=\"background-image: url(' + imgnext + ')\">';\n });\n }\n if ($('.hero-slider').find('.owl-item.active').prev().length === 0) {\n $('.hero-slider')\n .find('.owl-prev .icon')\n .before(function () {\n var imglast = $('.hero-slider').find('.owl-item').last().find('img').attr('src');\n return '<div class=\"navslider-img\" style=\"background-image: url(' + imglast + ')\">';\n });\n } else {\n $('.hero-slider')\n .find('.owl-prev .icon')\n .before(function () {\n var imgprev = $('.hero-slider').find('.owl-item.active').prev().find('img').attr('src');\n return '<div class=\"navslider-img\" style=\"background-image: url(' + imgprev + ')\">';\n });\n }\n }", "title": "" }, { "docid": "abe1255cd5bcf0ac0009d8cf20721b10", "score": "0.5754066", "text": "handleArrowPress(event) {\n var focusObj = this.getFocus();\n if (focusObj._id === 'prevNavArrow') {\n this.prevPage();\n } else if (focusObj._id === 'nextNavArrow') {\n this.nextPage();\n }\n return focusObj;\n }", "title": "" }, { "docid": "e42346df607890f9b2d6dc0bb56b6c3b", "score": "0.5744301", "text": "function leftArrow() {\r\n\t\tclearInterval(autoAdvance);\r\n\t\tif (currentImage === 0) {\r\n\t\t\tcurrentImage = photoOrder.length - 1;\r\n\t\t} else {\r\n\t\t\tcurrentImage = currentImage - 1 ;\r\n\t\t}\r\n\t\tpopulateFigures(currentImage);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "18d415b3d5a25c847d60408bb36abc24", "score": "0.57424414", "text": "function arrowsClickHandler () {\n let that = this\n\n // Define arrow DOM node variables\n let leftArrow = this.arrowNodes[0]\n let rightArrow = this.arrowNodes[1]\n\n // Add event listeners\n leftArrow.addEventListener('click', () => \n slideSwitcher.call(that, that.activeIndex - 1, -1))\n rightArrow.addEventListener('click', () => \n slideSwitcher.call(that, that.activeIndex + 1, 1))\n }", "title": "" }, { "docid": "f64fb98da5cbe4da821b583b9b8e073d", "score": "0.57367134", "text": "function showOverlayArrows() {\n\tlet projectCount = $(\"#gallery li\").length;\n\tif(elementIndex+1 === projectCount) {\n\t\t$('.next').hide();\n\t} else {\n\t\t$('.next').show();\n\t}\n\tif(elementIndex-1 < 0) {\n\t\t$('.previous').hide();\n\t} else {\n\t\t$('.previous').show();\n\t}\n}", "title": "" }, { "docid": "186080eef13a025addbb534ca8d1e28f", "score": "0.57324564", "text": "_handleUp() {\r\n if (0 != this.tag('GalleryRowList').index) {\r\n this.tag('GalleryRowList').element._reset()\r\n this.tag('GalleryRowList').setPrevious()\r\n }\r\n this.current = this.tag('GalleryRowList').element\r\n //Make the down arrow visible on all other cases other than at the last row\r\n if (this.tag('GalleryRowList').length - 1 != this.tag('GalleryRowList').index) {\r\n this.tag('Down').visible = true\r\n }\r\n }", "title": "" }, { "docid": "041268a73478104bb06fe66e9fde3d05", "score": "0.5724146", "text": "function clickKeyArrowsPresenter(event){\n let presenter = document.getElementById(\"presenterDiv\");\n if (event.key === \"ArrowLeft\"){\n goToPreviousSlide();\n removeChildPresenter(presenter);\n appendChildPresenter(presenter);\n }\n if (event.key === \"ArrowRight\"){\n goToNextSlide();\n removeChildPresenter(presenter);\n appendChildPresenter(presenter);\n }\n}", "title": "" }, { "docid": "041268a73478104bb06fe66e9fde3d05", "score": "0.5724146", "text": "function clickKeyArrowsPresenter(event){\n let presenter = document.getElementById(\"presenterDiv\");\n if (event.key === \"ArrowLeft\"){\n goToPreviousSlide();\n removeChildPresenter(presenter);\n appendChildPresenter(presenter);\n }\n if (event.key === \"ArrowRight\"){\n goToNextSlide();\n removeChildPresenter(presenter);\n appendChildPresenter(presenter);\n }\n}", "title": "" }, { "docid": "0dacce7033a995d16173b67e34aef054", "score": "0.5723466", "text": "function makePageNav(pageInfo)\n{\n // ** LEFT ARROW ** //\n var leftArrow = \"\";\n if(pageInfo.page !== 1) leftArrow = \"<li class=\\\"enabled\\\"><a onClick=\\\"queryAPI(\" + (pageInfo.page - 1) + \"); return false;\\\" href=\\\"#\\\"><span aria-hidden=\\\"true\\\">&laquo;</span><span class=\\\"sr-only\\\">Previous</span></a></li>\";\n else leftArrow = \"<li class=\\\"disabled\\\"><a href=\\\"#\\\"><span aria-hidden=\\\"true\\\">&laquo;</span><span class=\\\"sr-only\\\">Previous</span></a></li>\";\n\n // ** NUMBER LINKS ** //\n var numberHtml = \"\";\n if(pageInfo.page <= 3) // Selected link should be on the left side or middle (1,2 or 3) - [<<] [1] [2] [3] [4] [5] [>>]\n {\n var toPage = Math.min(5, pageInfo.pageCount);\n\n for(var i = 1; i <= toPage; i++)\n {\n if(i === pageInfo.page)\n {\n numberHtml += \"<li class=\\\"active\\\"><a href=\\\"\\\">\" + i + \"<span class=\\\"sr-only\\\">(current)</span></a></li>\";\n }\n else\n {\n numberHtml += \"<li><a onClick=\\\"queryAPI(\" + i + \"); return false;\\\" href=\\\"#\\\">\" + i + \"</a></li>\";\n }\n }\n }\n else if(pageInfo.page >= (pageInfo.pageCount-2)) // Selected link should be on the right side or middle (n, n-1 or n-2) - [<<] [n-4] [n-3] [n-2] [n-1] [n] [>>]\n {\n var fromPage = Math.max(1, pageInfo.pageCount-4);\n\n for(var i = fromPage; i <= pageInfo.pageCount; i++)\n {\n if(i === pageInfo.page)\n {\n numberHtml += \"<li class=\\\"active\\\"><a href=\\\"\\\">\" + i + \"<span class=\\\"sr-only\\\">(current)</span></a></li>\";\n }\n else\n {\n numberHtml += \"<li><a onClick=\\\"queryAPI(\" + i + \"); return false;\\\" href=\\\"#\\\">\" + i + \"</a></li>\";\n }\n }\n }\n else // Selected link should be in the middle (k) - [<<] [k-2] [k-1] [k] [k+1] [k+2] [>>]\n {\n for(var i = pageInfo.page-2; i <= pageInfo.page+2; i++)\n {\n if(i === pageInfo.page)\n {\n numberHtml += \"<li class=\\\"active\\\"><a href=\\\"\\\">\" + i + \"<span class=\\\"sr-only\\\">(current)</span></a></li>\";\n }\n else\n {\n numberHtml += \"<li><a onClick=\\\"queryAPI(\" + i + \"); return false;\\\" href=\\\"#\\\">\" + i + \"</a></li>\";\n }\n }\n }\n\n // ** RIGHT ARROW ** //\n var rightArrow = \"\";\n if(pageInfo.page === pageInfo.pageCount)\n rightArrow = \"<li class=\\\"disabled\\\"><a href=\\\"#\\\"><span aria-hidden=\\\"true\\\">&raquo;</span><span class=\\\"sr-only\\\">Next</span></a></li>\";\n else\n rightArrow = \"<li class=\\\"enabled\\\"><a onClick=\\\"queryAPI(\" + (pageInfo.page + 1) + \"); return false;\\\" href=\\\"#\\\"><span aria-hidden=\\\"true\\\">&raquo;</span><span class=\\\"sr-only\\\">Next</span></a></li>\";\n\n\n // Add the whole thingamagig to the html.\n document.getElementById('pageNavigator').innerHTML = leftArrow + numberHtml + rightArrow;\n}", "title": "" }, { "docid": "27c0068834dc67172dc36d9db66cc2b3", "score": "0.57198715", "text": "function initHtml () {\n\t\t\t$container.slick(config);\n\t\t\t\n\t\t\t// For large arrows we don't create a custom control container and move the controls, they stay default.\n\t\t\tif ($container[0].className.indexOf(\"ibm-carousel__arrows--large\") === -1) {\n\t\t\t\t// Move the \"next\" arrow to the right div.\n\t\t\t\tconfig.appendArrows.find(\".ibm-carousel-next\").appendTo(config.appendDots.next());\n \n\t\t\t\t// Move the controls into the container AFTER SLICK INIT so they don't get processed as a panel.\n\t\t\t\t$container.next().appendTo($container);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "db2fba19b237b462b3aeaf3ec6b8f253", "score": "0.571471", "text": "function plusSlides(n) {//name of function n being the parameter\n showSlides(slideIndex += n);//letting the arrows move left to right\n}", "title": "" }, { "docid": "0d1c68615929b134a8edda6f6e5cc800", "score": "0.57142395", "text": "static _vs_go_nav(e) {\n e.preventDefault();\n let i = 0;\n\n const sliderNavigation = document.querySelector('.slider-number-block');\n const sliderNavigationBox = sliderNavigation.querySelectorAll('DIV');\n const sliderNavArray = Array.from(sliderNavigationBox, (el) => el.className);\n sliderNavArray.forEach((element, index) => {\n if (element == e.target.className) {\n i = index;\n return i;\n }\n });\n\n this.slide = i;\n this.pos = this.slide + 1;\n\n this.navAnimation();\n this.x = -this.sliderWrapWidth - (this.sliderWrapWidth * i);\n this.itemsBox.style.marginLeft = `${this.x}px`;\n }", "title": "" }, { "docid": "90cac98f3b4f119486d1221d40e7a9a5", "score": "0.57142067", "text": "function disableNavigation (){\n arrowNavigation.addClass('disableClick'); \n setTimeout(function(){\n arrowNavigation.removeClass('disableClick');\n },animationSpeed);\n carouselIndicators.addClass('disableClick'); \n setTimeout(function(){\n carouselIndicators.removeClass('disableClick');\n },animationSpeed);\n}", "title": "" }, { "docid": "7c8ab9c1b8e794d4f75d90f1e05ad12d", "score": "0.5714192", "text": "function navigate(direction) {\n // hide the old current list item \n current.classList.remove('current');\n \n // calculate the new position\n counter = (counter + direction) % amount;\n counter = counter < 0 ? amount - 1 : counter;\n // set new current element \n // and add CSS class\n current = items[counter];\n current.classList.add('current');\n }", "title": "" } ]
4109c1f2652797aa9844f02922c24259
Positional scales default to a point scale instead of an ordinal scale.
[ { "docid": "66ac2866cef43a61b25e61c91c1e674b", "score": "0.0", "text": "function asOrdinalType(key) {\n switch (registry.get(key)) {\n case position: return \"point\";\n case color: return \"categorical\";\n default: return \"ordinal\";\n }\n}", "title": "" } ]
[ { "docid": "1e645dc9d0c7bd364efe476f72215394", "score": "0.5645439", "text": "function xyscale(xscale, yscale)\n {\n\tthis.xscale = xscale;\n\tthis.yscale = yscale;\n\tthis.scale_pt = fx.scale_fn(xscale, yscale);\n\tthis.unscale_pt = fx.invert_scale_fn(xscale, yscale);\n }", "title": "" }, { "docid": "c3f56ae5f4373bc9332323663353c7e1", "score": "0.564518", "text": "function scalePoints( vecToScale ){\n\tvar scaledX = ( 1 / (xmax - xmin) ) * vecToScale[0];\n\tvar scaledY = ( 1 / (ymax - ymin) ) * vecToScale[1];\n\treturn vec2( scaledX, scaledY );\n}", "title": "" }, { "docid": "27f061cd80576b23f3f542263aa45298", "score": "0.5572454", "text": "function linearScale(position, minp_, maxp_, minv_, maxv_) {\r\n var minp = minp_;\r\n var maxp = maxp_;\r\n var minv = minv_;\r\n var maxv = maxv_;\r\n\r\n var percent = (position - minp) / (maxp-minp);\r\n return percent * (maxv - minv) + minv;\r\n}", "title": "" }, { "docid": "cbfa1b42e954378c4a08ed962ee9ee54", "score": "0.55011666", "text": "function scale(point, scale) {\r\n return [point[0]*scale, point[1]*scale, point[2]*scale]\r\n}", "title": "" }, { "docid": "17a9ffdc0007d85933c2036faa439b89", "score": "0.54483235", "text": "function translateThenScale(coord, gx, gy, scale) {\n return { // grab the x and y of each point, translate it so that it's relative to an origin, then scale it\n x: (coord.x - gx) * scale,\n y: (coord.y - gy) * scale\n };\n}", "title": "" }, { "docid": "8e673478d73cdb677efecd33ee56efd0", "score": "0.5406432", "text": "function scalePoint(x, y) {\n return G.point(Math.round(x/scale) - xOffset,\n Math.round(y/scale) - yOffset);\n}", "title": "" }, { "docid": "1bc1453e83f9518afc7ef05fc80c0a08", "score": "0.5395461", "text": "getScale(type) {\n return SCALE_TYPES[type]() || SCALE_TYPES.linear();\n }", "title": "" }, { "docid": "8c4c066e89ed32790873bfec509c787f", "score": "0.5339256", "text": "function newScale(data, chosenAxis, xy) \n{\n // create scales\n if (xy === \"x\")\n {\n let xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenAxis])*0.9, d3.max(data, d => d[chosenAxis])*1.1])\n .range([0, chartWidth]);\n return xLinearScale;\n }\n else\n {\n let yLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenAxis])*0.9, d3.max(data, d => d[chosenAxis])*1.1])\n .range([chartHeight, 0]);\n return yLinearScale;\n }\n}", "title": "" }, { "docid": "46336f4f2810968a8b415e4cd6bd9817", "score": "0.53326106", "text": "function scaleBy(point, value) {\r\n point.x *= value;\r\n point.y *= value;\r\n }", "title": "" }, { "docid": "3a4e58a6457067aab6561568f1db235c", "score": "0.5320649", "text": "getScales(state) {\n const { height, width } = this.props;\n const domains = this.getDomains(state);\n\n return {\n x: d3.time.scale()\n .range([0, width])\n .domain(domains.x),\n\n y: domains.y.map(domain => d3.scale.linear()\n .range([height, 0])\n .domain(domain)\n .nice()\n ),\n };\n }", "title": "" }, { "docid": "7dcd68206db24ee1a791c41044356793", "score": "0.5315833", "text": "_scales(domain) {\n const x = d3.scale.linear()\n .rangeRound([0, this.props.width])\n .domain(domain);\n\n return {x: x};\n }", "title": "" }, { "docid": "f5f196c45b4180e5bd3e0b9b939ec4d3", "score": "0.5311114", "text": "function reset_transform_to_default() {\n x_scale = default_x_scale\n y_scale = default_y_scale\n x_offset = default_x_offset\n y_offset = default_y_offset\n}", "title": "" }, { "docid": "5824a57ceffa8f9312b1721052e1fac0", "score": "0.52810454", "text": "function point(x, xscale, yscale, fn) {\n var xlabel = value(x, xscale);\n var ylabel = value(fn(xlabel.value), yscale);\n return [xlabel, ylabel];\n }", "title": "" }, { "docid": "bf7dffec0c4bce44130a43f509782786", "score": "0.5277759", "text": "pointRel(point, scaling = this.scaling) {\n\t\tlet x = this.xNumberRel(point[0], scaling);\n\t\tlet y = this.yNumberRel(point[1], scaling);\n\t\treturn [x, y];\n\t}", "title": "" }, { "docid": "8274c6dbf750e18f739abf9803f1bf38", "score": "0.5230873", "text": "function _linearScale() {\n var dmin = 0, dmax = 1,\n rmin = 0, rmax = 1,\n clamp = false,\n scale = function(val) {\n if (clamp) {\n if (val < dmin) val = dmin;\n if (val > dmax) val = dmax;\n }\n return rmin + (rmax - rmin) * (val - dmin) / (dmax - dmin);\n };\n\n scale.clamp = function(c) {\n if (arguments.length) {\n clamp = c;\n return scale;\n } else {\n return clamp;\n }\n };\n\n scale.domain = function(domain) {\n if (arguments.length) {\n dmin = domain[0];\n dmax = domain[1];\n return scale;\n } else {\n return [dmin, dmax];\n }\n };\n\n scale.range = function(range) {\n if (arguments.length) {\n rmin = range[0];\n rmax = range[1];\n return scale;\n } else {\n return [rmin, rmax];\n }\n };\n\n return scale;\n }", "title": "" }, { "docid": "cf5fc6d01c240ca97706d7e2ec06079f", "score": "0.5215201", "text": "scaleToLocal(vector) {\n if (this.hasParent()) this.parent.scaleToLocal(vector);\n scale(vector, {x:1.0/this.scale.x, y:1.0/this.scale.y});\n return;\n }", "title": "" }, { "docid": "21bae56b056b32f3357426f512b9045e", "score": "0.51926625", "text": "function init_ordinal_scales() {\n\n Svg.xScale = d3.scale.ordinal()\n .domain(Psets.data.map(function(d) { return d[Svg.x_encoding]; }))\n .rangeRoundBands([0, Svg.width], 0.5, 0);\n\n Svg.yScale = d3.scale.linear()\n .domain([0, d3.max(Psets.data, function(d) { return d[Svg.y_encoding]; })])\n .range([0, Svg.height]);\n}", "title": "" }, { "docid": "fb8998f93596c715c0d16f5c0daa0904", "score": "0.5186792", "text": "function normalize (pts, bounds) {\n\tlet [lox, loy, hix, hiy] = bounds\n\tlet scaleX = 1.0 / (hix - lox)\n\tlet scaleY = 1.0 / (hiy - loy)\n\tlet result = new Array(pts.length)\n\n\tfor (let i = 0, n = pts.length / 2; i < n; i++) {\n\t\tresult[2*i] = clamp((pts[2*i] - lox) * scaleX, 0, 1)\n\t\tresult[2*i+1] = clamp((pts[2*i+1] - loy) * scaleY, 0, 1)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "fb8998f93596c715c0d16f5c0daa0904", "score": "0.5186792", "text": "function normalize (pts, bounds) {\n\tlet [lox, loy, hix, hiy] = bounds\n\tlet scaleX = 1.0 / (hix - lox)\n\tlet scaleY = 1.0 / (hiy - loy)\n\tlet result = new Array(pts.length)\n\n\tfor (let i = 0, n = pts.length / 2; i < n; i++) {\n\t\tresult[2*i] = clamp((pts[2*i] - lox) * scaleX, 0, 1)\n\t\tresult[2*i+1] = clamp((pts[2*i+1] - loy) * scaleY, 0, 1)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "2bec906b2f80f719eb9c6f83f8effee4", "score": "0.5168392", "text": "getScaleX(){\n const selectedAxis = this.getSelectedAxisX();\n\n const scale = d3.scaleLinear()\n .domain(selectedAxis.getDomain(this.data))\n .range([0, this.chartWidth]);\n\n return scale;\n }", "title": "" }, { "docid": "1762d07afe9620d4d018740b8025a7d3", "score": "0.5112117", "text": "function getAllPoints(scales) {\n return _.chain(scales).map(function (d) {\n return d.domain;\n }).flatten().value();\n }", "title": "" }, { "docid": "fc3a6b0e9d3476c1ff0197e91f769530", "score": "0.51076204", "text": "scale() {\n this.p.scale(this._scaleFactor);\n }", "title": "" }, { "docid": "fc3a6b0e9d3476c1ff0197e91f769530", "score": "0.51076204", "text": "scale() {\n this.p.scale(this._scaleFactor);\n }", "title": "" }, { "docid": "695d4076b6b56244c0cd96b545ad4c49", "score": "0.50987124", "text": "function position(d) {\n var v = dragging[d];\n return v == null ? xScale(d) : v;\n }", "title": "" }, { "docid": "bb400b1fc9879975e693f204520a2dac", "score": "0.50984365", "text": "scaleIdx() {\n switch (this.normBy) {\n case _etc_types__WEBPACK_IMPORTED_MODULE_4__[\"NormBy\"].COL:\n return 'j';\n case _etc_types__WEBPACK_IMPORTED_MODULE_4__[\"NormBy\"].ROW:\n return 'i';\n case _etc_types__WEBPACK_IMPORTED_MODULE_4__[\"NormBy\"].ALL:\n return 'i';\n }\n }", "title": "" }, { "docid": "75b112258bc3adb06fdc6a93727e1946", "score": "0.5097832", "text": "function scale_scaleTypePrecedence(scaleType) {\n return scale_SCALE_PRECEDENCE_INDEX[scaleType];\n}", "title": "" }, { "docid": "6751da0d2fadab4f38034886f52e342f", "score": "0.50917256", "text": "function xScale(ppData, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(ppData, d =>d[chosenXAxis]*0.8), d3.max(ppData, d => d[chosenXAxis]*1.2)])\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "bc7c1c32d2892c484b101401a29d0d4a", "score": "0.5087718", "text": "function xscaler(choice){\n xscale=d3.scaleLinear()\n if (choice=='Poverty(%)'){\n xscale.domain(d3.extent(poverty)).range([0,chartW])\n }\n else {\n xscale.domain(d3.extent(incomes)).range([0,chartW])\n }\n return xscale;\n }", "title": "" }, { "docid": "7d4a583e7f90cafe7ee4f3a1276682cf", "score": "0.50754863", "text": "scale(scale) {\n this.x * scale;\n this.y * scale;\n }", "title": "" }, { "docid": "ab6166ecbe10dd6fb6498bf713d2e58d", "score": "0.5072789", "text": "getScale(){\n let scale = this.props.scale;\n if( typeof scale != 'number' ){\n scale = this.context && this.context.scale;\n }\n if( typeof scale != 'number' ){\n return 1;\n }\n return scale;\n }", "title": "" }, { "docid": "acafdc5bb04bfb46b4b92c75bc0dc796", "score": "0.5072685", "text": "function xScale(povertyData , chosenXAxis) {\n // create Scales\n var xLinearScale= d3.scaleLinear()\n .domain([d3.min(povertyData, d => d[chosenXAxis])*0.8,d3.max(povertyData, d => d[chosenXAxis])*1.2])\n .range([0,chartWidth]);\n\n return xLinearScale;\n}", "title": "" }, { "docid": "51510ed74ba13a90554aefd30447f2b5", "score": "0.5058999", "text": "function transcss(position){\n\tswitch(position){\n\t\tcase 'left':\n\t\t\treturn {\n\t\t\t\t'-webkit-transform'\t: 'translate(-360px) scale(0.5)',\n\t\t\t\t'-moz-transform'\t: 'translate(-360px) scale(0.5)',\n\t\t\t\t'-o-transform'\t\t: 'translate(-360px) scale(0.5)',\n\t\t\t\t'-ms-transform'\t\t: 'translate(-360px) scale(0.5)',\n\t\t\t\t'transform'\t\t\t: 'translate(-360px) scale(0.5)',\n\t\t\t\t'z-index'\t\t\t: 10\n\t\t\t};\n\t\t\tbreak;\n\t\tcase 'leftmid':\n\t\t\treturn {\n\t\t\t\t'-webkit-transform'\t: 'translate(-210px) scale(0.7)',\n\t\t\t\t'-moz-transform'\t: 'translate(-210px) scale(0.7)',\n\t\t\t\t'-o-transform'\t\t: 'translate(-210px) scale(0.7)',\n\t\t\t\t'-ms-transform'\t\t: 'translate(-210px) scale(0.7)',\n\t\t\t\t'transform'\t\t\t: 'translate(-210px) scale(0.7)',\n\t\t\t\t'z-index'\t\t\t: 20\n\t\t\t};\n\t\t\tbreak;\n\t\tcase 'mid':\n\t\t\treturn {\n\t\t\t\t'-webkit-transform'\t: 'translate(0px) scale(1)',\n\t\t\t\t'-moz-transform'\t: 'translate(0px) scale(1)',\n\t\t\t\t'-o-transform'\t\t: 'translate(0px) scale(1)',\n\t\t\t\t'-ms-transform'\t\t: 'translate(0px) scale(1)',\n\t\t\t\t'transform'\t\t\t: 'translate(0px) scale(1)',\n\t\t\t\t'z-index'\t\t\t: 30\n\t\t\t};\n\t\t\tbreak;\n\t\tcase 'rightmid':\n\t\t\treturn {\n\t\t\t\t'-webkit-transform'\t: 'translate(210px) scale(0.7)',\n\t\t\t\t'-moz-transform'\t: 'translate(210px) scale(0.7)',\n\t\t\t\t'-o-transform'\t\t: 'translate(210px) scale(0.7)',\n\t\t\t\t'-ms-transform'\t\t: 'translate(210px) scale(0.7)',\n\t\t\t\t'transform'\t\t\t: 'translate(210px) scale(0.7)',\n\t\t\t\t'z-index'\t\t\t: 20\n\t\t\t};\n\t\t\tbreak;\n\t\tcase 'right':\n\t\t\treturn {\n\t\t\t\t'-webkit-transform'\t: 'translate(360px) scale(0.5)',\n\t\t\t\t'-moz-transform'\t: 'translate(360px) scale(0.5)',\n\t\t\t\t'-o-transform'\t\t: 'translate(360px) scale(0.5)',\n\t\t\t\t'-ms-transform'\t\t: 'translate(360px) scale(0.5)',\n\t\t\t\t'transform'\t\t\t: 'translate(360px) scale(0.5)',\n\t\t\t\t'z-index'\t\t\t: 10\n\t\t\t};\n\t\t\tbreak;\n\n\t};\n}", "title": "" }, { "docid": "e620f4e6f8e16a1e7d5f9cade67a9ac5", "score": "0.50471073", "text": "function updateScales() {\n hour2X.range([0, chartSize[0]]);\n distance2Y.domain([maxDistance, 0]).range([0, chartSize[1]]);\n }", "title": "" }, { "docid": "2c68a6f8d403a940a1d977b99263b901", "score": "0.503963", "text": "function scaleForCanvas(points){\n\tvar scaledPoints = [];\n\tfor(var i = 0; i<points.length;i++){\n\t\tscaledPoints.push([points[i][0] /scaleRatio , points[i][1] /scaleRatio]);\n\t}\n\treturn scaledPoints\n\t\n}", "title": "" }, { "docid": "42a716be48096a4ebd5ff29b6ffc4cb1", "score": "0.5029203", "text": "constructor(x,y,scal){\n this.x=x;\n this.y=y;\n this.scale=scal;\n}", "title": "" }, { "docid": "e781fb46797a86a11bdb259591e386de", "score": "0.50271964", "text": "translatePoint(point) {\n let series = this, shapeArgs, size;\n XRangeSeries.prototype.translatePoint.call(series, point);\n if (point.options.milestone) {\n shapeArgs = point.shapeArgs;\n size = shapeArgs.height || 0;\n point.shapeArgs = {\n x: (shapeArgs.x || 0) - (size / 2),\n y: shapeArgs.y,\n width: size,\n height: size\n };\n }\n }", "title": "" }, { "docid": "56a2d537073c470e910df8806fe38d7b", "score": "0.50120586", "text": "function xScale(paperData, activeXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(paperData, d => d[activeXAxis]) * 0.9,\n d3.max(paperData, d => d[activeXAxis]) * 1.1])\n .range([0, chartWidth]);\n\n return xLinearScale;\n }", "title": "" }, { "docid": "2f744c8b11578eddb8ba34ee51ca5092", "score": "0.50060016", "text": "_appendScales() {\n const shortDist = Boolean(this._profile.totalDistance <= 10)\n const yHeightMin = this._profile.yElevationMin\n const yHeightMax = this._profile.yElevationMax\n const margin = this._margin, width = this._width - this._margin.left - this._margin.right,\n height = this._height - this._margin.top - this._margin.bottom\n this._x = scaleLinear()\n .range([0, width]);\n this._y = scaleLinear()\n .range([height, 0]);\n this._x.domain([0, this._profile.totalDistance]);\n this._y.domain([yHeightMin, yHeightMax]);\n if (shortDist === true) {\n this._xAxis = axisBottom()\n .scale(this._x)\n .tickFormat(d => format(\".2f\")(d) + \" km\");\n } else {\n this._xAxis = axisBottom()\n .scale(this._x)\n .tickFormat(d => format(\".0f\")(d) + \" km\");\n }\n if(this.options.xTicks !== undefined){\n this._xAxis.ticks(Math.pow(2, this.options.xTicks));\n }\n this._yAxis = axisLeft()\n .scale(this._y)\n .tickFormat(d => d + \" m\");\n if(this.options.yTicks !== undefined){\n this._yAxis.ticks(Math.pow(2, this.options.yTicks));\n }\n this._yEndAxis = axisRight()\n .scale(this._yEnd)\n .ticks(0);\n }", "title": "" }, { "docid": "514c4408eb94928125d2df6fde9bb10f", "score": "0.4998861", "text": "scalePositionToAbsolutePosition(scalePosition) {\n if (scalePosition === 0) { console.log(\"Note Position must be > 1\") }\n let ret = (scalePosition + this.root - 2) % 7\n if (ret < 0 || ret > 7) { console.log(\"Bug in Chord.absoluteNoteValue()\", ret) }\n return ret\n }", "title": "" }, { "docid": "c104b8325330435e5a97e7085029abb4", "score": "0.49828044", "text": "drawPoints() {\n //this.circles();\n this.xScale.range([0, 150]); \n this.circles();\n }", "title": "" }, { "docid": "4aad87c585b0c7649567d5363fc5a2f1", "score": "0.49822983", "text": "pointAbs(point, scaling = this.scaling) {\n\t\tlet x = this.xNumberAbs(point[0], scaling);\n\t\tlet y = this.yNumberAbs(point[1], scaling);\n\t\treturn [x, y];\n\t}", "title": "" }, { "docid": "dcfc6b4714b9bccaa99b5a5423e807c1", "score": "0.4979629", "text": "function scaleFromDef( def ) { \n\t\t\n\t\tvar localScale = new THREE.Vector3( 1, 1, 1 );\n\t\tif ( _.isArray( def.scale ) ) localScale.fromArray( def.scale );\n\t\telse localScale.set( def.scale, def.scale, def.scale );\n\t\t\n\t\treturn localScale;\n\t\t\n\t}", "title": "" }, { "docid": "0ba45e9ede668d2006ba927a9e2b3af4", "score": "0.49683684", "text": "function xScale(stateData, selectedXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(stateData, d=>d[selectedXAxis])*0.9, d3.max(stateData, d => d[selectedXAxis])*1.1])\n .range([0, width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "3f1034d5a3e53d687bd3df14f636a3da", "score": "0.496766", "text": "yLeftAxisScale(min, max) {\n return { min: `${min}`, max: `${max}` };\n }", "title": "" }, { "docid": "ffd819b449d0869cd36f6a8d874556eb", "score": "0.49630523", "text": "function QuantitativeScale() {\n var _this = _super.call(this) || this;\n _this._tickGenerator = function (scale) { return scale.defaultTicks(); };\n _this._padProportion = 0.05;\n _this._snappingDomainEnabled = true;\n _this._paddingExceptionsProviders = new Utils.Set();\n return _this;\n }", "title": "" }, { "docid": "9bad44f5f7508a9ef1a5b6986798f7e5", "score": "0.4956298", "text": "get scaled()\n {\n return this.scale.x;\n }", "title": "" }, { "docid": "1a8758a49fa99caa1c1f9f97d6f70460", "score": "0.49525857", "text": "function getScales(data, numPoints, numValues) {\n let colorScale;\n\n // If we are only visualizing 2 enums, we need to manually select colors because colorbrewer's minimum is 3.\n if (numValues <= 2) {\n colorScale = d3.scaleOrdinal()\n .domain(data.map(function (d) {\n return d.value; // Each value gets its own color\n }))\n .range([\"rgb(38,73,109)\", \"rgb(180,221,212)\"]);\n } else {\n colorScale = d3.scaleOrdinal()\n .domain(data.map(function (d) {\n return d.value; // Each value gets its own color\n }))\n .range(colorbrewer.Set3[numValues]);\n }\n\n // x-axis is all about time, so we use the built in scaleTime() to make it\n let xScale = d3.scaleTime()\n .domain([getTime(d3.min(data, function (d) {\n return parseFloat(d.timestamp); // min timestamp is where we start\n })),\n getTime(d3.max(data, function (d) {\n return parseFloat(d.timestamp); // max timestamp is where we end\n }))])\n .range([yOffset + margin, w - margin]);\n\n // y-axis is points, so there is no linear sort of scale for this.\n let yScale = d3.scaleBand()\n .domain(data.map(function (d) {\n return d.point_name;\n }))\n // we want a little space above and below the first and last point --> that is why we are using rangeRound\n .rangeRound([margin, h - xOffset - margin], 0, -.075);\n\n return [colorScale, xScale, yScale];\n }", "title": "" }, { "docid": "1e81639203cb8e9dcc613eebd1847184", "score": "0.49458903", "text": "scaleBackPoint(point) {\n let xs = point[0],\n x = this.rangeX * xs + this.minX,\n ys = point[1],\n y = this.rangeY * ys + this.minY;\n return [x, y];\n }", "title": "" }, { "docid": "043da947de2034bde51761a559d41af4", "score": "0.4945558", "text": "function normalize(point) {\r\n var oneOverLen = 1 / ParticleUtils.length(point);\r\n point.x *= oneOverLen;\r\n point.y *= oneOverLen;\r\n }", "title": "" }, { "docid": "3368725ba202e4f3ffcb92bb4512d241", "score": "0.4944587", "text": "function gridItemPos(idName, itemId, x, y, scale) {\n\n\n var scaleVal =1;\n if (scale =='rand'){\n scaleVal = randomInt(1,30)/10;\n }\n\n if (scale =='f1'){\n var figVal = figure01.slice((itemId-1),itemId);\n }\n if (scale =='f2'){\n var figVal = figure02.slice((itemId-1),itemId);\n }\n if (scale =='f3'){\n var figVal = figure03.slice((itemId-1),itemId);\n }\n\n\n if(figVal == '#') {\n scaleVal = 5;\n }\n if(figVal == '*') {\n scaleVal = 3;\n }\n\n\n document.getElementById(idName+itemId).style.transform = 'translate('+x+'px,'+y+'px) scale('+scaleVal+', '+scaleVal+')';\n\n if ((/MSIE 10/i.test(navigator.userAgent)) || (/MSIE 9/i.test(navigator.userAgent)) || (/rv:11.0/i.test(navigator.userAgent)) || (/Edge\\/\\d./i.test(navigator.userAgent))) {\n document.getElementById(idName+itemId).setAttribute(\"transform\", 'translate('+x+' '+y+') scale('+scaleVal+', '+scaleVal+')');\n }\n\n\n\n}", "title": "" }, { "docid": "ad62a28d73a0432c53ae7f42e645e3e2", "score": "0.4932753", "text": "getScales(state) {\n const { height, width } = this.props;\n\n const x = d3.time.scale()\n .range([0, width])\n .domain(d3.extent(state.data, d => d.date));\n\n const y = d3.scale.linear()\n .range([height, 0])\n .domain(d3.extent(state.data, d => d.value))\n .nice();\n\n return {\n x: x,\n y: y,\n };\n }", "title": "" }, { "docid": "d12ab74f7281923a79a6080339e32190", "score": "0.49272922", "text": "function gridItemPos(idName, itemId, x, y, scale) {\n\n document.getElementById(idName+itemId).style.transform = 'translate('+x+'px,'+y+'px) scale('+scale+','+scale+')';\n}", "title": "" }, { "docid": "267af1ec153e0df263be3df0895f4565", "score": "0.4924714", "text": "function xScale(demographicData, chosenXAxis) {\r\n \r\n var xLinearScale = d3.scaleLinear()\r\n .domain([d3.min(demographicData, d => d[chosenXAxis]) * 0.8,\r\n d3.max(demographicData, d => d[chosenXAxis]) * 1.2\r\n ])\r\n .range([0, width]);\r\n\r\n return xLinearScale;\r\n\r\n}", "title": "" }, { "docid": "7065438dfe00f9994153f6ef18866c74", "score": "0.49152136", "text": "_convertPoint (data, xName = 'x', yName = 'y') {\n data[xName] = data[xName]\n data[yName] = -1 * data[yName]\n }", "title": "" }, { "docid": "c850217af25141380ae196d5f5aacf89", "score": "0.49085203", "text": "function getXScaleForAxis(data,chosenXAxis) {\n var xScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis])*.9, \n d3.max(data, d => d[chosenXAxis])*1.1])\n .range([0, width]); \n return xScale;\n }", "title": "" }, { "docid": "9893402d628e4234363c3979847ef694", "score": "0.49042833", "text": "function identityScale(scale) {\n return d3.scale.identity().range(range(scale));\n }", "title": "" }, { "docid": "df94b98694bff9ea8cfc3b572ae21d0d", "score": "0.490345", "text": "updateScales() {\n // Calculate limits: minimum/maximum x and y values in the data\n \n\n // Define scales `this.xScale()` and `this.yScale()` using `d3.scaleLinear()`\n \n }", "title": "" }, { "docid": "70441c68f6ae84ae85f844a58bc9a6d7", "score": "0.4902124", "text": "function xScale(stateData, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(stateData, d => d[chosenXAxis]) * .99,\n d3.max(stateData, d => d[chosenXAxis]) * 1\n ])\n .range([0, width]);\n\n return xLinearScale;\n\n}", "title": "" }, { "docid": "8c84d6db6c5b1abaa92ed01da90874cd", "score": "0.4901611", "text": "function _getZeroAxis(scale) {\r\n const [from, to] = scale;\r\n const yScale = scaleLinear()\r\n .domain([from, to])\r\n .range([0, 100]);\r\n return (100 - yScale(0));\r\n}", "title": "" }, { "docid": "2961b070656561475bb5397a344ebafb", "score": "0.48977575", "text": "static scaling(x, y) {\n return fromPool().setToScale(x, y);\n }", "title": "" }, { "docid": "548209ec150c5930688ec5d1a03aff40", "score": "0.4896204", "text": "scaleBackPoints(points) {\n return points.map(point=>{\n return this.scaleBackPoint(point);\n });\n }", "title": "" }, { "docid": "001ca8b668e298eaf71fa1f34f31e017", "score": "0.48894715", "text": "function createPoint(z, x, pts, scale) {\r\n\r\n pts.push(new THREE.Vector2(z * scale, x * scale));\r\n\r\n}", "title": "" }, { "docid": "5fe4c1b69b6c47ced8d2548cc7c8961c", "score": "0.48864087", "text": "function scalePoint(point, scale, originPoint) {\n\t var distanceFromOrigin = point - originPoint;\n\t var scaled = scale * distanceFromOrigin;\n\t return originPoint + scaled;\n\t}", "title": "" }, { "docid": "e2ba52dd6603c5a40a60fe97e91a607b", "score": "0.4882412", "text": "function defaultScaleProvider(xScale) {\n\treturn function (data, xAccessor) {\n\t\treturn { data: data, xScale: xScale, xAccessor: xAccessor, displayXAccessor: xAccessor };\n\t};\n}", "title": "" }, { "docid": "99dfa5940c5f2718106fb297a19696fb", "score": "0.4873304", "text": "function xScale(stateData, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(stateData, d => d[chosenXAxis]) * 0.8,\n d3.max(stateData, d => d[chosenXAxis]) * 1.2])\n .range([0, width]);\n return xLinearScale;\n }", "title": "" }, { "docid": "a2c0dcbb5efd24eef5d4633a2e7e6a28", "score": "0.4863901", "text": "function nearestTick(pos) {\n\t var ticks = scale.ticks ? scale.ticks() : scale.domain();\n\t var dist = ticks.map(function (d) {\n\t return pos - scale(d);\n\t });\n\t var i = -1,\n\t index = 0,\n\t r = scale.ticks ? scale.range()[1] : scale.rangeExtent()[1];\n\t do {\n\t i++;\n\t if (Math.abs(dist[i]) < r) {\n\t r = Math.abs(dist[i]);\n\t index = i;\n\t };\n\t } while (dist[i] > 0 && i < dist.length - 1);\n\n\t return ticks[index];\n\t }", "title": "" }, { "docid": "2193ac4bef09322b01d9e591906280c4", "score": "0.4859215", "text": "function applyUniformScaling (transformDefaults, transformValues) {\n let sortedValues = JSON.parse(JSON.stringify(transformValues)) // deepcopy\n if (sortedValues.length === 0 || sortedValues[0] === null || sortedValues[0] === undefined || sortedValues[0].isNaN) {\n transformValues = sortedValues = transformDefaults.sca // safety catch\n }\n sortedValues = sortedValues.map(Math.abs).slice().sort()\n for (let i = 0; i < sortedValues.length; i++) {\n if (sortedValues[i] === sortedValues[i + 1]) {\n sortedValues.splice(i, 2)\n }\n }\n const newValue = sortedValues[0]\n transformValues = transformValues.map(function (value) {\n return value < 0 ? -(newValue) : newValue\n })\n return transformValues\n}", "title": "" }, { "docid": "b945aa2bffbd1e667467522f13ed1b0b", "score": "0.48556864", "text": "function init_linear_scales() {\n\n Svg.xScale = d3.scale.linear()\n .domain([0, d3.max(Psets.data, function(d) { return d[Svg.bins]; })])\n .range([0, Svg.width]);\n\n Psets.data = d3.layout.histogram()\n .bins(Svg.xScale.ticks(Svg.num_ticks))\n (Psets.data.map(function(d) { return d[Svg.bins]; }));\n\n Svg.yScale = d3.scale.linear()\n .domain([0, d3.max(Psets.data, function(d) {return d.y})])\n .range([0, Svg.height]);\n\n}", "title": "" }, { "docid": "ce888728baccf89b6766e4a324967f6c", "score": "0.48482582", "text": "createScales() {\n const referenceJPstopsDistances = this.journeyPatternMix.referenceJP.distances;\n const lastStopDistance = referenceJPstopsDistances[referenceJPstopsDistances.length - 1];\n this.xScale = d3.scaleLinear()\n .domain([0, lastStopDistance])\n .range([0, this.dims.marey.innerWidth]);\n this.yStopSelScale = d3.scaleLinear()\n .domain([0, lastStopDistance])\n .range([0, this.dims.mareyStopSelection.height]);\n this.yScale = d3.scaleTime()\n .domain([this.minTime, this.maxTime])\n .range([0, this.dims.marey.innerHeight]);\n this.yScrollScale = d3.scaleTime()\n .domain([this.minTime, this.maxTime])\n .range([0, this.dims.mareyScroll.height]);\n }", "title": "" }, { "docid": "29a9273187b40bc542b314453d4781f1", "score": "0.48458624", "text": "function xScale(inData, chosenXAxis) {\n // create scales\n if (chosenXAxis == 'state'){\n var xLinearScale = d3.scaleLinear()\n .domain([0, 51])\n .range([0,width]);\n }\n else{\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(inData, d => d[chosenXAxis]) * 0.8,\n d3.max(inData, d => d[chosenXAxis]) * 1.2\n ])\n .range([0, width]);\n }\n return xLinearScale;\n\n}", "title": "" }, { "docid": "15aa15ad7e2aa773b95bbf87cfb3f813", "score": "0.48350686", "text": "function xScale(data,chosenXAxis) { \n var xLinearScale1= d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * .8, d3.max(data, d => d[chosenXAxis])*1.2])\n .range([0, width]);\n\n return xLinearScale1\n}", "title": "" }, { "docid": "72b0ace016755b7af0850153e214729a", "score": "0.48333842", "text": "function xScale(data, chosenXAxis) {\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * 0.9,\n d3.max(data, d => d[chosenXAxis]) * 1.1])\n .range([0,width]);\n\n return xLinearScale;\n}", "title": "" }, { "docid": "22dac20b7532f71b2d64915a67024ed1", "score": "0.48299524", "text": "function getScales(xyMinMaxCurr,xyMinMaxOrigin){\nvar sizeCurr=getSize(xyMinMaxCurr);\nvar sizeOrigin=getSize(xyMinMaxOrigin);\nvar scales=[sizeCurr[0]/sizeOrigin[0],sizeCurr[1]/sizeOrigin[1]];\nisNaN(scales[0])&&(scales[0]=1);\nisNaN(scales[1])&&(scales[1]=1);\nreturn scales;\n}", "title": "" }, { "docid": "2113fbc96eb7677ec2f0d3175069f908", "score": "0.48260036", "text": "function convertPointOnScaleToDate(scaleMin, scaleMax, dateMin, dateMax, position) {\n if (position <= 0) {\n return dateMin;\n }\n\n if (position === scaleMin) {\n return dateMin;\n }\n\n if (position === scaleMax) {\n return dateMax;\n }\n\n if (position >= scaleMax) {\n var maxDate = new Date(dateMax.getTime());\n maxDate.setSeconds(dateMax.getSeconds() + 1);\n return maxDate;\n }\n\n // orignal values before transforming into scale\n var originalMin = dateMin.getTime();\n var originalMax = dateMax.getTime();\n\n // rescale range\n var date = (position - scaleMin) / (scaleMax - scaleMin) * (originalMax - originalMin);\n date += Math.round(originalMin);\n\n var result = new Date(date);\n return result;\n }", "title": "" }, { "docid": "a5c586cae603193b9d9a9355fff6dc01", "score": "0.48214573", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n\t var sizeCurr = getSize(xyMinMaxCurr);\n\t var sizeOrigin = getSize(xyMinMaxOrigin);\n\t var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n\t isNaN(scales[0]) && (scales[0] = 1);\n\t isNaN(scales[1]) && (scales[1] = 1);\n\t return scales;\n\t }", "title": "" }, { "docid": "a5c586cae603193b9d9a9355fff6dc01", "score": "0.48214573", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n\t var sizeCurr = getSize(xyMinMaxCurr);\n\t var sizeOrigin = getSize(xyMinMaxOrigin);\n\t var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n\t isNaN(scales[0]) && (scales[0] = 1);\n\t isNaN(scales[1]) && (scales[1] = 1);\n\t return scales;\n\t }", "title": "" }, { "docid": "a5c586cae603193b9d9a9355fff6dc01", "score": "0.48214573", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n\t var sizeCurr = getSize(xyMinMaxCurr);\n\t var sizeOrigin = getSize(xyMinMaxOrigin);\n\t var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n\t isNaN(scales[0]) && (scales[0] = 1);\n\t isNaN(scales[1]) && (scales[1] = 1);\n\t return scales;\n\t }", "title": "" }, { "docid": "5ffc4adbbfc67324c49a547de93b8fb7", "score": "0.482088", "text": "function scale(data, chosenXAxis, y=true){\n // Input:- data, chosenXAxis(attribute in the data)\n // Output:- Linear scale\n // y: Indicates y axis or not\n var upper = (y) ? [height,0]: [0,width];\n var linearScale = d3.scaleLinear()\n .domain([d3.min(data, d=>d[chosenXAxis])*0.9, d3.max(data, d=>d[chosenXAxis])*1.1])\n .range(upper)\n \n return linearScale;\n }", "title": "" }, { "docid": "aaf023d75af543907251739ce3b12531", "score": "0.48205367", "text": "static scaleData (source, {coords: {z}, min}) {\n for (var t in source.layers) {\n var num_features = source.layers[t].features.length;\n for (var f=0; f < num_features; f++) {\n var feature = source.layers[t].features[f];\n Geo.transformGeometry(feature.geometry, coord => {\n coord[0] = (coord[0] - min.x) * Geo.units_per_meter[z];\n // TODO: this will create negative y-coords, force positive as below instead? or, if later storing positive coords in bit-packed values, flip to negative in post-processing?\n coord[1] = (coord[1] - min.y) * Geo.units_per_meter[z];\n // coord[1] = (coord[1] - tile.max.y) * Geo.units_per_meter[tile.coords.z]; // alternate to force y-coords to be positive, subtract tile max instead of min\n });\n }\n }\n }", "title": "" }, { "docid": "c61316e89d43409cee01fd4d9ef98a94", "score": "0.4816461", "text": "function xScale(my_data, chosenXAxis) {\n // create scales\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(my_data, d => d[chosenXAxis]) * 0.9,\n d3.max(my_data, d => d[chosenXAxis]) * 1.1\n ])\n .range([0, width]);\n \n return xLinearScale;\n }", "title": "" }, { "docid": "1923757050ecc414a992038be2345fd6", "score": "0.4815674", "text": "function buildPath(points, scale) {\n\treturn points.map((point) => {\n\t\treturn {\n\t\t\tx: point.x, // * scale.x,\n\t\t\ty: point.y //* scale.y\n\t\t};\n\t});\n}", "title": "" }, { "docid": "d84c7aa0c5fe47da6ce587d77b22ae01", "score": "0.48113647", "text": "static createDirectionalScale(direction, scale, result) {\n const unit = direction.normalize();\n if (unit) {\n const x = unit.x;\n const y = unit.y;\n const z = unit.z;\n const a = (scale - 1);\n return Matrix3d.createRowValues(1 + a * x * x, a * x * y, a * x * z, a * y * x, 1 + a * y * y, a * y * z, a * z * x, a * z * y, 1 + a * z * z, result);\n }\n return Matrix3d.createUniformScale(scale);\n }", "title": "" }, { "docid": "07f55f1fec82516d5b4006331a51fae4", "score": "0.48067966", "text": "setScale(scale, update=true){\n if(Array.isArray(scale)){\n this.setMatrixProperty('scale', scale, update);\n return;\n }\n if(scale.elements){\n this.setMatrixProperty('scale', scale, update);\n return;\n }\n if(typeof scale == 'number'){\n this.setMatrixProperty('scale', new Vec2(scale, scale), update);\n return;\n }\n this.setMatrixProperty('scale', scale, update);\n }", "title": "" }, { "docid": "7e2dcfac5dc5ea91fb2a201c774a2571", "score": "0.48025107", "text": "function position_point_positionRef(params) {\n const { channel, channelDef, scaleName, stack, offset } = params;\n // This isn't a part of midPoint because we use midPoint for non-position too\n if (channeldef_isFieldDef(channelDef) && stack && channel === stack.fieldChannel) {\n if (channeldef_isPositionFieldDef(channelDef) && channelDef.band !== undefined) {\n return valueref_interpolatedSignalRef({\n scaleName,\n fieldDef: channelDef,\n startSuffix: 'start',\n band: channelDef.band,\n offset: 0\n });\n }\n // x or y use stack_end so that stacked line's point mark use stack_end too.\n return valueref_fieldRef(channelDef, scaleName, { suffix: 'end' }, { offset });\n }\n return valueref_midPointRefWithPositionInvalidTest(params);\n}", "title": "" }, { "docid": "5977006178450a3dc77651c0ce16ef88", "score": "0.48022383", "text": "scalePosition (newP, oldW, oldH) {\n this.p = newP;\n let p = this.p;\n\n this.pos.x /= oldW;\n this.pos.x *= p.width;\n\n this.pos.y /= oldH;\n this.pos.y *= p.height;\n\n this.clamp();\n }", "title": "" }, { "docid": "a71b2bd4dd240326de19cdd2bad52d17", "score": "0.4800081", "text": "scale(s) {\n\t\treturn new LV2(this.x * s, this.y * s);\n\t}", "title": "" }, { "docid": "db03f4ce64a042fed978f13950606fe6", "score": "0.47957006", "text": "createScales(width, height) {\n let x;\n let y;\n\n // Set x scale\n if (this.xtype==\"number\") {\n x = d3.scaleLinear()\n .domain( d3.extent(this.d, (row)=>{ return row[this.x]; }) )\n .range([ 0, width])\n .nice();\n }\n\n // Set y scale\n if (this.ytype==\"number\") {\n y = d3.scaleLinear()\n .domain( d3.extent(this.d, (row)=>{ return row[this.y]; }) )\n .range([ height, 0])\n .nice();\n }\n return { x, y };\n }", "title": "" }, { "docid": "f1a3339d7582667b048f239e6ca0e5f3", "score": "0.47902396", "text": "function scaleXCoords(tupesArr, scaleFactor){\r\n\tfor(var i = 0; i<tupesArr.length; i++){\r\n\t\ttupesArr[i].x = Math.floor(tupesArr[i].x * scaleFactor);\r\n\t}\r\n\txCoordDisplayScaling = 1/scaleFactor;\r\n}", "title": "" }, { "docid": "f29c929f0fa0a287f1e726d39496f013", "score": "0.47863832", "text": "function locationforcanvas(location,scaleamountX){\n var x= location%scaleamountX;\n var y = Math.floor((location-x)/scaleamountX);\n if(x==0){\n y-=1\n if(scaleamountX==16){\n x=16 \n }\n if(scaleamountX==80){\n x=80\n }\n if(scaleamountX==1200){\n x=1200\n }\n }\n return {\n x:x,\n y:y\n }\n }", "title": "" }, { "docid": "6aca133efa636a203fe8716149b75227", "score": "0.4777762", "text": "function xPosition(d, i) {\n return xScale(d.y);\n}", "title": "" }, { "docid": "00510f7b40e45ca5f32ba0cdb2f62bfd", "score": "0.47762424", "text": "function xScale(censusData, chosenXAxis) {\n// CREATE X SCALE\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(censusData, d => d[chosenXAxis]) * 0.8, // [] instead of dot notation. dot notation need to know ahead of time\n d3.max(censusData, d => d[chosenXAxis]) * 1.2 \n ])\n .range([0, chartWidth]);\n \n return xLinearScale;\n}", "title": "" }, { "docid": "869f609fe232d0adb777ecdf94658599", "score": "0.47720125", "text": "scale(scale) {\n return new Vector(this.x * scale, this.y * scale);\n }", "title": "" }, { "docid": "b74bee34dc3372e17759de77021dd535", "score": "0.47703636", "text": "function xScale(data, chosenXAxis) {\n //creating scales\n let xLinearScale = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]) * .8,\n d3.max(data, d => d[chosenXAxis]) * 1.1\n ])\n .range([0,width]);\n return xLinearScale;\n}", "title": "" }, { "docid": "5e4b4ae8e053e479fea1db06f0316f13", "score": "0.47701192", "text": "function normalizePoint(p) {\n var d = dist(0, 0, p.x, p.y);\n return {\n x: p.x / d,\n y: p.y / d\n }\n}", "title": "" }, { "docid": "f9f1013c13a97d2adf264f39846757de", "score": "0.476377", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "title": "" }, { "docid": "f9f1013c13a97d2adf264f39846757de", "score": "0.476377", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "title": "" }, { "docid": "f9f1013c13a97d2adf264f39846757de", "score": "0.476377", "text": "function getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}", "title": "" }, { "docid": "d789151144a6aa4e9e55051079479ddc", "score": "0.47583124", "text": "setToScale(x, y) {\n // allow using one parameter to scale everything\n y = y === undefined ? x : y;\n return this.rowMajor(x, 0, 0, 0, y, 0, 0, 0, 1, Matrix3Type.SCALING);\n }", "title": "" }, { "docid": "34fe851374951fe914173c213e3bdee4", "score": "0.47568434", "text": "function xScale(data, chosenXAxis) {\n var x = d3.scaleLinear()\n .domain([d3.min(data, d => d[chosenXAxis]), d3.max(data, d => d[chosenXAxis])])\n .range([0, width]);\n return x;\n}", "title": "" }, { "docid": "60746f27535b7962057417d2f0a5eeed", "score": "0.47563574", "text": "function NullScaleProvider() {\n FixedScaleProvider.call(this, 1);\n }", "title": "" }, { "docid": "a0af87a6f349c8c7529de98677ab54b3", "score": "0.4755453", "text": "function getScaledX(point) {\r\n return point.x * xScale;\r\n }", "title": "" } ]
abe4da4acf3cc2cb235295a6579a8d5a
Handle any potential error codes returned by a shelljs command execution.
[ { "docid": "028148d1127fdf0ef89b0176debdd2ab", "score": "0.6813361", "text": "function handleErrorCode (commandOutput) {\n if (commandOutput.code !== 0) {\n throw new Error([\n `Command line operation failed with code ${commandOutput.code}.`,\n `Standard error output: ${commandOutput.stderr}`\n ].join('\\n'))\n }\n}", "title": "" } ]
[ { "docid": "b334cef7a504e65fa58b10948bddb6e8", "score": "0.66310984", "text": "function _errorHandler ( e ) { throw new Error( 'unhandled command: ', e.toString( 16 ) ); }", "title": "" }, { "docid": "b334cef7a504e65fa58b10948bddb6e8", "score": "0.66310984", "text": "function _errorHandler ( e ) { throw new Error( 'unhandled command: ', e.toString( 16 ) ); }", "title": "" }, { "docid": "395874d754b7f9794f39ae6982b22912", "score": "0.63677233", "text": "function _errorHandler ( e ) { console.warn( 'unhandled command: ', e.toString( 16 ) ); return false; }", "title": "" }, { "docid": "395874d754b7f9794f39ae6982b22912", "score": "0.63677233", "text": "function _errorHandler ( e ) { console.warn( 'unhandled command: ', e.toString( 16 ) ); return false; }", "title": "" }, { "docid": "fceab33dcf3cb1acc6b7b602478b1fa5", "score": "0.5908048", "text": "function handleErrors() {\n var notify = require('gulp-notify');\n var args = Array.prototype.slice.call(arguments);\n notify.onError({\n title: \"Compile Error\",\n message: \"<%= error.message %>\"\n }).apply(this, args);\n console.log(args);\n this.emit('end'); // Keep gulp from hanging on this task\n}", "title": "" }, { "docid": "9ebbf25aef34ebd801a2850be1474dba", "score": "0.5851567", "text": "function errorHandler(error){\n console.log(\"ERROR: \"+error.code);\n}", "title": "" }, { "docid": "58e623e3f7c533c28986c03e75e213e9", "score": "0.58387065", "text": "function handleErrors() {\n var args = Array.prototype.slice.call(arguments);\n notify.onError({\n title: 'Compile Error',\n message: '<%= error.message %>'\n }).apply(this, args);\n\n this.emit('end');\n}", "title": "" }, { "docid": "90fbe3306055b6e1f2f2655f3671e3c3", "score": "0.5833458", "text": "function errHandler(err) {\n console.error('There was an error performing the operation');\n console.log(err);\n console.log(err.code);\n return console.error(err.message);\n}", "title": "" }, { "docid": "ee68d847da3a8115bbeb528a7d57797d", "score": "0.5829574", "text": "function handleError(err) {\n console.log('ERROR:', err);\n quit();\n return err;\n}", "title": "" }, { "docid": "ee68d847da3a8115bbeb528a7d57797d", "score": "0.5829574", "text": "function handleError(err) {\n console.log('ERROR:', err);\n quit();\n return err;\n}", "title": "" }, { "docid": "ee68d847da3a8115bbeb528a7d57797d", "score": "0.5829574", "text": "function handleError(err) {\n console.log('ERROR:', err);\n quit();\n return err;\n}", "title": "" }, { "docid": "7c076353e754795168408e52ed04bb95", "score": "0.58286995", "text": "function runProcessThrowError(cmd, dir) {\n log('Running: ' + cmd);\n if (dir) shelljs.pushd(dir);\n try {\n execSync(cmd);\n }\n finally {\n if (dir) shelljs.popd();\n }\n}", "title": "" }, { "docid": "f9d0f3ec67808ea9ce15c22fb1688697", "score": "0.5784127", "text": "function handleErrors() {\n var args = Array.prototype.slice.call(arguments);\n\n notify.onError({\n title: 'Task Failed! See console.',\n message: \"\\n\\n<%= error.message %>\",\n sound: 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults\n }).apply(this, args);\n\n gutil.beep(); // Beep 'sosumi' again\n\n // Prevent the 'watch' task from stopping\n this.emit('end');\n}", "title": "" }, { "docid": "9e190f8fd473eff7423922d652c225be", "score": "0.5770263", "text": "function handleErrors() {\n const args = Array.prototype.slice.call( arguments );\n\n notify.onError( {\n 'title': 'Task Failed [<%= error.message %>',\n 'message': 'See console.',\n 'sound': 'Sosumi' // See: https://github.com/mikaelbr/node-notifier#all-notification-options-with-their-defaults\n } ).apply( this, args );\n\n gutil.beep(); // Beep 'sosumi' again.\n\n // Prevent the 'watch' task from stopping.\n this.emit( 'end' );\n}", "title": "" }, { "docid": "968ff7112020b15a979cabfc3fd8b8f2", "score": "0.5752999", "text": "function reportExecuteScriptError(error) {\n //document.querySelector(\"#popup-content\").classList.add(\"hidden\");\n //document.querySelector(\"#error-content\").classList.remove(\"hidden\");\n console.error(`Failed to execute HPsel content script: ${error.message}`);\n return \"ok\";\n}", "title": "" }, { "docid": "47ddbde7fb194ab3fa9e0e1b9965f1f8", "score": "0.5743285", "text": "handleError() { }", "title": "" }, { "docid": "1d95c96b2b7145dff31b3b22481f4a80", "score": "0.5735111", "text": "function error(message) {\n command_1.issue('error', message);\n}", "title": "" }, { "docid": "1d95c96b2b7145dff31b3b22481f4a80", "score": "0.5735111", "text": "function error(message) {\n command_1.issue('error', message);\n}", "title": "" }, { "docid": "1d95c96b2b7145dff31b3b22481f4a80", "score": "0.5735111", "text": "function error(message) {\n command_1.issue('error', message);\n}", "title": "" }, { "docid": "1d95c96b2b7145dff31b3b22481f4a80", "score": "0.5735111", "text": "function error(message) {\n command_1.issue('error', message);\n}", "title": "" }, { "docid": "94e7149ffc893b7be864d0dfdf8692af", "score": "0.5690619", "text": "function error(message) {\r\n command_1.issue('error', message);\r\n}", "title": "" }, { "docid": "94e7149ffc893b7be864d0dfdf8692af", "score": "0.5690619", "text": "function error(message) {\r\n command_1.issue('error', message);\r\n}", "title": "" }, { "docid": "113f6d1e99f2a37f20be223d99aec681", "score": "0.568076", "text": "function runProcessCatchError(cmd, msg, dir) {\n var success = false;\n log('Running: ' + cmd);\n if (dir) shelljs.pushd(dir);\n try {\n execSync(cmd);\n if (msg) log('!SUCCESS! ' + msg, COLOR.yellow);\n success = true;\n } catch (err) {\n if (msg) log('!FAILURE! ' + msg, COLOR.red);\n console.error(err.stderr.toString());\n }\n finally {\n if (dir) shelljs.popd();\n return success;\n }\n}", "title": "" }, { "docid": "ed6d0a5e719ecdb21b6a7b4c18ff5482", "score": "0.5613322", "text": "function err(msg, command, raw, e)\n{\n console.log(msg + '. Command: ' + command + '. See error[' + error.length + ']');\n error.push({\"data\" : raw, \"exception\" : e});\n}", "title": "" }, { "docid": "375467b6c5e33e60ec996c2819177c1d", "score": "0.55752844", "text": "function stderrHandler(data) {\n if (data && data.length > 0) {\n error = String(data);\n }\n }", "title": "" }, { "docid": "4fcdb7300e1b38c9051f394eb739194d", "score": "0.55660105", "text": "function handleErr (err) {\n if (err) {\n process.stderr.write(util.format(err) + '\\n')\n process.exit(1)\n }\n}", "title": "" }, { "docid": "f464bd7204d29d85c9994ef5516c9d32", "score": "0.5471701", "text": "function ExecError(message, parameters, code) {\n CliError.call(this, message, code, parameters);\n}", "title": "" }, { "docid": "38ad42afa257736d710ebcbfa1de6b3c", "score": "0.5462189", "text": "function handleErrors(...errorArgs) {\n const args = Array.prototype.slice.call(errorArgs);\n notify.onError({\n title: 'Compile Error',\n message: '<%= error.message %>'\n }).apply(this, args);\n this.emit('end'); // Keep gulp from hanging on this task\n}", "title": "" }, { "docid": "6e6cd87a8e49dd61859831165c89f6fa", "score": "0.5456941", "text": "function handleError(response, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n response.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "57e1c7c4894185711f5058e39a9bbef2", "score": "0.5456084", "text": "function handleError(code, message) {\n //Process yor code\n // Generate a message\n throw new Error(`${message}. Code: ${code}`);\n}", "title": "" }, { "docid": "bbb223ec7536116d371d1e0a0a2a1c96", "score": "0.5450441", "text": "function onOutputError(err) {\n if (err.code === 'EACCES') {\n console.error(err.path + \" is not writable. Skipping!\");\n }\n else {\n console.error(err);\n process.exit(0);\n }\n}", "title": "" }, { "docid": "c427797bb400a27b45fd63bd955496f0", "score": "0.5427856", "text": "function handleError(response, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n response.status(code || 500).json({ \"error\": message });\n}", "title": "" }, { "docid": "a23249622d7e5b28c6fc10b8b89ce553", "score": "0.54150796", "text": "function error(err) {\n exit('ERROR: ' + err);\n}", "title": "" }, { "docid": "b86b3d79bcec3313525558455efda1ae", "score": "0.53864956", "text": "function errorHandler(error) {\n // Logs out error in the command line\n console.log(error.toString());\n // Ends the current pipe, so Gulp watch doesn't break\n this.emit('end');\n}", "title": "" }, { "docid": "72668e3fd642c54262e0f52854b890ce", "score": "0.5381621", "text": "function handleError(res, reason, message, code) {\n\tconsole.log(\"ERROR: \" + reason);\n\tres.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "75929c875617feae8f0e56a7a8467413", "score": "0.537677", "text": "function run(command: Observable<SerializableAppState>): void {\n commandWasHandled = true;\n lock()\n .concat(command.switchMap(saveState).finally(() => endWatchman()))\n .concat(unlock())\n .subscribe(\n () => {},\n // eslint-disable-next-line no-console\n err => console.error(err),\n () => {\n debugLog(`Done! (${String(process.exitCode)})`);\n },\n );\n}\n\nexport class ForwardedCommandError extends Error {\n process: child_process$ChildProcess;\n exitCode: number;\n constructor(exitCode: number, proc: child_process$ChildProcess) {\n super(`Forwarded command failed: ${(proc: any).spawnargs}`);\n this.process = proc;\n this.exitCode = exitCode;\n this.name = this.constructor.name;\n }", "title": "" }, { "docid": "57f26c16a77a4d83415d67faf4c7b9f9", "score": "0.5346777", "text": "function errorHandler(error) {\n // Logs out error in the command line..\n console.log(error.toString());\n // Ends the current pipe, so Gulp watch doesn't break..\n this.emit('end');\n}", "title": "" }, { "docid": "cc1889e57c3c08815643ca843fda1f71", "score": "0.53352267", "text": "function failHandler(status) {\n console.log(status);\n}", "title": "" }, { "docid": "9a2f308a02efc79cf82a0920e478acb7", "score": "0.5333782", "text": "function onExit (code, signal) {\n if (code !== 0) {\n return callback(new Error('`' + command + '` failed with exit code: ' + code))\n }\n if (signal) {\n return callback(new Error('`' + command + '` got signal: ' + signal))\n }\n callback()\n }", "title": "" }, { "docid": "9a2f308a02efc79cf82a0920e478acb7", "score": "0.5333782", "text": "function onExit (code, signal) {\n if (code !== 0) {\n return callback(new Error('`' + command + '` failed with exit code: ' + code))\n }\n if (signal) {\n return callback(new Error('`' + command + '` got signal: ' + signal))\n }\n callback()\n }", "title": "" }, { "docid": "d3c1166b2f982b8905ed1c5b1323c750", "score": "0.5326461", "text": "function HandleError(res, reason, message, code) {\n\tconsole.log('ERROR: ' + reason);\n\tres.status(code || 500).json({ 'error': message });\n}", "title": "" }, { "docid": "22fe20aaa312b8f04bb1d3d09e45fd4b", "score": "0.5303769", "text": "function errorHandler(err) \n{\n console.error(err.message);\n browserSync.notify(err.message, 3000);\n this.emit('end');\n}", "title": "" }, { "docid": "191c4b8a1ede7b59fb1a2e0a116305d3", "score": "0.5298942", "text": "function errorMessage(x){\n displayOutput(\"bash: \"+x.innerHTML+\": command not found\");\n}", "title": "" }, { "docid": "191c4b8a1ede7b59fb1a2e0a116305d3", "score": "0.5298942", "text": "function errorMessage(x){\n displayOutput(\"bash: \"+x.innerHTML+\": command not found\");\n}", "title": "" }, { "docid": "2bc3eb70adf4a34dfd16e65254ca2c9a", "score": "0.52957916", "text": "_handleErr (err) {\n console.error(err)\n }", "title": "" }, { "docid": "c624febe9563690471058d09e93c2a8b", "score": "0.5292951", "text": "function handleError(res, reason, message, code) {\n console.error(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "3d15c74ce6ea3eb9626d50b6ff7fc31e", "score": "0.5291734", "text": "function shellInvalidCommand() {\r\n _StdIn.putText(\"Invalid Command. \");\r\n if (_SarcasticMode) {\r\n _StdIn.putText(\"Duh. Go back to your Speak & Spell.\");\r\n }\r\n else {\r\n _StdIn.putText(\"Commands are case sensitive.\");\r\n _StdIn.advanceLine();\r\n _StdIn.putText(\"Type help for options.\");\r\n }\r\n}", "title": "" }, { "docid": "3c1f2685705eafc279e5e5e3e25f32c5", "score": "0.52907294", "text": "function quit(code, line, chr) {\n\t var percentage = Math.floor((line / state.lines.length) * 100);\n\t var message = messages.errors[code].desc;\n\n\t throw {\n\t name: \"JSHintError\",\n\t line: line,\n\t character: chr,\n\t message: message + \" (\" + percentage + \"% scanned).\",\n\t raw: message,\n\t code: code\n\t };\n\t }", "title": "" }, { "docid": "adcbdb86d4eb56c8649bbe840fdb1eb4", "score": "0.52900535", "text": "function onError(err, msg) {\n console.log(msg);\n console.log(err.message);\n process.exit();\n}", "title": "" }, { "docid": "0493c92d997faf949fd72cac4b942f80", "score": "0.527539", "text": "function failure(msg: string) {\n console.error(msg);\n exit(-1);\n}", "title": "" }, { "docid": "ed6ab6c1c7bf7016b14b3361b0add1a2", "score": "0.5271833", "text": "function shellExec(cmd, msg)\r\n{\r\n\texec(cmd, (error, stdout, stderr) =>\r\n\t{\r\n\t\tif (error)\r\n\t\t{\r\n\t\t\tconsole.log(\"Compilation Error\");\r\n\t\t\tconsole.error(`exec error: ${error}`);\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tconsole.log(\"Successfully Compiled\");\r\n\t\t}\r\n\t\tif (msg)\r\n\t\t{\r\n\t\t\tconsole.log(`stdout: ${stdout}`);\r\n\t\t\tconsole.log(`stderr: ${stderr}`);\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "3277e89148dfb25162d364631bd5585a", "score": "0.5260184", "text": "function handleError (err, msg) {\n if (err) {\n console.log(msg)\n console.log(err)\n process.exit(1)\n }\n}", "title": "" }, { "docid": "3dbfd191d9a73d5259fe476f00aee384", "score": "0.5259852", "text": "function handle_error(err) {\n if (err.message) {\n err = err.message;\n }\n\n if (Buffer.isBuffer(err)) {\n err = err.toString();\n }\n\n if (typeof err === 'string') {\n err = err.trim();\n }\n err.split(\"\\n\").forEach(function (line) {\n write_output(gutil.colors.red(line));\n });\n}", "title": "" }, { "docid": "4f963fd323847e5866f55486243f89f4", "score": "0.52546585", "text": "function handleError(value) {\n console.log(\"Error: \" + value);\n switch(value){\n case \"auth\":\n // Beats Music API auth error (401)\n break;\n case \"connectionfailure\":\n // audio stream connection failure\n break;\n case \"apisecurity\":\n // Beats Music API crossdomain error\n break;\n case \"streamsecurity\":\n // audio stream crossdomain error\n break;\n case \"streamio\":\n // audio stream io error\n break;\n case \"apiio\":\n // Beats Music API io error getting track data\n break;\n case \"flashversion\":\n // flash version too low or not installed\n break;\n }\n }", "title": "" }, { "docid": "67923866f0178c9b0bd95c48c17350ad", "score": "0.5254489", "text": "function errorHandler(error){\n\tswitch (error){\n\t\tcase PromiseCode.UnknownNet:\n\t\t\talert(\"Please move to MainNet\")\n\t\t\tbreak\n\t\tcase PromiseCode.InvalidTxn:\n\t\t\tconsole.log(\"No initial txn\")\n\t\t\tbreak\n\t\tdefault:\n\t\t\treturn error\n\t}\n}", "title": "" }, { "docid": "1c090153cab93029926182bb25ad5511", "score": "0.5250546", "text": "function quit(code, line, chr) {\n var percentage = Math.floor((line / state.lines.length) * 100);\n var message = messages.errors[code].desc;\n\n throw {\n name: \"JSHintError\",\n line: line,\n character: chr,\n message: message + \" (\" + percentage + \"% scanned).\",\n raw: message,\n code: code\n };\n }", "title": "" }, { "docid": "1c090153cab93029926182bb25ad5511", "score": "0.5250546", "text": "function quit(code, line, chr) {\n var percentage = Math.floor((line / state.lines.length) * 100);\n var message = messages.errors[code].desc;\n\n throw {\n name: \"JSHintError\",\n line: line,\n character: chr,\n message: message + \" (\" + percentage + \"% scanned).\",\n raw: message,\n code: code\n };\n }", "title": "" }, { "docid": "2c1e188faa418a2b0269ee4f8aa81a89", "score": "0.52450657", "text": "function error(msg) {\n console.error(msg);\n process.exit(1);\n}", "title": "" }, { "docid": "f228bce21ca1978de60335800f20cb5f", "score": "0.52396864", "text": "function errorCallback(err) {}", "title": "" }, { "docid": "10e7ca602c2610038c3ef082c5e88088", "score": "0.5227262", "text": "function handleError(error){\n alert(\"Something went wrong in JavaScript code: \"+error);\n}", "title": "" }, { "docid": "9061c30f0aac4c910947db9b8cfd9b57", "score": "0.522369", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n }", "title": "" }, { "docid": "0527aee225022aec9894a7e571d2f122", "score": "0.5220394", "text": "function errorHandler(err) {\n if(err.code == 1) {\n console.log(\"Error: Access is denied!\");\n }\n\n else if( err.code == 2) {\n console.log(\"Error: Position is unavailable!\");\n }\n }", "title": "" }, { "docid": "5f1f58319e72a011492afcb66d1dfdc7", "score": "0.5216754", "text": "function mkErrorMsg(registryCommand, code, output) {\r\n var stdout = output['stdout'].trim();\r\n var stderr = output['stderr'].trim();\r\n\r\n var msg = util.format(\"%s command exited with code %d:\\n%s\\n%s\", registryCommand, code, stdout, stderr);\r\n return new ProcessUncleanExitError(msg, code);\r\n}", "title": "" }, { "docid": "a37651cf5415eb979fc44d4922883801", "score": "0.52136505", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n console.log(\"ERROR MSG: \" + message);\n return res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "ba07ce4c759ed128af3e8fa3cb8e6aae", "score": "0.52130115", "text": "function quit(code, line, chr) {\n\t\tvar percentage = Math.floor((line / state.lines.length) * 100);\n\t\tvar message = messages.errors[code].desc;\n\n\t\tthrow {\n\t\t\tname: \"JSHintError\",\n\t\t\tline: line,\n\t\t\tcharacter: chr,\n\t\t\tmessage: message + \" (\" + percentage + \"% scanned).\",\n\t\t\traw: message,\n\t\t\tcode: code\n\t\t};\n\t}", "title": "" }, { "docid": "279d1a89c02401bb3950a7605c5c868d", "score": "0.5212078", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "279d1a89c02401bb3950a7605c5c868d", "score": "0.5212078", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "279d1a89c02401bb3950a7605c5c868d", "score": "0.5212078", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "279d1a89c02401bb3950a7605c5c868d", "score": "0.5212078", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "5f65fec11b57e3c4b89ebb421198f217", "score": "0.52078635", "text": "function quit(code, token, a, b) {\n var percentage = Math.floor((token.line / state.lines.length) * 100);\n var message = messages.errors[code].desc;\n\n var exception = {\n name: \"JSHintError\",\n line: token.line,\n character: token.from,\n message: message + \" (\" + percentage + \"% scanned).\",\n raw: message,\n code: code,\n a: a,\n b: b\n };\n\n exception.reason = supplant(message, exception) + \" (\" + percentage +\n \"% scanned).\";\n\n throw exception;\n }", "title": "" }, { "docid": "7b1ddc94e6f664d7b565ba7b985502c4", "score": "0.52006805", "text": "TestHandleError() {\r\n const sql = `DELETE FROM nnnnnnnnnnnnnnnnnnnnnn WHERE id=19`;\r\n const that = this;\r\n dpdata.executeSql(sql, null, function (status, error) {\r\n that._displaySubtitle(\"#00 TestHandleError:\");\r\n if (status == 'error') {\r\n console.log('ERROR: ' + error.message);\r\n } else {\r\n console.log(`successful, i.e. no error`);\r\n } \r\n });\r\n }", "title": "" }, { "docid": "78371424ff54919387b509c14ec66784", "score": "0.51928526", "text": "async function handleError(error) {\n process.stdout.write('\\n' + chalk.red.bold(error + '\\n'));\n if (error.name === 'ArgumentError') {\n await help(args);\n }\n return 1;\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "97319bfd209e40d23cd0cf724c7be525", "score": "0.5192017", "text": "function handleError(res, reason, message, code) {\n console.log(\"ERROR: \" + reason);\n res.status(code || 500).json({\"error\": message});\n}", "title": "" }, { "docid": "566447617af99a577937f750d84c5fb1", "score": "0.51870537", "text": "handle (error, { request, response, session }) {\n if(true){\n let json = {\n status: error.status || 201,\n code: error.code,\n message: error.message\n }\n \n if (use('Env').get('NODE_ENV') === 'development') {\n json.traces = error.stack\n }\n \n return response.status(error.status).json(json)\n }\n \n session.withErrors({ error: error.message }).flashAll()\n await session.commit()\n \n response.redirect('/error/invalid-args')\n }", "title": "" }, { "docid": "f49a02226cd5d9fe9f9346bd2c177178", "score": "0.5183709", "text": "function quit(code, line, chr) {\r\t\tvar percentage = Math.floor((line / state.lines.length) * 100);\r\t\tvar message = messages.errors[code].desc;\r\r\t\tthrow {\r\t\t\tname: \"JSHintError\",\r\t\t\tline: line,\r\t\t\tcharacter: chr,\r\t\t\tmessage: message + \" (\" + percentage + \"% scanned).\",\r\t\t\traw: message,\r\t\t\tcode: code\r\t\t};\r\t}", "title": "" }, { "docid": "fe412462e79acd0cddc30f2153fc55d7", "score": "0.51759547", "text": "_errorHandle(err) {\n console.log('err:', err);\n }", "title": "" } ]
4d47d393762aea8b95bc1b487b757037
Remove hpadding style from all existing actors & stop listening for more
[ { "docid": "9fc09c2a48462493680ccd23e5fafcea", "score": "0.5501637", "text": "function removeStyles() {\n /* disconnect signal */\n if (actorAddedID) {\n Main.panel._rightBox.disconnect(actorAddedID);\n }\n /* remove style class name. */\n let children = Main.panel._rightBox.get_children();\n for (let i = 0; i < children.length; ++i) {\n restoreOriginalStyle(children[i]);\n }\n}", "title": "" } ]
[ { "docid": "2fa7e56baaecfc2fe3dcace3b35d3261", "score": "0.5538037", "text": "function applyStyles() {\n padding = settings.get_int('hpadding');\n styleLine = '-natural-hpadding: %dpx'.format(padding);\n // if you set it below 6 and it looks funny, that's your fault!\n if (padding < 6) {\n styleLine += '; -minimum-hpadding: %dpx'.format(padding);\n }\n\n /* set style for everything in _rightBox */\n let children = Main.panel._rightBox.get_children();\n for (let i = 0; i < children.length; ++i) {\n overrideStyle(children[i]);\n }\n\n /* connect signal */\n actorAddedID = Main.panel._rightBox.connect('actor-added',\n function (container, actor) {\n overrideStyle(actor);\n }\n );\n}", "title": "" }, { "docid": "6027aa7e721f927c877cfdd60ca21b4a", "score": "0.53770256", "text": "function clear_message_style()\n{\n\tvar frameDoc = get_frame();\n\t$(\".UD\", frameDoc).first().attr(\"style\", \"\");\n\t$(\".UB\", frameDoc).first().attr(\"style\", \"\");\n\t$(\".vh\", frameDoc).first().not(\".boomerang\").attr(\"style\", \"\");\n}", "title": "" }, { "docid": "33f0f8958b9925617f9c67a155c59b7f", "score": "0.5322352", "text": "function deilluminate() {\n\tattentionbarEl.style.backgroundColor = '#CCCCCC'\n\tattention_on = 0;\n}", "title": "" }, { "docid": "23733713beb17dd1096a9346f3b5da67", "score": "0.53148395", "text": "function removeSickness()\n{\n\tfor (let bubble of bubbles)\n\t{\n\t\tif (bubble.sick && bubble.timeSick > 20) {\n\t\t\tbubble.sick = false;\n\t\t\tbubble.timeSick = 0;\n\t\t\tbubble.changeColour();\n\t\t\tbubble.immune = true;\n\t\t\tbubble.colours = [85, 0, 85];\n\t\t\timmuneCounter++;\n\t\t\tsickCounter--;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "725de25a57a3a0882b882c722ddc87a5", "score": "0.5290907", "text": "beforeLeave() {\n bodyTag.classList.remove(\"feed\");\n }", "title": "" }, { "docid": "418330e2fe4988972ebdc0952894dc68", "score": "0.5240184", "text": "function destroyLines() {\n const msgs = document.getElementById('mudScreen');\n if (msgs.innerHTML.length > 100000) {\n msgs.innerHTML = '';\n }\n}", "title": "" }, { "docid": "4f96d779bdae7f0063cf2d85d7e927e0", "score": "0.52065974", "text": "function clearBubbleOnScreen() {\n const bubbleList = Array.from(document.getElementsByClassName('bubble'));\n wordRuningList = [];\n bubbleList.forEach(function(bubble) {\n bubble.remove();\n })\n}", "title": "" }, { "docid": "0c7ed7acb6cc02003bf71b6a033c5ffd", "score": "0.5197758", "text": "function restoreChat(){\n\telements = document.querySelectorAll('#chatbubble');\n\tfor (var i = 0; i < elements.length; i++){\n\t\tvar element = elements[i];\t\n\t\telement.classList.remove('fade-out-element');\n\t\telement.classList.add('fade-in-element');\n\t}\n\tchatTarget = \"webcam\";\n\tspam();\n}", "title": "" }, { "docid": "594165c2fee45213df5b679386f07711", "score": "0.51903725", "text": "destroyCrackedLetter(){\n if(this.container.getIndex(this.container.last) !== 0){\n //Añadir animacion de destruir letra agrietada aqui\n this.container.remove(this.container.last, true);\n }\n }", "title": "" }, { "docid": "ddf0b46d2e61a6475677c8facc0cfbf9", "score": "0.5178563", "text": "function screenEmpireBarrage(){\r\n let fatherNode = document.querySelector(\".danmu-6e95c1\");\r\n for(let i = fatherNode.children.length-1;i>=0;i--){\r\n if(fatherNode.children[i].className.indexOf(\"noble-bf13ad\")==-1 && fatherNode.children[i].innerHTML.indexOf(\"border: 2px solid rgb(2, 255, 255)\")!=-1){//find self and remove redupliction\r\n //transform parent node\r\n let liStyle = fatherNode.children[i].getAttribute(\"style\");\r\n let characterLength = liStyle.substring(liStyle.indexOf(\"translateX(-\")+12,liStyle.indexOf(\"px); transition\"));\r\n let transformLength = liStyle.substring(liStyle.indexOf(\"transform \")+10,liStyle.indexOf(\"s linear\"));\r\n let screenOpacity = liStyle.substring(liStyle.indexOf(\"opacity:\")+8,liStyle.indexOf(\"; z-index:\"));\r\n let characterStyle = \"opacity: \"+ screenOpacity +\"; z-index: 30; background: rgba(0, 0, 0, 0); top: 4px; transform: translateX(-\"+ characterLength +\"px); transition: transform \"+ transformLength +\"s linear 0s;\"\r\n fatherNode.children[i].className = \"danmuItem-31f924 noble-bf13ad\";\r\n fatherNode.children[i].setAttribute(\"style\",characterStyle);\r\n //noble icon without redupliction remove\r\n let nobleImgTag = document.createElement(\"img\");\r\n nobleImgTag.className = \"super-noble-icon-9aacaf\";\r\n nobleImgTag.setAttribute(\"src\",\"https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h1_dcd226.png\");\r\n nobleImgTag.setAttribute(\"style\",\"margin-left: -57px; margin-top: -4px;\");\r\n fatherNode.children[i].insertBefore(nobleImgTag,fatherNode.children[i].firstElementChild);\r\n //user avatar img\r\n let userIconTag = document.createElement(\"img\");\r\n userIconTag.className = \"super-user-icon-574f31\";\r\n let userIconObj = document.getElementsByClassName(\"Avatar is-circle\")[0];\r\n if(userIconObj !=undefined){\r\n userIconObj = userIconObj.getElementsByTagName(\"img\")[0].getAttribute(\"src\");\r\n userIconTag.setAttribute(\"src\", userIconObj.replace((new RegExp(\"_middle\")),\"_small\"));\r\n }else{\r\n console.error(\"未能获取到用户头像\");\r\n }\r\n fatherNode.children[i].insertBefore(userIconTag,fatherNode.children[i].firstElementChild);\r\n //remove out tail tag\r\n let tailTag = fatherNode.children[i].getElementsByClassName(\"afterpic-8a2e13\")[0];\r\n tailTag.remove();\r\n //transform barrage effect\r\n let textContent = fatherNode.children[i].getElementsByClassName(\"text-879f3e\")[0];\r\n textContent.className = \"super-text-0281ca\";\r\n textContent.setAttribute(\"style\",\"font: bold 23px SimHei, 'Microsoft JhengHei', Arial, Helvetica, sans-serif; color: rgb(255, 255, 255); background: url('https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h2_8e5e64.png'); height: 44px;\");\r\n //add tag tail includes fire icon or sign icon\r\n let afterpicTag = document.createElement(\"div\");\r\n afterpicTag.setAttribute(\"class\",\"afterpic-8a2e13\");\r\n afterpicTag.setAttribute(\"style\",\"margin-top: 7px; margin-left: -1px;\");// afterpicTag.setAttribute(\"style\",\"margin-top: 7px; margin-left: -43px;\");\r\n if(document.querySelector(\".FirePowerChatModal-Notice\")==null){//add sign icon\r\n let signImg = document.createElement(\"img\");\r\n signImg.setAttribute(\"class\",\"afterpic-8a2e13\");\r\n let signImgUrl = [\"https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/lucky_c5d02e.png\",\"https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/first_e511ac.png\"];\r\n signImg.setAttribute(\"src\",signImgUrl[parseInt(Math.random()*2)]);\r\n signImg.setAttribute(\"style\",\"width: 28.8px; height: 28.8px;\");\r\n afterpicTag.appendChild(signImg);\r\n }else{//add fire icon\r\n let fireImg = document.createElement(\"img\");\r\n fireImg.setAttribute(\"class\",\"afterpic-8a2e13\");\r\n fireImg.setAttribute(\"src\",\"https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/hlqk_61648e.svg\");//fire\r\n fireImg.setAttribute(\"style\",\"width: 28.8px; height: 28.8px;\");//margin-left: -42px;\r\n afterpicTag.appendChild(fireImg);\r\n }\r\n textContent.appendChild(afterpicTag);\r\n //tail icon\r\n let superTailImg = document.createElement(\"img\");\r\n superTailImg.className = \"super-tail-bffa58\";\r\n superTailImg.setAttribute(\"src\",\"https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h3_fd2e5b.png\");\r\n fatherNode.children[i].appendChild(superTailImg);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "8cb00fda38ad0c4b20ee82dfe9c16bd4", "score": "0.5168407", "text": "wipe() {\n // Remove everything except the overlay\n this.g.selectAll(':not(.overlay)').remove();\n this.container.selectAll('.sparkText').remove();\n }", "title": "" }, { "docid": "40dca63b858098b8a9c74fe564c8ef24", "score": "0.51581913", "text": "function FlyoverCursorsOff(){\n\t\tfriendCursor.renderer.enabled = false;\n\t\tenemyCursor.renderer.enabled = false;\n}", "title": "" }, { "docid": "c8789bd13a868c646d93ef122370d2a2", "score": "0.51389223", "text": "function removeLifeFromBoard() {\n // Find the container holding all the heart icons\n const container = document.getElementById('lives-icon-container');\n if (container.hasChildNodes()) {\n container.removeChild(container.lastChild);\n }\n}", "title": "" }, { "docid": "b7d9588f55bcb9edcaced17a998f57e0", "score": "0.5135471", "text": "_removeA11yAttributes() {\n this.getWrapper().removeAttribute('aria-live');\n this.getCarouselElement().removeAttribute('role');\n this.getSlides().forEach((slide) => {\n slide.removeAttribute('role');\n });\n }", "title": "" }, { "docid": "14a3a9b346a5f0d6e9501f98a9b6b705", "score": "0.5126816", "text": "function clearTrackedMessages() {\n trackedMessages.forEach(el => {\n el[0].classList.remove('tch-highlighted-message');\n if (trackBar)\n trackBar.removeChild(el[2]);\n });\n trackedMessages = [];\n trackedIndex = 0;\n}", "title": "" }, { "docid": "5ba52c6b7869a9ed3987546a2c39a89e", "score": "0.5122887", "text": "destroy() {\n \n this.removeAllChild(this._title, this.message, this.controller);\n this.modal.removeClasses('fadeOut');\n this.mainBox.removeClasses(`${this.userSetting.animation.dismiss} ${this.userSetting.animation.escape} ${this.userSetting.type}`);\n \n }", "title": "" }, { "docid": "eda6229ce5527cb85181e2400a79086c", "score": "0.5116294", "text": "function offshowall() {\n document.getElementById(\"timecontainer\").setAttribute(\"style\", \"background-color: rgb(255,255,255);\");\n document.getElementById(\"timebar\").setAttribute(\"style\", \"width:100%; background-color: rgb(255,255,255);\");\n }", "title": "" }, { "docid": "fc74ca141b88b839e5125fd5d4ee928c", "score": "0.51037186", "text": "function resetAttributes() {\n foreground = 7;\n background = 0;\n foreground24bit = undefined;\n background24bit = undefined;\n bold = false;\n blink = false;\n inverse = false;\n }", "title": "" }, { "docid": "2592d4598fd21fdfc7141d2a34f7239a", "score": "0.51004577", "text": "function resetAttributes() {\n foreground = 7;\n background = 0;\n foreground24bit = undefined;\n background24bit = undefined;\n bold = false;\n blink = false;\n inverse = false;\n }", "title": "" }, { "docid": "b6f194d50ef628849427f9842a0ff50c", "score": "0.5096532", "text": "clear() {\n this._actor = ActorProvider.ANONYMOUS;\n }", "title": "" }, { "docid": "c71f1ff3644f3b2efbdd423da22eedec", "score": "0.5059185", "text": "function removeChatTyping(data) {\n\t var typings = getTypingMessages(data);\n\t typings.forEach(function (el) {\n\t el.className = 'animated fadeOut';\n\n\t setTimeout(function () {\n\t el.parentNode.removeChild(el);\n\t }, 1000);\n\t });\n\t}", "title": "" }, { "docid": "7874aa46d7b51aa7387c14c88ad2b774", "score": "0.5054881", "text": "clearRoomButtons(){\n\n for(let i = 0; i < this.matchButtons.length; i++){\n this.matchButtons[i].cleanUp();\n }\n \n if(this.create_new_match_button != null){\n this.create_new_match_button.cleanUp()\n }\n\n renderer.removeSprite(this.smallPresidentsTitle)\n \n // empty it!\n this.matchButtons = []\n }", "title": "" }, { "docid": "9b971c9c3001748f5a8b010db2b3df79", "score": "0.50423235", "text": "static removeAllScreenNamesToIgnore(){\n UXCamBridge.removeAllScreenNamesToIgnore();\n }", "title": "" }, { "docid": "60285603833430c81090f032b83066c8", "score": "0.5013276", "text": "clear() {\n if (this.timeListener_ != null) {\n unByKey(this.timeListener_);\n }\n if (this.playingListener_ != null) {\n unByKey(this.playingListener_);\n }\n if (this.timeZoneListener != null) {\n unByKey(this.timeZoneListener);\n }\n if (this.timeZoneLabelListener != null) {\n unByKey(this.timeZoneLabelListener);\n }\n this.mouseListeners_.forEach((mouseListener) => {\n mouseListener.destroy();\n });\n this.resizeDetector.removeAllListeners(this.container_);\n if (this.container_ != null && this.container_.lastChild != null) {\n this.container_.removeChild(this.container_.lastChild);\n }\n this.frames_ = [];\n }", "title": "" }, { "docid": "b2afdc79b72feb77f154109935564d11", "score": "0.5001615", "text": "function removeZzz (){\n dia.style.color = 'black';\n dia.innerText = '';\n dia.classList.remove('animate__animated','animate__headShake');\n}", "title": "" }, { "docid": "cfd1d11f2c423396c7c918baa1b5c494", "score": "0.49949348", "text": "clear_gutter() {\n\t\t\tfor(let [i_line, s_class] of hm_gutter_decorations) {\n\t\t\t\ty_editor.session.removeGutterDecoration(i_line, s_class);\n\t\t\t\thm_gutter_decorations.delete(i_line);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f4aa9b68ce0746903284ac003d486191", "score": "0.4994084", "text": "function removeDocumentPadding() {\n $documentPadding.remove();\n }", "title": "" }, { "docid": "bcb33ac86c24a56177044d7b99a8948e", "score": "0.49937132", "text": "remove() {\n window.clearInterval(this.counterInterval);\n let activationDistance =\n this.el.offsetWidth * this.options.activationPercent;\n\n if(this.wasSwiped) {\n this.el.style.transition = 'transform .05s, opacity .05s';\n this.el.style.transform = `translateX(${activationDistance}px)`;\n this.el.style.opacity = 0;\n }\n\n Vel(\n this.el,\n {opacity: 0, marginTop: '-40px'},\n {\n duration: this.options.outDuration,\n easing: 'easeOutExpo',\n queue: false,\n complete: () => {\n // Call the optional callback\n if(typeof(this.options.completeCallback) === 'function') {\n this.options.completeCallback();\n }\n // Remove toast from DOM\n this.el.parentNode.removeChild(this.el);\n Toast._toasts.splice(Toast._toasts.indexOf(this), 1);\n if (Toast._toasts.length === 0) {\n Toast._removeContainer();\n }\n }\n }\n );\n }", "title": "" }, { "docid": "2fa29ecb86287213dc731e905f7a7785", "score": "0.49721512", "text": "function clearMessageBoard() {\n const messages = document.getElementsByClassName('indicator');\n\n for (let index = 0; index < messages.length; index += 1) {\n messages[index].style.display = 'none';\n }\n}", "title": "" }, { "docid": "a8bf66d1ace6e6eae9a7327218c35b00", "score": "0.496953", "text": "function removeActiveClassLoop() {\n\t\t\t\tvar dTime = Date.now() - anchorHighlight._startRemoveTime;\n\n\t\t\t\tif (dTime > anchorHighlight.options.keepActiveClassDelay) {\n\t\t\t\t\t// after touchend\n\t\t\t\t\tclearActiveClass();\n\t\t\t\t} else {\n\t\t\t\t\tanchorHighlight._requestAnimationFrame(removeActiveClassLoop);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "6398df25833f9bec85d951aa44e7c81d", "score": "0.49659514", "text": "resetCounterManagement(actorId) {\n let currentActor = game.actors.get(actorId);\n currentActor?.update({\n \"data.counterClasses.values\": []\n });\n }", "title": "" }, { "docid": "670d5023300ebb2a49fcf74993754195", "score": "0.49572045", "text": "function removeNoiseBg() {\n if (this.state.style === 'auto') return\n\n let el = document.getElementById('root')\n el.style.removeProperty('--bg-img')\n el.style.removeProperty('--bg-size')\n}", "title": "" }, { "docid": "b5434c476d065894adc2411af30da987", "score": "0.4954001", "text": "function hideCheatSheet(el) {\n el.className = el.className.replace(/\\s*active/, '');\n }", "title": "" }, { "docid": "b6869a5bf685d2e2262f8e7465bd3afa", "score": "0.49538544", "text": "function removeAlexaTypingIndicator() {\n const messageId = MSG_NUM.concat(numMessages, TYPING);\n const lastAlexaBubble = document.getElementById(messageId);\n\n if (lastAlexaBubble) {\n const lastAlexaMessageParent = lastAlexaBubble.parentElement.parentElement;\n while (lastAlexaMessageParent.firstChild) {\n lastAlexaMessageParent.removeChild(lastAlexaMessageParent.lastChild);\n }\n lastAlexaMessageParent.remove();\n }\n saveElementState(MESSAGE_CONTAINER);\n}", "title": "" }, { "docid": "3d6c8ca18d50fe2ac2896eebac205a54", "score": "0.49531886", "text": "function end() {\n\n bg.visible = false;\n monkey.visible = false;\n\n bananaGroup.destroyEach();\n stoneGroup.destroyEach();\n\n}", "title": "" }, { "docid": "cc59e09804208709a702ae16f4c44237", "score": "0.4943807", "text": "function removeBorder(event){\r\n\tthis.style['border'] = \"\";\r\n\tthis.style['padding'] = \"\";\r\n}", "title": "" }, { "docid": "19f7238f5d798e594536c826e5f9291f", "score": "0.4938122", "text": "function removeBorders() {\n document.body.removeAttribute('showlongdescborders', '');\n}", "title": "" }, { "docid": "bd4a71e3a5d026279c61bd6d30615517", "score": "0.4933309", "text": "function endgameFlyOut() {\n endgameText.style.left = 16 * h + 'px';\n setTimeout(() => endgameText.remove(), 2000);\n }", "title": "" }, { "docid": "fc2149bb8af35d2bdb92fde7e83cc4b0", "score": "0.49318105", "text": "function royalChatEffect() {\r\n let barrageArr = document.getElementsByClassName('Barrage-listItem');\r\n if (barrageArr.length > 1) {\r\n for (let i = barrageArr.length - 1; i >-1; i--) {\r\n if (barrageArr[i].lastElementChild != null && barrageArr[i].lastElementChild.innerHTML.indexOf(\"Barrage-nobleImg\") == -1 && barrageArr[i].lastElementChild.innerHTML.indexOf(\"is-self\") != -1) {//not null,remove reduplicttion,find self\r\n // revise father element class\r\n barrageArr[i].className = \"Barrage-listItem js-noblefloating-barrage\";\r\n let chatArea = barrageArr[i].lastElementChild;\r\n chatArea.className = \"js-noblefloating-barragecont Barrage-notice--noble\";\r\n chatArea.setAttribute('style','background-color: #fff3df');\r\n // revise nickname class\r\n let nickNameObj = chatArea.getElementsByClassName(\"Barrage-nickName\")[0];\r\n nickNameObj.setAttribute('class','Barrage-nickName is-self js-nick');//here need reserved is-self\r\n //add motorcade flag, already remove reduplication\r\n let motorFlagObj = chatArea.querySelector(\".Motor\");\r\n if(motorFlagObj==null){\r\n let iconTag = document.createElement(\"span\");\r\n iconTag.className = \"Motor\"\r\n iconTag.setAttribute(\"title\",\"中\");\r\n iconTag.setAttribute(\"data-motorcade\",\"中\");\r\n iconTag.setAttribute(\"style\",\"background-image:url(https://img.douyucdn.cn/data/yuba/admin/2019/01/07/201901071437499042327937962.png)\");\r\n let iconSpan = document.createElement(\"span\");\r\n iconSpan.className = \"Motor-flag\";\r\n iconSpan.innerText = \"中\"\r\n iconTag.appendChild(iconSpan);\r\n chatArea.insertBefore(iconTag,nickNameObj);\r\n }\r\n //tranform user level\r\n let userLevelObj = chatArea.querySelector(\".UserLevel\");\r\n if( userLevelObj!=null){\r\n userLevelObj.className = \"UserLevel UserLevel--120\";\r\n userLevelObj.setAttribute(\"title\", \"用户等级:120\");\r\n }\r\n // revise or create Room element unless no room level\r\n let roomLevelObj = chatArea.querySelector(\".RoomLevel\");\r\n if( roomLevelObj!=null){\r\n roomLevelObj.className = \"RoomLevel RoomLevel--18\";\r\n roomLevelObj.setAttribute(\"title\",\"房间等级:18\");\r\n }else{\r\n let roomTag = document.createElement(\"span\");\r\n roomTag.className =\"RoomLevel RoomLevel--18\";\r\n roomTag.setAttribute(\"title\",\"房间等级:18\");\r\n chatArea.insertBefore(roomTag,motorFlagObj);\r\n }\r\n // barrage color\r\n let barrageColorObj = chatArea.querySelector(\".Barrage-content\");\r\n if(barrageColorObj !=null){\r\n barrageColorObj.className = \"Barrage-content Barrage-content--color0\";//red color\r\n }\r\n // add king-hao dynamic logo\r\n let kingIconUrl = [\"https://sta-op.douyucdn.cn/douyu/412bc7d49e40c245a0b140b8d2ae5f2db420e36c.gif\",\"https://sta-op.douyucdn.cn/douyu/3d416f83fb2de6e4e8de5ce4e24b424e4eccc705.gif\",\r\n \"https://sta-op.douyucdn.cn/douyu/7ac49673ae22983ca626a55a607e39ef0d3df5f0.gif\",\"https://sta-op.douyucdn.cn/douyu/6467a61a8e57944b09ddb68a7673c9f6164335e9.gif\",\r\n \"https://cs-op.douyucdn.cn/dy-activity/2017/12/20/a7e16d5efd74e3b6bc82ff690c387c95.gif\",\"https://sta-op.douyucdn.cn/dy-activity/2018/08/02/cf7ae36b23d47cc0bd0762d1776b7a6f.gif\",\r\n \"https://cs-op.douyucdn.cn/dy-activity/2018/06/27/4855683291eb04fae38a73003946fd1b.gif\",\"https://cs-op.douyucdn.cn/dy-activity/2018/06/27/ba0d92fc83b0f34c378ef81e21325fe0.gif\",\r\n \"https://sta-op.douyucdn.cn/dy-activity/2018/09/11/939a31aa442d07da9133987d18191d75.gif\",\"https://sta-op.douyucdn.cn/dy-activity/2019/01/30/3443c9004fa48fee0bb00f906a168246.gif\",\r\n \"https://sta-op.douyucdn.cn/douyu/0b9f31cf073fa88c1daade3a08252f90bdd18a0a.gif\"]//honor hao, king hao||bumie god,tianwei God||hao first,shark queen||shark general,shark command||annually hao old, loving day ||annually hao\r\n let tailTagObj = chatArea.querySelector(\".Baby\");\r\n if(tailTagObj != null){\r\n let kingIconImg = document.createElement(\"img\");\r\n kingIconImg.setAttribute(\"class\",\"Baby-image is-achievement\");\r\n kingIconImg.setAttribute(\"src\",kingIconUrl[parseInt(Math.random()*kingIconUrl.length)]);\r\n // kingIconImg.setAttribute(\"data-achievementid\",\"213\");\r\n tailTagObj.insertBefore(kingIconImg,tailTagObj.firstElementChild);\r\n }else{\r\n let signTag = document.createElement(\"a\");\r\n signTag.setAttribute(\"class\",\"Baby\");\r\n let kingIconImg = document.createElement(\"img\");\r\n kingIconImg.setAttribute(\"class\",\"Baby-image is-achievement\");\r\n kingIconImg.setAttribute(\"src\",kingIconUrl[parseInt(Math.random()*kingIconUrl.length)]);\r\n // kingIconImg.setAttribute(\"data-achievementid\",\"188\");\r\n signTag.appendChild(kingIconImg);\r\n let fireIconObj = chatArea.getElementsByClassName(\"FirePowerIcon\")[0];\r\n fireIconObj!=undefined? chatArea.insertBefore(signTag,fireIconObj): chatArea.appendChild(signTag);\r\n }\r\n // add fans medal without redupliction remove\r\n let fansMedalName = document.getElementsByClassName(\"FansMedal-name\")[0];//fans medal\r\n let fansBackgroundImg = document.getElementsByClassName(\"FansRankList-item FansRankList-item--top\")[0];\r\n if(fansMedalName!=undefined && roomId!=undefined && fansBackgroundImg!= undefined ){\r\n if(fansBackgroundImg.innerHTML.indexOf(\"background-image:\")==-1){//common fans medal\r\n let fansTag = document.createElement(\"div\");\r\n let fansSpan = document.createElement(\"span\");\r\n fansTag.className=\"FansMedal level-30 js-fans-dysclick Barrage-icon\";\r\n fansTag.setAttribute(\"data-rid\",roomId);//id is same to roomId\r\n fansSpan.className = \"FansMedal-name js-fans-dysclick\";\r\n fansSpan.setAttribute(\"data-rid\",roomId);\r\n fansSpan.innerHTML = fansMedalName.innerText;\r\n fansTag.appendChild(fansSpan);\r\n chatArea.insertBefore(fansTag,chatArea.firstElementChild);\r\n }else{//special fans medal\r\n let fansTag1 = document.createElement(\"div\");\r\n fansTag1.className=\"FansMedal is-made js-fans-dysclick Barrage-icon\";\r\n fansTag1.setAttribute(\"style\", fansBackgroundImg.getElementsByClassName(\"FansMedal is-made\")[0].getAttribute(\"style\") );\r\n fansTag1.setAttribute(\"data-rid\",roomId);\r\n let fansSpan1 = document.createElement(\"span\");\r\n fansSpan1.className = \"FansMedal-name js-fans-dysclick\";\r\n fansSpan1.setAttribute(\"data-rid\",roomId);\r\n fansSpan1.innerHTML = fansMedalName.innerText;\r\n fansTag1.appendChild(fansSpan1);\r\n chatArea.insertBefore(fansTag1,chatArea.firstElementChild);\r\n }\r\n }else{//point to a fans medal when room have none of fans medal\r\n let fansTag2 = document.createElement(\"div\");\r\n fansTag2.className=\"FansMedal is-made js-fans-dysclick Barrage-icon\";\r\n fansTag2.setAttribute(\"style\",\"background-image: url('https://gfs-op.douyucdn.cn/fans_medal_resource/2019/07/12/5a5efaca4d1250413ed9c3c36438f6cb.gif')\");\r\n fansTag2.setAttribute(\"data-rid\",\"4615502\");\r\n let fansSpan2 = document.createElement(\"span\");\r\n fansSpan2.className = \"FansMedal-name js-fans-dysclick\";\r\n fansSpan2.setAttribute(\"data-rid\",\"4615502\");\r\n fansSpan2.innerHTML = \"猪叫团\";\r\n fansTag2.appendChild(fansSpan2);\r\n chatArea.insertBefore(fansTag2,chatArea.firstElementChild);\r\n }\r\n //add noble logo,if you have this identity,this will be not display\r\n let nobleIconObj = barrageArr[i].getElementsByClassName(\"Barrage-icon Barrage-noble\")[0];\r\n if(nobleIconObj == undefined){//noble logo\r\n let royalTag = document.createElement(\"span\");\r\n let royalImg = document.createElement(\"img\");\r\n royalTag.className = \"Barrage-icon Barrage-noble\";\r\n royalImg.className = \"Barrage-nobleImg\";\r\n royalImg.setAttribute(\"src\", \"//res.douyucdn.cn/resource/2019/08/15/common/4e85776071ffbae2867bb9d116e9a43c.gif\");\r\n royalImg.setAttribute(\"title\", \"幻神\");\r\n royalTag.appendChild(royalImg);\r\n chatArea.insertBefore(royalTag, chatArea.firstElementChild);\r\n }\r\n // add admin logo,if you have this identity,this will be not display\r\n let adminIconObj = barrageArr[i].getElementsByClassName(\"Barrage-icon Barrage-icon--roomAdmin\")[0];\r\n if(adminIconObj == undefined){\r\n let adminTag = document.createElement(\"span\");\r\n adminTag.setAttribute(\"class\",\"Barrage-icon Barrage-icon--roomAdmin\");\r\n chatArea.insertBefore(adminTag, chatArea.firstElementChild);\r\n }\r\n break;//avoid cpu resource wasted\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5f8e82cd49a594148cc36ac9c00ebb32", "score": "0.49283847", "text": "hideActivities() {\n\t this.activityLocked.alpha = 0.0;\n\t this.top_mid_panel.alpha = 0.0;\n\t /*this.r1_map.alpha = 0;\n\t this.r1_notebook.alpha = 0;\n\t this.help_menu.alpha = 0.0;\n\t this.helpOpen = false;*/\n }", "title": "" }, { "docid": "0d8bbcfbe49ddc7d380f6dc2fee3bab7", "score": "0.49207678", "text": "function removeCss(index, elem_class) {\n $this.find(elem_class)\n .each(function() {\n var $$this = $(this)\n\n $$this.removeClass(data.activeClass)\n $$this.removeClass(data.consumedClass)\n\n $$this.off(data.mouseenterEventType)\n $$this.off(data.mouseleaveEventType)\n $$this.off(data.clickEventType)\n }\n )\n }", "title": "" }, { "docid": "84606d3d38c567105606cf9945fdc432", "score": "0.4918776", "text": "function rm_class_space(ele) {\n window.addEventListener(\"load\", () => {\n var white_spaces = document.getElementsByClassName(ele);\n for (var i = 0; i < white_spaces.length; i++) {\n white_spaces[i].style.display = 'none';\n white_spaces[i].removeAttribute(\"style\");\n console.log(\"Ad blocked by AdverFox\");\n }\n });\n}", "title": "" }, { "docid": "03036accd9e14b63cf19357409e29086", "score": "0.49115077", "text": "function cleanUp(){\n let cleanObj = new TimelineMax();\n\n cleanObj\n .set(f1copy, {autoAlpha: 0})\n .set(f2copy, {autoAlpha: 0})\n .set(blueShape, {autoAlpha: 0})\n .set(redShape, {autoAlpha: 0})\n .set(whiteShape, {autoAlpha: 0})\n .set(qantasColor, {autoAlpha: 0})\n .set(qantasMono, {autoAlpha: 0})\n .set(aalogo, {autoAlpha: 0})\n .set(terms, {autoAlpha: 0})\n .set(f3copy, {autoAlpha: 0})\n .set(divider, {autoAlpha: 0})\n .set(btn, {autoAlpha: 0})\n .set(shadow, {autoAlpha: 0})\n .set(maskShape, {autoAlpha: 0, x: '-=15', y:'-=20'})\n .set(vid, {autoAlpha: 0})\n\n\n ;\n return cleanObj;\n\n }", "title": "" }, { "docid": "e4e92977079ef73c7ea9f8d44089229c", "score": "0.49071753", "text": "function removeAllRenderables() {\n\n // Remove all xrelement out of Entity\n // letsee.getBoundsXRElement(letsee.getEntityByUri('sticker.json')).((item) => letsee.removeXRElement(item));\n letsee.removeAllXRElements(letsee.getEntityByUri('https://developer.letsee.io/api-tm/target-manager/target-uid/6051a9a3040a2b444321a598'));\n}", "title": "" }, { "docid": "7323d0967ed7b96ec192ef47860d7c3d", "score": "0.49057773", "text": "function removenewEffect() {\n let effectMe = document.getElementById('rightPane');\n effectMe.classList.remove(\"text-blur-out\");\n\n}", "title": "" }, { "docid": "a77f128731c8e2acf1c6633620eab9f3", "score": "0.49004808", "text": "function clearTimers() {\n clearTimeout(timeout);\n clearInterval(interval);\n document.getElementById(\"decrease-headcount\").style.backgroundColor = \"rgb(238, 238, 238)\";\n }", "title": "" }, { "docid": "8d8335824fc04834359c1bacb1918d3e", "score": "0.4889537", "text": "fadeOutAllNonPersistent() {\n this._rippleRenderer.fadeOutAllNonPersistent();\n }", "title": "" }, { "docid": "224ef71526492588e3e082be264f3cd1", "score": "0.48831385", "text": "function hideAllGifScreens() {\n windowBoxes = boxContainer.querySelectorAll(\".window-box\");\n windowBoxes.forEach((node, index) => {\n node.classList.add(\"nodisplay\")\n });\n}", "title": "" }, { "docid": "a5752022b96717600e7cf4fa8a210087", "score": "0.4881981", "text": "function hideHud() {\n\t\tclearInterval(hudTimer);\n\t\tcerabox.getElements('.cerabox-title, .cerabox-close, .cerabox-left, .cerabox-right').set('tween', {duration: 500}).tween('opacity', 0);\n\t}", "title": "" }, { "docid": "b05f9ed460c8ae878daaa0b2d12f3504", "score": "0.48801857", "text": "function erase() { \t\t\t\t \n\t\t$(com_ub_utilities_loggerjs_ns_instance+'_view').innerHTML = '';\n\t\tnumberOfLogs = 0;\n\t\t$(com_ub_utilities_loggerjs_ns_instance+'_frame').innerHTML='LogViewer:'+numberOfLogs;\n\t}", "title": "" }, { "docid": "f011611a244b1611bed1b6b2922ff416", "score": "0.48789912", "text": "function RemoveListeners()\n {\n document.getElementById(\"allowance-screen\").classList.add(\"invisible\")\n window.removeEventListener('camera-init', CameraSuccess)\n window.removeEventListener('camera-error', CameraFailed)\n }", "title": "" }, { "docid": "ee72105ae3c10baef361dc88c5b55ab6", "score": "0.487694", "text": "_removeWidgets() {\n for (let i = 0, len = this.widgets.length; i < len; ++i) {\n this.widgets[i].destroy();\n }\n this.widgets.splice(0, this.widgets.length);\n }", "title": "" }, { "docid": "fece75df10e419585d3fed31296f4a82", "score": "0.48741812", "text": "clearChat () {\n this.chat = {};\n this.hideAllButtons();\n this.restorePreviousBotState();\n }", "title": "" }, { "docid": "040667fa0c7232a31a372ed5fd14ecac", "score": "0.48735458", "text": "function kill() {\n oConfig.pauseMode = false;\n killTextarea();\n aRenderBuffer = [];\n var aLogNodes = document.querySelectorAll('.ticker_log');\n pseudoForEach(aLogNodes, function(i, oLogNode) {\n oLogNode.parentNode.removeChild(oLogNode);\n });\n }", "title": "" }, { "docid": "f728b2bb7b3dec59e45298fbcc22117d", "score": "0.48680672", "text": "function removeStreamItems(elementNum){\n document.getElementById('img' + elementNum).style = 'display:none';\n document.getElementById('link' + elementNum).style = 'display:none';\n document.getElementById('id' + elementNum).style = 'display:none';\n document.getElementById('gameName' + elementNum).style = 'display:none';\n document.getElementById('viewers' + elementNum).style = 'display:none';\n document.getElementById('description' + elementNum).style = 'display:none';\n}", "title": "" }, { "docid": "f4e757d1510d88363e84399c085a6281", "score": "0.48671165", "text": "function removeEnemyPresident() {\n enemyPresidents.forEach(item => {\n cells[item.currentEnemyPosition].classList.remove(item.namePresident)\n })\n }", "title": "" }, { "docid": "a9396e4aee0d6e4c0d74f7d1f762c396", "score": "0.48643103", "text": "function clearTimers() {\n clearTimeout(timeout);\n clearInterval(interval);\n document.getElementById(\"increase-headcount\").style.backgroundColor = \"rgb(238, 238, 238)\";\n }", "title": "" }, { "docid": "df491a74adc738176f3a847ef07002f6", "score": "0.48609307", "text": "function clearOld() {\n\ttotalSnow = 0;\n\t$('#skinBackground').remove();\n\t$('#ChatSkins').remove();\n}", "title": "" }, { "docid": "e95955d223750174fd9efada322a9131", "score": "0.4859058", "text": "function removeYum (){\n dia.innerText = '';\n dia.style.display = null;\n dia.classList.remove('animate__animated','animate__headShake');\n}", "title": "" }, { "docid": "57b4b4fa41da596814b79ca8a081c543", "score": "0.48551053", "text": "function clearClasses(){\n unbindControls();\n $('.animation-container .fa').removeClass('fa-hand-scissors-o').removeClass('fa-hand-rock-o').removeClass('fa-hand-paper-o').removeClass('fa-github-alt').removeClass('fa-smile-o').removeClass('fa-thumbs-up').removeClass('fa-hand-peace-o').removeClass('fa-gamepad');\n }", "title": "" }, { "docid": "7ca183ec35cfbf840339cdb2c13dae94", "score": "0.48512247", "text": "renderForeground() {\n const canvas = this.foreground;\n const ctx = canvas.getContext('2d');\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }", "title": "" }, { "docid": "7da476dccfcf60ca9dc7a2d109487621", "score": "0.4845312", "text": "fadeOutAllNonPersistent() {\n this._activeRipples.forEach(ripple => {\n if (!ripple.config.persistent) {\n ripple.fadeOut();\n }\n });\n }", "title": "" }, { "docid": "3bd39c6affc71ce47a4fb26faab07ebe", "score": "0.48373348", "text": "function drawActors (actors) {\n return elt('div', {}, ...actors.map(actor => {\n const rect = elt('div', {\n class: `actor ${actor.type}`\n })\n rect.style.width = `${actor.size.x * scale}px`\n rect.style.height = `${actor.size.y * scale}px`\n rect.style.left = `${actor.pos.x * scale}px`\n rect.style.top = `${actor.pos.y * scale}px`\n\n if (actor.type === 'player' && actor.speed.x > 0) {\n rect.className = `actor ${actor.type} skewleft`\n }\n if (actor.type === 'player' && actor.speed.x < 0) {\n rect.className = `actor ${actor.type} skewright`\n }\n\n return rect\n }))\n}", "title": "" }, { "docid": "464606b1fb6285a503cddd93104be41d", "score": "0.4836848", "text": "function clearScreen () {\n while (node.hasChildNodes()) {\n node.removeChild(node.lastChild);\n }\n }", "title": "" }, { "docid": "a3330b6a2d0e0a339a2fa922044156de", "score": "0.48356646", "text": "function cambio(){\r\n $(\".utente\").css(\"background\",\"unset\")\r\n $(\".display-chat\").removeClass(\"active\");\r\n $(\".head-utente-left\").removeClass(\"active\")\r\n\r\n var valoreIndex = $(this).index();\r\n\r\n $(\".display-chat\").eq(valoreIndex).addClass(\"active\");\r\n $(\".head-utente-left\").eq(valoreIndex).addClass(\"active\");\r\n\r\n $(this).css({\"background\": \"rgba(0, 0, 0, 0.1)\"})\r\n\r\n }", "title": "" }, { "docid": "27442bcae3271a63faf7022393da183b", "score": "0.48303643", "text": "function removeAllGhostsFromMap () {\n chaserGhost.removeGhostFromCell()\n lostGhost.removeGhostFromCell()\n randomGhost.removeGhostFromCell()\n interceptorGhost.removeGhostFromCell()\n }", "title": "" }, { "docid": "a627b702da25570e6778d2b4276c11c9", "score": "0.4827786", "text": "function pre_exchange()\n{\n\tmessage_listen();\n\t$(\"main\").addClass(\"reset_padding\");\n}", "title": "" }, { "docid": "a75312931a5954aa970b0e80f937394c", "score": "0.48252255", "text": "function hideAll() {\n\t\tstream.html('');\n\t\troomList.html('');\n\t\troomName.html('');\n\n\t\troomUI.hide();\n\t\tlistUI.hide();\n\t\tadminUI.hide();\n\t}", "title": "" }, { "docid": "c2f2194c976b4a40bdce625f0581bbd4", "score": "0.48228744", "text": "function eraseStrokes() {\n inkManager.mode = Windows.UI.Input.Inking.InkManipulationMode.erasing;\n strokeColor = \"gold\";\n strokeWidth = 1;\n modeMessage.innerText = inkManager.mode;\n }", "title": "" }, { "docid": "a0a89a7181f72f1c883ea28b1d372bca", "score": "0.48214802", "text": "removeEvents() {}", "title": "" }, { "docid": "c8baedfff039e766325d3cd44adbfd58", "score": "0.48204568", "text": "function titleFlyOut() {\n let titles = document.querySelectorAll('.title');\n Array.from(titles).map((t, i) => { setTimeout(() => { t.style.left = 16 * h + 'px' }, (i * 200)) });\n setTimeout(() => { Array.from(titles).map(t => t.remove()) }, 2000);\n }", "title": "" }, { "docid": "3fb99232702da2106a956259ec4a6244", "score": "0.48161364", "text": "function removeAllTextOutput(){\t\n\tvar txtelems = document.getElementsByClassName(\"desc_line\");\n\tfor (var m=0; m<txtelems.length; m++){\n\t\tvar txtelem = txtelems[m];\n\t\tif (txtelem.getAttribute(\"id\") != \"desc_line_9\"){\n\t\t\ttxtelem.textContent = \"\";\n\t\t\ttxtelem.setAttribute(\"style\", \"stroke:none\");\n\t\t}\n\n\t}\t\t\n}", "title": "" }, { "docid": "16acac0a0bf470f050ec9cede2e02828", "score": "0.4815604", "text": "function resetWin() {\n let board = document.getElementById('board');\n board.classList.remove('blur');\n\n let winningBanner = document.getElementById('winningMat');\n winningMat.classList.remove('show');\n winningMat.classList.add('hide');\n\n\n }", "title": "" }, { "docid": "86af917c47d17b751caa4af8a36e9267", "score": "0.48155752", "text": "function removeYay (){\n dia.innerText = '';\n dia.classList.remove('animate__animated','animate__headShake');\n}", "title": "" }, { "docid": "3b02b1b74b5b942d00dbd9b805438b20", "score": "0.48150736", "text": "function normalizeTutorial()\n\t\t{\n\t\t\tparent.alpha = 1;\n\t\t\tleftLine.x = parent.getBounds().width/2;\n\t\t\trightLine.x = parent.getBounds().width/2;\n\t\t\tmsgTxt.alpha = 0;\n\t\t\tcreatejs.Ticker.removeEventListener('tick', onCloseTutorial);\n\t\t}", "title": "" }, { "docid": "8b063e36a327fef24a8459cfd798cf0a", "score": "0.48128116", "text": "function revert(){\n\t\tvar x = document.getElementsByClassName('manga-viewer');\n\t\tfor (var l=0; l < x.length; l++){\n\t\t\tdocument.getElementsByClassName('detail-container')[0]\n\t\t\t.removeChild(x[l]);\n\t\t}\n\t\tdocument.getElementsByClassName('related-container')[0]\n\t\t\t.setAttribute('style','display:all');\n\t}", "title": "" }, { "docid": "aa49de84e0e3087498deaa9310703454", "score": "0.48110178", "text": "chatBoardCleaner() {\n if (this.state.messages.length === 20) {\n const currentState = [].slice.call(this.state.messages);\n currentState.shift();\n this.setState({messages: currentState});\n }\n }", "title": "" }, { "docid": "f03d522e28b99bf048e8eded3323bc0f", "score": "0.48100883", "text": "function winFlash() {\n const finishLabelEl = document.querySelector(\".elex-votes-finish-label-overlay\");\n finishLabelEl.classList.remove(\"finish-label-flash\");\n void finishLabelEl.offsetWidth;\n finishLabelEl.classList.add(\"finish-label-flash\");\n}", "title": "" }, { "docid": "667ac1f8387d3a934e836009709d5137", "score": "0.48075873", "text": "function initialAnimations() {\n snakeEmblem.removeClass('to-animate');\n setTimeout(function() {\n snakeEmblem.removeClass('no-border-offset');\n scrollBtn.removeClass('to-animate');\n }, 1000);\n }", "title": "" }, { "docid": "088d396f319c22bf6e01b0670127e45a", "score": "0.4806368", "text": "shutdown() {\n //this.div.removeChild(this.div.getElementsByTagName(\"table\")[0]);\n this.div.style.display = \"none\";\n this.game.stage.backgroundColor = \"#000\";\n }", "title": "" }, { "docid": "7374321d5e57a861607f6bbbf4dcf327", "score": "0.48031867", "text": "kill() {\n\t\tthis.alive = false;\n\t\tthis.battleLog.addDelayed(this.toString() + \" died!\");\n\t\tthis.modifiers.forEach(modifier => {\n\t\t\tmodifier.remove();\n\t\t});\n\t}", "title": "" }, { "docid": "9c07480adea561dd9dc54b0acbe0550b", "score": "0.47953928", "text": "function removeDrawables(){\n\tif(guiControls.oTimer != null){\n\t\tclearTimeout(guiControls.oTimer);\n\t\tguiControls.oTimer = null;\n\t}\n\tstages.stageBG.removeChild(mission.oTarget.sprite);\n\tstages.stageBG.removeChild(mission.oTarget.bitmap);\n\tstages.stageCharacter.removeAllChildren();\n\tstages.stageUI.removeAllChildren();\n\tmission.oRange = null;\n}", "title": "" }, { "docid": "c05f5a0be7f716e22522e0b076fd68df", "score": "0.47952864", "text": "function removeAnimation(e)\n{\n e.target.classList.remove(\"draw-anim\");\n e.target.classList.remove(\"win-anim\");\n}", "title": "" }, { "docid": "7a8e824dcbc0f711de66394d3b087732", "score": "0.4790881", "text": "function CutHides() {\n var scissors = Orion.FindTypeEx('0x0F9F').shift();\n var hides = Orion.FindTypeEx('0x1079');\n UseItemOnTargets(scissors, hides);\n\n}", "title": "" }, { "docid": "99017349ba9d696c1a13dc01939daf32", "score": "0.4790618", "text": "function undraw() {\n current.forEach(index => {\n squares[currentPos + index].classList.remove('block');\n squares[currentPos + index].removeAttribute('style');\n })\n }", "title": "" }, { "docid": "5a76cf5a6563ca07605d75e32337a3fa", "score": "0.47893846", "text": "repaintListGC() {\n for (const id in G.windowResizePaintList) {\n const item = G.windowResizePaintList[id];\n // remove items that is not belongs to current scene\n if (item.sceneName != G.scene.name) {\n delete G.windowResizePaintList[id];\n continue;\n }\n }\n }", "title": "" }, { "docid": "3ad6045ccd99eebfb38e0c9704b6bc60", "score": "0.47889313", "text": "function removeWobble() {\n const wobble1 = document.querySelectorAll(\".wobble\");\n\n wobble1[0].classList.remove(\"wobble\");\n wobble1[0].classList.remove(\"animated\");\n\n}", "title": "" }, { "docid": "6355bf570de1d87ab89aaca4e449f957", "score": "0.4787714", "text": "function removeButts(){\n removeRaider.remove()\n removeBlue.remove()\n \n }", "title": "" }, { "docid": "bce64eb92a480315099a73ed72ea9e7b", "score": "0.47828448", "text": "removeActive (game) {\n\t\t\tgame.is_active = false;\n\t\t\tgame.betareas_container.children[0].graphics.clear().beginFill(this.color_settings.inactive).drawRect(0,0,game.betareas_container.children[0].getBounds().width, game.betareas_container.children[0].getBounds().height);\n\t\t\tgame.children[1].graphics.clear().beginLinearGradientFill([this.color_settings.multibetgradColor1,this.color_settings.multibetgradColor2],[0,1],0,0,0,100).drawRect(0,0,218,this.g_height);\n\t\t\tif(game.game.indexOf(\"icbo\") > -1) {\n\t\t\t\tgame.children[1].graphics.clear().beginLinearGradientFill([this.color_settings.multibetgradColor1,this.color_settings.multibetgradColor2],[0,1],0,0,0,100).drawRect(0,0,218,this.g_height + this.g_height);\n\t\t\t}\n\t\t\tgame.height = this.g_height\n\t\t\tthis.toggleResultVeiw(game, false)\n\t\t}", "title": "" }, { "docid": "dc79009d3c3416c4361ed99d377d34c4", "score": "0.47752818", "text": "function removeHighlights() {\n const cls = '_ideoHoveredSubpart';\n const hovereds = document.querySelectorAll(`.${cls}`);\n hovereds.forEach(el => el.classList.remove(cls));\n}", "title": "" }, { "docid": "3b7b7a19e77a3e7313223c3515339523", "score": "0.47742847", "text": "function clearStage(){\n\t\tvar clearTl = new TimelineMax();\n\n\t\tclearTl\n\t\t\t.set($truck, {x: -1000, y: 0, scale: 1, transformOrigin: 'center center'})\n .set($wordingheigt, {x: 0, y: 0, transformOrigin: 'center center'})\n .set($wordingheigtcolor, {x: 0.07, y: 0, transformOrigin: 'center center'})\n .set($refresh, {x: 0, y: 0, transformOrigin: 'center center'})\n .set($Socialize, {x: 0, y: 0, transformOrigin: 'center center'})\n .set($Be_Entertained, {x: 0, y: 0, transformOrigin: 'center center'})\n \n\n\t\treturn clearTl;\n\t}", "title": "" }, { "docid": "8c4bde6e8e80b99f2679fd595d8ee10e", "score": "0.47687823", "text": "function clearAll() {\n let inactiveButtons = document.getElementsByClassName('category-button');\n for (let k=0;k<inactiveButtons.length;k++) {\n inactiveButtons[k].style.backgroundColor = '#fff';\n }\n /* let cleanContainer = document.getElementsByClassName('info-container');\n for (let k=0;k<cleanContainer.length;k++) {\n cleanContainer[k].innerHTML = '';\n }*/\n}", "title": "" }, { "docid": "3b1064e2ee24019a1d48e0e490a4a202", "score": "0.47687376", "text": "kill(id) {\n\t\tthis.veggies[parseInt(id)].alive = false;\n\t\tthis.veggies[parseInt(id)].rep.classList.add('flipped');\n\t\tthis.veggies[parseInt(id)].rep.style.width = this.veggies[parseInt(id)].rep.clientWidth + 'px';\n\t\tthis.veggies[parseInt(id)].rep.style.height = this.veggies[parseInt(id)].rep.clientHeight * .8 + 'px';\n\t}", "title": "" }, { "docid": "6dd6d82f00772ea94b75e090ec6b5154", "score": "0.47659886", "text": "function showRoom(){\n overlay.classList.remove('d-none');\n roomContainer.classList.remove('room-hidden');\n}", "title": "" }, { "docid": "52969af3eb143c0df4a3855f4a4872c6", "score": "0.47634125", "text": "function cleanup () {\n $(\".key-topics-hidden\").css(\"display\",\"none\");\n $(\".key-topics-visible\").css(\"display\",\"block\");\n $(\".selected\").removeClass(\"selected\");\n }", "title": "" }, { "docid": "a75eb14a63d6f1e701438db82541d476", "score": "0.47623834", "text": "_addReset() {\n const tl = this.timeline;\n tl.call(() => {\n this.$['body-actual'].innerHTML = '';\n this.$.name.innerHTML = '';\n }, undefined, null, '+=0.03');\n tl.set(this.$svg.bgRect.node, { drawSVG: '0%', 'fill-opacity': 0 });\n tl.set([this.$.label, this.$.name], { scaleX: 0, color: 'transparent', clipPath: '' });\n tl.set(this.$['body-actual'], { opacity: 1 });\n }", "title": "" }, { "docid": "f2f822de3675aa65838d39f7e1ab279d", "score": "0.47588742", "text": "function resetAttributes() {\n gifFrame.removeAttribute('style');\n stickerCarousel.removeAttribute('style');\n embedUrlDisplay.style.display = 'none';\n stickerButton.removeAttribute('style');\n allButton.removeAttribute('style');\n gifButton.removeAttribute('style');\n}", "title": "" }, { "docid": "5c03e6a8de95630f67c94a71c9e895b2", "score": "0.47582278", "text": "function emptySpeaker() {\n $('#empty-speaker').show();\n $('body').not('#empty-speaker').css({\n backgroundColor: '#d9dedb',\n opacity: '0.8',\n });\n}", "title": "" }, { "docid": "7e255c1cc81228acfa9b976b4aca65f7", "score": "0.47571728", "text": "makeInactive() {\r\n this.setActive(false);\r\n this.setVisible(false);\r\n this.body.checkCollision.none = true;\r\n this.healthBar.clear();\r\n }", "title": "" }, { "docid": "a2d545d0a4c2305aa056a806a035e5de", "score": "0.47571495", "text": "function cleanup() {\n remove()\n relative.removeListener(\"visible\", onvisible)\n relative.removeListener(\"invisible\", onhide)\n entity.remove()\n }", "title": "" } ]
ee1041c608dbc27d2207be250a559622
ajaxPagination(url,limit); parameter : url = url action limit = limit page
[ { "docid": "c37b1dd515cc85b7605af94275d2a0e5", "score": "0.76478624", "text": "function ajaxPagination(url,limit){\r\r\n\r\r\n $('#boxLoading').ajaxStart(function() {\r\r\n $(this).show();\r\r\n });\r\r\n \r\r\n $('#boxLoading').ajaxStop(function() {\r\r\n $(this).hide();\r\r\n });\r\r\n\r\r\n $('.next').removeAttr('disabled');\r\r\n $('.last').removeAttr('disabled');\r\r\n $('#curpage_news').val(1);\r\r\n $('#curpage_event').val(1);\r\r\n $('#curpage_dest').val(1);\r\r\n $('#curpage_article').val(1);\r\r\n $('#curpage_gallery').val(1);\r\r\n \r\r\n\r\r\n funcyAction();\r\r\n\r\r\n hideNav();\r\r\n \r\r\n\r\r\n //default active tab\r\r\n $('.content').hide();\r\r\n $('#content_dest').show();\r\r\n\r\r\n\r\r\n if(($('#allpage_dest').val()) > 5){\r\r\n $('#first_dest').show();\r\r\n $('#last_dest').show();\r\r\n }else{\r\r\n $('#first_dest').hide();\r\r\n $('#last_dest').hide();\r\r\n }\r\r\n\r\r\n //if(($('#allpage_news').val()) > 5){\r\r\n // $('#first_news').show();\r\r\n // $('#last_news').show();\r\r\n //}else{\r\r\n // $('#firsts_news').hide();\r\r\n // $('#last_news').hide();\r\r\n //}\r\r\n \r\r\n $('.tabsearch').click(function(){\r\r\n var id = $(this).attr('id');\r\r\n\r\r\n var content_id = ($(this).attr('id')).substr(4);\r\r\n $('.content').hide();\r\r\n $('.navigation').hide();\r\r\n $('.linkpages').hide();\r\r\n\r\r\n\r\r\n $('#content_'+id).show();\r\r\n \r\r\n \r\r\n $('#tabs li a').removeClass('active');\r\r\n $(this).addClass('active');\r\r\n \r\r\n var allpage = $('#allpage_'+id).val();\r\r\n\r\r\n\r\r\n if(allpage > 1)\r\r\n {\r\r\n $('#nav_'+id).show();\r\r\n $('#linkpage_'+id).show();\r\r\n } \r\r\n if(allpage > 5){\r\r\n $('#first_'+id).show();\r\r\n $('#last_'+id).show();\r\r\n }else{\r\r\n $('#firsts_'+id).hide();\r\r\n $('#last_'+id).hide();\r\r\n }\r\r\n\r\r\n \r\r\n });\r\r\n\r\r\n \r\r\n $('.next').click(function(){\r\r\n \r\r\n var methodAction = ($(this).attr('id')).substr(5);\r\r\n var id = methodAction;\r\r\n \r\r\n $.post(url+methodAction+'paging',\r\r\n {\r\r\n \r\r\n paramOffset: $('#offset_'+id).val(),\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : $('#curpage_'+id).val(),\r\r\n paramLimit : limit,\r\r\n actionQuery: \"next\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n //alert(data.result);\r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //alert(cur_page);\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n\r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#prev_'+id).removeAttr('disabled','disabled');\r\r\n $('#prev_'+id).removeClass('passive');\r\r\n \r\r\n $('#firsts_'+id).removeAttr('disabled','disabled');\r\r\n $('#firsts_'+id).removeClass('passive');\r\r\n \r\r\n if(($('#allpage_'+id).val()) == data.curpages)\r\r\n {\r\r\n $('#next_'+id).attr('disabled','disabled');\r\r\n $('#next_'+id).addClass('passive');\r\r\n \r\r\n $('#last_'+id).attr('disabled','disabled');\r\r\n $('#last_'+id).addClass('passive');\r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n \r\r\n }, \"json\");\r\r\n \r\r\n \r\r\n }) \r\r\n \r\r\n $('.prev').click(function(){\r\r\n \r\r\n var methodAction = ($(this).attr('id')).substr(5);\r\r\n var id = methodAction;\r\r\n \r\r\n $.post(url+methodAction+'paging',\r\r\n {\r\r\n paramOffset: ($('#offset_'+id).val())-(parseInt(limit))*2,\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : $('#curpage_'+id).val(),\r\r\n paramLimit : limit,\r\r\n actionQuery: \"prev\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n \r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n //alert(link_page);\r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#next_'+id).removeAttr('disabled','disabled');\r\r\n $('#next_'+id).removeClass('passive');\r\r\n \r\r\n $('#last_'+id).removeAttr('disabled','disabled');\r\r\n $('#last_'+id).removeClass('passive');\r\r\n \r\r\n if(data.curpages == 1)\r\r\n {\r\r\n $('#prev_'+id).attr('disabled','disabled');\r\r\n $('#prev_'+id).addClass('passive');\r\r\n \r\r\n $('#firsts_'+id).attr('disabled','disabled');\r\r\n $('#firsts_'+id).addClass('passive');\r\r\n \r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n }, \"json\");\r\r\n \r\r\n \r\r\n })\r\r\n\r\r\n\r\r\n $('.first').click(function(){\r\r\n var id = ($(this).attr('id')).substr(7);\r\r\n //alert();\r\r\n \r\r\n $.post(url+id+'paging',\r\r\n {\r\r\n paramOffset: 0,\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : 0,\r\r\n paramLimit : limit,\r\r\n actionQuery: \"\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n \r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n //alert(link_page);\r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#next_'+id).removeAttr('disabled','disabled');\r\r\n $('#next_'+id).removeClass('passive');\r\r\n\r\r\n $('#last_'+id).removeAttr('disabled','disabled');\r\r\n $('#last_'+id).removeClass('passive');\r\r\n \r\r\n if(data.curpages == 1)\r\r\n {\r\r\n $('#prev_'+id).attr('disabled','disabled');\r\r\n $('#prev_'+id).addClass('passive');\r\r\n\r\r\n $('#firsts_'+id).attr('disabled','disabled');\r\r\n $('#firsts_'+id).addClass('passive');\r\r\n\r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n \r\r\n }, \"json\");\r\r\n\r\r\n })\r\r\n\r\r\n\r\r\n $('.last').click(function(){\r\r\n var id = ($(this).attr('id')).substr(5);\r\r\n \r\r\n var tmp_offset = limit;\r\r\n var lastpage = $('#paramlast_'+id).val();\r\r\n var offset = (tmp_offset * lastpage)-tmp_offset;\r\r\n //alert(offset);\r\r\n\r\r\n\r\r\n $.post(url+id+'paging',\r\r\n {\r\r\n \r\r\n paramOffset: offset,\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : ($('#paramlast_'+id).val())-1,\r\r\n paramLimit : limit,\r\r\n actionQuery: \"next\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n \r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#prev_'+id).removeAttr('disabled','disabled');\r\r\n $('#prev_'+id).removeClass('passive');\r\r\n\r\r\n $('#firsts_'+id).removeAttr('disabled','disabled');\r\r\n $('#firsts_'+id).removeClass('passive');\r\r\n \r\r\n if(($('#allpage_'+id).val()) == data.curpages)\r\r\n {\r\r\n $('#next_'+id).attr('disabled','disabled');\r\r\n $('#next_'+id).addClass('passive');\r\r\n\r\r\n $('#last_'+id).attr('disabled','disabled');\r\r\n $('#last_'+id).addClass('passive');\r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n \r\r\n }, \"json\");\r\r\n\r\r\n })\r\r\n\r\r\n \r\r\n linkPage('',url,limit);\r\r\n\r\r\n}", "title": "" } ]
[ { "docid": "c36b6ff7bb6dae15bd4ddef58fe72de3", "score": "0.7336676", "text": "function Paging(totalPage) {\n var obj = $(\"#pagination\").twbsPagination({\n totalPages: totalPage,\n visiblePages: 5,\n onPageClick: function (event, page) {\n CallAPI(page);\n }\n });\n }", "title": "" }, { "docid": "27eb7e94131e0e24e2651f9205147f66", "score": "0.72419715", "text": "function page(pageNo){\n\n pageNum = pageNo;\n new Ajax.Request( \"paginate.php\",\n {\n method: \"get\",\n parameters: {pageNo : pageNo},\n onSuccess: pageSuccess,\n onFailure: pageFailure\n }\n );\n}", "title": "" }, { "docid": "9da4502749d0269f72da234ea89776a3", "score": "0.72417337", "text": "function ajaxpagination(val, channelVideos, channelId) {\n\tvar xmlhttp;\n\tif (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\txmlhttp = new XMLHttpRequest();\n\t} else {// code for IE6, IE5\n\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\tdocument.getElementById(\"channel_videos\").innerHTML = xmlhttp.responseText;\n\t\t}\n\t}\n\txmlhttp\n\t\t\t.open(\n\t\t\t\t\t\"POST\",\n\t\t\t\t\t\"index.php?option=com_contushdvideoshare&view=channelvideos&tmpl=component\",\n\t\t\t\t\ttrue);\n\txmlhttp.setRequestHeader('Content-Type',\n\t\t\t'application/x-www-form-urlencoded');\n\tvar page = val;\n\tvar channel_videos = channelVideos;\n\tvar channelId = channelId;\n\txmlhttp.send('page=' + page + '&channel_videos=' + channel_videos\n\t\t\t+ '&channelid=' + channelId);\n}", "title": "" }, { "docid": "34c747b905d1b77ec284ae5f016da3cd", "score": "0.7198764", "text": "function pagination(page,aksix,subaksi){ \n var aksi ='aksi='+aksix+'&subaksi='+subaksi+'&starting='+page;\n var cari ='';\n var el,el2;\n\n if(subaksi!=''){ // multi paging \n el = '.'+subaksi+'_cari';\n el2 = '#'+subaksi+'_tbody';\n }else{ // single paging\n el = '.cari';\n el2 = '#tbody';\n }\n\n $(el).each(function(){\n var p = $(this).attr('id');\n var v = $(this).val();\n cari+='&'+p+'='+v;\n });\n\n $.ajax({\n url:dir,\n type:\"post\",\n data: aksi+cari,\n beforeSend:function(){\n $(el2).html('<tr><td align=\"center\" colspan=\"10\"><img src=\"../img/w8loader.gif\"></td></tr></center>');\n },success:function(dt){\n setTimeout(function(){\n $(el2).html(dt).fadeIn();\n },1000);\n }\n });\n }", "title": "" }, { "docid": "5cc1cdb192ec7df3251ed54c72937db0", "score": "0.7197422", "text": "function pagination(page,aksix,subaksi){ \n var aksi ='aksi='+aksix+'&subaksi='+subaksi+'&starting='+page;\n var cari ='';\n var el,el2;\n\n if(subaksi!=''){ // multi paging \n el = '.'+subaksi+'_cari';\n el2 = '#'+subaksi+'_tbody';\n }else{ // single paging\n el = '.cari';\n el2 = '#tbody';\n }\n\n $(el).each(function(){\n var p = $(this).attr('id');\n var v = $(this).val();\n cari+='&'+p+'='+v;\n });\n\n $.ajax({\n url:dir,\n type:\"post\",\n data: aksi+cari,\n beforeSend:function(){\n $(el2).html('<tr><td align=\"center\" colspan=\"8\"><img src=\"img/w8loader.gif\"></td></tr></center>');\n },success:function(dt){\n setTimeout(function(){\n $(el2).html(dt).fadeIn();\n },1000);\n }\n });\n }", "title": "" }, { "docid": "08b311d8ce55ca677a6bdd1e6165ef3c", "score": "0.7181308", "text": "function pageloading(page, url) {\n $.blockUI({ message: '<img src=\"'+window.location.origin+'/admin_assets/images/loader.jpg\" style=\"height: 100px;\" />',\n css: {border: 'none', backgroundColor:'transparent'} });\n $('#pagination_tags').pagination({\n total: 1, // 总数据条数\n current: 1, // 当前页码\n length: 1, // 每页数据量\n size: 1, // 显示按钮个数\n prev: 'Previous',\n next: 'Next',\n ajax: function (options, refresh, $target) {\n $.ajax({\n type: \"post\",\n url: url,\n data: {\n \"_token\": $('#csrf-token')[0].content,\n 'page_num': options.current,\n },\n success: function (data) {\n data=JSON.parse(data);\n\n $('#append_list').html('');\n $('#append_list').append(data['html']);\n $.unblockUI();\n\n refresh({\n total: data['total'], // 可选\n length: 10, // 可选\n });\n },\n error: function () {\n $.unblockUI();\n $.alert('Something went wrong.');\n }\n });\n }\n });\n}", "title": "" }, { "docid": "14fd4e3a1c589bb6c82e895a21ceacaf", "score": "0.6930473", "text": "function GetByAjaxMoins() {\n\n page--;\n if (page < 1) {\n page = 1;\n }\n CallAjax(page);\n}", "title": "" }, { "docid": "a2522379a038538b73b98e17a259768b", "score": "0.68886495", "text": "function GetByAjax() {\n page++;\n CallAjax(page);\n}", "title": "" }, { "docid": "6c0f66cb92ff0abf55339d4ec37098cd", "score": "0.68806106", "text": "function initPagination(num_entries,cur_page) {\n //var num_entries = $('#hiddenresult div.result').length;\n //var num_entries =200;\n // Create pagination element\n \n $(\"#Pagination\").pagination(num_entries, {\n num_edge_entries: 2,\n num_display_entries: 8,\n current_page:cur_page,\n callback: pageselectCallback,\n items_per_page:page_items\n });\n}", "title": "" }, { "docid": "228f5e089b1c5341f42fec016d1872ba", "score": "0.67948794", "text": "function flo_ajax_pagination(){jQuery(\".pag\").on(\"click\",\".page-numbers\",function(e){e.preventDefault();jQuery(\".flo-page-number\").val(jQuery(this).data(\"pagenumber\"));setTimeout(function(){flo_filter_projects()},200)})}", "title": "" }, { "docid": "83af1521d7a6d14a3e02567e90cf692b", "score": "0.67916256", "text": "function get_Contributionpagination(){\n\t\t$.ajax({\n\t\t\turl: '../../components/modules/Contributionpagination.php',\n\t\t\tdata: \"getContributionpagination\",\n\t\t\tsuccess:function(html){\n\t\t\t\t$(\"#Contributionpagination\").html(html);\n\t\t\t}\n\t\t});\n }", "title": "" }, { "docid": "53e585d71f43fdeb541bf7c24a457616", "score": "0.6731393", "text": "function pagination() {\n$(\".row ul li a\")\n.click(function(){\n$(\"#page_id\").val($(this).attr('href'))\n$(this).attr('href','#')\n$(\"#ja-content-main,.row\").remove()\n$(\"#fetch_book_process .modal-body span\").html('<b>Đang tải dữ liệu...</b>')\n$(\"#fetch_book_process\").show()\n$(this).addClass('active')\n//start ajax\n$.ajax({\ntype:'post',\ncontent:'text/html',\nurl:'/book/main/',\ndata: {\ncsrf_test_name:$(\"#csrf_test_name\").val(),\nbook_category:$(\"#page_id\").val(),\ncurrent_page_id:$(this).html()\n},\nsuccess:function(data){\n\t$(\"#fetch_book_process\").hide()\n\t$(\".main_content\").prepend(data)\n\t$('.khung_hinh').remove()\n\tfilter_ui() \n\tpagination()\n\tvar current_page_id=$(\"#current_page_id\").val()\n\t$(\".row ul li a\").each(function(){if($(this).html()==current_page_id){$(this).attr('style','background-color:#428bca;color:white')}})\n}\t\t\t\n})\n//end ajax\n})\n$(\".row ul\").addClass('pagination')\n}", "title": "" }, { "docid": "1693f0a5895443033d75f9853277a47f", "score": "0.66961825", "text": "function pagingAJAX(nextOrPrev){\n console.log('nextOrPrev = ' + nextOrPrev);\n create_paging_post(nextOrPrev, getActiveSearchType());\n hideControlsDuringSearch();\n}", "title": "" }, { "docid": "5d9936c6c06380a3eb48c6f5f800ba5d", "score": "0.6684388", "text": "function getContentCall(){\n // Call AJAX request function\n getContent(pagenum);\n // Increase page number\n pagenum++;\n}", "title": "" }, { "docid": "bac740ce8d7df2b11a17beba666470e9", "score": "0.664618", "text": "function paginadorAjax(pagina,order_by,direction,mensaje,modulo,accion,p_id,p_option,p_option2) {\n\n\tvar url = \"index.php\";\n\n \tvar param = {\n\t\tparameters:\"Ajax=true&paginando=true&accion=\"+accion+\"&pagina=\"+pagina+\"&order_by=\"+order_by+\"&order_direction=\"+direction+\"&modulo=\"+modulo+\"&id=\"+p_id+\"&option=\"+p_option+\"&option2=\"+p_option2,\n\t\tonLoading: onMsjUpdate(mensaje,'resultDataGrid')\n\t};\n\n \tvar peticion = new Ajax.Updater(\"resultDataGrid\",url,param);\n\n}", "title": "" }, { "docid": "c3a30cc747fbafa790851b12548514de", "score": "0.6598346", "text": "function initPagination(total,pageSize,currentPage) {\r\n var num_entries =total;\r\n if(pageSize>=total){currentPage=1;}\r\n // Create pagination element\r\n $(\"#result_page\").pagination(num_entries, {\r\n num_edge_entries: 2,\r\n num_display_entries: 5,\r\n current_page: currentPage-1,\r\n callback: pageselectCallback,\r\n items_per_page:pageSize,\r\n load_first_page:false,\r\n next_text:\"后一页\",\r\n prev_text:\"前一页\"\r\n });\r\n}", "title": "" }, { "docid": "77de100bfdf6bc5c3017ae89f5e15c94", "score": "0.6584747", "text": "function paginate(url, per_page, token, page, max, done) {\n var results = [];\n var page = page || 1;\n var max = max - per_page; //offset by 1 correction\n \n return subPaginate(results, url, per_page, token, page, max, done);\n }", "title": "" }, { "docid": "5eeeafdf5111c67faa238f624e62b44a", "score": "0.6579052", "text": "function RequestPage(pn){\n var perPage = document.getElementById(\"perPage\").value;\n var total = document.getElementById(\"empTotal\").value;\n var page = document.getElementById(\"page\").value;\n var search = document.getElementById(\"search\").value;\n var results = document.getElementById(\"results\");\n\tvar paginationControls = document.getElementById(\"paginationControls\");\n\tvar http = new XMLHttpRequest();\n http.onreadystatechange = function() {\n\t if(http.readyState == 4 && http.status == 200) {\n results.innerHTML = http.responseText;\n\t }\n }\n http.open(\"POST\",page, true);\n http.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n http.send(\"perPage=\"+perPage+\"&total=\"+total+\"&pn=\"+pn+\"&search=\"+search);\n\tvar pagination = \"\";\n if(total != 1){\n\t\tif (pn > 1) {\n\t\t\tpagination += '<button class=\"btnPage\" onclick=\"RequestPage('+(pn-1)+')\">&lt;</button>';\n \t}\n\t\tpagination += ' Strana '+pn+' od '+total + ' ';\n \tif (pn != total) {\n \tpagination += '<button class=\"btnPage\" onclick=\"RequestPage('+(pn+1)+')\">&gt;</button>';\n \t}\n }\n\tpaginationControls.innerHTML = pagination;\n}", "title": "" }, { "docid": "53c6f7b8d507044020b2e2f44a37bd5e", "score": "0.65761125", "text": "function paging(total,curr_page,url){\n \n var page = '';\n var total_page = Math.ceil(total/LIMIT);\n \n if(total > LIMIT) {\n \n page = '<ul class=\"pagination\">';\n \n if(parseInt(curr_page) >1)\n page +='<li><a href=\"'+url+(parseInt(curr_page)-1)+'\">Prev</a></li>';\n \n for(x = 1;x <= total_page;x++){\n \n var active = '';\n \n if(x == curr_page)\n active = 'class=\"active\"';\n \n page +='<li '+active+'><a href=\"'+url+x+'\">'+x+'</a></li>';\n \n }\n if(parseInt(curr_page) < total_page)\n page +='<li><a href=\"'+url+(parseInt(curr_page)+1)+'\">Next</a></li>';\n \n page +='</ul>';\n \n var x_showed = LIMIT;\n if(total < LIMIT)\n x_showed = total\n \n page += '<div class=\"pull-right\" style=\"margin-top:2px\">'\n +'<h5>'\n +' <small>Displaying '+x_showed+' of Total '+total+' Item(s)</small>' \n +'</h5>'\n +'</div>';\n }\n \n return page;\n}", "title": "" }, { "docid": "b5f91664580434f973cafd235f3039b4", "score": "0.65510386", "text": "function initPagination(pagenum, pagelimit) {\n\t\t// count entries inside the hidden content\n\t\tvar num_entries = jQuery('#total_entries').val();\n\n\n\t\t// Create content inside pagination element\n\t\t$(\"#Pagination\").pagination(num_entries, {\n\n\t\t\t\tcallback: pageselectCallback,\n\t\t\t\tcurrent_page:pagenum,\n\t\t\t\titems_per_page:pagelimit // Show only one item per page\n\t\t});\n }", "title": "" }, { "docid": "322f13292732512fbbff89cf61c58975", "score": "0.6549759", "text": "function loadPagination() {\r\n\t\tState = History.getState();\r\n\t\t\r\n\t\t$.get(State.url, function(data){\r\n\r\n\t\t\t$(\".ql_post_list\").replaceWith($(data).find(\".ql_post_list\"));\r\n\t\t \tql_niceSCrollPostList();\r\n\t\t \tql_animateMainPostList();\r\n\t\t});//get\r\n\r\n\t}", "title": "" }, { "docid": "dd2b9774bfbb64d0dda59c46de5b1dad", "score": "0.65304744", "text": "function callDiplome(docType, pageNumber, elementsPerPage, tbody, tPager) {\n content = $('#leiscontainer');\n link = \"/ListaT/\" + (((pageNumber - 1) * elementsPerPage) + 1) + \"/\" + (elementsPerPage -1) + \"/\" + docType;\n $.ajax({\n url: link,\n success: function (data) {\n $.ajax(\n {\n url: \"http://localhost:8089/documentstypecount/\" + docType,\n success: function (data) {\n var pages = Math.ceil(JSON.parse(data)[0].numberofmembers_ / elementsPerPage);\n if (pages > 1) {\n tPager.removeClass(\"hide\");\n tPager.bootpag({ total: pages });\n }\n else {\n tPager.addClass(\"hide\");\n }\n },\n }\n );\n showTramite(data, 'docLei', tbody);\n },\n error: function (data) {\n alert(\"erro ao devolver valor\")\n }\n });\n}", "title": "" }, { "docid": "6d4f9f9be10d5d9bb31ec1ad0ccc188b", "score": "0.6520184", "text": "function PagedListPagination(event) {\n\n // Prevent the url submission\n event.preventDefault();\n\n // Stope them from targeting the page they are on\n if ($(this).attr(\"href\") != undefined) {\n // Get and set search string\n var searchString = $('#SearchString').val();\n if (searchString == null || searchString == '') {\n searchString = '';\n }\n else {\n searchString = \"&searchString=\" + searchString;\n }\n\n // Create url\n var url = $(this).attr(\"href\") + searchString;\n\n // Empty the current contents of tableUsers\n $(\"#ProductList\").not(\".TableUserPager\").empty();\n\n // Send ajax request\n $.ajax({\n url: url, // Url request\n success: function (result) {// function to perform when the request succeeds\n $('#ProductList').html(result);\n\n // Fade in the table elements\n $(\".TableUser\").animate({ opacity: 1 }, 500);\n }\n });\n }\n}", "title": "" }, { "docid": "05de927542d9dd00e50c88233533639d", "score": "0.6516913", "text": "function hotn_ajax_pager($hotn_filter_form) {\n $j('#hotn-pager').find('.pager').bind('click', function() {\n var pager_id = $(this).data('pager');\n\n data = {};\n\n // Set the pager id to variable.\n data['hotnpager'] = pager_id;\n\n $j('select', $hotn_filter_form).each(function() {\n var $filter_select = $j(this);\n var hotn_filter_val = $filter_select.val();\n var hotn_filter_name = $filter_select.attr('name');\n\n // Set the value to array with as key field name.\n data[hotn_filter_name] = hotn_filter_val;\n });\n\n // Call ajax request with all data.\n hotn_ajax_request(data);\n });\n }", "title": "" }, { "docid": "391ee3134cf4af79590e75868e654a12", "score": "0.6485986", "text": "function showPublicPaintings(pageNo){\n\n var id = getUrlParameter('id');\n var limit = 8;\n counter = pageNo * limit - limit ;\n $.ajax({\n url: `${baseUrl}/controller/artistProfileController.cfm?action=paginationForPublicPainting&counter=${counter}&id=${id}` ,\n type: \"GET\",\n crossDomain: true,\n data: {},\n async: false,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n success: function (response) {\n response = JSON.parse(response);\n \n getCountOfPublicPaintings();\n if(response.length){\n $('#publicImgDiv').empty();\n setAllPaintings(response); \n } \n },\n error: function( error) {\n } ,\n complete: function () { \n bindCall();\n } \n });\n \n}", "title": "" }, { "docid": "be3fe5dbbdb4db2c9fc7c7ad0d5faa49", "score": "0.6427412", "text": "function nextPage() {\n page = page + 1;\n ajaxLoad(page);\n}", "title": "" }, { "docid": "e682455a1c4d77875280856d2a737beb", "score": "0.6395132", "text": "function woo_vou_used_codes_ajax_pagination( pid ) {\n\t\n\tvar woo_vou_start_date = jQuery('#woo_vou_hid_start_date').val();\n\tvar woo_vou_end_date = jQuery('#woo_vou_hid_end_date').val();\n\tvar woo_vou_post_id = jQuery('#woo_vou_product_filter').val();\n\t\n\tvar data = {\n\t\t\t\t\taction: 'woo_vou_used_codes_next_page',\t\t\t\t\t\n\t\t\t\t\tpaging: pid,\n\t\t\t\t\twoo_vou_start_date: woo_vou_start_date,\n\t\t\t\t\twoo_vou_end_date: woo_vou_end_date,\n\t\t\t\t\twoo_vou_post_id: woo_vou_post_id\n\t\t\t\t};\n\t\t\n\tjQuery('.woo-vou-usedcodes-loader').show();\n\tjQuery('.woo-vou-used-codes-paging').hide();\n\t\n\tjQuery.post( WooVouPublic.ajaxurl, data, function(response) {\n\t\tvar newresponse = jQuery(response).filter('.woo-vou-used-codes-html').html();\n\t\tjQuery('.woo-vou-usedcodes-loader').hide();\n\t\tjQuery('.woo-vou-used-codes-html').html(newresponse);\n\t});\t\n\treturn false;\n}", "title": "" }, { "docid": "9e27b557312e0ab36d1a131a0b11c7e8", "score": "0.63940454", "text": "massUpdatePagination() {}", "title": "" }, { "docid": "1564ccc1f00a5066026ceb85a6af78f8", "score": "0.6389263", "text": "function paginate(data){\n\tvar total_found = data.response.numFound;\n\tvar start_row_this_click = data.response.start;\n\tvar remaining = total_found - start_row_this_click- NUMBER_OF_RESULTS_ON_PAGE ;\n\tif (total_found<=NUMBER_OF_RESULTS_ON_PAGE){\n\t\treturn;\n\t}else{\n\t\t$('.previous').remove();\n\t\t$('.next').remove();\n\t\talert\n\t\tif (data.response.start>0){\n\t\t\t$('.paginate').append('<button class=\"previous\">Previous</button>');\n\t\t\t$('.previous').unbind().click(function(event){\n\t\t\t\t$.getJSON('search?q='+data.responseHeader.params.q+'&start='+(data.response.start-NUMBER_OF_RESULTS_ON_PAGE), function(newData){\n\t\t\t\t\tprocessJson(newData);\n\t\t\t\t}); \n\t\t\t});\n\t\t}\n\t\tif (data.response.numFound-data.response.start>NUMBER_OF_RESULTS_ON_PAGE){\n\t\t\t$('.paginate').append('<button class=\"next\">Next</button>');\n\t\t\t$('.next').unbind().click(function(event){\n\t\t\t\t$.getJSON('search?q='+data.responseHeader.params.q+'&start='+(data.response.start+NUMBER_OF_RESULTS_ON_PAGE), function(newData){\n\t\t\t\t\tprocessJson(newData);\n\t\t\t\t}); \n\t\t\t});\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dc8ac59a606e68b1a45bc1767a64ac68", "score": "0.6303358", "text": "function paginatePosts() {\n $('#paginationPosts').find('a').on('click', function(e) {\n e.preventDefault();\n\n var $a = $(this);\n var url = $a.attr('href');\n // récupère l'argument passer en get\n var argGet = url.substring(url.lastIndexOf('?'));\n // récupère la route pour la pagination\n var urlNewRoute = $('.pagination-table-posts').attr('url');\n // concatene la route et l'argument\n var newUrl = urlNewRoute+argGet;\n $.ajax({\n type: 'GET',\n url: newUrl,\n success: function (data) {\n // recharge le tableau\n $('.pagination-table-posts').replaceWith(data);\n // réactive les écouteurs\n removePost();\n editPost();\n paginatePosts();\n }, error: function() {\n addFlashMsgManagePosts('danger', 'Une erreur est survenue')\n }\n })\n });\n }", "title": "" }, { "docid": "e5822d77e85793cd8a3082fb7f1f5941", "score": "0.63003975", "text": "function ajaxGetManyProduct(ProductName, PageNumber, PageSize, OrderBy) {\n\n let options = {};\n let qProductName = \"\";\n let qPageNumber = \"\";\n let qPageSize = \"\";\n let qOrderBy = \"\";\n\n if (!isEmpty(ProductName)) qProductName = 'ProductName=' + ProductName;\n if (!isEmpty(PageNumber)) qPageNumber = 'PageNumber=' + PageNumber;\n if (!isEmpty(PageSize)) qPageSize = 'PageSize=' + PageSize;\n if (!isEmpty(OrderBy)) qOrderBy = 'OrderBy=' + OrderBy;\n //EX. /Products?ProductName=a&PageNumber=1&PageSize=5&OrderBy=id\n options.url = baseAPI\n + \"Products?\"\n + qProductName + \"&\"\n + qPageNumber + \"&\"\n + qPageSize + \"&\"\n + qOrderBy;\n\n options.type = \"GET\";\n //options.beforeSend = function (xhr) {\n // xhr.setRequestHeader(\"Authorization\", \"Bearer \" + sessionStorage.getItem(\"token\"));\n // $(\"h3.message\").html(\"Wait...\");\n //}; \n options.dataType = \"json\";\n options.success = function (data, status, xhr) {\n //#region -------- Pagination\n //Get Pagination\n //X-Pagination: {\"TotalCount\":10,\"PageSize\":1,\"CurrentPage\":5,\"TotalPages\":10,\"HasNext\":true,\"HasPrevious\":true}\n let pagination = JSON.parse(xhr.getResponseHeader(\"X-Pagination\"));\n //Cho vào biến global để sử dụng bên ngoài\n pagination_ShopGrid3_Global = pagination;\n //Nếu số lượng Page trong database nhỏ hơn totalShowPage thì số nhỏ \n totalShowPage = totalShowPage <= pagination.TotalPages ? totalShowPage : pagination.TotalPages;\n //Bên trái của page hiện tại luôn luôn có totalLeftPage page \n let totalLeftPage = Math.round(totalShowPage / 2 - 1); //EX.=2\n //Bên phải của page hiện tại luôn luôn có totalRightPage page\n let totalRightPage = totalShowPage - totalLeftPage - 1;\n //Tính toán để hiển thị page đầu tiên\n //Nếu CurrentPage nhỏ hơn số lượng page bên trái thì firstPage =1;\n let firstPage = 1; // Ex. \n\n //Xét trường hợp lớn hơn \n if (pagination.CurrentPage > totalLeftPage) {\n //Trường hợp CurrentPage lớn hơn (pagination.TotalPages - totalRightPage)\n //Thì firstPage = TotalPages - totalShowPage - 1 (tức cố định firstPage từ vị trí này)\n if (pagination.CurrentPage >= (pagination.TotalPages - totalRightPage)) {\n firstPage = pagination.TotalPages - totalShowPage + 1;\n //Trường hợp bình thường cứ lấy page hiện tại trừ số page muốn hiện thị ở bên trái của nó\n } else {\n\n firstPage = pagination.CurrentPage - totalLeftPage;\n }\n }\n\n //Create html list_li_page\n let list_li_page = `<li class=\"page-item prev\"><a class=\"page-link prev\">Prev</a></li>`;\n for (let i = firstPage; i <= firstPage + totalShowPage - 1; ++i) {\n let activeClass = i === pagination.CurrentPage ? \" active\" : \"\";\n list_li_page += `<li page =\"` + i + `\" class=\"page-item\"><a class=\"page-link` + activeClass + `\">` + i + `</a></li>`;\n }\n list_li_page += `<li class=\"page-item next\"><a class=\"page-link next\"\">Next</a></li>`;\n\n //add Page\n $(\"div.page-pagination ul.pagination\").text(\"\");\n $(\"div.page-pagination ul.pagination\").append(list_li_page);\n\n //Show Page info\n let toNumber = (pagination.CurrentPage * PageSize);\n let fromNumber = toNumber - PageSize + 1;\n toNumber = toNumber >= pagination.TotalCount ? pagination.TotalCount : toNumber;\n $(\"div.top-bar-page-amount p\").text(\"Showing \" + fromNumber + \" - \" + toNumber + \" of \" + pagination.TotalCount + \" result\");\n\n //#endregion ----- Pagination\n\n // Add to New Product, Quick View (index page )and Get Array <div class=\"single-product\">\n let arrDivSingleProduct = [];\n //let arrDivModalQuickView = [];\n let root = window.location.origin + \"/\";\n //clear list View\n $(\"div#list\").text(\"\");\n //clear modal\n $(\"div.main-wrapper div#modal\").text(\"\");\n data.forEach(function (product) {\n //Check quantity of product\n if (product.quantity === 0) {\n var stickerNew = `<span class=\"sticker-new soldout-title\">Soldout</span>`;\n } else {\n var stickerNew = `<span class=\"sticker-new label-sale\">-` + product.productPrice.salePercent + `%</span>`;\n }\n\n //MainProductImage \n var mainProductImage = \"\";\n product.productImages.forEach(function (productImage) {\n if (productImage.isMainPicture) {\n mainProductImage = productImage.pictureUri;\n //break; JAVASCRIPT can't break forEach\n }\n });\n\n //#region Create div class=\"single-product\n let divSingleProduct = `\n <div class=\"single-product\">\n <div class=\"product-image\">\n <a href=\"`+ root + `shopsingle/` + product.id + `\">\n <img src=\"`+ root + mainProductImage + `\" alt=\"\">\n </a>\n `+ stickerNew + `\n <div class=\"action-links\">\n <ul>\n <li><a productId=`+ product.id + ` \n productName=`+ product.name + ` \n currentPrice=`+ product.productPrice.currentPrice + ` \n oldPrice=`+ product.productPrice.oldPrice + ` \n maxQuantity=`+ product.quantity + `\n image=`+ mainProductImage + ` \n data-tooltip=\"tooltip\" data-placement=\"left\" title=\"Add to cart\"><i class=\"icon-shopping-bag\"></i></a></li>\n <li><a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"Compare\"><i class=\"icon-sliders\"></i></a></li>\n <li><a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"Add to Wishlist\"><i class=\"icon-heart\"></i></a></li>\n <li><a data-tooltip=\"tooltip\" data-placement=\"left\" title=\"Quick View\" data-toggle=\"modal\" data-target=\"#Modal`+ product.id + `\"><i class=\"icon-eye\"></i></a></li>\n </ul>\n </div>\n\n </div>\n <div class=\"product-content text-center\">\n <ul class=\"rating\">\n <li class=\"rating-on\"><i class=\"fa fa-star\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star-half-o\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star-o\"></i></li>\n </ul>\n <h4 class=\"product-name\"><a href=\"`+ root + `shopsingle/` + product.id + `\">` + product.name + `</a></h4>\n <div class=\"price-box\">\n <span class=\"current-price\">$`+ product.productPrice.currentPrice + `</span>\n <span class=\"old-price\">$`+ product.productPrice.oldPrice + `</span>\n </div>\n </div>\n </div>`;\n //#endregion\n //#region Create <div class=\"modal fade\" id=\"Modal`+ product.id + `\">\n var quickView = `\n <div class=\"modal fade\" id=\"Modal`+ product.id + `\">\n <div class=\"modal-dialog modal-dialog-centered\">\n <div class=\"modal-content\">\n <button type=\"button\" class=\"btn-close\" data-dismiss=\"modal\" aria-label=\"Close\"></button>\n <div class=\"modal-body\">\n <div class=\"row\">\n <div class=\"col-md-6\">\n <div class=\"quick-view-image\">\n <img src=\"`+ root + mainProductImage + `\" alt=\"\">\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"quick-view-content\">\n <h4 class=\"product-title\">`+ product.name + `</h4>\n <div class=\"thumb-price\">\n <span class=\"current-price\">$`+ product.productPrice.currentPrice + `</span>\n <span class=\"old-price\">$`+ product.productPrice.oldPrice + `</span>\n <span class=\"discount\">-`+ product.productPrice.salePercent + `%</span>\n </div>\n <div class=\"product-rating\">\n <ul class=\"rating-star\">\n <li><i class=\"fa fa-star-o\"></i></li>\n <li><i class=\"fa fa-star-o\"></i></li>\n <li><i class=\"fa fa-star-o\"></i></li>\n <li><i class=\"fa fa-star-o\"></i></li>\n <li><i class=\"fa fa-star-o\"></i></li>\n </ul>\n <span>No reviews</span>\n </div>\n <p>`+ product.shortDescription + `</p>\n\n <div class=\"quick-view-quantity-addcart d-flex flex-wrap\">\n <form action=\"#\">\n <div class=\"quantity d-inline-flex\">\n <button type=\"button\" class=\"sub\"><i class=\"ti-minus\"></i></button>\n <input type=\"text\" value=\"1\" max=`+ product.quantity + ` />\n <button type=\"button\" class=\"add\"><i class=\"ti-plus\"></i></button>\n </div>\n </form>\n <div class=\"addcart-btn\">\n <button productId=`+ product.id + ` \n productName=`+ product.name + ` \n currentPrice=`+ product.productPrice.currentPrice + ` \n oldPrice=`+ product.productPrice.oldPrice + ` \n maxQuantity=`+ product.quantity + `\n image=`+ mainProductImage + `\n quickView=true\n class=\"btn btn-primary\">Add to cart</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>`;\n //#endregion Create quick view\n //Add quickView (index page and Grid 3 page)\n $(\"div.main-wrapper div#modal\").append(quickView);\n //Add to listDivSingleProduct\n arrDivSingleProduct.push(divSingleProduct);\n //#region Create and Add product list view (Grid 3 page)\n if ($(\"div#list\").length > 0) {\n let divProductList = `\n <div class=\"single-product product-list\">\n <div class=\"product-image\">\n <a href=\"`+ root + `shopsingle/` + product.id + `\">\n <img src=\"`+ mainProductImage + `\" alt=\"\">\n </a>\n \n `+ stickerNew + `\n \n <div class=\"action-links\">\n <ul>\n <li><a href=\"javascript:void(0);\" data-tooltip=\"tooltip\" data-placement=\"left\" title=\"Quick View\" data-toggle=\"modal\" data-target=\"#Modal`+ product.id + `\"><i class=\"icon-eye\"></i></a></li>\n </ul>\n </div>\n </div>\n <div class=\"product-content\">\n <ul class=\"rating\">\n <li class=\"rating-on\"><i class=\"fa fa-star-o\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star-o\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star-o\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star-o\"></i></li>\n <li class=\"rating-on\"><i class=\"fa fa-star-o\"></i></li>\n </ul>\n <h4 class=\"product-name\"><a href=\"`+ root + `shopsingle/` + product.id + `\">` + product.name + `</a></h4>\n <div class=\"price-box\">\n <span class=\"current-price\">$`+ product.productPrice.currentPrice + `</span>\n <span class=\"old-price\">$`+ product.productPrice.oldPrice + `</span>\n </div>\n <p>`+ product.shortDescription + `</p>\n \n <ul class=\"action-links\">\n <li><a productId=`+ product.id + ` \n productName=`+ product.name + ` \n currentPrice=`+ product.productPrice.currentPrice + ` \n oldPrice=`+ product.productPrice.oldPrice + ` \n maxQuantity=`+ product.quantity + `\n image=`+ mainProductImage + `\n class=\"add-cart\" data-tooltip=\"tooltip\" data-placement=\"top\" title=\"Add to cart\"> Add to cart </a></li>\n <li><a href=\"javascript:void(0);\" data-tooltip=\"tooltip\" data-placement=\"top\" title=\"Add to Wishlist\" class=\"wishlist\"><i class=\"icon-heart\"></i></a></li>\n <li><a href=\"javascript:void(0);\" data-tooltip=\"tooltip\" data-placement=\"top\" title=\"Compare\" class=\"compare\"><i class=\"icon-sliders\"></i></a></li>\n </ul>\n </div>\n </div>`;\n $(\"div#list\").append(divProductList);\n }\n\n //#endregion Create product list view\n });\n\n let arrLen = arrDivSingleProduct.length;\n //#region Add to New Products (index page) and Related Products (on ShopSingle)\n let newProducts = $(\"div.new-product-area div.swiper-wrapper\");\n if (newProducts.length > 0) {\n for (let i = 0; i < arrLen; i++) {\n //Create <div class=\"swiper-slide\">\n let divswiperSlide = document.createElement(\"div\");\n divswiperSlide.className = \"swiper-slide\";\n divswiperSlide.innerHTML = arrDivSingleProduct[i];\n\n //Add to New Product on Index page\n newProducts.append(divswiperSlide);\n }\n }\n //#endregion Add to New Products (index page) and Related Products (on ShopSingle)\n //#region Add to Featured (index page)\n //Chỉ lấy 10 sản phẩm đầu để demo\n if ($(\"#tab1 div.swiper-wrapper\").length > 0) {\n for (let i = 0; i < 10 / 2; i++) {\n // Create <div class=\"swiper-slide\">\n let divswiperSlide = document.createElement(\"div\");\n let divswiperSlideReverse = document.createElement(\"div\");\n let divswiperSlideBestSeller = document.createElement(\"div\");\n divswiperSlide.className = \"swiper-slide\";\n divswiperSlideReverse.className = \"swiper-slide\";\n divswiperSlideBestSeller.className = \"swiper-slide\";\n //Mỗi swiper-slide là 2 SingleProduct\n divswiperSlide.innerHTML = arrDivSingleProduct[i] + arrDivSingleProduct[10 - 1 - i];\n divswiperSlideReverse.innerHTML = arrDivSingleProduct[10 - 1 - i] + arrDivSingleProduct[i];\n divswiperSlideBestSeller.innerHTML = arrDivSingleProduct[2 * (i + 1) - 1] + arrDivSingleProduct[2 * (i + 1) - 2];\n\n //Add New in Featured (index page)\n $(\"#tab1 div.swiper-wrapper\").prepend(divswiperSlide);\n //Add Featured in Featured (index page)\n $(\"#tab2 div.swiper-wrapper\").prepend(divswiperSlideReverse);\n //Add Featured in Featured (index page)\n $(\"#tab3 div.swiper-wrapper\").prepend(divswiperSlideBestSeller);\n }\n }\n //#endregion Add to Featured (index page)\n //#region Add Gird (Grid 3 page)\n let grid3 = $(\"#grid > div\");\n //If being Grid3 page\n if (grid3.length > 0) {\n grid3.text(\"\");\n for (let i = 0; i < arrLen; i++) {\n\n //Create <div class=\"col-lg-4 col-sm-6\">\n let divcollg4colsm6 = document.createElement(\"div\");\n divcollg4colsm6.className = \"col-lg-4 col-sm-6\";\n divcollg4colsm6.innerHTML = arrDivSingleProduct[i];\n //add to (\"#grid > div\") in Grid 3 page\n grid3.append(divcollg4colsm6);\n }\n }\n //#endregion Add Gird view and List View (Grid 3 page)\n //#region Error\n //Error message change to \"\"\n //$(\"h3.message\").html(\"\");\n\n //if (sessionStorage.hasOwnProperty(\"message\")) {\n // $(\"h3.message\").html(sessionStorage.getItem(\"message\"));\n // sessionStorage.removeItem(\"message\");\n // }\n //#endregion Error \n\n };\n options.error = function (xhr) {\n //if (xhr.status == 401) {\n // window.location.href = \"chuyển đến trang đăng nhập\";\n //} \n\n //$(\"h3.message\").html(\"Error while calling the API\");\n }\n //Start call API\n $.ajax(options);\n}", "title": "" }, { "docid": "94f2bfc7cda137df83efd2e739405b62", "score": "0.6296801", "text": "function pagebtn(res) {\n var pagenums = res.pages;\n\n $(\"#pagebadge\").remove();\n $(\"#pagebadgepre\").after(\n '<span id=\"pagebadge\" class=\"ml-2 badge badge-info w-25 \">第 ' +\n res.pageNo +\n \" 頁 / 共 \" +\n res.totalPages +\n \" 頁</span>\"\n );\n\n $(\"#pagination\").empty();\n $(\"#pagination\").append(\n `<li class=\"page-item\"><a id=\"firstbtn\" class=\"page-link\" href=\"javascript:void(0)\">第一頁</a></li>`\n );\n if (res.pageNo > 1) {\n $(\"#pagination\").append(\n '<li class=\"page-item\"><a id=\"prevbtn\" class=\"page-link\" href=\"javascript:void(0)\">上一頁</a>' +\n '<input class=\"prev\" type=\"hidden\" value=' +\n (res.pageNo - 1) +\n \"></li>\"\n );\n }\n\n $.each(pagenums, function(i, num) {\n if (num == res.pageNo) {\n $(\"#pagination\").append(\n `<li class=\"page-item active\"><a id=\"pageNo\" class=\"pagebtn page-link \" href=\"javascript:void(0)\">` +\n num + `<span class=\"sr-only\">(current)</span></a></li>`\n\n );\n } else {\n $(\"#pagination\").append(\n `<li class=\"page-item\"><a id=\"pageNo\" class=\"pagebtn page-link\" href=\"javascript:void(0)\">` +\n num + `</a></li>`\n\n );\n }\n });\n if (res.pageNo != res.totalPages) {\n $(\"#pagination\").append(\n '<li class=\"page-item\"><a id=\"nextbtn\" class=\"page-link\" href=\"javascript:void(0)\">下一頁</a>' +\n '<input class=\"next\" type=\"hidden\" value=' +\n (res.pageNo + 1) +\n \"></li>\"\n\n );\n }\n $(\"#pagination\").append(\n '<li class=\"page-item\"><a id=\"lastbtn\" class=\"page-link\" href=\"javascript:void(0)\">最末頁</a>' +\n '<input id=\"totalPages\" type=\"hidden\" value=\"' +\n res.totalPages +\n '\"></li>'\n );\n}", "title": "" }, { "docid": "2d689d988f761e364aa518c57a373589", "score": "0.6294544", "text": "function dhPagination() {\n // TODO: Fix the pages numbers\n const paginationRequest = sendRequests('/dashboard/data/api/get-table-pagination', 'Pagination Request');\n $.when(paginationRequest).done(function (data, textStatus, jqXHR) {\n\n // check if there is any returned data\n if ((textStatus === 'success') && (jqXHR.status === 200)) {\n const results = data['data'];\n const pagesItems = [];\n // console.log(results);\n const dhTablePaginationWrapper = $(\"#dhTablePaginationWrapper\");\n // const previousBtn = dhTablePaginationWrapper.find(\"#previousBtn\");\n // const nextBtn = dhTablePaginationWrapper.find(\"#nextBtn\");\n const paginationTotalResults = $(\"#paginationTotalResults\");\n paginationTotalResults.html(results['total_records']);\n\n // loop through pages and create pages items\n for (let page = 1; page <= results['total_pages']; page++) {\n const element = page;\n // console.log(object);\n const htmlElement = `<a class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary mr-2 my-1 data-table-nav-btns not-allowed-cursor disabled\" disabled='disabled'>${page}</a>`.trim();\n pagesItems.push(htmlElement);\n }\n // $(pagesItems.toString()).insertAfter(previousBtn); // insert the pages number to ui\n\n }\n\n\n });\n}", "title": "" }, { "docid": "aed3197a115a5589ad98ca69a3efef69", "score": "0.6270956", "text": "function updatePagination(){\n checkPagPrev();\n checkPagNext();\n}", "title": "" }, { "docid": "e28da5050a1b43e99890757ca77c6b5b", "score": "0.62617755", "text": "function postsPagination (page=0, tableLimit=10) {\n const totalLength = tableSortedEntries.length;\n const numOfPages = Math.ceil(totalLength/tableLimit);\n const currentPage = tableSortedEntries.slice(page*tableLimit+0, page*tableLimit+tableLimit);\n tableEntries.hide();\n currentPage.show();\n\n prevPage.empty();\n pageNumbers.empty();\n nextPage.empty();\n if (numOfPages > 1) {\n if (page == 0) {\n prevPage.empty();\n nextPage.append(`\n <li class=\"page-item active shadow\">\n <a class=\"page-link\" href=\"javascript:postsPagination(${page+1})\">Next</a>\n </li>\n `);\n } else if (page == (numOfPages-1)) {\n nextPage.empty();\n prevPage.append(`\n <li class=\"page-item active shadow\">\n <a class=\"page-link\" href=\"javascript:postsPagination(${page-1})\">Previous</a>\n </li>\n `);\n } else {\n prevPage.append(`\n <li class=\"page-item active shadow\">\n <a class=\"page-link\" href=\"javascript:postsPagination(${page-1})\">Previous</a>\n </li>\n `);\n nextPage.append(`\n <li class=\"page-item active shadow\">\n <a class=\"page-link\" href=\"javascript:postsPagination(${page+1})\">Next</a>\n </li>\n `);\n };\n paginationNumbers(page, numOfPages);\n };\n}", "title": "" }, { "docid": "ad05768f8cf35c696d65ac2f38664193", "score": "0.62398183", "text": "function pageLimit()\r\n{\r\n return Math.ceil(data.length / recordsPerPage);\r\n}", "title": "" }, { "docid": "a739b613d8a68d5efe937f876ac603de", "score": "0.62281907", "text": "function getAjaxPageAndBill(search, show) {\n $.ajax({\n url: \"../../api/bill/get-ajax-bill-page\",\n method: \"get\",\n data: { search: search, show: show },\n success: function(data) {\n // /\n let showPagaLink = `<nav >\n <ul class=\"pagination\" id=\"product_page\">\n <li class=\"page-item disabled pre\" aria-disabled=\"true\" aria-label=\"« Previous\">\n <span class=\"page-link\" aria-hidden=\"true\">‹</span>\n </li>\n <li class=\"page-item page active\" value=\"1\" aria-current=\"page\"><span class=\"page-link\">1</span></li> `;\n if (data.totalPage >= 2) {\n for (var i = 2; i <= data.totalPage; i++) {\n showPagaLink +=\n `<li class=\"page-item page\" value=\"` +\n i +\n `\" aria-current=\"page\"><span class=\"page-link\">` +\n i +\n `</span></li> `;\n }\n }\n showPagaLink += ` <li class=\"page-item next\">\n <a class=\"page-link\" rel=\"next\" aria-label=\"Next »\">›</a>\n </li>\n </ul>\n </nav>`;\n showHtmlBill(data.bills);\n $(\"#paga-link\").html(showPagaLink);\n let product_page = document.getElementById(\"product_page\");\n let pages = product_page.getElementsByClassName(\"page\");\n for (let i = 0; i < pages.length; i++) {\n pages[i].addEventListener(\"click\", function() {\n $(\"li\").removeClass(\"active\");\n this.className += \" active\";\n const id = $(this).val();\n // console.log(id);\n let page = id;\n $.ajax({\n url: \"../../api/bill/get-ajax-bill-page\",\n method: \"get\",\n data: { search: search, show: show, paga: page },\n success: function(data) {\n console.log(data.skip);\n console.log(data.bills);\n showHtmlBill(data.bills);\n },\n });\n });\n }\n $(\".pre\").click(function() {\n const id = $(\".active\").val();\n const i = id - 2 < 0 ? 0 : id - 2;\n $(\"li\").removeClass(\"active\");\n\n pages[i].className += \" active\";\n\n // console.log(id)\n let page = id - 1;\n $.ajax({\n url: \"../../api/bill/get-ajax-bill-page\",\n method: \"get\",\n data: { search: search, show: show, paga: page },\n success: function(data) {\n console.log(data.skip);\n console.log(data.bills);\n showHtmlBill(data.bills);\n },\n });\n });\n\n $(\".next\").click(function() {\n const id = $(\".active\").val();\n const i = id;\n if (i <= pages.length - 1) {\n $(\"li\").removeClass(\"active\");\n\n pages[i].className += \" active\";\n let page = id + 1;\n // console.log(i);\n $.ajax({\n url: \"../../api/bill/get-ajax-bill-page\",\n method: \"get\",\n data: { search: search, show: show, paga: page },\n success: function(data) {\n console.log(data.skip);\n console.log(data.bills);\n showHtmlBill(data.bills);\n },\n });\n }\n });\n },\n });\n}", "title": "" }, { "docid": "024bd4a7c7f0b9bf36f8ac6a8009c102", "score": "0.62132215", "text": "function globalAjaxRequest(_startIndex,_boolean){\r\n\t\t//set request url\r\n\t\tvar pkSelectFriendUrl=String.format($.pkSelectFriendUrl,$.USERID,$.pageSize,_startIndex,$.gameId);\r\n\t\t//set callback function\r\n\t\tfunction callBack(_xmlHttp){\r\n\t\t\tvar jsonData=$.parse(_xmlHttp.responseText);\r\n\t\t\tif(typeof jsonData == 'object'){\r\n\t\t\t\tvar result=Number(jsonData.result.resultcode);\r\n\t\t\t\tvar mes=jsonData.result.resultmsg;\r\n\t\t\t\tswitch(result){\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t//get json data\r\n\t\t\t\t\t\tif(_boolean){\r\n\t\t\t\t\t\t\ttotalRecord=jsonData.totalRecord;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(totalRecord<=$.pageSize){\r\n\t\t\t\t\t\t\t$.display();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tvar tailEnd=Math.floor(totalRecord/$.pageSize)*$.pageSize;\r\n\t\t\t\t\t\t\t$.pages(globalAjaxRequest,tailEnd);\r\n\t\t\t\t\t\t\t$.style('firstButId',$.startIndex,0);\r\n\t\t\t\t\t\t\t$.style('previousButId',$.startIndex,0);\r\n\t\t\t\t\t\t\t$.style('nextButId',tailEnd,$.startIndex);\r\n\t\t\t\t\t\t\t$.style('tailButId',tailEnd,$.startIndex);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//a tag href attribute and table content\r\n\t\t\t\t\t\t$.text('nowLineFriendId',jsonData.onlineNum,true);\r\n\t\t\t\t\t\tvar detailObj=$.clear('listDetail');\r\n\t\t\t\t\t\tvar dataList=jsonData.pkList;\r\n\t\t\t\t\t\tfor(var i=0; i<$.pageSize; i++){\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tswitch(dataList[i].onlineStatus){\r\n\t\t\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\t\t\tvar online='';\r\n\t\t\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\t\t\tvar online='<p class=\"online online_56\"></p>';\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar dataStr='<div class=\"line_1\"></div>'\r\n\t\t\t\t\t\t\t\t\t\t+'<form id=\"form1\" method=\"post\" action=\"\">'\r\n\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"blohi P_tb_10\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t+'<label for=\"no2\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"float_l P_lr_10\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<table class=\"font_18 color_2 font_w\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<tr>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<td class=\"\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"pos\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<span class=\"head_mask_76c\"></span>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"'+arrayData[i].icon+'\" alt=\"\"/>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</td>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<td class=\"P_l_10 color_2\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<P class=\"font_20 text_hide font_w\">'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+arrayData[i].userName\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</P>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+online\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</td>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</tr>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</table>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t +'</label>'\r\n\t\t\t\t\t\t\t\t\t\t\t\t +'<input id=\"friendCheckbox'+i+'\" type=\"checkbox\" name=\"no2\" id=\"no2\" class=\"float_r m_tr_35\" />'\r\n\t\t\t\t\t\t\t\t\t\t\t +'</div>'\r\n\t\t\t\t\t\t\t\t\t\t+'</form>';\r\n\t\t\t\t\t\t\t\t$.text('listDetail',dataStr,false);\r\n\t\t\t\t\t\t\t}catch(ex){\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\t//a tag onclick event\r\n\t\t\t\t\t\tvar selectAllFirendBut=$.dollar('selectAllFirendId');\r\n\t\t\t\t\t\tselectAllFirendBut.onclick=function(){\r\n\t\t\t\t\t\t\tfor(var j=0; j<$.pageSize; j++){\r\n\t\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\t\tvar checkboxObj=$.dollar('friendCheckbox'+j);\r\n\t\t\t\t\t\t\t\t\tif(checkboxObj.checked!='checked'){\r\n\t\t\t\t\t\t\t\t\t\tcheckboxObj.checked=checked;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}catch(ex){\r\n\t\t\t\t\t\t\t\t\tbreak;\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\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t$.display();\r\n\t\t\t\t\t\t$.prompt(mes)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t$.display();\r\n\t\t\t\t\t\t$.prompt(mes)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$.dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//ajax request\r\n\t\t$.AJAX('GET',pkSelectFriendUrl,callBack,null);\r\n\t}", "title": "" }, { "docid": "4510aead471617934e83d1ba9cd28481", "score": "0.61812264", "text": "function perpagechange(){\r\n\tperpage = $('#perpage').val();\r\n\tstartIndex = ((currentpage-1)*perpage)+1;\r\n\tendIndex = perpage;\r\n\tfilter();\r\n}", "title": "" }, { "docid": "ba60b743ee174e954f6b118f2bdcd0a4", "score": "0.61745065", "text": "function updatePagination(page_size) {\n //show the first page\n var page_number = 0;\n\n var url = clearUrl(window.location.href);\n\n url += \"?page_size=\" + page_size + \"&page_number=\" + page_number;\n\n window.location.href = url;\n}", "title": "" }, { "docid": "92f3db1bfd5e998829d6acac3f29a673", "score": "0.61670816", "text": "function hotn_ajax_request(data) {\n // Set ajax callback to refresh the data and set throbber to load.\n $j('#hotn-child-list').html('<div class=\"throbber\">....</div>');\n $j.ajax({\n type: 'GET',\n url: document.URL,\n data: data,\n success: function (data) {\n // Get the content.\n var $html = $j(data);\n $content = $html.find('#hotn-child-list').html();\n\n // Replace the content.\n $j('#hotn-child-list').html($content);\n\n // Load the pager functionality after ajax request.\n hotn_ajax_pager($hotn_filter_form);\n }\n });\n }", "title": "" }, { "docid": "70792b2cfa24bbb28e1b4f4e1b622ecf", "score": "0.61632496", "text": "function showPagination() {\n var table = '#contact';\n $('.pagination').html('');\n var trnum = 0;\n var maxRows = parseInt($('#maxRows').val());\n var totalRows = $(table + ' tbody tr').length;\n $(table + ' tr:gt(0)').each(function () {\n trnum++;\n if (trnum > maxRows) {\n $(this).hide();\n } else {\n $(this).show();\n }\n });\n if (totalRows > maxRows) {\n var pagenum = Math.ceil(totalRows / maxRows);\n for (var i = 1; i <= pagenum;) {\n $('.pagination').append('<li class =\"page-item\" data-page=\"' + i + '\">\\<a class=\"page-link\">' + i++ + '</a>\\</li>').show();\n }\n }\n $('.pagination li:first-child').addClass('active');\n $('.pagination li').on('click', function () {\n var pageNum = $(this).attr('data-page');\n var trIndex = 0;\n $('.pagination li').removeClass('active');\n $(this).addClass('active');\n $(table + ' tr:gt(0)').each(function () {\n trIndex++;\n if (trIndex > (maxRows * pageNum) || trIndex <= ((maxRows * pageNum) - maxRows)) {\n $(this).hide();\n } else {\n $(this).show();\n }\n })\n })\n}", "title": "" }, { "docid": "3b45417adc2aca01741aff23a2453e87", "score": "0.61425495", "text": "function updatePagination(){\n var itemCount = (_filtered.length > 0) ? _filtered.length : _data.length;\n _totalPages = ( _pageSize > itemCount ) ? 1 : Math.ceil(itemCount / _pageSize);\n _paginationEnd = _totalPages;\n }", "title": "" }, { "docid": "4908970176b60a75b9b3632cec5a0a21", "score": "0.6128557", "text": "function initPaginationSE(pageDiv,total,pageSize,currentPage) {\r\n var num_entries =total;\r\n if(pageSize>=total){currentPage=1;}\r\n // Create pagination element\r\n $(\"#\"+pageDiv).pagination(num_entries, {\r\n num_edge_entries: 2,\r\n num_display_entries: 5,\r\n current_page: currentPage-1,\r\n callback: pageselectCallbackSE,\r\n items_per_page:pageSize,\r\n load_first_page:false,\r\n next_text:\"后一页\",\r\n prev_text:\"前一页\"\r\n });\r\n}", "title": "" }, { "docid": "ba47aa69e5d7f24abf7c88afcfd58ac7", "score": "0.61200076", "text": "function paginateComments() {\n $('#paginationCommentsModeration').find('a').on('click', function(e) {\n e.preventDefault();\n\n var $a = $(this);\n var url = $a.attr('href');\n // récupère l'argument passer en get\n var argGet = url.substring(url.lastIndexOf('?'));\n // récupère la route pour la pagination\n var urlNewRoute = $('.pagination-table-comments-moderation').attr('url');\n // concatene la route et l'argument\n var newUrl = urlNewRoute+argGet;\n $.ajax({\n type: 'GET',\n url: newUrl,\n success: function (data) {\n // recharge le tableau\n $('.pagination-table-comments-moderation').replaceWith(data);\n // réactive les écouteurs\n // removeComment();\n // approuvecomment();\n paginateComments();\n }, error: function() {\n addFlashMsgCommentsModeration('danger', 'Une erreur est survenue')\n }\n })\n });\n }", "title": "" }, { "docid": "85e9eecb67540b5555aba7add7d7e69d", "score": "0.6118659", "text": "function pagination() {\r\n\t \r\n\t \t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t$scope.currentPage = 0;\r\n\t\t\t$scope.totalPages = 0;\r\n\t\t/*\tself.FilterUsers = self.users;*/\r\n\t\t\t$scope.nextDisabled = false;\r\n\t\t\t$scope.previouseDisabled = true;\r\n\t\t\tif(self.FilterUsers.length <= 10 ) {\r\n\t\t\t\t$scope.nextDisabled = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( self.FilterUsers.length < 100 ) {\r\n\t\t\t\t$scope.totalnof_records = self.FilterUsers.length;\r\n\t\t\t\t//findrecord_count();\r\n\t\t\t} else {\r\n\t\t\t\tfindrecord_count();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.log(self.FilterUsers.length);\r\n\t }", "title": "" }, { "docid": "e1e3193ab4a23393dfb656da182604ea", "score": "0.6103852", "text": "function GetByAjaxChange() {\n\n page = 1;\n CallAjax(page);\n}", "title": "" }, { "docid": "dcaa35318bc2b9e80584555d22d5fb4d", "score": "0.60909545", "text": "function generatePaginationMarkup(){\n var i=0;\n var limit=5;\n var data = window.jdata\n\n //calculate the number of pages\n var pages = Math.ceil(data.total / limit);\n window.pages = pages;\n //current page\n var page = window.listing_page;\n\n var markup = \"<ul id=\\\"pagination\\\"><li\";\n if (page === 1)\n markup+= \" class=\\\"disabled\\\"\";\n markup+= \"><a href=\\\"javascript:void(0)\\\" onclick=\\\"gotoPrevPage()\\\">«</a></li>\";\n for (i=1;i<=pages;i++){\n markup+= \"<li\";\n if (i===page)\n markup+= \" class=\\\"active\\\"\";\n markup+=\"><a href=\\\"javascript:void(0)\\\" onclick=\\\"gotoPage(\"+ i.toString() +\")\\\">\"+ i.toString() + \"</a></li>\";\n }\n markup+=\"<li\";\n if (page===pages)\n markup+= \" class=\\\"disabled\\\"\";\n markup+=\"><a href=\\\"javascript:void(0)\\\" onclick=\\\"gotoNextPage()\\\">»</a></li></ul>\";\n return markup;\n}", "title": "" }, { "docid": "15d786f6a095eaf51cae1bae07ee3400", "score": "0.60784566", "text": "function loc_update_pagination(){\n\t$loc('.locator_pages').html('');\n\t$loc('.locator_pages').append('<a class=\"locator_previous\" rel=\"previous\">&#171; Previous '+loc_result_display_limit+'</a> ');\n\t\n\tpages = Math.ceil(loc_search_results.length / loc_result_display_limit);\n\tfor (a=1; a<=pages; a++){\n\t\tpage_class = '';\n\t\tif ((loc_current_page + 1) == a){ page_class = 'class=\"locator_current_page\"'; }\n\t\t$loc('.locator_pages').append(' <a rel=\"'+a+'\" '+page_class+'>'+a+'</a> ');\n\t}\n\t\n\t$loc('.locator_pages').append(' <a class=\"locator_next\" rel=\"next\">Next '+loc_result_display_limit+' &#187;</a>');\n}", "title": "" }, { "docid": "73c5dec2224aaf8ee2fdec09bb20637b", "score": "0.606596", "text": "function pagination() {\n getDogBreedsAPI(0);\n}", "title": "" }, { "docid": "a4de664eb2ecc02ea9810678b901c555", "score": "0.6065587", "text": "function paginadorAjaxAdmin(pagina,order_by,direction,mensaje,archivo_control,modulo,accion,id,option,option2) {\n\n\n \tvar url = archivo_control + \".php\";\n\n \tvar param = {\n\t \t\t\t\tparameters:\"Ajax=true&paginando=true&modulo=\"+modulo+\"&accion=\"+accion+\"&id=\"+id+\"&option=\"+option+\"&option2=\"+option2+\"&pagina=\"+pagina+\"&order_by=\"+order_by+\"&order_direction=\"+direction,\n\t \t\t\t\tonLoading: onMsjUpdate(mensaje, \"resultDatos\")\n\t \t\t\t};\n\n \tvar peticion = new Ajax.Updater(\"resultDatos\",url,param);\n\n}", "title": "" }, { "docid": "689be3679af81abed0ac3cfa50247d0a", "score": "0.6057637", "text": "function searchLikesCustomerCategory(page,showPageSize,searchData){\n\n $.ajax({\n url: './likes/searchLikesCustomer/' + searchData + \"/\" + (page-1) + \"/\" + showPageSize,\n type: 'get',\n dataType: \"json\",\n contentType : 'application/json; charset=utf-8',\n success: function (data) {\n //console.log(\"Data result \" + JSON.stringify(data))\n createRowData(data)\n dynamicPagination(data.totalPage,showPageSize)\n },\n error: function (err) {\n Swal.fire({\n title: \"Error!\",\n text: \"An error occurred during the operation!\",\n icon: \"error\",\n customClass: {\n confirmButton: 'btn btn-primary'\n },\n buttonsStyling: false\n });\n console.log(err)\n }\n })\n}", "title": "" }, { "docid": "6ece04c387ee24344eea806ce77ea8fc", "score": "0.6055315", "text": "function setPagination() {\n let nrPages = parseInt($('#pagination').attr('data-nr_pages'));\n if (nrPages == 0) {\n return;\n }\n\n $('#pagination').twbsPagination({\n totalPages: nrPages,\n visiblePages: 7,\n onPageClick: function(event, page) {\n $('#pagination').attr('data-curr_page', page);\n showAuctionsOfAPage(page);\n },\n });\n}", "title": "" }, { "docid": "bda3f1b9bbd0c6bbf8bbbf1833355701", "score": "0.60490835", "text": "function startSearch() {\n \n /* make sure the page number is valid and within range */\n var pages = getPageNumber();\n\n /* send 1 through user number of pages to AJAX function */\n for (var i = 1; i <= pages; i++) {\n search(i); \n }\n}", "title": "" }, { "docid": "062f72fefa22832ae13ddcd60aea3b61", "score": "0.6034991", "text": "function core_getposts(pageNum, max, nextLink, count) {\n\n\t \tif(typeof core != 'undefined') {\n\n\t\t \tjQuery('#load-more.disabled').click(function() { return false; });\n\n\t\t\tif(!pageNum) {\n\t\t\t\t// The number of the next page to load (/page/x/).\n\t\t\t\tvar pageNum = parseInt(core.startPage) + 1;\n\t\t\t}\n\n\t\t\tif(!max) {\n\t\t\t\t// The maximum number of pages the current query can return.\n\t\t\t\tvar max = parseInt(core.maxPages);\n\t\t\t}\n\n\t\t\tif(!nextLink) {\n\t\t\t\t// The link of the next page of posts.\n\t\t\t\tvar nextLink = core.nextLink;\n\t\t\t}\n\n\t\t\tif(!count) {\n\t\t\t\tvar count = parseInt(jQuery('.count').text());\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Replace the traditional navigation with our own,\n\t\t\t * but only if there is at least one page of new posts to load.\n\t\t\t */\n\t\t\t\n\t\t\t\n\t\t\t//debug\n\t\t\t\t//console.log('DEBUG INFO...');\n\t\t\t\t//console.log('The Next Link Number '+ nextLink);\n\t\t\t\t//console.log('The Max Number of Pages '+ max);\n\t\t\t\t//console.log('The Current Page Num '+ pageNum);\n\t\t\t\n\t\t\tif(pageNum <= max) {\n\t\t\t\t\n\n\t\t\t\t// Remove the traditional navigation.\n\t\t\t\tjQuery('.navigation').remove();\n\n\t\t\t} else {\n\n\t\t\t\tjQuery('#load-more').addClass('disabled');\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Load new posts when the link is clicked.\n\t\t\t */\n\t\t\tjQuery('#load-more').not('.disabled').click(function() {\n\n\t\t\t\t//debug\n\t\t\t\tconsole.log('DEBUG INFO...');\n\t\t\t\tconsole.log('The Next Link Number '+ nextLink);\n\t\t\t\tconsole.log('The Max Number of Pages '+ max);\n\t\t\t\tconsole.log('The Current Page Num '+ pageNum);\n\n\t\t\t\t//jQuery(this).unbind('click', core_getposts());\n\n\t\t\t\t// Are there more posts to load?\n\t\t\t\tif(pageNum <= max) {\n\t\t\t\t\t\n\t\t\t\t\tjQuery('#load-more')\n\t\t\t\t\t\t\t.before('<div id=\"ajax-container-new-'+ pageNum + '\"class=\"row\"></div>');\n\n\t\t\t\t\t// Show that we're working.\n\t\t\t\t\tjQuery('.load-more-text').text('Loading...');\n\t\t\t\t\t\n\n\t\t\t\t\tjQuery('#ajax-container-new-'+pageNum).load(nextLink + ' .post-item',\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t$( this ).hide().fadeIn(500);\n\n\t\t\t\t\t\t\t\t\t// Update page number and nextLink.\n\t\t\t\t\t\t\t\t\tpageNum++;\n\t\t\t\t\t\t\t\t\tnextLink = nextLink.replace(/\\/page\\/[0-9]?/, '/page/'+ pageNum);\n\t\t\t\t\t\t\t\t\tjQuery('#load-more')\n\t\t\t\t\t\t\t\t\t\t.before('<div id=\"ajax-container-new-'+pageNum+ '\"class=\"row\"></div>');\n\t\t\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\t\t// Update the button message.\n\t\t\t\t\t\t\t\t\tif(pageNum <= max) {\n\n\t\t\t\t\t\t\t\t\t\tjQuery('.load-more-text').text('Click here to load more');\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\t\t\t\t\tjQuery('.load-more-text').text('No more itens to show');\n\n\t\t\t\t\t\t\t\t\t}\n \n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t});\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "2838d49c8bfe0194c37a29b8b2a15e08", "score": "0.60075045", "text": "function paginateCategories() {\n $('#paginationCategories').find('a').on('click', function(e) {\n e.preventDefault();\n\n var $a = $(this);\n var url = $a.attr('href');\n // récupère l'argument passer en get\n var argGet = url.substring(url.lastIndexOf('?'));\n // récupère la route pour la pagination\n var urlNewRoute = $('.pagination-table-categories').attr('url');\n // concatene la route et l'argument\n var newUrl = urlNewRoute+argGet;\n $.ajax({\n type: 'GET',\n url: newUrl,\n success: function (data) {\n // recharge le tableau\n $('.pagination-table-categories').replaceWith(data);\n // réactive les écouteurs\n removeCategory();\n editCategory();\n paginateCategories();\n }, error: function() {\n addFlashMsgManageCategories('danger', 'Une erreur est survenue')\n }\n })\n });\n }", "title": "" }, { "docid": "c2c9e08d74f544bfbfe3963567629316", "score": "0.6006078", "text": "function bindPaginationControl(){\n $(\"#pagNext\").on('click',function(e){\n page=page+1;\n showResults(page,records);\n });\n $(\"#pagPrev\").on('click',function(e){\n page=page-1;\n showResults(page,records);\n });\n $(\"#pagFirst\").on('click',function(){\n page=1;\n showResults(page,records);\n })\n $(\"#pagLast\").on('click',function(){\n page=totalPages;\n showResults(page,records);\n })\n}", "title": "" }, { "docid": "4bdc1fdf83af3cc20677343d52cc7dbe", "score": "0.59999835", "text": "function pagination(){\n if($scope.config.rowsPerPage){\n var showBetween = $scope._tAVars.currentPage * $scope.config.rowsPerPage;\n if($scope.$index < showBetween-$scope.config.rowsPerPage || $scope.$index >= showBetween){\n $elem.addClass('hidden');\n }else{\n $elem.removeClass('hidden');\n }\n }\n\n if($scope._tAVars.currentPage * $scope.config.rowsPerPage > $scope.config._tBodyClone.length + $scope.config.rowsPerPage){\n $scope._tAVars.currentPage = 1;\n }\n }", "title": "" }, { "docid": "41672e7c747e944b6151307784e55895", "score": "0.59988075", "text": "function handlePagination(id){\r\n\tvar links = $(\"#projectList .pagination .paging\");\r\n\tid = parseInt(id);\r\n\tvar i =1;\r\n\tvar start,end =0;\r\n\tif(id%maxPaginationLinks ==0){\r\n\t\tstart = id -maxPaginationLinks+1;\r\n\t\tend = id;\r\n\t}\r\n\telse{\r\n\t\tstart = id;\r\n\t\tend = id+maxPaginationLinks-1;\r\n\t}\r\n\tlinks.each(function(){\r\n\t\tvar link =$(this);\r\n\t\tif (i>=start && i <=end){\r\n\t\t\tlink.show();\r\n\t\t}else{\r\n\t\t\tlink.hide();\r\n\t\t}\r\n\t\t\t\r\n\t\ti=i+1;\r\n\t});\r\n}", "title": "" }, { "docid": "f8338d4daa0ca894fedc6633056ae244", "score": "0.5997612", "text": "function setUpPagination ($numPerPage) {\r\n if($numPerPage == \"DISPLAY\") {\r\n $perPage = rows.length;\r\n $numPages = 1;\r\n } else {\r\n\t $perPage = $numPerPage;\r\n\t $numPages = Math.ceil(rows.length / $perPage);\r\n }\r\n setPageNumbers($numPages);\r\n\tshowPagination(0);\r\n}", "title": "" }, { "docid": "4d49a5ce2372fe684fef748f0017d61e", "score": "0.59971386", "text": "function pag() {\n $('.pagination').html('')\n var table = '#listCertificationTable';\n var trnum = 0;\n var maxRows = 5;\n var totalRows = $('#listCertificationTable tbody tr').length;\n //console.log(totalRows);\n $(table + ' tr:gt(0)').each(function () {\n trnum++\n if (trnum > maxRows) {\n $(this).hide()\n }\n if (trnum <= maxRows) {\n $(this).show()\n }\n })\n if (totalRows > maxRows) {\n var pagenum = Math.ceil(totalRows / maxRows)\n for (var i = 1; i <= pagenum;) {\n $('.pagination').append('<li data-page=\"' + i + '\">\\<span>' + i++ + '<span class=\"sr-only\">(current)</span> </span>\\ </li>').show()\n }\n }\n $('.pagination li:first-child').addClass('active')\n $('.pagination li').on('click', function () {\n var pageNum = $(this).attr('data-page')\n var trIndex = 0\n $('.pagination li').removeClass('active')\n $(this).addClass('active')\n $(table + ' tr:gt(0)').each(function () {\n trIndex++\n if (trIndex > (maxRows * pageNum) || trIndex <= ((maxRows * pageNum) - maxRows)) {\n $(this).hide()\n } else {\n $(this).show()\n }\n })\n })\n}", "title": "" }, { "docid": "ee0241d0a9e64f845aae5e253335b7ea", "score": "0.5995991", "text": "function setPagination() {\n let nrPages = parseInt($('#pagination').attr('data-nr_pages'));\n if (nrPages == 0)\n return;\n\n $('#pagination').twbsPagination({\n totalPages: nrPages,\n visiblePages: 7,\n onPageClick: function(event, page) {\n $('#pagination').attr('data-curr_page', page);\n showAuctionsOfAPage(page);\n window.scrollTo(0, 0);\n },\n });\n}", "title": "" }, { "docid": "3c75227c7446547f90a112ecc1071826", "score": "0.59935355", "text": "function initialSetupPagination() {\n $(\".pagination\").css(\"display\", \"block\");\n var numPages = Math.ceil(searchResult.length / amount);\n\n var pagesDynamic = $(\"#pages\");\n pagesDynamic.empty();\n for (var i = 0; i < numPages; i++) {\n var pagIcon = $(\"<li class = 'wave-effect'><a href = '#'></a></li>\");\n pagIcon.children(\"a\").text(i + 1);\n pagIcon.attr(\"data-index\", i * 6);\n if (i == 0) {\n pagIcon.removeClass(\"wave-effect\");\n pagIcon.addClass(\"active\");\n }\n pagesDynamic.append(pagIcon);\n }\n if ($(\"#pages li\").length > 1) {\n console.log(\"Greater\")\n $(\"#pag-next\").removeClass(\"disabled\");\n }\n var dataLength = amount;\n if (searchResult.length < amount) {\n dataLength = searchResult.length;\n }\n generateItems(0, dataLength);\n}", "title": "" }, { "docid": "dd9822ee51a8eafa64b6d89a773ff3f5", "score": "0.5989108", "text": "function searchGeneral(target) {\n var search = $(\"#sResult\").val();\n var post_per_page = 20;\n\n var accion = \"searchGeneralResult\";\n //console.log(search,target,post_per_page);\n $(\"#searchGeneral\").html('');\n\n $.ajax({\n type: \"POST\",\n url: $(\"#ajax_url\").val(),\n data: {\n action: accion,\n search: search,\n target: target,\n post_per_page: post_per_page\n },\n beforeSend: function () {\n var section = '';\n section += '<section class=\"vPadding-20 vMarginTop-35 vMarginBottom-35\">'\n section += '<tr>'\n section += '<td colspan=\"3\" style=\"width:770px;\">'\n section += '<div id=\"cargandoajax\" style=\"text-align:center;\">'\n section += '<p style=\"padding:0px\"><img src=\"' + $(\"#template_url\").val() + '/images/gif-load.gif\" alt=\"loading\"/></p>'\n section += '<p style=\"padding:0px\">cargando...</p>'\n section += '</div>'\n section += '</td>'\n section += '</tr>'\n section += '</section> ';\n $(\"#searchGeneral\").html('');\n $(\"#searchGeneral\").html(section);\n },\n error: function (jqXHR, textStatus, errorThrown) {\n alert(jqXHR + \"--\" + textStatus + \"--\" + errorThrown);\n },\n success: function (resp) {\n $(\"#searchGeneral\").html('');\n $(\"#searchGeneral\").html(resp);\n }\n });\n}", "title": "" }, { "docid": "b4b6a967ecbfcf85eb43a944e4f1c2dd", "score": "0.59850353", "text": "function LeerPolizasByNIF()\n{\n var pag=window.pagina;\n var tama=window.pagsize;\n \n var url='AjaxPolizas.servlet';\n var dataToSend='accion=PolizasByNIF&pagina='+pag +'&size='+tama;\n var conn = new Conectar(url, dataToSend);\n \n conn.pageRequest.onreadystatechange = function() { ListaPolizas(conn.pageRequest); };\n\n conn.Enviar();\n \n return conn;\n}", "title": "" }, { "docid": "10e376d1b3b89811dae66a0ba966044f", "score": "0.59822255", "text": "function updatePagination(){ctrl.maxTabWidth=getMaxTabWidth();ctrl.shouldPaginate=shouldPaginate();}", "title": "" }, { "docid": "9cdfa4d0af976a6e97bf487216ed3a44", "score": "0.5967667", "text": "function ListProductWithAjax(current_page){\n\t\t\t\tconsole.log(current_page + \"= crnt pg\");\n\t\t\t\t$.ajax({\n\t\t\t\t type: \"POST\",\n\t\t\t\t url: './list_product',\n\t\t\t\t data: {page_no : current_page},\n\t\t\t\t headers :{\n\t\t\t\t \t Accept : \" application/json; charset=utf-8\"\n\t\t\t\t },\n\t\t\t\t\t cache: false,\n\t\t\t\t beforeSend: function(){$('.loadingDiv').show();},\n\t\t\t\t success: function(data) {\n\t\t\t\t \t //console.log(data);\n\t\t\t\t \t if(data == \"empty table\"){\n\t\t\t\t\t \t \n\t\t\t\t\t \t $(\"#footer\").html(\"\");\n\t\t\t\t\t \t $(\"#cat_table\").html(\"<h5> No records to display </h5>\");\n\t\t\t\t\t \n\t\t\t\t \t}else if(data == \"fail\"){\n\t\t\t\t \t\t $('#errorMessage').text(\"fail from ListBrandWithAjax !\");\n\t\t\t\t \t $('#success_alert').hide();\n\t\t\t\t\t $('#error_alert').show();\n\t\t\t\t \t}else{\n\t\t\t\t \t\tvar result = $.parseJSON(data);\n\t\t\t\t\t \t $(\"#footer\").html(result.paginations);\n\t\t\t\t\t \t $(\"#prod_tbl\").html(result.tbody);\n\t\t\t\t \t}\n\t\t\t\t \t $('.loadingDiv').hide();\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "c364e0dfa178ad0e2768d0d5a4fae35a", "score": "0.59672236", "text": "function paginate() {\n\n scope.pagination = [];\n\n var index = 0;\n for (var i = 0; i < n; i += scope.interval) {\n var page = {};\n page.begin = i;\n page.end = i + scope.interval;\n page.index = index++;\n\n scope.pagination.push(page);\n }\n\n controlify();\n\n process(scope.current.page);\n }", "title": "" }, { "docid": "917339beb3a09f210e0be032cc45bd3e", "score": "0.59548205", "text": "function paginationClick(page) {\n driver(resource, searchParams, page);\n}", "title": "" }, { "docid": "5f1d08a8323960391727e9cbc265fd00", "score": "0.5953493", "text": "function paginationSetting() {\n\t$('#corpus-tab-page-list-block').pagination({\n\t\tdataSource: _data,\n\t\tpageSize: 1,\n\t\tshowGoInput: true,\n\t\tshowGoButton: true,\n\t\tformatGoInput: 'go to the <%= input %> th document',\n\t\t\n\t\tcallback: function($data, $pagination) {\n\t\t\t$(\"#corpus-tab-corpus-name\").html($data[0].metadata.corpus);\n\t\t\t$(\"#corpus-tab-current-doc-name\").html($data[0].metadata.filename);\n\t\t\t$(\"#corpus-tab-current-doc-content\").html($data[0].fulltext.replace(/\\n/g, '<br>'));\n\t\t}\n\t});\n}", "title": "" }, { "docid": "69f020cdfb7b042060a5473824f93252", "score": "0.5950756", "text": "_page (page, size) {\n this.debugMessage(`page(${this.url}) requesting from api`)\n return this._request(`${this.url}?page=${page}&page_size=${size}`)\n }", "title": "" }, { "docid": "736429c031287c2524cb3421fae472fc", "score": "0.5945475", "text": "function handlePagination({ url }) {\n fetchData({ query: filter, url });\n }", "title": "" }, { "docid": "ff5b5c9c1108f62ca274f89bfce1ed1e", "score": "0.59335643", "text": "function getRecords( statObj, paging )\r\n{\r\n var controller = statObj.parent().parent().attr('id');\r\n if(statObj.attr(\"class\") == 'active')\r\n {\r\n statObj.removeClass('active');\r\n statObj.addClass('folder');\r\n $(\"#\" + controller + \" .listFilter > *\").remove();\r\n $(\"#\" + controller + \" .listContent > *\").remove();\r\n }else{\r\n statObj.removeClass('folder');\r\n statObj.addClass('active');\r\n\r\n $.ajax({\r\n type: 'GET',\r\n dataType: 'script',\r\n url: '/admin/' + controller,\r\n error: function(msg) { alert(\"Chyba v přenosu dat.\"); },\r\n success: function(data, status) {\r\n if( paging == 'yes' )\r\n {\r\n $(\"div[id='\" + controller + \"'] .pagination a\").live(\"click\", function() { \r\n $(\"#\" + controller + \" .listFilter > *\").remove();\r\n $(\"#\" + controller + \" .listContent > *\").remove();\r\n $.get(this.href, null, function(data){}, \"script\");\r\n return false;\r\n });\r\n } \r\n }\r\n });\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "01cccfe68f0735f84264401e38d0c5cb", "score": "0.5931533", "text": "function _fnFeatureHtmlPaginate(e){\n// EllisLab edit\nvar a=document.getElementById(\"filter_pagination\");\n//var nPaginate = document.createElement( 'div' );\n/* Add a draw callback for the pagination on first instance, to update the paging display */\nreturn a.className=e.oClasses.sPaging+e.sPaginationType,_oExt.oPagination[e.sPaginationType].fnInit(e,a,function(e){_fnCalculateEnd(e),_fnDraw(e)}),\"undefined\"==typeof e.aanFeatures.p&&e.aoDrawCallback.push({fn:function(e){_oExt.oPagination[e.sPaginationType].fnUpdate(e,function(e){_fnCalculateEnd(e),_fnDraw(e)})},sName:\"pagination\"}),a}", "title": "" }, { "docid": "6c7fe9bde635afbd097df2df3ad57fbe", "score": "0.5928942", "text": "function onPageChangePerPageRes(){\n\t\tvar pageNumber = $('#pageNumber').val();\n\t\tvar viewPerPage = $('#viewPerPage').val();\n\t\t\n\t\tdisablePaginationContent();\n\t\t\n\t\t$('#dataGrid').append('<div class=\"preloader\"></div>').show();\n\t\t\n\t\tif(!$('#filterInputResourceID').is(':visible'))\n\t\tsearchResourceListParam.resourceId = null;\n\t\t\n\t\tif(!$('#filterInputClass').is(':visible'))\n\t\tsearchResourceListParam.resourceClass = null;\n\t\t\n\t\tif(!$('#filterInputFeatures').is(':visible'))\n\t\tsearchResourceListParam.features = null;\n\t\t\n\t\t//Created for sending data of narrow search- abhinavr - 4/29/14\n\n\t\tif(filterResourceListParam.resourceState != 'null')\n\t\t{\n\t\t\tfilterResourceListParam.resourceState = $('#resourceState').val();\n\t\t}\n\t\t//filterResourceListParam.resourceState = $('#resourceState').val();\n\t\tif(filterResourceListParam.processorFrom != '0')\n\t\t{\n\t\t\tfilterResourceListParam.processorFrom = $('#procsFrom').val();\n\t\t}\n\t\tif(filterResourceListParam.processorTo != '0')\n\t\t{\n\t\t\tfilterResourceListParam.processorTo = $('#procsTo').val();\n\t\t}\n\t\tif(filterResourceListParam.jobsFrom != '0')\n\t\t{\n\t\t\tfilterResourceListParam.jobsFrom = $('#jobsFrom').val();\n\t\t}\n\t\tif(filterResourceListParam.jobsTo != '0')\n\t\t{\n\t\t\tfilterResourceListParam.jobsTo = $('#jobsTo').val();\n\t\t}\n\t\tif(filterResourceListParam.cpuUtilizationFrom != '0')\n\t\t{\n\t\t\tfilterResourceListParam.cpuUtilizationFrom = $('#proc_utilFrom').val();\n\t\t}\n\t\tif(filterResourceListParam.cpuUtilizationTo != '0')\n\t\t{\n\t\t\tfilterResourceListParam.cpuUtilizationTo = $('#proc_utilTo').val();\n\t\t}\n\t\tif(filterResourceListParam.memoryUtilizationFrom != '0')\n\t\t{\n\t\t\tfilterResourceListParam.memoryUtilizationFrom = $('#memory_utilFrom').val();\n\t\t}\n\t\tif(filterResourceListParam.memoryUtilizationTo != '0')\n\t\t{\n\t\t\tfilterResourceListParam.memoryUtilizationTo = $('#memory_utilTo').val();\n\t\t}\n\n\t\t//Ends\n\t\t\n\t\t$.ajax({\n\t\t\turl:'/node_table/',\n\t\t\ttype:'GET',\n\t\t\tdata:{max:viewPerPage, offset:pageNumber,\n\t\t\t//Created for sending data of narrow search- abhinavr - 4/29/14\n\t\t\tsort_parameter:persistedResSortingState.colname,\n\t\t\tsortState:persistedResSortingState.sortState,\n\t\t\tname:searchResourceListParam.resourceId,\n\t\t\tclasses:searchResourceListParam.resourceClass,\n\t\t\tfeatures:searchResourceListParam.features,\n\t\t\tstate:filterResourceListParam.resourceState,\n\t\t\tprocsFrom:filterResourceListParam.processorFrom,\n\t\t\tprocsTo:filterResourceListParam.processorTo,\n\t\t\tjobsFrom:filterResourceListParam.jobsFrom,\n\t\t\tjobsTo:filterResourceListParam.jobsTo,\n\t\t\tproc_utilFrom:filterResourceListParam.cpuUtilizationFrom,\n\t\t\tproc_utilTo:filterResourceListParam.cpuUtilizationTo,\n\t\t\tmemory_utilFrom:filterResourceListParam.memoryUtilizationFrom,\n\t\t\tmemory_utilTo:filterResourceListParam.memoryUtilizationTo,\n\t\t\t//ends\n\t\t\t},\n\t\t\tsuccess:function(result){\n\t\t\t\t\t$('#dataGrid .preloader').hide();\n\t\t\t\t\t$('#dataGrid').html(result);\n\t\t\t\t\t$('#pageNumber').children('option').eq(pageNumber-1).attr('selected',true);\n\t\t\t\t\t\n\t\t\t\t\t$('#viewPerPage').val(viewPerPage);\n\t\t\t\t\tdisablePaginationContent();\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "663d558d4a3213426b2b419772a0d359", "score": "0.59283257", "text": "function searchWithPagination(page_number, search){\n\t// Ubah text tombol search menjadi SEARCHING... \n\t// Dan tambahkan atribut disable pada tombol nya agar tidak bisa diklik lagi\n\t$(this).html(\"SEARCHING...\").attr(\"disabled\", \"disabled\");\n\t\n\t$.ajax({\n\t\turl: 'search.php', // File tujuan\n\t\ttype: 'POST', // Tentukan type nya POST atau GET\n\t\tdata: {keyword: $(\"#keyword\").val(), page: page_number, search: search}, // Set data yang akan dikirim\n\t\tdataType: \"json\",\n\t\tbeforeSend: function(e) {\n\t\t\tif(e && e.overrideMimeType) {\n\t\t\t\te.overrideMimeType(\"application/json;charset=UTF-8\");\n\t\t\t}\n\t\t},\n\t\tsuccess: function(response){ // Ketika proses pengiriman berhasil\n\t\t\t// Ubah kembali text button search menjadi SEARCH\n\t\t\t// Dan hapus atribut disabled untuk meng-enable kembali button search nya\n\t\t\t$(\"#btn-search\").html(\"SEARCH\").removeAttr(\"disabled\");\n\t\t\t\n\t\t\t// Ganti isi dari div view dengan view yang diambil dari search.php\n\t\t\t$(\"#view\").html(response.hasil);\n\t\t},\n\t\terror: function (xhr, ajaxOptions, thrownError) { // Ketika terjadi error\n\t\t\talert(xhr.responseText); // munculkan alert\n\t\t}\n\t});\n}", "title": "" }, { "docid": "01e28c901ed3c83cef1e8e6e60526143", "score": "0.5924239", "text": "function gfn_renderPaging(params){\n\t\n\tvar divId = params.divId; //div id for page\n\tgfv_pageIndex = params.pageIndex; //save current page index to global variable\n\tvar totalCount = params.totalCount; //total search count from database\n\tvar pageGroupCount = params.pageGroupCount; //page group count that is number of showing page\n\tvar pageGroupPrev = pageGroupCount - 1;\n\tvar currentIndex = params.pageIndex; //current page\n\n\tif(gfn_isNull(currentIndex) == true){\n\t\tcurrentIndex = 1;\n\t}\n\t\n\tvar recordCount = params.recordCount; //The row count a page\n\tif(gfn_isNull(recordCount) == true){\n\t\trecordCount = 20;\n\t}\n\tvar totalIndexCount = Math.ceil(totalCount / recordCount); // total index count\n\tgfv_eventName = params.eventName;\n\t\n\t$(\"#\"+divId).empty();\n\tvar preStr = \"\";\n\tvar postStr = \"\";\n\tvar str = \"\";\n\tvar totalStr = \"\";\n\t\n\tvar first = (parseInt((currentIndex-1) / pageGroupCount) * pageGroupCount) + 1;\n\tvar last = (parseInt(totalIndexCount/pageGroupCount) == parseInt((currentIndex-1)/pageGroupCount)) ? totalIndexCount%pageGroupCount : pageGroupCount;\n\tvar prev = (parseInt((currentIndex-1)/pageGroupCount)*pageGroupCount) - pageGroupPrev > 0 ? (parseInt((currentIndex-1)/pageGroupCount)*pageGroupCount) - pageGroupPrev : 1; \n\tvar next = (parseInt((currentIndex-1)/pageGroupCount)+1) * pageGroupCount + 1 < totalIndexCount ? (parseInt((currentIndex-1)/pageGroupCount)+1) * pageGroupCount + 1 : totalIndexCount;\n\t\n\tif(totalIndexCount > pageGroupCount){ //If total index is more than page group count, create tag for the first and the last\n\t\tpreStr += \"<li class='page_btn befor_prev'>\"\n\t\tpreStr += \"<a href='javascript:;' onclick='_movePage(1)'><i class='fa fa-angle-double-left'></i></a>\"\n\t\tpreStr += \"</li>\"\n\t\tpreStr += \"<li class='page_btn prev'>\"\n\t\tpreStr += \"<a href='javascript:;' onclick='_movePage(\"+prev+\")'><i class='fa fa-angle-left\t'></i></a>\";\n\t\tpreStr += \"</li>\"\n\t}\n\telse if(totalIndexCount <=pageGroupCount && totalIndexCount > 1){ //If total index is less than page group count, crete tag for previous\n\t\tpreStr += \"<li class='page_btn befor_prev'>\"\n\t\tpreStr += \"<a href='javascript:;' onclick='_movePage(1)'><i class='fa fa-angle-double-left'></i></a>\";\n\t\tpreStr += \"</li>\"\n\t}\n\t\n\tif(totalIndexCount > pageGroupCount){ //If total index more tha page groucount, create tag for next tag\n\t\tpostStr += \"<li class='page_btn next'>\";\n\t\tpostStr += \"<a href='javascript:;' onclick='_movePage(\"+next+\")'><i class='fa fa-angle-right'></i></a>\";\n\t\tpostStr += \"</li>\"\n\t\tpostStr += \"<li class='page_btn after_next'>\";\n\t\tpostStr += \"<a href='javascript:;' onclick='_movePage(\"+totalIndexCount+\")'><i class='fa fa-angle-double-right'></i></a>\";\n\t\tpostStr += \"</li>\";\n\t}\n\telse if(totalIndexCount <=pageGroupCount && totalIndexCount > 1){ //If total index less than page group count, create tag next\n\t\tpostStr += \"<li class='page_btn after_next'>\";\n\t\tpostStr += \"<a href='javascript:;' onclick='_movePage(\"+totalIndexCount+\")'><i class='fa fa-angle-double-right'></i></a>\";\n\t\tpostStr += \"</li>\";\n\t}\n\t\n\tfor(var i=first; i<(first+last); i++){\n\t\t\n\t\tif(i != currentIndex){\n\t\t\tstr += \"<li class='page_list'>\";\n\t\t\tstr += \"<a href='javascript:;' onclick='_movePage(\"+i+\")'>\"+i+\"</a>\";\n\t\t\tstr += \"</li>\";\n\t\t}\n\t\telse{\n\t\t\tstr += \"<li class='page_list active'>\";\n\t\t\tstr += \"<a href='javascript:;' onclick='_movePage(\"+i+\")'>\"+i+\"</a>\";\n\t\t\tstr += \"</li>\";\n\t\t}\n\t}\n\t\n\ttotalStr = \"<div class='total_num'>\"+_Total+\" : \" + totalCount + \"</div>\";\n\t\n\t$(\"#\"+divId).append(\"<ul>\" + preStr + str + postStr + \"</ul>\");\n\t$(\"#\"+divId).append(totalStr);\n}", "title": "" }, { "docid": "083ee1ef6ab10f0431ac13e5d97de055", "score": "0.5914122", "text": "function _getUserPerPage(page,size){\n\t $http({\n method: 'GET', \n url:'/users/pagination?page='+page+'&size='+size\n }).then(\n function(res){\n \t $scope.employees=res.data;\n }, \n function(res){\n console.log(\"Error: \"+res.status+\": \"+res.data);\n }\n )\n }", "title": "" }, { "docid": "25a90d5145359bf7098362dd7e790753", "score": "0.5902698", "text": "function searchProductCategory(page,showPageSize,searchData){\n\n $.ajax({\n url: './product/searchProductCategory/' + searchData + \"/\" + (page-1) + \"/\" + showPageSize,\n type: 'get',\n dataType: \"json\",\n contentType : 'application/json; charset=utf-8',\n success: function (data) {\n //console.log(\"Data result \" + JSON.stringify(data))\n createRowData(data)\n dynamicPagination(data.totalPage,showPageSize)\n },\n error: function (err) {\n Swal.fire({\n title: \"Error!\",\n text: \"An error occurred during the operation!\",\n icon: \"error\",\n customClass: {\n confirmButton: 'btn btn-primary'\n },\n buttonsStyling: false\n });\n console.log(err)\n }\n })\n}", "title": "" }, { "docid": "b030baa7298639aabeb5769ccb5c93c4", "score": "0.5898691", "text": "function loadPage(numpage, callback) {\n // load\n //config.dataSource = [];\n let urlPost = config.connector.serverPath + config.connector.source.serviceName;\n let urlData = { pagesize: config.pageSize, currentpage: numpage };\n // parametri custom\n if (config.connector.source.customData) {\n $.each(config.connector.source.customData, (i, v) => urlData[v[\"name\"]] = v[\"val\"]);\n }\n // carico la pagina passata\n $.post(urlPost, urlData, function (data) {\n $.each(data, (i, el) => config.dataSource.push(el));\n // scateno evento onbind prima di costruire la griglia\n $.each(config.dataSource, function (index, value) { config.onbind(config.dataSource[index]); });\n\n //console.info(config.dataSource);\n if (numpage == 1) {\n status.fullLoaded = false;\n dataBind(status.currentPage);\n addRowEvents();\n }\n //console.info(status.pages);\n status.pages[parseInt(numpage) - 1].status = \"loaded\";\n\n // carico tutte le altre pagine in background\n \n if (numpage < status.totalPages) {\n\n loadPage(numpage + 1);\n }\n else {\n \n status.fullLoaded = true;\n buildPaginator();\n addPaginatorEvents();\n }\n \n })\n\n\n }", "title": "" }, { "docid": "e1dc14195b3ee1434cbf831cf9cac2f1", "score": "0.58909714", "text": "function loadPage(page) {\n\n var url = 'players';\n if(page) url = url + '?page=' + page;\n\n $.ajax({\n type: \"GET\",\n url: url,\n success: function (response) {\n var target = $('#target');\n\n for (i = 0; i < response.data.length; ++i) {\n target.append(dataTemplate.render(response.data[i]));\n }\n\n\n var options = {\n currentPage: response.current_page,\n totalPages: response.last_page,\n bootstrapMajorVersion:3,\n onPageClicked: function (e, originalEvent, type, page) {\n target.empty()\n loadPage(page);\n }\n }\n\n $('#page').bootstrapPaginator(options);\n }\n });\n}", "title": "" }, { "docid": "c94b3a1bd802ec9f1f3085f6266ab909", "score": "0.58802885", "text": "function paging(thisPage, thisPageNum, name, rstb, rste, rsnb, rsne, np, nv, ne) {\n $.ajax({\n type: 'POST',\n url: url + 'doNotNeedSecurity_findByCondition.action',\n dataType: 'json',\n data: {\n page: thisPage || arg || 1, // 当前第几页\n rows: thisPageNum || 10, // 当前页数量\n name: name,\n returnSchoolTimeBegin: rstb,\n returnSchoolTimeEnd: rste,\n returnSchoolNumberBegin: rsnb,\n returnSchoolNumberEnd: rsne,\n isNeedPlace: np,\n isNeedVisit: nv,\n isNeedEat: ne\n },\n success: function (data) {\n // console.log(data.data)\n that.tableData = data.data.rows\n // console.log(that.tableData)\n $('.loading').removeClass('loading').hide()\n // 表格渲染\n table.render({\n elem: '#userTable'\n ,id: 'userTable'\n // ,height: 500\n // ,url: 'http://www.layui.com/demo/table/user/' //数据接口\n ,data: that.tableData\n ,limit : thisPageNum || 10\n // ,page: {\n // limit: 5,\n // loading: true\n // } //开启分页\n ,cols: [[ //表头\n {field: 'name', title: '联系人', width: 100, align: 'center'}\n ,{field: 'phone', title: '联系电话', width: 200, align: 'center'}\n ,{field: 'returnSchoolTime', title: '返校时间', sort: true, align: 'center'}\n ,{field: 'returnNumber', title: '返校人数', align: 'center'}\n ,{field: 'schoolClass', title: '所在班级', align: 'center'}\n ,{field: 'isNeedPlace', title: '是否需要聚会场地', align: 'center'}\n ,{field: 'isNeedVisit', title: '是否需要参观', align: 'center'}\n ,{field: 'isNeedEat', title: '是否在校就餐', align: 'center'}\n ,{field: 'remark', title: '备注', align: 'center'}\n ,{field: 'edit', title: '操作', toolbar: '#barUserEdit', align: 'center', width: 300}\n ]]\n ,text: {\n none: '暂无相关数据'\n }\n })\n\n /*分页*/\n laypage.render({\n elem: 'pageDiv' //\n ,count: data.data.total //数据总数,从服务端得到\n ,limit: thisPageNum || 10 // 每页显示的条数\n ,curr: thisPage || 1\n ,limits: [10, 20, 30, 40, 50]\n ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']\n // ,curr: location.hash.replace('#!page=', '')\n // ,hash: 'page'\n ,jump: function(obj, first){\n //obj包含了当前分页的所有参数,比如:\n // console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。\n // console.log(obj); //得到每页显示的条数\n\n //首次不执行\n if(!first){\n flag = true\n //do something\n // paging(false, obj.curr, obj.limit)\n // var selAgrs = JSON.parse(sessionStorage.getItem('selJson'))\n // paging(obj.curr, obj.limit, selAgrs.name, selAgrs.startTime, selAgrs.endTime, selAgrs.smallNum, selAgrs.bigNum, selAgrs.isNeedPlace, selAgrs.isNeedVisit, selAgrs.isNeedEat)\n paging(obj.curr, obj.limit, selJson.name, selJson.startTime, selJson.endTime, selJson.smallNum, selJson.bigNum, selJson.isNeedPlace, selJson.isNeedVisit, selJson.isNeedEat)\n }\n if(obj.count){\n $('#pageDiv').show()\n }else{\n $('#pageDiv').hide()\n }\n }\n });\n\n\n },\n error: function (err) {\n console.log('err')\n }\n })\n\n }", "title": "" }, { "docid": "7ffe396ceef60010e06e2961d96145f3", "score": "0.5870689", "text": "function pagination(ids,totals,limits){\n\n\t/* Past Variable from Controller [totalRecord, Item Per Page] */\n\n\tvar totalPage = Math.ceil(parseInt(totals)/parseInt(limits));\n\n\t//alert(totalPage);\n\tif(parseInt(totals) > parseInt(limits)){\n\t\tvar atId = '';\n\t\tif(ids == null || ids == ''){\n\t\t\tids = 'pg1';\n\t\t}else if(ids == 'pg0'){\n\t\t\tatId = $('#pg1').text();\n\t\t\t$('#pg1').text(parseInt(atId)-1);\n\t\t\t$('#pg2').text(atId);\n\t\t\t$('#pg3').text(parseInt(atId)+1);\n\t\t}else if(ids == 'pg4'){\n\t\t\tatId = $('#pg1').text();\n\t\t\t$('#pg1').text(parseInt(atId)+1);\n\t\t\t$('#pg2').text(parseInt(atId)+2);\n\t\t\t$('#pg3').text(parseInt(atId)+3);\n\t\t}else{\n\t\t\tatId = $(\"#\"+ids+\"\").text();\n\n\t\t\tif((parseInt(totalPage) - parseInt(atId)) <= 2){\n\t\t\t\tif((parseInt(totalPage) - parseInt(atId)) == 2){\n\t\t\t\t\t$('#pg2').removeClass('pg-active');\n\t\t\t\t\t$('#pg3').removeClass('pg-active');\n\t\t\t\t\t$('#pg1').addClass('pg-active');\n\t\t\t\t}else if((parseInt(totalPage) - parseInt(atId)) == 1){\n\t\t\t\t\t$('#pg1').removeClass('pg-active');\n\t\t\t\t\t$('#pg3').removeClass('pg-active');\n\t\t\t\t\t$('#pg2').addClass('pg-active');\n\t\t\t\t}else if((parseInt(totalPage) - parseInt(atId)) == 0){\n\t\t\t\t\t$('#pg1').removeClass('pg-active');\n\t\t\t\t\t$('#pg2').removeClass('pg-active');\n\t\t\t\t\t$('#pg3').addClass('pg-active');\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tatId = $(\"#\"+ids+\"\").text();\n\t\t\t\t}\n\n\t\t\t\t$('#pg1').text(parseInt(totalPage) - 2);\n\t\t\t\t$('#pg2').text(parseInt(totalPage) - 1);\n\t\t\t\t$('#pg3').text(totalPage);\n\t\t\t}else{\n\t\t\t\t$('#pg1').text(atId);\n\t\t\t\t$('#pg2').text(parseInt(atId)+1);\n\t\t\t\t$('#pg3').text(parseInt(atId)+2);\n\t\t\t}\n\t\t}\n\n\t\tvar pdno = $('.pg-active').text();\n\t\tif(parseInt(pdno) == 1){\n\t\t\t$('#pg0').css('display','none');\n\t\t}else if(parseInt(pdno) > 1){\n\t\t\t$('#pg0').css('display','block');\n\n\t\t\tif((parseInt(totalPage) - parseInt(pdno)) <= 2){\n\t\t\t\t$('#pg4').css('display','none');\t\t\t\n\t\t\t}else{\n\t\t\t\t$('#pg4').css('display','block');\n\t\t\t}\n\t\t}\n\t\tif(parseInt(getPageStartTop()) > 0){\n\t\t\tsetPageStart(0);\n\t\t}else{\n\t\t\tsetPageStart((parseInt(pdno) - 1) * parseInt(limits));\n\t\t\tsetPageStartTop(getPageStart());\n\t\t}\n\n\t}else{\n\t\t$('#pg0').css('display','none');\n\t\t$('#pg1').css('display','none');\n\t\t$('#pg2').css('display','none');\n\t\t$('#pg3').css('display','none');\n\t\t$('#pg4').css('display','none');\n\t}\n\t\n}", "title": "" }, { "docid": "8f1f6d625800badc1b2d7c03abd6db1e", "score": "0.58673185", "text": "updatePagination() {\n this._checkPaginationEnabled();\n this._checkScrollingControls();\n this._updateTabScrollPosition();\n }", "title": "" }, { "docid": "1eadb7398baa412fea832905b49a1bc2", "score": "0.5860755", "text": "function PaggingTemplate(totalPage, currentPage) {\n var template = \"<p>Show \" + currentPage + \" of \" + totalPage + \" pages</p>\"\n\n $('#pagination').twbsPagination('destroy');\n window.pagObj = $('#pagination').twbsPagination({\n totalPages: totalPage,\n visiblePages: 10,\n startPage: currentPage,\n onPageClick: function (event, page) {\n if (currentPage != page) {\n GetPageData(page, 1, $('#page-size').val(), $('#key-search').val(), $('#action').val(), $('#cb-status').val());\n }\n }\n });\n $(\"#paged\").append(template);\n\n $('.filter').off('change').on('change', function (e) {\n e.preventDefault();\n GetPageData(1, 1, $('#page-size').val(), $('#key-search').val(), $('#action').val(), $('#cb-status').val());\n });\n $(\"#button-search\").on('click', function () {\n GetPageData(1, 1, $('#page-size').val(), $('#key-search').val(), $('#action').val(), $('#cb-status').val());\n });\n}", "title": "" }, { "docid": "103204f4306487a47cf24836668ebe47", "score": "0.585981", "text": "function pagination() {\n\t\tvar i = 0;\n\t\tvar y = '';\n\t\tfor(i=0; i<slideCount; i++){\n\t\t\ty += '<li class=\"paginate\"><a href=\"#\"></a></li>';\n\t\t}\n\t\t$('.paginationCircle').append(y);\n\t}", "title": "" }, { "docid": "00e413e764f72384888183d9dd85701c", "score": "0.5858237", "text": "function authorList(pageNo, pageSize) {\n var skip = pageNo * pageSize;\n $.ajax({\n type: 'GET',\n url: '../electricity/api/author/list',\n data: {skip: skip, size: pageSize},\n success: function (data) {\n console.log(data);\n drawAuthorsTable(data, pageNo);\n },\n error: function (error) {\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "c3241b01d1b78f7db9236320a6ffbe99", "score": "0.5844397", "text": "function LeerPolizasByRiesgo()\n{\n var pag=window.pagina;\n var tama=window.pagsize;\n var xRiesgo=document.getElementById(\"xRiesgo\").value;\n \n \n var url='AjaxPolizas.servlet';\n var dataToSend='accion=PolizasByRiesgo&pagina='+pag +'&size='+tama+'&xRiesgo='+xRiesgo;\n var conn = new Conectar(url, dataToSend);\n \n conn.pageRequest.onreadystatechange = function() { ListaPolizas(conn.pageRequest); };\n\n conn.Enviar();\n \n return conn;\n}", "title": "" }, { "docid": "7d4c0bd95bdff75fc05865ff38028793", "score": "0.5839494", "text": "function addPaging(fn) {\n return function(call, callback) {\n if (!call.request.page_size) {\n call.request.page_size = 10;\n }\n if (!call.request.page_token) {\n call.request.page_token = 0;\n }\n return fn(call, callback);\n }\n}", "title": "" }, { "docid": "093f7d47e8335f06e94f389af2d1f990", "score": "0.5837635", "text": "function saveUsersPerPage(value) {\n $.ajax({\n type : \"POST\",\n data : { 'perPage': value },\n url : \"rest/userSettings/usersPerPage\",\n complete : function(response) {\n location.reload();\n }\n });\n}", "title": "" }, { "docid": "bb1cfffe939cf646c3e346d9d38a18ba", "score": "0.5834498", "text": "function LeerPolizasByBuscar()\n{\n var pag=window.pagina;\n var tama=window.pagsize;\n var xBuscar=document.getElementById(\"xBuscar\").value;\n \n \n var url='AjaxPolizas.servlet';\n var dataToSend='accion=PolizasByBuscar&pagina='+pag +'&size='+tama+'&xBuscar='+xBuscar;\n var conn = new Conectar(url, dataToSend);\n \n conn.pageRequest.onreadystatechange = function() { ListaPolizas(conn.pageRequest); };\n\n conn.Enviar();\n \n return conn;\n}", "title": "" }, { "docid": "003d21c30c726e4791fd683f40edbb26", "score": "0.58333445", "text": "function get_different_page() {\n var select_object_data_url = \"/api/tracking/select?object_name=\" + object_name + \"&column_data=\" + select_columns\n select_object_data_url += \"&limit=\" + (page_limit+2) + \"&offset=\" + current_offset\n\n $.get(select_object_data_url, function(data) {\n page_data = data.page_data\n\n if (page_data.length < (page_limit+1)) {\n // reached the max page\n $(\"button[name='next-btn\").prop(\"disabled\", true)\n }\n if (page_data.length > 0) {\n fill_valued_rows(page_data)\n clear_remaining_rows(page_data.length)\n }\n else {\n get_previous_page()\n }\n })\n}", "title": "" }, { "docid": "cd3c261bdee6a71c9a77362cd7f9a87c", "score": "0.5826012", "text": "function pagination(param) {\n matchList.innerHTML = \"\"\n if (param == 1) {\n arrBis = arr.slice(0, 10)\n } else if (param == 2) {\n arrBis = arr.slice(10, 20)\n } else if (param == 3) {\n arrBis = arr.slice(20, 30)\n } else if (param == 4) {\n arrBis = arr.slice(30, 40)\n } else if (param == 5) {\n arrBis = arr.slice(40, 50)\n } else {\n arrBis = arr.slice(50)\n }\n matchList.innerHTML = arrBis.join('');\n}", "title": "" }, { "docid": "c28a3b82aadcabdcec313d174737575d", "score": "0.58228755", "text": "function showPageing(pagesize, pageindex) {\n //begin loadpaging\n options.loadingCallback($pageingContainer);\n\n if (options.showloading) {\n try { //trying to use jquery.blockUI.js to show loading overlay. if do not reference it.then no overlay effect.and because to catch the error,there will be no error reported.\n $.blockUI.defaults.overlayCSS.opacity = '.2';\n $pageingContainer\n .block({\n message: '<div style=\"\"><i class=\"fa fa-spinner fa-pulse fa-3x fa-fw\" ></i><span class=\"\">' + options.loadingtext + '</span></div>', //sr-only\n css: { border: '2px' }\n });\n }\n catch (e) { }\n }\n\n var url = options.url;\n var paramData = options.paramData;\n paramData.pageSize = pagesize;\n paramData.pageIndex = pageindex;\n\n if (options.method.toUpperCase() === \"GET\") {\n jsonAjaxGet(url, paramData, onsuccess, onerror);\n } else {\n jsonAjaxPost(url, paramData, onsuccess, onerror);\n }\n\n function onsuccess(r) {\n $pageingContainer.html(r);\n options.loadedCallback($pageingContainer);\n if (options.showloading) {\n try {\n $pageingContainer.unblock();\n } catch (e) {\n }\n }\n }\n\n function onerror(r) {\n options.loadedCallback($pageingContainer);\n if (options.showloading) {\n try {\n $pageingContainer.unblock();\n } catch (e) {\n }\n }\n }\n }", "title": "" }, { "docid": "e600a63ed1e6754f66223bbb82a95809", "score": "0.58118314", "text": "function fetch_page(page) {\n\tpage = page || 0;\n\tvar url = '';\n\tparsed_page = parseInt(page);\n\tif (isNaN(parsed_page)) {\n\t\t// We can get an url instead of a page number\n\t\turl = page;\n\t}\n\telse {\n\t\turl = BASE_URL + 'api/files/?limit='+PER_PAGE;\n\t\tif (page) {\n\t\t\turl += '&offset=' + PER_PAGE * parsed_page;\n\t\t}\n\t\tvar filter = document.forms.ajax.elements.filter.value;\n\t\tif (filter != 'all') {\n\t\t\turl += '&type=' + filter;\n\t\t}\n\t}\n\tvar xhr = new XMLHttpRequest();\n\txhr.open('GET', url, true);\n\n\txhr.onload = function() {\n\t\tif (this.status == 200) {\n\t\t\treturn this.onsuccess();\n\t\t}\n\t\telse {\n\t\t\treturn this.onerror();\n\t\t}\n\t}\n\txhr.onsuccess = function() {\n\t\tvar data = JSON.parse(this.responseText);\n\n\t\t// Pagination\n\t\tif (data.next || data.previous) {\n\t\t\tPAGINATION.style = '';\n\t\t\t// Previous & Next link\n\t\t\tif (data.previous) {\n\t\t\t\tPREV_LINK.href = data.previous;\n\t\t\t\tPREV_LINK.parentElement.classList.remove('disabled');\n\t\t\t} else {\n\t\t\t\tPREV_LINK.parentElement.classList.add('disabled');\n\t\t\t}\n\t\t\tif (data.next) {\n\t\t\t\tNEXT_LINK.href = data.next;\n\t\t\t\tNEXT_LINK.parentElement.classList.remove('disabled');\n\t\t\t} else {\n\t\t\t\tNEXT_LINK.parentElement.classList.add('disabled');\n\t\t\t}\n\t\t} else {\n\t\t\tPAGINATION.style = 'display:none;';\n\t\t}\n\n\t\tvar tpl = TABLE.tHead.rows[0];\n\t\tTABLE.tBodies[0].innerHTML = '';\n\t\tfor (var i = 0; i < data.results.length; ++i) {\n\t\t\tvar row = document.createElement(\"tr\");\n\t\t\tvar file = data.results[i];\n\t\t\trow.dataset.file = JSON.stringify(file);\n\t\t\tfor (var c = 0; c < tpl.cells.length; ++c) {\n\t\t\t\tvar col = document.createElement(\"td\");\n\t\t\t\tvar field = tpl.cells[c].dataset.field\n\t\t\t\tvar format = tpl.cells[c].dataset.format || \"text\";\n\t\t\t\tcol.innerHTML = formatter[format](file[field]);\n\t\t\t\trow.append(col);\n\t\t\t}\n\t\t\tTABLE.tBodies[0].append(row);\n\t\t}\n\t}\n\n\txhr.send();\n}", "title": "" }, { "docid": "861c1c12b56711aebdf052c2ca54cf82", "score": "0.58109903", "text": "function generatePagination() {\n\n //Remove all earlier pagination to generate new\n $(\".page-item\").remove();\n\n\n //If there is no products to show there is no need to generate pagination\n if (numberOfItems < 1) return false;\n\n //Hide products that exceeds the limit per page mark\n $(`.show:gt(${limitPerPage-1})`).hide();\n\n //Count number of pages needed\n var totalPages = Math.ceil(numberOfItems / limitPerPage);\n\n //Append first page which is active on default\n $(\".pagination-list\").append(`<li class='page-item page-number active first-page'><a class='page-link' href='#'>1</a></li>`);\n\n //Append ass much pages as needed according to products to show\n for (let i = 2; i <= totalPages; i++) {\n $(\".pagination-list\").append(`<li class='page-item page-number'><a class='page-link' href='#'>${i}</a></li>`);\n }\n\n\n //Navigating through pagination on click\n goToPage();\n\n}", "title": "" }, { "docid": "83452a01ee4e92cc8476f3080caa180c", "score": "0.5810117", "text": "function paginateMethod () {\n\n var search = ($scope.input) ? $scope.input : null;\n var currentPage = $scope.currentPage;\n var data = { page: currentPage, search: search };\n\n $http.get('api/users', { params: data })\n .then(function (response) {\n\n $scope.users = response.data.data;\n \n /* Update pagination object */\n $scope.pagination = {\n currentPage: 1,\n maxSize: 50,\n totalItems: response.data.count,\n };\n\n }, function (response) {\n // not found users\n });\n }", "title": "" }, { "docid": "e70b9fec3eb93d33b463de9ba941594a", "score": "0.5806678", "text": "function loadBlogPostsPage(lastid, limit){\n $(\"#ajaxLoader\").show();\n m.getFromDb({\n getAction: \"getBlogPostsPage\",\n lastId: lastid,\n limit: limit\n }).done(function(resp){\n $(\"#ajaxLoader\").hide();\n v.loadBlogPosts(resp);\n blogIsWorking = false;\n if(resp == \"\"){\n $(\"#ajaxLoader\").remove();\n }\n });\n }", "title": "" }, { "docid": "fad8b14d25b6ca943b83ca3c046708a3", "score": "0.58041286", "text": "function refresh_pagination(page,element) {\nvar start_page = page-before_links;\nvar bool=0;\n$('.link_page').each(function(i, obj) {\n if($(element).attr(\"page\")!=$(obj).attr(\"page\")){\n // console.log($(element).attr(\"page\")+\" \"+$(obj).attr(\"page\"))\n//console.log(start_page)\n $(this).remove()\n\n start_page++;\n }\n else{bool=1;\n start_page++;\n }\n});\nstart_page = page-before_links;\nbool=0;\nfor(var i=0 ; i<=num_links;i++){\n\nif(start_page+i!=$(element).attr('page')){\n if(!bool){\n if((start_page+i)>0)\n $( ' <li class=\"page-item\"><a class=\"page-link link_page\" page=\"'+(start_page+i)+'\"href=\"/students/get_student/'+(start_page+i)+'\">'+(start_page+i)+'</a></li>').insertBefore(element.parent());\n } else {\n if((start_page+i)<=total_pages)\n\n $( ' <li class=\"page-item\"><a class=\"page-link link_page\" page=\"'+(start_page+i)+'\"href=\"/students/get_student/'+(start_page+i)+'\">'+(start_page+i)+'</a></li>').insertAfter($('.link_page').last().parent());\n\n }\n\n}\nelse{\n bool=1;\n}\n\n}\n$(\".link_page\").click(link_page_click);\n\n\n }", "title": "" }, { "docid": "8c2edf7ad5b7f2178c164d556f96eb7b", "score": "0.57852215", "text": "function initUserPagination(num_entries) {\n \n // Create pagination element\n $(\".users_pagination\").pagination(num_entries, {\n \t num_display_entries:7,\n num_edge_entries: 1,\n callback: pageselectuserCallback,\n load_first_page:false,\n items_per_page:userlimit\n });\n }", "title": "" } ]
de6279d4119323e6ed29304c3d09283a
Updates the userData file for a specific user
[ { "docid": "a55e870f2080817f94ee5460a6aefad0", "score": "0.8082139", "text": "function updateUserFile(username) {\n var data = JSON.stringify(userData[username]);\n var filename = \"userdata/\" + username + \".txt\";\n writeFile(filename, data)\n}", "title": "" } ]
[ { "docid": "6f0af0e2f4175216aef0e178ff19d4d6", "score": "0.7584284", "text": "function setUserData(userID) {\n readFile(\"userdata/\" + userID + \".txt\", undefined, function(err, data) {\n userData[userID] = JSON.parse(data);\n });\n }", "title": "" }, { "docid": "b4d666c27319d783a164c78fac01d00b", "score": "0.70594573", "text": "function updateUser(systemPart, userName, dataSet) {\n let checkData = Client.checkStorage(systemPart);\n if (checkData[\"status\"]) {\n let loadedData = checkData[\"load\"];\n if (loadedData[userName]) {\n let userData = loadedData[userName];\n\n if (typeof dataSet === 'object' && dataSet !== null) {\n for (const [key, value] of Object.entries(dataSet)) {\n userData[key] = value;\n }\n let obj = {[userName]:userData};\n Client.createEntry(systemPart, obj);\n }\n else {\n //Error\n console.log(\"Error\");\n }\n }\n else {\n //Error\n console.log(\"Error\");\n }\n }\n else {\n //Error\n console.log(\"Error\");\n }\n}", "title": "" }, { "docid": "eab160eafeec4e060f10e162825a3117", "score": "0.68894416", "text": "function updateUserData(newData) {\n setUserData(newData);\n }", "title": "" }, { "docid": "1e97ff4d39da68c1712704fde3cb998b", "score": "0.67353237", "text": "SetUserData(user) {\n const userDoc = this.afs.doc(`users/${user.uid}`);\n userDoc.set(user, { merge: true });\n }", "title": "" }, { "docid": "b07060df94d09517a69c74c40f3b95e3", "score": "0.67323184", "text": "function addUser(user) {\n fileService.writeFileContents(\"../data/users.json\", user);\n}", "title": "" }, { "docid": "38ab302f385044c1f0ecbea39ab03149", "score": "0.6616821", "text": "function update_user_configuration(new_user_config) {\n console.log(\"updating...\")\n const configurations_path = localStorageElectron.getItem('configurations_path')\n fs.writeFile(path.join(configurations_path, 'personalConfiguration.json'), JSON.stringify(new_user_config), (error) => {\n if (error) throw error\n console.log(\"new configuration loaded\")\n })\n // upload the configuration to localStorageElectron\n localStorageElectron.setItem('personal_configuration', JSON.stringify(new_user_config))\n}", "title": "" }, { "docid": "e139627e836410a5412d246d09f2bfe5", "score": "0.6611892", "text": "function loadUserData( data ) {\n _users = data;\n}", "title": "" }, { "docid": "10c216c0f8ab46083048a15438eaff0f", "score": "0.6557167", "text": "updateUser(state, data){\n state.user = data\n }", "title": "" }, { "docid": "bfe63fc121e7180f99da6d197acfc932", "score": "0.6493708", "text": "function updateUser(){\n requestProxy({keyName: 'getUser'})\n .success(function(data){\n $scope.accountData.user = data;\n });\n }", "title": "" }, { "docid": "554a870192c6f895056bcc94d5fb28d8", "score": "0.63995993", "text": "function update_user_info(data, success, fail) {\n _post(updateUserUrl, data, success, fail)\n}", "title": "" }, { "docid": "15216b335e10ceeae4587d0516935e27", "score": "0.6373712", "text": "set userData(value) {}", "title": "" }, { "docid": "f70999949b95cc1f884de63cf50097af", "score": "0.63487804", "text": "function updateUser() {\n API.updateUser({\n _id: id,\n userName: user\n })\n .then(res => console.log(res.data))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "087260c246b4d70c42ce07b54e46d225", "score": "0.63349074", "text": "function setUser(user){\r\n userData=user;\r\n}", "title": "" }, { "docid": "e259889ec2c4f537a31cce7d9f59670f", "score": "0.6320328", "text": "static setUserData(user) {\n try {\n localStorage.setItem(\"user\", JSON.stringify(user));\n return fetch(constants.API_BASEURL + \"/users/\" + user.id, {\n method: \"PUT\",\n body: JSON.stringify(user),\n headers: this.headers\n }).then(r => r.json());\n } catch (error) {\n return error;\n }\n }", "title": "" }, { "docid": "819586e9b3dad350afa9f5a6221df157", "score": "0.6302963", "text": "function updateUser() {\n\n\tCookies.set(\"preferences\", USER_PREFERENCES);\n}", "title": "" }, { "docid": "5b74d60bcd85774af48ddf0b6b999333", "score": "0.6210549", "text": "function updateUserCache(data)\n{\n\n\ttry\n\t{\n\t\tintel.xdk.cache.setCookie('user_id', data['user_id'], -1);\n\t\tintel.xdk.cache.setCookie('screen_name', data['user_screen_name'], -1);\n\t\tintel.xdk.cache.setCookie('avatar',data['user_avatar'], -1);\n\t intel.xdk.cache.setCookie('avatar_image',data['user_image'],-1);\n\n\t // Update user display\n\t $('#profile_screen_name').attr(\"value\",intel.xdk.cache.getCookie('screen_name'));\n\t $('#profile_avatar').attr('src',server_host + \"images/\" + intel.xdk.cache.getCookie('avatar'));\n\t}\n\tcatch(err)\n\t{\n\t\talert(\"Error: \" + err.message);\n\t}\n}", "title": "" }, { "docid": "9d3f3025fa92a60604242f3f6d39afb4", "score": "0.61915314", "text": "static setUserData(data) {\n localStorage.setItem(STORAGEKEY.userData, JSON.stringify(data));\n }", "title": "" }, { "docid": "95a386d86925ecad38277d2acf609915", "score": "0.6188438", "text": "SetUserData(user) {\n const userData = {\n uid: user.uid,\n email: user.email,\n photoURL: user.photoURL,\n displayName: user.displayName,\n emailVerified: user.emailVerified\n };\n const userRef = this.afs.doc(`users/${user.uid}`);\n return userRef.set(userData, {\n merge: true\n });\n }", "title": "" }, { "docid": "bbe3ecb2c105dc339853edba3e29ffa3", "score": "0.6165419", "text": "function setUserActive(userId) {\n userObj.users[userId].isActive = true;\n writeUsersFile(userObj);\n}", "title": "" }, { "docid": "62e49a1467ab3e2b5abf1dfc498a449a", "score": "0.61286414", "text": "update(userData,userId) {\n\t\t\n\t\tlet opts = this.options;\n\t\topts.method = 'POST';\n\t\topts.url = `https://e1822f0b7e239bcc6dab870f135bb256.us-east-1.aws.found.io:9243/users/user/${userId}/_update`;\n\t\t\n\t\tif (Object.keys(userData).length > 0) {\n\t\t\topts.body = {\n\t\t\t\t\"doc\":userData\n\t\t\t} ;\n\t\t\topts.body = JSON.stringify(opts.body);\n\t\t} else {\n\t\t\treturn (this.resolveError(\"no_user_data\", 400, \"Bad Request : User data is empty\"));\n\t\t}\n\t\n\t\tlet r = new Promise ((resolve,reject) => {\n\t\t request(opts, (err, res, body) => {\n\t\t \t\tif (res.statusCode === 200) {\n\t\t \t\t\tresolve(this.resolveOk(res.statusCode, JSON.parse(body)));\t\n\t\t \t\t} else {\n\t\t \t\t\treject(this.resolveError(err, res.statusCode, body));\n\t\t \t\t}\n\t\t }).auth(this.userAuth, this.password, false);\n\t\t});\n\n\t return r.then((data) => {\n\t \treturn data; \n\t })\n\t .catch((err) => {\n\t \treturn err;\n\t })\n\t}", "title": "" }, { "docid": "1691cc5e68fc5f30786775bb76abf24f", "score": "0.61223906", "text": "SET_USER_DATA(state, userData) {\n state.user = userData;\n\n localStorage.setItem(\"user\", JSON.stringify(userData));\n\n const authInterceptor = config => {\n config.headers[\"Authorization\"] = `Bearer ${state.user.token}`;\n return config;\n };\n\n httpClient.interceptors.request.use(authInterceptor);\n }", "title": "" }, { "docid": "590d1f2d9a4a69fe6026adef1e15a3d4", "score": "0.61037123", "text": "static async update(username, userData) {\n if (userData.password) {\n userData.password = await bcrypt.hash(userData.password, BCRYPT_WORK_FACTOR);\n }\n const { query, values } = partialUpdate(\"users\", userData, \"username\", username);\n const result = await db.query(query, values);\n const user = result.rows[0];\n\n if (!user) {\n throw new ExpressError(`There exists no user '${username}'`, 404);\n }\n\n delete user.password;\n delete user.is_admin;\n\n return user;\n }", "title": "" }, { "docid": "0a4ed45cd2d295b2d76541a027eb0366", "score": "0.60970825", "text": "function updateData(newUser, files) {\n for(let collection in data)\n data[collection].length = 0\n\n data.user = newUser;\n\n for(let file of files){\n if (file.mimetype.search('audio') !== -1)\n addAudio(file);\n else if (file.mimetype.search('video') !== -1)\n addVideo(file);\n else if (file.mimetype.search('image') !== -1)\n addImage(file);\n else if (file.mimetype.search('application') !== -1)\n addFile(file);\n }\n\n broadcast([\n listeners.user, listeners.audio, listeners.video,\n listeners.images, listeners.files\n ]);\n\n console.log(data)\n }", "title": "" }, { "docid": "83694af187178f7ea030960383911aca", "score": "0.6094521", "text": "function updateUser(user) {\n\t\t\t\tconnectedUser = user;\n\t\t\t}", "title": "" }, { "docid": "30f3823234ace8eee1e83c5e9a0f0cb8", "score": "0.6080245", "text": "function updateParametersFromUserData() {\n var userDataProperty = DEFAULT_USER_DATA;\n\n try {\n userDataProperty = JSON.parse(Entities.getEntityProperties(_entityID, 'userData').userData);\n } catch (err) {\n console.error(\"Error parsing userData: \", err);\n }\n\n rejectionLocation = userDataProperty.rejectTeleportLocation || DEFAULT_USER_DATA.rejectTeleportLocation;\n ticketMarketplaceID = userDataProperty.whitelist && userDataProperty.whitelist.marketplaceID || \n DEFAULT_USER_DATA.whitelist.marketplaceID;\n userDataUsernameWhitelist = userDataProperty.whitelist && userDataProperty.whitelist.usernames || \n DEFAULT_USER_DATA.whitelist.usernames;\n allowAdmins = userDataProperty.whitelist && userDataProperty.whitelist.allowAdmins || \n DEFAULT_USER_DATA.whitelist.allowAdmins;\n var bounceSoundURL = userDataProperty.bounceSound && userDataProperty.bounceSound.bounceSoundURL || \n DEFAULT_USER_DATA.bounceSound.bounceSoundURL;\n if (userDataProperty.bounceSound && (typeof userDataProperty.bounceSound.bounceSoundVolume === \"number\")) {\n bounceSoundVolume = Math.max(0, userDataProperty.bounceSound.bounceSoundVolume);\n } else {\n bounceSoundVolume = DEFAULT_USER_DATA.bounceSound.bounceSoundVolume;\n }\n downloadedBounceSound = bounceSoundURL && SoundCache.getSound(bounceSoundURL) || null;\n }", "title": "" }, { "docid": "44638e34ad2cc7198a47911723366911", "score": "0.6073113", "text": "addUserData(userData)\n {\n this._loadedUserInfo({\n body: userData,\n });\n }", "title": "" }, { "docid": "c71026e8891fda489831566a90f73c24", "score": "0.6067177", "text": "function writeUsersFile(userJSON){\n fs.writeFileSync(\"./users/usersOneTime.json\", JSON.stringify(userJSON, null, 2));\n}", "title": "" }, { "docid": "8369105fc5f840fdfbae537a18b38157", "score": "0.60506904", "text": "function updateUser(newUser) {\n // set user in state\n setUser(newUser);\n\n // update user in localstorage\n setStoredUser(newUser);\n\n // TODO: pre-populate user profile in React Query client\n }", "title": "" }, { "docid": "d2cf31ee3a45712e1919f261c87834cf", "score": "0.60311097", "text": "function updateUserDataOnServerAndProperties(pin, oldData, newData, bofffsSpecificData)\n{\n\talert(newData);\n\tTi.API.info(\"updateUserDataOnServerAndProperties\");\n\tvar xhr = Ti.Network.createHTTPClient(\n\t{\n\t onload: function(e) \n\t {\n\t \talert(this.responseText);\n\t \t//manageUserUpdates(userData,pin,bofffsSpecificData);\n\t \tcreateUpdateString(oldData, newData, pin, bofffsSpecificData);\n\t \t\n\t \t// If the profile picture was updated by the user, the server sends back the new urls\n\t \t// Delete the new_profile_picture flag and save the new urls\n\t \tif(newData.new_profile_picture) {\n\t \t\tdelete newData.new_profile_picture;\n\t \t\tvar newPictureUrls = JSON.parse(this.responseText);\n\t \t\tnewData.profile_picture = newPictureUrls.profile_picture;\n\t \t\tnewData.icon_image = newPictureUrls.icon_image;\n\t \t\talert(\"el donia mashya tamam yatsa, el url el gdida aheh \\n\" + newPictureUrls.profile_picture);\n\t \t}\n\t \t\n\t \t// Save the new user data to properties and to golbal variable userData\n\t \tuserData = newData;\n\t \tTitanium.App.Properties.setObject(\"userData\", newData);\n\t },\n\t onerror: function(e) \n\t {\n\t \talert(this.responseText);\n\t },\n\t});\n\txhr.open(\"POST\", Alloy.Globals.apiUrl + \"update_with_pin/bofff/user_accounts/\"+pin);\n\t\n\txhr.send(newData); // request is actually sent with this statement\n}", "title": "" }, { "docid": "5331214d34158f0901f902e765f7839f", "score": "0.6022451", "text": "async modifyUser() {\n \n // ........... authority judge\n\n\n const user = this.ctx.request.body;\n\n this.ctx.body = await this.service.users.update(user);\n }", "title": "" }, { "docid": "7097082c68719bb20c8ba38971af0756", "score": "0.6021748", "text": "async _writeUserConfig() {\n const {\n WRITE_USER_CONFIG_START,\n WRITE_USER_CONFIG_SUCCESS,\n WRITE_USER_CONFIG_ERROR,\n WRITE_USER_CONFIG_SKIP_FILE_EXISTS,\n } = Installer.operations;\n\n const {\n userConfigExists: fileExists,\n userConfigFilename: filename,\n userConfigFilepath: filepath,\n configTemplatePath,\n } = this.config;\n\n const payload = { fileExists, filename, filepath };\n\n try {\n this.subject.next({ type: WRITE_USER_CONFIG_START, payload });\n\n if (fileExists === true) {\n this.subject.next({\n type: WRITE_USER_CONFIG_SKIP_FILE_EXISTS,\n payload,\n });\n } else {\n // copy template\n this.memFsEditor.copy(configTemplatePath, filepath);\n // commit changes\n await this._commitMemFsChanges();\n\n this.subject.next({ type: WRITE_USER_CONFIG_SUCCESS, payload });\n }\n } catch (error) {\n throw new InstallerError({\n type: WRITE_USER_CONFIG_ERROR,\n payload,\n error,\n });\n }\n }", "title": "" }, { "docid": "19868382bc9d905e754825be9a24f613", "score": "0.60168546", "text": "async function updateUserData() {\n let payload = {\n url: process.env.REACT_APP_BASE_URL + \"auth/jwt/refresh\",\n method: \"POST\",\n auth: false,\n body: {\n refresh: authService.currentUserValue?.refresh,\n },\n };\n try {\n let local = JSON.parse(localStorage.getItem(\"currentUser\"));\n if (!local.refresh || !validateExp(local.refresh)) {\n throw new Error(\"User not logged in or expired credentials!\");\n }\n let response = await fetchCall(payload);\n local.access = response.access;\n localStorage.setItem(\"currentUser\", JSON.stringify(local));\n currentUserSubject.next(local);\n } catch (err) {\n /* TODO: error handling... */\n toast.error(err.message);\n authService.logout();\n }\n}", "title": "" }, { "docid": "d7da8344e5b593f14ad470ca6ff65e93", "score": "0.6000612", "text": "function setUserInactive(userId) {\n userObj.users[userId].isActive = false;\n writeUsersFile(userObj);\n}", "title": "" }, { "docid": "00d4dd9851d02189503926ba9e5482a5", "score": "0.59966797", "text": "async updateProfile(userId,data) {\n try {\n return await this._fetch({\n method: 'PUT',\n url: '/1/users/' + userId,\n body: data\n });\n } catch(error) {\n throw error;\n }\n }", "title": "" }, { "docid": "4c9068d8d59a2b4473ed998995348e24", "score": "0.5995602", "text": "function _updateUserInfo(u, bNotify) {\n if(angular.isUndefined(bNotify)) {\n bNotify = true;\n }\n user.email = u.email || '';\n user.mobile = u.mobile || '';\n user.name = u.username || '';\n user.oID = u.objectId;\n user.sToken = u.session || user.sToken;\n user.emailVerified = u.emailVerified;\n user.mobileVerified = u.mobileVerified || false;\n\n\n /* jshint +W106 */\n //store data store & other info\n _updateUserProfile(u);\n _updateLoggedInStatus();\n if(bNotify) {\n _userStatusNotify();\n }\n\n }", "title": "" }, { "docid": "2256ae6e2a1a9a50aa0a0ebaf6348292", "score": "0.59954286", "text": "function UpdateData(user, path, data) {\n // Required to use firebase tools such as auth, storage, and database\n const firebase = require('firebase');\n require('firebase/database');\n const database = firebase.database();\n\n database.ref(user+'/').child(path).update(data,\n function (error) {\n if (error) {\n alert('The data did not submit properly');\n }\n });\n}", "title": "" }, { "docid": "8a7d0eed4c32b9267133c2b534527439", "score": "0.59818274", "text": "updateUserProfile(user) {\n console.log(user);\n let name = user.name ? user.name : user.email;\n let photoUrl = user.photoURL ? user.photoURL : src_environments_environment_prod__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_AVATAR\"];\n this.getUserData().updateProfile({\n displayName: name,\n photoURL: photoUrl\n });\n // create or update passenger\n this.db.object('passengers/' + user.uid).update({\n name: name,\n photoURL: photoUrl,\n email: user.email,\n phoneNumber: user.phoneNumber ? user.phoneNumber : '',\n isPhoneVerified: user.isPhoneVerified,\n createdAt: Date.now()\n });\n }", "title": "" }, { "docid": "3de85c401e0f5d20f2fbcae6f7dd4b6b", "score": "0.5968842", "text": "function handleUserUpdate(userObj){\n\t\tlog('update data', userObj);\n\t\t$.extend(config.user, userObj)\n\n\t\tif(config.authWindow == null) return;\n\n\t\tchrome.windows.remove(config.authWindow);\n\t\tconfig.authWindow = null;\n\t}", "title": "" }, { "docid": "1ea9e1cabbcc94bc67c38d569b59d6ff", "score": "0.59662575", "text": "updateUser(id_user, user_content) {\r\n\t\treturn API.put(\"pm\", \"/update-users/\" + id_user, {\r\n\t\t\tbody: user_content\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "3ef1b007539618fd9978939ac7d09183", "score": "0.5944677", "text": "function writeUserData(userID, name, email) {\n console.log(\"updating a new user profile\")\n firebase.database().ref('users/' + userID).set({\n fullname: name,\n email: email,\n });\n firebase.database().ref(`users/${userID}/player_info`).set({\n \"player\": {\n \"name\" : \"null\"\n }\n });\n}", "title": "" }, { "docid": "b645525b555b2ec9ae822a1e2809cf5e", "score": "0.5940838", "text": "function updateUserData(success)\n{\n if (!isLoggedIn()) {\n //Prevent destroying the data\n return;\n }\n \n userData.userId = getCookie(\"userId\"); //Add login identification info\n userData.token = getCookie(\"token\");\n $.ajax({\n\t\turl : \"database/update_user.php\",\n\t\ttype : \"POST\",\n\t\tdata : \"userData=\" + JSON.stringify(userData),\n\t\tsuccess : function(data) {\n\t\t\tconsole.log(data);\n\t\t\tif (typeof success === \"function\") {\n\t\t\t success(data == \"success\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "97a8dfa6739fc349eb76da4bf56de42a", "score": "0.5937667", "text": "function setUserData(e) {\n\tTi.API.info(\"Logged User Token Data Set :\"+ JSON.stringify(e));\n\t\n\tTi.App.Properties.setInt(\"accountID\", e.user_Details.accountId);\n\tTi.App.Properties.setString(\"emailID\", e.user_Details.emailAddress);\n\tTi.API.info(\"Logged User Token Data Set :\"+ e.account_details.firstName);\n\tvar str = e.account_details.firstName;\n //var storeFirstname = str.substr(0,str.indexOf(' '));\n Ti.App.Properties.setString(\"firstName\", str);\n //Ti.API.info(\"Logged User Token Data Set :\"+ storeFirstname);\n\tcall_web_serivce_updateRegistrationWithUser(e);\t\n}", "title": "" }, { "docid": "3ae9138e90c8dc5e04d6f2959795ccac", "score": "0.5935008", "text": "static async updateUser(username, data) {\n let res = await this.request(`users/${username}`, data, \"patch\");\n return res.user;\n }", "title": "" }, { "docid": "eb690a08f1d64daa7d3bebbeb12a590c", "score": "0.5928584", "text": "function setUserData(req, res, next) {\n req.source = (req.body.originalRequest) && (req.body.originalRequest.source);\n if (req.source === undefined) {\n req.source = (req.body.result) && (req.body.result.source);\n }\n req.sender_id = (req.body.originalRequest) && (req.body.originalRequest.data) && (req.body.originalRequest.data.sender) && (req.body.originalRequest.data.sender.id);\n if (req.sender_id === undefined) {\n req.sender_id = req.body.sessionId;\n }\n let query = db.getUserData(req.source, req.sender_id);\n query.once(\"value\", function(snapshot) {\n req.userData = snapshot.val() || {};\n next();\n }, function (errorObject) {\n console.log(\"The read 'userData' failed: \" + errorObject.code);\n next();\n });\n}", "title": "" }, { "docid": "2756b481597ad9c596856f5bd6ef1db7", "score": "0.5917497", "text": "function setUserData(userDataObject) {\n if (isUserDataObjectValid(userDataObject)) {\n var goatUsers = [];\n goatUsers = getGoatUsersFromLocalStorage();\n console.log(\"users:\" + goatUsers);\n if (goatUsers !== null) {\n var userExists = false;\n goatUsers.forEach(user => {\n if (user !== null) {\n console.log(\"checking user:\" & user.email);\n if (user.email == userDataObject.email) {\n //copy the input into the exiting record\n user.email = userDataObject.email;\n user.name = userDataObject.name;\n user.password = userDataObject.password;\n user.shoeSize = userDataObject.shoeSize;\n user.creditCard = userDataObject.creditCard;\n user.cart = userDataObject.cart;\n user.lastLogIn = userDataObject.lastLogIn;\n userExists = true;\n return;\n }\n }\n });\n if (!userExists) {\n goatUsers.push(userDataObject);\n }\n }\n else {\n goatUsers = [];\n goatUsers.push(userDataObject);\n }\n localStorage.setItem(\"goatUsers\", JSON.stringify(goatUsers));\n }\n else {\n console.log(\"Invalid User data\");\n }\n}", "title": "" }, { "docid": "180260f918aa544eb09751e123243b5e", "score": "0.59162915", "text": "updateUserInfo(user_username,user){\n return db('user').where('user_username',user_username).update(user)\n }", "title": "" }, { "docid": "ad4deb98cb58b25f5462c99a473fbb9a", "score": "0.5912194", "text": "[USER_UPDATE] (state, user) {\n state.logged = !!user;\n state.user = {\n ...state.user,\n ...user\n };\n syncWindow(state.user);\n }", "title": "" }, { "docid": "2dd644157dedbe891056c89da4a6e1b4", "score": "0.58797807", "text": "function settingUser(key, value){\n const newUserInfo = {...realUser};\n newUserInfo[key] = value;\n setRealUser(newUserInfo);\n }", "title": "" }, { "docid": "1d4036042310f18bc785f2dd8dc5d399", "score": "0.58667755", "text": "async function updateUser(updateData) {\n const user = await JoblyApi.updateUser(updateData);\n setCurrentUser(user);\n history.push(\"/\");\n }", "title": "" }, { "docid": "483e671502771226f5d6004803b41fc6", "score": "0.58645797", "text": "function updateUserDetails() {\n if ($scope.userMode == VIEWER_MODE) {\n Dealer.updateViewer($scope.profile, EPR_SESSION);\n } else {\n Dealer.updateDealer($scope.bank_account, $scope.profile, EPR_SESSION);\n }\n }", "title": "" }, { "docid": "e0451b634592f47a63f940ecdb3a2019", "score": "0.5849594", "text": "function upsertUser(userData) {\n $.post(\"/api/signin\", userData, function (data) {\n if (!data) {\n alert(\"Incorrect Password\");\n } else {\n localStorage.setItem(\"currentUser\", JSON.stringify(data));\n redirect();\n }\n\n }).catch(err => console.log(err));\n }", "title": "" }, { "docid": "8dca1b05b0fe2364b7494fb1c616089c", "score": "0.5844728", "text": "function save_user_data (data) {\n\tlocalStorage[userKey.key] = JSON.stringify(data);\n}", "title": "" }, { "docid": "b343b9cb7745bdac523eaf147ea2488a", "score": "0.58355963", "text": "function initUserData() {\n // user browser supports in localStorage\n if (localStorage) {\n // Retrieve the users data.\n var userGenresAndTagsDataStr = localStorage.getItem(LOCAL_STORAGE_GENRES_AND_TAGS_KEY);\n if (isObjectDefined(userGenresAndTagsDataStr)) { // exist/old user\n var userGenresAndTagsDataObj;\n try {\n userGenresAndTagsDataObj = JSON.parse(userGenresAndTagsDataStr);\n if (isValidUserGenresAndTagsDataObj(userGenresAndTagsDataObj)) {\n $rootScope.userGenresMap = userGenresAndTagsDataObj.genres;\n $rootScope.userTagsMap = userGenresAndTagsDataObj.tags;\n return;\n } else {\n // thu user has the an old data structure of userData\n // as new user\n setNewUserGenresAndTagsData();\n }\n } catch (e) {\n console.error(\"Error: \" + e + \" | Unable to parse local storage data. value: \" + userGenresAndTagsDataStr);\n }\n\n } else { // new user\n setNewUserGenresAndTagsData();\n }\n\n } else { // no local storage\n setNewUserGenresAndTagsData();\n }\n\n }", "title": "" }, { "docid": "f6a6925bbffb3a79403d0be6de39ee95", "score": "0.5834445", "text": "function setUser(user) {\n localStorage.setItem(USER_KEY, JSON.stringify(user));\n}", "title": "" }, { "docid": "6c19bdfa917379daecba20789899369e", "score": "0.5832964", "text": "static async profileSaver(username, data) {\n let res = await this.request(`users/${username}`, data, \"patch\");\n return res.user;\n }", "title": "" }, { "docid": "3748a93d457435c83a7692b2bb182e32", "score": "0.5826504", "text": "function updateProfile(data, userID) {\n var url = '/users/' + userID;\n return $http.put(url, data)\n .then(function successCallback(res) {\n return res.data;\n }, function errorCallback(res) {\n console.log('Error updating user profile');\n });\n }", "title": "" }, { "docid": "481e90317a6005028304ee45d3d607be", "score": "0.5824433", "text": "function updateUser(data) {\n const { users } = app.locals\n const userCheck = users.find( user => user.id === data.id)\n if(!userCheck){\n users.push(data)\n }else{\n app.locals.users = users.map(user => {\n if(user.id == data.id){\n return data\n }\n return user\n })\n }\n}", "title": "" }, { "docid": "9829bd611ad5f5d1e2d2da53c652e6a9", "score": "0.581981", "text": "function writeUserData(userId, name, email) {\n firebase.database().ref('users/' + userId).set({\n username: name,\n email: email,\n });\n}", "title": "" }, { "docid": "afd7c5e8b14a30b0a1ce7682d66c77ee", "score": "0.5812747", "text": "function modifyUser()\n\t{\n\t\tlet user_modified = (localStorage.getItem(\"user_modified\"))\n\t\t\t? parseInt(localStorage.getItem(\"user_modified\"))\n\t\t\t: 0;\n\n\t\t/**\n\t\t * Modify one user and then sign out and change user\n\t\t */\n\t\tif ( ! user_modified)\n\t\t{\n\t\t\tif ( ! signIn())\n\t\t\t{\n\t\t\t\tlet my_account_opened = (localStorage.getItem(\"my_account_opened\"))\n\t\t\t\t\t? parseInt(localStorage.getItem(\"my_account_opened\"))\n\t\t\t\t\t: 0;\n\n\t\t\t\t/**\n\t\t\t\t * Prevent being stuck in a redirect loop when performing\n\t\t\t\t * more than one redirect in a sequence.\n\t\t\t\t */\n\t\t\t\tif ( ! my_account_opened)\n\t\t\t\t{\n\t\t\t\t\tif ( ! redirect(\"http://localhost/Examensarbete/App/CodeIgniter/index.php/my-account\"))\n\t\t\t\t\t{\n\t\t\t\t\t\t\tlocalStorage.setItem(\"my_account_opened\", 1);\n\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/** Save the URL for the selected resource */\n\t\t\t\t\tlet edit_usr_url = (localStorage.getItem(\"edit_usr_url\"))\n\t\t\t\t\t\t? JSON.parse(localStorage.getItem(\"edit_usr_url\"))\n\t\t\t\t\t\t: document.getElementById(\"edit-usr-btn\").href;\n\n\t\t\t\t\tlocalStorage.setItem(\"edit_usr_url\", JSON.stringify(edit_usr_url));\n\t\t\t\t\t\n\t\t\t\t\tif ( ! redirect(edit_usr_url))\n\t\t\t\t\t{\n\t\t\t\t\t\tinitDataGen();\n\n\t\t\t\t\t\tdocument.getElementById(\"profile-img-2\").checked = true;\n\t\n\t\t\t\t\t\tlet num_of_sentences = randApp.randIntFromIntervall(1, 5);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tlet biography = \"\";\n\t\t\n\t\t\t\t\t\tfor (let i = 0; i < num_of_sentences; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbiography += grammar.generateSentence();\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\tdocument.getElementById(\"form-biography\").value = biography;\n\t\t\t\n\t\t\t\t\t\tlocalStorage.setItem(\"user_modified\", 1);\n\t\t\t\t\t\tlocalStorage.setItem(\"users_modified\", users_modified + 1);\n\t\t\t\n\t\t\t\t\t\tprintTimesRun();\n\t\t\t\n\t\t\t\t\t\tdocument.getElementsByName(\"submit\")[0].click();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsignOut();\n\t\t}\n\t}", "title": "" }, { "docid": "1e7ebf786e80a62b319a89565e2821e1", "score": "0.5811885", "text": "function updateUser(user) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/users\",\n data: user\n }).then(getUsers);\n }", "title": "" }, { "docid": "41bcd20f5f7f4040bef9c0f85ee653c4", "score": "0.58028096", "text": "updateUser() {\n let userString = JSON.stringify(this);\n localStorage.removeItem(this.username);\n localStorage.setItem(this.username, userString);\n alert(\"User account updated\");\n console.log(\"updated\");\n\n }", "title": "" }, { "docid": "40a7be96b9be910eab2eac73e0a71078", "score": "0.5801246", "text": "function initUsers(channelID){\n //if (fs.existsSync(path)) {\n // // Do something\n //}\n var users = {};\n fs.writeFile(\"users.json\", JSON.stringify(users, null, '\\t'), function(err) {\n if (err) {\n console.log(err);\n }\n });\n doMessage(\"User database reinitialised\", channelID);\n}", "title": "" }, { "docid": "cad04f3b582d74633e18107fd2b2a021", "score": "0.5793762", "text": "function updateUser1() {\t \n\t this.userName = \"controller1 user1\";\n\t}", "title": "" }, { "docid": "9b0b6a1a393a74d9ae8dbc3bab8608a6", "score": "0.57868963", "text": "async updateUser (user, tokenInfo) {\n\t\tthis.accessToken = tokenInfo.token;\n\t\tconst accessTokens = user.get('accessTokens') || {};\n\t\tObject.keys(accessTokens).forEach(type => {\n\t\t\tif (type === 'rst' || type === 'conf') {\n\t\t\t\tdelete accessTokens[type];\n\t\t\t}\n\t\t\telse {\n\t\t\t\taccessTokens[type].invalidated = true;\n\t\t\t}\n\t\t});\n\t\taccessTokens.web = {\n\t\t\ttoken: tokenInfo.token,\n\t\t\tminIssuance: tokenInfo.minIssuance\n\t\t};\n\t\tconst op = {\n\t\t\t'$set': {\n\t\t\t\tpasswordHash: this.passwordHash,\n\t\t\t\taccessTokens: accessTokens\n\t\t\t}\n\t\t};\n\t\tawait this.request.data.users.applyOpById(user.id, op);\n\t}", "title": "" }, { "docid": "25c24e8c50a6e47e4b6fd715ff4ab239", "score": "0.5786599", "text": "function refreshUserData() {\n $.post('/userdata', function(data) {\n user = data;\n // Update the gold badge\n $('span.badge.gold-badge').text(user.gold + ' gold');\n });\n }", "title": "" }, { "docid": "fa20eff954d85fb9372338475c9ab1d7", "score": "0.5775112", "text": "function updateUserProfileState(updatedProfileData) {\n setUser(updatedProfileData)\n }", "title": "" }, { "docid": "3447b6d2dbcc436678095fe6bb769f50", "score": "0.5772168", "text": "static async updateUser(userID, userData) {\n const { query, values } = partialUpdate(\"users\", userData, \"id\", userID);\n\n const results = await db.query(query, values);\n if (results.rows.length === 0) {\n throw new ExpressError(`Could not find user with id ${userID}`, 404);\n }\n return results.rows[0];\n }", "title": "" }, { "docid": "898d4c5104018f83e202da5ba22240b8", "score": "0.57687324", "text": "static async update(username, data) {\n let { query, values } = sqlForPartialUpdate(\n \"users\",\n data,\n \"username\",\n username\n );\n const result = await db.query(query, values);\n const { password, ...user } = result.rows[0];\n if (user) {\n User.deserialize(user);\n }\n return user;\n }", "title": "" }, { "docid": "ea5ade3499b9152fd4480c5d9581e3ab", "score": "0.57620966", "text": "UPDATE_USER_INFO(state, payload) {\n // Get Data localStorage\n let userInfo =\n JSON.parse(localStorage.getItem(\"userInfo\")) || state.AppActiveUser;\n\n for (const property of Object.keys(payload)) {\n if (payload[property] != null) {\n // If some of user property is null - user default property defined in state.AppActiveUser\n state.AppActiveUser[property] = payload[property];\n // Update key in localStorage\n userInfo[property] = payload[property];\n }\n }\n\n // Store data in localStorage\n localStorage.setItem(\"userInfo\", JSON.stringify(userInfo));\n }", "title": "" }, { "docid": "266439acb0adb1ff28770e075c44cdd0", "score": "0.57579535", "text": "static async modify(userId, { name, mail, username, password, second_mail, admin, active }) {\n password = bcrypt.hashSync(String(password));\n try {\n const data = await database.update('users',\n `name = '${name}',\n mail = '${mail}',\n username = '${username}',\n password = '${password}',\n second_mail = '${second_mail}',\n admin = '${admin}',\n active = '${active}'\n WHERE user_id = ${userId}`);\n return data;\n } catch (e) {\n throw e;\n }\n }", "title": "" }, { "docid": "ad8095246ffb0d39280fcf1f8d0adcd0", "score": "0.57545334", "text": "function updateUserProfile(user) {\n $(\"#profileInfo\").children().remove();\n var info =\n $('<dt class=\"col-md-2\">Username:</dt><dd class=\"col-md-10\">' + user.username + '</dd>' +\n '<dt class=\"col-md-2\">First Name:</dt><dd class=\"col-md-10\">' + user.firstName +'</dd>' +\n '<dt class=\"col-md-2\">Last Name:</dt><dd class=\"col-md-10\">' + user.lastName + '</dd>' +\n '<dt class=\"col-md-2\">Email:</dt><dd class=\"col-md-10\">' + user.email +'</dd>');\n $(\"#profileInfo\").append(info);\n\n $('#usernameEdit').val(user.username);\n $('#firstNameEdit').val(user.firstName);\n $('#lastNameEdit').val(user.lastName);\n $('#emailEdit').val(user.email);\n }", "title": "" }, { "docid": "96ebde36c8ff6e930da5ae7a61accd23", "score": "0.57537425", "text": "function initializeUserIfNeeded (usr, pwd, email, phoneNumber) {\n var user = {}\n user.username = usr\n user.password = pwd\n var userID = genUID()\n user.sellerID = userID\n user.userID = userID\n user.email = email\n user.number = phoneNumber\n allUser[userID] = user\n // var items = getItemsBought[user.userID]\n // if (items === undefined) {\n // putItemsBought(userID, [])\n // }\n fs.writeFileSync('allUser.txt', JSON.stringify(allUser))\n console.log(allUser[userID].userID)\n console.log(allUser)\n return allUser[userID].userID\n}", "title": "" }, { "docid": "6c18c10248eb7fa85d75a0eabf5f7d89", "score": "0.57446456", "text": "updateLocalStorage(field, value) {\n let userData = JSON.parse(window.localStorage.getItem(\"user\"));\n userData[`${field}`] = value;\n window.localStorage.setItem(\"user\", JSON.stringify(userData));\n }", "title": "" }, { "docid": "343f1df954efa7c7cc6ac32ef708c89a", "score": "0.57437766", "text": "async UpdateUser() {\n this.query.get(this.#id).then((user) => {\n // Updates the data we want\n user.set('email', this.#email);\n user.set('password', this.#pswd);\n user.set('lname', this.#lname);\n user.set('fname', this.#fname);\n // Saves the user with the updated data\n user.save().then((response) => {\n if (typeof document !== 'undefined') document.write(`Updated user: ${JSON.stringify(response)}`);\n console.log('Updated user', response);\n }).catch((error) => {\n if (typeof document !== 'undefined') document.write(`Error while updating user: ${JSON.stringify(error)}`);\n console.error('Error while updating user', error);\n });\n });\n }", "title": "" }, { "docid": "e7d15af45a50f8ed4396e61da02c41b9", "score": "0.5741287", "text": "function writeUserData(userId, name, email, imageUrl) {\n firebase.database().ref('users/' + userId).set({\n username: name,\n email: email,\n profile_picture: imageUrl\n });\n}", "title": "" }, { "docid": "86f92d799f996bd6e7a094cf34001672", "score": "0.57392883", "text": "function updateUser() {\n const objectToSave = {\n \"email\": $(\"#emailRegisterForm\").val(),\n \"password\": $(\"#passwordRegisterForm\").val(),\n \"name\": $(\"#nameRegisterForm\").val(),\n \"language\": ($(\"#languagePtRegisterForm\").is(':checked'))? 'PT': 'EN',\n \"image\": \"\"\n };\n const userToUpdate = JSON.parse(localStorage.getItem(\"user\"));\n // Makes the API request, transforming the object to a string and setting content-type to JSON\n $.ajax({\n url: \"http://localhost:8080/api/user/\" + parseInt(userToUpdate.userId),\n type: 'PUT',\n contentType: \"application/json\",\n data: JSON.stringify(objectToSave),\n success: function (result) {\n // If the error is true, something wrong happen with the processing of the request, \n // eg. duplicate emails, and gives the user an error message\n // If no error, shows a success message\n if (result[\"error\"]) {\n $(\".success-account\").hide();\n $(\".error-account\").show();\n $(\".error-account\").text(result[\"description\"]);\n } else {\n visualChanges(false);\n $(\".error-account\").hide();\n $(\".success-account\").show();\n $(\".success-account\").text(result[\"description\"]);\n localStorage.setItem(\"user\", JSON.stringify(result[\"data\"]));\n }\n }, error: function (data) {\n console.log(\"Error: \" + data);\n }\n });\n }", "title": "" }, { "docid": "e636b35338bc8a7bf435f0310d2af01f", "score": "0.57387334", "text": "handleUpdateUser(data, uid, mode) {\n const index = this.state.users.findIndex(i => i.id === uid);\n if(mode === 'usr') {\n this.setState((prev, props) => {\n data.password = prev.users[index].password;\n prev.users[index] = data;\n prev.currentUser = data;\n return prev;\n });\n }\n else {\n this.setState((prev, props) => {\n prev.users[index].password = data.newPassword;\n prev.currentUser.password = data.newPassword;\n return prev;\n });\n }\n }", "title": "" }, { "docid": "65f02babe22e57d15c803ee7e98f38ee", "score": "0.5737674", "text": "function writeUserData(userId, name, email, imageUrl) {\n firebase.database().ref('users/' + userId).set({\n username: name,\n email: email,\n profile_picture : imageUrl\n });\n}", "title": "" }, { "docid": "5b2d2637a63570fff5e89cd96b059037", "score": "0.57351196", "text": "function updateDatainStorage(id_of_user){\n\tvar usr_id = id_of_user; \t\n\tvar array = checkLocalStorage();\n\tdocument.getElementById('add_data_buton_Id').innerHTML = 'Update Data';\n\n\tfor (let i = 0; i < array.length; i++){\n\t\tif(array[i].userId == usr_id){\n\t\t\tdocument.getElementById('firstNameId').value = array[i].firstName;\n\t\t\tdocument.getElementById('lastNameId').value = array[i].lastName;\n\t\t\tdocument.getElementById('userNameId').value = array[i].userName;\n\t\t\tdocument.getElementById('ageId').value = array[i].age;\n\t\t}\n\t}\n\n\tdocument.getElementById('add_data_buton_Id').value = usr_id;\n}", "title": "" }, { "docid": "db30b8aae70abb45dd4de3f03d4b9d23", "score": "0.57328624", "text": "function writeUserData(userId, name, email, photoURL) {\n firebase.database().ref('users/' + userId)\n .set({\n username: name,\n email: email,\n photoURL: photoURL\n });\n }", "title": "" }, { "docid": "c7f7fbf1c18061051bb536e52c9a7ec7", "score": "0.57056415", "text": "function UpdateData() {\n fs.writeFileSync(path.join(__dirname + '/.data.json'), JSON.stringify(data));\n}", "title": "" }, { "docid": "14ed06c6ee870b246c51395357036efc", "score": "0.57033557", "text": "function edit_user(data) {\r\n\tdata = (data || req.data);\r\n\tif(!data.username)\r\n\t\treturn false;\r\n\r\n\tvar user = app.getHits(\"User\", {_id: data.user_id}).objects(0,1)[0];\r\n\tif(!user)\r\n\t\treturn false;\r\n\r\n\tif(data.password){\r\n\t\tuser.setPassword(data.password);\r\n\t\tdelete data.password;\r\n\t}\r\n\treturn user.edit(data);\r\n}", "title": "" }, { "docid": "41cc32e62939347baf1a0c4b53b8eb5c", "score": "0.5703279", "text": "function updateUser(){\n // get the current user's data\n var userData = firebase.auth().currentUser;\n // update the db with the user data (except favorites)\n ref.child(currentUid).update({\n name: userData.displayName,\n email: userData.email,\n emailverified: userData.emailVerified,\n photoUrl: userData.photoURL,\n providerId: userData.providerData[0].providerId,\n providerUid: userData.providerData[0].uid,\n }).then(function(){\n // retrieve the newly updated user to see if they had any favorites stored\n ref.child(currentUid).once('value', function(snapshot){\n userPhoto = snapshot.val().photoUrl\n // if the user had favorites stored, combine the local favorites array with the db favorites\n if(snapshot.val().favorites){\n var dbFavorites = snapshot.val().favorites;\n favorites = combineArrays(favorites.concat(dbFavorites));\n };\n // update the db favorites with the favorites array\n ref.child(currentUid).update({favorites: favorites});\n });\n }); \n}", "title": "" }, { "docid": "c2019a53c08cbefaf09a102f1b76f3d0", "score": "0.5695929", "text": "function updateUser() {\r\n user.name.toUpperCase();\r\n user.age++\r\n}", "title": "" }, { "docid": "3729d7622567d525a9c9faa01a08cf75", "score": "0.5694225", "text": "function updateUser (){\n user.age++;\n user.name.toUpperCase();\n }", "title": "" }, { "docid": "e9bbb7627c90906c89492d99d53188eb", "score": "0.56905395", "text": "function updateUserContext() {\n console.log(\"update\", myFriends);\n //when the map is passed in the callback is empty\n // myFriends is an array of users which upload at first when\n // my user is set\n setUserContext({\n // allUser: myFriends.concat(myUser).reduce((map, user) => {\n allUser: myFriends.reduce((map, user) => {\n map[user._id] = user;\n return map;\n }, {}),\n });\n console.log(userContext);\n }", "title": "" }, { "docid": "7e5f65b313c870a66843796338f6dfb2", "score": "0.56850225", "text": "function writeUserData(userId, firstName, lastName, email, state) {\n firebase.database().ref('users/' + userId).set({\n firstName: firstName,\n lastName: lastName,\n email: email,\n state: state\n }, function (err) {\n window.location.replace('/');\n });\n }", "title": "" }, { "docid": "c0dec157e80186c1476a200f1b1ae7f6", "score": "0.5684001", "text": "update (data) {\n axios.defaults.headers.common['Authorization'] = `Bearer ${localStorage.getItem('token')}`\n return axios.post('/api/v1/user-detail-update', data)\n }", "title": "" }, { "docid": "fe4478fec5529e77331c8a965d529d62", "score": "0.5669298", "text": "function updateUserDb(user) {\n var userRef = database.ref('/users/' + user.uid);\n userRef.set({\n name: user.displayName,\n photoUrl: user.photoURL,\n email: user.email\n });\n}", "title": "" }, { "docid": "e08eace1662b5af5e525edbd2cefb326", "score": "0.5660298", "text": "function updateUsers() {\n const range = SS.getRangeByName(`${SHEET}!B2:J`);\n let data = range.getValues();\n for (row of data) {\n try {\n // empty row, skip this iteration\n if (!row[0]) continue;\n\n const user = getUser(row[0], MODE);\n if (user.username === 'RESTRICTED') {\n row[1] += ' [RESTRICTED]';\n continue;\n }\n else if (user.hasOwnProperty('username')) {\n row[1] = user.username;\n row[2] = user.rank;\n row[3] = user.pp;\n row[4] = user.statistics.play_count;\n row[5] = new Date(user.join_date);\n row[6] = user.badgeCount;\n row[7] = `https://a.ppy.sh/${user.id}`;\n row[8] = user.country_code;\n }\n }\n catch (e) {\n console.log(new Error(`Querying user_id ${row[0]} failed.`, e.stack));\n }\n }\n const rangeToAdd = [1, 1, range.getLastRow(), range.getLastColumn()];\n // pushing the same range we queried, prevents race condition-related errors\n return SS.getSheetByName(SHEET).getRange(...rangeToAdd).setValues(data);\n}", "title": "" }, { "docid": "f28741f9841dc4ddb4a5447320068f26", "score": "0.56527036", "text": "function updateServiceXUser(req, res) {\n\n}", "title": "" }, { "docid": "70d65146b21c53a1dbd3b1e9d2d3780e", "score": "0.56431854", "text": "updateUserData(user, prenom, nom, username, entrepriseName, addresse, telephone, postal, connectionType) {\n return new Promise(resolve => {\n const userRef = this.afs.doc(`users/${user.uid}`);\n const notificationRef = this.afs.doc(`notifications_account_value/${user.uid}`);\n const data_notification = {\n uid: user.uid,\n notification: \"Veuillez définir vos paramètres de facturation en cliquant ici\"\n };\n notificationRef.set(data_notification);\n const data = {\n uid: user.uid,\n first_name: prenom,\n last_name: nom,\n email: user.email || null,\n displayName: user.displayName || username,\n photoURL: user.photoURL || 'assets/img/images/user.png',\n account_value: 0,\n paymentKey: \"\",\n entrepriseName: entrepriseName,\n addresse: addresse,\n telephone: telephone,\n postal: postal,\n isConnectWithMailAndPassword: connectionType\n // emailVerified: user.emailVerified\n };\n userRef.set(data);\n resolve(\"ok\");\n });\n }", "title": "" }, { "docid": "b722648350d174e6c574db2ea95c86d9", "score": "0.5640782", "text": "function startUserData(userID, username, email) {\r\n firebase.database().ref('users/' + userID).set({\r\n userName: username,\r\n userEmail: email,\r\n });\r\n}", "title": "" }, { "docid": "ed9f963b87eaf5778626e64169ec6ae1", "score": "0.56391954", "text": "async update(opSession , username , options){\n if(!options) throw new KeycloakError(`Update attributes can't be empty!!`); \n const target_user_id = await this.getID(opSession , username);\n if (target_user_id){\n let queryUri = `auth/admin/realms/${this.keycloakAdapter.keycloakRealm.name}/users/${target_user_id}`;\n let postData = {}\n \n if(options){\n const keys = Object.keys(options);\n keys.forEach(key => {\n postData[key] = options[key];\n })\n }\n await this.keycloakAdapter.API.put(queryUri , JSON.stringify(postData) , \"application/json\" , opSession.keycloakUser);\n return true;\n } else throw new KeycloakError(`User[${username}] not exist!!`); \n }", "title": "" }, { "docid": "1b58ac375345394252550b2bf79376b6", "score": "0.5639102", "text": "function userUpdate(user) {\n\t $.ajax({\n\t url: \"http://localhost:8080/users/\" + user.id,\n\t type: 'PUT',\n\t contentType: \"application/json;charset=utf-8\",\n\t data: JSON.stringify(user),\n\t success: function(user) {\n\t userUpdateSuccess(user);\n\t },\n\t error: function(request, message, error) {\n\t handleException(request, message, error);\n\t }\n\t });\n\t}", "title": "" }, { "docid": "4bb726b8368d558f5f1c5302dd81e9bb", "score": "0.5624101", "text": "function saveUser() {\n\n setLoading(true);\n\n if (operation == 1) {\n updateUser({\n _id: item._id,\n userData: {\n name: name,\n email: email,\n login: email,\n pass: password,\n access: [typeAccess]\n }\n })\n .then((resp) => {\n setLoading(false);\n props.navigation.goBack();\n })\n .catch((error) => {\n setLoading(false);\n props.navigaiton.goBack();\n });\n\n } else {\n\n addUser({\n matrix_id: infosUser.matrix_id,\n\n name: name,\n email: email,\n login: email,\n pass: password,\n access: [typeAccess]\n })\n .then((resp) => {\n setLoading(false);\n props.navigation.goBack();\n console.log(resp)\n })\n .catch((error) => {\n console.log(error);\n });\n }\n }", "title": "" }, { "docid": "d8e74083fc9c8579cc6c1f9923122f04", "score": "0.56229144", "text": "function setUser(name){\n\t\t//Update global variable\n\t\tuser = name;\n\n\t\t//Set display element\n\t\t$(\"#current-user\").text(user);\n\n\t\t//Save a cookie for persistent login\n\t\tsetCookie('User', user, 365);\n\n\t\t//Updates reference in the DB\n\t\tdatabase.ref(\"/connections/\"+connection.key).update({user: user});\n\t}", "title": "" }, { "docid": "2b720eefc03604cea94b0d1ad54bc2d3", "score": "0.56177884", "text": "function updateCurrentUser() {\n \"use strict\";\n\n generateNewKey().then((key) => {\n\n user.full_name = document.getElementById(\"name\").value;\n user.email = document.getElementById(\"email\").value;\n user.phone_number = document.getElementById(\"mobile_phone\").value;\n\n console.log(JSON.stringify(user));\n\n /**\n * TODO\n * 1) Send user details to background.js\n */\n chrome.runtime.sendMessage(\n {\n updateUser: user,\n },\n function(response) {\n console.log(response);\n }\n );\n });\n\n}", "title": "" }, { "docid": "d00fe87af8b96ea0f6c7f2881c48ea7f", "score": "0.5608731", "text": "function update(user) {\n return $http.put(ENV.apiEndpoint + 'account/update-profile/', user);\n }", "title": "" }, { "docid": "60efb581afbd5e9a6c58517c2cb7c983", "score": "0.5607077", "text": "updateUserConfig(props) {\n if (!props || Object.keys(props).length == 0)\n return;\n let { user } = this._configuration;\n let model = user.clone();\n Object.keys(props).forEach(key => {\n let val = props[key];\n if (val === undefined) {\n model.removeValue(key);\n }\n else if (is_1.objectLiteral(val)) {\n for (let k of Object.keys(val)) {\n model.setValue(`${key}.${k}`, val[k]);\n }\n }\n else {\n model.setValue(key, val);\n }\n });\n this.changeConfiguration(types_1.ConfigurationTarget.User, model);\n }", "title": "" } ]
729d0bafd85871656ec99d0b9b11a85c
Return string representation of the range using set notation
[ { "docid": "26e3815a49b67fe1fd134c10d418c8ed", "score": "0.6264038", "text": "toString() { return `{x | ${this.from} <= x <= ${this.to}}`; }", "title": "" } ]
[ { "docid": "7cc82b55bb7e5d0ef00f7d63f05b8fb9", "score": "0.7596561", "text": "toString() {\n const that = this;\n\n const str = that.ranges\n .map(([start, end]) => `[${start}, ${end})`)\n .join(' ');\n\n return str;\n }", "title": "" }, { "docid": "a0190b1d44ad2b530997b54f676e1e49", "score": "0.6792884", "text": "function rangeToString(r) {\n if (r == undefined) {\n return 'Range is undefined!';\n }\n\n return 'location: ' + r.start + ', length: ' + r.length;\n}", "title": "" }, { "docid": "e416d267d7ae948835568d1eac1f7735", "score": "0.6619431", "text": "toString() {\n return stringFormat(\"Repeat range from {0} to {1}\", this._e, this._b);\n }", "title": "" }, { "docid": "0eb73ecb3322fd19f96c7f88edf55ed8", "score": "0.64467925", "text": "output() {\n const res = []\n this.range.forEach(r => {\n res.push(`[${r[0]}, ${r[1]})`)\n })\n return res.join(\" \")\n }", "title": "" }, { "docid": "7e10d1b7a64909a6aec55f1a914f5bdf", "score": "0.63597375", "text": "function getRangeAsString(range) {\n if (!range) return '';\n return store.getAsString(_ContigInterval2['default'].fromGenomeRange(range));}", "title": "" }, { "docid": "a7ed9e89ac191bb7a4c10c182613a6bc", "score": "0.6327996", "text": "function ipRangeToString(ipRange) {\n return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;\n}", "title": "" }, { "docid": "9b3bb30fc243ca00114095ed8469370f", "score": "0.6263338", "text": "print() {\n console.log(this.ranges.reduce((acc, range) => (acc += `[${range[0]} ${range[1]}) `), ''));\n }", "title": "" }, { "docid": "48f7ef05c5be72c87fe6a91d1d91297c", "score": "0.6240769", "text": "function rangeToString(range) {\n if (range.offset < 0) {\n throw new RangeError(`Range.offset cannot be smaller than 0.`);\n }\n if (range.count && range.count <= 0) {\n throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`);\n }\n return range.count\n ? `bytes=${range.offset}-${range.offset + range.count - 1}`\n : `bytes=${range.offset}-`;\n}", "title": "" }, { "docid": "dd930b989cc3ce4cd25d57684f20f122", "score": "0.61907154", "text": "function reRange(first, last, reExtended) {\n var output;\n if (reExtended || first < 0x10000) {\n output = '['\n + reUnicode(first, reExtended)\n + '-'\n + reUnicode(last, reExtended)\n + ']';\n } else {\n var\n mpoint = first - 0x10000,\n high = 0xD800 + (mpoint >> 10),\n low = 0xDC00 + (mpoint & 0x3FF);\n output = reUnicode(high, false)\n +'['\n + reUnicode(low, false)\n + '-'\n + reUnicode(low + (last-first), false)\n + ']';\n }\n return output;\n }", "title": "" }, { "docid": "844e289fba9855a136f98daf2dc415b6", "score": "0.61539835", "text": "function Range() {}", "title": "" }, { "docid": "0dd0f084f3c0b6883f483de33e8de959", "score": "0.61428887", "text": "toString() {\n return `{ x| x ∉ ${this.set.toString()} }`;\n }", "title": "" }, { "docid": "03536399a9f9ae0891289f3fa16cdc72", "score": "0.61251277", "text": "function range(start, end) {\n var result = \"\";\n\n for(var i = start; i <= end; i++) {\n result += i;\n }\n\n return result;\n}", "title": "" }, { "docid": "d2ea654dae0a03364019f93394804645", "score": "0.6083604", "text": "function getRange(a,b) {\n return a === b ? a.toString(10) : a.toString(10) + \"->\" + b.toString(10);\n}", "title": "" }, { "docid": "6026931a6a589c1e6e71338497409df6", "score": "0.59768045", "text": "function numSetToString(set) {\n for (const setType of Object.keys(set)) {\n if (setType === \"pos_list\") {\n return set[setType].join(\",\");\n }\n if (setType === \"neg_list\") {\n if (set[setType].length !== 0) {\n return \"D* \\\\ {\" + set[setType].join(\",\") + \"}\";\n }\n else {\n return \"D*\"\n }\n }\n if (setType === \"string\") {\n return set[setType];\n }\n return \"\"\n }\n }", "title": "" }, { "docid": "2263af2854e8be346d0ad27f5c61708e", "score": "0.59395945", "text": "get rangeKey() {\n return this.getStringAttribute('range_key');\n }", "title": "" }, { "docid": "2263af2854e8be346d0ad27f5c61708e", "score": "0.59395945", "text": "get rangeKey() {\n return this.getStringAttribute('range_key');\n }", "title": "" }, { "docid": "2263af2854e8be346d0ad27f5c61708e", "score": "0.59395945", "text": "get rangeKey() {\n return this.getStringAttribute('range_key');\n }", "title": "" }, { "docid": "326cad159c752983f5abd20b3ce66c2d", "score": "0.59054404", "text": "function formatSelectOptionsForRange(start, end) {\n const options = [];\n\n for (let i = start; i <= end; i += 1) {\n options.push([i, i.toString()]);\n }\n\n return options;\n}", "title": "" }, { "docid": "0fbb513ede4952611f9529d5a9872a47", "score": "0.58867073", "text": "get range() {\n return this._options.range;\n }", "title": "" }, { "docid": "2ff679473321c82a1cee0d5abbdfbad7", "score": "0.58463687", "text": "function range(start, end) {\n // ..TODO..\n}", "title": "" }, { "docid": "7feac4f7fdd70f4af0cac3b84be24653", "score": "0.57265365", "text": "function range() {\n return function(input, start, end) {\n start = parseInt(start);\n end = parseInt(end);\n for (var i = start; i <= end; i++)\n input.push(i);\n return input;\n };\n }", "title": "" }, { "docid": "48c88008101f65ddde2bf147d0f5a00c", "score": "0.57211083", "text": "function setrange(property, amount) {\n ranges[property] = amount;\n}", "title": "" }, { "docid": "493b97973016a9c328a3db2a999929da", "score": "0.57193786", "text": "get range() {\n let range = (this.mDictionary.items.getValue(this.mDictionaryProperties.range));\n return range;\n }", "title": "" }, { "docid": "493b97973016a9c328a3db2a999929da", "score": "0.57193786", "text": "get range() {\n let range = (this.mDictionary.items.getValue(this.mDictionaryProperties.range));\n return range;\n }", "title": "" }, { "docid": "5b5424fe4887532e64c4751b2df4b553", "score": "0.5707343", "text": "toString() { return `(${this.from}...${this.to})`; }", "title": "" }, { "docid": "f6f23bf826e2a999d7a6bbdadbb3b93b", "score": "0.5685464", "text": "get ranges() {\n return this._f;\n }", "title": "" }, { "docid": "54935387b092a367d43e0fa21cd0db9e", "score": "0.56612766", "text": "function getRangeFormat(arg1){\n\tvar ans = \"\";\t\t\t\t\t// Our final string to output\n\tvar cnt = 0\t\t\t\t\t\t// the cnt variable will be our index\n\twhile(cnt < arg1.length){\t\n\n\t\t// Case 1: There's a chain of range!\n\t\tif (arg1[cnt]+1 == arg1[cnt+1]){\n\t\t\tans+= arg1[cnt]+\"-\";\t// We begin our range with the first instance\n\t\t\tvar k = 0;\t\t\t\t// k keeps a record of how long the range is\n\t\t\twhile(arg1[cnt+k]+1 == arg1[cnt+k+1]){\t// keep going till the range is broken\n\t\t\t\tk++;\t\n\t\t\t}\n\t\t\tif (cnt+k+1 < arg1.length)\t\t// check if we've reached the last character\n\t\t\t\tans+= arg1[cnt+k]+\",\";\t\t// if not, add the comma\n\t\t\telse\n\t\t\t\tans+= arg1[cnt+k];\t\t\t// if end, don't add comma\n\t\t\tcnt += k;\t\t\t\t\t\t// increase cnt to current k\n\t\t}\n\t\n\t\t// Case 2: There's no range chain!\n\t\telse {\t\n\t\t\tif (cnt+1<arg1.length)\t\t// check if last character\n\t\t\t\tans+=arg1[cnt]+\", \";\t// if not end, add comma\n\t\t\telse\t\t\t\t\t\t\n\t\t\t\tans+=arg1[cnt];\t\t\t// if end, don't add comma\n\t\t}\n\t\tcnt++;\t\t\t\t\t\t\t// move index to next array\n\t}\n\treturn ans;\t\t\t\t\t\t\t// print the answer!\n}", "title": "" }, { "docid": "a95f0f606ff7b4c75c05a5ed95a075b0", "score": "0.56038755", "text": "function getRangeAddress(range) {\n return getCellAddress(range[0], range[1]) + ':' + getCellAddress(range[2], range[3]);\n}", "title": "" }, { "docid": "6075b24d8733fe7c4ec4c5e8f70672e0", "score": "0.5584234", "text": "function RangedValue() {}", "title": "" }, { "docid": "4ebee3bf3da726cb046b3c1dcca5020c", "score": "0.5583377", "text": "toString() { return \"(\" + this.from + \"...\" + this.to + \")\"; }", "title": "" }, { "docid": "d27776fa91d83971f83c1d17470a1cfc", "score": "0.5579013", "text": "function get_range (age_end) {\n if (age_end <= 60)\n return '50 - 60';\n\n if (age_end <= 65)\n return '61 - 65';\n\n return '66 - 70';\n }", "title": "" }, { "docid": "0e1ae220d8d3474ca740fd3aea9b53e5", "score": "0.5554426", "text": "print() {\n var str = \"\";\n for(var i=0; i<this.rangeArr.length; i++){\n str += \"[\" + this.rangeArr[i][0] + \", \" + this.rangeArr[i][1] + \") \";\n }\n console.log(str.trim());\n }", "title": "" }, { "docid": "062044b7ee65ea4fc493ec5c88a6fc2c", "score": "0.5551538", "text": "get showRange() {\n return unwrapNullable(this._showRange$i);\n }", "title": "" }, { "docid": "b065152a1dc3491e376789a48d7cd312", "score": "0.5543531", "text": "function range (min, max) {\n\n}", "title": "" }, { "docid": "59e6be1c15ef5c419ca4387acb293e3a", "score": "0.5541672", "text": "function SettableRangedValue() {}", "title": "" }, { "docid": "f3e1a17ee997578845a5f4cf3b323dd7", "score": "0.5535774", "text": "function solution(list){\n const filtered = list.map(function(item){\n \t//filter list of numbers in between ranges.ie only keeping isolated numbers and low and highpoints of ranges\n if(item - (list[list.indexOf(item) - 1]) !== 1 && list[list.indexOf(item) + 1 ] - item === 1){\n return item.toString()//make lowpoint in range a string to identify for later using typeof\n }\n else if(item - list[list.indexOf(item) - 1] !== 1 || list[list.indexOf(item) + 1 ] - item !==1){\n return item\n }\n }) \n //filter undefined values\n const ranges = filtered.filter(item=>{\n return item !==undefined\n })\n //find string values in array which represent low points of range and use string templates to make ranges\nconst final = ranges.map(item=>{\n if(item === ranges[0] && typeof item == 'string'){\n return `${item}-${ranges[(ranges.indexOf(item) + 1)]}`\n }\n else if(item === ranges[0] && !(typeof item == 'string')){\n return `${item}`\n }\n else if(typeof item == 'string'){\n return `${item}-${ranges[(ranges.indexOf(item) + 1)]}`\n }\n})\n //filter for undefined values once more and join so we end up with one string of values\n return final.filter(item=>{\n return item !==undefined\n }).join()\n}", "title": "" }, { "docid": "5854a978e61e0b88ea44bd3ad8c7efec", "score": "0.5532232", "text": "print() {\n return this.range.length === 0\n ? console.log('This range is empty')\n : console.log(\n this.range\n .map(subrange => `[${subrange[0]}, ${subrange[1]})`)\n .join(' ')\n );\n }", "title": "" }, { "docid": "78ae60fc7c13fe58763356883c2db173", "score": "0.551281", "text": "setRange( min, max ){\n\t\tthis.rangeMin = min;\n\t\tthis.rangeMax = max;\n\t}", "title": "" }, { "docid": "cbcee6eee0afae9b2bc7f1dc992248ba", "score": "0.5508912", "text": "print() {\n\tvar result = '';\n const {length} = this.list;\n var previousExists = false;\n var rangeStart;\n \n // Range Creation by looping through the list by checking boolean values\n for (i = 0; i <= length; i++) {\n \n // If a number to the left of i doesn't exist, set start of a new range \n if (this.list[i] && (!i || !previousExists)) {\n rangeStart = i;\n }\n \n // If number to the left of i is exists, but i doesn't end the range \n if (previousExists && !this.list[i]) {\n result += `[${rangeStart}, ${i}) `;\n }\n previousExists = this.list[i];\n }\n\n console.log(result);\n }", "title": "" }, { "docid": "6f3dc94930b38dcd4002a5eb3cf686da", "score": "0.5503121", "text": "function range(start, end) {\n if (end === start) {\n return start;\n } else {\n return [start++].concat(range(start, end));\n }\n}", "title": "" }, { "docid": "8b632a63781378e0044b956870a02035", "score": "0.54765856", "text": "set showRange(a) {\n arguments[0] = wrapNullable(Boolean_$type, arguments[0]);\n this._showRange$i = arguments[0];\n }", "title": "" }, { "docid": "49ef12d53682e458e9cdd1a918357214", "score": "0.54638684", "text": "function Range(start, end) {\n this.start = start.value;\n this.end = end.value;\n }", "title": "" }, { "docid": "776a2e0c765543ebda57908a62a6aa0e", "score": "0.5450804", "text": "function add_range(range_string) {\n var wkt = new Wkt.Wkt();\n wkt.read(range_string);\n obj = wkt.toObject({\n strokeColor: '#666',\n strokeWeight: 5,\n strokeOpacity: 0.5,\n fillOpacity: 0,\n clickable: false\n });\n obj.setMap(map);\n return obj;\n}", "title": "" }, { "docid": "7101218ccaa50941ccb6b30832dbd44b", "score": "0.5427459", "text": "_range (datum, [min, max]) {\n throw new Error('_range not implemented')\n }", "title": "" }, { "docid": "54450cf566ff774807addee36b2df245", "score": "0.5412229", "text": "function makeRange(title, fromCol, fromRow, toCol, toRow) {\n if (fromCol === toCol) {\n fromCol = colAsString(fromCol);\n toCol = fromCol;\n } else {\n fromCol = colAsString(fromCol);\n toCol = colAsString(toCol);\n }\n return title + \"!\" + fromCol + fromRow + \":\" + toCol + toRow;\n }", "title": "" }, { "docid": "5f5f58edb7577875e745c9987e5f5c16", "score": "0.5401082", "text": "function getStringEnumerator(range) {\n var tempArray, i,\n tempString = '',\n finalValue;\n (range.indexOf(',') >= 0) ? (tempArray = range.split(',')) : (tempArray = range.split('or'));\n for (i = 0; i < tempArray.length; i++) {\n finalValue = tempArray[i].trim();\n finalValue = finalValue.replace(/\"/g, '');\n tempString += '<xs:enumeration value=\"' +\n finalValue + '\"/>';\n }\n\n return tempString;\n}", "title": "" }, { "docid": "6a92a924599f72cfc48780ce7fb41ecd", "score": "0.5397504", "text": "function Range(from, to) {\r\n this.from = from;\r\n this.to = to;\r\n}", "title": "" }, { "docid": "9c30525380c01d1368c1800ec5ed0571", "score": "0.539043", "text": "static of(ranges, sort = false) {\n let build = new RangeSetBuilder();\n\n for (let range of ranges instanceof Range ? [ranges] : sort ? lazySort(ranges) : ranges) build.add(range.from, range.to, range.value);\n\n return build.finish();\n }", "title": "" }, { "docid": "d9b61cff9dc1603c155d3e648bba2b49", "score": "0.5387833", "text": "function TARange() {\r\n this.elm = null;\r\n this.start = 0;\r\n this.end = 0;\r\n}", "title": "" }, { "docid": "9bb5925d2134377f57eea7fdd90b7b24", "score": "0.53834116", "text": "get ranges() {\n return {\n temperatureC: [0, 60],\n pressurehP: [900, 1100],\n humidityPercent: [20, 80]\n };\n }", "title": "" }, { "docid": "ad0b97df074489a26990110bb8d352d5", "score": "0.53691524", "text": "function getRangeValues (range, element) {\n var parsed = parseInt (range.value);\n parsed = get_nums (parsed);\n if (parsed !== false) element.innerText = parsed;\n return range = parsed;\n\n}", "title": "" }, { "docid": "d72f0e88433f09f8e33266f5c4981558", "score": "0.5349192", "text": "parseRanges() {\n var i, k, cell_range;\n this.cells = [];\n for (i = 0; (cell_range = this.cell_ranges[i]); i++) {\n var split_x = cell_range.x.split('-'),\n split_y = cell_range.y.split('-'),\n x,\n y,\n x_from,\n x_to,\n y_from,\n y_to;\n\n if (split_x.length > 1) {\n x_from = Number(split_x[0]);\n x_to = Number(split_x[1]);\n y = split_y[0];\n for (\n k = x_from;\n x_from < x_to ? k <= x_to : k >= x_to;\n x_from < x_to ? k++ : k--\n ) {\n this.cells.push(`${k}-${y}`);\n }\n } else if (split_y.length > 1) {\n x = split_x[0];\n y_from = Number(split_y[0]);\n y_to = Number(split_y[1]);\n for (\n k = y_from;\n y_from < y_to ? k <= y_to : k >= y_to;\n y_from < y_to ? k++ : k--\n ) {\n this.cells.push(`${x}-${k}`);\n }\n } else {\n x = split_x[0];\n y = split_y[0];\n this.cells.push(`${x}-${y}`);\n }\n }\n }", "title": "" }, { "docid": "255ebc18ad28ccce40a3694de10eef4c", "score": "0.5332172", "text": "function TStylingRange() {}", "title": "" }, { "docid": "255ebc18ad28ccce40a3694de10eef4c", "score": "0.5332172", "text": "function TStylingRange() {}", "title": "" }, { "docid": "255ebc18ad28ccce40a3694de10eef4c", "score": "0.5332172", "text": "function TStylingRange() {}", "title": "" }, { "docid": "2224aafcf993c8cca3c9e91a73247a9e", "score": "0.53311265", "text": "function getRangeInclusive(a, b) {\n var s = \"\";\n if (a > b) {\n for (var i = a; i >= b; i--) {\n // console.log(i);\n s = s + i + \" \";\n }\n } else {\n for (var i = a; i <= b; i++) {\n // console.log(i);\n s = s + i + \" \";\n }\n }\n console.log(s);\n}", "title": "" }, { "docid": "5fde1158f247ee8ac7440cd1a9ee928f", "score": "0.5326955", "text": "add(newRange) {\n if (this.range.length === 0) {\n this.range = [newRange]\n } else {\n let start = newRange[0]\n let end = newRange[1]\n const res = []\n this.range.forEach(r => {\n if (r[1] < start) {\n res.push(r)\n } else if (r[0] > end) {\n res.push([start, end])\n start = r[0]\n end = r[1]\n } else {\n start = Math.min(start, r[0])\n end = Math.max(end, r[1])\n }\n })\n res.push([start, end])\n this.range = res\n }\n }", "title": "" }, { "docid": "adf0cba2f11d04e46a9d7f4406824f15", "score": "0.53202546", "text": "function range(start, end){\n\n return (start === end) ? [start] : range(start, end - 1).concat([end]);\n\n}", "title": "" }, { "docid": "61f3c8da30f761150780f30763b9e8eb", "score": "0.52984744", "text": "get range() {\n return ['range', 'week'].includes(this.mode) || this._range;\n }", "title": "" }, { "docid": "07941611d08f0645b373a1f9553c8dee", "score": "0.52972895", "text": "function range(from, to) {\n var result = inherit(range.methods);\n result.from = from;\n result.to = to;\n return result;\n}", "title": "" }, { "docid": "d7e3cb29b51b458319b9b03c35c70648", "score": "0.5292053", "text": "static set(of, sort = false) {\n return _rangeset.RangeSet.of(of, sort);\n }", "title": "" }, { "docid": "6cfdd581882dc7c6ae3c2be50a42032e", "score": "0.5277654", "text": "function updateRangeHtml() {\n var el, newPoint, newPlace, offset, siblings, k;\n width = this.offsetWidth; //Get the input width\n newPoint = (this.value - this.getAttribute(\"min\")) / (this.getAttribute(\"max\") - this.getAttribute(\"min\")); //Calculate where how far the point has been dragged\n offset = -1;\n if (newPoint < 0) { newPlace = 0; }//If the point is less than 0, make the newplace 0\n else if (newPoint > 1) { newPlace = width; } //If the point is larger then 1, set the newplace to our width variable\n else { newPlace = width * newPoint + offset; offset -= newPoint;} //Otherwise, take the width times our new point plus the offset. Make the offset variable: offset (-1) minus the new point.\n outPutObject = document.getElementById(\"rangeText\"); //Get the output cause we need to fill it with the value\n outputTag = outPutObject;\n outputTag.innerHTML = this.value+'cm';\n}", "title": "" }, { "docid": "3e309f46479850e1d98ab234bba4e914", "score": "0.5264597", "text": "function _createRange(start, end, isReverse, containerId) {\n if (isReverse) {\n var tmp = start;\n start = end;\n end = tmp;\n }\n return new Range(start, end, isReverse, containerId);\n }", "title": "" }, { "docid": "2c958b24a2ddb33383cedb73a47d7c67", "score": "0.52491397", "text": "function range(len) {\n var rangeSet = createSet();\n for (var i = 0; i < len; i++) {\n rangeSet.add(i);\n }\n\n return rangeSet;\n}", "title": "" }, { "docid": "6922d5a7cb6b975b890d8d3581530977", "score": "0.5242929", "text": "get valueRange() {\n\t\treturn this.__valueRange;\n\t}", "title": "" }, { "docid": "84b1d1227e25423c8ff3d395d1bcd724", "score": "0.5238362", "text": "function range(start, end) {\n return regeneratorRuntime.wrap(function range$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(start <= end)) {\n _context.next = 6;\n break;\n }\n\n _context.next = 3;\n return start;\n\n case 3:\n\n start++;\n _context.next = 0;\n break;\n\n case 6:\n case 'end':\n return _context.stop();\n }\n }\n }, _marked, this);\n}", "title": "" }, { "docid": "242e7b175a8bd35f29b8505445ca08ba", "score": "0.5236969", "text": "function RangeSeq(from, to)\n {\n this.postion = from - 1;\n this.end = to;\n }", "title": "" }, { "docid": "52b915ce07dd3d192109e6ba70abe88c", "score": "0.5219188", "text": "function getRange() {\n var first = this.first ? this : this.sibling\n var second = first.sibling\n\n return {\n start: first.dateSelected,\n end: second.dateSelected\n }\n}", "title": "" }, { "docid": "fbc79d784dd20312076945788f058198", "score": "0.5218168", "text": "setRange(min, max) {\n this.left = min;\n this.right = max;\n }", "title": "" }, { "docid": "c8c918c2dfada79adbb69508c918edf8", "score": "0.5216054", "text": "function range(start, end) {\n return new Array(end - start + 1).join(' ').split(' ').map(function (_, i) { return start + i; });\n }", "title": "" }, { "docid": "f441d67875e7619877c0f7994a33a6d0", "score": "0.52152056", "text": "function TStylingRange() { }", "title": "" }, { "docid": "73e01e13a5702899ed7c49b8821e61a2", "score": "0.5212117", "text": "function range(start, end) {\n let nums = [];\n // for (let i = 0; i < end; i++ , start++) {\n // group[i] = start;\n // }\n for (let i = start; i <= end; i++) {\n nums.push(i);\n }\n return nums;\n}", "title": "" }, { "docid": "04bdd9753a7e22a9d690f3431ce9b87b", "score": "0.5204011", "text": "setRange(min, max) {\n this.min = min;\n this.max = max;\n }", "title": "" }, { "docid": "04bdd9753a7e22a9d690f3431ce9b87b", "score": "0.5204011", "text": "setRange(min, max) {\n this.min = min;\n this.max = max;\n }", "title": "" }, { "docid": "0fbe940255bf06b17c9556f4e801815c", "score": "0.51908493", "text": "function expandNumberRange(start, end, by) {\n\t by = by || 1; //incrementing by 0 is a bad idea\n\t var converted = [];\n\t for (var i=start; i<=end; i+=by) {\n\t converted.push( Numbered.stringify(i).replace(/-/g,' ') );\n\t }\n\t return converted;\n\t}", "title": "" }, { "docid": "b65960d41a8bdaa35f429a0df4d172ec", "score": "0.51891243", "text": "join( range ) {\n return new CobaltAnnotation( this.range.join( range ), this.tag );\n }", "title": "" }, { "docid": "58893d7477df20373badf9d55236f56c", "score": "0.51778775", "text": "function ranges (){\n var create = '<select id=\"groups\">';\n for(var i = 0, j = gpaRanges.length; i < j; i++)\n {\n create += '<option value=\"'+gpaRanges[i]+'\">'+gpaRanges[i]+'</option>';\n }\n create += '</select>';\n $('#select').append($(create));\n }", "title": "" }, { "docid": "a4d83d5bdbc769a388a73458e35644cf", "score": "0.5163895", "text": "range(min, max) {\n var { value } = this.fields[this.scope][this.key];\n if (Array.isArray(value) || typeof value === \"string\") {\n if (value.length >= min && value.length <= max) {\n return this;\n }\n }\n value = parseInt(value);\n if (!isNaN(value)) {\n if (value >= min && value <= max) {\n return this;\n }\n }\n this.reportInvalid(\"vRange\", `${min}-${max}`);\n return this;\n }", "title": "" }, { "docid": "2ac9fa51344942482f408274f402f4a5", "score": "0.5154582", "text": "function expandStringRanges(ranges, inBrackets, inverse) {\n var bounds = [];\n ranges.forEach(function (range) {\n bounds.push(parseInt(range[0], 16));\n bounds.push(parseInt(range[1], 16));\n });\n return expandIntRanges(bounds, inBrackets, inverse);\n }", "title": "" }, { "docid": "89e9da79091ba475b3cff12ae846a006", "score": "0.5148937", "text": "function getNumberExclusive(range, exception) {\n\n var tempArray, tempString = '',\n finalString;\n //If only minimum range is mentioned then we split with \"or\" delimeter\n (exception === 'minOnly') ? (tempArray = range.split('or')) : (tempArray = range.split('-'));\n //Remove all non-numeric characters\n\n\n //fix for -360-360 this type of range\n if(tempArray[0] === \"\")\n finalString =\"-\" + tempArray[1].trim().replace(/\\D/g, '');\n else\n finalString = tempArray[0].trim().replace(/\\D/g, ''); \n\n tempString += '<xs:minInclusive value=\"' +\n finalString + '\"/>';\n //Remove all non-numeric characters\n finalString = tempArray[1].trim().replace(/\\D/g, '');\n (exception !== 'minOnly') ? tempString += '<xs:maxInclusive value=\"' + finalString + '\"/>': '';\n\n return tempString;\n}", "title": "" }, { "docid": "a53021fb98326411339c4745f6a0872f", "score": "0.51463", "text": "get $from() {\n return this.ranges[0].$from\n }", "title": "" }, { "docid": "e206346086e750d5d1cbf64650d75b15", "score": "0.51284295", "text": "setRange(range) {\n this.selectedRange = range;\n\n this.drawChart();\n }", "title": "" }, { "docid": "89ee7aba00f793a9ee043d79ace26b3a", "score": "0.5117789", "text": "get ipRange() {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start\n };\n }\n return undefined;\n }", "title": "" }, { "docid": "37812ef04a47102bbcdd5f61fd0c37e9", "score": "0.5108145", "text": "get $to() {\n return this.ranges[0].$to\n }", "title": "" }, { "docid": "ea1940c9889251082ddd7131e2562c26", "score": "0.51079786", "text": "get activeRange() {\n const activeRange = this.findRangeForSituation()\n return activeRange && this.toRange(activeRange)\n }", "title": "" }, { "docid": "99c4199090dd876c1149ba1634017e19", "score": "0.5106804", "text": "get ipRange() {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start\n };\n }\n return void 0;\n }", "title": "" }, { "docid": "7261c4833cd7b66dae72f691468eec8e", "score": "0.5106713", "text": "function isoform_range(reg) {\n\n //range per la finestra della struttura\n var x = d3.scale.log()\n .rangeRound([0, width_isoform - margin_isoform.left - margin_isoform.right], .1);\n\n //valorei minimo e massimo di inizio e fine dei blocchi\n var min = d3.min(reg, function(d) { return d.start; });\n var max = d3.max(reg, function(d) { return d.end; });\n\n x.domain([min, max], .1);\n\n return x;\n}", "title": "" }, { "docid": "d106c1a438fd42683189501b3c6711df", "score": "0.51032984", "text": "getRange(startObj, endObj) {\n return exports.util.createRangeFromPositions(startObj.range.start, endObj.range.end);\n }", "title": "" }, { "docid": "051742b5551eca9236f9f9517295504b", "score": "0.508891", "text": "function replaceXRanges (ranges) {\n return ranges.split(/\\s+/)\n .map(replaceXRange)\n .join(\" \")\n}", "title": "" }, { "docid": "090651d217d9a8a9d739901bb36e14dc", "score": "0.5087751", "text": "ranges () {\n var range = this._list.at(0)\n const ranges = []\n while (range) {\n ranges.push([range.data.a, range.data.b])\n range = range.prev\n }\n return ranges\n }", "title": "" }, { "docid": "74f6dc3ca47f76d6f5639579b695afcb", "score": "0.5087456", "text": "function range(start, end) {\n const startToEnd = [];\n for (let i = start; i <= end; i++) {\n startToEnd.push(i);\n }\n return startToEnd;\n}", "title": "" }, { "docid": "3e5751c9dc33a1fb55c2051c72ee83ff", "score": "0.50830275", "text": "function parseRange(str) {\n var params = str.split('x')\n var numbers = params[0].split('-')\n var delta = parseInt(params[1], 10)\n\n numbers = numbers.map(function (num) {\n return parseInt(num, 10)\n })\n\n if (numbers.length > 1) {\n numbers = numbers.reduce(function (prev, curr) {\n return range(prev, curr, delta)\n })\n }\n\n return flatten(numbers)\n}", "title": "" }, { "docid": "6bc0231ef35e0437845f80c09b6d8e5d", "score": "0.50797844", "text": "static ipAddressRange(range) {\n return Match.cidr(range);\n }", "title": "" }, { "docid": "416624599d46feec7fbe3cd97065fc4d", "score": "0.507643", "text": "toString() {\n return `{${this.values().join(', ')}}`;\n }", "title": "" }, { "docid": "bd337769f41ed6e14455f46b2a54e112", "score": "0.5075156", "text": "range(from, to = from) {\n return new Range(from, to, this);\n }", "title": "" }, { "docid": "e6a26e39c74e84695d48be81a34d8aaa", "score": "0.507483", "text": "function generateRange(start, end) {\n return t => t >= start.codePointAt(0) && t < end.codePointAt(0);\n}", "title": "" }, { "docid": "74344118fe198969438067c33d8d536f", "score": "0.50743353", "text": "getSelectedRange() {\n let range;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.startValue) && !Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.endValue)) {\n range = (Math.round(Math.abs((this.startValue.getTime() - this.endValue.getTime()) / (1000 * 60 * 60 * 24))) + 1);\n this.disabledDateRender();\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(this.disabledDayCnt)) {\n range = range - this.disabledDayCnt;\n this.disabledDayCnt = null;\n }\n }\n else {\n range = 0;\n }\n return { startDate: this.startValue, endDate: this.endValue, daySpan: range };\n }", "title": "" }, { "docid": "65dcb02b215cc1573c9f6d44294da832", "score": "0.5074203", "text": "function getRange(d1, d2) {\n return Utilities.formatDate(d1, 'GMT-5', 'yyyy-MM-dd') + \" to \" + Utilities.formatDate(d2, 'GMT-5', 'yyyy-MM-dd'); \n}", "title": "" }, { "docid": "565a667f881da466d17a94ce78dfe378", "score": "0.5070381", "text": "range() {\n if (typeof this.min != \"undefined\" && typeof this.max != \"undefined\") {\n return [this.min, this.max];\n }\n return null;\n }", "title": "" }, { "docid": "565a667f881da466d17a94ce78dfe378", "score": "0.5070381", "text": "range() {\n if (typeof this.min != \"undefined\" && typeof this.max != \"undefined\") {\n return [this.min, this.max];\n }\n return null;\n }", "title": "" } ]
64bf1471756cbf0e5e3b86d2a73050bc
3. METHODES NECESSAIRES AUX ACTIONS DANS LA VUE
[ { "docid": "21aafe1fed6a2c7d712b8d3c4a11f0e8", "score": "0.0", "text": "function _enregistrerCompte() {\n var compte = _lireInfosCompte();\n if (!compte.nom || !compte.motDePasse) {\n swal(\"Nom et mot de passe sont obligatoires !\", \"Veuillez compléter svp\", \"warning\"); \n } else {\n httpServ.creerCompte(compte).then(data => {\n var login = JSON.parse(data);\n if (login.nom) {\n httpServ.chargerVue(\"login\");\n swal(\"OK, le compte a été créé !\", login.nom + \" - \" + login.domaine, \"info\");\n } else {\n swal(\"Le compte existe déjà !\", \"Veuillez changer de nom et/ou de domaine\", \"warning\");\n }\n });\n } \n }", "title": "" } ]
[ { "docid": "5ca3844fbc39ea372bc058cf3e8c8e75", "score": "0.5873449", "text": "bouger()\n {\n this.gauche += this.vitesseX;\n this.haut += this.vitesseY;\n this.limite();\n this.majHTML();\n }", "title": "" }, { "docid": "6dec9cef29d89f8c9037107b36e0f9e9", "score": "0.5762711", "text": "function finPartie(){\r\n\t\tif (joueur.vie<=0){\r\n\t\t\talert(\"Vous avez perdu !\");\r\n\t\t}\r\n\t\t//joueur.vie=3;\r\n\t\t//BaseObject.remiseAzero();\r\n\t\t\r\n\t}", "title": "" }, { "docid": "72cea549bdb26888dae48d01c8565d49", "score": "0.5749977", "text": "function oponente(){\n var pontoJogar;\n var jogou = false;\n //jogadas de vitórias scriptada para tornar IA competitiva primariamente vencendo e bloqueando vitórias\n // vitória na primeira linha\n if((tabuleiro[0] != null && tabuleiro[1] != null) && \n (tabuleiro[0] == tabuleiro[1]) && (tabuleiro[0] != init && tabuleiro[2] == null)){\n proximo(valor,2,5,1);\n }\n else if((tabuleiro[1] != null && tabuleiro[2] != null) && \n (tabuleiro[1] == tabuleiro[2]) && (tabuleiro[1] != init && tabuleiro[0] == null)){\n proximo(valor,0,1,1);\n }\n else if((tabuleiro[0] != null && tabuleiro[2] != null) \n && (tabuleiro[0] == tabuleiro[2]) && (tabuleiro[0] != init && tabuleiro[1]==null)){\n proximo(valor,1,3,1)\n }\n // //vitória na segunda linha\n else if((tabuleiro[3] != null && tabuleiro[4] != null) \n && (tabuleiro[3] == tabuleiro[4]) && tabuleiro[3] != init && tabuleiro[5] == null){\n proximo(valor,5,5,3);\n }\n else if((tabuleiro[4] != null && tabuleiro[5] != null) \n && (tabuleiro[4] == tabuleiro[5]) && tabuleiro[4] != init && tabuleiro[3] == null){\n proximo(valor,3,1,3);\n }\n else if((tabuleiro[3] != null && tabuleiro[5] != null) \n && (tabuleiro[3] == tabuleiro[5]) && tabuleiro[3] != init && tabuleiro[4] == null){\n proximo(valor,4,3,3);\n }\n // //vitória na terceira linha\n else if((tabuleiro[6] != null && tabuleiro[7] != null) \n && (tabuleiro[6] == tabuleiro[7]) && tabuleiro[6] != init && tabuleiro[8] == null){\n proximo(valor,8,5,5);\n }\n else if((tabuleiro[7] != null && tabuleiro[8] != null) \n && (tabuleiro[7] == tabuleiro[8]) && tabuleiro[7] != init && tabuleiro[3] == null){\n proximo(valor,6,1,5);\n }\n else if((tabuleiro[6] != null && tabuleiro[8] != null) \n && (tabuleiro[6] == tabuleiro[8]) && tabuleiro[6] != init && tabuleiro[7] == null){\n proximo(valor,7,3,5);\n }\n // //vitória na primeira coluna\n else if((tabuleiro[0] != null && tabuleiro[3] != null) \n && (tabuleiro[0] == tabuleiro[3]) && (tabuleiro[0] != init && tabuleiro[6] == null)){\n proximo(valor,6,1,5);\n }\n else if((tabuleiro[3] != null && tabuleiro[6] != null) \n && (tabuleiro[3] == tabuleiro[6]) && tabuleiro[6] != init && tabuleiro[0] == null){\n proximo(valor,0,1,1);\n }\n else if((tabuleiro[0] != null && tabuleiro[6] != null) \n && (tabuleiro[0] == tabuleiro[6]) && tabuleiro[0] != init && tabuleiro[3] == null){\n proximo(valor,3,1,3);\n }\n // //vitória na segunda coluna\n else if((tabuleiro[1] != null && tabuleiro[4] != null) \n && (tabuleiro[1] == tabuleiro[4]) && tabuleiro[4] != init && tabuleiro[7] == null){\n proximo(valor,7,3,5);\n }\n else if((tabuleiro[4] != null && tabuleiro[7] != null) \n && (tabuleiro[4] == tabuleiro[7]) && tabuleiro[7] != init && tabuleiro[1]==null){\n proximo(valor,1,3,1);\n }\n else if((tabuleiro[1] != null && tabuleiro[7] != null) \n && (tabuleiro[1] == tabuleiro[7]) && tabuleiro[1] != init && tabuleiro[4] == null){\n proximo(valor,4,3,3);\n }\n // //vitória na terceira coluna\n else if((tabuleiro[2] != null && tabuleiro[5] != null) \n && (tabuleiro[2] == tabuleiro[5]) && tabuleiro[5] != init && tabuleiro[8] == null){\n proximo(valor,8,5,5);\n }\n else if((tabuleiro[5] != null && tabuleiro[8] != null) \n && (tabuleiro[5] == tabuleiro[8]) && tabuleiro[8] != init && tabuleiro[2] == null){\n proximo(valor,2,5,1);\n }\n else if((tabuleiro[2] != null && tabuleiro[8] != null) \n && (tabuleiro[2] == tabuleiro[8]) && tabuleiro[8] != init && tabuleiro[5] == null){\n proximo(valor,5,5,3);\n }\n // // vitoria na diagonal principal\n else if((tabuleiro[0]!= null && tabuleiro[8]!= null)&& (tabuleiro[0]==tabuleiro[8])\n && (tabuleiro[8] != init && tabuleiro[4] == null)){\n proximo(valor,4,3,3);\n }\n else if((tabuleiro[0]!= null && tabuleiro[4]!= null)&& (tabuleiro[0]==tabuleiro[4])\n && (tabuleiro[4] != init && tabuleiro[8] == null)){\n proximo(valor,8,5,5);\n }\n else if((tabuleiro[4]!= null && tabuleiro[8]!= null)&& (tabuleiro[4]==tabuleiro[8])\n && (tabuleiro[8] != init && tabuleiro[0] == null)){\n proximo(valor,0,1,1);\n }\n // // vitoria na diagonal secundaria\n else if((tabuleiro[2]!= null && tabuleiro[6]!= null)&& (tabuleiro[2]==tabuleiro[6])\n && (tabuleiro[2] != init && tabuleiro[4] == null)){\n proximo(valor,4,3,3);\n }\n else if((tabuleiro[2]!= null && tabuleiro[4]!= null)&& (tabuleiro[2]==tabuleiro[4])\n && (tabuleiro[4] != init && tabuleiro[6] == null)){\n proximo(valor,6,1,5);\n }\n else if((tabuleiro[4]!= null && tabuleiro[6]!= null)&& (tabuleiro[4]==tabuleiro[6])\n && (tabuleiro[4] != init && tabuleiro[2] == null)){\n proximo(valor,2,5,1);\n }\n\n //com semantica muito proxima da vitória,os bloqueios precisam ser colocado depois pois é \n //prioritário vencer\n\n // //bloqueio de vitória na primeira linha\n else if((tabuleiro[0] != null && tabuleiro[1] != null) && \n (tabuleiro[0] == tabuleiro[1]) && (tabuleiro[0] == init && tabuleiro[2] == null)){\n proximo(valor,2,5,1);\n }\n else if((tabuleiro[1] != null && tabuleiro[2] != null) && \n (tabuleiro[1] == tabuleiro[2]) && (tabuleiro[1] == init && tabuleiro[0] == null)){\n proximo(valor,0,1,1);\n }\n else if((tabuleiro[0] != null && tabuleiro[2] != null) \n && (tabuleiro[0] == tabuleiro[2]) && (tabuleiro[0] == init && tabuleiro[1]==null)){\n proximo(valor,1,3,1)\n }\n // //bloqueio de vitória na segunda linha\n else if((tabuleiro[3] != null && tabuleiro[4] != null) \n && (tabuleiro[3] == tabuleiro[4]) && tabuleiro[3] == init && tabuleiro[5] == null){\n proximo(valor,5,5,3);\n }\n else if((tabuleiro[4] != null && tabuleiro[5] != null) \n && (tabuleiro[4] == tabuleiro[5]) && tabuleiro[4] == init && tabuleiro[3] == null){\n proximo(valor,3,1,3);\n }\n else if((tabuleiro[3] != null && tabuleiro[5] != null) \n && (tabuleiro[3] == tabuleiro[5]) && tabuleiro[3] == init && tabuleiro[4] == null){\n proximo(valor,4,3,3);\n }\n // //bloqueio de vitória na terceira linha\n else if((tabuleiro[6] != null && tabuleiro[7] != null) \n && (tabuleiro[6] == tabuleiro[7]) && tabuleiro[6] == init && tabuleiro[8] == null){\n proximo(valor,8,5,5);\n }\n else if((tabuleiro[7] != null && tabuleiro[8] != null) \n && (tabuleiro[7] == tabuleiro[8]) && tabuleiro[7] == init && tabuleiro[3] == null){\n proximo(valor,6,1,5);\n }\n else if((tabuleiro[6] != null && tabuleiro[8] != null) \n && (tabuleiro[6] == tabuleiro[8]) && tabuleiro[6] == init && tabuleiro[7] == null){\n proximo(valor,7,3,5);\n }\n // //bloqueio de vitória na primeira coluna\n else if((tabuleiro[0] != null && tabuleiro[3] != null) \n && (tabuleiro[0] == tabuleiro[3]) && (tabuleiro[0] == init && tabuleiro[6] == null)){\n proximo(valor,6,1,5);\n }\n else if((tabuleiro[3] != null && tabuleiro[6] != null) \n && (tabuleiro[3] == tabuleiro[6]) && tabuleiro[6] == init && tabuleiro[0] == null){\n proximo(valor,0,1,1);\n }\n else if((tabuleiro[0] != null && tabuleiro[6] != null) \n && (tabuleiro[0] == tabuleiro[6]) && tabuleiro[0] == init && tabuleiro[3] == null){\n proximo(valor,3,1,3);\n }\n // //bloqueio de vitória na segunda coluna\n else if((tabuleiro[1] != null && tabuleiro[4] != null) \n && (tabuleiro[1] == tabuleiro[4]) && tabuleiro[4] == init && tabuleiro[7] == null){\n proximo(valor,7,3,5);\n }\n else if((tabuleiro[4] != null && tabuleiro[7] != null) \n && (tabuleiro[4] == tabuleiro[7]) && tabuleiro[7] == init && tabuleiro[1]==null){\n proximo(valor,1,3,1);\n }\n else if((tabuleiro[1] != null && tabuleiro[7] != null) \n && (tabuleiro[1] == tabuleiro[7]) && tabuleiro[1] == init && tabuleiro[4] == null){\n proximo(valor,4,3,3);\n }\n // //bloqueio de vitória na terceira coluna\n else if((tabuleiro[2] != null && tabuleiro[5] != null) \n && (tabuleiro[2] == tabuleiro[5]) && tabuleiro[5] == init && tabuleiro[8] == null){\n proximo(valor,8,5,5);\n }\n else if((tabuleiro[5] != null && tabuleiro[8] != null) \n && (tabuleiro[5] == tabuleiro[8]) && tabuleiro[8] == init && tabuleiro[2] == null){\n proximo(valor,2,5,1);\n }\n else if((tabuleiro[2] != null && tabuleiro[8] != null) \n && (tabuleiro[2] == tabuleiro[8]) && tabuleiro[8] == init && tabuleiro[5] == null){\n proximo(valor,5,5,3);\n }\n // //bloqueio de vitoria na diagonal principal\n else if((tabuleiro[0]!= null && tabuleiro[8]!= null)&& (tabuleiro[0]==tabuleiro[8])\n && (tabuleiro[8] == init && tabuleiro[4] == null)){\n proximo(valor,4,3,3);\n }\n else if((tabuleiro[0]!= null && tabuleiro[4]!= null)&& (tabuleiro[0]==tabuleiro[4])\n && (tabuleiro[4] == init && tabuleiro[8] == null)){\n proximo(valor,8,5,5);\n }\n else if((tabuleiro[4]!= null && tabuleiro[8]!= null)&& (tabuleiro[4]==tabuleiro[8])\n && (tabuleiro[8] == init && tabuleiro[0] == null)){\n proximo(valor,0,1,1);\n }\n // // bloqueio de vitoria na diagonal secundaria\n else if((tabuleiro[2]!= null && tabuleiro[6]!= null)&& (tabuleiro[2]==tabuleiro[6])\n && (tabuleiro[2] == init && tabuleiro[4] == null)){\n proximo(valor,4,3,3);\n }\n else if((tabuleiro[2]!= null && tabuleiro[4]!= null)&& (tabuleiro[2]==tabuleiro[4])\n && (tabuleiro[4] == init && tabuleiro[6] == null)){\n proximo(valor,6,1,5);\n }\n else if((tabuleiro[4]!= null && tabuleiro[6]!= null)&& (tabuleiro[4]==tabuleiro[6])\n && (tabuleiro[4] == init && tabuleiro[2] == null)){\n proximo(valor,2,5,1);\n }\n //a maior prioridade é que se o oponente comçar em um canto é necessário por no meio(somente no\n //impossivel)\n else if((tabuleiro[0] != null || tabuleiro[2] != null || tabuleiro[6] != null\n || tabuleiro[8] != null) && tabuleiro[4] == null && dificuldade.value ==1){\n proximo(valor,4,3,3);\n }\n //em condições normais o computador tentará preencher os cantos(essas são jogado aleatórias\n // com diferentes niveis de prioridades)\n else if((tabuleiro[0] == null || tabuleiro[2] == null || tabuleiro[6] == null\n || tabuleiro[8] == null)){\n do{\n pontoJogar = Math.round(Math.random() * (4 - 1) + 1);\n if(pontoJogar == 1 && tabuleiro[0] ==null){\n proximo(valor,0,1,1);\n jogou=true;\n }else if(pontoJogar == 2 && tabuleiro[2] ==null){\n proximo(valor,2,5,1);\n jogou=true;\n }else if(pontoJogar == 3 && tabuleiro[6] ==null){\n proximo(valor,6,1,5);\n jogou=true;\n }else if(pontoJogar == 4 && tabuleiro[8] ==null){\n proximo(valor,8,5,5);\n jogou=true;\n }\n }while(jogou!=true);\n }\n else if(tabuleiro[4] == null){\n proximo(valor,4,3,3);\n }\n else if((tabuleiro[1] == null || tabuleiro[3] == null || tabuleiro[5] == null\n || tabuleiro[7] == null)){\n do{\n pontoJogar = Math.round(Math.random() * (4 - 1) + 1);\n if(pontoJogar == 1 && tabuleiro[1] ==null){\n proximo(valor,1,3,1);\n jogou=true;\n }else if(pontoJogar == 2 && tabuleiro[3] ==null){\n proximo(valor,3,1,3);\n jogou=true;\n }else if(pontoJogar == 3 && tabuleiro[5] ==null){\n proximo(valor,5,5,3);\n jogou=true;\n }else if(pontoJogar == 4 && tabuleiro[7] ==null){\n proximo(valor,7,3,5);\n jogou=true;\n }\n }while(jogou!=true);\n }\n\n }", "title": "" }, { "docid": "59060e0f44148827318f0a23fa4cb14e", "score": "0.5700918", "text": "function C008_DramaClass_SarahIntro_Untie() {\n\tActorUntie();\n\tC008_DramaClass_SarahIntro_CalcParams();\n}", "title": "" }, { "docid": "37c75d428e7b5245d7bf4f22611a59e6", "score": "0.5663478", "text": "function User_Update_Ventes_Ventes0(Compo_Maitre)\n{\n var Table=\"vente\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ve_quantite=GetValAt(262);\n if (!ValiderChampsObligatoire(Table,\"ve_quantite\",TAB_GLOBAL_COMPO[262],ve_quantite,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_quantite\",TAB_GLOBAL_COMPO[262],ve_quantite))\n \treturn -1;\n var ve_prix=GetValAt(263);\n if (!ValiderChampsObligatoire(Table,\"ve_prix\",TAB_GLOBAL_COMPO[263],ve_prix,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_prix\",TAB_GLOBAL_COMPO[263],ve_prix))\n \treturn -1;\n var ve_date=GetValAt(264);\n if (!ValiderChampsObligatoire(Table,\"ve_date\",TAB_GLOBAL_COMPO[264],ve_date,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_date\",TAB_GLOBAL_COMPO[264],ve_date))\n \treturn -1;\n var ve_personne=GetValAt(265);\n if (ve_personne==\"-1\")\n ve_personne=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ve_personne\",TAB_GLOBAL_COMPO[265],ve_personne,true))\n \treturn -1;\n var ve_recolte=GetValAt(266);\n if (ve_recolte==\"-1\")\n ve_recolte=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ve_recolte\",TAB_GLOBAL_COMPO[266],ve_recolte,true))\n \treturn -1;\n var note=GetValAt(267);\n if (!ValiderChampsObligatoire(Table,\"note\",TAB_GLOBAL_COMPO[267],note,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"note\",TAB_GLOBAL_COMPO[267],note))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ve_quantite=\"+(ve_quantite==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_quantite)+\"'\" )+\",ve_prix=\"+(ve_prix==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_prix)+\"'\" )+\",ve_date=\"+(ve_date==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_date)+\"'\" )+\",ve_personne=\"+ve_personne+\",ve_recolte=\"+ve_recolte+\",note=\"+(note==\"\" ? \"null\" : \"'\"+ValiderChaine(note)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "903cdbe2c1bc67b8fd5f4db6ee71d057", "score": "0.55077523", "text": "function jsouVetsi(pole){\n\n}", "title": "" }, { "docid": "a1b057827ea66c64cbe3bfefdf911abe", "score": "0.5485898", "text": "function calcularSituacao( _pontosCair, _pontosSubir, _pontosTitulo, _temporadaAtualVitoria, _temporadaAtualEmpate, _temporadaAtualDerrota ) {\n atualizarNumerosTemporadas = false;\n temporadaNova = temporadaAtual;\n var totalJogos = 10;\n // vars que recupera o total de jogos somando vitoria, derrota y empate mais o jogo atual\n var jogosDisputados = _temporadaAtualVitoria + _temporadaAtualEmpate + _temporadaAtualDerrota + 1;\n var pontosVitoriaRecuperados = _temporadaAtualVitoria * 3;\n var ptVitoria = novosPontosVitoria + pontosVitoriaRecuperados;\n var ptEmpate = _temporadaAtualEmpate + novosPontosEmpate;\n var totalPontosTemp = ptVitoria + ptEmpate;\n var ptDerrota = _temporadaAtualDerrota + novaTemporadaAtualDerrota; // --\n // vars para cuando nao se completou os 10 jogos\n var jogosFaltantes = totalJogos - jogosDisputados - 1;\n var pontosRestantes = jogosFaltantes * 3;\n var pontosAconquistar = totalPontosTemp + pontosRestantes;\n // si completou os 10 jogos\n if ( jogosDisputados == totalJogos ) {\n console.log( \"10 jogos\", totalPontosTemp, _pontosTitulo, _pontosSubir );\n if ( totalPontosTemp < _pontosCair ) {\n if ( temporadaAtual != 10 ) {\n temporadaNova = temporadaAtual + 1;\n console.log( \"1 - caiu da temp \" + temporadaAtual + \" para a temp \" + temporadaNova );\n } else {\n temporadaNova = temporadaAtual;\n console.log( \"2 - Permaneceu na temp \" + temporadaNova );\n }\n } else if ( totalPontosTemp >= _pontosCair && totalPontosTemp < _pontosSubir ) {\n // actualizar aqui a temporada:\n temporadaNova = temporadaAtual;\n itemList.push( [ arrayConquistas[ 40 ][ 0 ], arrayConquistas[ 40 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 40 ][ 1 ];\n console.log( \"3 - permaneceu na temp \" + temporadaNova );\n } else if ( totalPontosTemp >= _pontosSubir && totalPontosTemp < _pontosTitulo ) {\n if ( temporadaAtual != 1 ) {\n temporadaNova = temporadaAtual - 1;\n itemList.push( [ arrayConquistas[ 39 ][ 0 ], arrayConquistas[ 39 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 39 ][ 1 ];\n console.log( \"4 - subir pra temp \" + temporadaNova );\n } else {\n itemList.push( [ arrayConquistas[ 40 ][ 0 ], arrayConquistas[ 40 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 40 ][ 1 ];\n console.log( \"5 - permaneceu na primeira\" );\n temporadaNova = temporadaAtual;\n }\n // actualizar aqui a temporada \n } else {\n if ( ptEmpate > 0 && ptDerrota == 0 ) {\n //campeao com empate \n if ( temporadaAtual > 7 ) {\n itemList.push( [ arrayConquistas[ 28 ][ 0 ], arrayConquistas[ 28 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 28 ][ 1 ];\n } else if ( temporadaAtual < 8 && temporadaAtual > 4 ) {\n itemList.push( [ arrayConquistas[ 31 ][ 0 ], arrayConquistas[ 31 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 31 ][ 1 ];\n } else if ( temporadaAtual < 5 && temporadaAtual > 1 ) {\n itemList.push( [ arrayConquistas[ 34 ][ 0 ], arrayConquistas[ 34 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 34 ][ 1 ];\n } else {\n itemList.push( [ arrayConquistas[ 37 ][ 0 ], arrayConquistas[ 37 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 37 ][ 1 ];\n }\n console.log( \"7 - Campeao con Empate\" );\n } else if ( ptDerrota > 0 ) {\n //campeao com derrota\n if ( temporadaAtual > 7 ) {\n itemList.push( [ arrayConquistas[ 29 ][ 0 ], arrayConquistas[ 29 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 29 ][ 1 ];\n } else if ( temporadaAtual < 8 && temporadaAtual > 4 ) {\n itemList.push( [ arrayConquistas[ 32 ][ 0 ], arrayConquistas[ 32 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 32 ][ 1 ];\n } else if ( temporadaAtual < 5 && temporadaAtual > 1 ) {\n itemList.push( [ arrayConquistas[ 35 ][ 0 ], arrayConquistas[ 35 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 35 ][ 1 ];\n } else {\n itemList.push( [ arrayConquistas[ 38 ][ 0 ], arrayConquistas[ 38 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 38 ][ 1 ];\n }\n console.log( \"8 - Campeao con Derrota\" );\n } else {\n //campeao perfeito\n if ( temporadaAtual > 7 ) {\n itemList.push( [ arrayConquistas[ 27 ][ 0 ], arrayConquistas[ 27 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 27 ][ 1 ];\n } else if ( temporadaAtual < 8 && temporadaAtual > 4 ) {\n itemList.push( [ arrayConquistas[ 30 ][ 0 ], arrayConquistas[ 30 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 30 ][ 1 ];\n } else if ( temporadaAtual < 5 && temporadaAtual > 1 ) {\n itemList.push( [ arrayConquistas[ 33 ][ 0 ], arrayConquistas[ 33 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 33 ][ 1 ];\n } else {\n itemList.push( [ arrayConquistas[ 36 ][ 0 ], arrayConquistas[ 36 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 36 ][ 1 ];\n }\n console.log( \"9 - Campeao Perfeito\" );\n }\n // actualizar aqui a temporada\n temporadaNova = temporadaAtual - 1;\n }\n atualizarNumerosTemporadas = true;\n } else {\n console.log( \"menos de 10\", totalPontosTemp, _pontosTitulo, _pontosSubir );\n if ( totalPontosTemp >= _pontosTitulo ) {\n console.log( \"pontos é igual ou maior q pontos titulo\" );\n if ( ptEmpate > 0 && ptDerrota == 0 ) {\n if ( temporadaAtual > 7 ) {\n itemList.push( [ arrayConquistas[ 28 ][ 0 ], arrayConquistas[ 28 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 28 ][ 1 ];\n } else if ( temporadaAtual < 8 && temporadaAtual > 4 ) {\n itemList.push( [ arrayConquistas[ 31 ][ 0 ], arrayConquistas[ 31 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 31 ][ 1 ];\n } else if ( temporadaAtual < 5 && temporadaAtual > 1 ) {\n itemList.push( [ arrayConquistas[ 34 ][ 0 ], arrayConquistas[ 34 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 34 ][ 1 ];\n } else {\n itemList.push( [ arrayConquistas[ 37 ][ 0 ], arrayConquistas[ 37 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 37 ][ 1 ];\n }\n console.log( \"11 Antes - Campeao con Empate\" );\n } else if ( ptDerrota > 0 ) {\n //campeao com derrota\n if ( temporadaAtual > 7 ) {\n itemList.push( [ arrayConquistas[ 29 ][ 0 ], arrayConquistas[ 29 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 29 ][ 1 ];\n } else if ( temporadaAtual < 8 && temporadaAtual > 4 ) {\n itemList.push( [ arrayConquistas[ 32 ][ 0 ], arrayConquistas[ 32 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 32 ][ 1 ];\n } else if ( temporadaAtual < 4 && temporadaAtual > 1 ) {\n itemList.push( [ arrayConquistas[ 35 ][ 0 ], arrayConquistas[ 35 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 35 ][ 1 ];\n } else {\n itemList.push( [ arrayConquistas[ 38 ][ 0 ], arrayConquistas[ 38 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 38 ][ 1 ];\n }\n console.log( \"12 Antes - Campeao con Derrota\" );\n } else {\n //campeao perfeito\n if ( temporadaAtual > 7 ) {\n itemList.push( [ arrayConquistas[ 27 ][ 0 ], arrayConquistas[ 27 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 27 ][ 1 ];\n } else if ( temporadaAtual < 8 && temporadaAtual > 4 ) {\n itemList.push( [ arrayConquistas[ 30 ][ 0 ], arrayConquistas[ 30 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 30 ][ 1 ];\n } else if ( temporadaAtual < 5 && temporadaAtual > 1 ) {\n itemList.push( [ arrayConquistas[ 33 ][ 0 ], arrayConquistas[ 33 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 33 ][ 1 ];\n } else {\n itemList.push( [ arrayConquistas[ 36 ][ 0 ], arrayConquistas[ 36 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 36 ][ 1 ];\n }\n console.log( \"13 Antes - Campeao Perfeito\", totalPontos );\n console.log( itemList );\n }\n temporadaNova = temporadaAtual - 1;\n atualizarNumerosTemporadas = true;\n }\n console.log( \"# \" + pontosRestantes, _pontosTitulo, _pontosSubir );\n console.log( \"$ \", pontosAconquistar );\n if ( temporadaAtual != 1 ) {\n if ( temporadaAtual != 10 ) {\n if ( pontosAconquistar >= _pontosCair && pontosAconquistar < _pontosSubir ) {\n temporadaNova = temporadaAtual;\n atualizarNumerosTemporadas = true;\n itemList.push( [ arrayConquistas[ 40 ][ 0 ], arrayConquistas[ 40 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 40 ][ 1 ];\n console.log( \"14 Permaneceu, na temporada \" + temporadaNova );\n } else if ( pontosAconquistar >= _pontosSubir && pontosAconquistar < _pontosTitulo ) {\n console.log( \"15 podeSubir y nao pode ser campeao\" );\n } else {\n if ( pontosAconquistar < _pontosCair ) {\n temporadaNova = temporadaAtual + 1;\n atualizarNumerosTemporadas = true;\n console.log( \"16 Caiu para a \" + temporadaNova );\n }\n // enviar datos aqui\n }\n } else {\n if ( pontosAconquistar < _pontosSubir ) {\n temporadaNova = temporadaAtual;\n atualizarNumerosTemporadas = true;\n itemList.push( [ arrayConquistas[ 40 ][ 0 ], arrayConquistas[ 40 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 40 ][ 1 ];\n console.log( \"16.1 Permaneceu, na temporada \" + temporadaNova );\n }\n }\n } else {\n atualizarNumerosTemporadas = true;\n if ( pontosAconquistar >= _pontosCair && pontosAconquistar < 23 ) {\n temporadaNova = temporadaAtual;\n itemList.push( [ arrayConquistas[ 40 ][ 0 ], arrayConquistas[ 40 ][ 1 ] ] );\n totalPontos = totalPontos + arrayConquistas[ 40 ][ 1 ];\n console.log( \"17 Permaneceu, na temporada \" + temporadaNova );\n } else {\n temporadaNova = temporadaAtual + 1;\n console.log( \"18 Caiu para a \" + temporadaNova );\n }\n }\n }\n }", "title": "" }, { "docid": "f1ef01eefed551ea61357b1ff295cef0", "score": "0.54825836", "text": "function votacao (anoNascimento, voto) {//aqui declaro os votos.\n \n if ( voto == 1 ) {\n candidato.gat++; //colocar a somatoraia aqui\n } else if (voto == 2 ) {\n candidato.cach++;\n } else if ( voto == 3 ) {\n candidato.pass++; //colocar o nome da variavel que ganha o voto\n } else if ( voto == 4 ) {\n candidato.nul++;\n } else if ( voto == 5 ) {\n candidato.branco++; \n }\n console.log(\"ERRO\");\n }", "title": "" }, { "docid": "d20d4e4b3cf01967994a3a36b27e353a", "score": "0.54733086", "text": "function accepterTpsMortEquipe() {\n fermerDemandeTpsMort();\n afficherTempsMort(\"normal\"); \n}", "title": "" }, { "docid": "450d482e62d1c92d542392b67b0bcd9d", "score": "0.54452336", "text": "function calculeMoyenne(ets,interos,devoirs,compos,partiels){\n var moyenne;\n if (ets.niveauEtablissement == 'secondaire') {\n var moyinteros = moyennesArithmetique(interos),\n sommedevoirs = somme(devoirs);\n moyenne = (moyinteros + sommedevoirs)/3;\n console.log('moy devoir:'+moydevoirs,'moy interos:'+moypartiels);\n }\n else if (ets.niveauEtablissement == 'universite') {\n var moyinteros = moyennesArithmetique(interos),\n moydevoirs = moyennesArithmetique(devoirs),\n moypartiels = moyennesArithmetique(partiels);\n if (isNaN(moyinteros)) {\n //console.log('moy devoir:'+moydevoirs,'moy partiel:'+moypartiels);\n moyenne = (moydevoirs*ets.pourcentageDevoir)+(moypartiels*ets.pourcentagePartiel);\n //console.log('moyenne: '+moyenne);\n }\n else if (isNaN(moydevoirs)) {\n //console.log('moy intero:'+moyinteros,'moy partiel:'+moypartiels);\n moyenne = (moyinteros*ets.pourcentageTP)+(moypartiels*ets.pourcentagePartiel);\n //console.log('moyenne: '+moyenne);\n }\n else if (isNaN(moypartiels)) {\n //console.log('moy intero:'+moyinteros, 'moy devoir:'+moydevoirs);\n moyenne = (moyinteros*ets.pourcentageTP)+(moydevoirs*ets.pourcentageDevoir);\n //console.log('moyenne: '+moyenne);\n }\n\n else if (isNaN(interos) && isNaN(devoirs)) {\n moyenne = moypartiels*ets.pourcentagePartiel;\n }\n\n else if (isNaN(interos) && isNaN(partiels)) {\n moyenne = moydevoirs*ets.pourcentageDevoir;\n }\n\n else if (isNaN(devoirs) && isNaN(partiels)) {\n moyenne = moyinteros*ets.pourcentageTP;\n }\n else {\n moyenne = (moyinteros*ets.pourcentageTP)+(moydevoirs*ets.pourcentageDevoir)+(moypartiels*ets.pourcentagePartiel);\n // console.log('moy intero:'+moyinteros, 'moy devoir:'+moydevoirs,'moy partiel:'+moypartiels,'moyenne:'+moyenne);\n // console.log('moyenne: '+moyenne);\n }\n }\n return moyenne;\n}", "title": "" }, { "docid": "4aa5d7282a32aa30b4b3d7c86dea0014", "score": "0.5445187", "text": "function calculs_physiques_attraction(pos, target){\n // on ré-initialise l'accélération\n var accX = 0\n var accY = 0\n // on calcule un force de friction : une résistance au mouvement, pour que notre objet s'arrête s'il n'est\n // plus soumis à aucune force. Cette force doit être inversement proportionnelle au déplacement et donc à\n // la vitesse pour ralentir l'objet en mouvement\n var frict = createVector(speedX,speedY);\n frict.normalize(); // cette opération ne permet de conserver que la direction du vecteur / l'orientation\n frict.mult(-1) // on inverse le vecteur vitesse normalié pour qu'il soit opposé au déplacement\n frict.mult(friction) // on multiplie par notre coefficient de friction\n // on ajoute ce résultat à l'accélération que l'on va applique à notre objet\n accX += frict.x;\n accY += frict.y;\n\n // déplacement : l'objet va être attiré par la souris\n var dir = pos.sub(target); // on obtient le vecteur de déplacement : différence entre la position et la cible\n var d = dir.mag(); // on calcul sa magnitude : la distance qui sépare les deux points du vecteur\n dir.normalize();\n dir.mult(-1);\n dir.div(1/d*d) // on fait en sorte que la force appliquée dépende de l'inverse du carré de la distance\n dir.div(force) // on multiplie par la force souhaitée\n // on ajoute cela à l'accélération\n accX = accX+ dir.x;\n accY = accY+ dir.y;\n\n // on ajoute l'accélération à la vitesse\n speedX = speedX + accX\n speedY = speedY + accY\n\n // on ajoute la vitesse à la position\n posX = posX + speedX\n posY = posY + speedY\n\n}", "title": "" }, { "docid": "87956aac7b34133e2304ec378a336068", "score": "0.5444682", "text": "function reaction () {\n calculation(); // Berechnungen\n op1.innerHTML = ToString(alpha/DEG,0,true)+\" \"+degree; // Winkel links ausgeben (Gradmaß)\n op2.innerHTML = ToString(beta/DEG,0,true)+\" \"+degree; // Winkel rechts ausgeben (Gradmaß)\n }", "title": "" }, { "docid": "ddd51d8f9e4cd7c02744d0195c3508be", "score": "0.5444292", "text": "function operaciones(){\n\t\t\t\t\t\tif(this===mas)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnum1=contadordisplay;\n\t\t\t\t\t\t\tquitar();\n\t\t\t\t\t\t\toperador=\"+\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this===menos)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnum1=contadordisplay;\n\t\t\t\t\t\t\tquitar();\n\t\t\t\t\t\t\toperador=\"-\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this===por)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnum1=contadordisplay;\n\t\t\t\t\t\t\tquitar();\n\t\t\t\t\t\t\toperador=\"*\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this===dividido)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnum1=contadordisplay;\n\t\t\t\t\t\t\tquitar();\n\t\t\t\t\t\t\toperador=\"/\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(this===igual && num2==0)/*metodo boton igual*/\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnum2=contadordisplay;\n\t\t\t\t\t\t\tculminar();\n\n\t\t\t\t\t\t}\n\t\t\t\t\telse if(this===igual && num2 !=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnum2=contadordisplay;\n\t\t\t\t\t\t\tresetculminar();\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}", "title": "" }, { "docid": "ac7266c2f986abb047df6377566d55e2", "score": "0.54276675", "text": "dispatch(e){\n\t\te.vector[0] = this.strength;\n\t}", "title": "" }, { "docid": "2eb0094b81a9ceb5c7db96cca352692e", "score": "0.54141164", "text": "function stProprieteCompo()\n{\n\tthis.Action_en_cours=null;\n\tthis.NewCle=null;\n}", "title": "" }, { "docid": "c796a514003950beb4873e4dc4f07c0b", "score": "0.5412513", "text": "function doActions(joueur = GestionJoueur.getJoueurCourant()) {\n let fiche = GestionFiche.getById(joueur.pion.axe + \"-\" + joueur.pion.position);\n if (fiche == null) {\n return GestionJoueur.change();\n }\n let buttons = fiche.action(); // Recupere les actions jouables en tombant sur cette case\n // une fois l'action cree, le joueur doit faire une action\n joueur.actionApresDes(buttons, fiche);\n // Notify end play\n bus.send('move.end');\n}", "title": "" }, { "docid": "2dfcd935a4edb432f5779d8f4e6422c0", "score": "0.5390425", "text": "function spat_na_vyber_tymov()\n{\n uloz_udaje_turnaja();\n vypis_tymy();\n zobraz_podstranku(1);\n}", "title": "" }, { "docid": "36934933f5ac9166386265fa33af70e6", "score": "0.5389237", "text": "function calcular_si_mueve(element, partes) {\n switch (puzzleElegido){\ncase \"south_park\": comprovarGanado(partes, array_south_park); break;\ncase \"peter\": comprovarGanado(partes, array_peter_partido); break;\ncase \"homer\": comprovarGanado(partes, array_homer_partido); break;\ncase \"stan \": comprovarGanado(partes, erased_value_stan); break;\n }\n \n var valor_element = element.getBoundingClientRect();\n var vacio = document.getElementById(\"vacio\");\n\n\n var valor_vacio = vacio.getBoundingClientRect();\n\n if (\n seTocanAbajo(valor_element, valor_vacio, element, vacio) ||\n seTocanArriba(valor_element, valor_vacio, element, vacio) ||\n seTocanDerechaNormal(valor_element, valor_vacio, element, vacio) ||\n seTocanIzquierda(valor_element, valor_vacio, element, vacio)\n ) {\n\n var valor_anterior = Number(document.getElementById(\"mov\").innerHTML);\n document.getElementById(\"mov\").innerHTML = valor_anterior + 1;\n\n } else {\n\n flash(element.getAttribute(\"name\"))\n\n }\n\n\n}", "title": "" }, { "docid": "61814c489b23c1671fdeefe303fe323b", "score": "0.53858626", "text": "function inizia(volte) {\n\t\n}", "title": "" }, { "docid": "79059f809852ef06ebdf7278fba1a094", "score": "0.5363172", "text": "_calculateVoisins(nbCases = 10) {\n let currentGroupe = null;\n let totalCases = nbCases * 4;\n // Parcourt les fiches. On enregistre le groupe courant, quand changement, on defini le groupe precedent et calcule le suivant du precedent\n for (let i = 0; i < totalCases + 2; i++) {\n let axe = Math.floor(i / nbCases) % 4;\n let pos = i % totalCases - (axe * nbCases);\n let fiche = GestionFiche.get({\n axe: axe,\n pos: pos\n });\n if (fiche != null && fiche.groupe != null && fiche.isTerrain()) {\n if (currentGroupe == null) {\n // initialisation\n currentGroupe = fiche.groupe;\n }\n if (!currentGroupe.equals(fiche.groupe)) { // Changement de groupe\n fiche.groupe.groupePrecedent = currentGroupe;\n currentGroupe.groupeSuivant = fiche.groupe;\n currentGroupe = fiche.groupe;\n }\n }\n }\n }", "title": "" }, { "docid": "b8c29240573fa80aacbd60aa3629cc15", "score": "0.53623897", "text": "function impRel (vendas) {\n if (vendas.length < 1) {\n alert(\"Não ha dados de vendas para gerar o relatorio\");\n } else {\n var valC = 0;\n var valD = 0;\n document.write('Relatorio de vendas de combustivel<br /> <br />');\n for (a=0; a < vendas.length; a++) {\n var x = vendas[a];\n if (x.fp == 'c' || x.fp == 'C') {\n valC = valC + (x.qtdLitros * precoLitro);\n } else {\n valD = valD + (x.qtdLitros * precoLitro); \n }\n document.write('Cliente : ' + x.nome + ' Telefone : ' + x.telefone \n + ' Tipo Pg : ' + x.fp + ' Qtd Litros : ' + x.qtdLitros \n + ' Valor pago : ' + parseFloat(x.qtdLitros * precoLitro).toFixed(2) \n + '<br />');\n }\n }\n document.write('<br />');\n // Total das vendas por tipo de pagamento\n document.write(\"VALOR TOTAL CARTÂO : \" + valC.toFixed(2) + ' reais <br />');\n document.write('VALOR TOTAL DINHEIRO : ' + valD.toFixed(2) + ' reais <br />');\n}", "title": "" }, { "docid": "50b29668bc50683b7091f690994d280c", "score": "0.53532153", "text": "function VehiculeMotorise (moteur, nombreDeRoue, nombreDeSiege) {\n // this\n this.moteur = moteur;\n this.nombreDeRoue = nombreDeRoue;\n this.nombreDeSiege = nombreDeSiege;\n\n this.start = function () {\n console.log('je demarre mon moteur de puissance : ' + this.moteur);\n }\n}", "title": "" }, { "docid": "7ab6fa06f98f7eb042396ed2bef37676", "score": "0.5334242", "text": "function operacionResta() {\r\n for (var j = 0; j < vecAuxiliar.length; j++) {\r\n var nu1 = vecAuxiliar[j].dato;\r\n var nu2 = vecTramaG[j].dato;\r\n var r = nu1 - nu2;\r\n if (r < 0) {\r\n agregar(1, 5);\r\n // vecresta += 1;\r\n } else {\r\n agregar(r, 5);\r\n //vecresta += r;\r\n }\r\n console.log(\"RESTA \" + vecresta[j].dato);\r\n } //FIN FOR\r\n vecAuxiliar = [];\r\n operacionAcomodar();\r\n } // FIN FUNCION OPERACION RESTAR ", "title": "" }, { "docid": "c7895bfc81703718e7f5c70aa1673e71", "score": "0.53298557", "text": "rebond()\n {\n if (this.droite > raquetteD.gauche) {\n if (this.bas > raquetteD.haut) {\n if (this.haut < raquetteD.bas) {\n this.vitesseX *= -1.2;\n console.log(1)\n }\n }\n }\n\n if (this.gauche < raquetteG.droite) { \n if (this.bas > raquetteG.haut) { \n if (this.haut < raquetteG.bas) {\n this.vitesseX *= -1.2;\n console.log(2)\n }\n }\n }\n }", "title": "" }, { "docid": "0fd72f5714f3bb9a6cb843eefc7ddb87", "score": "0.53240645", "text": "function submeter(op) {\n // Seta a opcao de pesquisa escolhida para o action correspondente funcionar corretamente\n document.formFormaPagamento.opcao.value = op;\n switch(op){\n // PESQUISAR PELO NOME\n case 0: {\n // Linha abaixo comentada para manter os acentos\n //document.formFormaPagamento.nome.value = retirarAcentos(document.formFormaPagamento.nome.value).toUpperCase();\n document.formFormaPagamento.nome.value = document.formFormaPagamento.nome.value.toUpperCase();\n document.formFormaPagamento.submit();\n }break;\n\n // PESQUISAR PELO TIPO\n case 1: {\n document.formFormaPagamento.submit();\n }break;\n }\n}", "title": "" }, { "docid": "386f1019e0813ae67a7dcd79eaaeee10", "score": "0.5320546", "text": "function nourrir(){\n EN+=2;\n if(FAIM>0)\n FAIM--;\n\n if (JOIE>0)\n JOIE--;\n updateUi();\n}", "title": "" }, { "docid": "8756bd0860c3b5587316bc1bf8a13938", "score": "0.53056955", "text": "function result3(idTxWE, idD_WE){\n\tvar TxWE = document.getElementById(idTxWE);\n\tvar D_WE = document.getElementById(idD_WE);\n\tdose = 0;\n\t//test si les cases son pleines, sinon afficher un message pour dire de remplir\n\t\n\tif(valve.checked){\n\t\t // vérifier ce que ça change sur la dose ou l'INR\n\t}\n\t\n\tif (testTaux(TxWE) != \"\"){\n\t\t\tdisplayAffichage(\"INR incorrect\");\n\t\t\treturn false ;\n\t}\n\tTxWE = TxWE.value; \n\tif (testDose(D_WE, \"fluindione\") != \"\"){\n\t\t\tdisplayAffichage(\"dose incorrecte\");\n\t\t\treturn false;\n\t}\n\tD_WE = parseInt(D_WE.value);\n\t\n\tif(TxWE > 4){\n\t\tif(TxWE < 6){\n\t\t\tdisplayAffichage(\"saut d'une prise, pas d'apport de vitamine K\");\n\t\t}\n\t\telse if(TxWE < 10){\n\t\t\tdisplayAffichage(\"arrêt du traitement, 1 à 2 mg de vitamine K par voiz orale\");\n\t\t}\n\t\telse{\n\t\t\tdisplayAffichage(\"arrêt du traitement jusqu'à INR < 2.5, 5 mg de vitamine K par voie orale\")\n\t\t}\n\t}\n\telse{\n\t\tif(TxWE < 2.5){\n\t\t\tdose = D_WE;\n\t\t\tdose += 1;\n\t\t}\n\t\telse{\n\t\t\tdose = (D_WE)-1;\n\t\t}\n\t\tdisplayAffichage(\"Le traitement est de \" + dose + \"mg de warfarine\");\n\t}\n\t\n}", "title": "" }, { "docid": "9a896c63804a132dd6ae0a68321a69f1", "score": "0.52942824", "text": "commencerNiveauSuivant()\r\n\t{\r\n\t\tthis._vue.masquerBandeaux();\r\n\t\tthis._jeu.niveauSuivant();\r\n\t\tthis.animer();\r\n\t}", "title": "" }, { "docid": "f2935aa7f5dcbc8480e42563c61a91eb", "score": "0.5283398", "text": "function mouvance(proba, victoire) {\r\n console.log('mouvance')\r\n if (victoire) {\r\n return (proba - 1)\r\n } else {\r\n return (1 - proba)\r\n }\r\n}", "title": "" }, { "docid": "35aa36687972212a722b95f43b5e8567", "score": "0.52824605", "text": "function dibujarFresadoExteriorE(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\n\t\n\tEAction.handleUserMessage(\"x1= \" +y2);\n\t\n\tif (modelo==50) { //[E0]\n\t\t\n\t\t//-----FRESADO EXTERIOR parte IZQUIERDA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura2/margenM1) //Esto es lo unico que cambia Math.atan(tamaño en x[horizontal] /tamaño en y[vertical])\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\t\n\t\tvar corte1 = new RVector(pos.x+margenM1-x1,pos.y+altura5+altura4+altura3+altura2)\n\t\tvar corte2 = new RVector(pos.x,pos.y+altura5+altura4+altura3+y2)\n\t\t\n\t\t//Tramo medio\n\t\tvar corte3 = new RVector(pos.x-margenFresado,pos.y+altura5+altura4+altura3)\n\t\tvar corte4 = new RVector(pos.x-margenFresado,pos.y+altura5+altura4)\n\t\t\n\t\t//Tramo inferior\n\t\tbeta = Math.atan(altura4/margenM1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\t\n\t\t\n\t\tvar corte5 = new RVector(pos.x,pos.y+altura5+altura4-y2)\n\t\tvar corte6 = new RVector(pos.x+margenM1-x1,pos.y+altura5)\n\t\t\n\t\t//Dibujar puntos calculados\n\t\tvar line = new RLineEntity(document, new RLineData( corte1 , corte2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte2 , corte3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte3 , corte4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte4 , corte5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t//-----FRESADO EXTERIOR parte DERECHA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2-altura1+x1,pos.y+altura5+altura4+altura3+altura2+altura1)\n\t\tvar corte6 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2,pos.y+altura5+altura4+altura3+altura2+y2)\n\t\t\n\t\tvar corte7 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2+margenFresado,pos.y+altura5+altura4+altura3+altura2)\n\t\tvar corte8 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2+margenFresado,pos.y+altura5+altura4+altura3)\n\t\t\n\t\tbeta = Math.atan(altura3/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte9 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2,pos.y+altura5+altura4+altura3-y2)\n\t\tvar corte10 = new RVector(pos.x+margenM1+anchuraPlaca+x1,pos.y+altura5+altura4)\n\t\t\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte6 , corte7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte7 , corte8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte8 , corte9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte9 , corte10 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}else if (modelo==51) { //[E1]\n\t\t//-----FRESADO EXTERIOR parte IZQUIERDA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte1 = new RVector(pos.x+altura1-x1,pos.y+altura5+altura4+altura3+altura2+altura1)\n\t\tvar corte2 = new RVector(pos.x,pos.y+altura5+altura4+altura3+altura2+y2)\n\t\t\n\t\t//Tramo medio\n\t\tvar corte3 = new RVector(pos.x-margenFresado,pos.y+altura5+altura4+altura3+altura2)\n\t\tvar corte4 = new RVector(pos.x-margenFresado,pos.y+altura5+altura4+altura3)\n\t\t\n\t\t//Tramo inferior\n\t\tbeta = Math.atan(altura3/margenM1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x,pos.y+altura5+altura4+altura3-y2)\n\t\tvar corte6 = new RVector(pos.x+margenM1-x1,pos.y+altura5+altura4)\n\t\t\n\t\t//Dibujar puntos calculados\n\t\tvar line = new RLineEntity(document, new RLineData( corte1 , corte2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte2 , corte3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte3 , corte4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte4 , corte5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t//-----FRESADO EXTERIOR parte DERECHA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura2/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x+margenM1+anchuraPlaca+x1,pos.y+altura5+altura4+altura3+altura2)\n\t\tvar corte6 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2,pos.y+altura5+altura4+altura3+y2)\n\t\t\n\t\tvar corte7 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2+margenFresado,pos.y+altura5+altura4+altura3)\n\t\tvar corte8 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2+margenFresado,pos.y+altura5+altura4)\n\t\t\n\t\tbeta = Math.atan(altura4/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte9 = new RVector(pos.x+margenM1+anchuraPlaca+margenM2,pos.y+altura5+altura4-y2)\n\t\tvar corte10 = new RVector(pos.x+margenM1+anchuraPlaca+x1,pos.y+altura5)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte6 , corte7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte7 , corte8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte8 , corte9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte9 , corte10 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}else if (modelo==52) { //[E2]\n\t\t//-----FRESADO EXTERIOR parte IZQUIERDA-------\n\t\t//Tramo superior\n\t\tvar corte1 = new RVector(pos.x+margenM1-margenFresado,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte2 = new RVector(pos.x+margenM1-margenFresado,pos.y+altura4+altura3+altura2+margenFresado)\n\t\t\n\t\t//Tramo medio\n\t\tbeta = Math.atan(altura2/margenM1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte3 = new RVector(pos.x+margenM1-x1,pos.y+altura4+altura3+altura2)\n\t\tvar corte4 = new RVector(pos.x,pos.y+altura4+altura3+y2)\n\t\t\n\t\t//Tramo inferior\n\t\tvar corte5 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3)\n\t\tvar corte6 = new RVector(pos.x-margenFresado,pos.y+altura4)\n\t\t\n\t\t\n\t\t\n\t\t//Dibujar puntos calculados\n\t\tvar line = new RLineEntity(document, new RLineData( corte1 , corte2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte2 , corte3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte3 , corte4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte4 , corte5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//-----FRESADO EXTERIOR parte DERECHA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x+anchura2+margenM2-altura1+x1,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte6 = new RVector(pos.x+anchura2+margenM2,pos.y+altura4+altura3+altura2+y2)\n\t\t\n\t\tvar corte7 = new RVector(pos.x+anchura2+margenM2+margenFresado,pos.y+altura4+altura3+altura2)\n\t\tvar corte8 = new RVector(pos.x+anchura2+margenM2+margenFresado,pos.y+altura4+altura3)\n\t\t\n\t\tbeta = Math.atan(altura3/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte9 = new RVector(pos.x+anchura2+margenM2,pos.y+altura4+altura3-y2)\n\t\tvar corte10 = new RVector(pos.x+anchura2+x1,pos.y+altura4)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte6 , corte7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte7 , corte8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte8 , corte9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte9 , corte10 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}else if (modelo==53) { //[E3]\n\t\t//-----FRESADO EXTERIOR parte IZQUIERDA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte1 = new RVector(pos.x+altura1-x1,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte2 = new RVector(pos.x,pos.y+altura4+altura3+altura2+y2)\n\t\t\n\t\t//Tramo medio\n\t\tvar corte3 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3+altura2)\n\t\tvar corte4 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3)\n\t\t\n\t\t//Tramo inferior\n\t\tbeta = Math.atan(altura3/margenM1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x,pos.y+altura4+altura3-y2)\n\t\tvar corte6 = new RVector(pos.x+margenM1-x1,pos.y+altura4)\n\t\t\n\t\t//Dibujar puntos calculados\n\t\tvar line = new RLineEntity(document, new RLineData( corte1 , corte2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte2 , corte3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte3 , corte4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte4 , corte5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t//-----FRESADO EXTERIOR parte DERECHA-------\n\t\t//Tramo superior\n\t\tvar corte5 = new RVector(pos.x+margenM1+anchura2-margenM2+margenFresado,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte6 = new RVector(pos.x+margenM1+anchura2-margenM2+margenFresado,pos.y+altura4+altura3+altura2+margenFresado)\n\t\t\n\t\tbeta = Math.atan(altura2/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte7 = new RVector(pos.x+margenM1+anchura2-margenM2+x1,pos.y+altura4+altura3+altura2)\n\t\tvar corte8 = new RVector(pos.x+margenM1+anchura2,pos.y+altura4+altura3+y2)\n\t\t\n\t\tvar corte9 = new RVector(pos.x+margenM1+anchura2+margenFresado,pos.y+altura4+altura3)\n\t\tvar corte10 = new RVector(pos.x+margenM1+anchura2+margenFresado,pos.y+altura4)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte6 , corte7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte7 , corte8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte8 , corte9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte9 , corte10 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}else if (modelo==54) { //[E4] \n\t\t//-----FRESADO EXTERIOR parte IZQUIERDA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte1 = new RVector(pos.x+altura1-x1,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte2 = new RVector(pos.x,pos.y+altura4+altura3+altura2+y2)\n\t\t\n\t\t//Tramo medio\n\t\tvar corte3 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3+altura2)\n\t\tvar corte4 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3)\n\t\t\n\t\t//Tramo inferior\n\t\tbeta = Math.atan(altura3/margenM1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x,pos.y+altura4+altura3-y2)\n\t\tvar corte6 = new RVector(pos.x+margenM1-x1,pos.y+altura4)\n\t\t\n\t\t//Dibujar puntos calculados\n\t\tvar line = new RLineEntity(document, new RLineData( corte1 , corte2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte2 , corte3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte3 , corte4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte4 , corte5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t//-----FRESADO EXTERIOR parte DERECHA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x+margenM1+anchura2+margenM2-altura1+x1,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte6 = new RVector(pos.x+margenM1+anchura2+margenM2,pos.y+altura4+altura3+altura2+y2)\n\t\t\n\t\tvar corte7 = new RVector(pos.x+margenM1+anchura2+margenM2+margenFresado,pos.y+altura4+altura3+altura2)\n\t\tvar corte8 = new RVector(pos.x+margenM1+anchura2+margenM2+margenFresado,pos.y+altura4+altura3)\n\t\t\n\t\tbeta = Math.atan(altura3/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte9 = new RVector(pos.x+margenM1+anchura2+margenM2,pos.y+altura4+altura3-y2)\n\t\tvar corte10 = new RVector(pos.x+margenM1+anchura2+x1,pos.y+altura4)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte6 , corte7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte7 , corte8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte8 , corte9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte9 , corte10 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}else if (modelo==55) { //[E5]\n\t\t//-----FRESADO EXTERIOR parte IZQUIERDA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte1 = new RVector(pos.x+altura1-x1,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte2 = new RVector(pos.x,pos.y+altura4+altura3+altura2+y2)\n\t\t\n\t\t//Tramo medio\n\t\tvar corte3 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3+altura2)\n\t\tvar corte4 = new RVector(pos.x-margenFresado,pos.y+altura4+altura3)\n\t\t\n\t\t//Tramo inferior\n\t\tbeta = Math.atan(altura3/margenM1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x,pos.y+altura4+altura3-y2)\n\t\tvar corte6 = new RVector(pos.x+margenM1-x1,pos.y+altura4)\n\t\t\n\t\t//Dibujar puntos calculados\n\t\tvar line = new RLineEntity(document, new RLineData( corte1 , corte2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte2 , corte3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte3 , corte4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte4 , corte5 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t//-----FRESADO EXTERIOR parte DERECHA-------\n\t\t//Tramo superior\n\t\tbeta = Math.atan(altura1/altura1)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte5 = new RVector(pos.x+margenM1+anchura2+margenM2-altura1+x1,pos.y+altura4+altura3+altura2+altura1)\n\t\tvar corte6 = new RVector(pos.x+margenM1+anchura2+margenM2,pos.y+altura4+altura3+altura2+y2)\n\t\t\n\t\tvar corte7 = new RVector(pos.x+margenM1+anchura2+margenM2+margenFresado,pos.y+altura4+altura3+altura2)\n\t\tvar corte8 = new RVector(pos.x+margenM1+anchura2+margenM2+margenFresado,pos.y+altura4+altura3)\n\t\t\n\t\tbeta = Math.atan(altura3/margenM2)\n\t\tvar x1 = margenFresado/Math.sin(beta)\n\t\tvar alfa = Math.PI/2 - beta\t\t\n\t\tvar y2 = margenFresado/Math.sin(alfa)\n\t\t\n\t\tvar corte9 = new RVector(pos.x+margenM1+anchura2+margenM2,pos.y+altura4+altura3-y2)\n\t\tvar corte10 = new RVector(pos.x+margenM1+anchura2+x1,pos.y+altura4)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( corte5 , corte6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte6 , corte7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte7 , corte8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte8 , corte9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( corte9 , corte10 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\t\n\t\t\n\t}\n\t\n\t\n\t\n\t\n\treturn op_fresado;\n}", "title": "" }, { "docid": "840450c1c563adcf6ab453902085860d", "score": "0.52756715", "text": "commencerNiveauSuivant()\n\t{\n\t\tthis._vue.masquerBandeaux();\n\t\tthis._jeu.niveauSuivant();\n\t\tthis.animer();\n\t}", "title": "" }, { "docid": "4ae7ee53ab057fc570e05d77ce88bf62", "score": "0.52523565", "text": "function eventosLlenado() {\n //recorre la tabla creada para revisar los ckb\n revisarCkb();\n //da los eventos de guardar observaciones en valor de boton.\n darEventoObservaciones();\n //dar total \n resultadoConteo();\n\n}//fin 21", "title": "" }, { "docid": "42844278df85a9cfc359070a66ae2b35", "score": "0.5241107", "text": "function nVa(){this.F=0;this.J=[];this.H=[];this.O=this.V=this.C=this.N=this.Z=this.L=0;this.ea=[]}", "title": "" }, { "docid": "9b8b2974dc61ffdeddeb022d3df07a20", "score": "0.5238304", "text": "function colisaoBalaoEspinho(){}", "title": "" }, { "docid": "c3c5a211aa219091691f99862fec48df", "score": "0.52336377", "text": "get totals(){\n let mr=this.mass_ratios;//alias for code reduction\n let co=this.components; //alias for code reduction\n\n //COD fractions (Chemical Oxygen Demand)\n let bsCOD = co.S_VFA + co.S_FBSO; //bio + soluble COD\n let usCOD = co.S_USO; //unbio + soluble COD\n let bpCOD = co.X_BPO; //bio + partic COD\n let upCOD = co.X_UPO; //unbio + partic COD\n let bCOD = bsCOD + bpCOD; //bio COD\n let uCOD = usCOD + upCOD; //unbio COD\n let sCOD = bsCOD + usCOD; //soluble COD\n let pCOD = bpCOD + upCOD; //partic COD\n let Total_COD = bsCOD + usCOD + bpCOD + upCOD + co.X_OHO + co.X_PAO;\n let COD={\n total: Total_COD,\n bCOD, uCOD, sCOD, pCOD,\n bsCOD, usCOD, bpCOD, upCOD,\n active: co.X_OHO + co.X_PAO,\n };\n\n //TOC all fractions (Total Organic Carbon)\n let bsOC = co.S_VFA * mr.f_C_VFA / mr.f_CV_VFA + co.S_FBSO * mr.f_C_FBSO / mr.f_CV_FBSO; //bio + soluble OC\n let usOC = co.S_USO * mr.f_C_USO / mr.f_CV_USO; //unbio + soluble OC\n let bpOC = co.X_BPO * mr.f_C_BPO / mr.f_CV_BPO; //bio + partic OC\n let upOC = co.X_UPO * mr.f_C_UPO / mr.f_CV_UPO; //unbio + partic OC\n let bOC = bsOC + bpOC; //bio OC\n let uOC = usOC + upOC; //unbio OC\n let sOC = bsOC + usOC; //soluble OC\n let pOC = bpOC + upOC; //partic OC\n let actOC = co.X_OHO * mr.f_C_OHO / mr.f_CV_OHO + //OC in active biomass (OHO)\n co.X_PAO * mr.f_C_PAO / mr.f_CV_PAO; //OC in active biomass (PAO)\n\n let Total_TOC = bsOC + usOC + bpOC + upOC + actOC;\n let TOC={\n total:Total_TOC,\n bOC, uOC, sOC, pOC,\n bsOC, usOC, bpOC, upOC,\n active: actOC,\n };\n\n //TKN all fractions (Organic Nitrogen (ON) + Inorganic Free Saline Ammonia (FSA))\n let bsON = co.S_VFA * mr.f_N_VFA / mr.f_CV_VFA + co.S_FBSO * mr.f_N_FBSO / mr.f_CV_FBSO; //bio + soluble ON\n let usON = co.S_USO * mr.f_N_USO / mr.f_CV_USO; //unbio + soluble ON\n let bpON = co.X_BPO * mr.f_N_BPO / mr.f_CV_BPO; //bio + partic ON\n let upON = co.X_UPO * mr.f_N_UPO / mr.f_CV_UPO; //unbio + partic ON\n let bON = bsON + bpON; //bio ON\n let uON = usON + upON; //unbio ON\n let sON = bsON + usON; //soluble ON\n let pON = bpON + upON; //partic ON\n let actON = co.X_OHO * mr.f_N_OHO / mr.f_CV_OHO+ //ON in active biomass (OHO)\n co.X_PAO * mr.f_N_PAO / mr.f_CV_PAO; //ON in active biomass (PAO)\n let Total_TKN = co.S_FSA + bsON + usON + bpON + upON + actON;\n let TKN={\n total:Total_TKN,\n FSA:co.S_FSA,\n ON:sON+pON,\n bON, uON, sON, pON,\n bsON, usON, bpON, upON,\n active: actON,\n }\n\n //TP all fractions (Organic P (OP) + Inorganic Phosphate (PO4))\n let bsOP = co.S_VFA * mr.f_P_VFA / mr.f_CV_VFA + co.S_FBSO * mr.f_P_FBSO / mr.f_CV_FBSO; //bio + soluble OP\n let usOP = co.S_USO * mr.f_P_USO / mr.f_CV_USO; //unbio + soluble OP\n let bpOP = co.X_BPO * mr.f_P_BPO / mr.f_CV_BPO; //bio + partic OP\n let upOP = co.X_UPO * mr.f_P_UPO / mr.f_CV_UPO; //unbio + partic OP\n let bOP = bsOP + bpOP; //bio OP\n let uOP = usOP + upOP; //unbio OP\n let sOP = bsOP + usOP; //soluble OP\n let pOP = bpOP + upOP; //partic OP\n let actOP = co.X_OHO * mr.f_P_OHO / mr.f_CV_OHO + //OP in active biomass (OHO)\n co.X_PAO * mr.f_P_PAO / mr.f_CV_PAO; //OP in active biomass (PAO)\n\n let Total_TP = co.S_OP + bsOP + usOP + bpOP + upOP + actOP;\n let TP={\n total:Total_TP,\n PO4:co.S_OP,\n OP:sOP+pOP,\n bOP, uOP, sOP, pOP,\n bsOP, usOP, bpOP, upOP,\n active: actOP,\n };\n\n //TSS all fractions (Volatile Suspended Solids (VSS) + inert Suspended Solids (iSS))\n let bVSS = co.X_BPO / mr.f_CV_BPO; //bio VSS\n let uVSS = co.X_UPO / mr.f_CV_UPO; //unbio VSS\n\n let actVSS = co.X_OHO / mr.f_CV_OHO + //OHO VSS active biomass\n co.X_PAO / mr.f_CV_PAO; //PAO VSS active biomass\n\n let Total_VSS = bVSS + uVSS + actVSS; //total VSS\n let Total_TSS = Total_VSS + co.X_iSS; //total TSS\n let TSS={\n total: Total_TSS,\n iSS: co.X_iSS,\n VSS: Total_VSS,\n bVSS,\n uVSS,\n active: actVSS,\n };\n\n //pack components\n return {COD,TKN,TP,TOC,TSS};\n }", "title": "" }, { "docid": "80a77ae3979ac672ed7c77ee5168ffb0", "score": "0.5233471", "text": "function vincitore() {\n if (pariDispari != risultato) {\n return 'Hai perso'\n }\n return 'HAI VINTO!'\n}", "title": "" }, { "docid": "ea8b85a8a2c821e9fa064e438a9b1d6b", "score": "0.52270484", "text": "function User_Insert_Ventes_Ventes0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 6\n\nId dans le tab: 262;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 263;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 264;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 265;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = personne,ve_personne,pe_numero\n\nId dans le tab: 266;\nsimple\nNbr Jointure: 1;\n Joint n° 0 = recolte,ve_recolte,re_numero\n\nId dans le tab: 267;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"vente\";\n var CleMaitre = TAB_COMPO_PPTES[256].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ve_quantite=GetValAt(262);\n if (!ValiderChampsObligatoire(Table,\"ve_quantite\",TAB_GLOBAL_COMPO[262],ve_quantite,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_quantite\",TAB_GLOBAL_COMPO[262],ve_quantite))\n \treturn -1;\n var ve_prix=GetValAt(263);\n if (!ValiderChampsObligatoire(Table,\"ve_prix\",TAB_GLOBAL_COMPO[263],ve_prix,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_prix\",TAB_GLOBAL_COMPO[263],ve_prix))\n \treturn -1;\n var ve_date=GetValAt(264);\n if (!ValiderChampsObligatoire(Table,\"ve_date\",TAB_GLOBAL_COMPO[264],ve_date,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ve_date\",TAB_GLOBAL_COMPO[264],ve_date))\n \treturn -1;\n var ve_personne=GetValAt(265);\n if (ve_personne==\"-1\")\n ve_personne=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ve_personne\",TAB_GLOBAL_COMPO[265],ve_personne,true))\n \treturn -1;\n var ve_recolte=GetValAt(266);\n if (ve_recolte==\"-1\")\n ve_recolte=\"null\";\n if (!ValiderChampsObligatoire(Table,\"ve_recolte\",TAB_GLOBAL_COMPO[266],ve_recolte,true))\n \treturn -1;\n var note=GetValAt(267);\n if (!ValiderChampsObligatoire(Table,\"note\",TAB_GLOBAL_COMPO[267],note,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"note\",TAB_GLOBAL_COMPO[267],note))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",ve_quantite,ve_prix,ve_date,ve_personne,ve_recolte,note\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(ve_quantite==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_quantite)+\"'\" )+\",\"+(ve_prix==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_prix)+\"'\" )+\",\"+(ve_date==\"\" ? \"null\" : \"'\"+ValiderChaine(ve_date)+\"'\" )+\",\"+ve_personne+\",\"+ve_recolte+\",\"+(note==\"\" ? \"null\" : \"'\"+ValiderChaine(note)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "73c7a64996589ab719558099263545ef", "score": "0.52266306", "text": "function RisolviPrimoProblema(){\n\n //creo un ciclo condizionale switch innestato in modo da risolvere\n //il problema solo se la variabile bug è nulla, variabile che assume\n //solo due valori 0 oppure 1\n switch (bug){\n case 0:\n switch (tipoProblema){\n case \"navigazione generale\":\n DeltaPhiLatArr();\n DeltaPhiCrescente();\n DeltaLambdaLonArr();\n break;\n case \"navigazione meridiano\":\n NavigazioneMeridiano();\n break;\n case \"navigazione parallelo\":\n NavigazioneParallelo();\n break;\n default:\n alert(\"Errore nella risoluzione del primo problema di lossodromia.\");\n break;\n }\n break;\n case 1:\n alert(\"Errore, impossibile risolvere il problema, controllare inserimento dati.\");\n break;\n default:\n alert(\"Errore valutazione della risoluzione tramite bug.\");\n }\n}//end function RisolviPrimoProblema()", "title": "" }, { "docid": "ac7dab3ce635f4c1a6ea1905ae5580ca", "score": "0.52185607", "text": "function cambiarLimiteDeExtraccion() {\n\n}", "title": "" }, { "docid": "d9f36ed215a2b318919ad1e4a02770e2", "score": "0.521725", "text": "function ze_Affecter_ouvrieres() {\n\tvar RecolteMateriaux = parseInt(document.querySelector('#RecolteMateriaux').value.replace(/ /g,\"\"));\n\tvar RecolteNourriture = parseInt(document.querySelector('#RecolteNourriture').value.replace(/ /g,\"\"));\n\tif ((RecolteMateriaux + RecolteNourriture < gTDC ) && (RecolteMateriaux + RecolteNourriture < gouvrieres * 0.99999 )) {\n\t\tdocument.querySelector('#RecolteMateriaux').value = Math.min(gouvrieres - RecolteNourriture,gTDC - RecolteNourriture);\n\t\tdocument.getElementsByName('ChangeRessource')[0].type= \"hidden\";\n\t\tdocument.forms[0].submit();\n\t}\n}", "title": "" }, { "docid": "d9f36ed215a2b318919ad1e4a02770e2", "score": "0.521725", "text": "function ze_Affecter_ouvrieres() {\n\tvar RecolteMateriaux = parseInt(document.querySelector('#RecolteMateriaux').value.replace(/ /g,\"\"));\n\tvar RecolteNourriture = parseInt(document.querySelector('#RecolteNourriture').value.replace(/ /g,\"\"));\n\tif ((RecolteMateriaux + RecolteNourriture < gTDC ) && (RecolteMateriaux + RecolteNourriture < gouvrieres * 0.99999 )) {\n\t\tdocument.querySelector('#RecolteMateriaux').value = Math.min(gouvrieres - RecolteNourriture,gTDC - RecolteNourriture);\n\t\tdocument.getElementsByName('ChangeRessource')[0].type= \"hidden\";\n\t\tdocument.forms[0].submit();\n\t}\n}", "title": "" }, { "docid": "4098aa0da4486d45903a21ea8a6c41ce", "score": "0.52050686", "text": "effect(){\n if(hasChallenge('E',31))return player.O.points.add(1).log(5).add(1).pow(3)\n if(hasMilestone('MS',1.7e30)) return player.O.points.add(1).log(9).add(1).pow(2)\n else if(hasUpgrade('UF',95)) return player.O.points.add(1).log(10).add(1).pow(1.5)\n else return player.O.points.add(1).log(10).add(1)}", "title": "" }, { "docid": "a95e16dcbfd6c4c2c15e5403f17a8e96", "score": "0.51981026", "text": "function sumaValor(tituloSeccion, vInicial){\n tituloSeccion = tituloSeccion.toLowerCase()\n console.log(tituloSeccion)\n if(typeof vInicial[0] === 'boolean' && !(vInicial[0])){\n if(tituloSeccion === 'conciencia') return objTriangulo.trianguloAparienciaInteraccion = false;\n\n if(tituloSeccion === 'coloracion de la piel') return objTriangulo.trianguloCirculacion = false;\n\n if(tituloSeccion === 'actividad') return objTriangulo.trianguloAparienciaInteraccion = false;\n\n if(tituloSeccion === 'tono') return objTriangulo.trianguloAparienciaTono = false;\n\n if(tituloSeccion === 'visual') return objTriangulo.trianguloAparienciaMirada = false;\n\n if(tituloSeccion === 'intensidad del llanto') return objTriangulo.trianguloAparienciaLlanto = false;\n\n if(tituloSeccion === 'consolabilidad') return objTriangulo.trianguloAparienciaLlanto = false;\n\n if(tituloSeccion === 'ruidos respiratorios') return objTriangulo.trianguloRespiracion = false;\n\n if(tituloSeccion === 'dificultad respiratoria') return objTriangulo.trianguloRespiracion = false;\n\n if(tituloSeccion === 'posicion patologica') return objTriangulo.trianguloRespiracion = false;\n }\n if(typeof vInicial[1]==='number' && typeof vInicial[2]==='number'){\n valorTotal.alertaTemprana += vInicial[1]\n valorTotal.saveChild = valorTotal.saveChild + vInicial[2];\n }\n desactivarBotones()\n}", "title": "" }, { "docid": "b638335b797d44015fdaa66910e544a2", "score": "0.51940465", "text": "sumAttacks([x, y]) {\n const getSign = (color) => {\n return (color == 'w' ? 1 : -1);\n };\n let res = 0;\n // Knights:\n V.steps[V.KNIGHT].forEach(s => {\n const [i, j] = [x + s[0], y + s[1]];\n if (V.OnBoard(i, j) && this.getPiece(i, j) == V.KNIGHT)\n res += getSign(this.getColor(i, j)) * V.VALUES[V.KNIGHT];\n });\n // Kings:\n V.steps[V.ROOK].concat(V.steps[V.BISHOP]).forEach(s => {\n const [i, j] = [x + s[0], y + s[1]];\n if (V.OnBoard(i, j) && this.getPiece(i, j) == V.KING)\n res += getSign(this.getColor(i, j)) * V.VALUES[V.KING];\n });\n // Pawns:\n for (let c of ['w', 'b']) {\n for (let shift of [-1, 1]) {\n const sign = getSign(c);\n const [i, j] = [x + sign, y + shift];\n if (\n V.OnBoard(i, j) &&\n this.getPiece(i, j) == V.PAWN &&\n this.getColor(i, j) == c\n ) {\n res += sign * V.VALUES[V.PAWN];\n }\n }\n }\n // Other pieces (sliders):\n V.steps[V.ROOK].concat(V.steps[V.BISHOP]).forEach(s => {\n let [i, j] = [x + s[0], y + s[1]];\n let compatible = [V.QUEEN];\n compatible.push(s[0] == 0 || s[1] == 0 ? V.ROOK : V.BISHOP);\n let firstCol = undefined;\n while (V.OnBoard(i, j)) {\n if (this.board[i][j] != V.EMPTY) {\n const pieceIJ = this.getPiece(i, j);\n if (!(compatible.includes(pieceIJ))) break;\n const colIJ = this.getColor(i, j);\n if (!firstCol) firstCol = colIJ;\n if (colIJ == firstCol) res += getSign(colIJ) * V.VALUES[pieceIJ];\n else break;\n }\n i += s[0];\n j += s[1];\n }\n });\n return res;\n }", "title": "" }, { "docid": "54d7573936a38355c364c8d90398499f", "score": "0.51925224", "text": "function VLtransfer(i, j) {\n let iVL = P[i].ViralLoad;\n let jVL = P[j].ViralLoad;\n if (isNaN(iVL) || (isNaN(jVL))) {\n alertX(\"NaN i:j \"+i+\":\"+j);\n iVL = 5; jVL=5;\n }\n // console_log(\"i,j viral load = \"+iVL.toFixed(2)+\",\"+jVL.toFixed(2));\n if (iVL == 0 && jVL == 0) {\n return\n }\n if (P[i].state == \"orange\" || P[j].state == \"orange\") {\n return\n }\n\n // if viral load below threshold or still in incubation period do not infect\n // if they are both below threshold, cannot infect\n // if they are both in incubation, they cannot infect\n\n if (Math.max(iVL, jVL) < VLlower) {\n // console_log(\"iVL, jVL below threshold for i,j\"+i+\",\"+j);\n return\n }\n if (Math.max((cT - P[i].tInfect), (cT - P[j].tInfect)) < VLincD) {\n // console_log(\"both i,j in incubation for\"+i+\",\"+j);\n return\n }\n\n let Vgrad = Math.abs(jVL - iVL);\n let diff = raMax - yLength;\n // if gap is A, then overlap = sum - gap\n let Vdist = Math.pow(1-(diff / raMax), 3);\n let Vbig = i;\n let Vsmall = j;\n if (iVL < jVL) {\n Vbig = j; //the bigger viral load agent\n Vsmall = i;\n };\n let VTrans = Vgrad * Vdist;\n // console_log(\"Virus Transfer = \"+VTrans+\" Overlap diff \"+diff);\n\n // this is a stochastic threshold for ineffective touches\n if (VTrans < 0.05) {\n if (Math.random() < 0.5) { // toss a ccoin\n P[Vbig].failedCt++;\n return\n }\n }\n\n /*********************************************************\n / VAX Status checks\n /*********************************************************\n */\n\n let vaxT = cD - P[Vsmall].vaxD;\n let vaxSwitch = 1;\n let VaxProb = Math.random();\n\n if (P[Vsmall].vaxType==0) { }\n else {\n\n if (P[Vsmall].vaxType == 1){\n if (vaxT>13 && vaxT<36){\n if (VaxProb<0.75) {vaxSwitch = 0};\n }\n }\n if (P[Vsmall].vaxType == 2){\n if (vaxT>28) {\n if (VaxProb<0.95) {vaxSwitch = 0};\n }\n if (vaxT>13 && vaxT<29){\n if (VaxProb<0.75) {vaxSwitch = 0};\n }\n }\n if (vaxSwitch==0) {\n console_log(\"Vax prevented \"+Vsmall+\" ageGp\"+P[Vsmall].ageGp+\" by \"+Vbig+\" ageGp\"+P[Vbig].ageGp+\" gen\"+gen+\" Prob \"+VaxProb);\n return}\n }\n\n // if vaccinated transmitter, will do so with inverse %\n\n let vaxTT = cD - P[Vbig].vaxD;\n vaxSwitch = 1;\n\n if (P[Vbig].vaxType==0) { }\n else {\n\n if (P[Vbig].vaxType == 1){\n if (vaxTT>13 && vaxTT<36){\n if (VaxProb>0.25) {vaxSwitch = 0};\n }\n }\n if (P[Vsmall].vaxType == 2){\n if (vaxTT>28) {\n if (VaxProb>0.95) {vaxSwitch = 0};\n }\n if (vaxTT>13 && vaxTT<29){\n if (VaxProb>0.75) {vaxSwitch = 0};\n }\n }\n if (vaxSwitch==0) {\n console_log(\"No transmit \"+Vbig+ \" ageGp\"+P[Vbig].ageGp+\" on \"+Vsmall+\" ageGp\"+P[Vsmall].ageGp+\" gen\"+gen+\" Prob \"+VaxProb);\n return}\n }\n\n let qVir = 0;\n\n let ipostInfect = cT - P[i].tInfect;\n let jpostInfect = cT - P[j].tInfect;\n let xpostInf;\n let xVL;\n\n let xinfD;\n let xinfVir;\n let xInf = 0;\n let x;\n\n if (ipostInfect<0) { ipostInfect = -ipostInfect };\n if (jpostInfect <0) { jpostInfect = - jpostInfect};\n if (Vbig == i){\n xpostInf = jpostInfect;\n xVL = jVL;\n x = j;\n } else {\n xpostInf = ipostInfect;\n xVL = iVL;\n x = i;\n }\n xinfD = Math.floor(xpostInf);\n if (xinfD < 21) {\n xinfVir = tViral[xinfD]\n } else {\n xinfVir = 1;\n }\n\n qVir = Math.min((xVL + VTrans), xinfVir);\n qVir = stochast(qVir, 0.05);\n if (isNaN(qVir)) {\n alertX(\"NaN qVir\");\n }\n if (qVir < 0) {\n alertX(\"neg viral load \"+qVir)\n };\n\n if (P[x].tInfect == 0){\n P[x].tInfect = cT;\n P[x].ViralLoad = Math.max(qVir,1);\n } else {\n P[x].tInfect = P[x].tInfect + 0.000001;\n return;\n }\n\n let xAgeGp = P[x].ageGp;\n let AGtotal = AG[xAgeGp].total;\n let AGinfcd = AG[xAgeGp].infected;\n if (AGinfcd > AGtotal) alertX(\"AG limit exceeded\");\n\n\n if (P[x].state == \"green\"){\n xInf = M.PCt-M.GreenCt;\n xAgeGp = P[x].ageGp;\n if (P[x].tInfect == cT){ // new infection\n AG[xAgeGp].infected++;\n }\n let vic = i;\n let dra = j;\n if (x==j) {\n vic = j;\n dra = i;\n }\n console_log(xInf+\"I x:ageGp:fam \"+vic+\":\"+P[vic].ageGp+\":\"+P[vic].famKey+\" by \"+P[dra].state+\" \"+dra+\":\"+P[dra].ageGp+\":\"+P[dra].famKey+\" at gen\"+gen+\" Univ\"+wU+\" prob=\"+VaxProb.toFixed(3));\n }\n\n\n if (ipostInfect > VLincD) {\n P[i].touchCt++\n };\n if (ipostInfect > VLincD && P[j].state == \"green\") {\n P[i].susCt++\n };\n if (jpostInfect > VLincD) {\n P[j].touchCt++\n };\n if (jpostInfect > VLincD && P[i].state == \"green\") {\n P[j].susCt++\n };\n\n }", "title": "" }, { "docid": "a47cb9adb367c9824aaf5fad106f6c7b", "score": "0.519093", "text": "function ds_nganh_nghe_trang_chu_ntv_theo_ten() {\n\tv_url = '/ajax/ntv_danh_sach_nganh_nghe_trang_chu/sap_xep_theo_ten/';\n\tAjaxAction('div_ds_nganh_nghe_trang_chu_ntv', v_url);\n}", "title": "" }, { "docid": "0729e6af1292168252bd080d54efd637", "score": "0.5183345", "text": "function resul() {\n // Ordi Pierre vs User Papier\n if (Ordi === 0 && Vous === 1) {\n\n Res.innerHTML = \"Victoire\";\n vousScor.innerHTML++;\n return;\n console.log(vousScor);\n\n\n // User Papier vs Ordi Pierre\n } else if (Ordi === 1 && Vous === 0) {\n\n Res.innerHTML = \"Perdu\";\n OrdiScor.innerHTML++;\n return;\n\n\n\n }\n // Ordi Papier vs User Ciseau \n else if (Ordi === 1 && Vous === 2) {\n\n\n Res.innerHTML = \"Victoire\";\n vousScor.innerHTML++;\n return;\n console.log(vousScor);\n\n\n\n }\n // Ordi Ciseau vs User Papier\n else if (Ordi === 2 && Vous === 1) {\n\n\n Res.innerHTML = \"Perdu\";\n OrdiScor.innerHTML++;\n return;\n\n\n\n }\n // Ordi Ciseau vs User Pierre\n else if (Ordi === 2 && Vous === 0) {\n\n\n Res.innerHTML = \"Victoire\";\n vousScor.innerHTML++;\n return;\n console.log(vousScor);\n\n\n\n }\n // Ordi Pierre vs User Ciseau\n\n else if (Ordi === 0 && Vous === 2) {\n\n\n Res.innerHTML = \"Perdu\";\n OrdiScor.innerHTML++;\n return;\n\n\n }\n\n else {\n\n\n Res.innerHTML = \"Egalité\";\n return;\n\n\n\n }\n\n}", "title": "" }, { "docid": "ec5ea5781874d6da7632c95f52fcb285", "score": "0.5182392", "text": "function texteVisionsForces(transDSR, transScore, appreDSR, appreScore, develDSR, develScore, soutiDSR, soutiScore, reforDSR, reforScore) {\n//-----------------------TABLEAU DES VISIONS--------------------------//\n//création des objets de type vision\n function Vision(nomVision, dsrVision, scoreVision) {\n this.nom = nomVision;\n this.dsr = parseInt(dsrVision);\n this.score = parseInt(scoreVision);\n }\n\n//création des objets vision pour les 5 visions d'enseignement\n var Transmission = new Vision(\"de transmission\", transDSR, transScore);\n var Apprenti = new Vision(\"du maître et de l&#39;apprenti\", appreDSR, appreScore);\n var Developpement = new Vision(\"de développement\", develDSR, develScore);\n var Soutien = new Vision(\"de soutien émotionnel\", soutiDSR, soutiScore);\n var Reforme = new Vision(\"de changement social\", reforDSR, reforScore);\n\n var visionsScores = [Transmission, Apprenti, Developpement, Soutien, Reforme];\n\n//initialisation de la variable stockant le nom de la vision dominante\n var visionDomi = \"\";\n\n//initialisation de la variable s'assurant qu'une vision dominante existe\n var visionDomiOK = false;\n\n//Recherche de la vision dominante\n for (i = 0; i < 5; i++) {\n var nVisDomi;\n if (visionDomiOK == false) {\n if (visionsScores[i].dsr == 2) {\n visionDomi = visionsScores[i].nom;\n visionDomiOK = true;\n nVisDomi = i;\n }\n }\n if (visionDomiOK == true) {\n if (visionsScores[i].score > visionsScores[nVisDomi].score) {\n visionDomi = visionsScores[i].nom;\n visionDomiOK = true;\n nVisDomi = i;\n }\n }\n }\n\n//s'il n'y a pas de vision dominante, recherche de la vision au score le plus élevé\n if (visionDomiOK == false) {\n visionsScores.sort(function (a, b) {\n return b.score - a.score\n });\n visionDomi = visionsScores[0].nom;\n }\n\n\n//affichage du profil en fonction des forces principales et de la vision\n document.write('Utiliser vos forces dans une vision ' + visionDomi + ' de l&#39;enseignement :<br /><div class=\"bloc920\">');\n if (visionDomi == \"de transmission\") {\n for (i = 0; i < 4; i++) {\n switch (forcesScores[i].nom) {\n case \"Curiosité\" :\n document.write(\"<b>Curiosité : </b>\" + curiT + \"<br />\");\n break;\n case \"Créativité\" :\n document.write(\"<b>Créativité : </b>\" + creaT + \"<br />\");\n break;\n case \"Intelligence sociale\" :\n document.write(\"<b>Intelligence sociale : </b>\" + intST + \"<br />\");\n break;\n case \"Perspective\" :\n document.write(\"<b>Perspective : </b>\" + ptivT + \"<br />\");\n break;\n case \"Persévérance\" :\n document.write(\"<b>Persévérance : </b>\" + persT + \"<br />\");\n break;\n case \"Honnêteté\" :\n document.write(\"<b>Honnêteté / Intégrité : </b>\" + honnT + \"<br />\");\n break;\n case \"Gentillesse\" :\n document.write(\"<b>Gentillesse et générosité : </b>\" + gentT + \"<br />\");\n break;\n case \"Amour\" :\n document.write(\"<b>Capacité d'aimer et d'être aimé•e : </b>\" + amouT + \"<br />\");\n break;\n case \"Travail d'équipe\" :\n document.write(\"<b>Travail d'équipe / Fidélité : </b>\" + trvET + \"<br />\");\n break;\n case \"Impartialité\" :\n document.write(\"<b>Impartialité / Équité : </b>\" + impaT + \"<br />\");\n break;\n case \"Leadership\" :\n document.write(\"<b>Leadership : </b>\" + leadT + \"<br />\");\n break;\n case \"Gratitude\" :\n document.write(\"<b>Gratitude : </b>\" + gratT + \"<br />\");\n break;\n case \"Optimisme\" :\n document.write(\"<b>Optimisme / Anticipation : </b>\" + optiT + \"<br />\");\n break;\n case \"Enthousiasme\" :\n document.write(\"<b>Enthousiasme / Vigueur : </b>\" + enthT + \"<br />\");\n break;\n default:\n document.write(\"Nous avons rencontré un problème.\");\n }\n }\n }\n if (visionDomi == \"du maître et de l&#39;apprenti\") {\n for (i = 0; i < 4; i++) {\n switch (forcesScores[i].nom) {\n case \"Curiosité\" :\n document.write(\"<b>Curiosité : </b>\" + curiA + \"<br />\");\n break;\n case \"Créativité\" :\n document.write(\"<b>Créativité : </b>\" + creaA + \"<br />\");\n break;\n case \"Intelligence sociale\" :\n document.write(\"<b>Intelligence sociale : </b>\" + intSA + \"<br />\");\n break;\n case \"Perspective\" :\n document.write(\"<b>Perspective : </b>\" + ptivA + \"<br />\");\n break;\n case \"Persévérance\" :\n document.write(\"<b>Persévérance : </b>\" + persA + \"<br />\");\n break;\n case \"Honnêteté\" :\n document.write(\"<b>Honnêteté / Intégrité : </b>\" + honnA + \"<br />\");\n break;\n case \"Gentillesse\" :\n document.write(\"<b>Gentillesse et générosité : </b>\" + gentA + \"<br />\");\n break;\n case \"Amour\" :\n document.write(\"<b>Capacité d'aimer et d'être aimé•e : </b>\" + amouA + \"<br />\");\n break;\n case \"Travail d'équipe\" :\n document.write(\"<b>Travail d'équipe / Fidélité : </b>\" + trvEA + \"<br />\");\n break;\n case \"Impartialité\" :\n document.write(\"<b>Impartialité / Équité : </b>\" + impaA + \"<br />\");\n break;\n case \"Leadership\" :\n document.write(\"<b>Leadership : </b>\" + leadA + \"<br />\");\n break;\n case \"Gratitude\" :\n document.write(\"<b>Gratitude : </b>\" + gratA + \"<br />\");\n break;\n case \"Optimisme\" :\n document.write(\"<b>Optimisme / Anticipation : </b>\" + optiA + \"<br />\");\n break;\n case \"Enthousiasme\" :\n document.write(\"<b>Enthousiasme / Vigueur : </b>\" + enthA + \"<br />\");\n break;\n default:\n document.write(\"Nous avons rencontré un problème.\");\n }\n }\n }\n if (visionDomi == \"de développement\") {\n for (i = 0; i < 4; i++) {\n switch (forcesScores[i].nom) {\n case \"Curiosité\" :\n document.write(\"<b>Curiosité : </b>\" + curiD + \"<br />\");\n break;\n case \"Créativité\" :\n document.write(\"<b>Créativité : </b>\" + creaD + \"<br />\");\n break;\n case \"Intelligence sociale\" :\n document.write(\"<b>Intelligence sociale : </b>\" + intSD + \"<br />\");\n break;\n case \"Perspective\" :\n document.write(\"<b>Perspective : </b>\" + ptivD + \"<br />\");\n break;\n case \"Persévérance\" :\n document.write(\"<b>Persévérance : </b>\" + persD + \"<br />\");\n break;\n case \"Honnêteté\" :\n document.write(\"<b>Honnêteté / Intégrité : </b>\" + honnD + \"<br />\");\n break;\n case \"Gentillesse\" :\n document.write(\"<b>Gentillesse et générosité : </b>\" + gentD + \"<br />\");\n break;\n case \"Amour\" :\n document.write(\"<b>Capacité d'aimer et d'être aimé•e : </b>\" + amouD + \"<br />\");\n break;\n case \"Travail d'équipe\" :\n document.write(\"<b>Travail d'équipe / Fidélité : </b>\" + trvED + \"<br />\");\n break;\n case \"Impartialité\" :\n document.write(\"<b>Impartialité / Équité : </b>\" + impaD + \"<br />\");\n break;\n case \"Leadership\" :\n document.write(\"<b>Leadership : </b>\" + leadD + \"<br />\");\n break;\n case \"Gratitude\" :\n document.write(\"<b>Gratitude : </b>\" + gratD + \"<br />\");\n break;\n case \"Optimisme\" :\n document.write(\"<b>Optimisme / Anticipation : </b>\" + optiD + \"<br />\");\n break;\n case \"Enthousiasme\" :\n document.write(\"<b>Enthousiasme / Vigueur : </b>\" + enthD + \"<br />\");\n break;\n default:\n document.write(\"Nous avons rencontré un problème.\");\n }\n }\n }\n if (visionDomi == \"de soutien émotionnel\") {\n for (i = 0; i < 4; i++) {\n switch (forcesScores[i].nom) {\n case \"Curiosité\" :\n document.write(\"<b>Curiosité : </b>\" + curiS + \"<br />\");\n break;\n case \"Créativité\" :\n document.write(\"<b>Créativité : </b>\" + creaS + \"<br />\");\n break;\n case \"Intelligence sociale\" :\n document.write(\"<b>Intelligence sociale : </b>\" + intSS + \"<br />\");\n break;\n case \"Perspective\" :\n document.write(\"<b>Perspective : </b>\" + ptivS + \"<br />\");\n break;\n case \"Persévérance\" :\n document.write(\"<b>Persévérance : </b>\" + persS + \"<br />\");\n break;\n case \"Honnêteté\" :\n document.write(\"<b>Honnêteté / Intégrité : </b>\" + honnS + \"<br />\");\n break;\n case \"Gentillesse\" :\n document.write(\"<b>Gentillesse et générosité : </b>\" + gentS + \"<br />\");\n break;\n case \"Amour\" :\n document.write(\"<b>Capacité d'aimer et d'être aimé•e : </b>\" + amouS + \"<br />\");\n break;\n case \"Travail d'équipe\" :\n document.write(\"<b>Travail d'équipe / Fidélité : </b>\" + trvES + \"<br />\");\n break;\n case \"Impartialité\" :\n document.write(\"<b>Impartialité / Équité : </b>\" + impaS + \"<br />\");\n break;\n case \"Leadership\" :\n document.write(\"<b>Leadership : </b>\" + leadS + \"<br />\");\n break;\n case \"Gratitude\" :\n document.write(\"<b>Gratitude : </b>\" + gratS + \"<br />\");\n break;\n case \"Optimisme\" :\n document.write(\"<b>Optimisme / Anticipation : </b>\" + optiS + \"<br />\");\n break;\n case \"Enthousiasme\" :\n document.write(\"<b>Enthousiasme / Vigueur : </b>\" + enthS + \"<br />\");\n break;\n default:\n document.write(\"Nous avons rencontré un problème.\");\n }\n }\n }\n if (visionDomi == \"de changement social\") {\n for (i = 0; i < 4; i++) {\n switch (forcesScores[i].nom) {\n case \"Curiosité\" :\n document.write(\"<b>Curiosité : </b>\" + curiR + \"<br />\");\n break;\n case \"Créativité\" :\n document.write(\"<b>Créativité : </b>\" + creaR + \"<br />\");\n break;\n case \"Intelligence sociale\" :\n document.write(\"<b>Intelligence sociale : </b>\" + intSR + \"<br />\");\n break;\n case \"Perspective\" :\n document.write(\"<b>Perspective : </b>\" + ptivR + \"<br />\");\n break;\n case \"Persévérance\" :\n document.write(\"<b>Persévérance : </b>\" + persR + \"<br />\");\n break;\n case \"Honnêteté\" :\n document.write(\"<b>Honnêteté / Intégrité : </b>\" + honnR + \"<br />\");\n break;\n case \"Gentillesse\" :\n document.write(\"<b>Gentillesse et générosité : </b>\" + gentR + \"<br />\");\n break;\n case \"Amour\" :\n document.write(\"<b>Capacité d'aimer et d'être aimé•e : </b>\" + amouR + \"<br />\");\n break;\n case \"Travail d'équipe\" :\n document.write(\"<b>Travail d'équipe / Fidélité : </b>\" + trvER + \"<br />\");\n break;\n case \"Impartialité\" :\n document.write(\"<b>Impartialité / Équité : </b>\" + impaR + \"<br />\");\n break;\n case \"Leadership\" :\n document.write(\"<b>Leadership : </b>\" + leadR + \"<br />\");\n break;\n case \"Gratitude\" :\n document.write(\"<b>Gratitude : </b>\" + gratR + \"<br />\");\n break;\n case \"Optimisme\" :\n document.write(\"<b>Optimisme / Anticipation : </b>\" + optiR + \"<br />\");\n break;\n case \"Enthousiasme\" :\n document.write(\"<b>Enthousiasme / Vigueur : </b>\" + enthR + \"<br />\");\n break;\n default:\n document.write(\"Nous avons rencontré un problème.\");\n }\n }\n }\n document.write(\"</div>\")\n}", "title": "" }, { "docid": "7c63ef0476c38cb66eadfa521b60ee5e", "score": "0.5178276", "text": "recalculo(){\n let total = 0;\n for(let i = 0; i < this.detalles.length ; i++){\n total += this.calcularSubtotal(this.detalles[i].det_cant\n ,this.detalles[i].det_punit);\n }\n this.fact_igv_t = total * this.fact_igv_p / 100;\n this.comp_total = total;\n }", "title": "" }, { "docid": "22afdacb0017ea44b327ddd3f3bc48bc", "score": "0.5177717", "text": "attribuScore(){ // Attribu les score\n if(this.tourDeJeu%2===0){\n this.scoreJoueur1+=parseInt(this.mot.length);\n let Joueur1 =document.querySelector(\".pendu section:nth-of-type(1) article:nth-of-type(1) p:nth-of-type(2)\");\n Joueur1.innerHTML=(this.scoreJoueur1);\n }\n else{\n this.scoreJoueur2+=parseInt(this.mot.length);\n let Joueur2 =document.querySelector(\".pendu section:nth-of-type(1) article:nth-of-type(2) p:nth-of-type(2)\");\n Joueur2.innerHTML=(this.scoreJoueur2);\n }\n }", "title": "" }, { "docid": "ced7b0479f2704c7cf6df4bf2bab5b79", "score": "0.51769495", "text": "function vajutaKontroll() {\n\n if(etapp==1){\n if(e1lipp==false){\n kontrollr();\n }else{}\n\n }else if(etapp==2){\n\n if(e1lipp==false){\n console.log(\"kontroll\");\n kontrollI1();\n\n }\n if(e2lipp==false){\n console.log(\"kontroll\");\n kontrollI2();\n }\n if(e3lipp==false){\n console.log(\"kontroll\");\n kontrollI34();\n }\n }else if(etapp==3){\n if(e1lipp==false){\n kontrollU1();\n }\n if(e2lipp==false){\n kontrollU2();\n }\n if(e3lipp==false){\n kontrollU3();\n }\n }else if(etapp==4){\n if(e1lipp==false){\n kontrollI3();\n }\n if(e2lipp==false){\n kontrollI4();\n }\n if(e1lipp==true && e2lipp==true){\n liiguedasi();\n }\n }\n console.log(\"etapp on \"+etapp);\n console.log(\"kordusi on\"+kordused);\n console.log(\"punkte on \"+punkte);\n console.log(e1lipp + \" \"+ e2lipp + \" \"+ e3lipp);\n}", "title": "" }, { "docid": "6032f7aa249856463152951cdc04e30e", "score": "0.5175455", "text": "calcularCostoInventarioMenorIgual()\n {\n let {demanda, costoDePreparacion, costoDeAlmacenamiento, precioC1, ym} = this.state;\n return (Number(demanda)*Number(precioC1) + ((Number(costoDePreparacion)*Number(demanda))/(ym)) + (ym*Number(costoDeAlmacenamiento))/2 ) //TCU1(y)\n }", "title": "" }, { "docid": "e10148fa4e8b0ff0f14be952ce7a7386", "score": "0.5175268", "text": "computeAction() {\n if (Math.abs(this.xVel) > 0.01) {\n this.action = 2;\n } else {\n this.action = 0;\n }\n if (!this.grounded) {\n this.action = 4;\n }\n if (this.onSkate) {\n this.action = 6;\n if (this.holdingJump) {\n this.action = 8;\n if (this.holdingJump > 15) {\n if (this.holdingJump < 15 + dT) {\n this.frame = 0;\n this.frameCounter = 0;\n }\n this.action = 10;\n }\n } else if (this.xVel == 0 && !this.uncontrollable) {\n this.frame = 0;\n this.frameCounter = 0;\n }\n if (flash > 0) {\n this.action = 12;\n }\n }\n\n if (this.saving) {\n this.action = 14;\n this.baseSlowness = 10;\n if (this.frame == this.actionX[this.action].length - 1 && this.frameCounter > this.baseSlowness * dT - 1 * dT) {\n this.saving = false;\n this.uncontrollable = false;\n this.baseSlowness = 4;\n }\n }\n }", "title": "" }, { "docid": "2e9045f41560dd13b6db189867687aa0", "score": "0.5175086", "text": "function modifierVisiteAnnuelle(){\n\t\n}", "title": "" }, { "docid": "d98dedc4d811be041df2f80b84fb47b5", "score": "0.5172473", "text": "function VUa(){this.F=0;this.J=[];this.H=[];this.X=this.O=this.C=this.N=this.V=this.L=0;this.qa=[]}", "title": "" }, { "docid": "7fc1c267152928a78183df98c3546a5a", "score": "0.5166529", "text": "calcIndemnitesJoursAuReel (facture, prixEntretien) {\n // facture.coutIndemniteAuReel = facture.nombreJoursAuReel * prixEntretien\n return facture.nombreJoursAuReel * prixEntretien\n }", "title": "" }, { "docid": "57f6263e42f1735765a34c687f917551", "score": "0.5160234", "text": "function presun_z_vytvor_do_aktual()\n{\n aktualny_turnaj_nazov=vytvor_turnaj_nazov;\n aktualny_turnaj_typ=vytvor_turnaj_typ;\n aktualny_turnaj_pocet_skupin=vytvor_turnaj_pocet_skupin;\n \n vytvor_turnaj_nazov=\"\";\n vytvor_turnaj_typ=\"\";\n vytvor_turnaj_pocet_skupin=\"\";\n}", "title": "" }, { "docid": "021e355ee98c423b228657a8e03e9c6e", "score": "0.51567185", "text": "function texteIncoherences(croT, croA, croD, croS, croR, intT, intA, intD, intS, intR, actT, actA, actD, actS, actR) {\n\n//analyse des différences vision par vision\n var diffTransmission = diffCompVision(\"de transmission\", parseInt(croT), parseInt(intT), parseInt(actT));\n var diffApprenti = diffCompVision(\"d&#39;apprenti\", parseInt(croA), parseInt(intA), parseInt(actA));\n var diffDeveloppement = diffCompVision(\"de développement\", parseInt(croD), parseInt(intD), parseInt(actD));\n var diffSoutien = diffCompVision(\"de soutien\", parseInt(croS), parseInt(intS), parseInt(actS));\n var diffReforme = diffCompVision(\"de changement social\", parseInt(croR), parseInt(intR), parseInt(actR));\n\n//affichage des textes des différences le cas échéant\n//si le nb compté dans les objects est égal à 0 on affiche rien\n var messagedifferences = \"\";\n //pour la vision de transmission\n if (diffTransmission[0][1] == 1) {\n messagedifferences += diffTransmission[0][0];\n }\n if (diffTransmission[1][1] == 1) {\n messagedifferences += diffTransmission[1][0];\n }\n if (diffTransmission[2][1] == 1) {\n messagedifferences += diffTransmission[2][0];\n }\n //pour la vision d'apprenti\n if (diffApprenti[0][1] == 1) {\n messagedifferences += diffApprenti[0][0];\n }\n if (diffApprenti[1][1] == 1) {\n messagedifferences += diffApprenti[1][0];\n }\n if (diffApprenti[2][1] == 1) {\n messagedifferences += diffApprenti[2][0];\n }\n //pour la vision de développement\n if (diffDeveloppement[0][1] == 1) {\n messagedifferences += diffDeveloppement[0][0];\n }\n if (diffDeveloppement[1][1] == 1) {\n messagedifferences += diffDeveloppement[1][0];\n }\n if (diffDeveloppement[2][1] == 1) {\n messagedifferences += diffDeveloppement[2][0];\n }\n //pour la vision de soutien\n if (diffSoutien[0][1] == 1) {\n messagedifferences += diffSoutien[0][0];\n }\n if (diffSoutien[1][1] == 1) {\n messagedifferences += diffSoutien[1][0];\n }\n if (diffSoutien[2][1] == 1) {\n messagedifferences += diffSoutien[2][0];\n }\n //pour la vision de changement social (réforme)\n if (diffReforme[0][1] == 1) {\n messagedifferences += diffReforme[0][0];\n }\n if (diffReforme[1][1] == 1) {\n messagedifferences += diffReforme[1][0];\n }\n if (diffReforme[2][1] == 1) {\n messagedifferences += diffReforme[2][0];\n }\n\n//vérification du message et affichage le cas échéant\n var diffPluriel = diffTransmission[0][1] + diffTransmission[1][1] + diffTransmission[2][1] + diffApprenti[0][1] + diffApprenti[1][1] + diffApprenti[2][1] + diffDeveloppement[0][1] + diffDeveloppement[1][1] + diffDeveloppement[2][1] + diffSoutien[0][1] + diffSoutien[1][1] + diffSoutien[2][1] + diffReforme[0][1] + diffReforme[1][1] + diffReforme[2][1];\n\n var titrediff = '<h3>Décalages entre croyances, intentions et actions</h3><div class=\"bloc920\">';\n\n if (messagedifferences != \"\" && diffPluriel == 1) {\n document.write(titrediff);\n document.write(messagedifferences + '</div>' + \"<br /><i>Comment expliquez vous ce décalage ? Est-il de votre fait, ou est-il lié à des impératifs imposés par votre établissement ?</i><br />\");\n }\n else if (messagedifferences != \"\" && diffPluriel > 1) {\n document.write(titrediff);\n document.write(messagedifferences + '</div>' + \"<br /><i>Comment expliquez vous ces décalages ? Sont-ils de votre fait, ou sont-ils liés à des impératifs imposés par votre établissement ?</i><br />\");\n }\n else if (messagedifferences == \"\") {\n document.write(titrediff);\n document.write(\"Vos croyances, intentions et actions sont en harmonie.<br />\" + '</div>' + \"<br />Cela signifie que vous agissez en fonction de vos intentions et que vos comportements et vos croyances sont alignés.</i><br />\");\n }\n\n}", "title": "" }, { "docid": "64ce7763220fff883335a286e025b09a", "score": "0.5149757", "text": "function affiche_Vie() {\n if(vieE>1){\n vie.innerHTML='Il vous reste '+ vieE +' vies';\n }else{\n vie.innerHTML='Il vous reste '+ vieE +' vie';\n }\n}", "title": "" }, { "docid": "7642e10eef9b7aacf3c506e55d31b59c", "score": "0.51472515", "text": "function CestaCompraController(){\n var me = this;\n me.columna;\n me.orden=false;\n\n me.ordenNombre=true;\n me.ordenFlechaNombre=true;\n me.ordenPrecio=true;\n me.ordenFlechaPrecio=true;\n\n me.precioTotalResultado=0;\n me.precioTotal=0;\n me.frutaSeleccionada = \"\";\n me.frutasJson={\"fruta\":[\n {\n \"imagen\": \"manzana.jpg\",\n \"nombre\":\"Manzana\",\n \"color\":\"roja\",\n \"precio\": 13, \n \"cantidad\": 0\n },\n {\n \"imagen\": \"fresa.jpg\",\n \"nombre\":\"Maracuya\",\n \"color\":\"lila\",\n \"precio\": 5,\n \"cantidad\": 0\n },\n {\n \"imagen\": \"pera.jpg\",\n \"nombre\":\"pera\",\n \"color\":\"verde\",\n \"precio\": 4,\n \"cantidad\": 0\n }\n ]};\n\n me.seleccionado = function( fruta ){\n console.log('click seleccionado' + fruta);\n me.frutaSeleccionada = fruta; \n\n }\n \n me.sumarCantidad = function( fruta ){\n console.log('click sumarCantidad' + fruta);\n me.frutaSeleccionada = fruta; \n me.frutaSeleccionada.cantidad++; \n }\n\n me.restarCantidad = function( fruta ){\n console.log('click restarCantidad' + fruta);\n me.frutaSeleccionada = fruta; \n if(me.frutaSeleccionada.cantidad>0){\n me.frutaSeleccionada.cantidad--;\n }\n \n }\n \n me.calcularPrecioTotal = function( fruta ){\n /*\n console.log('click calcularPrecioTotal' + fruta);\n me.frutaSeleccionada = fruta;\n me.precioTotal = me.precioTotal + me.frutaSeleccionada.precio * me.frutaSeleccionada.cantidad;\n me.precioTotalResultado= me.precioTotal;\n me.precioTotal = 0;\n */\n console.log('click ordenar %o' + fruta);\n var i = 0;\n \n\n // TODO\n for(i=0;i<Object.keys(me.frutasJson.fruta).length;i++){\n me.frutaSeleccionada = fruta;\n me.precioTotal = me.precioTotal + me.frutaSeleccionada.precio * me.frutaSeleccionada.cantidad;\n me.precioTotalResultado= me.precioTotal;\n me.precioTotal = 0;\n }\n \n }\n\n me.ordenar = function( column ){\n console.log('click ordenar');\n\n me.columna=column;\n if(column=='nombre'){\n me.ordenNombre=!me.ordenNombre;\n me.orden=!me.ordenNombre;\n }else{\n me.ordenPrecio=!me.ordenPrecio;\n me.orden=!$me.ordenPrecio;\n }\n\n }\n }", "title": "" }, { "docid": "7c57d9b5a0e5746ded01e80496be98c0", "score": "0.51335824", "text": "function cambiar_cantidad() {\n \n}", "title": "" }, { "docid": "7c98e7f88579c4540a7359a1ec411387", "score": "0.5127223", "text": "function joueurSuivant() {\n\n joueurActif === 1 ? joueurActif = 2 : joueurActif = 1;\n scoreEnCours = 0;\n document.getElementById(`encours-${joueurActif}`).textContent = '0';\n document.querySelector('.joueur-1-panel').classList.toggle('active');\n document.querySelector('.joueur-2-panel').classList.toggle('active');\n document.querySelector('.de').style.display = 'none';\n\n}", "title": "" }, { "docid": "439bb6149e46de6728f3783af7959408", "score": "0.5124683", "text": "function result4(idTxFE, idD_FE){\n\tvar TxFE = document.getElementById(idTxFE);\n\tvar D_FE = document.getElementById(idD_FE);\n\t\n\tif(valve.checked){\n\t\t // vérifier ce que ça change sur la dose ou l'INR\n\t}\n\tif (testTaux(TxFE) != \"\"){\n\t\tdisplayAffichage(\"INR incorrect\");\n\t\treturn false ;\n\t}\n\tTxFE = TxFE.value;\n\tif (testDose(D_FE, \"fluindione\") != \"\"){\n\t\tdisplayAffichage(\"dose incorrecte\");\n\t\treturn false;\n\t}\n\tD_FE = parseInt(D_FE.value);\n\t\n\tif(TxFE > 4){\n\t\tif(TxFE < 6){\n\t\t\tdisplayAffichage(\"Saut d'une prise, pas d'apport de vitamine K, préléver l'INR le lendemain. diminuer la dose de 20%. reprise du traitement si INR < 2.5\");\n\t\t}\n\t\telse if(TxFE < 10){\n\t\t\tdisplayAffichage(\"Arrêt du traitement, 2mg de vitamine K par voie orale, prélever l'INR le lendemain, diminuer la dose de 10mg reprise tu traitement si INR < 2.5\");\n\t\t}\n\t\telse{\n\t\t// taux > 10\n\t\t\tdisplayAffichage(\"Arrêt du traitement, 5mg de vitamine k par voie orale, prélever l'INR le lendemain, changer d'AVK et préférer la WARAFARINE\");\n\t\t}\n\t}\n\telse{\n\t\t//taux dans la norme\n\t\tif(TxFE < 2.5){\n\t\t\tdose = D_FE + ((20*D_FE)/100);\n\t\t}\n\t\telse{\n\t\t\tdose = D_FE - ((20*D_FE)/100);\n\t\t}\n\t\tdisplayAffichage(\"Le traitement est de \" + dose + \"mg de Fluindione\");\n\n\t}\n}", "title": "" }, { "docid": "56e8a00efe82a359ae7ed5d14ae16c11", "score": "0.512409", "text": "function operazioni(studente){\r\n\talert(\"Inizio procedura calcolo ISEE per lo studente\"\r\n\t\t\t+ studente.nome + \" \" + studente.cognome);\r\n\tvar numeroComponenti = prompt(\"Inserisci il numero dei componenti\");\r\n\tcomponentiReddito = new Array();\r\n\tcomponentiPatrimonio = new Array();\r\n\t\r\n\tvar i;\r\n\tfor (i = 0; i < numeroComponenti; i++){\r\n\t\tcomponentiReddito[i] = prompt(\"Inserisci il reddito del componente \" + (i + 1));\r\n\t\tcomponentiPatrimonio[i] = prompt(\"Inserisci il patrimonio del componente \" + (i + 1));\r\n\t}\r\n\t\r\n\tvar redditoComplessivo = 0;\r\n\tvar patrimonioComplessivo = 0;\r\n\t\r\n\tfor (i = 0; i < numeroComponenti; i++){\r\n\t\tredditoComplessivo += parseInt(componentiReddito[i]);\r\n\t\tpatrimonioComplessivo += parseInt(componentiPatrimonio[i]);\r\n\t}\r\n\tISR = redditoComplessivo;\r\n\tISP = patrimonioComplessivo;\r\n\t\r\n\tISE = ISR + ISP * 20/100;\r\n\t\t\r\n\tscaleEquivalenza =\r\n\t{\r\n\t\t\t\"1\" : 1,\r\n\t\t\t\"2\" : 1.57,\r\n\t\t\t\"3\" : 2.04,\r\n\t\t\t\"4\" : 2.46,\r\n\t\t\t\"5\" : 2.85\r\n\t};\r\n\t\r\n\t\r\n\t\r\n\tvar calcolaSe = function(numeroComponenti){\r\n\t\tvar SE;\r\n\t\tswitch (parseInt(numeroComponenti)){\r\n\t\tcase 1:\r\n\t\t\tSE = 1;\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tSE = 1.57;\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tSE = 2.04;\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tSE = 2.46;\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tSE = 2.85;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn SE;\r\n\t}\r\n\t\r\n\tSE = calcolaSe(numeroComponenti);\r\n\t//alert(\"SIIIIIIIIIIIII\");\r\n\tISEE = ISE / SE;\r\n\t\r\n\treportISEECalcolato = \"Report ISEE calcolato:\\n\";\r\n\treportISEECalcolato += \"Numero componenti nucleo familiare:\" + numeroComponenti + \"\\n\";\r\n\treportISEECalcolato += \"Reddito complessivo nucleo familiare:\" + redditoComplessivo + \"\\n\";\r\n\treportISEECalcolato += \"Patrimonio complessivo nucleo familiare:\" + patrimonioComplessivo + \"\\n\";\r\n\treportISEECalcolato += \"Valore ISE:\" + ISE + \"\\n\";\r\n\treportISEECalcolato += \"Scala equivalenza applicata:\" + SE + \"\\n\";\r\n\treportISEECalcolato += \"Valore ISEE:\" + ISEE + \"\\n\";\r\n\t\r\n\talert(reportISEECalcolato);\r\n}", "title": "" }, { "docid": "4f76287bbe2de8d89c6d68c3f121355a", "score": "0.51152015", "text": "function operat() {\r\n // ********************************************************************\r\n // Initialize summation of variables\r\n // ********************************************************************\r\n for (let mo = 1; mo <= 13; mo++) {\r\n for (let m = 1; m <= mm; m++) {\r\n tpoe[m] = 0.0;\r\n voe[m][mo] = 0.0;\r\n };\r\n toe[mo] = 0.0;\r\n tvoe[mo] = 0.0;\r\n };\r\n // ********************************************************************\r\n // Begin calculation of budget\r\n // ********************************************************************\r\n for (let mo = 1; mo <= 12; mo++) {\r\n for (let m = 1; m <= mm; m++) {\r\n for (let i = 1; i <= n; i++) {\r\n voe[m][mo] = voe[m][mo] + sv[i][mo] * oek[i][m];\r\n };\r\n voe[m][13] = voe[m][13] + voe[m][mo];\r\n oe[m][mo] = voe[m][mo] + (foe[m] / 12.0);\r\n toe[mo] = toe[mo] + oe[m][mo];\r\n tvoe[mo] = tvoe[mo] + voe[m][mo];\r\n tpoe[m] = tpoe[m] + oe[m][mo];\r\n };\r\n tvoe[13] = tvoe[13] + tvoe[mo];\r\n toe[13] = toe[13] + toe[mo];\r\n };\r\n for (let m = 1; m <= mm; m++) {\r\n tfoe = tfoe + foe[m];\r\n };\r\n // ********************************************************************\r\n // Write out the budget\r\n // ********************************************************************\r\n write(`${fh(1)}${fx(44)}OPERATING EXPENSE COEFFICIENTS`); // 100\r\n write(`${fh(0)}${fx(11)}OEK(I,M)`); // 101\r\n write(` I${fx(8)} 1 2 3 4 5 6 7 8 9 10`); // 102\r\n write(` M`);\r\n for (let m = 1; m <= mm; m++) {\r\n write_no_cr(` ${fi(1, m)}${fx(7)}`); // 103\r\n for (let i = 1; i <= n; i++) {\r\n write_no_cr(`${ff(7, 3, oek[i][m])}`);\r\n };\r\n write(\"\");\r\n };\r\n write(`${fh(0)}${fx(10)}FIXED OPERATING EXPENSES FOE(M)`); // 104\r\n write_no_cr(`${fh(0)}${fx(10)}`);\r\n for (let m = 1; m <= mm; m++) {\r\n write_no_cr(`${ff(10, 4, foe[m])}`);\r\n };\r\n write(\"\");\r\n\r\n write(`${fh(1)}${fx(47)}OPERATING EXPENSE BUDGET`); // 105\r\n write(`${fh(0)}EXPENSE${fx(29)}VARIABLE OPERATING EXPENSES VOE(M,MO)${fx(31)}FIXED TOTAL`);\r\n write(` ITEM${fx(98)}OPERAT. OPERAT.`);\r\n write(` JAN. FEB. MAR. APR. MAY JUNE JULY AUG. SEPT. OCT NOV. DEC. PERIOD EXPENSES EXPENSES`);\r\n write(` M MO= 1 MO= 2 MO= 3 MO= 4 MO= 5 MO= 6 MO= 7 MO= 8 MO= 9 MO=10 MO=11 MO=12 MO=13 FOE(M) OE(M)`);\r\n for (let m = 1; m <= mm; m++) {\r\n write_no_cr(`${fh(0)}${fi(2, m)}${ff(13, 3, voe[m][1])}`); // 106\r\n for (let mo = 2; mo <= 13; mo++) {\r\n write_no_cr(`${ff(7, 3, voe[m][mo])}`);\r\n };\r\n write(`${ff(10, 3, foe[m])}${ff(10, 3, tpoe[m])}`);\r\n };\r\n write(`${fh(0)}TOTALS${fx(96)} TFOE TOE`); // 107\r\n write_no_cr(`TVOE(MO)${ff(8, 3, tvoe[1])}`);\r\n for (let mo = 2; mo <= 13; mo++) {\r\n write_no_cr(`${ff(7, 3, tvoe[mo])}`);\r\n };\r\n write(`${ff(10, 3, tfoe)}${ff(10, 3, toe[13])}`);\r\n\r\n\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "bf1e1d3eda388b4d1ad5b3a9a62ddf13", "score": "0.51143473", "text": "function B1() {\n document.getElementById(\"titre\").textContent = \"âge et nombre d'anciens\";\n document.getElementById(\"PAR1\").textContent = \"Nous allons dénombrer les personnes d'âge strictement inférieur à 20 ans, les personnes d'âge strictement supérieur à 40 ans et celles dont l'âge est compris entre 20 ans et 40 ans (20 ans et 40 ans y compris).Nous allons vous demander de rentrer des ages les uns à la suite des autres, quand vous aurez terminé, rentrez l'age d'une personne centenaire.\";\n // On détermine l'énoncé par deux parties, le titre puis l'énoncé, avec la technique textContent, ce qui va permettre d'afficher les élements sur la page html\n An(1);\n document.getElementById(\"result\").textContent = \"\";\n\n var com1 = document.getElementById(\"com1\");\n com1.addEventListener(\"click\", op1); // on crée un nouveau bouton qui va amener à une nouvelle fonction sur l'énoncé\n}", "title": "" }, { "docid": "dbd505a680ba5968411d9f84b0cbe88b", "score": "0.5112768", "text": "function evitementGenerique(msg, verbe, attributeName, actionName, tente, msgDejaFait, carac, typeAttaque, msgReussite, opt) {\n var options = parseOptions(msg);\n if (options === undefined) return;\n var cmd = options.cmd;\n if (cmd === undefined || cmd.length < 1) {\n error(\"Impossible de trouve la commande !\", msg.content);\n return;\n }\n if (cmd.length < 2) {\n error(\"Pas assez d'arguments pour \" + cmd[0], cmd);\n return;\n }\n var evt;\n var chance;\n if (cmd.length > 2) { //On relance pour un événement particulier\n evt = findEvent(cmd[2]);\n if (evt === undefined) {\n error(\"L'action est trop ancienne ou a été annulée\", cmd);\n return;\n }\n chance = cmd.length > 3 && cmd[3] == 'chance';\n } else {\n evt = lastEvent();\n }\n if (evt === undefined) {\n sendChat('', \"Historique d'actions vide, pas d'action trouvée pour esquiver\");\n return;\n }\n if (evt.type != 'Attaque') {\n sendChat('', \"la dernière action n'est pas une attaque réussie, trop tard pour \" + verbe + \" l'attaque précédente\");\n return;\n }\n var perso = persoOfId(cmd[1]);\n if (perso === undefined) {\n error(\"Le premier argument de \" + cmd[0] + \" n'est pas un token de personnage\", cmd);\n return;\n }\n if (!peutController(msg, perso)) {\n sendPlayer(msg, \"pas le droit d'utiliser ce bouton\");\n return;\n }\n var action = evt.action;\n var optionsAttaque = action.currentOptions;\n var pageId = action.pageId;\n var cible = action.cibles.find(function(target) {\n return (target.token.id === perso.token.id);\n });\n if (cible === undefined) {\n sendChar(perso.charId, \"n'est pas la cible de la dernière attaque\");\n return;\n }\n if (opt && opt.condition && !opt.condition(perso)) {\n attackDealDmg(action.attaquant, action.cibles, action.echecCritique, action.attackLabel, action.weaponStats, action.attackd20roll, action.display, optionsAttaque, evt, action.explications, pageId, action.ciblesAttaquees);\n }\n var jetAdversaire = cible.attackRoll;\n if (jetAdversaire === undefined) {\n error(\"Impossible de trouver le jet de l'attaquant\", cible);\n return;\n }\n var pc = ficheAttributeAsInt(perso, 'PC', 0);\n if (chance) {\n if (pc <= 0) {\n sendChar(perso.charId, \" n'a plus de point de chance à dépenser...\");\n chance = false;\n } else {\n setFicheAttr(perso, 'PC', pc - 1, evt);\n }\n } else {\n var attribut = tokenAttribute(perso, attributeName);\n if (attribut.length === 0) {\n sendChar(perso.charId, \"ne sait pas faire \" + actionName);\n return;\n }\n attribut = attribut[0];\n if (opt && opt.attrAsBool) {\n if (!attribut.get('current')) {\n sendChar(perso.charId, msgDejaFait);\n return;\n }\n evt.deletedAttributes = evt.deletedAttributes || [];\n evt.deletedAttributes.push(attribut);\n } else {\n var curAttribut = parseInt(attribut.get('current'));\n if (isNaN(curAttribut)) {\n error(\"Resource pour \" + actionName + \" mal formée\", attribut);\n return;\n }\n if (curAttribut < 1) {\n sendChar(perso.charId, msgDejaFait);\n return;\n }\n evt.attributes = evt.attributes || [];\n evt.attributes.push({\n attribute: attribut,\n current: curAttribut\n });\n attribut.set('current', curAttribut - 1);\n }\n }\n var attackRollExpr = \"[[\" + computeDice(perso) + \"]]\";\n sendChat('', attackRollExpr, function(res) {\n var msg = cible['msg' + attributeName];\n var totalEvitement = cible['total' + attributeName];\n if (chance) {\n msg += '+10';\n totalEvitement += 10;\n } else {\n var rolls = res[0];\n var attackRoll = rolls.inlinerolls[0];\n totalEvitement = attackRoll.results.total;\n msg = buildinline(attackRoll);\n var attBonus = ficheAttributeAsInt(perso, 'niveau', 1);\n switch (typeAttaque) {\n case 'distance':\n attBonus += modCarac(perso, carac);\n attBonus += ficheAttributeAsInt(perso, 'ATKTIR_DIV', 0);\n if (stateCOF.setting_arran ||\n (stateCOF.setting_mixte && ficheAttribute(perso, 'option_setting', 'generique') == 'arran')) {\n attBonus += ficheAttributeAsInt(perso, 'mod_atktir', 0);\n }\n break;\n case 'magique':\n attBonus += ficheAttributeAsInt(perso, 'ATKMAG_DIV', 0);\n if (stateCOF.setting_arran ||\n (stateCOF.setting_mixte && ficheAttribute(perso, 'option_setting', 'generique') == 'arran')) {\n attBonus += ficheAttributeAsInt(perso, 'mod_atkmag', 0);\n attBonus += modCarac(perso, 'intelligence');\n } else {\n attBonus += modCarac(perso, carac);\n }\n break;\n case 'contact':\n attBonus += ficheAttributeAsInt(perso, 'ATKCAC_DIV', 0);\n break;\n default:\n }\n if (opt && opt.arme && cible.arme) {\n actionName = cible.arme.nom;\n if (cible.arme.attSkillDiv) attBonus += cible.arme.attSkillDiv;\n }\n totalEvitement += attBonus;\n if (attBonus > 0) msg += \"+\" + attBonus;\n else if (attBonus < 0) msg += attBonus;\n var optionsEvitement = {\n displayName: true,\n pasDeDmg: true\n };\n var attEvBonus = bonusAttaqueA(cible, actionName, evt, cible.messages, optionsEvitement);\n var bad = bonusAttaqueD(cible, action.attaquant, 0, pageId, evt, cible.messages, optionsEvitement);\n attEvBonus += bad;\n if (opt && opt.bonusAttaque) attEvBonus += opt.bonusAttaque;\n if (attEvBonus > 0) msg += \"+\" + attEvBonus;\n else if (attEvBonus < 0) msg += attEvBonus;\n msg = cible.tokName + \" tente \" + tente + \". \" +\n onGenre(cible, \"Il\", \"elle\") + \" fait \" + msg;\n }\n if (totalEvitement < jetAdversaire) {\n cible.messages.push(msg + \" => Raté\");\n if (pc <= 0 || totalEvitement < jetAdversaire - 10) {\n removePreDmg(optionsAttaque, perso, attributeName);\n } else {\n removePreDmg(optionsAttaque, perso, attributeName, 'chance');\n cible['msg' + attributeName] = msg;\n cible['total' + attributeName] = totalEvitement;\n cible['indexMsg' + attributeName] = cible.messages.length - 1;\n }\n } else { //Évitement réussi\n if (opt && opt.critiqueDevientNormal && cible.critique) {\n cible.critique = false;\n msg += \" => Réussi, l'attaque fait des dégâts normaux\";\n removePreDmg(optionsAttaque, perso, attributeName);\n } else {\n cible.touche = false;\n action.cibles = action.cibles.filter(function(c) {\n return c.token.id != cible.token.id;\n });\n msg += \" => Réussi, \" + msgReussite;\n removePreDmg(optionsAttaque, perso);\n }\n if (cible['indexMsg' + attributeName] === undefined)\n cible.messages.push(msg);\n else\n cible.messages[cible['indexMsg' + attributeName]] = msg;\n }\n attackDealDmg(action.attaquant, action.cibles, action.echecCritique, action.attackLabel, action.weaponStats, action.attackd20roll, action.display, optionsAttaque, evt, action.explications, pageId, action.ciblesAttaquees);\n }); //fin lancé de dés asynchrone\n }", "title": "" }, { "docid": "c1bab42d5fec52f775aaf3ba7dab549c", "score": "0.51110405", "text": "function perform_operation()\r\n{\r\n\tvar operation = document.form1.elements[\"operationen\"].value; \r\n\r\n\tswitch(operation)\r\n\t{\r\n\t\tcase \"adjunkte\": \r\n\t\t\tadjunkte(); \r\n\t\t\tbreak; \r\n\t\tcase \"aequilibrierung\": \r\n\t\t\taequilibrierung(); \r\n\t\t\tbreak; \t\r\n\t\tcase \"loesen\": \r\n\t\t\taxb(); \r\n\t\t\tbreak; \r\n\t\tcase \"cholesky\": \r\n\t\t\tcholesky(); \r\n\t\t\tbreak; \r\n\t\tcase \"determinante_laplace\": \r\n\t\t\tdeterminante(); \r\n\t\t\tbreak; \r\n\t\tcase \"determinante_zerlegung\": \r\n\t\t\tLRdeterminante(); \r\n\t\t\tbreak; \r\n\t\tcase \"dimension_kern\": \r\n\t\t\tdimensionkern(); \r\n\t\t\tbreak; \r\n\t\tcase \"dimensionsregel\": \r\n\t\t\tdimensionsregel(); \r\n\t\t\tbreak; \r\n\t\tcase \"gauss\": \r\n\t\t\tgauss(); \r\n\t\t\tbreak; \r\n\t\tcase \"householder\": \r\n\t\t\thouseHold(); \r\n\t\t\tbreak; \r\n\t\tcase \"inverse\": \r\n\t\t\tinverse(); \r\n\t\t\tbreak; \r\n\t\tcase \"kreuzprodukt\": \r\n\t\t\tkreuzprodukt(); \r\n\t\t\tbreak; \r\n\t\tcase \"lr_zerlegung\": \r\n\t\t\tlrZerlegung(); \r\n\t\t\tbreak; \t\r\n\t\tcase \"matrixaddition\": \r\n\t\t\tmatrixAddition(); \r\n\t\t\tbreak; \r\n\t\tcase \"matrix_vektor\": \r\n\t\t\tvektormultiplikation(); \r\n\t\t\tbreak; \r\n\t\tcase \"matrixmultiplikation\": \r\n\t\t\tmatrixmultiplikation(); \r\n\t\t\tbreak; \r\n\t\tcase \"qr_house\": \r\n\t\t\tqrhouse(); \r\n\t\t\tbreak; \r\n\t\tcase \"qr_givens\": \r\n\t\t\tqrgivens(); \r\n\t\t\tbreak; \r\n\t\tcase \"rang\": \r\n\t\t\trang(); \r\n\t\t\tbreak; \r\n\t\tcase \"skalar_matrix\": \r\n\t\t\tskalarmultiplikation(); \r\n\t\t\tbreak; \r\n\t\tcase \"skalarprodukt\": \r\n\t\t\tskalarProdukt(); \r\n\t\t\tbreak; \r\n\t\tcase \"spatprodukt\": \r\n\t\t\tspatprodukt(); \r\n\t\t\tbreak; \r\n\t\tcase \"spur\": \r\n\t\t\tspur(); \r\n\t\t\tbreak; \t\r\n\t\tcase \"transponieren\": \r\n\t\t\ttransponierteAusgeben(); \r\n\t\t\tbreak; \r\n\t\tcase \"vektor1_vektor2\": \r\n\t\t\tvtv(); \r\n\t\t\tbreak; \r\n\t\tcase \"spaltensummennorm\": \r\n\t\t\tspaltensummennorm(); \r\n\t\t\tbreak; \r\n\t\tcase \"zeilensummennorm\": \r\n\t\t\tzeilensummennorm(); \r\n\t\t\tbreak; \r\n\t\tcase \"gesamtnorm\": \r\n\t\t\tgesamtnorm(); \r\n\t\t\tbreak; \r\n\t\tcase \"relativer_fehler\": \r\n\t\t\trelFehler(); \r\n\t\t\tbreak; \r\n\t\tcase \"betragsnorm\": \r\n\t\t\tbetragsnorm(); \r\n\t\t\tbreak; \r\n\t\tcase \"euklidnorm\": \r\n\t\t\teuklidnorm(); \r\n\t\t\tbreak; \r\n\t\tcase \"maxnorm\": \r\n\t\t\tmaxnorm(); \r\n\t\t\tbreak; \r\n\t\tcase \"pivotisierung\": \r\n\t\t\tpivotisierung(); \r\n\t\t\tbreak; \t\r\n\t\tcase \"aequilibrierung_pivotisierung\": \r\n\t\t\taequipivo(); \r\n\t\t\tbreak; \r\n\t\tcase \"eigenwerte\": \r\n\t\t\teigenwerte(); \r\n\t\t\tbreak; \r\n\t\r\n\t}\r\n\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "30bc9454ccee50049f3f603eefc280fc", "score": "0.5102491", "text": "function declaracionArrayCTV(ele, mod, ambi) {\n var encontreError = false;\n //BUSCANDO VECTOR EN LOS AMBITOS SI NO ESTA SE REALIZA DECLARACION\n if (!buscarVariable(ele.identificador)) {\n //VERIFICAR EXPRESIONES\n var v = [];\n //console.log(ele);\n //VERIFICANDO TAMAñO DE VECTOR DE VALORES PARA SABER SI ES NECESARIO ASIGNAR VALORES\n if (ele.valor.length > 0) {\n //console.log(\"traigo valores\");\n //AGREGANDO VALORES\n for (var e of ele.valor) {\n var exp = leerExp(e);\n if (e.tipo != \"Error Semantico\") {\n if (ele.tipoDato == exp.tipo) {\n v.push(exp.valor);\n } else {\n encontreError = true;\n errorSemantico.push({\n tipo: \"Error Semantico\",\n Error:\n \"Problema al insertar valores que no coinciden con tipo de vector \" +\n exp.valor,\n Fila: ele.fila,\n Columna: 0,\n });\n break;\n }\n } else {\n encontreError = true;\n errorSemantico.push(exp);\n break;\n }\n }\n //SI NO SE ENCONTRO UN ERROR SE HACE LA CREACION DE LA VARIABLE\n if (encontreError == false) {\n insertarAmbito({\n tipo: ele.tipo,\n ambito: rNomAmbito(),\n modificador: mod,\n identificador: ele.identificador,\n tipoDato: ele.tipoDato,\n valor: v,\n fila: ele.fila,\n });\n } else {\n errorSemantico.push({\n tipo: \"Error Semantico\",\n Error:\n \"Problema al declarar vector con valores no validos -> \" +\n ele.identificador,\n Fila: ele.fila,\n Columna: 0,\n });\n }\n } else {\n //SI NO ES NECESARIO AGREGAR VALORES\n //console.log(\"no traigo valores\");\n insertarAmbito({\n tipo: ele.tipo,\n ambito: rNomAmbito(),\n modificador: mod,\n identificador: ele.identificador,\n tipoDato: ele.tipoDato,\n valor: v,\n fila: ele.fila,\n });\n }\n } else {\n //SI HAY UNA VARIABLE DECLARADA CON EL MISMO NOMBRE SE REPORTA ERROR\n errorSemantico.push({\n tipo: \"Error Semantico\",\n Error: \"variable ya declarada -> \" + ele.identificador,\n Fila: ele.fila,\n Columna: 0,\n });\n }\n}", "title": "" }, { "docid": "5ce0866ada4155da57a74217ae410701", "score": "0.5100339", "text": "function niveauFini() {\r\n //console.log(\"reste \"+ nbBouleAManger+\" nbBouleAManger\");\r\n return nbBouleAManger === 0; //tableauDesBalles.length === 3\r\n}", "title": "" }, { "docid": "d4164b00371cc9abc731dfdba2eebb73", "score": "0.5099883", "text": "function controleAvantAjout() {\n let UrlOk = controlerUrl();\n let TitreOk = controlerTitre();\n let DateOk = controlerDate();\n if (UrlOk && TitreOk && DateOk) ajouter();\n}", "title": "" }, { "docid": "947b51a8a8bcd21aa963faa2345f17a0", "score": "0.5099708", "text": "totalVentas(state){\n return state.ventas.reduce((acumulador, juego)=>{\n return acumulador+juego.precio\n },0);\n }", "title": "" }, { "docid": "edf1bfede21121be2fd49e97e2236910", "score": "0.5090564", "text": "CalcularVelocidadX(t){\n let VelocidadX=0;\n\n VelocidadX=(this.velocidadInicial*Math.cos(this.angulo*(Math.PI/180)))*t;\n return VelocidadX;\n \n }", "title": "" }, { "docid": "5b6285f8caf7f5b3d324ca229fa84fa5", "score": "0.50823915", "text": "static saisieHandler() {\n var saisie = window.saisie.value.toLowerCase();\n var occ;\n var motJuste;\n var tableauLettresJouees;\n var lettreJouee = false;\n \n if (saisie.length === 1) {\n occ = jeu.getPartieCourante().getMot().verifierLettre(saisie);\n jeu.getPartieCourante().setScore(jeu.getPartieCourante().getScore() + occ * 100);\n \n // on ajoute la lettre jouee a la liste des lettres jouees si on l'a\n // pas deja joue\n tableauLettresJouees = jeu.getPartieCourante().getLettresJouees();\n for (var i = 0; i < tableauLettresJouees.length; i++) {\n if (tableauLettresJouees[i] == saisie) {\n lettreJouee = true;\n }\n }\n if (!lettreJouee) {\n // affiche les lettres\n jeu.getPartieCourante().ajouterLettresJouees(saisie);\n }\n \n // si la lettre ne figure pas dans le mot\n if (occ == 0) {\n if (jeu.getPartieCourante().getDifficulte() == DIFFICULTE_FACILE\n && !lettreJouee) {\n jeu.getPartieCourante().getGibet().ajouterPartie(1);\n } else if (jeu.getPartieCourante().getDifficulte() == DIFFICULTE_MOYEN) {\n jeu.getPartieCourante().getGibet().ajouterPartie(2);\n } else if (jeu.getPartieCourante().getDifficulte() == DIFFICULTE_DIFFICILE) {\n jeu.getPartieCourante().getGibet().ajouterPartie(4);\n }\n }\n \n jeu.getPartieCourante().afficherScore();\n jeu.getPartieCourante().afficherErreurs();\n } else if (saisie.length > 1) {\n motJuste = jeu.getPartieCourante().getMot().verifierMot(saisie);\n jeu.partieCourante.setScore(motJuste ? 5000 - jeu.getPartieCourante().getScore() * 10 - jeu.getPartieCourante().getGibet().getNbPartiesAffichees() * 20 : 0);\n Partie.finPartie(motJuste, jeu.getPartieCourante().getScore(), jeu.getPartieCourante().getGibet().getNbPartiesAffichees());\n }\n JeuPendu.resetSaisie();\n \n if (jeu.getPartieCourante().getMot().isFini()) {\n Partie.finPartie(true, jeu.getPartieCourante().getScore(), \n jeu.getPartieCourante().getGibet().getNbPartiesAffichees());\n } else if (jeu.getPartieCourante().getGibet().isFini()) {\n Partie.finPartie(false, jeu.getPartieCourante().getScore(), \n jeu.getPartieCourante().getGibet().getNbPartiesAffichees());\n }\n }", "title": "" }, { "docid": "17836f0261e94215c194cd871f3848ce", "score": "0.5081234", "text": "updateServings(type) { //c we need a param type so that we can pass increase or decrease\n // servings\n const newServings = type ==='dec' ? this.servings -1 : this.servings +1;\n\n // ingredents\n this.ingredients.forEach(ing =>{\n ing.count *= (newServings/ this.servings);\n\n });\n this.servings = newServings;\n\n }", "title": "" }, { "docid": "21e59a6190bc2af7ba5ce79e3b88c7ce", "score": "0.5068176", "text": "static get softVegetation() {}", "title": "" }, { "docid": "ed456d649b009833b0eb9982029fba32", "score": "0.5067573", "text": "step(){\n \n let visc = this.visc;\n let diff = this.diff;\n let dt = this.dt;\n let Vx = this.Vx; \n let Vy = this.Vy;\n let Vx0 = this.Vx0;\n let Vy0 = this.Vy0;\n let s = this.s;\n let density = this.density;\n // 1. diffuse the x and y velocities. \n \n this.diffuse(1, Vx0, Vx, visc, dt); \n this.diffuse(2, Vy0, Vy, visc, dt);\n\n //2. fix the velocities to keep the fluid incomressible\n this.project(Vx0, Vy0, Vx, Vy);\n\n //3. move the velocities of the fluid according to the velocity field \n this.advection(1, Vx, Vx0, Vx0, Vy0, dt);\n this.advection(2, Vy, Vy0, Vx0, Vy0, dt);\n \n //4. fix the velocities (again) to keep the fluid incomressible\n this.project(Vx, Vy, Vx0, Vy0);\n\n //5. diffuse the dye\n this.diffuse(0, s, density, diff, dt);\n\n //6. make the dye's velocity follow the velocity field\n this.advection(0, density, s, Vx, Vy, dt);\n\n // cleans up the squares\n this.clearSquares();\n\n }", "title": "" }, { "docid": "36cd596a09a2d2a047a0875bf6c0fca4", "score": "0.5057502", "text": "function ds_nganh_nghe_trang_chu_ntv_theo_nganh_hot() {\n\tv_url = '/ajax/ntv_danh_sach_nganh_nghe_trang_chu/index/';\n\tAjaxAction('div_ds_nganh_nghe_trang_chu_ntv', v_url);\n}", "title": "" }, { "docid": "04b5535aba9e29f4a233c21d8368ed9b", "score": "0.5056376", "text": "function mainCollector(){\n //fullFuturePension\n var annuityLongevity=vm.annuityLongevity();\n //Infaltion\n var inflation = vm.inflation();\n //net growth\n var netgrowth = vm.netgrowth(inflation);\n //DOB\n var dob = vm.dob();\n //Date At retirement\n var dateAtRet = vm.dateAtRetirement(dob['obj'],dob,annuityLongevity);\n //Time to retirement\n var timeToRet = vm.timeToRetirement(dateAtRet['obj']);\n //State Pensiob Age\n var statePensionAge=vm.statePensionAge(dob['obj']);\n //future premiums\n var netgrowth=vm.netgrowth(inflation);\n //future Premium\n var futurePremium=vm.futurePremium(timeToRet,netgrowth);\n //future pension pots\n var futurePensionPot=vm.futurePensionPot(timeToRet,netgrowth);\n //fullFuturePension\n var pensionFundAtRetirement=vm.pensionFundAtRetirement(futurePremium,futurePensionPot);\n //final salary chart series calcualtor\n var finalsalaryChart = vm.finalsalaryChart(statePensionAge);\n //state pension series calculator\n var statepensionChart = vm.statepensionChart(statePensionAge);\n //annuity calcualtions\n var annuity=vm.annuity(pensionFundAtRetirement,annuityLongevity,inflation,statePensionAge,finalsalaryChart,statepensionChart);\n //annuity calcualtions\n var taxLumpSum=vm.taxLumpSum(pensionFundAtRetirement);\n //cashout calcualtions\n var cashOut=vm.cashOut(taxLumpSum,finalsalaryChart,statepensionChart);\n //PMT calculator function\n var pmt=vm.pmt(netgrowth,dateAtRet,pensionFundAtRetirement,0,1);\n //flexible calcualtion\n var flexible=vm.flexible(pmt,statePensionAge,inflation,pensionFundAtRetirement,netgrowth,annuityLongevity,finalsalaryChart,statepensionChart);\n //flexible calcualtion\n var flexibleFixIncome=vm.flexibleFixIncome(pmt,statePensionAge,inflation,pensionFundAtRetirement,netgrowth,annuityLongevity,finalsalaryChart,statepensionChart,dateAtRet,flexible);\n // flexible chart\n var flexibleChart = vm.flexibleChart(flexible,flexibleFixIncome,finalsalaryChart,statepensionChart);\n //help to setup the chart\n var chartHelper = vm.chartHelper(flexible,annuity,statePensionAge);\n\n\n //count the Calls of the function\n $rootScope.calculationCounter=$rootScope.calculationCounter+1;\n\n\n var response={\n 'inflation':inflation,\n 'netGrowth':netgrowth,\n 'DOB':dob,\n 'dateAtRet':dateAtRet,\n 'timeToRet':timeToRet,\n 'statePension':statePensionAge,\n 'futurePremium':futurePremium,\n 'futurePensionPot':futurePensionPot,\n 'pensionFundAtRetirement':pensionFundAtRetirement,\n 'annuityLongevity':annuityLongevity,\n 'annuity':annuity,\n 'cashOut':cashOut,\n 'flexible':flexible,\n 'flexibleFixIncome':flexibleFixIncome,\n 'flexibleChart':flexibleChart,\n 'chartHelper':chartHelper,\n 'taxLumpSum':taxLumpSum\n }//response\n\n //update slug value with the new data\n $rootScope.clonelink=ClonelinkService.cloneLink();\n\n\n return response;\n }", "title": "" }, { "docid": "28b7a45c0ae4dcddd31907f5d79a72e2", "score": "0.50514036", "text": "function prevod(pole){\n\n}", "title": "" }, { "docid": "3882da15e565499610317f7bb8011124", "score": "0.50461394", "text": "function calcIvaDovuta(){\n // read values from form's input\n let val_totAcq = parseFloat(totAcq.value);\n let val_totVend = parseFloat(totVend.value);\n\n let val_ivaEsc = parseInt(ivaEsc.value);\n let val_iva = parseInt(iva.value);\n let val_ivaInc = parseInt(ivaInc.value);\n \n // VAT due\n let val_iAD = val_totVend * val_iva / val_ivaInc;\n // VAT on credit\n let val_iAC = val_totAcq / val_ivaEsc * val_iva;\n\n // round the results\n val_iAD = doublePrecisionRound(val_iAD);\n val_iAC = doublePrecisionRound(val_iAC);\n\n // VAT to be paid\n let val_iDV = val_iAD - val_iAC;\n \n iAC.value = val_iAC;\n iAD.value = val_iAD;\n iDV.value = val_iDV;\n\n ivaEsc.value = val_ivaEsc;\n iva.value = val_iva;\n ivaInc.value = val_ivaEsc + val_iva;\n\n [].forEach.call(totAcqs,ele => ele.value = val_totAcq);\n [].forEach.call(totVends,ele => ele.value = val_totVend);\n\n [].forEach.call(iACs,ele => ele.value = val_iAC);\n [].forEach.call(iADs,ele => ele.value = val_iAD);\n [].forEach.call(iDVs,ele => ele.value = val_iDV);\n\n [].forEach.call(ivaEscs,ele => ele.value = val_ivaEsc);\n [].forEach.call(ivas,ele => ele.value = val_iva);\n [].forEach.call(ivaIncs,ele => ele.value = val_ivaInc);\n }", "title": "" }, { "docid": "d5e46efdab73c3a33b1a982602154d72", "score": "0.50440145", "text": "function verifier()\n\t{\n\t\tif (tabCases === tabSolution)\n\t\t{\n\t\t\tconsole.log(\"valide\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconsole.log(\"invalide\");\n\t\t}\n\t}", "title": "" }, { "docid": "71778db7ea17859f307dd7dc23c0c197", "score": "0.5040065", "text": "calcTotIndemnitesPourAbs(facture, prixEntretien) {\n facture.coutTotalIndemnitesAbs = facture.nbJoursAbsence * prixEntretien\n // console.log('calc total indemnites pour absences ' + facture.coutTotalIndemnitesAbs)\n return facture\n }", "title": "" }, { "docid": "cf77dc719e94a17861cc97a449d39b01", "score": "0.5038834", "text": "function velocidadDeseada(posicion, target) {\n var vector = Phaser.Point.subtract(target, posicion); //Obtenemos la velocidad deseada\n vector.normalize();\t //La normalizamos\n vector.multiply(posicion.MAX_VELOCIDAD, posicion.MAX_VELOCIDAD); //Luego de normalizar multiplicamos por la velocidad maxima\n return vector;\n}", "title": "" }, { "docid": "4fc81ceb914553cb861c077e9234609e", "score": "0.50365514", "text": "function subtract() {\n action((a, b) => a - b);\n }", "title": "" }, { "docid": "419c9ea37f5bfd9e1b09d351b45cfffd", "score": "0.5036513", "text": "function traigoEstaciones(){\n ss.rpc(\"bicis.misEstaciones\");\n}", "title": "" }, { "docid": "04a1514829bc5ca4dce22dbe1a568de2", "score": "0.503595", "text": "function testItcDouble(e) {\n\n\n let form = document.querySelector('form[name=form_itc_equipe]');\n\n erreurs = '';\n // Formatage\n\n if (pointsItcSimple.value != \"\") {\n remplacementVirgule = pointsItcSimple.value.replace(',', '.');\n ready = parseFloat(remplacementVirgule, 10);\n\n }\n if (pointsItcDouble1.value!= \"\") {\n remplacementVirgule1 = pointsItcDouble1.value.replace(',', '.');\n ready1 = parseFloat(remplacementVirgule1, 10);\n }\n if (pointsItcDouble2.value!= \"\") {\n remplacementVirgule2 = pointsItcDouble2.value.replace(',', '.');\n ready2 = parseFloat(remplacementVirgule2, 10);\n }\n\n // Vérification des champs\n\n if ((ready1 < 0) || (ready2 <0) || (ready <0)) {\n erreurs +='<li>Il n\\'est pas possible d\\'avoir des points négatifs !</li>';\n event.preventDefault();\n}\n if(isNaN(ready) && (isNaN(ready2)) && (isNaN(ready1))){\n erreurs +='<li>Tu dois saisir au moins un nombre !</li>';\n event.preventDefault();\n}\n if((typeof ready == \"number\") && (typeof ready1 == \"number\") && (typeof ready2 == \"number\")){\n erreurs +='<li>Tu ne peux avoir affronté 3 personnes !</li>';\n ready1 = '';\n ready2 = '';\n ready = '';\n event.preventDefault();\n}\n if(((typeof ready1 == \"number\") && (typeof ready2 == \"undefined\")) || ((typeof ready1 ==\"undefined\") && (typeof ready2 == \"number\"))){\n erreurs +='<li>Tu dois saisir les points des deux joueurs de la paire!</li>';\n event.preventDefault();\n}\n let decompte = function() {\n popup.classList.remove('actif');\n };\n if (erreurs!='') {\n section.innerHTML ='<ul>'+erreurs+'</ul>';\n popup.classList.add('actif');\n setTimeout(decompte,2000); } else {\n form.submit();\n\n };\n}", "title": "" }, { "docid": "12bcd8edd634f902ad7c6b8e5ac5e9e3", "score": "0.5034115", "text": "function accionCierreAplicacionNacar(parametros){\nif (parametros) { \n\t\tvar datos = parametros.split(\"||\");\n\t\tif (datos) {\n\t\t\tvar op = datos[0];\n\t\t\tswitch(op) {\n\t\t\t\tcase \"0\": // Si es pagina contenedora\n\t\t\t\t\tif (typeof (CTE_CONTENEDORES_PAGINA_CONTENEDORA)!=\"undefined\") {\n\t\t\t\t\t\tprevenirCierrePaginaContenedora();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"1\": // Si es cierre de ventana modal\n\t\t\t\t\t\n\t\t\t\t\t//Pendiente de realizar para el entorno ligero\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"2\"://Cierre Mediante Notificación Tarea Invocante\n\t\t\t\t\t\n\t\t\t\t\tif (null != datos[1] && typeof(datos[1]) != \"undefined\" \n\t\t\t\t\t\t&& datos[1] != \"\" && datos[1] != \"null\" \n\t\t\t\t\t\t&& typeof(callback_notificacion_cierre_tarea)!= \"undefined\"){\n\t\t\t\t\t\tcallback_notificacion_cierre_tarea (datos[1], datos[2]);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"3\"://Notificacion a la ventana contextual\n \t\t if (typeof(utils_callBackVentanaContextual)==\"function\"){\n \t\t try{\n \t\t var objJson2=eval( \"(\" + datos[1] + \")\" );\n utils_callBackVentanaContextual(objJson2);\n }catch (errr){\n alert(errr.message);\n } \n }\n break;\n\t\t\t\t case \"4\"://Notificacion cambio contexto\n\t\t\t\t for(var i = 0; i<utils_callBackRegistroContexto.length; i++){\n\t\t\t\t\tdatos[2]=datos[2].replace(/\\+/g, \" \");\n\t\t\t\t\tif(typeof(utils_callBackRegistroContexto[i])==\"function\" && (utils_callBackRegistroContexto[i].toString().split('('))[0]==datos[2]){\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tvar objJson2=eval( \"(\" + datos[1] + \")\" );\n\t\t\t\t\t\t\tutils_callBackRegistroContexto[i](objJson2);\n\t\t\t\t\t\t}catch (errr){\n\t\t\t\t\t\t\talert(errr.message);\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t break;\n \t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e1dcbcecf94d8c5ec76133006fdcb58e", "score": "0.5032473", "text": "clicked(posx, posy,k){\n var distance = dist(posx, posy, this.x, this.y);\n if(distance < this.diam/2){\n for( var i = 0 ; i < 5; i++){ \n UpX[i]= x + ((this.diam / 2)*5/8) * cos(90 - 36 + 72 * i) + dimensao /2;\n UpY[i]= y + ((this.diam / 2)*5/8) * -sin(90 - 36 + 72 * i) + dimensao /2;\n DownX[i]= x + ((this.diam / 2)*5/8) * cos(90 - 36 + 72 * i) - dimensao /2;\n DownY[i]= y + ((this.diam / 2)*5/8) * -sin(90 - 36 + 72 * i)- dimensao /2;\n }\n if(posx < UpX[k] && posx > DownX[k] && posy < UpY[k] && posy > DownY[k] ){\n centerText = names[k];\n cores[k]= [click_cor[0], click_cor[1], click_cor[2]];\n text1= frase1+ data[k][0];\n text2= frase2+ data[k][1];\n text3= frase3+ data[k][2]\n text4= frase4+ data[k][3];\n text_inc0= incre_frase + percent_increase(data[k][0],data[k][1]) + \" %\";\n text_inc1= incre_frase + percent_increase(data[k][2],data[k][3]) + \" %\";\n text_depen= textdepen; dep_0= \"0\"; dep_1= \"1\";dep_2= \"2\";dep_3= \"3\";\n barra_total= bar_total;barra_alt=bar_alt;small_barra_alt=small_bar_alt;\n barra_valor_physical= dependece_converter(DEP_physical[k]);barra_valor_psychological= dependece_converter(DEP_psychological[k]);\n barra_valor_mean=dependece_converter(DEP_mean[k]); barra_valor_plea= dependece_converter(DEP_plea[k]);\n leg_phy=legenda_phy;leg_psy=legenda_psy;leg_mean=legenda_mean; leg_plea= legenda_plea;\n retc_x=retc__x; retc_y=retc__y; button=1;\n rect1 = 0;rect2 = 0;rect3 = 0;rect4 = 0;\n }\n }else{\n centerText=\"\";\n text1=\"\";text2=\"\";text3=\"\";text4=\"\"; text_inc0=\"\"; text_inc1=\"\";\n text_depen=\"\";barra_total= 0;barra_alt=0;\n dep_0= \"\"; dep_1= \"\";dep_2= \"\";dep_3= \"\";small_barra_alt=0;\n barra_valor_mean=0;barra_valor_physical=0;barra_valor_psychological=0;\n leg_phy=\"\";leg_psy=\"\";leg_mean=\"\"; barra_valor_plea=0;\n leg_plea= \"\";retc_x=0; retc_y=0; button=0; \n cores[1]=i1; cores[2]=i2;cores[3]=i3;cores[4]=i4;\n }\n }", "title": "" }, { "docid": "c74ef2934c82b9d97c76f247e60ab5d7", "score": "0.5031678", "text": "function verificaColisaoRaquete1(){ \n \n if (xbolinha - raio < xRaquete + raqueteComprimento && ybolinha - raio < yRaquete + raqueteAltura && ybolinha + raio > yRaquete){\n \n \n velocidadeXbolinha *= -1;\n raquetada.play();\n }\n}", "title": "" }, { "docid": "eea07f8e28ea94dec9c36f7605e4207c", "score": "0.50295305", "text": "function renderPorSucursal(){\r\nlet porSucursal=0\r\n for (let i = 0; i < local.sucursal.length; i++) {\r\n let porSucursal= console.log('Total de ' + local.sucursal[i] + ': ' + ventasTotal(local.sucursal[i]))\r\n }\r\n return porSucursal\r\n }", "title": "" }, { "docid": "9bdc1242dc2c7b742f7cd6040b907468", "score": "0.50277996", "text": "bouger() {\n if (this.mouvement == true) {\n if (keyIsDown(RIGHT_ARROW) && !this.collision(this.x + 1, this.y) && !this.collisionCreature(this.x + 1, this.y)) {\n this.x += this.vitesse;\n }\n if (keyIsDown(LEFT_ARROW) && !this.collision(this.x - 1, this.y) && !this.collisionCreature(this.x - 1, this.y)) {\n this.x -= this.vitesse;\n }\n if (keyIsDown(UP_ARROW) && !this.collision(this.x, this.y - 1) && !this.collisionCreature(this.x, this.y - 1)) {\n this.y -= this.vitesse;\n }\n if (keyIsDown(DOWN_ARROW) && !this.collision(this.x, this.y + 1) && !this.collisionCreature(this.x, this.y + 1)) {\n this.y += this.vitesse;\n }\n }\n this.collisionCreature(this.x, this.y);\n this.collisionPastille(this.x, this.y);\n if (keyIsDown(82)) {\n posSpawnX = posDepartX\n posSpawnY = posDepartY\n niveau = 0;\n this.score = 0;\n this.vie = 3;\n dernierScore = this.score\n derniereVie = this.vie\n initNiveau();\n }\n this.afficher();\n this.exit();\n textSize(32);\n fill(\"red\");\n text(\"vie : \" + this.vie + \" score: \" + this.score, 30, 830);\n this.mort();\n this.changerNiveaux();\n this.victoire();\n }", "title": "" }, { "docid": "46a035d29ded8034b3f2426f2157d025", "score": "0.5024876", "text": "function autov()\n{\n matrix= savematriz(1,matrizTranformacao);\n var values=numeric.eig(matrix._data);\n \n //console.log(values);\n var resu=\"\";\n for( var i=0;i<3;i++)\n {\n resu +=(\"O autovalor : \"+ math.round( values.lambda.x[i],2) +\"\\nPossui o autovetor : [\"+ math.round(values.E.x[0][i],2)+\",\"+ math.round(values.E.x[1][i],2)+\",\"+ math.round(values.E.x[2][i],2)+\"] \\n\");\n }\n alert(resu);\n}", "title": "" }, { "docid": "6500333d3a5a3ee915164c9bcdfd0717", "score": "0.50142515", "text": "function auto() {\r\n // Rôle : choix et jeu automatique du meilleur coup\r\n // Retour : néant\r\n // Paramètres : néant\r\n \r\n \r\n // Récupération du joueur actif\r\n var joueur = getJoueurActif();\r\n // Choisir le meilleur coup\r\n elt = choixMeilleurCoup(joueur); // Récupère la case à jouer pour le meileur coup\r\n \r\n // La case est choisie : on la joue ave le numéro du joueur actif\r\n marqueCaseDirect(elt, joueur);\r\n \r\n\r\n if (detecteGagnant(joueur)) {\r\n // Vérifie si le joueur qui vient de jouer à gagner\r\n afficheGagnant(joueur); // Félicite le gagnant\r\n return;\r\n }\r\n if (detecteBloque()) {\r\n // Vérifie si on peut encore jouer\r\n afficheFin(); // Affiche la situation de match nul\r\n return; \r\n }\r\n \r\n // Changer de joueur\r\n // Désactive le joueur actif :\r\n desactiveJoueur(joueur);\r\n // Change de joueur :\r\n joueur = 3 - joueur; // On peut le faire avec des if si on ne pense pas que 3 - 1 = 2, 3 - 2 = 1\r\n // Active le nouveau joueur actif\r\n activeJoueur(joueur);\r\n \r\n}", "title": "" }, { "docid": "d46e061a4246c0fc4d51e0aaeb9ec1bf", "score": "0.5013816", "text": "run(){\n let opciones= 0;//CONTADOR QUE DEFINE CUANTAS OPCIONES DISPONIBLES TENGO PARA ESCOGER\n let camDisponibles = [];//TENDRÁ LAS POSIBLES VIAS PARA DONDE SE PODRÁ DESPLAZAR EL TANK\n if(getObject(this._posX,this._posY-1).espacioLibre()){ //ARRIBA\n camDisponibles.push(ARRIBA);\n opciones++;\n }\n if(getObject(this._posX,this._posY+1).espacioLibre()){//ABAJO\n camDisponibles.push(ABAJO);\n opciones++;\n }\n if(getObject(this._posX-1,this._posY).espacioLibre()){//IZQUIERDA\n camDisponibles.push(IZQUIERDA);\n opciones++;\n }\n if(getObject(this._posX+1,this._posY).espacioLibre()){//DERECHA\n camDisponibles.push(DERECHA);\n opciones++;\n }\n if(opciones !== 0){\n let numRandom = this.generarRandom(opciones);\n this.moverTank(camDisponibles[numRandom]);\n }\n }", "title": "" }, { "docid": "cb031b9c651d9c4bdb65fa1d0adcc447", "score": "0.5011349", "text": "act() {\n }", "title": "" }, { "docid": "7798fe51909eabd4b8318d4657a815e9", "score": "0.50026995", "text": "function ze_MAJ_convois() {\n\tvar pseudo = ze_Analyser_URL('pseudo');\n\tvar valeur = ze_Analyser_URL('valeur_convois') ;\n\tvar alliance = ze_Analyser_URL('alliance');\n\tvar ressource = ze_Analyser_URL('ressource');\n\tdocument.location.href=url_zzzelp + '/convois/preparation?ressource=' + ressource + '&serveur=' + ze_serveur + '&alliance=' + alliance + '&pseudo=' + pseudo + '&valeur_convois=' + valeur + '&ouvrieres=' + gouvrieres + '&TDC=' + gTDC;\n}", "title": "" }, { "docid": "8ca4af910fd08fc3874c7248d9a848a3", "score": "0.50021094", "text": "function jouer(){\n if(trajetCourant !=undefined){\n joueurs.getJoueur(numeroJoueurCourant).position=document.getElementById(\"nomVilleChoisie\").value;\n joueurs.getJoueur(numeroJoueurCourant).actions.push(trajetCourant);\n joueurs.getJoueur(numeroJoueurCourant).temps=additionHeure(joueurs.getJoueur(numeroJoueurCourant).temps,document.getElementById(\"trajettemps\").innerHTML);\n joueurs.getJoueur(numeroJoueurCourant).prix+=parseFloat(document.getElementById(\"trajetprix\").innerHTML);\n joueurs.getJoueur(numeroJoueurCourant).co2+=parseFloat(document.getElementById(\"trajetco2\").innerHTML);\n miseAjourScores(joueurs.getJoueur(numeroJoueurCourant), trajetCourant);\n miseAjourSvg();\n document.getElementById(\"joueur\"+numeroJoueurCourant+\"prix\").innerHTML=joueurs.getJoueur(numeroJoueurCourant).prix.toFixed(2);\n document.getElementById(\"joueur\"+numeroJoueurCourant+\"co2\").innerHTML=joueurs.getJoueur(numeroJoueurCourant).co2.toFixed(2);\n document.getElementById(\"joueur\"+numeroJoueurCourant+\"temps\").innerHTML=joueurs.getJoueur(numeroJoueurCourant).temps;\n if(joueurs.getJoueur(numeroJoueurCourant).position==arrivee){\n annonceGagnant(numeroJoueurCourant);\n var num=numeroSuivant(numeroJoueurCourant);\n setTimeout(suivant,4000,num);\n }\n else{\n suivant(numeroSuivant(numeroJoueurCourant));\n }\n }\n}", "title": "" }, { "docid": "fdbe07f95000f44766fab76f848e472d", "score": "0.4988305", "text": "function vincente(pod,controllo){\r\n var vincitore='';\r\n if(pod === controllo){\r\n vincitore='HAI VINTO';\r\n return vincitore;\r\n }else{\r\n vincitore='HAI PERSO';\r\n return vincitore;\r\n }\r\n}", "title": "" }, { "docid": "c6ebd3f38f265b1218bfc8a3107e746a", "score": "0.4986862", "text": "function ntv_quan_tri_xoa_1_viec_lam_da_luu(id_viec_lam) {\n\tif (!confirm(\"Bạn có chắc chắn xoá không?\")) {\n\t\tdat_trang_thai_xu_ly_xong();\n\t\treturn;\n\t}\n\tdocument.forms['form_ds_viec_lam_da_luu'].target = \"fr_submit_ds_viec_lam_da_luu\";\n\tvar url = \"/ajax/ntv_quan_tri_viec_lam_da_luu/xoa/\" + id_viec_lam;\n\tif (document.getElementById('viec_lam_da_luu_ds_thu_gon') != null) {\n\t\tif (document.getElementById('viec_lam_da_luu_ds_thu_gon').value == 1) {\n\t\t\turl = url + \"/1\";\n\t\t}\n\t}\n\tdocument.forms['form_ds_viec_lam_da_luu'].action = url;\n\tdocument.forms['form_ds_viec_lam_da_luu'].submit();\n}", "title": "" }, { "docid": "49ca4acd4a25f363566699ef76cec5a9", "score": "0.49859294", "text": "calculCasesInterdites() {\n // Recherche des cases murs \"M\"\n this.artefacts.forEach(element => {\n if(element.type === 'M' || element.type === 'A' || element.type === 'R') {\n this.casesInterdites.push(element.coordonnee);\n }\n });\n\n // Cases occupées par les lumicycles\n this.lumicycles.forEach(lumicycle => { \n this.casesInterdites = this.casesInterdites.concat(lumicycle.points);\n });\n //console.log(\"this.casesInterdites:\",this.casesInterdites); \n }", "title": "" } ]
d4a0b5c74abf195c3fb5d8707061ffa7
Agregar Nodos o vertices
[ { "docid": "339d1ea6ac247414efe7769a8996f3d8", "score": "0.71301544", "text": "addVertex(node) {\n //Por cada elemento que se va agregando a la lista, le creamos un array vacio\n this.adjacentList[node] = [];\n this.nodes++;\n }", "title": "" } ]
[ { "docid": "82b5fb075ffa4254f145455501f38d58", "score": "0.737458", "text": "addVertex(vertex) {\n this.nodes.add(vertex)\n }", "title": "" }, { "docid": "82b5fb075ffa4254f145455501f38d58", "score": "0.737458", "text": "addVertex(vertex) {\n this.nodes.add(vertex)\n }", "title": "" }, { "docid": "97843e687fa6feef28bab29d17c8adc7", "score": "0.7308152", "text": "addVertex(vertex) {\n this.nodes.add(vertex);\n }", "title": "" }, { "docid": "da7f70a46f69efb8262d8fca762c127c", "score": "0.7188992", "text": "addVertex(node) {\n this.nodes.add(node);\n }", "title": "" }, { "docid": "ce2b393aefeb89c0dd5f487270adf25b", "score": "0.716315", "text": "_import_vertexes(vertexes) {\n for (let v of vertexes) {\n this.add_vertex(v)\n }\n }", "title": "" }, { "docid": "a7d10e587b79c6a40722e63f6255500c", "score": "0.70941824", "text": "addVertices(vertexArray) {\n for(let vertex of vertexArray) {\n this.nodes.add(vertex);\n }\n }", "title": "" }, { "docid": "51b58207758ac27c2f7070924a4a24fd", "score": "0.7056205", "text": "SetVertices() {}", "title": "" }, { "docid": "4424cb2942bb58caf5871c880e7d3436", "score": "0.69669807", "text": "addVertex(node) {\n this.adjacentList[node] = [];\n this.numberOfNodes++\n }", "title": "" }, { "docid": "55a1fc42f7b2e2a0a56035300c2205ed", "score": "0.69316417", "text": "function pushToVertices( v){\n\tvertices.push(v);\n}", "title": "" }, { "docid": "cab01d430851242d43bc3ef4d358621d", "score": "0.6882432", "text": "addVertices(vertexArray) {\n for( let vertex of vertexArray ) this.addVertex(vertex)\n }", "title": "" }, { "docid": "3bf7a39947e722ba15125fe7deb447e1", "score": "0.68798727", "text": "addvertex(vertex) {\n if (!this.adjacencylist[vertex])\n this.adjacencylist[vertex] = [];\n }", "title": "" }, { "docid": "b48484db5a89d26e68598d1a324cefd8", "score": "0.6868168", "text": "addVertex(vertex) {\n this.adjacencyList.set(vertex, []);\n }", "title": "" }, { "docid": "210a6f40e2a678991ac09865b8415c32", "score": "0.68316376", "text": "addVertices(vertexArray) {\n for (const vertex of vertexArray) {\n this.addVertex(vertex)\n }\n }", "title": "" }, { "docid": "d327cfeff5c9ab68cf45c9849e33d5ec", "score": "0.6799946", "text": "addVertex(vertex) {\n if (!this.adjacencyList[vertex]) this.adjacencyList[vertex] = [];\n }", "title": "" }, { "docid": "d327cfeff5c9ab68cf45c9849e33d5ec", "score": "0.6799946", "text": "addVertex(vertex) {\n if (!this.adjacencyList[vertex]) this.adjacencyList[vertex] = [];\n }", "title": "" }, { "docid": "b5a871aec6bc17241a10bddcedfb25a7", "score": "0.67969275", "text": "addVertex(vertex) {\n if (!this.adjacencyList[vertex]) {\n this.adjacencyList[vertex] = [];\n }\n }", "title": "" }, { "docid": "e9b3261f9b7b43a691b5c05102f58bc9", "score": "0.6780212", "text": "GetVertices() {}", "title": "" }, { "docid": "1c37a7adb70fc24184f95c08b4599168", "score": "0.6775455", "text": "addVertex(v)\n {\n this.adjList.set(v,[]);\n }", "title": "" }, { "docid": "b95e51eacafbda408f213155d7e42875", "score": "0.6761839", "text": "addVertex(v) {\n this.adjList.set(v, []);\n }", "title": "" }, { "docid": "533fe9a3800a8f1b39610cdbaa893635", "score": "0.67201746", "text": "addVertex(value, edges = []) {\r\n const gn = new GraphNode({ value, edges: [] });\r\n if (edges.length === 0) {\r\n if (this.vertices.length > 0) {\r\n this.vertices[this.vertices.length - 1].pushToEdges(gn);\r\n gn.pushToEdges(this.vertices[this.vertices.length - 1]);\r\n }\r\n }\r\n edges.forEach(edge => {\r\n edge.pushToEdges(gn);\r\n gn.pushToEdges(edge);\r\n });\r\n this.vertices.push(gn);\r\n return gn;\r\n }", "title": "" }, { "docid": "f5ca7733ed5c03d8ce64e30b3a5366e5", "score": "0.6690683", "text": "addVertex(node) {\n // check input\n if (!node) {\n return;\n }\n // check if node doesn't exists in adjacentList and add empty array\n if (!this.adjacentList[node]) {\n this.adjacentList[node] = [];\n // increment number of nodes\n this.numberOfNodes++;\n }\n }", "title": "" }, { "docid": "42dcbdb47363d22f9913ca46d118968d", "score": "0.66890407", "text": "addVertex(vertex){\n\t\tif(!this.adjacencyList[vertex]) this.adjacencyList[vertex] = [];\n\t}", "title": "" }, { "docid": "95587ec76acae8ffa3185300c9debe1c", "score": "0.6684305", "text": "addVertices(nodeArray) {\n for (let node of nodeArray) {\n this.nodes.add(node);\n }\n }", "title": "" }, { "docid": "c8c69bafdfce7bbc506592e9637f98da", "score": "0.6671957", "text": "addVertex(v)\r\n\t{\r\n\t\t// initialize the adjacent list with a null array\r\n\t\tthis.AdjList.set(v, []);\r\n\t\tthis.noOfVertices += 1;\r\n\t}", "title": "" }, { "docid": "91981d255b8672fe09667d287645ad30", "score": "0.6669002", "text": "function addVertex(e) {\n // If mouse in canvas:\n if (inCanvas) {\n let posX = mousePos.x;\n let posY = mousePos.y;\n\n let displayId = document.getElementById('vertex_ids').checked;\n let displayDegree = document.getElementById('vertex_degrees').checked;\n\n let vertex = graph.addVertex(posX, posY, displayId, displayDegree);\n canvas.add(vertex.circle);\n canvas.add(vertex.idText);\n canvas.add(vertex.degText);\n // Note: Order matters!\n canvas.bringToFront(vertex.idText);\n canvas.bringToFront(vertex.degText);\n\n canvas.renderAll();\n updateUI();\n }\n }", "title": "" }, { "docid": "8056fe4a1da04c0599b817d51e6e760c", "score": "0.6664873", "text": "function Graph(vertices){ //vertices = 5\n //initialise vertex\n v = vertices //v = 5\n\n //initialise adjancey list\n initAdjList();\n}", "title": "" }, { "docid": "18dfd12539f555ff1dd4200f3c0bac19", "score": "0.6632541", "text": "addVertex(v) {\n // initialize the adjacent list with a null array\n this.AdjList.set(v, []);\n }", "title": "" }, { "docid": "dc05343ad69dded845b015e671f9f374", "score": "0.6629971", "text": "addVertex(vertex){\n if (!this.adjacencyList[vertex]){ //checking if it already exists first so won't overwrite\n this.adjacencyList[vertex] = []\n }\n }", "title": "" }, { "docid": "17de7154a69ccd34a8bf63cf0c1e5d10", "score": "0.66176283", "text": "addVertex(v) {\n if (!this.adjacencyList[v]) this.adjacencyList[v] = [];\n }", "title": "" }, { "docid": "d86176f8c1cbcce0f5130976b74378d3", "score": "0.66113925", "text": "addVertex(v) {\n // initialize the adjacent list with a null array \n this.AdjList.set(v, []);\n }", "title": "" }, { "docid": "a36ccf140f374002161c60b789a59d55", "score": "0.6604254", "text": "addVertex(vertex) {\n this.adjacencyList[vertex] = []\n return this.adjacencyList\n }", "title": "" }, { "docid": "7f78aa69dd3efe7fcb819a58c9f7c938", "score": "0.65879387", "text": "addVertex(x,y,z,u,v){\n\t\tthrow \"Not using this anymore. Add triangles instead.\";\n\t\tif(this.geometry){\n\t\t\t//Need to update in real time.\n\t\t\tthis.geometry.attributes.position.array[this.vertices.length * 3] = x;\n\t\t\tthis.geometry.attributes.position.array[this.vertices.length * 3 + 1] = y;\n\t\t\tthis.geometry.attributes.position.array[this.vertices.length * 3 + 2] = z;\n\t\t\tthis.geometry.attributes.position.needsUpdate = true;\n\t\t\tthis.geometry.attributes.uv.array[this.uvs.length * 2] = u;\n\t\t\tthis.geometry.attributes.uv.array[this.uvs.length * 2 + 1] = v;\n\t\t\tthis.geometry.attributes.uv.needsUpdate = true;\n\t\t\tthis.geometry.setDrawRange( 0, (this.vertices.length + 1) * 3 - 1 );\n\t\t}\n\n\t\tthis.vertices.push([x,y,z]);\n\t\tthis.uvs.push([u,v]);\n\t\t//console.log(this.vertices.length);\n\t}", "title": "" }, { "docid": "f75ea63b6287cf172fdfb72a5f42300e", "score": "0.65690595", "text": "addVertex(v) {\n this.AdjList.set(v, []);\n }", "title": "" }, { "docid": "f75ea63b6287cf172fdfb72a5f42300e", "score": "0.65690595", "text": "addVertex(v) {\n this.AdjList.set(v, []);\n }", "title": "" }, { "docid": "552c374c4ac207e1f0101303a7bf632c", "score": "0.65617806", "text": "addVertex(vertex) {\n if (!this.AdjList.has(vertex)) {\n this.AdjList.set(vertex, [])\n }\n }", "title": "" }, { "docid": "edefa908a8e942190e07f60784823431", "score": "0.65346164", "text": "function addVertex(a, b){\n\tvar obj = {x: a, y: b}\n\tsites.push(obj);\n}", "title": "" }, { "docid": "70b230975576316093fc394cd829179e", "score": "0.6452634", "text": "addVertex(vertex) {\n\t\t// add a key to the adjacency list with name and sets its value to ''\n\t\t// this makes sure data isn't overriden if it's already there.\n\t\tif (!this.adjacencyList[vertex]) this.adjacencyList[vertex] = [];\n\t}", "title": "" }, { "docid": "3c4aca8c2e12f22e3bc23aa86e6acf96", "score": "0.64039165", "text": "function addVertex(p0, p1, p2) {\n var length = Math.sqrt(p0 * p0 + p1 * p1 + p2 * p2);\n var scale = radius / length;\n positions[positions.length] = p0 * scale;\n positions[positions.length] = p1 * scale;\n positions[positions.length] = p2 * scale;\n return (positions.length / 3) - 1;\n }", "title": "" }, { "docid": "a2f07033df235afef1e087bc52244d1b", "score": "0.63963413", "text": "addEdge(vertex1, vertex2, weight) {\n if(!this.adjacencyList[vertex1]) {\n console.info(`Creating vertex \"${vertex1}\"`)\n this.addVertex(vertex1);\n }\n\n if(!this.adjacencyList[vertex2]) {\n console.info(`Creating vertex \"${vertex2}\"`)\n this.addVertex(vertex2);\n }\n\n this.adjacencyList[vertex1].push({ node: vertex2, weight });\n this.adjacencyList[vertex2].push({ node: vertex1, weight });\n }", "title": "" }, { "docid": "93a7ff84be63c6a6232f4994f86d0201", "score": "0.6382404", "text": "addVertex(vertex, array) {\n\n }", "title": "" }, { "docid": "9a7e2e27c0ca2f0da0471c278f76eca1", "score": "0.63677895", "text": "get vertices() {\n return [this.ps.clone(), this.pe.clone()];\n }", "title": "" }, { "docid": "290f29c44c9255b3e687e9ce336cdf4d", "score": "0.63632125", "text": "addVertex(u) {\n\t\tthis.neighbors[u] = []\n\t\tthis.vertices.push(u)\n\t\treturn this\n\t}", "title": "" }, { "docid": "433f84eb6ea165455840e6465176ff20", "score": "0.6344229", "text": "function addVertex (array, vertexIndex) {\n geomBuffer.vertices[index] = array[vertexIndex];\n geomBuffer.normals[index++] = 0;\n geomBuffer.vertices[index] = array[vertexIndex + 1];\n geomBuffer.normals[index++] = 0;\n}", "title": "" }, { "docid": "0901f99a610463184b5e535eec2facee", "score": "0.6338543", "text": "addVertex(vertex) {\n if(this.adjacencyList[vertex]) {\n console.warn(`\"${vertex}\" vertex already present into adjacency list. Overriding ${vertex} `);\n }\n\n this.adjacencyList[vertex] = [];\n }", "title": "" }, { "docid": "67dc4b93d2bc28c15d6ddb47441dfbee", "score": "0.63343024", "text": "addVertex(v) {\n this.AdjList.set(v, new Set());\n }", "title": "" }, { "docid": "8a3c10793c129d745c3b320828e5f26a", "score": "0.63190526", "text": "constructor(vertices)\r\n\t{\r\n\t\tthis.data = new Object();\r\n this.noOfVertices = 0;\r\n this.AdjList = new Map(); // adjacency map for research\r\n\t\tthis.ItemList = new Object(); // mapping items to research\r\n\t\tthis.ResearchList = new Object(); // list of available research\r\n\t\t\r\n\t\t// console.log(vertices);\r\n\t var count = Object.keys(vertices).length;\r\n\t\tconsole.log(\"Adding \" + count + \" vertices.\");\r\n\t\tconst keys = Object.keys(vertices)\r\n\t\t\r\n\t\t// add all vertices first\r\n\t\tfor (const key of keys) {\r\n\t\t // console.log(key);\r\n\t\t var cleaned_key = key.replace(\"&#39;\",\"'\")\r\n\t\t this.data[cleaned_key] = vertices[key]\r\n\t\t this.data[cleaned_key]['name'] = cleaned_key;\r\n\t\t //console.log(this.data[cleaned_key]);\r\n\t\t this.addVertex(cleaned_key);\r\n\t\t this.ResearchList[cleaned_key] = '';\r\n\t\t for (const item of this.data[cleaned_key][\"items\"]) {\r\n\t\t\t// console.log(item + \" requires \" + cleaned_key);\r\n\t\t\tif(item != \"none\"){\r\n\t\t\t\tthis.ItemList[item] = cleaned_key;\r\n\t\t\t}\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\t// add all edges second\r\n\t\tconst cleaned_keys = Object.keys(this.data)\r\n\t\tfor (const key of cleaned_keys) {\r\n\t\t // console.log(key);\r\n\t\t // console.log(this.data[key][\"requires\"]);\r\n\t\t for (const prerequisite of this.data[key][\"requires\"]) {\r\n\t\t\t// console.log(key + \" requires \" + prerequisite);\r\n\t\t\tif(prerequisite != \"none\"){\r\n\t\t\t\tthis.addEdge(key, prerequisite);\r\n\t\t\t}\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\t\r\n }", "title": "" }, { "docid": "dacae0a9b77b3b970a167025e8ac7ad7", "score": "0.6310722", "text": "addEdge(vertex1, vertex2) {\n this.adjacencyList[vertex1].push(vertex2);\n this.adjacencyList[vertex2].push(vertex1);\n }", "title": "" }, { "docid": "dacae0a9b77b3b970a167025e8ac7ad7", "score": "0.6310722", "text": "addEdge(vertex1, vertex2) {\n this.adjacencyList[vertex1].push(vertex2);\n this.adjacencyList[vertex2].push(vertex1);\n }", "title": "" }, { "docid": "e8c5ea70e147d5c7e894e68e29a879cf", "score": "0.62768894", "text": "addVertex(val) {\n if (!this.adjacencyList[val]) this.adjacencyList[val] = [];\n }", "title": "" }, { "docid": "afc12455c49cc0c1956d241e782b8383", "score": "0.6270166", "text": "function Vertex(forge){\n this.forge = forge;\n this.nodes = {};\n this.index = 0;\n}", "title": "" }, { "docid": "0a2f2f4271d8f20ce553341506cb1449", "score": "0.62602013", "text": "constructor() {\n /**\n * Array of all known vertex names.\n *\n * @final\n * @property names\n * @type Array\n */\n this.names = [];\n\n /**\n * Hash of vertices keyed by name.\n *\n * @final\n * @property vertices\n * @type Object\n */\n this.vertices = {};\n }", "title": "" }, { "docid": "e4fe56adf13558be28c1c72fa202fc00", "score": "0.6246388", "text": "constructor(vertexes) {\n this.edges = [];\n let n = vertexes.length;\n for (let i = 0; i < n; i++) {\n this.edges.push([vertexes[i], vertexes[(i + 1) % n]]);\n }\n this.filled = false;\n }", "title": "" }, { "docid": "16d943be8830a6823bce814e3e4fb2a4", "score": "0.6177865", "text": "function addVerticesToDictionary(v1, v2, v3, m1, m2, m3) {\r\n if (verticesTriangles[JSON.stringify(vertices[m1])] === undefined) {\r\n verticesTriangles[JSON.stringify(vertices[m1])] = [];\r\n }\r\n if (verticesTriangles[JSON.stringify(vertices[m2])] === undefined) {\r\n verticesTriangles[JSON.stringify(vertices[m2])] = [];\r\n }\r\n if (verticesTriangles[JSON.stringify(vertices[m3])] === undefined) {\r\n verticesTriangles[JSON.stringify(vertices[m3])] = [];\r\n }\r\n if (verticesTriangles[JSON.stringify(vertices[v1])] === undefined) {\r\n verticesTriangles[JSON.stringify(vertices[v1])] = [];\r\n }\r\n if (verticesTriangles[JSON.stringify(vertices[v2])] === undefined) {\r\n verticesTriangles[JSON.stringify(vertices[v2])] = [];\r\n }\r\n if (verticesTriangles[JSON.stringify(vertices[v3])] === undefined) {\r\n verticesTriangles[JSON.stringify(vertices[v3])] = [];\r\n }\r\n\r\n // Midpoint 1\r\n verticesTriangles[JSON.stringify(vertices[m1])].push(getCentroid(vertices[v1], vertices[m1], vertices[m3]));\r\n verticesTriangles[JSON.stringify(vertices[m1])].push(getCentroid(vertices[v2], vertices[m2], vertices[m1]));\r\n verticesTriangles[JSON.stringify(vertices[m1])].push(getCentroid(vertices[m1], vertices[m2], vertices[m3]));\r\n\r\n // Midpoint 2\r\n verticesTriangles[JSON.stringify(vertices[m2])].push(getCentroid(vertices[v2], vertices[m2], vertices[m1]));\r\n verticesTriangles[JSON.stringify(vertices[m2])].push(getCentroid(vertices[v3], vertices[m3], vertices[m2]));\r\n verticesTriangles[JSON.stringify(vertices[m2])].push(getCentroid(vertices[m1], vertices[m2], vertices[m3]));\r\n\r\n // Midpoint 3\r\n verticesTriangles[JSON.stringify(vertices[m3])].push(getCentroid(vertices[v1], vertices[m1], vertices[m3]));\r\n verticesTriangles[JSON.stringify(vertices[m3])].push(getCentroid(vertices[v3], vertices[m3], vertices[m2]));\r\n verticesTriangles[JSON.stringify(vertices[m3])].push(getCentroid(vertices[m1], vertices[m2], vertices[m3]));\r\n\r\n // Vertex 1\r\n verticesTriangles[JSON.stringify(vertices[v1])].push(getCentroid(vertices[v1], vertices[m1], vertices[m3]));\r\n\r\n // Vertex 2\r\n verticesTriangles[JSON.stringify(vertices[v2])].push(getCentroid(vertices[v2], vertices[m2], vertices[m1]));\r\n\r\n // Vertex 3\r\n verticesTriangles[JSON.stringify(vertices[v3])].push(getCentroid(vertices[v3], vertices[m3], vertices[m2]));\r\n }", "title": "" }, { "docid": "9de5d24ee08dcd63e5924633e0490ee3", "score": "0.6145084", "text": "v (specs) {\n if (specs.length !== 3) {\n throw new Error(\"Given vertex geometry specification is malformed\");\n }\n\n // Optimization: vertex indices are aligned\n // with the \"start with 1\" index face specification\n this.vertices = this.vertices || [[]];\n\n specs = \"[\" + specs + \"]\";\n this.vertices.push(JSON.parse(specs));\n }", "title": "" }, { "docid": "d32b44f6ce305388f3facbbe36bc02a8", "score": "0.61402273", "text": "addEdge(vertex, node) {\n if (this.AdjList.has(vertex)) {\n if (this.AdjList.has(node)){\n let arr = this.AdjList.get(vertex)\n if(!arr.includes(node)){\n arr.push(node)\n }\n }else {\n throw `Can't add non-existing vertex ->'${node}'`\n }\n } else {\n throw `'${vertex}' should be added first`\n }\n }", "title": "" }, { "docid": "9d37627fa640871c74ba190b39282765", "score": "0.61316615", "text": "addVertex(vertex) {\n if (vertex in this.data) {\n console.log('Vertex already exists');\n return false;\n }\n this.data[vertex] = [];\n this.vertexNumber++;\n }", "title": "" }, { "docid": "bba3d953ed5597fa3dd12aa62ec29c5f", "score": "0.6126225", "text": "addFace(vertices, colors, coordinates, normals) {\n const triCount = vertices.length - 2;\n if (triCount < 1) return;\n\n if (!normals) {\n normals = [];\n const n = this.findNormal(vertices[0], vertices[1], vertices[2]);\n for (let i = 0; i < vertices.length; i++) normals.push(n);\n }\n\n for (let i = 0; i < triCount; i++) {\n\n //-- Vertex A--\n\n this.vertices.push(...vertices[0]);\n if (normals) this.normals.push(...normals[0]);\n if (colors) this.colors.push(...colors[0]);\n if (coordinates) this.coordinates.push(...coordinates[0]);\n\n //-- Vertex B --\n\n this.vertices.push(...vertices[i+1]);\n if (normals) this.normals.push(...normals[i+1]);\n if (colors) this.colors.push(...colors[i+1]);\n if (coordinates) this.coordinates.push(...coordinates[i+1]);\n\n //-- Vertex C --\n\n this.vertices.push(...vertices[i+2]);\n if (normals) this.normals.push(...normals[i+2]);\n if (colors) this.colors.push(...colors[i+2]);\n if (coordinates) this.coordinates.push(...coordinates[i+2]);\n }\n }", "title": "" }, { "docid": "02a00f229541c7ae28e0651be722c872", "score": "0.6111015", "text": "appendVertex(index, array = []) {\n let vertx = this.uvert;\n array.push(vertx[index++]);\n array.push(vertx[index++]);\n array.push(vertx[index]);\n return array;\n }", "title": "" }, { "docid": "287ee4f15494e55796ff1cf8942a28b7", "score": "0.60829544", "text": "addVertex(value, edges = []) {\n const newNode = new GraphNode ({\n\t\t\t\tvalue,\n\t\t\t\tedges,\n\t });\n \n\t\t // ensure that the edges that this node is connected to also \n // connect back to this new node we're creating\n\t\tif (edges.length > 0) {\n\t\t\tedges.forEach((edge) => {\n\t\t\t\t\tthis.addEdge(newNode, edge);\n\t\t\t});\n\t }\n\t\t this.vertices.push(newNode);\n\t\t// we need to check if there are exactly two nodes in the graph and \n\t //\t they do not have a connection between them\n if (this.vertices.length == 2) {\n\t\t\tthis.addEdge(this.vertices[0], this.vertices[1]);\n }\n\t\treturn newNode;\n\t}", "title": "" }, { "docid": "5f9b576e11aefec92b472ed82a4ddc7b", "score": "0.60795087", "text": "function Add(vert) {\n\t\tif(vertices.length==0) {\n\t\t\thead = vert;\n\t\t\tvert.next = vert;\n\t\t\tvert.prev = vert;\n\t\t\tvertices.push(vert);\n\t\t\tvert.name = vertices.length-1;\n\t\t} else {\n\t\t\tvertices[vertices.length-1].next = vert; \t//point old end to new guy\n\t\t\tvert.prev = vertices[vertices.length-1]; \t//point new guy to old end\n\t\t\tvert.next = vertices[0]; \t\t\t\t//point new guy to the begining\n\t\t\tvertices[0].prev = vert; \t\t\t\t//point beginning to new guy\n\t\t\tvertices.push(vert);\n\t\t\tvert.name = vertices.length-1;\n\t\t}\n\t}", "title": "" }, { "docid": "0630fbaabee79834de2fd8a542e07120", "score": "0.60593647", "text": "function addNode() {\n var aux = document.getElementById(\"node-id\").value;\n try {\n nodes.add({\n id: aux,\n label:\"Nodo \" + document.getElementById(\"node-id\").value,\n });\n arrayIdVertices.push(document.getElementById(\"node-id\").value)\n } catch (err) {\n alert(err);\n }\n console.log(arrayIdVertices);\n}", "title": "" }, { "docid": "3078870734c2a07e566df6488289ffa4", "score": "0.6044306", "text": "calculateVertices() {\n const wtID = this.transform._worldID;\n if (this._transformID === wtID)\n return;\n this._transformID = wtID;\n const wt = this.transform.worldTransform, a2 = wt.a, b2 = wt.b, c2 = wt.c, d2 = wt.d, tx = wt.tx, ty = wt.ty, data = this._geometry.points, vertexData = this.vertexData;\n let count = 0;\n for (let i2 = 0; i2 < data.length; i2 += 2) {\n const x2 = data[i2], y2 = data[i2 + 1];\n vertexData[count++] = a2 * x2 + c2 * y2 + tx, vertexData[count++] = d2 * y2 + b2 * x2 + ty;\n }\n }", "title": "" }, { "docid": "7bd85c15588ec3db4505fc1ab4b3bad5", "score": "0.60330284", "text": "set vertexCount(value) {}", "title": "" }, { "docid": "a1d8e309cdb545fa83bed52bc1986b72", "score": "0.603149", "text": "function connectVerts(v0, v1) {\n v0.edges.push(new Edge(v1, returnNumber(0, 99)));\n v1.edges.push(new Edge(v0, returnNumber(0,99)));\n }", "title": "" }, { "docid": "28c5e8a55293552204db36f8c1621743", "score": "0.6027932", "text": "constructor(noOfVertices) {\n this.noOfVertices = noOfVertices;\n this.AdjList = new Map();\n }", "title": "" }, { "docid": "9f0591eb644f5ef04cb3bb06fc9b2223", "score": "0.60153544", "text": "addUndirectedEdge(vertex1, vertex2) {\n if(!this.edges[vertex1]) this.edges[vertex1] = [];\n this.edges[vertex1].push(vertex2); \n if(!this.edges[vertex2]) this.edges[vertex2] = [];\n this.edges[vertex2].push(vertex1); \n }", "title": "" }, { "docid": "faeb7bc16f2040478285d6c565fd49a5", "score": "0.6012049", "text": "addEdge(vertex1, vertex2) {\n // get the list for vertex1 and add vertex2 to it\n this.adjList[vertex1].push(vertex2);\n }", "title": "" }, { "docid": "c481245d8f76d55ae201267d05798150", "score": "0.60075045", "text": "function createVertex(vertexName)// public method; adds a vertex to the graph\n\t//efficiency: O(set)\n\t{\n\t\tthis.global.set({\n\t\t\tglobal: this.name,\n\t\t\tsubscripts: [vertexName],\n\t\t\tdata:\"foo\"\n\t\t});\n\t}", "title": "" }, { "docid": "fb422783674935efbdef4eabb64fa1bb", "score": "0.60010666", "text": "addEdge(vertex1, vertex2) {\n if (vertex1 in this.adjencyList && vertex2 in this.adjencyList) {\n const vertex1Edges = this.adjencyList[vertex1];\n const vertex2Edges = this.adjencyList[vertex2];\n\n if (!vertex1Edges.includes(vertex2)) {\n vertex1Edges.push(vertex2)\n }\n\n if (!vertex2Edges.includes(vertex1)) {\n vertex2Edges.push(vertex1)\n }\n } else {\n throw new Error(`One or more vertices not present in graph`)\n }\n }", "title": "" }, { "docid": "5ca0460b9780ed7b3cc63b06907e52e5", "score": "0.59971905", "text": "constructor(numberOfVertices){\r\n this.numberOfVertices = numberOfVertices;\r\n this.AdjacencyList = new Map();\r\n }", "title": "" }, { "docid": "bf603164b085dcafae36ec0b1bfba5d2", "score": "0.59790915", "text": "constructor(noOfVertices) \n\t\t\t { \n\t\t\t this.noOfVertices = noOfVertices; \n\t\t\t this.AdjList = new Map(); \n\t\t\t }", "title": "" }, { "docid": "0bcaa426077f682781f43fa49636fb13", "score": "0.5975375", "text": "function getVertices() {\n return V;\n }", "title": "" }, { "docid": "a0ca7595730f9e4a06727e3d8126003b", "score": "0.59698075", "text": "withVertices(vertices: VertexArg[]) {\n return this.withChanges(s => s.withVertices(vertices));\n }", "title": "" }, { "docid": "f1b7b7e0359d523cd1fc42a465fbce94", "score": "0.59530497", "text": "function updateVertices() {\n for (var i=0; i<VX.points.length; i++) {\n cube.geometry.vertices[i].x = VX.points[i].cx;\n cube.geometry.vertices[i].y = VX.points[i].cy;\n cube.geometry.vertices[i].z = VX.points[i].cz;\n }\n}", "title": "" }, { "docid": "1f76e73fc80f9d6715fa9a3c6a19e208", "score": "0.59526306", "text": "addVertices(transform, vertices, beginOffset, endOffset) {\n this.addVerticesMatrix(transform.worldTransform, vertices, beginOffset, endOffset);\n }", "title": "" }, { "docid": "8cc0e867cf1a1d0f1000164322c8a08c", "score": "0.59499246", "text": "addedge(vertex1, vertex2) {\n let add = true;\n if (vertex1 !== vertex2) {\n for (let i in this.adjacencylist[vertex1])\n if (this.adjacencylist[vertex1][i] === vertex2)\n add = false\n if (add) {\n this.adjacencylist[vertex1].push(vertex2);\n this.adjacencylist[vertex2].push(vertex1);\n }\n }\n }", "title": "" }, { "docid": "7ccb7f28936c31bef443d935bb67a656", "score": "0.59345365", "text": "addEdge(vertex1, vertex2) {\n\t\tthis.adjacencyList[vertex1].push(vertex2);\n\t\tthis.adjacencyList[vertex2].push(vertex1);\n\t}", "title": "" }, { "docid": "0e26971bf680a50fdad8f227295fe0e3", "score": "0.59253883", "text": "update_vertices(){\n let z = 2;\n for (var j = 0; j < this.altimetry.length; j++)\n\t\t{\n //z = 2;\n\t\t\tfor (var i = 0; i < this.altimetry[j].length; i++)\n\t\t\t{\n this.vertices[z] = this.altimetry[j][i];\n z = z + 3;\n\t\t\t}\n }\n super.initGLBuffers();\n }", "title": "" }, { "docid": "e1e7155fd89c31a0059db2e2a4b75c59", "score": "0.59245014", "text": "addEdge(v1, v2) {\n this.adjacencyList[v1].push(v2);\n this.adjacencyList[v2].push(v1);\n }", "title": "" }, { "docid": "bebfe1a3f0abf895cbdbb4bb9ceda37a", "score": "0.59074014", "text": "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "title": "" }, { "docid": "256ed1580f4580cedf145992a9ec34df", "score": "0.5902544", "text": "addEdge(v1, v2) {\n v1.adjacent.add(v2)\n v2.adjacent.add(v1)\n }", "title": "" }, { "docid": "256ed1580f4580cedf145992a9ec34df", "score": "0.5902544", "text": "addEdge(v1, v2) {\n v1.adjacent.add(v2)\n v2.adjacent.add(v1)\n }", "title": "" }, { "docid": "23ebc1f9dc905354e4d347e403cd4f4c", "score": "0.58959687", "text": "function setVertexBuffer(gl, vertices) {\r\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\r\n}", "title": "" }, { "docid": "44ba6dfd5b81a97cebbcd941250f4353", "score": "0.5891499", "text": "addEdge(fromVertex, toVertex) {\r\n if (fromVertex.edges.indexOf(toVertex) < 0) {\r\n fromVertex.pushToEdges(toVertex);\r\n }\r\n if (toVertex.edges.indexOf(fromVertex) < 0) {\r\n toVertex.pushToEdges(fromVertex);\r\n }\r\n }", "title": "" }, { "docid": "0dc30b6bcd558bc6482a48b8b879056a", "score": "0.58891034", "text": "add_vertex(id, data=null) {\n if (this._vertexes.has(id)) {\n throw new error.Conflict('Vertex is already existed')\n }\n this._vertexes.set(id, {\n id: id,\n data: data\n })\n }", "title": "" }, { "docid": "b0ec9f254a9193ce13a63961cae01034", "score": "0.58826447", "text": "addEdge(vertex1, vertex2) {\n if (vertex1 in this.adjacencyList && vertex2 in this.adjacencyList) {\n this.adjacencyList[vertex1].push(vertex2)\n this.adjacencyList[vertex2].push(vertex1)\n }\n return this.adjacencyList\n }", "title": "" }, { "docid": "c6fdd79c87338d3c984fd37371472f2c", "score": "0.58725506", "text": "function list_vert()\n{\n var i, v; // local vars\n for (i=0; i < this.nv; i++)\n {\n v = this.vert[i];\n document.write( \"VERTEX: \", i, \" {\", v.label, \"} - VISIT: \", v.visit,\n \" - ADJACENCY: \", v.adjacentById(), \"<br>\" );\n }\n}", "title": "" }, { "docid": "4e7b8e9a36c1c9ef35f27d70b1a5b216", "score": "0.58627844", "text": "_createVertex(i) {\n\t\tvar angle = (vg.TAU / 6) * i;\n\t\treturn new THREE.Vector3((this.cellSize * Math.cos(angle)), (this.cellSize * Math.sin(angle)), 0);\n\t}", "title": "" }, { "docid": "2eb59dd73cb489fafb24c81ea14d4fd0", "score": "0.5861748", "text": "setVertices() { throw new Error(\"This method must be implemented by derived classes.\"); }", "title": "" }, { "docid": "47d3002645f3811e9f29656304306931", "score": "0.58603215", "text": "_createNodes() {\n for (let x = 0; x < this.size; x++) {\n this.nodes.push(this._getPoint(this.height, this.width));\n }\n }", "title": "" }, { "docid": "ab4fa09c33347460013b3d3a9b97be10", "score": "0.5858379", "text": "function loadVertices(vertexArray){\n let pBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, pBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(vertexArray), gl.STREAM_DRAW); //load vertices\n\n let vPosition = gl.getAttribLocation(program, \"vPosition\");\n gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vPosition); //load vertices\n}", "title": "" }, { "docid": "85237918bdc6c082d2d97250d7a7e490", "score": "0.5852371", "text": "get vertices() {\n return this.m_geometry.vertices;\n }", "title": "" }, { "docid": "97983329f9463f0a07e0667595b8b39b", "score": "0.5844342", "text": "function loadArrays(vertices) {\n\t\t// Always set the arrays to zero, in order to center properly\n\t\taVerts.length = 0;\n\t\taCounterVerts.length = 0;\n\t\tnVerts.length = 0;\n\t\tfor (var i in vertices.a_vertex) {\n\t\t\taVerts.push(p.createVector(vertices.a_vertex[i].x, vertices.a_vertex[i].y));\n\t\t\taVerts[i].x *= scaleFactor;\n\t\t\taVerts[i].x += glyphCenter.x;\n\t\t\taVerts[i].y *= scaleFactor;\n\t\t\taVerts[i].y += glyphCenter.y;\n\t\t}\n\t\tfor (var j in vertices.counter_vertex) {\n\t\t\taCounterVerts.push(p.createVector(vertices.counter_vertex[j].x, vertices.counter_vertex[j].y));\n\t\t\taCounterVerts[j].x *= scaleFactor;\n\t\t\taCounterVerts[j].x += glyphCenter.x;\n\t\t\taCounterVerts[j].y *= scaleFactor;\n\t\t\taCounterVerts[j].y += glyphCenter.y;\n\t\t}\n\t\tfor (var k in vertices.n_vertex) {\n\t\t\tnVerts.push(p.createVector(vertices.n_vertex[k].x, vertices.n_vertex[k].y));\n\t\t\tnVerts[k].x *= nScaleFactor;\n\t\t\tnVerts[k].x += nOffset.x;\n\t\t\tnVerts[k].x *= scaleFactor;\n\t\t\tnVerts[k].x += glyphCenter.x;\n\t\t\tnVerts[k].y *= nScaleFactor;\n\t\t\tnVerts[k].y += nOffset.y;\n\t\t\tnVerts[k].y *= scaleFactor;\n\t\t\tnVerts[k].y += glyphCenter.y;\n\t\t}\n\t}", "title": "" }, { "docid": "98bf43254ba78b2d0aaba924f497defc", "score": "0.58429396", "text": "addEdge(v1, v2) {\n this.adjacencyList[v1].push(v2);\n this.adjacencyList[v2].push(v1);\n }", "title": "" }, { "docid": "8dda3f4f6b5c0cd3152a8ee4458ffa08", "score": "0.5829512", "text": "calculateVertices()\n {\n if (this._transformID === this.transform._worldID)\n {\n return;\n }\n\n this._transformID = this.transform._worldID;\n\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n\n const data = this.geometry.points;// batch.vertexDataOriginal;\n const vertexData = this.vertexData;\n\n let count = 0;\n\n for (let i = 0; i < data.length; i += 2)\n {\n const x = data[i];\n const y = data[i + 1];\n\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n }", "title": "" }, { "docid": "f9de27850a270e9c4470d08ff4c5da6d", "score": "0.58269286", "text": "addEdge(vertex1, vertex2) {\n // get the list for vertex1 and add vertex2 to it\n this.adjList[vertex1].push(vertex2);\n // For an undirected graph, add an edge from vertex2 to vertex1 as well\n //this.adjList[vertex2].push(vertex1);\n }", "title": "" }, { "docid": "f9de27850a270e9c4470d08ff4c5da6d", "score": "0.58269286", "text": "addEdge(vertex1, vertex2) {\n // get the list for vertex1 and add vertex2 to it\n this.adjList[vertex1].push(vertex2);\n // For an undirected graph, add an edge from vertex2 to vertex1 as well\n //this.adjList[vertex2].push(vertex1);\n }", "title": "" }, { "docid": "6f44c729fa3cf1c84b91c9800813dbc1", "score": "0.58209187", "text": "debugVertices(){\r\n let eCnt = this.vertices.elementCount();\r\n let v = [0,0,0];\r\n\r\n for( let i=0; i < eCnt; i++ ){\r\n this.getVertex( i, v );\r\n App.Debug.pnt( v, \"cyan\", 0.1 );\r\n }\r\n }", "title": "" }, { "docid": "a33028a2f050dcbcfa752251f1c1047c", "score": "0.58205837", "text": "addEdge(vertex1, vertex2) {\n if (this.adjacencyList[vertex1] && this.adjacencyList[vertex2]) {\n if (!this.adjacencyList[vertex1].includes(vertex2)) {\n this.adjacencyList[vertex1].push(vertex2);\n }\n if (!this.adjacencyList[vertex2].includes(vertex1)) {\n this.adjacencyList[vertex2].push(vertex1);\n }\n } else {\n console.log('Vertices are invalid');\n }\n return this.adjacencyList;\n }", "title": "" }, { "docid": "6dec62cfc243cb58cc02312afb364e46", "score": "0.5819914", "text": "function createGraph() {\n\tgraph = VERTICES;\n\n\tfor (var i = 0; i < ENTRANCE_DATA.length; i++) {\n\t\tvar entrance = ENTRANCE_DATA[i];\n\t\tfor (var j = 0; j < graph.length; j++) {\n\t\t\tvar vertex = graph[j];\n\t\t\tif (vertex.x === entrance.x && vertex.y === entrance.y) {\n\t\t\t\tvertex.name = entrance.building;\n\t\t\t\tvertex.accessible = entrance.accessible;\n\t\t\t\tvertex.desc = entrance.desc;\n\t\t\t\tif (entrances[vertex.name] === undefined) {\n\t\t\t\t\tentrances[vertex.name] = [vertex.id];\n\t\t\t\t} else {\n\t\t\t\t\tentrances[vertex.name].push(vertex.id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" } ]
291019bbad1c7f912a2e44c3059333c1
Exercise 7 Write a Promise that resolves after 4000 milliseconds.
[ { "docid": "7876da0cc8e0922ded1bb757849a6d02", "score": "0.7284625", "text": "function promise4000() {}", "title": "" } ]
[ { "docid": "cfb8dbe31a0563fc0e77cd7fe8fb6791", "score": "0.6909736", "text": "function longer() {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve();\n }, 500);\n });\n}", "title": "" }, { "docid": "d3bd1f000f1798da6d43944012c9ce3d", "score": "0.6902035", "text": "function esperarPor(tempo = 2000){\n return new Promise(function(resolve){\n \n setTimeout(function(){\n console.log('Executando uma promise...')\n resolve('Vishhhh')\n },tempo)\n })\n}", "title": "" }, { "docid": "fddfc24b609b5db4e048aca2eecd727f", "score": "0.6875459", "text": "function resolveAfter2Seconds() {\n console.log(\"starting slow promise\");\n return new Promise((resolve) => {\n setTimeout(function () {\n resolve(\"slow\");\n console.log(\"slow promise is done\");\n }, 2000);\n });\n}", "title": "" }, { "docid": "8b37c9be502bc3ae9f6659c0ca16ac90", "score": "0.6866989", "text": "function dormant(ms) {\n return new Promise(function (resolve) {\n return setTimeout(resolve, ms);\n });\n}", "title": "" }, { "docid": "bae5b74a52a7d702df8812b24b29ef83", "score": "0.6793261", "text": "function sleep10000() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve();\n });\n });\n}", "title": "" }, { "docid": "f982e4d42b5398ec54b27288c1364414", "score": "0.6779174", "text": "function y(){\n return new Promise(function(resolve,reject){\n setTimeout(()=>{\n resolve('Anil');\n },3000); \n });\n}", "title": "" }, { "docid": "eb3e5911fec69a708ad6e28956ed7878", "score": "0.6610575", "text": "function cobaPromise() {\n return new Promise(( resolve, reject ) => {\n const waktu = 4000;\n if ( waktu < 5000 ) {\n setTimeout(() => {\n resolve('selesai')\n }, waktu );\n } else {\n reject('kelamaan')\n }\n });\n}", "title": "" }, { "docid": "66715d8a722e417424cd438ee7975617", "score": "0.6595432", "text": "function timeout(x) {\n return new Promise(resolve => setTimeout(() => resolve(x), 1000))\n}", "title": "" }, { "docid": "1f898c2bbf410f4ae64ea82d0cceb329", "score": "0.6550837", "text": "function __delay__(timer) {\r\n return new Promise(resolve => {\r\n timer = timer || 2000;\r\n setTimeout(function () {\r\n resolve();\r\n }, timer);\r\n });\r\n}", "title": "" }, { "docid": "223bcf031ad36e8ea22ebeb9e452a9c2", "score": "0.6542142", "text": "function delay(time = 5000) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}", "title": "" }, { "docid": "fc3d3ae59cb8a6e9592e6eab54fcc899", "score": "0.6540322", "text": "function DoSomething() {\n return new Promise((resolve) => {\n for (var n = 0; n < 1e6; n++) {}\n resolve(sleep(100));\n }).then(() => {\n console.log('hello world');\n });\n}", "title": "" }, { "docid": "718001759eeb765dc5398c27d5bd03e9", "score": "0.6512802", "text": "function delay(n){\n n = n || 2000;\n return new Promise((done) => {\n setTimeout(() => {\n done();\n }, n);\n })\n}", "title": "" }, { "docid": "682876ad3c5a478f2aa0fec21645a0c8", "score": "0.65086067", "text": "function solution() {\n const new_promise = new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve('done!');\n // reject('some err');\n }, 3000);\n });\n\n return new_promise;\n}", "title": "" }, { "docid": "bc2ed51cac152256bfd7a40199627ca5", "score": "0.6476943", "text": "function waitFor(time = 2000) {\n return new Promise(\n function (resolve) {\n setTimeout(function () {\n console.log('Executing promise')\n resolve()\n })\n }\n )\n}", "title": "" }, { "docid": "f131abc67b97c52ff05594bd4fe4b4db", "score": "0.64230454", "text": "function sleeper(ms) {\n\t\t return function(x) {\n\t\t return new Promise(resolve => setTimeout(() => resolve(x), ms));\n\t\t };\n\t\t}", "title": "" }, { "docid": "f131abc67b97c52ff05594bd4fe4b4db", "score": "0.64230454", "text": "function sleeper(ms) {\n\t\t return function(x) {\n\t\t return new Promise(resolve => setTimeout(() => resolve(x), ms));\n\t\t };\n\t\t}", "title": "" }, { "docid": "d1fd3b3a81273f3aafb2e2d4739c957a", "score": "0.6418103", "text": "function delay(time) {\n return new Promise(function(resolve) { \n setTimeout(resolve, time);\n });\n }", "title": "" }, { "docid": "257f457179feca29e75dd12a4c01d8ae", "score": "0.64158237", "text": "function myfunction (resolveAfter) {\n return new Promise((resolve,reject) => {setTimeout((resolveAfter) => {resolve(\"I am called asynchronously\");},resolveAfter*1000);})\n }", "title": "" }, { "docid": "d9ba494c2a1ac406743c5d1bdc245287", "score": "0.64012814", "text": "function doSomthing4(time) {\n return new Promise4(resolve => {\n setTimeout(resolve, time);\n });\n}", "title": "" }, { "docid": "ad2cff0793313f74fb47ea2799067e6d", "score": "0.63918084", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}//sleep", "title": "" }, { "docid": "06a8907cf178201556fcfd3c31dcb21c", "score": "0.6370998", "text": "function delay(time) {\n \treturn new Promise(resolve => setTimeout(resolve, time));\n }", "title": "" }, { "docid": "b25f47f4176016c28c341a7440fe6586", "score": "0.6364839", "text": "function promiseAndAwaitPattern(number, timeout) {\n return new Promise((resolve) => {\n setTimeout(\n () => {\n console.log(number);\n resolve(number);\n },\n timeout,\n );\n });\n}", "title": "" }, { "docid": "412c97c6b1c9ab9fed55d3a0fbb8d85e", "score": "0.635976", "text": "function delay(n) {\n n = n || 1000;\n return new Promise((done) => {\n setTimeout(() => {\n done();\n }, n);\n });\n}", "title": "" }, { "docid": "69a56566f4213e5957c70b4fe91ed311", "score": "0.6355919", "text": "function delayDouble(number) {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve(number * 2), 1000);\n });\n}", "title": "" }, { "docid": "feb3fed9fed0b283c21f0d2be0fbde16", "score": "0.63399285", "text": "function ThisPromise(){\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n // masuk ke then\n resolve('hilmi')\n // masuk ke catch\n // reject \n }, 2000)\n })\n}", "title": "" }, { "docid": "b240ea2943af23253c06c2e29ab343a4", "score": "0.63327384", "text": "function SleepTime(sleep){\n return new Promise(function(resolve) {\n setTimeout(function(){resolve(\"true\");}, sleep*1000);\n });\n}", "title": "" }, { "docid": "f3eec8ee096792f8b9871d89818c5626", "score": "0.6310466", "text": "function delay(millisec) {\n const promise = new Promise((resolve) => {\n setTimeout(() => resolve(true), millisec);\n });\n return promise;\n}", "title": "" }, { "docid": "aa931301eeefddf61a7594bd5ea44261", "score": "0.6302581", "text": "delay(ms)\n {\n return new Promise(resolve => setTimeout( () => resolve(), ms));\n }", "title": "" }, { "docid": "fd43d30cb9fa8e8b62226dcc88207fed", "score": "0.6298164", "text": "function delay(time) {\n return new Promise(function(resolve) {\n setTimeout(resolve, time)\n })\n}", "title": "" }, { "docid": "74f4064e1dc1133230130168a42abd11", "score": "0.62905145", "text": "function timeOutPromise(){\n return new Promise(function(resolve, reject){\n setTimeout(resolve, 2000);\n});\n \n}", "title": "" }, { "docid": "68a917f7d0a992812a30d8183188dfee", "score": "0.6287026", "text": "function test() {\n setTimeout(defer.resolve, 300, \"RESOLVED!\");\n return defer.promise;\n}", "title": "" }, { "docid": "6c9c0ecd5343b01e39853e2d427ab1c4", "score": "0.6286781", "text": "function delay(time) {\n return new Promise(function (resolve, reject) {\n setTimeout(resolve, time);\n });\n}", "title": "" }, { "docid": "dc50f7e5fb904a2be02302dbc3627491", "score": "0.62792975", "text": "function sleep() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve();\n }, 1000);\n });\n}", "title": "" }, { "docid": "ecb9f667ee6f712583ea5b8dfc6d38c4", "score": "0.6274131", "text": "function getRandomNumber(){\r\n return new Promise(function(myResolve, myReject) {\r\n setTimeout(function() { \r\n let num = Math.floor((Math.random() * 100) + 1);\r\n\r\n myResolve(num); \r\n }, 500);\r\n });\r\n}", "title": "" }, { "docid": "2e362b795f4955293dc2dde3a03c113a", "score": "0.6265289", "text": "function delay() {\n return Promise.delay(Math.random(1, 5) * 10000);\n}", "title": "" }, { "docid": "332d33b53a7d3980eb66ff7cd8671508", "score": "0.6230141", "text": "function delay(t) {\n return new Promise(function (resolve) {\n setTimeout(resolve, t);\n });\n}", "title": "" }, { "docid": "1a96bc42191966a01cd24024119be400", "score": "0.62198514", "text": "function delayPromise(milliseconds) {\n return new Promise((resolve, reject) => {\n setTimeout(resolve, milliseconds);\n });\n}", "title": "" }, { "docid": "5613bad9d7154fca596ea9681b2c6b54", "score": "0.62132365", "text": "delay(ms){\n return new Promise(res => setTimeout(res, ms))\n }", "title": "" }, { "docid": "9cd35f5fbab95a1c8e5bcfb02bca7b9b", "score": "0.6213051", "text": "function sleep(ms) {\n return new Promise(function (resolve) { return setTimeout(resolve, ms); });\n}", "title": "" }, { "docid": "6f42f650ac89658424375dfb76d036e5", "score": "0.6212397", "text": "function delay(time) {\n\t\treturn new Promise(resolve => setTimeout(resolve, time));\n }", "title": "" }, { "docid": "079877c457701c81ea74786fa44b4f92", "score": "0.6191377", "text": "function asyncFunc() {\n //debugger\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve('DONE'), 5000);\n });\n}", "title": "" }, { "docid": "594b7e391885e89ee86a463bd9cbecd5", "score": "0.61856616", "text": "function sleep(ms){\r\n\treturn new Promise(resolve => setTimeout(resolve,ms));\r\n}", "title": "" }, { "docid": "d3608206bbf957fe821555ea599fbd0c", "score": "0.61855197", "text": "function timer(ms) {\n\treturn new Promise(res => setTimeout(res, ms));\n}", "title": "" }, { "docid": "315ef9c56512ac29efca465271cb56ff", "score": "0.61616576", "text": "function sleep(time) {\r\n return new Promise((resolve) => setTimeout(resolve, time));\r\n}", "title": "" }, { "docid": "7109867f43cc8a60da998e4f8b983d44", "score": "0.61546224", "text": "function delay(time) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}", "title": "" }, { "docid": "d33ee6a8b8f16ae405c0c062fb0e23f4", "score": "0.6153496", "text": "function wait(number){\n return new Promise(function (resolve, reject){\n setTimeout(function(){\n if (number !== 1000) {\n resolve(\"You will see this after \" + (number/1000) + \" seconds.\");\n }else {\n resolve(\"You will see this after \" + (number/1000) + \" second.\")\n }\n }, number)\n });\n}", "title": "" }, { "docid": "bed0be6503db5b2a3bf77b341c1be0a1", "score": "0.61448914", "text": "function DoSomething() {\n return new Promise(async (resolve) => {\n for (var n = 0; n < 1e6; n++) {}\n resolve(await sleep(100)); // !?\n console.log('B');\n }).then(() => {\n console.log('hello world');\n });\n}", "title": "" }, { "docid": "5c0bc1e06e1398da30322328244b8ad7", "score": "0.61428374", "text": "function doubleAfter2Seconds(x) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n console.log('doubleAfter2Seconds for x =', x)\n if (typeof x === 'number') {\n resolve(x * 2);\n } else {\n reject('error nih')\n }\n }, 2000);\n });\n}", "title": "" }, { "docid": "6699ebc3a0c38725a50a453f21884956", "score": "0.6141941", "text": "async function sleep(ms){\n return new Promise(exit => setTimeout(exit, ms));\n}", "title": "" }, { "docid": "ea8bc42e2dc8f6711cfb35b15045d7cf", "score": "0.6129746", "text": "function sleep (time=1000) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}", "title": "" }, { "docid": "ea8bc42e2dc8f6711cfb35b15045d7cf", "score": "0.6129746", "text": "function sleep (time=1000) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}", "title": "" }, { "docid": "c8e085f09ca89abfe9eae9dd353badf0", "score": "0.6127752", "text": "function delay(ms) {\n return new Promise((resolve, reject) => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "19f8aea4ffe7f24e08ce584af085c17e", "score": "0.6126296", "text": "function sleep(ms){\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "37170ea8e28e448ccc99f9fcbb8f9daa", "score": "0.6120721", "text": "function waitOneSecond() {\n return new Promise((resolve, reject) => {\n // this code will be executed immediately!\n setTimeout(() => {\n // one second has passed, this means that I can resolve my promise!\n resolve('1 second has passed!');\n }, 1000);\n });\n}", "title": "" }, { "docid": "0e384a3435a9f2922ce3f0a4cea61eaa", "score": "0.611848", "text": "function sleep(time) {\n return new Promise(function (resolve) {\n setTimeout(resolve, time);\n });\n}", "title": "" }, { "docid": "808045da35b43b71a8edf03d67ef6781", "score": "0.61134326", "text": "addDelay(ms){\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n }", "title": "" }, { "docid": "1c3f294d04324feefe54426d72aee3d7", "score": "0.61064994", "text": "function setTimeoutP(ms) {\n\treturn new Promise((resolve) => {\n\t\tsetTimeout(resolve, ms);\n\t});\n}", "title": "" }, { "docid": "58f41af77c9bb4637fc8f60222e1f134", "score": "0.6104868", "text": "static simLatency() {\n\n let latency = Math.random() * 1000;\n \n return new Promise((resolve, reject) => {\n setTimeout(resolve, latency); \n });\n }", "title": "" }, { "docid": "166d1c96885848056e6ca7d9c82a540a", "score": "0.6104036", "text": "function sleep(x) {\n return new Promise(resolve => setTimeout(resolve, x));\n}", "title": "" }, { "docid": "ab2de949222f4584f2950274cdfffed4", "score": "0.6101541", "text": "function delay(duration) {\n return new Promise( resolve => setTimeout( resolve, duration ) );\n}", "title": "" }, { "docid": "00713c02f01acd9698c036e22a074333", "score": "0.6098214", "text": "function returnValue() {\n return new Promise(resolve => {\n setTimeout(() => resolve(10), 5000)\n })\n}", "title": "" }, { "docid": "e23358111ed5acded58399e01afbaf63", "score": "0.60977215", "text": "function sleep(ms){\n return new Promise(resolve=>{\n setTimeout(resolve,ms)\n })\n}", "title": "" }, { "docid": "e23358111ed5acded58399e01afbaf63", "score": "0.60977215", "text": "function sleep(ms){\n return new Promise(resolve=>{\n setTimeout(resolve,ms)\n })\n}", "title": "" }, { "docid": "9e4f17a3e47a3cc055936d474c7aa922", "score": "0.6096955", "text": "function sleep(milliseconds) {\n return new Promise(resolve => {\n setTimeout(resolve, milliseconds);\n });\n}", "title": "" }, { "docid": "37b3b8cab8108b1fec2ebb4ae9459197", "score": "0.6096475", "text": "function resolveAfter2Seconds() {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve('resolved');\n }, 2000);\n });\n}", "title": "" }, { "docid": "7681321a984a95ce541f46528a9c6aa9", "score": "0.6096194", "text": "function sleep(ms) {\n //delay function\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "c52c788b742e6ea960b9848d742429b5", "score": "0.60915345", "text": "function pause(time) {\r\n return new Promise((resolve) => setTimeout(resolve, time));\r\n}", "title": "" }, { "docid": "33c50cf9e4d4601d3eaef44fd03cfebb", "score": "0.609093", "text": "function sleep (time) {\nreturn new Promise((resolve) => setTimeout(resolve, time));\n}", "title": "" }, { "docid": "c553511d7d1dadd5fc1e62e167959647", "score": "0.6090175", "text": "delay(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "8c1826e5ecd1c06112fbd43e507571d7", "score": "0.6089362", "text": "timeout (milliseconds) {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n }", "title": "" }, { "docid": "6a06f69f7f20ae4e75d0e2ccafd679cc", "score": "0.60868335", "text": "function getSpecificNumber2() {\n return new Promise((resolve, reject)=>{\n setTimeout(()=> resolve(42), 2000);\n });\n}", "title": "" }, { "docid": "1a65cff87db3da0d9e416a20bc698681", "score": "0.6085657", "text": "static delay(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms)\n })\n }", "title": "" }, { "docid": "98551b3cafe8f90cee50ff634258885e", "score": "0.6081726", "text": "function delay(milliseconds) {\n return new Promise(function(resolve) {\n if (milliseconds > 0) {\n setTimeout(function() {\n resolve(milliseconds);\n }, milliseconds);\n } else {\n resolve(0);\n }\n });\n}", "title": "" }, { "docid": "d3c5830dc01460ed5c4d7b5f746febfc", "score": "0.6073709", "text": "function doubleDelay(number) {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(number * 2);\n }, 1000);\n })\n}", "title": "" }, { "docid": "6bbff817a9d8bb81848755b9068d4365", "score": "0.607112", "text": "function sleep(ms) {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}", "title": "" }, { "docid": "5bd127849ff7150986f0d333e0fbc076", "score": "0.60687315", "text": "function sleep(milliseconds) {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n}", "title": "" }, { "docid": "5bd127849ff7150986f0d333e0fbc076", "score": "0.60687315", "text": "function sleep(milliseconds) {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n}", "title": "" }, { "docid": "5bd127849ff7150986f0d333e0fbc076", "score": "0.60687315", "text": "function sleep(milliseconds) {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n}", "title": "" }, { "docid": "5bd127849ff7150986f0d333e0fbc076", "score": "0.60687315", "text": "function sleep(milliseconds) {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n}", "title": "" }, { "docid": "4d72ee2fa393906c5ae4afdec541279f", "score": "0.6067514", "text": "function timer(ms) {\n return new Promise(res => setTimeout(res, ms));\n}", "title": "" }, { "docid": "f2ffb71756a2f6de014b1139510ccb55", "score": "0.6065262", "text": "function sleep(ms) {\n return new Promise((resolve) => { setTimeout(resolve, ms) })\n}", "title": "" }, { "docid": "44a13f61afa0304f719aceb2a319cc70", "score": "0.6064967", "text": "setDelay(x) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(x);\n }, x * 1000);\n });\n }", "title": "" }, { "docid": "9d95d0243faed557c9c84d4babf42578", "score": "0.606297", "text": "function delay(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "9d95d0243faed557c9c84d4babf42578", "score": "0.606297", "text": "function delay(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "10290449c89ef60571b463580ad20581", "score": "0.6060624", "text": "function getSpecificNumber1() {\n return new Promise((resolve, reject)=>{\n setTimeout(()=> resolve(42), 2000);\n });\n}", "title": "" }, { "docid": "da885e10fadd6241d13a169224aa9a1b", "score": "0.60530114", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n\n}", "title": "" }, { "docid": "0c537398c78a0753a674fb4558e8d018", "score": "0.60470676", "text": "function breathe2(amount) {\n return new Promise((resolve, reject) => {\n \n if (amount < 500) {\n reject('That is too small of a value!');\n }\n \n setTimeout(() => {\n resolve(`Done for ${amount}ms!`);\n }, amount);\n\n });\n}", "title": "" }, { "docid": "ad0432acbe1b6c73132bb8a85322c0fa", "score": "0.604455", "text": "function delay(time) {\n return new Promise((res) => {\n setTimeout(res, time);\n })\n }", "title": "" }, { "docid": "f064913a7cab931d3a809f58d7536a63", "score": "0.60442114", "text": "function sleep (time) \n{\n return new Promise((resolve) => setTimeout(resolve, time));\n}", "title": "" }, { "docid": "e6096ae8af0f41d003795a4faf359697", "score": "0.6038344", "text": "function delay(ms){\n return new Promise((resolve,reject)=> {\n if( typeof ms !== 'number' || ms < 0) reject(\"invalid value\");\n else setTimeout(function()\n {resolve(ms)},\n ms)\n }) \n}", "title": "" }, { "docid": "27c9f9d31b4be848f0d47e24fc703e5c", "score": "0.6036146", "text": "function sleep(time) {\n return new Promise(done => setTimeout(done, time));\n}", "title": "" }, { "docid": "b30a279718745e004ddca8e75203d60c", "score": "0.60354877", "text": "function sleep(ms)\r\n{\r\n return new Promise(resolve=>setTimeout(resolve,ms));\r\n}", "title": "" }, { "docid": "c5684e8f53c7781a594b589befa38c13", "score": "0.603144", "text": "function delay(t, value) {\n return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); });\n}", "title": "" }, { "docid": "c5684e8f53c7781a594b589befa38c13", "score": "0.603144", "text": "function delay(t, value) {\n return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); });\n}", "title": "" }, { "docid": "c5684e8f53c7781a594b589befa38c13", "score": "0.603144", "text": "function delay(t, value) {\n return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); });\n}", "title": "" }, { "docid": "808fca6ad6f461d6b7e41527a9b76f73", "score": "0.602544", "text": "function timeout(delay) {\n return new Promise((res) => setTimeout(res, delay));\n}", "title": "" }, { "docid": "a11e8906e721380a8aaa79108d3458be", "score": "0.6023713", "text": "function promiseTimeout(\n/** A function to be executed after the timer expires. */\nfunc,\n/** The time, in milliseconds (thousandths of a second), the timer should wait before the specified function or code is executed. If this parameter is omitted, a value of 0 is used, meaning execute \"immediately\", or more accurately, as soon as possible. */\ndelay) {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(func());\n }, delay);\n });\n}", "title": "" }, { "docid": "7b9153084c6ef37311ed58c9702e9167", "score": "0.6022604", "text": "function makePromise(arg) {\n return new Promise(function(resolve, reject) {\n setTimeout(resolve(arg), 3000);\n });\n }", "title": "" }, { "docid": "e422c602457ffb5508f1018b6630c179", "score": "0.60180527", "text": "sleep(milliseconds) {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n }", "title": "" }, { "docid": "1fa8f748cd1420f603892898ce64b261", "score": "0.6016897", "text": "delay(t) {\n return new Promise(function(resolve) {\n setTimeout(resolve, t)\n });\n }", "title": "" } ]
7da27f7332fbdfc5e144ff99cb0edaf6
component implements: eventRangesToEventFootprints eventFootprintsToSegs
[ { "docid": "193f570fc528830381798d2009a1d3c8", "score": "0.0", "text": "function BusinessHourRenderer(component, fillRenderer) {\n this.component = component;\n this.fillRenderer = fillRenderer;\n }", "title": "" } ]
[ { "docid": "43e979756884d36233b36199c215a442", "score": "0.6142905", "text": "sliceEventRange(eventRange, extraArgs) {\n let dateRange = eventRange.range;\n // hack to make multi-day events that are being force-displayed as list-items to take up only one day\n if (this.forceDayIfListItem && eventRange.ui.display === 'list-item') {\n dateRange = {\n start: dateRange.start,\n end: addDays(dateRange.start, 1),\n };\n }\n let segs = this.sliceRange(dateRange, ...extraArgs);\n for (let seg of segs) {\n seg.eventRange = eventRange;\n seg.isStart = eventRange.isStart && seg.isStart;\n seg.isEnd = eventRange.isEnd && seg.isEnd;\n }\n return segs;\n }", "title": "" }, { "docid": "1a3b051606847b5e946f5df03cbfebcd", "score": "0.6059104", "text": "sliceEventRange(eventRange, extraArgs) {\n let dateRange = eventRange.range;\n // hack to make multi-day events that are being force-displayed as list-items to take up only one day\n if (this.forceDayIfListItem && eventRange.ui.display === 'list-item') {\n dateRange = {\n start: dateRange.start,\n end: addDays(dateRange.start, 1),\n };\n }\n let segs = this.sliceRange(dateRange, ...extraArgs);\n for (let seg of segs) {\n seg.eventRange = eventRange;\n seg.isStart = eventRange.isStart && seg.isStart;\n seg.isEnd = eventRange.isEnd && seg.isEnd;\n }\n return segs;\n }", "title": "" }, { "docid": "3fbe34093eb950fa85899756056f0bed", "score": "0.55554754", "text": "function resliceDaySegs(segs, dayDate, colIndex) {\n var dayStart = dayDate;\n var dayEnd = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.addDays)(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.intersectRanges)(origRange, dayRange);\n if (slicedRange) {\n newSegs.push((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, seg), { firstCol: colIndex, lastCol: colIndex, eventRange: {\n def: eventRange.def,\n ui: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, eventRange.ui), { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange,\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n}", "title": "" }, { "docid": "3160bbb3ad71aec87b95dc12726445b9", "score": "0.5515078", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\ttop,\n\t\t\tbottom,\n\t\t\tcolumnLeft,\n\t\t\tcolumnRight,\n\t\t\tcolumnWidth,\n\t\t\twidth,\n\t\t\tleft,\n\t\t\tright,\n\t\t\thtml = '',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\ttitleElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\tisRTL = opt('isRTL');\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolumnLeft = colContentLeft(seg.col);\n\t\t\tcolumnRight = colContentRight(seg.col);\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\t// shave off space on right near scrollbars (2.5%)\n\t\t\t// TODO: move this to CSS somehow\n\t\t\tcolumnRight -= columnWidth * .025;\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\twidth = columnWidth * (seg.forwardCoord - seg.backwardCoord);\n\n\t\t\tif (opt('slotEventOverlap')) {\n\t\t\t\t// double the width while making sure resize handle is visible\n\t\t\t\t// (assumed to be 20px wide)\n\t\t\t\twidth = Math.max(\n\t\t\t\t\t(width - (20/2)) * 2,\n\t\t\t\t\twidth // narrow columns will want to make the segment smaller than\n\t\t\t\t\t\t// the natural width. don't allow it\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isRTL) {\n\t\t\t\tright = columnRight - seg.backwardCoord * columnWidth;\n\t\t\t\tleft = right - width;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tleft = columnLeft + seg.backwardCoord * columnWidth;\n\t\t\t\tright = left + width;\n\t\t\t}\n\n\t\t\t// make sure horizontal coordinates are in bounds\n\t\t\tleft = Math.max(left, columnLeft);\n\t\t\tright = Math.min(right, columnRight);\n\t\t\twidth = right - left;\n\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = width;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tseg.vsides = vsides(eventElement, true);\n\t\t\t\tseg.hsides = hsides(eventElement, true);\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title');\n\t\t\t\tif (titleElement.length) {\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "3160bbb3ad71aec87b95dc12726445b9", "score": "0.5515078", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\ttop,\n\t\t\tbottom,\n\t\t\tcolumnLeft,\n\t\t\tcolumnRight,\n\t\t\tcolumnWidth,\n\t\t\twidth,\n\t\t\tleft,\n\t\t\tright,\n\t\t\thtml = '',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\ttitleElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\tisRTL = opt('isRTL');\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolumnLeft = colContentLeft(seg.col);\n\t\t\tcolumnRight = colContentRight(seg.col);\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\t// shave off space on right near scrollbars (2.5%)\n\t\t\t// TODO: move this to CSS somehow\n\t\t\tcolumnRight -= columnWidth * .025;\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\twidth = columnWidth * (seg.forwardCoord - seg.backwardCoord);\n\n\t\t\tif (opt('slotEventOverlap')) {\n\t\t\t\t// double the width while making sure resize handle is visible\n\t\t\t\t// (assumed to be 20px wide)\n\t\t\t\twidth = Math.max(\n\t\t\t\t\t(width - (20/2)) * 2,\n\t\t\t\t\twidth // narrow columns will want to make the segment smaller than\n\t\t\t\t\t\t// the natural width. don't allow it\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isRTL) {\n\t\t\t\tright = columnRight - seg.backwardCoord * columnWidth;\n\t\t\t\tleft = right - width;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tleft = columnLeft + seg.backwardCoord * columnWidth;\n\t\t\t\tright = left + width;\n\t\t\t}\n\n\t\t\t// make sure horizontal coordinates are in bounds\n\t\t\tleft = Math.max(left, columnLeft);\n\t\t\tright = Math.min(right, columnRight);\n\t\t\twidth = right - left;\n\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = width;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tseg.vsides = vsides(eventElement, true);\n\t\t\t\tseg.hsides = hsides(eventElement, true);\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title');\n\t\t\t\tif (titleElement.length) {\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "3160bbb3ad71aec87b95dc12726445b9", "score": "0.5515078", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\ttop,\n\t\t\tbottom,\n\t\t\tcolumnLeft,\n\t\t\tcolumnRight,\n\t\t\tcolumnWidth,\n\t\t\twidth,\n\t\t\tleft,\n\t\t\tright,\n\t\t\thtml = '',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\ttitleElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\tisRTL = opt('isRTL');\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolumnLeft = colContentLeft(seg.col);\n\t\t\tcolumnRight = colContentRight(seg.col);\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\t// shave off space on right near scrollbars (2.5%)\n\t\t\t// TODO: move this to CSS somehow\n\t\t\tcolumnRight -= columnWidth * .025;\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\twidth = columnWidth * (seg.forwardCoord - seg.backwardCoord);\n\n\t\t\tif (opt('slotEventOverlap')) {\n\t\t\t\t// double the width while making sure resize handle is visible\n\t\t\t\t// (assumed to be 20px wide)\n\t\t\t\twidth = Math.max(\n\t\t\t\t\t(width - (20/2)) * 2,\n\t\t\t\t\twidth // narrow columns will want to make the segment smaller than\n\t\t\t\t\t\t// the natural width. don't allow it\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isRTL) {\n\t\t\t\tright = columnRight - seg.backwardCoord * columnWidth;\n\t\t\t\tleft = right - width;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tleft = columnLeft + seg.backwardCoord * columnWidth;\n\t\t\t\tright = left + width;\n\t\t\t}\n\n\t\t\t// make sure horizontal coordinates are in bounds\n\t\t\tleft = Math.max(left, columnLeft);\n\t\t\tright = Math.min(right, columnRight);\n\t\t\twidth = right - left;\n\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = width;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tseg.vsides = vsides(eventElement, true);\n\t\t\t\tseg.hsides = hsides(eventElement, true);\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title');\n\t\t\t\tif (titleElement.length) {\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "3160bbb3ad71aec87b95dc12726445b9", "score": "0.5515078", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\ttop,\n\t\t\tbottom,\n\t\t\tcolumnLeft,\n\t\t\tcolumnRight,\n\t\t\tcolumnWidth,\n\t\t\twidth,\n\t\t\tleft,\n\t\t\tright,\n\t\t\thtml = '',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\ttitleElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\tisRTL = opt('isRTL');\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolumnLeft = colContentLeft(seg.col);\n\t\t\tcolumnRight = colContentRight(seg.col);\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\t// shave off space on right near scrollbars (2.5%)\n\t\t\t// TODO: move this to CSS somehow\n\t\t\tcolumnRight -= columnWidth * .025;\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\twidth = columnWidth * (seg.forwardCoord - seg.backwardCoord);\n\n\t\t\tif (opt('slotEventOverlap')) {\n\t\t\t\t// double the width while making sure resize handle is visible\n\t\t\t\t// (assumed to be 20px wide)\n\t\t\t\twidth = Math.max(\n\t\t\t\t\t(width - (20/2)) * 2,\n\t\t\t\t\twidth // narrow columns will want to make the segment smaller than\n\t\t\t\t\t\t// the natural width. don't allow it\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isRTL) {\n\t\t\t\tright = columnRight - seg.backwardCoord * columnWidth;\n\t\t\t\tleft = right - width;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tleft = columnLeft + seg.backwardCoord * columnWidth;\n\t\t\t\tright = left + width;\n\t\t\t}\n\n\t\t\t// make sure horizontal coordinates are in bounds\n\t\t\tleft = Math.max(left, columnLeft);\n\t\t\tright = Math.min(right, columnRight);\n\t\t\twidth = right - left;\n\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = width;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tseg.vsides = vsides(eventElement, true);\n\t\t\t\tseg.hsides = hsides(eventElement, true);\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title');\n\t\t\t\tif (titleElement.length) {\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "2de7bc758f82a9d4fe01bf74b186dc74", "score": "0.5495101", "text": "function segmentEvent(){\n for (var i = data.length - 1; i >= 0; i--) {\n $scope.eventId = data[i].$id;\n angular.forEach(data[i], function(value, key){\n var startType, endType, eventType, eventColor, title, volunteerType;\n if(key === 'setup_start'){\n startType = 'setup_start';\n endType = 'setup_end';\n eventType = 'setup';\n eventColor = 'primaryGreen';\n title = \" Setup\";\n volunteerType = 'setup_volunteers_needed';\n } else if(key === 'event_start'){\n startType = 'event_start';\n eventColor = 'primaryBlue';\n endType = 'event_end';\n eventType = 'event';\n title = '';\n volunteerType = 'volunteers_needed';\n } else if(key === 'cleanup_start') {\n startType = 'cleanup_start';\n endType = 'cleanup_end';\n eventColor = 'primaryRed';\n eventType = 'cleanup';\n title = ' Cleanup'\n volunteerType = 'cleanup_volunteers_needed';\n }\n if(startType){\n var segmentObj = {\n id: this.$id,\n allday: false,\n location: this.location,\n startTime: this[startType],\n endTime:this[endType],\n type: eventType,\n volunteersNeeded: this[volunteerType],\n color: eventColor,\n title: this.title + title,\n startTimeOffset: getTimeOffset(new Date(this[startType])),\n totalApptTime: getApptTime(new Date(this[startType]), new Date(this[endType]))\n }\n if(this.volunteers){// This event has volunteers\n segmentObj.volunteersCount = Object.keys(this.volunteers).length\n // segmentObj.volunteerTitle = segmentObj.volunteersCount + ' of ' + this[volunteerType]; \n }\n $scope.eventSource.push(segmentObj);\n }\n }, data[i]);\n }\n $scope.arrayify(data[0], $scope.eventSource[$scope.eventSource.length - 1]);\n }", "title": "" }, { "docid": "d430653acb587ed8d0e9f7c59cfd0cca", "score": "0.54568624", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\ttop,\n\t\t\tbottom,\n\t\t\tcolumnLeft,\n\t\t\tcolumnRight,\n\t\t\tcolumnWidth,\n\t\t\twidth,\n\t\t\tleft,\n\t\t\tright,\n\t\t\thtml = '',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\ttitleElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\tisRTL = opt('isRTL');\n\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = computeDateTop(seg.start, seg.start);\n\t\t\tbottom = computeDateTop(seg.end, seg.start);\n\t\t\tcolumnLeft = colContentLeft(seg.col);\n\t\t\tcolumnRight = colContentRight(seg.col);\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\t// shave off space on right near scrollbars (2.5%)\n\t\t\t// TODO: move this to CSS somehow\n\t\t\tcolumnRight -= columnWidth * .025;\n\t\t\tcolumnWidth = columnRight - columnLeft;\n\n\t\t\twidth = columnWidth * (seg.forwardCoord - seg.backwardCoord);\n\n\t\t\tif (opt('slotEventOverlap')) {\n\t\t\t\t// double the width while making sure resize handle is visible\n\t\t\t\t// (assumed to be 20px wide)\n\t\t\t\twidth = Math.max(\n\t\t\t\t\t(width - (20/2)) * 2,\n\t\t\t\t\twidth // narrow columns will want to make the segment smaller than\n\t\t\t\t\t\t// the natural width. don't allow it\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isRTL) {\n\t\t\t\tright = columnRight - seg.backwardCoord * columnWidth;\n\t\t\t\tleft = right - width;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tleft = columnLeft + seg.backwardCoord * columnWidth;\n\t\t\t\tright = left + width;\n\t\t\t}\n\n\t\t\t// make sure horizontal coordinates are in bounds\n\t\t\tleft = Math.max(left, columnLeft);\n\t\t\tright = Math.min(right, columnRight);\n\t\t\twidth = right - left;\n\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = width;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif ((eventElement = seg.element)) {\n\t\t\t\tseg.vsides = vsides(eventElement, true);\n\t\t\t\tseg.hsides = hsides(eventElement, true);\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title');\n\t\t\t\tif (titleElement.length) {\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif ((eventElement = seg.element)) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(\n\t\t\t\t\t\t\tformatDate(event.start, opt('timeFormat')) + ' - ' + event.title\n\t\t\t\t\t\t);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "fff31269b8cff93fa0a08e760e34e6e8", "score": "0.54546446", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\n var i, segCnt=segs.length, seg,\n event,\n top,\n bottom,\n columnLeft,\n columnRight,\n columnWidth,\n width,\n left,\n right,\n html = '',\n eventElements,\n eventElement,\n triggerRes,\n titleElement,\n height,\n slotSegmentContainer = getSlotSegmentContainer(),\n isRTL = opt('isRTL');\n\n // calculate position/dimensions, create html\n for (i=0; i<segCnt; i++) {\n seg = segs[i];\n event = seg.event;\n top = timePosition(seg.start, seg.start);\n bottom = timePosition(seg.start, seg.end);\n columnLeft = colContentLeft(seg.col);\n columnRight = colContentRight(seg.col);\n columnWidth = columnRight - columnLeft;\n\n // shave off space on right near scrollbars (2.5%)\n // TODO: move this to CSS somehow\n columnRight -= columnWidth * .025;\n columnWidth = columnRight - columnLeft;\n\n width = columnWidth * (seg.forwardCoord - seg.backwardCoord);\n\n if (opt('slotEventOverlap')) {\n // double the width while making sure resize handle is visible\n // (assumed to be 20px wide)\n width = Math.max(\n (width - (20/2)) * 2,\n width // narrow columns will want to make the segment smaller than\n // the natural width. don't allow it\n );\n }\n\n if (isRTL) {\n right = columnRight - seg.backwardCoord * columnWidth;\n left = right - width;\n }\n else {\n left = columnLeft + seg.backwardCoord * columnWidth;\n right = left + width;\n }\n\n // make sure horizontal coordinates are in bounds\n left = Math.max(left, columnLeft);\n right = Math.min(right, columnRight);\n width = right - left;\n\n seg.top = top;\n seg.left = left;\n seg.outerWidth = width;\n seg.outerHeight = bottom - top;\n html += slotSegHtml(event, seg);\n }\n\n slotSegmentContainer[0].innerHTML = html; // faster than html()\n eventElements = slotSegmentContainer.children();\n\n // retrieve elements, run through eventRender callback, bind event handlers\n for (i=0; i<segCnt; i++) {\n seg = segs[i];\n event = seg.event;\n eventElement = $(eventElements[i]); // faster than eq()\n triggerRes = trigger('eventRender', event, event, eventElement);\n if (triggerRes === false) {\n eventElement.remove();\n }else{\n if (triggerRes && triggerRes !== true) {\n eventElement.remove();\n eventElement = $(triggerRes)\n .css({\n position: 'absolute',\n top: seg.top,\n left: seg.left\n })\n .appendTo(slotSegmentContainer);\n }\n seg.element = eventElement;\n if (event._id === modifiedEventId) {\n bindSlotSeg(event, eventElement, seg);\n }else{\n eventElement[0]._fci = i; // for lazySegBind\n }\n reportEventElement(event, eventElement);\n }\n }\n\n lazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\n // record event sides and title positions\n for (i=0; i<segCnt; i++) {\n seg = segs[i];\n if (eventElement = seg.element) {\n seg.vsides = vsides(eventElement, true);\n seg.hsides = hsides(eventElement, true);\n titleElement = eventElement.find('.fc-event-title');\n if (titleElement.length) {\n seg.contentTop = titleElement[0].offsetTop;\n }\n }\n }\n\n // set all positions/dimensions at once\n for (i=0; i<segCnt; i++) {\n seg = segs[i];\n if (eventElement = seg.element) {\n eventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n height = Math.max(0, seg.outerHeight - seg.vsides);\n eventElement[0].style.height = height + 'px';\n event = seg.event;\n if (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n // not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n eventElement.find('div.fc-event-time')\n .text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n eventElement.find('div.fc-event-title')\n .remove();\n }\n trigger('eventAfterRender', event, event, eventElement);\n }\n }\n\n }", "title": "" }, { "docid": "00049a0b3d52b53d574e15776768e782", "score": "0.54381746", "text": "function renderDaySegs(segs, modifiedEventId) { // 4668\n\t\tvar segmentContainer = getDaySegmentContainer(); // 4669\n\t\tvar rowDivs; // 4670\n\t\tvar rowCnt = getRowCnt(); // 4671\n\t\tvar colCnt = getColCnt(); // 4672\n\t\tvar i = 0; // 4673\n\t\tvar rowI; // 4674\n\t\tvar levelI; // 4675\n\t\tvar colHeights; // 4676\n\t\tvar j; // 4677\n\t\tvar segCnt = segs.length; // 4678\n\t\tvar seg; // 4679\n\t\tvar top; // 4680\n\t\tvar k; // 4681\n\t\tsegmentContainer[0].innerHTML = daySegHTML(segs); // faster than .html() // 4682\n\t\tdaySegElementResolve(segs, segmentContainer.children()); // 4683\n\t\tdaySegElementReport(segs); // 4684\n\t\tdaySegHandlers(segs, segmentContainer, modifiedEventId); // 4685\n\t\tdaySegCalcHSides(segs); // 4686\n\t\tdaySegSetWidths(segs); // 4687\n\t\tdaySegCalcHeights(segs); // 4688\n\t\trowDivs = getRowDivs(); // 4689\n\t\t// set row heights, calculate event tops (in relation to row top) // 4690\n\t\tfor (rowI=0; rowI<rowCnt; rowI++) { // 4691\n\t\t\tlevelI = 0; // 4692\n\t\t\tcolHeights = []; // 4693\n\t\t\tfor (j=0; j<colCnt; j++) { // 4694\n\t\t\t\tcolHeights[j] = 0; // 4695\n\t\t\t} // 4696\n\t\t\twhile (i<segCnt && (seg = segs[i]).row == rowI) { // 4697\n\t\t\t\t// loop through segs in a row // 4698\n\t\t\t\ttop = arrayMax(colHeights.slice(seg.startCol, seg.endCol)); // 4699\n\t\t\t\tseg.top = top; // 4700\n\t\t\t\ttop += seg.outerHeight; // 4701\n\t\t\t\tfor (k=seg.startCol; k<seg.endCol; k++) { // 4702\n\t\t\t\t\tcolHeights[k] = top; // 4703\n\t\t\t\t} // 4704\n\t\t\t\ti++; // 4705\n\t\t\t} // 4706\n\t\t\trowDivs[rowI].height(arrayMax(colHeights)); // 4707\n\t\t} // 4708\n\t\tdaySegSetTops(segs, getRowTops(rowDivs)); // 4709\n\t} // 4710", "title": "" }, { "docid": "dc8a47bbd1f4a4bf169de3068369eff0", "score": "0.54233634", "text": "get events() {\n if (!this._events) {\n this._events = []\n for (let ev of this.children) {\n if (ev.hasAttribute('start-date') && ev.hasAttribute('end-date')) {\n let sd = new Date(ev.getAttribute('start-date'))\n let ed = new Date(ev.getAttribute('end-date'))\n // Make certain that the date objects are valid\n if (!isNaN(sd.getTime()) && !isNaN(ed.getTime())) {\n \n // Now, make sure that the event doesn't span a week boundary. Split it into multiple events.\n let max = new Date(sd)\n max.setDate(max.getDate() + 7 - max.getDay())\n max.setHours(0,0,0,0)\n if (ed < max) {\n this._events.push({\n 'el': ev,\n 'slot': this.getSlot(ev),\n 'sd': sd,\n 'ed': ed,\n 'multiday': ed - sd > ONEDAY,\n 'duration': ed - sd\n })\n } else {\n console.error(ev, new Error(\"Events in a grid-calendar cannot span from one week to another. Please split it into multiple events.\"))\n }\n } else {\n console.error(ev, new Error(\"Event doesn't have valid a start-date or it doesn't have a valid end-date\"))\n }\n }\n }\n\n // Sort our events into the proper order...\n this._events.sort((a, b) => {\n // Note: I believe that there is some redundancy and error in this sorting. I'll need to play around with it \n // for a while to get something that works most, if not all, of the time. I just don't have a good enough\n // grasp of the pertinent variables. This is too complex for me to fully reason out so I'm falling back onto \n // trial and error.\n if (a.multiday && !b.multiday) {\n return -1\n } else if (b.multiday && !a.multiday) {\n return 1\n } else if (a.multiday && b.multiday) {\n // Which multiday event should go first\n return a.sd - b.sd // Whichever comes first?\n } else {\n if (a.ed < b.sd) {\n return -1\n } else if (b.ed < a.sd) {\n return 1\n } else { // They overlap at least some\n return a.sd - b.sd\n }\n }\n })\n }\n return this._events\n }", "title": "" }, { "docid": "123c690ad35f3c4c8a53041b817bac24", "score": "0.5369047", "text": "sliceEventRanges(eventRanges, extraArgs) {\n let segs = [];\n for (let eventRange of eventRanges) {\n segs.push(...this.sliceEventRange(eventRange, extraArgs));\n }\n return segs;\n }", "title": "" }, { "docid": "6c7bc234eb087e3719dc0096ac07f5c7", "score": "0.5278245", "text": "function sliceSegs(events, visEventEnds, start, end) { // 1671\n\tvar segs = [], // 1672\n\t\ti, len=events.length, event, // 1673\n\t\teventStart, eventEnd, // 1674\n\t\tsegStart, segEnd, // 1675\n\t\tisStart, isEnd; // 1676\n\tfor (i=0; i<len; i++) { // 1677\n\t\tevent = events[i]; // 1678\n\t\teventStart = event.start; // 1679\n\t\teventEnd = visEventEnds[i]; // 1680\n\t\tif (eventEnd > start && eventStart < end) { // 1681\n\t\t\tif (eventStart < start) { // 1682\n\t\t\t\tsegStart = cloneDate(start); // 1683\n\t\t\t\tisStart = false; // 1684\n\t\t\t}else{ // 1685\n\t\t\t\tsegStart = eventStart; // 1686\n\t\t\t\tisStart = true; // 1687\n\t\t\t} // 1688\n\t\t\tif (eventEnd > end) { // 1689\n\t\t\t\tsegEnd = cloneDate(end); // 1690\n\t\t\t\tisEnd = false; // 1691\n\t\t\t}else{ // 1692\n\t\t\t\tsegEnd = eventEnd; // 1693\n\t\t\t\tisEnd = true; // 1694\n\t\t\t} // 1695\n\t\t\tsegs.push({ // 1696\n\t\t\t\tevent: event, // 1697\n\t\t\t\tstart: segStart, // 1698\n\t\t\t\tend: segEnd, // 1699\n\t\t\t\tisStart: isStart, // 1700\n\t\t\t\tisEnd: isEnd, // 1701\n\t\t\t\tmsLength: segEnd - segStart // 1702\n\t\t\t}); // 1703\n\t\t} // 1704\n\t} // 1705\n\treturn segs.sort(segCmp); // 1706\n} // 1707", "title": "" }, { "docid": "1b7b34f68d51dc9d22fddafcd800931b", "score": "0.5266863", "text": "sliceEventRanges(eventRanges, extraArgs) {\n let segs = [];\n for (let eventRange of eventRanges) {\n segs.push(...this.sliceEventRange(eventRange, extraArgs));\n }\n return segs;\n }", "title": "" }, { "docid": "68815739ebeed6d5d4c4e1bf81321384", "score": "0.52348596", "text": "_alterEventsForDemo() {\n const thisMonth = new Date().getMonth() + 1;\n const thisYear = new Date().getFullYear();\n const thisMonthZeroAdded = thisMonth < 10 ? '0' + thisMonth : thisMonth;\n this.events.map((event) => {\n if (event.start) {\n let startArray = event.start.split('-');\n startArray[0] = thisYear;\n startArray[1] = thisMonthZeroAdded;\n event.start = startArray.join('-');\n }\n if (event.end) {\n let endArray = event.end.split('-');\n endArray[0] = thisYear;\n endArray[1] = thisMonthZeroAdded;\n event.end = endArray.join('-');\n }\n });\n }", "title": "" }, { "docid": "6952ec7d0ee0e858a0e5249cdba60c30", "score": "0.5198003", "text": "sortThingsOut() {\n this.event.sessions.forEach(session => {\n session.schedule.forEach(instance => {\n instance.time.days = this.event.days;\n });\n });\n }", "title": "" }, { "docid": "8389a64a1834aefe33908662b4a39328", "score": "0.5188322", "text": "events( start, end, timezone, callback ) {\n\n // GET THIS INDIVIDUAL STUDENT'S CALENDAR\n // EXPIRED EVENTS NOT SHOWN\n let data = Events.find({ $and: [ {$where: function(){ return moment(this.end).isSameOrAfter(moment())}},\n {students: Meteor.userId() } ] \n }).fetch().map( ( event ) => {\n\n //student can't edit\n event.editable = false; // !isPast( event.start );\n return event;\n });\n \n if ( data ) {\n callback( data );\n }\n }", "title": "" }, { "docid": "8cc7dbd5ebfacde52ab968abc18451af", "score": "0.5131358", "text": "get validFamilyEvents() { return [\n ]}", "title": "" }, { "docid": "1f3b2adef5dc0f22e77a5fbcf44d6521", "score": "0.5103565", "text": "extendEventsProp(events, endHour, beginningHour, stepMinute) {\n const extendedEvents = _.cloneDeep(events)\n const timeSlotsNumber = (endHour - beginningHour) * (60 / stepMinute) + 1\n const slotsEvents = _.times(timeSlotsNumber, () => Array.apply(null, Array(extendedEvents.length)))\n\n extendedEvents.forEach((event, eventIndex) => {\n event.startSlotIndex = Math.floor(event.start / stepMinute)\n event.endSlotIndex = Math.ceil((event.start + event.duration) / stepMinute)\n event.columnsNumber = 1\n\n let toEventIndex = 0\n\n for (let slotIndex = event.startSlotIndex; slotIndex < event.endSlotIndex; slotIndex++) {\n if (slotsEvents[slotIndex][toEventIndex] !== undefined)\n toEventIndex = slotsEvents[slotIndex].indexOf(undefined, toEventIndex)\n }\n\n for (let slotIndex = event.startSlotIndex; slotIndex < event.endSlotIndex; slotIndex++) {\n slotsEvents[slotIndex][toEventIndex] = eventIndex\n }\n })\n\n slotsEvents.forEach((slotEvents, slotEventsI) => {\n slotEvents.forEach((eventIndex, eventNumber) => {\n if (eventIndex !== undefined) {\n extendedEvents[eventIndex].number = eventNumber\n const slotEventsLength = _.findLastIndex(slotEvents, event => event !== undefined) + 1\n extendedEvents[eventIndex].columnsNumber = Math.max(slotEventsLength, extendedEvents[eventIndex].columnsNumber)\n }\n })\n })\n\n this.setState({ events: extendedEvents })\n }", "title": "" }, { "docid": "2b3ecee8fa522e74619019566e43c2b3", "score": "0.50639987", "text": "setEventColumns() {\n /**\n * Array of end times associated to a column (represented by zero based index). This is used to store previous event\n * positions within columns.\n *\n * For example, `eventMap[0] = 120` equates to the first column containing an event with an end time of 120.\n *\n * This information is used to determine if our next event can be placed in the same column or requires a new one.\n * If the current event's start time is later than all the end times in the array, we are essentially starting a\n * new row.\n *\n * @type {Array}\n */\n let eventMap = [];\n\n this.sortedEvents.forEach((event, index) => {\n const startTime = event.starts_at;\n const endTime = event.starts_at + event.duration;\n\n // If eventMap is empty, we need a first column.\n if (!eventMap.length) {\n this.eventColPositions[index] = eventMap.push(endTime);\n this.setColTotals(index, eventMap);\n return;\n }\n\n const latestEndTime = eventMap.reduce((acc, item) => item > acc ? item : acc);\n const earliestEndTime = eventMap.reduce((acc, item) => item < acc ? item : acc);\n\n // If start time > = all end times up to this point, start a new row.\n if (startTime >= latestEndTime) {\n // Set col totals first as we need to capture length of eventMap prior to starting a new row\n this.setColTotals(index, eventMap, true);\n eventMap = [];\n this.eventColPositions[index] = eventMap.push(endTime);\n\n // We need to set col totals again in case this is the last item in the array.\n this.setColTotals(index, eventMap);\n return;\n }\n\n // If start time < earliest end time, add a column.\n if (startTime < earliestEndTime) {\n this.eventColPositions[index] = eventMap.push(endTime);\n this.setColTotals(index, eventMap);\n return;\n }\n\n // Loop through eventMap to find lowest value (end time) < start time and assign event to that column.\n const position = eventMap.reduce((acc, endTime, colIndex) => endTime <= startTime ? colIndex : acc, 1);\n eventMap[position] = endTime;\n this.eventColPositions[index] = position + 1; // adj for zero based index.\n this.setColTotals(index, eventMap);\n })\n }", "title": "" }, { "docid": "7b7dcbfdbdbf358b0c125401f298226a", "score": "0.505362", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\tclasses,\n\t\t\ttop, bottom,\n\t\t\tcolI, levelI, forward,\n\t\t\tleftmost,\n\t\t\tavailWidth,\n\t\t\touterWidth,\n\t\t\tleft,\n\t\t\thtml='',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\tvsideCache={},\n\t\t\thsideCache={},\n\t\t\tkey, val,\n\t\t\ttitleElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\trtl, dis, dit,\n\t\t\tcolCnt = getColCnt();\n\t\t\t\n\t\tif (rtl = opt('isRTL')) {\n\t\t\tdis = -1;\n\t\t\tdit = colCnt - 1;\n\t\t}else{\n\t\t\tdis = 1;\n\t\t\tdit = 0;\n\t\t}\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolI = seg.col;\n\t\t\tlevelI = seg.level;\n\t\t\tforward = seg.forward || 0;\n\t\t\tleftmost = colContentLeft(colI*dis + dit);\n\t\t\tavailWidth = colContentRight(colI*dis + dit) - leftmost;\n\t\t\tavailWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS\n\t\t\tif (levelI) {\n\t\t\t\t// indented and thin\n\t\t\t\touterWidth = availWidth / (levelI + forward + 1);\n\t\t\t}else{\n\t\t\t\tif (forward) {\n\t\t\t\t\t// moderately wide, aligned left still\n\t\t\t\t\touterWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =\n\t\t\t\t}else{\n\t\t\t\t\t// can be entire width, aligned left\n\t\t\t\t\touterWidth = availWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tleft = leftmost + // leftmost possible\n\t\t\t\t(availWidth / (levelI + forward + 1) * levelI) // indentation\n\t\t\t\t* dis + (rtl ? availWidth - outerWidth : 0); // rtl\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = outerWidth;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tval = vsideCache[key = seg.key = cssKey(eventElement[0])];\n\t\t\t\tseg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val;\n\t\t\t\tval = hsideCache[key];\n\t\t\t\tseg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val;\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title');\n\t\t\t\tif (titleElement.length) {\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "fb5ca68d9a4c459874905be95449f8cb", "score": "0.5053424", "text": "function computeSegVerticals(segs, dayDate, slatCoords, eventMinHeight) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n seg.top = slatCoords.computeDateTop(seg.start, dayDate);\n seg.bottom = Math.max(seg.top + (eventMinHeight || 0), // yuck\n slatCoords.computeDateTop(seg.end, dayDate));\n }\n}", "title": "" }, { "docid": "6fbadeb49da89ef99b6d2334d2da624d", "score": "0.5052839", "text": "get validSpecificEvents() { return [\n ]}", "title": "" }, { "docid": "43110b0e02c6cf867b4ad86a543cfd2b", "score": "0.5046009", "text": "function computeSegVerticals(segs, dayDate, slatCoords, eventMinHeight) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n seg.top = slatCoords.computeDateTop(seg.start, dayDate);\n seg.bottom = Math.max(seg.top + (eventMinHeight || 0), // yuck\n slatCoords.computeDateTop(seg.end, dayDate));\n }\n }", "title": "" }, { "docid": "4f6fbaf3b6f301759874670f8aaa9f8c", "score": "0.5005562", "text": "function eventsZeichnen(){\n\t//zeichnet alle events aus der eventListe an der richtigen position\n\tvar posYZaehler=0;\n\tvar lastMilestoneYear=0;\n\tvar counterSameYearMS=0;\n\tfor(i = 0; i < eventListe.length; i++){\n\t\t\n\t\tvar e = eventListe[i];\n\n\t\tif(kategorieAktiv(e.kategorie) == true){\n\t\t\t//Position & Groesse Berechnen\n\t\t\tvar start = getDrawnY(e.start-startjahr);\n\t\t\tvar size = getDrawnY(e.end-e.start)-heightY+2;\n\t\t\tvar posX = (width-lMitte.dicke)/2-20-20*e.ebene;\n\t\t\t\n\t\t\t//Position fuer den Text\n\t\t\tvar posText = posX-200;\n\t\t\tvar posTextY = 20;\n\t\t\t\n\t\t\t/*\n\t\t\tif(e.start == e.end){\n\t\t\t\tposX = (width-lMitte.dicke)/2+60\n\t\t\t\t\n\t\t\t\tposText = posX+30\n\t\t\t\tposTextY = 0;\n\t\t\t}*/\n\t\t\tif(e.start == e.end){\n\t\t\t\t\tvar markersize=10;\n\t\t\t\t\tctx.fillStyle = e.color;\n\t\t\t\t \tctx.beginPath();\n\t\t\t\t\tctx.arc(posX, start, markersize, 0, Math.PI*2, true);\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tctx.fill(); \n\t\t\t\t\t\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(posX,start+markersize);\n\t\t\t\t\tctx.lineTo(posX+markersize*3,start);\n\t\t\t\t\tctx.lineTo(posX,start-markersize);\n\t\t\t\t\tctx.fill();\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t\n\t\t\t\tdrawShadow(posX,start,10,size);\n\t\t\t\tctx.fillStyle = e.color;\n\t\t\t\tctx.fillRect(posX-1,start,12,2) // -- Start-segment\n\t\t\t\tctx.fillRect(posX,start,10,size); // || Middle-segment\n\t\t\t\tctx.fillRect(posX-1,start+size-2,12,2) // -- End-segment\n\t\t\t}\n\t\t\t\n\t\t\tstart = start+size/2;\n\t\t\t\n\t\n\t\t\tif(e.start!=e.end){\n\t\t\t\tstandardText(e.start + \"-\" + e.end,20,start);\n\t\t\t\tstart+=20;\n\t\t\t}else{\n\t\t\t\tif(lastMilestoneYear==e.start){\n\t\t\t\t\tcounterSameYearMS++;\n\t\t\t\t\tstart+=10*counterSameYearMS;\n\t\t\t\t}else{\n\t\t\t\t\tcounterSameYearMS=0;\n\t\t\t\t}\n\t\t\t\tlastMilestoneYear=e.start;\n\t\t\t}\n\t\t\tif(ausgewaehltesEvent == i){\n\t\t\t\tgrosserText(e.text, 20,start)\n\t\t\t}else{\n\t\t\t\tstandardText(e.text, 20,start)\n\t\t\t\t\n\t\t\t}\n\t\t\tposYZaehler++;\n\t\t}\n\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "445a8fcaff4926ca286d5f7a1163d4c0", "score": "0.49996427", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\tclasses,\n\t\t\ttop, bottom,\n\t\t\tcolI, levelI, forward,\n\t\t\tleftmost,\n\t\t\tavailWidth,\n\t\t\touterWidth,\n\t\t\tleft,\n\t\t\thtml='',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\tvsideCache={},\n\t\t\thsideCache={},\n\t\t\tkey, val,\n\t\t\tcontentElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\trtl, dis, dit,\n\t\t\tcolCnt = getColCnt();\n\t\t\t\n\t\tif (rtl = opt('isRTL')) {\n\t\t\tdis = -1;\n\t\t\tdit = colCnt - 1;\n\t\t}else{\n\t\t\tdis = 1;\n\t\t\tdit = 0;\n\t\t}\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolI = seg.col;\n\t\t\tlevelI = seg.level;\n\t\t\tforward = seg.forward || 0;\n\t\t\tleftmost = colContentLeft(colI*dis + dit);\n\t\t\tavailWidth = colContentRight(colI*dis + dit) - leftmost;\n\t\t\tavailWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS\n\t\t\tif (levelI) {\n\t\t\t\t// indented and thin\n\t\t\t\touterWidth = availWidth / (levelI + forward + 1);\n\t\t\t}else{\n\t\t\t\tif (forward) {\n\t\t\t\t\t// moderately wide, aligned left still\n\t\t\t\t\touterWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =\n\t\t\t\t}else{\n\t\t\t\t\t// can be entire width, aligned left\n\t\t\t\t\touterWidth = availWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tleft = leftmost + // leftmost possible\n\t\t\t\t(availWidth / (levelI + forward + 1) * levelI) // indentation\n\t\t\t\t* dis + (rtl ? availWidth - outerWidth : 0); // rtl\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = outerWidth;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tval = vsideCache[key = seg.key = cssKey(eventElement[0])];\n\t\t\t\tseg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val;\n\t\t\t\tval = hsideCache[key];\n\t\t\t\tseg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val;\n\t\t\t\tcontentElement = eventElement.find('div.fc-event-content');\n\t\t\t\tif (contentElement.length) {\n\t\t\t\t\tseg.contentTop = contentElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time header\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "445a8fcaff4926ca286d5f7a1163d4c0", "score": "0.49996427", "text": "function renderSlotSegs(segs, modifiedEventId) {\n\t\n\t\tvar i, segCnt=segs.length, seg,\n\t\t\tevent,\n\t\t\tclasses,\n\t\t\ttop, bottom,\n\t\t\tcolI, levelI, forward,\n\t\t\tleftmost,\n\t\t\tavailWidth,\n\t\t\touterWidth,\n\t\t\tleft,\n\t\t\thtml='',\n\t\t\teventElements,\n\t\t\teventElement,\n\t\t\ttriggerRes,\n\t\t\tvsideCache={},\n\t\t\thsideCache={},\n\t\t\tkey, val,\n\t\t\tcontentElement,\n\t\t\theight,\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(),\n\t\t\trtl, dis, dit,\n\t\t\tcolCnt = getColCnt();\n\t\t\t\n\t\tif (rtl = opt('isRTL')) {\n\t\t\tdis = -1;\n\t\t\tdit = colCnt - 1;\n\t\t}else{\n\t\t\tdis = 1;\n\t\t\tdit = 0;\n\t\t}\n\t\t\t\n\t\t// calculate position/dimensions, create html\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\ttop = timePosition(seg.start, seg.start);\n\t\t\tbottom = timePosition(seg.start, seg.end);\n\t\t\tcolI = seg.col;\n\t\t\tlevelI = seg.level;\n\t\t\tforward = seg.forward || 0;\n\t\t\tleftmost = colContentLeft(colI*dis + dit);\n\t\t\tavailWidth = colContentRight(colI*dis + dit) - leftmost;\n\t\t\tavailWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS\n\t\t\tif (levelI) {\n\t\t\t\t// indented and thin\n\t\t\t\touterWidth = availWidth / (levelI + forward + 1);\n\t\t\t}else{\n\t\t\t\tif (forward) {\n\t\t\t\t\t// moderately wide, aligned left still\n\t\t\t\t\touterWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =\n\t\t\t\t}else{\n\t\t\t\t\t// can be entire width, aligned left\n\t\t\t\t\touterWidth = availWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tleft = leftmost + // leftmost possible\n\t\t\t\t(availWidth / (levelI + forward + 1) * levelI) // indentation\n\t\t\t\t* dis + (rtl ? availWidth - outerWidth : 0); // rtl\n\t\t\tseg.top = top;\n\t\t\tseg.left = left;\n\t\t\tseg.outerWidth = outerWidth;\n\t\t\tseg.outerHeight = bottom - top;\n\t\t\thtml += slotSegHtml(event, seg);\n\t\t}\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html()\n\t\teventElements = slotSegmentContainer.children();\n\t\t\n\t\t// retrieve elements, run through eventRender callback, bind event handlers\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tevent = seg.event;\n\t\t\teventElement = $(eventElements[i]); // faster than eq()\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement);\n\t\t\tif (triggerRes === false) {\n\t\t\t\teventElement.remove();\n\t\t\t}else{\n\t\t\t\tif (triggerRes && triggerRes !== true) {\n\t\t\t\t\teventElement.remove();\n\t\t\t\t\teventElement = $(triggerRes)\n\t\t\t\t\t\t.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: seg.top,\n\t\t\t\t\t\t\tleft: seg.left\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.appendTo(slotSegmentContainer);\n\t\t\t\t}\n\t\t\t\tseg.element = eventElement;\n\t\t\t\tif (event._id === modifiedEventId) {\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg);\n\t\t\t\t}else{\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind\n\t\t\t\t}\n\t\t\t\treportEventElement(event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg);\n\t\t\n\t\t// record event sides and title positions\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\tval = vsideCache[key = seg.key = cssKey(eventElement[0])];\n\t\t\t\tseg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val;\n\t\t\t\tval = hsideCache[key];\n\t\t\t\tseg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val;\n\t\t\t\tcontentElement = eventElement.find('div.fc-event-content');\n\t\t\t\tif (contentElement.length) {\n\t\t\t\t\tseg.contentTop = contentElement[0].offsetTop;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// set all positions/dimensions at once\n\t\tfor (i=0; i<segCnt; i++) {\n\t\t\tseg = segs[i];\n\t\t\tif (eventElement = seg.element) {\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px';\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides);\n\t\t\t\teventElement[0].style.height = height + 'px';\n\t\t\t\tevent = seg.event;\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) {\n\t\t\t\t\t// not enough room for title, put it in the time header\n\t\t\t\t\teventElement.find('div.fc-event-time')\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title);\n\t\t\t\t\teventElement.find('div.fc-event-title')\n\t\t\t\t\t\t.remove();\n\t\t\t\t}\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement);\n\t\t\t}\n\t\t}\n\t\t\t\t\t\n\t}", "title": "" }, { "docid": "17f0e4bc0c613c919ea97abcc163e150", "score": "0.49755555", "text": "function renderEvents(events, modifiedEventId) { // 2715\n\t\treportEvents(events); // 2716\n\t\trenderDaySegs(compileSegs(events), modifiedEventId); // 2717\n\t\ttrigger('eventAfterAllRender'); // 2718\n\t} // 2719", "title": "" }, { "docid": "35983b513f9c1e9d494a1fbefdbeeff8", "score": "0.49738228", "text": "function secondHandler(e) {\n e.preventDefault();\n\n if (!e.target.date) {\n return false;\n }\n\n var difference,\n selectedDate = moment(e.target.date);\n\n if (selectedDate.calendar() === range.start.calendar()) {\n return false;\n }\n if (selectedDate.isAfter(range.end)) {\n difference = range.end.diff(range.start);\n range.start = selectedDate.clone();\n range.end = range.start.clone().add(difference, 'milliseconds');\n }\n range.start = selectedDate.clone();\n that.render();\n that.trigger('rangeChanged', [[range.start.clone()._d, range.end.clone()._d]]);\n }", "title": "" }, { "docid": "09b42d69b9f75bd99d1de4211ff9e85d", "score": "0.4955402", "text": "function limitEvents(hiddenCnts, segIsHidden, colPlacements, _moreLinkConsumesLevel, isPlacementInBounds) {\n var colCnt = hiddenCnts.length;\n var segIsVisible = {}; // TODO: instead, use segIsHidden with true/false?\n var visibleColPlacements = []; // will mirror colPlacements\n for (var col = 0; col < colCnt; col += 1) {\n visibleColPlacements.push([]);\n }\n for (var col = 0; col < colCnt; col += 1) {\n var placements = colPlacements[col];\n var level = 0;\n for (var _i = 0, placements_2 = placements; _i < placements_2.length; _i++) {\n var placement = placements_2[_i];\n if (isPlacementInBounds(placement, level)) {\n recordVisible(placement);\n }\n else {\n recordHidden(placement, level, _moreLinkConsumesLevel);\n }\n // only considered a level if the seg had height\n if (placement.top !== placement.bottom) {\n level += 1;\n }\n }\n }\n function recordVisible(placement) {\n var seg = placement.seg;\n var instanceId = seg.eventRange.instance.instanceId;\n if (!segIsVisible[instanceId]) {\n segIsVisible[instanceId] = true;\n for (var col = seg.firstCol; col <= seg.lastCol; col += 1) {\n var destPlacements = visibleColPlacements[col];\n var newPosition = 0;\n // insert while keeping top sorted in each column\n while (newPosition < destPlacements.length &&\n placement.top >= destPlacements[newPosition].top) {\n newPosition += 1;\n }\n destPlacements.splice(newPosition, 0, placement);\n }\n }\n }\n function recordHidden(placement, currentLevel, moreLinkConsumesLevel) {\n var seg = placement.seg;\n var instanceId = seg.eventRange.instance.instanceId;\n if (!segIsHidden[instanceId]) {\n segIsHidden[instanceId] = true;\n for (var col = seg.firstCol; col <= seg.lastCol; col += 1) {\n hiddenCnts[col] += 1;\n var hiddenCnt = hiddenCnts[col];\n if (moreLinkConsumesLevel && hiddenCnt === 1 && currentLevel > 0) {\n var doomedLevel = currentLevel - 1;\n while (visibleColPlacements[col].length > doomedLevel) {\n recordHidden(visibleColPlacements[col].pop(), // removes\n visibleColPlacements[col].length, // will execute after the pop. will be the index of the removed placement\n false);\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "65a6733f6d3155ceb231431af192c853", "score": "0.49497876", "text": "function limitEvents(hiddenCnts, segIsHidden, colPlacements, _moreLinkConsumesLevel, isPlacementInBounds) {\n var colCnt = hiddenCnts.length;\n var segIsVisible = {}; // TODO: instead, use segIsHidden with true/false?\n var visibleColPlacements = []; // will mirror colPlacements\n for (var col = 0; col < colCnt; col++) {\n visibleColPlacements.push([]);\n }\n for (var col = 0; col < colCnt; col++) {\n var placements = colPlacements[col];\n var level = 0;\n for (var _i = 0, placements_2 = placements; _i < placements_2.length; _i++) {\n var placement = placements_2[_i];\n if (isPlacementInBounds(placement, level)) {\n recordVisible(placement);\n }\n else {\n recordHidden(placement, level, _moreLinkConsumesLevel);\n }\n // only considered a level if the seg had height\n if (placement.top !== placement.bottom) {\n level++;\n }\n }\n }\n function recordVisible(placement) {\n var seg = placement.seg;\n var instanceId = seg.eventRange.instance.instanceId;\n if (!segIsVisible[instanceId]) {\n segIsVisible[instanceId] = true;\n for (var col = seg.firstCol; col <= seg.lastCol; col++) {\n visibleColPlacements[col].push(placement);\n }\n }\n }\n function recordHidden(placement, currentLevel, moreLinkConsumesLevel) {\n var seg = placement.seg;\n var instanceId = seg.eventRange.instance.instanceId;\n if (!segIsHidden[instanceId]) {\n segIsHidden[instanceId] = true;\n for (var col = seg.firstCol; col <= seg.lastCol; col++) {\n var hiddenCnt = ++hiddenCnts[col];\n if (moreLinkConsumesLevel && hiddenCnt === 1) {\n var doomedLevel = currentLevel - 1;\n while (visibleColPlacements[col].length > doomedLevel) {\n recordHidden(visibleColPlacements[col].pop(), // removes\n visibleColPlacements[col].length, // will execute after the pop. will be the index of the removed placement\n false);\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "8b5cf0edba9bfebc71173c91c909a291", "score": "0.49362156", "text": "splitEvent(event) {\n let eventList = [];\n let hours = moment(event.calendarInfo.start).hour(); //Gets start time.\n let delta = moment(event.calendarInfo.end).subtract(hours, 'hours'); //Event duration (delta) is found by subtracting start time from end time.\n if (this.state.isRecurrent.value === \"recurring\") { //Converts the recurrence option (string) to its equivalent number (integer).\n let recurrenceWeeks = 0;\n if (this.state.recurrence === \"Weekly\") {\n recurrenceWeeks = 1;\n }\n else if (this.state.recurrence === \"Biweekly\") {\n recurrenceWeeks = 2;\n }\n else if (this.state.recurrence === \"Triweekly\") {\n recurrenceWeeks = 3;\n }\n else if (this.state.recurrence === \"Monthly\") {\n recurrenceWeeks = 4;\n }\n let i = 0;\n outer:\n while (true) {\n for (let z = 0; z < this.state.daysSelected.length; z++) {\n let dayINeed = this.state.daysSelected[z];\n if (new Date(moment().add(i, 'weeks').isoWeekday(this.weekDaysToNumbers(dayINeed))) > new Date(moment(event.calendarInfo.end))) {\n break outer;\n } else {\n let s2Date = moment(event.calendarInfo.start).add(i, 'weeks').isoWeekday(this.weekDaysToNumbers(dayINeed));\n let e2Date = moment(event.calendarInfo.start).add(i, 'weeks').isoWeekday(this.weekDaysToNumbers(dayINeed)).add(delta.hours(), \"hours\").add(delta.minutes(), \"minutes\");\n let a2Date = moment(event.calendarInfo.start).add(i, 'weeks').isoWeekday(this.weekDaysToNumbers(dayINeed)).add(1, 'days');\n if (s2Date >= moment(event.calendarInfo.start)) {\n let newEvent = {\n capacity: event.capacity,\n description: event.description,\n location: event.location,\n allDay: event.allDay,\n activationDay: new Date(a2Date.format()),\n instructor: event.instructor,\n calendarInfo: {\n title: event.calendarInfo.title,\n allDay: false,\n start: new Date(s2Date.format()),\n end: new Date(e2Date.format())\n }\n }\n eventList = eventList.concat(newEvent);\n }\n }\n }\n i += recurrenceWeeks;\n }\n return eventList;\n } else {\n return [event];\n }\n }", "title": "" }, { "docid": "87a8170176a7b3eedc1da9f0c13d1fe0", "score": "0.49216613", "text": "function renderSlotSegs(segs, modifiedEventId) { // 3894\n\t // 3895\n\t\tvar i, segCnt=segs.length, seg, // 3896\n\t\t\tevent, // 3897\n\t\t\tclasses, // 3898\n\t\t\ttop, bottom, // 3899\n\t\t\tcolI, levelI, forward, // 3900\n\t\t\tleftmost, // 3901\n\t\t\tavailWidth, // 3902\n\t\t\touterWidth, // 3903\n\t\t\tleft, // 3904\n\t\t\thtml='', // 3905\n\t\t\teventElements, // 3906\n\t\t\teventElement, // 3907\n\t\t\ttriggerRes, // 3908\n\t\t\tvsideCache={}, // 3909\n\t\t\thsideCache={}, // 3910\n\t\t\tkey, val, // 3911\n\t\t\ttitleElement, // 3912\n\t\t\theight, // 3913\n\t\t\tslotSegmentContainer = getSlotSegmentContainer(), // 3914\n\t\t\trtl, dis, dit, // 3915\n\t\t\tcolCnt = getColCnt(); // 3916\n\t\t\t // 3917\n\t\tif (rtl = opt('isRTL')) { // 3918\n\t\t\tdis = -1; // 3919\n\t\t\tdit = colCnt - 1; // 3920\n\t\t}else{ // 3921\n\t\t\tdis = 1; // 3922\n\t\t\tdit = 0; // 3923\n\t\t} // 3924\n\t\t\t // 3925\n\t\t// calculate position/dimensions, create html // 3926\n\t\tfor (i=0; i<segCnt; i++) { // 3927\n\t\t\tseg = segs[i]; // 3928\n\t\t\tevent = seg.event; // 3929\n\t\t\ttop = timePosition(seg.start, seg.start); // 3930\n\t\t\tbottom = timePosition(seg.start, seg.end); // 3931\n\t\t\tcolI = seg.col; // 3932\n\t\t\tlevelI = seg.level; // 3933\n\t\t\tforward = seg.forward || 0; // 3934\n\t\t\tleftmost = colContentLeft(colI*dis + dit); // 3935\n\t\t\tavailWidth = colContentRight(colI*dis + dit) - leftmost; // 3936\n\t\t\tavailWidth = Math.min(availWidth-6, availWidth*.95); // TODO: move this to CSS // 3937\n\t\t\tif (levelI) { // 3938\n\t\t\t\t// indented and thin // 3939\n\t\t\t\touterWidth = availWidth / (levelI + forward + 1); // 3940\n\t\t\t}else{ // 3941\n\t\t\t\tif (forward) { // 3942\n\t\t\t\t\t// moderately wide, aligned left still // 3943\n\t\t\t\t\touterWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer = // 3944\n\t\t\t\t}else{ // 3945\n\t\t\t\t\t// can be entire width, aligned left // 3946\n\t\t\t\t\touterWidth = availWidth; // 3947\n\t\t\t\t} // 3948\n\t\t\t} // 3949\n\t\t\tleft = leftmost + // leftmost possible // 3950\n\t\t\t\t(availWidth / (levelI + forward + 1) * levelI) // indentation // 3951\n\t\t\t\t* dis + (rtl ? availWidth - outerWidth : 0); // rtl // 3952\n\t\t\tseg.top = top; // 3953\n\t\t\tseg.left = left; // 3954\n\t\t\tseg.outerWidth = outerWidth; // 3955\n\t\t\tseg.outerHeight = bottom - top; // 3956\n\t\t\thtml += slotSegHtml(event, seg); // 3957\n\t\t} // 3958\n\t\tslotSegmentContainer[0].innerHTML = html; // faster than html() // 3959\n\t\teventElements = slotSegmentContainer.children(); // 3960\n\t\t // 3961\n\t\t// retrieve elements, run through eventRender callback, bind event handlers // 3962\n\t\tfor (i=0; i<segCnt; i++) { // 3963\n\t\t\tseg = segs[i]; // 3964\n\t\t\tevent = seg.event; // 3965\n\t\t\teventElement = $(eventElements[i]); // faster than eq() // 3966\n\t\t\ttriggerRes = trigger('eventRender', event, event, eventElement); // 3967\n\t\t\tif (triggerRes === false) { // 3968\n\t\t\t\teventElement.remove(); // 3969\n\t\t\t}else{ // 3970\n\t\t\t\tif (triggerRes && triggerRes !== true) { // 3971\n\t\t\t\t\teventElement.remove(); // 3972\n\t\t\t\t\teventElement = $(triggerRes) // 3973\n\t\t\t\t\t\t.css({ // 3974\n\t\t\t\t\t\t\tposition: 'absolute', // 3975\n\t\t\t\t\t\t\ttop: seg.top, // 3976\n\t\t\t\t\t\t\tleft: seg.left // 3977\n\t\t\t\t\t\t}) // 3978\n\t\t\t\t\t\t.appendTo(slotSegmentContainer); // 3979\n\t\t\t\t} // 3980\n\t\t\t\tseg.element = eventElement; // 3981\n\t\t\t\tif (event._id === modifiedEventId) { // 3982\n\t\t\t\t\tbindSlotSeg(event, eventElement, seg); // 3983\n\t\t\t\t}else{ // 3984\n\t\t\t\t\teventElement[0]._fci = i; // for lazySegBind // 3985\n\t\t\t\t} // 3986\n\t\t\t\treportEventElement(event, eventElement); // 3987\n\t\t\t} // 3988\n\t\t} // 3989\n\t\t // 3990\n\t\tlazySegBind(slotSegmentContainer, segs, bindSlotSeg); // 3991\n\t\t // 3992\n\t\t// record event sides and title positions // 3993\n\t\tfor (i=0; i<segCnt; i++) { // 3994\n\t\t\tseg = segs[i]; // 3995\n\t\t\tif (eventElement = seg.element) { // 3996\n\t\t\t\tval = vsideCache[key = seg.key = cssKey(eventElement[0])]; // 3997\n\t\t\t\tseg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val; // 3998\n\t\t\t\tval = hsideCache[key]; // 3999\n\t\t\t\tseg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val; // 4000\n\t\t\t\ttitleElement = eventElement.find('.fc-event-title'); // 4001\n\t\t\t\tif (titleElement.length) { // 4002\n\t\t\t\t\tseg.contentTop = titleElement[0].offsetTop; // 4003\n\t\t\t\t} // 4004\n\t\t\t} // 4005\n\t\t} // 4006\n\t\t // 4007\n\t\t// set all positions/dimensions at once // 4008\n\t\tfor (i=0; i<segCnt; i++) { // 4009\n\t\t\tseg = segs[i]; // 4010\n\t\t\tif (eventElement = seg.element) { // 4011\n\t\t\t\teventElement[0].style.width = Math.max(0, seg.outerWidth - seg.hsides) + 'px'; // 4012\n\t\t\t\theight = Math.max(0, seg.outerHeight - seg.vsides); // 4013\n\t\t\t\teventElement[0].style.height = height + 'px'; // 4014\n\t\t\t\tevent = seg.event; // 4015\n\t\t\t\tif (seg.contentTop !== undefined && height - seg.contentTop < 10) { // 4016\n\t\t\t\t\t// not enough room for title, put it in the time (TODO: maybe make both display:inline instead) // 4017\n\t\t\t\t\teventElement.find('div.fc-event-time') // 4018\n\t\t\t\t\t\t.text(formatDate(event.start, opt('timeFormat')) + ' - ' + event.title); // 4019\n\t\t\t\t\teventElement.find('div.fc-event-title') // 4020\n\t\t\t\t\t\t.remove(); // 4021\n\t\t\t\t} // 4022\n\t\t\t\ttrigger('eventAfterRender', event, event, eventElement); // 4023\n\t\t\t} // 4024\n\t\t} // 4025\n\t\t\t\t\t // 4026\n\t} // 4027", "title": "" }, { "docid": "c6f82f9320e21e07123eccc7d3c46b03", "score": "0.48990834", "text": "function resliceDaySegs(segs, dayDate, colIndex) {\n var dayStart = dayDate;\n var dayEnd = addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign(__assign({}, seg), { firstCol: colIndex, lastCol: colIndex, eventRange: {\n def: eventRange.def,\n ui: __assign(__assign({}, eventRange.ui), { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n}", "title": "" }, { "docid": "7afe6eaf76b56b79dd83d902180f420a", "score": "0.48970598", "text": "function sliceSegs(events, visEventEnds, start, end) {\n\tvar segs = [],\n\t\ti, len=events.length, event,\n\t\teventStart, eventEnd,\n\t\tsegStart, segEnd,\n\t\tisStart, isEnd;\n\tfor (i=0; i<len; i++) {\n\t\tevent = events[i];\n\t\teventStart = event.start;\n\t\teventEnd = visEventEnds[i];\n\t\tif (eventEnd > start && eventStart < end) {\n\t\t\tif (eventStart < start) {\n\t\t\t\tsegStart = cloneDate(start);\n\t\t\t\tisStart = false;\n\t\t\t}else{\n\t\t\t\tsegStart = eventStart;\n\t\t\t\tisStart = true;\n\t\t\t}\n\t\t\tif (eventEnd > end) {\n\t\t\t\tsegEnd = cloneDate(end);\n\t\t\t\tisEnd = false;\n\t\t\t}else{\n\t\t\t\tsegEnd = eventEnd;\n\t\t\t\tisEnd = true;\n\t\t\t}\n\t\t\tsegs.push({\n\t\t\t\tevent: event,\n\t\t\t\tstart: segStart,\n\t\t\t\tend: segEnd,\n\t\t\t\tisStart: isStart,\n\t\t\t\tisEnd: isEnd,\n\t\t\t\tmsLength: segEnd - segStart\n\t\t\t});\n\t\t}\n\t}\n\treturn segs.sort(segCmp);\n}", "title": "" }, { "docid": "7afe6eaf76b56b79dd83d902180f420a", "score": "0.48970598", "text": "function sliceSegs(events, visEventEnds, start, end) {\n\tvar segs = [],\n\t\ti, len=events.length, event,\n\t\teventStart, eventEnd,\n\t\tsegStart, segEnd,\n\t\tisStart, isEnd;\n\tfor (i=0; i<len; i++) {\n\t\tevent = events[i];\n\t\teventStart = event.start;\n\t\teventEnd = visEventEnds[i];\n\t\tif (eventEnd > start && eventStart < end) {\n\t\t\tif (eventStart < start) {\n\t\t\t\tsegStart = cloneDate(start);\n\t\t\t\tisStart = false;\n\t\t\t}else{\n\t\t\t\tsegStart = eventStart;\n\t\t\t\tisStart = true;\n\t\t\t}\n\t\t\tif (eventEnd > end) {\n\t\t\t\tsegEnd = cloneDate(end);\n\t\t\t\tisEnd = false;\n\t\t\t}else{\n\t\t\t\tsegEnd = eventEnd;\n\t\t\t\tisEnd = true;\n\t\t\t}\n\t\t\tsegs.push({\n\t\t\t\tevent: event,\n\t\t\t\tstart: segStart,\n\t\t\t\tend: segEnd,\n\t\t\t\tisStart: isStart,\n\t\t\t\tisEnd: isEnd,\n\t\t\t\tmsLength: segEnd - segStart\n\t\t\t});\n\t\t}\n\t}\n\treturn segs.sort(segCmp);\n}", "title": "" }, { "docid": "7afe6eaf76b56b79dd83d902180f420a", "score": "0.48970598", "text": "function sliceSegs(events, visEventEnds, start, end) {\n\tvar segs = [],\n\t\ti, len=events.length, event,\n\t\teventStart, eventEnd,\n\t\tsegStart, segEnd,\n\t\tisStart, isEnd;\n\tfor (i=0; i<len; i++) {\n\t\tevent = events[i];\n\t\teventStart = event.start;\n\t\teventEnd = visEventEnds[i];\n\t\tif (eventEnd > start && eventStart < end) {\n\t\t\tif (eventStart < start) {\n\t\t\t\tsegStart = cloneDate(start);\n\t\t\t\tisStart = false;\n\t\t\t}else{\n\t\t\t\tsegStart = eventStart;\n\t\t\t\tisStart = true;\n\t\t\t}\n\t\t\tif (eventEnd > end) {\n\t\t\t\tsegEnd = cloneDate(end);\n\t\t\t\tisEnd = false;\n\t\t\t}else{\n\t\t\t\tsegEnd = eventEnd;\n\t\t\t\tisEnd = true;\n\t\t\t}\n\t\t\tsegs.push({\n\t\t\t\tevent: event,\n\t\t\t\tstart: segStart,\n\t\t\t\tend: segEnd,\n\t\t\t\tisStart: isStart,\n\t\t\t\tisEnd: isEnd,\n\t\t\t\tmsLength: segEnd - segStart\n\t\t\t});\n\t\t}\n\t}\n\treturn segs.sort(segCmp);\n}", "title": "" }, { "docid": "3f9e8fcc0b9dd86827bcea81853001b8", "score": "0.4884846", "text": "renderHiddenGroups(hiddenGroups, segs) {\n let { extraDateSpan, dateProfile, todayRange, nowDate, eventSelection, eventDrag, eventResize } = this.props;\n return (h(p, null, hiddenGroups.map((hiddenGroup) => {\n let positionCss = computeSegVStyle(hiddenGroup.span);\n let hiddenSegs = compileSegsFromEntries(hiddenGroup.entries, segs);\n return (h(TimeColMoreLink, { key: buildIsoString(computeEarliestSegStart(hiddenSegs)), hiddenSegs: hiddenSegs, top: positionCss.top, bottom: positionCss.bottom, extraDateSpan: extraDateSpan, dateProfile: dateProfile, todayRange: todayRange, nowDate: nowDate, eventSelection: eventSelection, eventDrag: eventDrag, eventResize: eventResize }));\n })));\n }", "title": "" }, { "docid": "dc19c039ba80f9b39dad2cb7941ce58d", "score": "0.48770615", "text": "updateEvents() {\n let me = this,\n timeAxis = me.timeAxis,\n endTime = timeAxis.getTime(timeAxis.endTime),\n startTime = timeAxis.getTime(timeAxis.startTime),\n totalTime = endTime - startTime,\n date = DateUtil.clone(me.firstColumnDate),\n eventStore = me.eventStore,\n vdom = me.vdom,\n content = me.getVdomContent(),\n j = 0,\n len = eventStore.getCount(),\n column, duration, height, i, record, startHours, top;\n\n // remove previous events from the vdom\n content.cn.forEach(item => item.cn = []);\n\n for (; j < 7; j++) {\n column = content.cn[j];\n\n for (i = 0; i < len; i++) {\n record = eventStore.items[i];\n\n // todo: we need a check for date overlaps => startDate < current day, endDate >= current day\n if (DateUtil.matchDate(date, record.startDate)) {\n if (DateUtil.matchDate(date, record.endDate)) {\n duration = (record.endDate - record.startDate) / 60 / 60 / 1000; // duration in hours\n height = Math.round(duration / totalTime * 100 * 1000) / 1000;\n startHours = (record.startDate.getHours() * 60 + record.startDate.getMinutes()) / 60;\n top = Math.round((startHours - startTime) / totalTime * 100 * 1000) / 1000;\n\n console.log(j, record);\n console.log(top);\n\n column.cn.push({\n cls : ['neo-event'],\n id : me.id + '__' + record[eventStore.keyProperty],\n html: record.title,\n\n style: {\n height: `calc(${height}% - 2px)`,\n top : `calc(${top}% + 1px)`,\n width : 'calc(100% - 1px)' // todo\n }\n });\n }\n }\n }\n\n date.setDate(date.getDate() + 1);\n }\n\n console.log(content);\n me.vdom = vdom;\n }", "title": "" }, { "docid": "0576408c758c2a2cadc101346c56645c", "score": "0.486717", "text": "function addEventsToJTimeTwoDaysBooker(stH,stM,etH,etM,etDp1,bdH,bdM){\n\n startingTimeH = stH;\n startingTimeM = stM;\n endingTimeH = etH;\n endingTimeM = etM;\n endingTimeDayPlusOne = etDp1;\n bookingDurationH = bdH;\n bookingDurationM = bdM;\n\n JBookingElementEvents(stH,'starting-time-hour');\n JBookingElementEvents(stM,'starting-time-minute');\n JBookingElementEvents(etH,'ending-time-hour');\n JBookingElementEvents(etM,'ending-time-minute');\n JBookingElementEvents(etDp1,'ending-time-dayplusone');\n JBookingElementEvents(bdH,'booking-duration-hours');\n JBookingElementEvents(bdM,'booking-duration-minutes');\n\n}", "title": "" }, { "docid": "5c22dd34d5289f22ed05788769781283", "score": "0.48547468", "text": "_eventsArrayDidChange(array, idx, removedCount, addedCount) {\n for (var i = idx; i < idx + addedCount; i++) {\n this.$().fullCalendar('renderEvent', this.createEventObject(array.objectAt(i)));\n }\n }", "title": "" }, { "docid": "145d6e538b7791d643041d480d89c03e", "score": "0.48494184", "text": "function findAllPhaseStartEnd(col) {\n var strucCol = $(\".schedule-segment-week\").length ? $(\".schedule-segment-week:first\").parents('td').index() : 6;\n var structuredArr = findSegmentsInCol(strucCol,'schedule');\n var strucAllBegEnd = [];\n for (var i = 0; i < structuredArr.length; i++) {\n var strucSplit = structuredArr[i].split('_');\n strucAllBegEnd.push(strucSplit[1]+'_'+strucSplit[2]);\n }\n var phaseStartEndArr = [];\n $(\".center-div table.fixed-left-column tr:gt(1)\").find(\"td:eq(\" + col + \")\").each(function () {\n if ($(this).find(\"input.custom-node\").length) {\n //var tdClass = $(this).attr('class');\n var segStartEnd = findSegStartEndByEvent($(this).parent('tr').index(),$(this).index()); //(parentClassArr[1], parentClassArr[2]);\n\n // find type\n var type = '';\n var match = segStartEnd[0] + '_'+ segStartEnd[1];\n if($.inArray(match, strucAllBegEnd) > -1) {\n type = 'structured'; // structured phase\n } else {\n type = 'unstructured'; // unstructured phase\n }\n\n phaseStartEndArr.push({\n type: type,\n beg: parseInt(segStartEnd[0]),\n end: parseInt(segStartEnd[1])\n });\n }\n });\n return phaseStartEndArr;\n}", "title": "" }, { "docid": "faddb88ec8478e04fda7c066baa89b6f", "score": "0.48458678", "text": "function getStyledEvents(_ref7) {\n var unsortedEvents = _ref7.events,\n startAccessor = _ref7.startAccessor,\n endAccessor = _ref7.endAccessor,\n min = _ref7.min,\n totalMin = _ref7.totalMin,\n step = _ref7.step;\n\n var OVERLAP_MULTIPLIER = 0.3;\n var events = sort(unsortedEvents, { startAccessor: startAccessor, endAccessor: endAccessor });\n var helperArgs = { events: events, startAccessor: startAccessor, endAccessor: endAccessor, min: min, totalMin: totalMin, step: step };\n var styledEvents = [];\n var idx = 0;\n\n // One iteration will cover all connected events.\n\n var _loop = function _loop() {\n var siblings = getSiblings(idx, helperArgs);\n\n var _getChildGroups = getChildGroups(idx, idx + siblings.length + 1, helperArgs),\n childGroups = _getChildGroups.childGroups,\n nbrOfChildColumns = _getChildGroups.nbrOfChildColumns;\n\n var nbrOfColumns = Math.max(nbrOfChildColumns, siblings.length) + 1;\n console.log(nbrOfColumns);\n // Set styles to top level events.\n [idx].concat(siblings).forEach(function (eventIdx, siblingIdx) {\n var event = events[eventIdx];\n var style = {};\n\n var _getYStyles = getYStyles(eventIdx, helperArgs),\n top = _getYStyles.top,\n height = _getYStyles.height;\n\n var width = 100 / nbrOfColumns;\n if (event.background) {\n style = {\n top: top,\n height: height,\n width: 100,\n xOffset: 0\n };\n styledEvents[eventIdx] = {\n event: event,\n style: style\n };\n } else {\n var xAdjustment = width * (nbrOfColumns > 1 ? OVERLAP_MULTIPLIER : 0);\n style = {\n top: top,\n height: height,\n width: width + xAdjustment,\n xOffset: width * siblingIdx - xAdjustment\n };\n }\n\n styledEvents[eventIdx] = {\n event: event,\n style: style\n };\n });\n\n childGroups.forEach(function (group) {\n var parentIdx = idx;\n var siblingIdx = 0;\n\n // Move child group to sibling if possible, since this will makes\n // room for more events.\n while (isChild(siblings[siblingIdx], group[0], helperArgs)) {\n parentIdx = siblings[siblingIdx];\n siblingIdx++;\n }\n\n // Set styles to child events.\n group.forEach(function (eventIdx, i) {\n var parentStyle = styledEvents[parentIdx].style;\n\n var spaceOccupiedByParent = parentStyle.width + parentStyle.xOffset;\n var columns = Math.min(group.length, nbrOfColumns);\n var width = (100 - spaceOccupiedByParent) / columns;\n var xAdjustment = spaceOccupiedByParent * OVERLAP_MULTIPLIER;\n\n var _getYStyles2 = getYStyles(eventIdx, helperArgs),\n top = _getYStyles2.top,\n height = _getYStyles2.height;\n\n styledEvents[eventIdx] = {\n event: events[eventIdx],\n style: {\n top: top,\n height: height,\n width: width + xAdjustment,\n xOffset: spaceOccupiedByParent + width * i - xAdjustment\n }\n };\n });\n });\n\n // Move past all events we just went through\n idx += 1 + siblings.length + childGroups.reduce(function (total, group) {\n return total + group.length;\n }, 0);\n };\n\n while (idx < events.length) {\n _loop();\n }\n\n return styledEvents;\n}", "title": "" }, { "docid": "0ba763e24cfe1572bc8869c854c1e197", "score": "0.48436305", "text": "function displayStartAndEndDate(event) {\n\tvar content = \"\";\n\t//si on a bien les dates\n\tmylog.log(\"event map\", event);\n\tif(\"undefined\" != typeof event['startDateDB'] && \"undefined\" != typeof event['endDateDB']){\n\t\t//var start = dateToStr(data['startDate'], \"fr\", true);\n\t\t//var end = dateToStr(data['endDate'], \"fr\", true);\n\t\t\n\t\tvar startDateMoment = moment(event['startDateDB']).local();\n\t\tvar endDateMoment = moment(event['endDateDB']).local();\n\n\t\tvar startDate = startDateMoment.format(\"DD-MM-YYYY\");\n\t\tvar endDate = endDateMoment.format(\"DD-MM-YYYY\");\n\n\t\tvar hour1 = \"Toute la journée\";\n\t\tvar hour2 = \"Toute la journée\";\n\t\tif(event[\"allDay\"] == false || event[\"allDay\"] == null) { \t\n\t\t\thour1 = startDateMoment.format(\"HH:mm\");\n\t\t\thour2 = endDateMoment.format(\"HH:mm\");\n\t\t}\n\t\t//si la date de debut == la date de fin\n\t\tif( startDate == endDate) {\n\t\t\tcontent += \"<div class='info_item startDate_item_map_list double'><i class='fa fa-caret-right'></i> Le \" + startDate;\n\t\t\t\n\t\t\tif(event[\"allDay\"] == true) { \t\t\n\t\t\t\tcontent += \"</br><i class='fa fa-caret-right'></i> \" + hour1;\n\t\t\t} else {\n\t\t\t\tcontent += \"</br><i class='fa fa-caret-right'></i> \" + hour1 + \" - \" + hour2;\n\t\t\t}\n\t\t\tcontent += \"</div>\";\n\t\t} else {\n\t\t\tcontent += \"<div class='info_item startDate_item_map_list double'><i class='fa fa-caret-right'></i> Du \" + \n\t\t\t\t\t\t\t\tstartDate + \" - \" + hour1 +\n\t\t\t\t\t\t\t\"</div>\" +\n\t\t\t\t \t\t \t\"<div class='info_item startDate_item_map_list double'><i class='fa fa-caret-right'></i> Au \" + \n\t\t\t\t \t\t \t\tendDate + \" - \" + hour2 +\n\t\t\t\t \t\t \t\"</div></br>\";\n\t\t}\n\t}\n\treturn content;\n}", "title": "" }, { "docid": "e9be19f02a62b5044ede201d69c31feb", "score": "0.48321882", "text": "function layOutDay(myEvents) {\n\tvar myNode = document.getElementsByClassName('events')[0]\n\twhile (myNode.childNodes.length > 0) {\n \tmyNode.removeChild(myNode.firstChild);\n\t}\t\n\tmyEvents.forEach(function(myEvent) {\n\t\t//console log an error if the time entered is not in the range\n\t\tif(myEvent.end <= 720) {\n\t\t\tvar eventRow = eventHasConflicts(myEvent)\n\t\t\tvar event = document.createElement('td')\n\t\t\tevent.className += 'event'\n\t\t\tevent.start = myEvent.start\n\t\t\tevent.end = myEvent.end\n\n\t\t\t//generate the title for the event\n\t\t\tvar eventTitle = generateTextNode('Header', 'eventText1')\n\t\t\t\n\t\t\t//generate the subheader for the event\n\t\t\tvar eventBody = generateTextNode('Subheader', 'eventText2')\n\n\t\t\tevent.appendChild(eventTitle)\n\t\t\tevent.appendChild(eventBody)\n\t\t\tevent.style.position = 'absolute'\n\t\t\tevent.style.top = myEvent.start + 40 + 'px';\n\t\t\tevent.style.height = myEvent.end - myEvent.start -10 + 'px';\n\t\t\tevent.style.width = 540 + 'px'\n\t\t\t//create a new row in our event table if no conflict is found\n\t\t\tif(!eventRow) {\n\t\t\t\teventRow = document.createElement(\"tr\")\n\t\t\t\teventRow.start = myEvent.start\n\t\t\t\teventRow.end = myEvent.end\n\t\t\t\teventRow.setAttribute('style',`height: ${myEvent.end - myEvent.start -10}px`) + 'px'; \n\t\t\t\teventRow.className = 'eventRow'\n\t\t\t\teventRow.appendChild(event)\n\t\t\t\tvar eventTable = document.getElementsByClassName('events')[0];\n\t\t\t\teventTable.appendChild(eventRow)\n\t\t\t\t// if we have a conflict, add the event to the conflicting row\n\t\t\t} else {\n\t\t\t\tif(eventRow.start > myEvent.start) {\n\t\t\t\t\teventRow.start = myEvent.start\n\t\t\t\t} else if (eventRow.end < myEvent.end) {\n\t\t\t\t\teventRow.end = myEvent.end\n\t\t\t\t}\n\t\t\t\tvar t = Number(eventRow.childNodes[0].style.top.substr(0,3))\n\t\t\t\t//variable w as referenced in instructions\n\t\t\t\tvar w = 500/ (eventRow.childNodes.length + 1)\n\t\t\t\teventRow.style.top = t\n\t\t\t\tevent.setAttribute('style',`width: ${w}px`)\n\t\t\t\tevent.style.top = myEvent.start + 40 + 'px';\n\n\t\t\t\t//resetting attributes of the row and the row's children\n\t\t\t\tfor( var j = 0; j < eventRow.childNodes.length; j++) {\n\t\t\t\t\tvar top = eventRow.childNodes[j].style.top\n\t\t\t\t\teventRow.childNodes[j].setAttribute('style',`width: ${w}px`)\n\t\t\t\t\teventRow.setAttribute('style',`top: ${t}px`)\n\t\t\t\t\teventRow.childNodes[j].style.top = top;\n\t\t\t\t}\n\t\t\t\teventRow.appendChild(event);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log('error, end time is after 9:00 PM')\n\t\t}\n\t})\n}", "title": "" }, { "docid": "e891a926344241d3080f3956bab76338", "score": "0.48251718", "text": "function getStyledEvents(_ref7) {\n var unsortedEvents = _ref7.events,\n startAccessor = _ref7.startAccessor,\n endAccessor = _ref7.endAccessor,\n min = _ref7.min,\n totalMin = _ref7.totalMin,\n showMultiDayTimes = _ref7.showMultiDayTimes,\n step = _ref7.step,\n timeslots = _ref7.timeslots;\n\n var OVERLAP_MULTIPLIER = 0.3;\n var events = sort(unsortedEvents, { startAccessor: startAccessor, endAccessor: endAccessor });\n var helperArgs = { events: events, startAccessor: startAccessor, endAccessor: endAccessor, min: min, showMultiDayTimes: showMultiDayTimes, totalMin: totalMin, step: step, timeslots: timeslots };\n var styledEvents = [];\n var idx = 0;\n\n // One iteration will cover all connected events.\n\n var _loop = function _loop() {\n var siblings = getSiblings(idx, helperArgs);\n\n var _getChildGroups = getChildGroups(idx, idx + siblings.length + 1, helperArgs),\n childGroups = _getChildGroups.childGroups,\n nbrOfChildColumns = _getChildGroups.nbrOfChildColumns;\n\n var nbrOfColumns = Math.max(nbrOfChildColumns, siblings.length) + 1;\n\n // Set styles to top level events.\n [idx].concat(siblings).forEach(function (eventIdx, siblingIdx) {\n var width = 100 / nbrOfColumns;\n var xAdjustment = width * (nbrOfColumns > 1 ? OVERLAP_MULTIPLIER : 0);\n\n var _getYStyles = getYStyles(eventIdx, helperArgs),\n top = _getYStyles.top,\n height = _getYStyles.height;\n\n styledEvents[eventIdx] = {\n event: events[eventIdx],\n style: {\n top: top,\n height: height,\n width: width + xAdjustment,\n xOffset: width * siblingIdx - xAdjustment\n }\n };\n });\n\n childGroups.forEach(function (group) {\n var parentIdx = idx;\n var siblingIdx = 0;\n\n // Move child group to sibling if possible, since this will makes\n // room for more events.\n while (isChild(siblings[siblingIdx], group[0], helperArgs)) {\n parentIdx = siblings[siblingIdx];\n siblingIdx++;\n }\n\n // Set styles to child events.\n group.forEach(function (eventIdx, i) {\n var parentStyle = styledEvents[parentIdx].style;\n\n var spaceOccupiedByParent = parentStyle.width + parentStyle.xOffset;\n var columns = Math.min(group.length, nbrOfColumns);\n var width = (100 - spaceOccupiedByParent) / columns;\n var xAdjustment = spaceOccupiedByParent * OVERLAP_MULTIPLIER;\n\n var _getYStyles2 = getYStyles(eventIdx, helperArgs),\n top = _getYStyles2.top,\n height = _getYStyles2.height;\n\n styledEvents[eventIdx] = {\n event: events[eventIdx],\n style: {\n top: top,\n height: height,\n width: width + xAdjustment,\n xOffset: spaceOccupiedByParent + width * i - xAdjustment\n }\n };\n });\n });\n\n // Move past all events we just went through\n idx += 1 + siblings.length + childGroups.reduce(function (total, group) {\n return total + group.length;\n }, 0);\n };\n\n while (idx < events.length) {\n _loop();\n }\n\n return styledEvents;\n}", "title": "" }, { "docid": "f373f1ab520ae38123d6cda35b81e480", "score": "0.48173422", "text": "function processPastEvents (args) {\n templateProcessor('events-past', args, {\n transform: function (args) {\n const scope = {}\n\n scope.results = transformEvents(args.result.results)\n scope.results = scope.results.filter((el) => {\n return !el.upcoming\n })\n scope.results = scope.results.sort((a, b) => {\n if (a.startDate == b.startDate) {\n return 0\n }\n return a.startDate > b.startDate ? -1 : 1\n })\n return scope\n }\n })\n}", "title": "" }, { "docid": "b08b029eaa930e439de4c874cec1d067", "score": "0.481593", "text": "function formatEvents(i){\n outputString=outputString+\" There is an event called \"+eventTitle[i]+\". \";\n outputString=outputString+\" It's located at \"+ eventLocation[i]+\". \";\n outputString=outputString+\" It starts at \"+eventStart[i]+\" and \";\n outputString=outputString+\"ends at \"+eventEnd[i]+\". \"; \n console.log(outputString);\n}", "title": "" }, { "docid": "9b3cc05e5348442a48c7dd6b14559ea7", "score": "0.47966552", "text": "function buildSegmentsForEvent(event) {\n\t\tvar startDate = event.start;\n\t\tvar endDate = exclEndDay(event);\n\t\tvar segments = rangeToSegments(startDate, endDate);\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "title": "" }, { "docid": "9b3cc05e5348442a48c7dd6b14559ea7", "score": "0.47966552", "text": "function buildSegmentsForEvent(event) {\n\t\tvar startDate = event.start;\n\t\tvar endDate = exclEndDay(event);\n\t\tvar segments = rangeToSegments(startDate, endDate);\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "title": "" }, { "docid": "9b3cc05e5348442a48c7dd6b14559ea7", "score": "0.47966552", "text": "function buildSegmentsForEvent(event) {\n\t\tvar startDate = event.start;\n\t\tvar endDate = exclEndDay(event);\n\t\tvar segments = rangeToSegments(startDate, endDate);\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "title": "" }, { "docid": "9b3cc05e5348442a48c7dd6b14559ea7", "score": "0.47966552", "text": "function buildSegmentsForEvent(event) {\n\t\tvar startDate = event.start;\n\t\tvar endDate = exclEndDay(event);\n\t\tvar segments = rangeToSegments(startDate, endDate);\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "title": "" }, { "docid": "e458ee009333571f8099af3929fc6a13", "score": "0.47534516", "text": "getEventsToRender() {\n }", "title": "" }, { "docid": "bfa9c9807946a51606e826a26d6d47fd", "score": "0.47466254", "text": "function buildSegmentsForEvent(event) {\n\t\tvar segments = rangeToSegments(event.start, getEventEnd(event));\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "title": "" }, { "docid": "e00670effbc4e96e9f1065eaa64d8d41", "score": "0.4738599", "text": "function getGigData(eventArray){\r\n for (var i=0; i<eventArray.length; i++){\r\n gigDates[i] = eventArray[i].start.date;\r\n //console.log(gigDates[i]);\r\n gigTimes[i] = eventArray[i].start.time;\r\n //console.log(gigTimes[i]);\r\n if (eventArray[i].venue.displayName === \"Unknown venue\"){\r\n gigVenues[i] = eventArray[i].series.displayName;\r\n //console.log(eventArray[i].series.displayName);\r\n }\r\n else{\r\n gigVenues[i] = eventArray[i].venue.displayName;\r\n }\r\n //console.log(gigVenues[i]);\r\n gigCity[i] = eventArray[i].location.city;\r\n //console.log(gigCity[i]);\r\n gigUrl[i] = eventArray[i].uri;\r\n //console.log(gigUrl[i]);\r\n }\r\n processDates();\r\n processTimes();\r\n}", "title": "" }, { "docid": "555479d24510078fa65a91f16cb230d8", "score": "0.47373867", "text": "function listUpcomingEvents(indate, outdate) {\n //var date = new Date();\n const monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n gapi.client.calendar.events.list({\n 'calendarId': calendarId,\n 'timeMin': indate.toISOString(),\n 'timeMax': outdate.toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 10,\n 'orderBy': 'startTime'\n }).then(function(response) {\n var events = response.result.items;\n console.log(\"EVENTS\");\n console.log(events);\n\n var month = {};\n month.name = monthNames[indate.getMonth()];\n month.events = [];\n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n var event = events[i];\n var when = event.start.dateTime;\n if (!when) {\n when = event.start.date;\n }\n details = {};\n details.summary = event.summary;\n\n details.when = Number(when.split(\"T\")[0].split(\"-\")[2]);\n month.events.push(details);\n\n }\n }\n appendMonth(month);\n });\n}", "title": "" }, { "docid": "85def626affb404b85030f9ce5e6832c", "score": "0.47346744", "text": "function renderEvents(events, modifiedEventId) { // 3809\n\t\treportEvents(events); // 3810\n\t\tvar i, len=events.length, // 3811\n\t\t\tdayEvents=[], // 3812\n\t\t\tslotEvents=[]; // 3813\n\t\tfor (i=0; i<len; i++) { // 3814\n\t\t\tif (events[i].allDay) { // 3815\n\t\t\t\tdayEvents.push(events[i]); // 3816\n\t\t\t}else{ // 3817\n\t\t\t\tslotEvents.push(events[i]); // 3818\n\t\t\t} // 3819\n\t\t} // 3820\n\t\tif (opt('allDaySlot')) { // 3821\n\t\t\trenderDaySegs(compileDaySegs(dayEvents), modifiedEventId); // 3822\n\t\t\tsetHeight(); // no params means set to viewHeight // 3823\n\t\t} // 3824\n\t\trenderSlotSegs(compileSlotSegs(slotEvents), modifiedEventId); // 3825\n\t\ttrigger('eventAfterAllRender'); // 3826\n\t} // 3827", "title": "" }, { "docid": "cae42544ea62830ee371f04400d7f044", "score": "0.47324044", "text": "function getStyledEvents(_ref7) {\n var unsortedEvents = _ref7.events,\n startAccessor = _ref7.startAccessor,\n endAccessor = _ref7.endAccessor,\n min = _ref7.min,\n totalMin = _ref7.totalMin,\n step = _ref7.step;\n\n var OVERLAP_MULTIPLIER = 0.3;\n var events = sort(unsortedEvents, { startAccessor: startAccessor, endAccessor: endAccessor });\n var helperArgs = { events: events, startAccessor: startAccessor, endAccessor: endAccessor, min: min, totalMin: totalMin, step: step };\n var styledEvents = [];\n var idx = 0;\n\n // One iteration will cover all connected events.\n\n var _loop = function _loop() {\n var siblings = getSiblings(idx, helperArgs);\n\n var _getChildGroups = getChildGroups(idx, idx + siblings.length + 1, helperArgs),\n childGroups = _getChildGroups.childGroups,\n nbrOfChildColumns = _getChildGroups.nbrOfChildColumns;\n\n var nbrOfColumns = Math.max(nbrOfChildColumns, siblings.length) + 1;\n\n // Set styles to top level events.\n [idx].concat(siblings).forEach(function (eventIdx, siblingIdx) {\n var width = 100 / nbrOfColumns;\n var xAdjustment = width * (nbrOfColumns > 1 ? OVERLAP_MULTIPLIER : 0);\n\n var _getYStyles = getYStyles(eventIdx, helperArgs),\n top = _getYStyles.top,\n height = _getYStyles.height;\n\n styledEvents[eventIdx] = {\n event: events[eventIdx],\n style: {\n top: top,\n height: height,\n width: width + xAdjustment,\n xOffset: width * siblingIdx - xAdjustment\n }\n };\n });\n\n childGroups.forEach(function (group) {\n var parentIdx = idx;\n var siblingIdx = 0;\n\n // Move child group to sibling if possible, since this will makes\n // room for more events.\n while (isChild(siblings[siblingIdx], group[0], helperArgs)) {\n parentIdx = siblings[siblingIdx];\n siblingIdx++;\n }\n\n // Set styles to child events.\n group.forEach(function (eventIdx, i) {\n var parentStyle = styledEvents[parentIdx].style;\n\n var spaceOccupiedByParent = parentStyle.width + parentStyle.xOffset;\n var columns = Math.min(group.length, nbrOfColumns);\n var width = (100 - spaceOccupiedByParent) / columns;\n var xAdjustment = spaceOccupiedByParent * OVERLAP_MULTIPLIER;\n\n var _getYStyles2 = getYStyles(eventIdx, helperArgs),\n top = _getYStyles2.top,\n height = _getYStyles2.height;\n\n styledEvents[eventIdx] = {\n event: events[eventIdx],\n style: {\n top: top,\n height: height,\n width: width + xAdjustment,\n xOffset: spaceOccupiedByParent + width * i - xAdjustment\n }\n };\n });\n });\n\n // Move past all events we just went through\n idx += 1 + siblings.length + childGroups.reduce(function (total, group) {\n return total + group.length;\n }, 0);\n };\n\n while (idx < events.length) {\n _loop();\n }\n\n return styledEvents;\n}", "title": "" }, { "docid": "a274aabba3281dd5c238bf0843ac19b1", "score": "0.47322336", "text": "function buildSegmentsForEvent(event) {\n var startDate = event.start;\n var endDate = exclEndDay(event);\n var segments = rangeToSegments(startDate, endDate);\n for (var i=0; i<segments.length; i++) {\n segments[i].event = event;\n }\n return segments;\n }", "title": "" }, { "docid": "5130eff1c778568d0699c9ad24588b8b", "score": "0.473185", "text": "function setEventForSection(session, colorCounter, i) {\n // console.log(moment().startOf('month').format(\"YYYY-MM-D\"));\n // console.log(moment().day(fullday));\n var fullday = days.get(session[0]);\n var classInfo = savedCourses[i];\n var department = classInfo.coursename.substring(0, classInfo.coursename.search(/\\d/) - 2);\n var course_nbr = classInfo.coursename.substring(classInfo.coursename.search(/\\d/), classInfo.coursename.indexOf(\" \", classInfo.coursename.search(/\\d/)));\n var uncapProf = prettifyName(classInfo.profname);\n if (uncapProf == \"\") {\n uncapProf = \"Undecided\";\n }\n\n var year = moment().day(fullday)._d.toString().split(\" \")[3];\n var monthNum = moment(moment().day(fullday)._d.toString().split(\" \")[1], \"MMM\").format('MM');\n var beg = `${year}-${monthNum}-`;\n classSchedules.push({\n title: `${department}-${course_nbr} with ${uncapProf}`,\n start: beg +\n moment()\n .day(fullday)\n ._d.toString()\n .split(\" \")[2] +\n \"T\" +\n session[1][0] +\n \":00\",\n end: beg +\n moment()\n .day(fullday)\n ._d.toString()\n .split(\" \")[2] +\n \"T\" +\n session[1][1] +\n \":00\",\n color: materialColors[colorCounter],\n index: i,\n allday: false\n });\n }", "title": "" }, { "docid": "495901979e33acaef4551355e081f7c5", "score": "0.47241977", "text": "handleIntersect(entries) {\n entries.forEach((entry) => {\n if (entry['isIntersecting']) {\n this.nguiInview.emit(entry);\n }\n else {\n this.nguiOutview.emit(entry);\n }\n });\n }", "title": "" }, { "docid": "26a327b6241d673f4029e477714834e2", "score": "0.47241858", "text": "function main(){\n\t//hier werden alle events erstellt.\n\t\n\t//Hersteller\n\teventErstellen(1935,endjahr,\"Yamaha\",\"\",'Hersteller', 0);\n\teventErstellen(1853 ,1955,\"Wurlitzer Electric Piano\",\"Bis zur Herausgabe.\",'Hersteller', 0);\n\t\n\t\n\t//Milestones\n \teventErstellen(1962,1962,\"Chamberlin/Mellotron\",\"\",'Meilenstein',0);\n\teventErstellen(1964,1964,\"Robert Moog Modularsystem\",\"\",'Meilenstein',0);\n\teventErstellen(1968,1968,\"Hohner Clavinet D6\",\"\",'Meilenstein',0);\n\teventErstellen(1971,1971,\"Moog, Minimoog\",\"\",'Meilenstein',0);\n\teventErstellen(1972,1972,\"Arp Odyssey\",\"\",'Meilenstein',0);\n\teventErstellen(1973,1973,\"Roland SH-1000\",\"\",'Meilenstein',0);\n\teventErstellen(1973,1973,\"Oberheim\",\"\",'Meilenstein',0);\n\teventErstellen(1975,1975,\"Moog, Polymoog\",\"\",'Meilenstein',0);\n\teventErstellen(1976,1976,\"New England Digital\",\"\",'Meilenstein',0);\n\teventErstellen(1977,1977,\"Yamaha CS-80\",\"\",'Meilenstein',0);\n\teventErstellen(1978,1978,\"Sequential Cirquits Prophet 5\",\"\",'Meilenstein',0);\n\teventErstellen(1978,1978,\"Korg MS10/MS20\",\"\",'Meilenstein',0);\n\teventErstellen(1979,1979,\"CMI Fairlight\",\"\",'Meilenstein',0);\n\teventErstellen(1980,1980,\"PPG Wavecomputer 360\",\"\",'Meilenstein',0);\n\teventErstellen(1980,1980,\"Oberheim OBXa\",\"\",'Meilenstein',0);\n\teventErstellen(1980,1980,\"Korg Polysix\",\"\",'Meilenstein',0);\n\teventErstellen(1981,1981,\"Roland Jupiter 8\",\"\",'Meilenstein',0);\n\teventErstellen(1981,1981,\"Yamaha GS1\",\"\",'Meilenstein',0);\n\teventErstellen(1983,1983,\"Yamaha CP-70 Electric Grand\",\"\",'Meilenstein',0);\n\teventErstellen(1983,1983,\"Yamaha DX7\",\"\",'Meilenstein',0);\n\teventErstellen(1984,1984,\"Casio CZ-101 (Phase Distortion Synthese)\",\"\",'Meilenstein',0);\n\teventErstellen(1984,1984,\"Akai S612 Sampler\",\"\",'Meilenstein',0);\n\teventErstellen(1985,1985,\"Akai S900 Sampler\",\"\",'Meilenstein',0);\n\teventErstellen(1986,1986,\"Sequential Cirquits Prophet VS\",\"\",'Meilenstein',0);\n\teventErstellen(1987,1987,\"Roland D-50\",\"\",'Meilenstein',0);\n\teventErstellen(1988,1988,\"Korg M1\",\"\",'Meilenstein',0);\n\teventErstellen(1990,1990,\"Korg Wavestation\",\"\",'Meilenstein',0);\n\teventErstellen(1991,1991,\"Roland Sound Canvas SC-55\",\"\",'Meilenstein',0);\n\teventErstellen(1992,1992,\"Novation\",\"\",'Meilenstein',0);\n\teventErstellen(1994,1994,\"Yamaha VL1\",\"\",'Meilenstein',0);\n\teventErstellen(1995,1995,\"Clavia Nordlead\",\"\",'Meilenstein',0);\n\teventErstellen(1996,1996,\"Kawai K5000\",\"\",'Meilenstein',0);\n\teventErstellen(1997,1997,\"Yamaha AN1x\",\"\",'Meilenstein',0);\n\teventErstellen(1997,1997,\"Roland JP-8000\",\"\",'Meilenstein',0);\n\teventErstellen(1998,1998,\"Novation Super Nova\",\"\",'Meilenstein',0);\n\teventErstellen(2001,2001,\"Hartmann Music Neuron\",\"\",'Meilenstein',0); \n\n\tzeitstrahlZeichnen(zoomfaktor);\n}", "title": "" }, { "docid": "67d720b645542db28fa0b2768d9ddfd9", "score": "0.47075462", "text": "function findSegStartEndByEvent(segRow,segCol) {\n var eventCol = parseInt(segCol)+1;\n var eventCon = 'NaN';\n var eventDes = 'NaN';\n var tdText = '';\n var maxRow = $(\".center-div table.fixed-left-column tr\").length - 1;\n\n // get nearest constructor\n var wrongDes = '', wrongCon = '';\n for(var i=segRow; i>=2; i--) {\n tdText = $.trim($(\".center-div table.fixed-left-column tr:eq(\"+i+\") td:eq(\"+eventCol+\")\").text()).replace(/\\s/g, \"\");\n if(tdText.toLowerCase().indexOf('creation') >= 0) {\n eventCon = i;\n break;\n }\n }\n\n // get nearest destructor\n for(var i=segRow; i<=maxRow; i++) {\n tdText = $.trim($(\".center-div table.fixed-left-column tr:eq(\"+i+\") td:eq(\"+eventCol+\")\").text()).replace(/\\s/g, \"\");\n if(tdText.toLowerCase().indexOf('destruction') >= 0) {\n eventDes = i;\n break;\n }\n }\n\n return [parseInt(eventCon), parseInt(eventDes)];\n}", "title": "" }, { "docid": "f39bd737868c972088293c953237c5f9", "score": "0.47062206", "text": "function getEventsTest2() {\n minDT = \"2019-01-01T00:00:00Z\";\n maxDT = \"2010-01-08T00:00:00Z\";\n console.log(\"DEBUG: Testing event getting from \" + minDT + \" to \" + maxDT);\n getEvents(minDT, maxDT, getEventsHandleResponse);\n}", "title": "" }, { "docid": "138df673150acb816f7e340bc2937104", "score": "0.46862602", "text": "function setBookingPrice(events,bars) {\n var reduction=0; // Réduction a appliqué en pourcentage : entre 0 et 1 \n var optionPrice=0; // Prix des options à ajouter après application de la réudction\n events.forEach(event=>{\n bars.forEach(bar => {\n if (event.barId==bar.id) {\n\n if( 10<=event.persons && event.persons<20) {\n reduction=0.10;\n }\n if(20<=event.persons && event.persons<60) {\n reduction=0.30;\n }\n if(60<=event.persons) {\n reduction=0.50;\n }\n if(event.options.deductibleReduction==true){\n optionPrice=optionPrice+event.persons;\n }\n event.price = event.time*bar.pricePerHour + event.persons*bar.pricePerPerson; // Calcul du prix sans réduction\n event.price = event.price*(1-reduction); // Calcul de prix après réducion \n event.price = event.price + optionPrice;\n }\n });\n });\n}", "title": "" }, { "docid": "0f9132c53726d5c6d8569f3b5f7d7933", "score": "0.46747416", "text": "function normalizeEventRange(props) {\n\n\t\tnormalizeEventRangeTimes(props);\n\n\t\tif (props.end && !props.end.isAfter(props.start)) {\n\t\t\tprops.end = null;\n\t\t}\n\n\t\tif (!props.end) {\n\t\t\tif (options.forceEventDuration) {\n\t\t\t\tprops.end = t.getDefaultEventEnd(props.allDay, props.start);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprops.end = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0f9132c53726d5c6d8569f3b5f7d7933", "score": "0.46747416", "text": "function normalizeEventRange(props) {\n\n\t\tnormalizeEventRangeTimes(props);\n\n\t\tif (props.end && !props.end.isAfter(props.start)) {\n\t\t\tprops.end = null;\n\t\t}\n\n\t\tif (!props.end) {\n\t\t\tif (options.forceEventDuration) {\n\t\t\t\tprops.end = t.getDefaultEventEnd(props.allDay, props.start);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprops.end = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0f9132c53726d5c6d8569f3b5f7d7933", "score": "0.46747416", "text": "function normalizeEventRange(props) {\n\n\t\tnormalizeEventRangeTimes(props);\n\n\t\tif (props.end && !props.end.isAfter(props.start)) {\n\t\t\tprops.end = null;\n\t\t}\n\n\t\tif (!props.end) {\n\t\t\tif (options.forceEventDuration) {\n\t\t\t\tprops.end = t.getDefaultEventEnd(props.allDay, props.start);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprops.end = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0f9132c53726d5c6d8569f3b5f7d7933", "score": "0.46747416", "text": "function normalizeEventRange(props) {\n\n\t\tnormalizeEventRangeTimes(props);\n\n\t\tif (props.end && !props.end.isAfter(props.start)) {\n\t\t\tprops.end = null;\n\t\t}\n\n\t\tif (!props.end) {\n\t\t\tif (options.forceEventDuration) {\n\t\t\t\tprops.end = t.getDefaultEventEnd(props.allDay, props.start);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprops.end = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9836268a838b48c32d3b24a7c3573add", "score": "0.46666527", "text": "function normalizeEventRange(props) {\n\n normalizeEventRangeTimes(props);\n\n if (props.end && !props.end.isAfter(props.start)) {\n props.end = null;\n }\n\n if (!props.end) {\n if (options.forceEventDuration) {\n props.end = t.getDefaultEventEnd(props.allDay, props.start);\n }\n else {\n props.end = null;\n }\n }\n }", "title": "" }, { "docid": "d9836b1e06bd68c21ced953a59fd1116", "score": "0.46592894", "text": "forEachInRange(t, e) {\n const n = this.data.getIteratorFrom(t[0]);\n for (;n.hasNext(); ) {\n const s = n.getNext();\n if (this.comparator(s.key, t[1]) >= 0) return;\n e(s.key);\n }\n }", "title": "" }, { "docid": "20d0bcb174425ee689b59694edeb834f", "score": "0.46556085", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n let inverseBgByGroupId = {};\n let inverseBgByDefId = {};\n let defByGroupId = {};\n let bgRanges = [];\n let fgRanges = [];\n let eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (let defId in eventStore.defs) {\n let def = eventStore.defs[defId];\n let ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (let instanceId in eventStore.instances) {\n let instance = eventStore.instances[instanceId];\n let def = eventStore.defs[instance.defId];\n let ui = eventUis[def.defId];\n let origRange = instance.range;\n let normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n let slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def,\n ui,\n instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (let groupId in inverseBgByGroupId) { // BY GROUP\n let ranges = inverseBgByGroupId[groupId];\n let invertedRanges = invertRanges(ranges, framingRange);\n for (let invertedRange of invertedRanges) {\n let def = defByGroupId[groupId];\n let ui = eventUis[def.defId];\n bgRanges.push({\n def,\n ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (let defId in inverseBgByDefId) {\n let ranges = inverseBgByDefId[defId];\n let invertedRanges = invertRanges(ranges, framingRange);\n for (let invertedRange of invertedRanges) {\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "2fca31ce818f4fdc45544f3f41fb346b", "score": "0.46553567", "text": "function eventIntersectsRange(event, range) { // 10888\n\t\tvar eventStart = event.start.clone().stripZone(); // 10889\n\t\tvar eventEnd = t.getEventEnd(event).stripZone(); // 10890\n // 10891\n\t\treturn range.start < eventEnd && range.end > eventStart; // 10892\n\t} // 10893", "title": "" }, { "docid": "cf61d23fd80cbde5bd56ba663ebc8098", "score": "0.4654471", "text": "function getStyledEvents(_ref7) {\n\t var unsortedEvents = _ref7.events,\n\t startAccessor = _ref7.startAccessor,\n\t endAccessor = _ref7.endAccessor,\n\t min = _ref7.min,\n\t totalMin = _ref7.totalMin,\n\t step = _ref7.step;\n\n\t var OVERLAP_MULTIPLIER = 0.3;\n\t var events = sort(unsortedEvents, { startAccessor: startAccessor, endAccessor: endAccessor });\n\t var helperArgs = { events: events, startAccessor: startAccessor, endAccessor: endAccessor, min: min, totalMin: totalMin, step: step };\n\t var styledEvents = [];\n\t var idx = 0;\n\n\t // One iteration will cover all connected events.\n\n\t var _loop = function _loop() {\n\t var siblings = getSiblings(idx, helperArgs);\n\n\t var _getChildGroups = getChildGroups(idx, idx + siblings.length + 1, helperArgs),\n\t childGroups = _getChildGroups.childGroups,\n\t nbrOfChildColumns = _getChildGroups.nbrOfChildColumns;\n\n\t var nbrOfColumns = Math.max(nbrOfChildColumns, siblings.length) + 1;\n\n\t // Set styles to top level events.\n\t [idx].concat(siblings).forEach(function (eventIdx, siblingIdx) {\n\t var width = 100 / nbrOfColumns;\n\t var xAdjustment = width * (nbrOfColumns > 1 ? OVERLAP_MULTIPLIER : 0);\n\n\t var _getYStyles = getYStyles(eventIdx, helperArgs),\n\t top = _getYStyles.top,\n\t height = _getYStyles.height;\n\n\t styledEvents[eventIdx] = {\n\t event: events[eventIdx],\n\t style: {\n\t top: top,\n\t height: height,\n\t width: width + xAdjustment -5,\n\t xOffset: width * siblingIdx - xAdjustment\n\t }\n\t };\n\t });\n\n\t childGroups.forEach(function (group) {\n\t var parentIdx = idx;\n\t var siblingIdx = 0;\n\n\t // Move child group to sibling if possible, since this will makes\n\t // room for more events.\n\t while (isChild(siblings[siblingIdx], group[0], helperArgs)) {\n\t parentIdx = siblings[siblingIdx];\n\t siblingIdx++;\n\t }\n\n\t // Set styles to child events.\n\t group.forEach(function (eventIdx, i) {\n\t var parentStyle = styledEvents[parentIdx].style;\n\n\t var spaceOccupiedByParent = parentStyle.width + parentStyle.xOffset;\n\t var columns = Math.min(group.length, nbrOfColumns);\n\t var width = (100 - spaceOccupiedByParent) / columns;\n\t var xAdjustment = spaceOccupiedByParent * OVERLAP_MULTIPLIER;\n\n\t var _getYStyles2 = getYStyles(eventIdx, helperArgs),\n\t top = _getYStyles2.top,\n\t height = _getYStyles2.height;\n\n\t styledEvents[eventIdx] = {\n\t event: events[eventIdx],\n\t style: {\n\t top: top,\n\t height: height,\n\t width: width + xAdjustment -5,\n\t xOffset: spaceOccupiedByParent + width * i - xAdjustment\n\t }\n\t };\n\t });\n\t });\n\n\t // Move past all events we just went through\n\t idx += 1 + siblings.length + childGroups.reduce(function (total, group) {\n\t return total + group.length;\n\t }, 0);\n\t };\n\n\t while (idx < events.length) {\n\t _loop();\n\t }\n\n\t return styledEvents;\n\t}", "title": "" }, { "docid": "018d5806c04dbdac5fe87c618d9b60a8", "score": "0.4646056", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n var ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "018d5806c04dbdac5fe87c618d9b60a8", "score": "0.4646056", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n var ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "018d5806c04dbdac5fe87c618d9b60a8", "score": "0.4646056", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n var ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "018d5806c04dbdac5fe87c618d9b60a8", "score": "0.4646056", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n var ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "e02921ad2080d4c94b1f54f74f04a299", "score": "0.46440738", "text": "function bumpOldEventsDown(){\r\n\tvar today = new Date();\r\n\tvar jumps = 0;\r\n\tfor(var i=0; i< importedEvents.length; i++){\r\n\t\tvar endDate = new Date(importedEvents[jumps].eventEnd_date);\r\n\t\tif (today.getMonth()>endDate.getMonth()){\r\n\t\t\tarray_move(importedEvents,jumps,importedEvents.length-1);\r\n\t\t\tjumps = jumps+1;\r\n\t\t}else if (today.getMonth()==endDate.getMonth() && today.getDate() > endDate.getDate()){\r\n\t\t\tarray_move(importedEvents,jumps,importedEvents.length-1);\r\n\t\t\tjumps = jumps+1;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3b20b4b5b262629d079aafdbef02db46", "score": "0.46384132", "text": "function populateCalPageEvents() {\n upcomingEvents.reverse();\n \n // Builds the array of Weekly Events that will later have the upcoming events pushed into it.\n // Setting the condition number (i <= 10) will change how many weekly events are added\n // to the cal. Special events will still display if they occur after this cut off.\n for (i = 0; i <= 60; i++) {\n\n var calEndDate = new Date();\n var weeklyCalEntry = calEndDate.setDate(calEndDate.getDate() + i);\n var weeklyCalEntryString = new Date(weeklyCalEntry);\n\n if (weeklyCalEntryString.getDay() === 1) {\n calWeeklyEventsList.push({'eventDate' : weeklyCalEntryString.toDateString(), 'eventName' : weeklyEvents[0].eventName, 'eventDesc' : weeklyEvents[0].eventDesc, 'eventImgWide' : weeklyEvents[0].eventImgWide, 'eventTime' : weeklyEvents[0].eventTime, 'eventLink' : weeklyEvents[0].eventLink});\n }\n\n else if (weeklyCalEntryString.getDay() === 4) {\n calWeeklyEventsList.push({'eventDate' : weeklyCalEntryString.toDateString(), 'eventName' : weeklyEvents[1].eventName, 'eventDesc' : weeklyEvents[1].eventDesc, 'eventImgWide' : weeklyEvents[1].eventImgWide, 'eventTime' : weeklyEvents[1].eventTime, 'eventLink' : weeklyEvents[1].eventLink});\n }\n\n else if (weeklyCalEntryString.getDay() === 5) {\n calWeeklyEventsList.push({'eventDate' : weeklyCalEntryString.toDateString(), 'eventName' : weeklyEvents[2].eventName, 'eventDesc' : weeklyEvents[2].eventDesc, 'eventImgWide' : weeklyEvents[2].eventImgWide, 'eventTime' : weeklyEvents[2].eventTime, 'eventLink' : weeklyEvents[2].eventLink});\n }\n\n else if (weeklyCalEntryString.getDay() === 6) {\n calWeeklyEventsList.push({'eventDate' : weeklyCalEntryString.toDateString(), 'eventName' : weeklyEvents[3].eventName, 'eventDesc' : weeklyEvents[3].eventDesc, 'eventImgWide' : weeklyEvents[3].eventImgWide, 'eventTime' : weeklyEvents[3].eventTime, 'eventLink' : weeklyEvents[3].eventLink});\n }\n }\n\n // Adds upcoming events to the weekly events\n for (i = 0; i <= upcomingEvents.length - 1; i++) {\n calWeeklyEventsList.push(upcomingEvents[i]);\n }\n\n // Sorts the cal events\n calWeeklyEventsList.sort(function(a,b){var c = new Date(a.eventDate); var d = new Date(b.eventDate); return c-d;});\n\n // Pushes Cal events into the cal page\n function buildCal(a) {\n calendarEvents.innerHTML = a;\n }\n\n // Removes Weekly if a special event is set to overide\n for (i = 0; i <= calWeeklyEventsList.length - 1; i++) {\n \n // If a Special Event is set to Override, remove the previous weekly entry\n if (calWeeklyEventsList[i].eventWklOvrd === true) {\n calWeeklyEventsList.splice(i-1, 1);\n }\n // Else, Do nothing\n else { \n }\n }\n\n // Fixes the Special Event Dates for the cal and builds the Event entry. Push to the buildCal function.\n var formatedDate;\n var formatedTime;\n \n for (i = 0; i <= calWeeklyEventsList.length - 1; i++) {\n\n if (calWeeklyEventsList[i].eventTix !== undefined) {\n \n if (calWeeklyEventsList[i].eventTix != 'none') {\n formatedDate = calWeeklyEventsList[i].eventDate.toDateString();\n formatedTime = calWeeklyEventsList[i].eventDate.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}); \n\n buildCal(calendarEvents.innerHTML + '<div class=\"home-page-event-content\"><h3><a href=\"' + calWeeklyEventsList[i].eventLink + '\"><span class=\"event-day\">' + formatedDate + ', ' + formatedTime + '</span><br><span class=\"event-name\">' + calWeeklyEventsList[i].eventName + '</span></a></h3><a href=\"' + calWeeklyEventsList[i].eventLink + '\"><img src=\"' + calWeeklyEventsList[i].eventImgWide + '\" alt=\"An event poster for ' + calWeeklyEventsList[i].eventArtist + ' performing at the Necto Nightclub in Ann Arbor, Michigan on ' + (calWeeklyEventsList[i].eventDate.getMonth() + 1) + '/' + calWeeklyEventsList[i].eventDate.getDate() + '/' + calWeeklyEventsList[i].eventDate.getFullYear() + '.\"></a><p>' + calWeeklyEventsList[i].eventDesc + '</p><div class=\"row event-nav\"><a href=\"' + calWeeklyEventsList[i].eventLink + '\"class=\"col col-4-xs\">VIEW EVENT</a><a href=\"bottle-service-vip-reservations.html\" class=\"col col-4-xs\">REQUEST VIP</a><a href=\"' + calWeeklyEventsList[i].eventTix + '\" class=\"col col-4-xs \">BUY TICKETS</a></div></div><br><br>');\n }\n\n else {\n formatedDate = calWeeklyEventsList[i].eventDate.toDateString();\n formatedTime = calWeeklyEventsList[i].eventDate.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});\n buildCal(calendarEvents.innerHTML + '<div class=\"home-page-event-content\"><h3><a href=\"' + calWeeklyEventsList[i].eventLink + '\"><span class=\"event-day\">' + formatedDate + ', ' + formatedTime + '</span><br><span class=\"event-name\">' + calWeeklyEventsList[i].eventName + '</span></a></h3><a href=\"' + calWeeklyEventsList[i].eventLink + '\"><img src=\"' + calWeeklyEventsList[i].eventImgWide + '\" alt=\"An event poster for ' + calWeeklyEventsList[i].eventArtist + ' performing at the Necto Nightclub in Ann Arbor, Michigan on ' + (calWeeklyEventsList[i].eventDate.getMonth() + 1) + '/' + calWeeklyEventsList[i].eventDate.getDate() + '/' + calWeeklyEventsList[i].eventDate.getFullYear() + '.\"></a><p>' + calWeeklyEventsList[i].eventDesc + '</p><div class=\"row event-nav\"><a href=\"' + calWeeklyEventsList[i].eventLink + '\"class=\"col col-6-xs\">VIEW EVENT</a><a href=\"bottle-service-vip-reservations.html\" class=\"col col-6-xs \">REQUEST VIP</a></div></div><br><br>');\n }\n }\n\n else {\n buildCal(calendarEvents.innerHTML + '<div class=\"home-page-event-content\"><h3><a href=\"' + calWeeklyEventsList[i].eventLink + '\"><span class=\"event-day\">' + calWeeklyEventsList[i].eventDate + ', ' + calWeeklyEventsList[i].eventTime + '</span><br><span class=\"event-name\">' + calWeeklyEventsList[i].eventName + '</span></a></h3><a href=\"' + calWeeklyEventsList[i].eventLink + '\"><img src=\"' + calWeeklyEventsList[i].eventImgWide + '\" alt=\"A image of ' + calWeeklyEventsList[i].eventName + ', a weekly event at the Necto Nightclub in Ann Arbor, Michigan.\"></a><p>' + calWeeklyEventsList[i].eventDesc + '</p><div class=\"row event-nav\"><a href=\"' + calWeeklyEventsList[i].eventLink + '\"class=\"col col-6-xs\">VIEW EVENT</a><a href=\"bottle-service-vip-reservations.html\" class=\"col col-6-xs \">REQUEST VIP</a></div></div><br><br>');\n }\n }\n}", "title": "" }, { "docid": "50c58c5bfb2af46ccd960e5a2013a774", "score": "0.46278274", "text": "_updateSprints() {\n var sprintRects = this._sprintRects().selectAll('rect')\n .data(this.props.chart.sprints, d => d.start + '' + d.end)\n .attr('x', (d) => this._x1()(d.start))\n .attr('width', d => this._x1()(d.end) - this._x1()(d.start));\n\n sprintRects.enter().append('rect')\n .attr('class', \"sprintRect\")\n .attr('x', (d) => {\n return this._x1()(d.start)\n })\n .attr('y', 0)\n .attr('width', d => this._x1()(d.end) - this._x1()(d.start))\n .attr('height', this.sprint_height);\n sprintRects.exit().remove();\n\n var sprintLabels = this._sprintLabels().selectAll('text')\n .data(this.props.chart.sprints, d => d.start + '' + d.end)\n .attr('x', (d) => (this._x1()(d.start) + this._x1()(d.end))/2);\n\n sprintLabels.enter().append('text')\n .text(d => 'T'+d.sprint_num)\n .attr('class', 'sprintText')\n .attr('x', (d) => (this._x1()(d.start)+ this._x1()(d.end))/2)\n .attr('y', (d) => this._y1()(0) + this.sprint_height)\n .attr('dy', -6)\n .attr(\"text-anchor\", \"middle\");\n sprintLabels.exit().remove();\n }", "title": "" }, { "docid": "52e386ec203df5ccac5abe431aa69911", "score": "0.4616328", "text": "function computeSegHorizontals(segs, eventOrderSpecs) {\n // IMPORTANT TO CLEAR OLD RESULTS :(\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.level = null;\n seg.forwardCoord = null;\n seg.backwardCoord = null;\n seg.forwardPressure = null;\n }\n segs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.sortEventSegs)(segs, eventOrderSpecs);\n var level0;\n var levels = buildSlotSegLevels(segs);\n computeForwardSlotSegs(levels);\n if ((level0 = levels[0])) {\n for (var _a = 0, level0_1 = level0; _a < level0_1.length; _a++) {\n var seg = level0_1[_a];\n computeSlotSegPressures(seg);\n }\n for (var _b = 0, level0_2 = level0; _b < level0_2.length; _b++) {\n var seg = level0_2[_b];\n computeSegForwardBack(seg, 0, 0, eventOrderSpecs);\n }\n }\n return segs;\n}", "title": "" }, { "docid": "e9abc93dacfa1507b5e581858ae265b0", "score": "0.46156356", "text": "static getEventInfo(schedule, classData) {\n const ret = [];\n for (let sectionNum of schedule) {\n let Class = ClassUtils.getClassForSectionNum(sectionNum, classData);\n\n if (!Class || Class.sections.length === 0)\n continue;\n\n for (let section of Class.sections) {\n if(section.sectionNum !== sectionNum)\n continue;\n\n for (let subsection of section.subsections) {\n let strippedClassData = Object.assign({}, Class, {sections: []});\n let strippedSectionData = Object.assign({}, section, {subsections: []});\n let timeRange = ClassUtils.convertToMomentRange(subsection.timeInterval);\n\n ret.push({\n content: strippedSectionData.classTitle,\n ...strippedClassData,\n ...strippedSectionData,\n ...subsection,\n range: timeRange\n });\n }\n }\n }\n return ret;\n }", "title": "" }, { "docid": "871eb281e8db9c8f8258520eb17809b6", "score": "0.46047112", "text": "function createEventList (freetime, hourPer){\r\n //Need to be parameters/globals:\r\n var name = 'Test Event'; // name of the event\r\n var timeForEventBlock = 30 * 60000; // 30 mins in milliseconds\r\n\r\n var newEvents = [];\r\n var gap;\r\n var timeInDay;\r\n var startTime;\r\n var endTime;\r\n var newEvent;\r\n var remainder = 0;\r\n\r\n var i;\r\n for(i = 0; i < freetime.length; i++){\r\n timeInDay = hourPer[i];\r\n\r\n\r\n var j = 0;\r\n while(timeInDay >= timeForEventBlock){\r\n startTime = new Date(freetime[i][j].startTime);\r\n endTime = new Date(freetime[i][j].endTime);\r\n\r\n gap = endTime.getTime() - startTime.getTime();\r\n\r\n while((gap - timeForEventBlock) >= 0 && timeInDay >= timeForEventBlock){\r\n gap -= timeForEventBlock;\r\n\r\n newEvent = feeds.createGapEvent(name, startTime, timeForEventBlock);\r\n newEvents.push(newEvent);\r\n startTime = new Date(startTime.getTime() + timeForEventBlock);\r\n\r\n timeInDay -= timeForEventBlock;\r\n }\r\n\r\n //remainder += timeInDay;\r\n j += 1;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n return newEvents;\r\n\r\n}", "title": "" }, { "docid": "12f78503ee9c62e6f9a684472f3c651e", "score": "0.4592632", "text": "function CityEvents() {}", "title": "" }, { "docid": "7c6c4b45ae188b64b12eedb99957b24d", "score": "0.4592063", "text": "_addEventListeners() {\n // Update pages left in chapter\n // Update percent complete\n this.book.rendition.on('relocated', location => {\n let pagesLeft =\n this.book.rendition.manager.location[0].totalPages -\n this.book.rendition.manager.location[0].pages[0];\n pagesLeft = this.book.rendition.manager.location[0].pages[1]\n ? Math.floor(pagesLeft / 2)\n : pagesLeft;\n\n this.setState({\n pagesLeft,\n percent: +location.end.percentage.toFixed(2) * 100\n });\n });\n\n // Apply styles\n // Insert annotations\n // Add swipe and click listeners\n this.book.rendition.on('rendered', (section, view) => {\n this._applyStyles();\n this._applyHighlights(this.state.highlight);\n\n const [{ document }] = this.book.rendition.getContents();\n\n swipeListener(document, this.book, this.onSwipe);\n clickListener(document, this.book, this.onClick);\n\n document.addEventListener('click', this.onAnchorClick);\n });\n\n window.addEventListener('message', this.onHighlightClicked);\n\n this.book.rendition.emit('rendered');\n }", "title": "" }, { "docid": "9c2580545d07d0141da544b694e5593b", "score": "0.45786175", "text": "function displayEvents(modelJSON, forDate) {\n var container = document.getElementById('event-inner-container');\n flushEventsContainer(container);\n\n var eventsOnDate = [];\n var eventInd_ctgTitle_ctgColors_ctgInd = [];\n for (var i = 0; i < modelJSON.Categories.length; i++) {\n var ctg = modelJSON.Categories[i];\n if (ctg.isToggled) {\n for (j = 0; j < ctg.Events.length; j++) {\n if (ctg.Events[j].StartDate == forDate) {\n eventsOnDate.push(ctg.Events[j]);\n eventInd_ctgTitle_ctgColors_ctgInd.push(j.toString() + \"_\" + ctg.Title + \"_\" + ctg.Color + \"_\" + i.toString());\n }\n }\n }\n }\n if (eventsOnDate.length > 0) {\n var counter = 0;\n var eventLayers = generateColoredStructure(eventsOnDate, eventInd_ctgTitle_ctgColors_ctgInd);\n for (var layer = 0; layer < eventLayers.layers.length; layer++) {\n for (var i = 0; i < eventLayers.layers[layer].length; i++) {\n\n const event = eventLayers.layers[layer][i];\n const evtInd_title_color_ctgInd = eventLayers.evtInds_titles_colors_ctgInds[layer][i].split(\"_\");\n const evtIndex = parseInt(evtInd_title_color_ctgInd[0]);\n const ctgTitle = evtInd_title_color_ctgInd[1];\n const color = evtInd_title_color_ctgInd[2];\n const ctgIndex = parseInt(evtInd_title_color_ctgInd[3]);\n\n var eventSpan = document.createElement('span');\n eventSpan.className = 'event';\n eventSpan.id = 'event-' + event.Title + \"-\" + counter.toString();\n\n //add title \n var titleSpan = document.createElement('span');\n titleSpan.innerHTML = event.Title;\n titleSpan.className = 'event-title';\n titleSpan.addEventListener('click', function () {\n initEventModal_editor(modelJSON, event, evtIndex, ctgIndex);\n activateEventModal_editor();\n });\n eventSpan.appendChild(titleSpan);\n\n eventSpan.style.width = calculateWidth(event.Duration);\n eventSpan.style.left = calculateHorizPosition(event.StartTime);\n eventSpan.style.bottom = (layer * 43).toString() + 'px';\n eventSpan.style.backgroundColor = color;\n addDeleteBtn(eventSpan, event.Event_Id, evtIndex, ctgIndex);\n container.appendChild(eventSpan);\n\n counter++;\n }\n }\n }\n \n}", "title": "" }, { "docid": "e3fb3137e9f57d0a97b3caf57294c186", "score": "0.45768303", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "e3fb3137e9f57d0a97b3caf57294c186", "score": "0.45768303", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "title": "" }, { "docid": "185f85c345a950e2a39b89a2a0981c15", "score": "0.45741394", "text": "function addEventsToJTimeBooker(stH,stM,etH,etM,bdH,bdM){\n\n startingTimeH = stH;\n startingTimeM = stM;\n endingTimeH = etH;\n endingTimeM = etM;\n bookingDurationH = bdH;\n bookingDurationM = bdM;\n\n JBookingElementEvents(stH,'starting-time-hour');\n JBookingElementEvents(stM,'starting-time-minute');\n JBookingElementEvents(etH,'ending-time-hour');\n JBookingElementEvents(etM,'ending-time-minute');\n JBookingElementEvents(bdH,'booking-duration-hours');\n JBookingElementEvents(bdM,'booking-duration-minutes');\n\n}", "title": "" }, { "docid": "322038c3b1bc89e463c0b598ad62fbaf", "score": "0.45733905", "text": "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n let inverseBgByGroupId = {};\n let inverseBgByDefId = {};\n let defByGroupId = {};\n let bgRanges = [];\n let fgRanges = [];\n let eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (let defId in eventStore.defs) {\n let def = eventStore.defs[defId];\n let ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (let instanceId in eventStore.instances) {\n let instance = eventStore.instances[instanceId];\n let def = eventStore.defs[instance.defId];\n let ui = eventUis[def.defId];\n let origRange = instance.range;\n let normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n let slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def,\n ui,\n instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (let groupId in inverseBgByGroupId) { // BY GROUP\n let ranges = inverseBgByGroupId[groupId];\n let invertedRanges = invertRanges(ranges, framingRange);\n for (let invertedRange of invertedRanges) {\n let def = defByGroupId[groupId];\n let ui = eventUis[def.defId];\n bgRanges.push({\n def,\n ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (let defId in inverseBgByDefId) {\n let ranges = inverseBgByDefId[defId];\n let invertedRanges = invertRanges(ranges, framingRange);\n for (let invertedRange of invertedRanges) {\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n }", "title": "" }, { "docid": "8c34c0abdb1679a2a90b8501ecb5d316", "score": "0.45699847", "text": "_eventsArrayWillChange(array, idx, removedCount) {\n let removed = Ember.A();\n\n for (var i = idx; i < idx + removedCount; i++) {\n removed.pushObject(array.objectAt(i));\n }\n\n this.$().fullCalendar('removeEvents', eventObject => removed.contains(eventObject.originalObject));\n }", "title": "" }, { "docid": "0f652163d227e24568eeabf78f13e021", "score": "0.4569583", "text": "setOldEventsToShow(){\n \n var aujourdhui = this.today.getTime()-1*(24*60*60*1000);\n \n this.eventsOldToShow =[]; // vide le tableau des eventsOlToShow avant chaque set\n \n for(var eventos of this.events){ // pour chaque date de fin d'event < a la date d'aujourdhui getTime\n \n if( aujourdhui > eventos.dateendevent.getTime() ){\n this.addOldEventsToShow(eventos);\n \n }\n \n }\n \n }", "title": "" }, { "docid": "34ce797f0b6c6799e60c2a976dd08ecb", "score": "0.4565305", "text": "function sliceEvents(props, allDay) {\n return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;\n}", "title": "" }, { "docid": "34ce797f0b6c6799e60c2a976dd08ecb", "score": "0.4565305", "text": "function sliceEvents(props, allDay) {\n return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;\n}", "title": "" }, { "docid": "34ce797f0b6c6799e60c2a976dd08ecb", "score": "0.4565305", "text": "function sliceEvents(props, allDay) {\n return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;\n}", "title": "" }, { "docid": "34ce797f0b6c6799e60c2a976dd08ecb", "score": "0.4565305", "text": "function sliceEvents(props, allDay) {\n return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;\n}", "title": "" }, { "docid": "d35e7a5f62014161cab549ced1352551", "score": "0.45596498", "text": "function fSetRangeSliders() {\n console.log('start slider set event function');\n noUiSlider.create(eEff_slider, {\n start: [1, 5], // Handle start position\n step: 1,\n connect: [false, true, false],\n range: { // Slider can select '0' to '100'\n 'min': 1,\n 'max': 5\n },\n });\n console.log('start slider set event function before setting second slider');\n noUiSlider.create(eDiff_slider, {\n start: [1, 5], // Handle start position\n step: 1,\n connect: [false, true, false],\n range: { // Slider can select '0' to '100'\n 'min': 1,\n 'max': 5\n },\n });\n console.log('start slider set event function after setting second slider');\n\n\n // append event listeners to sliders\n eEff_slider.noUiSlider.on('update', function (values) {\n console.log('eff slider update event start');\n if (values[0] == values[1])\n eEff_output.innerText = values[0];\n else\n eEff_output.innerText = values[0] + ' - ' + values[1];\n });\n eEff_slider.noUiSlider.on('end', function (values) {\n liEff_values = values;\n var iNew_diff = values[1] - values[0];\n bFilter_is_more = iEff_diff < iNew_diff;\n iEff_diff = iNew_diff;\n console.log('hallo end 1');\n fFiltering('eff', liEff_values);\n });\n\n\n eDiff_slider.noUiSlider.on('update', function (values) {\n if (values[0] == values[1])\n eDiff_output.innerText = values[0];\n else\n eDiff_output.innerText = values[0] + ' - ' + values[1];\n });\n eDiff_slider.noUiSlider.on('end', function (values) {\n liDiff_values = values;\n console.log(liDiff_values);\n var iNew_diff = values[1] - values[0];\n bFilter_is_more = iDiff_diff < iNew_diff;\n iDiff_diff = iNew_diff;\n console.log('hallo end 2');\n fFiltering('diff', values);\n });\n // #end append event listeners to sliders\n}", "title": "" }, { "docid": "f56bff7232632f68e32ed72ec5fb8034", "score": "0.4559087", "text": "function eventHasConflicts(myEvent) {\n\tvar events = document.getElementsByClassName('events')[0].childNodes\n\tif(events.length > 0) {\n\t\tfor( var i = 0; i < events.length; i++) {\n\t\t\tif((!(events[i].start > myEvent.start && events[i].start > myEvent.end) && !(events[i].end < myEvent.start))) {\n\t\t\t\treturn events[i]\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d506796bf4956168c4c34ef9f3b6cad5", "score": "0.45584148", "text": "function drawAllEvents() {\n getMbsEvents()\n .then(sortDate)\n .then(makeParty)\n}", "title": "" } ]
6e7890dda37b9f5af3f180112e3528c4
Executes a function given: input: array of arguments self: context to run function in (i.e. item to set to `self`)
[ { "docid": "5ebbd2a29bc13235624fb6b6bfd3b02e", "score": "0.0", "text": "exec(input, self) {\n let scope = this.generateScope(input, self);\n\n if (!(scope instanceof CheddarScope))\n return scope;\n\n let tmp;\n\n // Detemine if body is JS Function, or Cheddar item\n if (typeof this.body === 'function') {\n return this.body(\n scope,\n name => (tmp = scope.accessor(name)) && tmp.Value,\n input\n );\n } else {\n // Determine if body is expression or block\n let executor = require(\n this.body.constructor.name === \"StatementExpression\" ?\n '../eval/eval' :\n '../../exec'\n );\n\n // Adjust Syntax Tree for proper excution pass:\n // 1) Syntax Tree\n // 2) Callback scope\n // 3) Context data (for private variable accessing)\n let res = new executor(\n this.body.constructor.name === \"StatementExpression\" ?\n this.body :\n this.body._Tokens[0],\n scope,\n this.data\n ).exec();\n\n // Handle signals such as break and return\n if (res instanceof Signal) {\n if (res.is(Signal.RETURN)) {\n res = res.data;\n }\n }\n\n return res;\n }\n }", "title": "" } ]
[ { "docid": "2bd1ffa63af0f6a461c50002f116a4f5", "score": "0.6341141", "text": "function setThisWithCall(fn, thisValue, arg){\n return fn.call(thisValue, arg);\n}", "title": "" }, { "docid": "2d0000c6be73c230443f2f3db3cf99ac", "score": "0.6285515", "text": "function setThisWithCall(fn, thisValue, arg) {\n return fn.call(thisValue, arg);\n}", "title": "" }, { "docid": "27465c9e5c6abebde9cc03f9b2136af6", "score": "0.6115543", "text": "function setThisWithApply(fn, thisValue, args) {\n return fn.apply(thisValue, args);\n}", "title": "" }, { "docid": "867542e0ac347e6de5ad5890a339f71c", "score": "0.6067466", "text": "function setThisWithApply(fn, thisValue, args) {\n return fn.apply(thisValue, args)\n}", "title": "" }, { "docid": "6ee2388564db6531325a8edcbd9f5c3b", "score": "0.5740275", "text": "function processThis(obj,fn){\n\t\t\t\treturn function(e){fn.call(obj,e)}\t\n}", "title": "" }, { "docid": "935bc27e1b82ea347c85d8721245e83b", "score": "0.5723911", "text": "fireWith (context, args) {\n let list = this.list\n for (let i = 0, len; i < list.length; i++) {\n list[i].apply(context, args.slice ? args.slice() : args)\n }\n \n return this\n }", "title": "" }, { "docid": "4b033a8d32b79e600f64d9f97548920f", "score": "0.572198", "text": "function myForEach(arr, func){\n //loop through array\n for(var i = 0; i <arr.length; i++){\n //call func for each item in array\n func(arr[i]);\n }\n}", "title": "" }, { "docid": "f64610e6cd248fabc551cbbdf76e699e", "score": "0.5720388", "text": "executeFunction(fn, args) { return fn(...args); }", "title": "" }, { "docid": "21116f4062de2d669e6bafb12598cebe", "score": "0.57080764", "text": "function foreach(input_array, func) {\r\n for (var i = 0; i < input_array.length; i++) {\r\n input_array[i] = func(input_array[i]);\r\n }\r\n return input_array;\r\n}", "title": "" }, { "docid": "f8faca2a0322e1e34dffdf58dcdddab1", "score": "0.5694939", "text": "Execute(Variant, Variant, int) {\n\n }", "title": "" }, { "docid": "4d141acd5498011b8c3f2928de64f79e", "score": "0.56607103", "text": "function set(arg) {\n\tvar old = state;\n\tif (_.isFunction(arg))\n\t\targ.call(state)\n\telse\n\t\t_.assign(state, arg);\n}", "title": "" }, { "docid": "56a0b47e5874623da63f1ce5c87775b5", "score": "0.56338525", "text": "function update$1() {\n const length = arguments.length;\n for (let i = 1; i < length; i++) {\n this[i - 1](arguments[i]);\n }\n }", "title": "" }, { "docid": "dcf343c806dc2bd077cbab7bb4529836", "score": "0.5624533", "text": "function myForEach2(arr, func) {\n for(var i = 0; i < arr.length; i++) {\n // call func for each item in the array and pass the current index as parameter\n func(arr[i]);\n }\n}", "title": "" }, { "docid": "f4a840ae594ae78bcc269fd221748204", "score": "0.5623266", "text": "function execute(someFunction, value) {\n someFunction(value);\n}", "title": "" }, { "docid": "655de7f8c84c17a43c97a811fb468e45", "score": "0.55884165", "text": "function execute(someFunction, value) {\n someFunction(value);\n}", "title": "" }, { "docid": "3fd62a39e2be808143df3c08075134f7", "score": "0.55810606", "text": "function myForEach(arr, func) {\n // loop through array\n for(var i = 0; i < arr.length; i++) {\n // Call function for each item in the array\n func(arr[i]);\n }\n}", "title": "" }, { "docid": "470d06e1b8a09ada46b112b670f8cb8a", "score": "0.55473715", "text": "function myForEach(array,func){\n for(var i = 0; i < array.length; i++){\n func(array[i],i)\n }\n}", "title": "" }, { "docid": "0796749ecaac98e1280fbf31a2088396", "score": "0.5545805", "text": "function call ( f, scope, args ) {\n\n\t\t\t// Allow the passing of an unwrapped function.\n\t\t\t// Leaves other code a more comprehensible.\n\t\t\tif( !$.isArray(f) ){\n\t\t\t\tf = [f];\n\t\t\t}\n\n\t\t\t$.each(f,function(i,q){\n\t\t\t\tif (typeof q === \"function\") {\n\t\t\t\t\tq.call(scope, args);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "c820239ede7c0933876dacf575166f09", "score": "0.55286133", "text": "function triggerFunction(fn) {\n \tfn.apply(this,args);\n }", "title": "" }, { "docid": "9ce38314564d11cc8418e9018a036371", "score": "0.5527274", "text": "function managedFnCall(item, scope, event, args) {\n // We change the scope of the function with respect to the\n // object that raised the event.\n try {\n item[0].call(scope, event, args || {});\n } catch (e) {\n // Call error in a separate thread to avoid stopping\n // of chart load.\n setTimeout(function () {\n throw e;\n }, 0);\n }\n}", "title": "" }, { "docid": "fba27fd97bd379ca0e3698a3a4817494", "score": "0.54905903", "text": "function applyArgs(func, thisObj, args) {\r\n\treturn func.apply(thisObj, Array.prototype.slice.call(args));\r\n}", "title": "" }, { "docid": "2e7a7ee87ab57c8e1a67dc09ab4520a4", "score": "0.5489904", "text": "function apply(e, thisObj, fn, args, c, cerr, env) {\n if (fn === eval) {\n if (typeof args[0] === \"string\") {\n // here is the case where `eval` is executed in metacircular space, therefore it has to be\n // handled in special way\n function cc(e, result) {\n c(result);\n }\n \n metaEval(e, args, env, cc, cerr);\n } else {\n c(args[0]);\n }\n } else if (fn.metaFunction instanceof MetaFunction) {\n fn.metaFunction.run(thisObj, args, c, cerr, env);\n } else {\n try {\n c(fn.apply(thisObj, args));\n } catch (e) {\n cerr(\"Error\", e);\n }\n }\n }", "title": "" }, { "docid": "13567d64f11693e9cbf6ca7233c4564c", "score": "0.5477169", "text": "function Item(fun,array){this.fun=fun,this.array=array}", "title": "" }, { "docid": "9f39c3c2a7ff35d51e941e15d52c4b66", "score": "0.54630554", "text": "function input(first, last, callback, objScope){\n\tcallback.apply(objScope, [first, last])\n}", "title": "" }, { "docid": "2a0f2bf2921a4d187baf0e5b29d7d64e", "score": "0.54534954", "text": "call(fn, ...args) {\n return fn.apply(this, args);\n }", "title": "" }, { "docid": "862f7d4f35960e2c2b640d04936c7d13", "score": "0.545017", "text": "function callingInAnArrayContext() {\n let arr = [\"a\", \"b\"];\n\n arr.push(function () {\n alert(this);\n })\n\n arr[2](); // array object: \"a,b,function...\"\n}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "e7dcc3b19988f437486fa3b0b3694899", "score": "0.5435449", "text": "function Item(fun,array){this.fun=fun;this.array=array;}", "title": "" }, { "docid": "511098e37742beb701eaf4b034b28e0a", "score": "0.5429752", "text": "function runThis(argOne, argTwo) {\n pick(argOne, argTwo);\n}", "title": "" }, { "docid": "be0efd0dbe10a7ece2c956a9139de967", "score": "0.5412663", "text": "function simpleBind(context,fn){return function(value){fn.call(context,value);};}", "title": "" }, { "docid": "df58392253582407864455ebfe78ddc1", "score": "0.54014206", "text": "function shit(arr, func){\n arr.forEach(function(i) {func(i)});\n}", "title": "" }, { "docid": "ff27dbb80874cfd10660c5af3c180247", "score": "0.5393851", "text": "function f(arg) {\n return this.invoke(arg);\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.53917027", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "9ad9928abd03e0845b99e00c079d401f", "score": "0.53755844", "text": "function forEachTransform(args, math, scope) {\n var x, callback;\n\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n\n if (args[1]) {\n if (Object(_utils_is__WEBPACK_IMPORTED_MODULE_0__[\"isSymbolNode\"])(args[1]) || Object(_utils_is__WEBPACK_IMPORTED_MODULE_0__[\"isFunctionAssignmentNode\"])(args[1])) {\n // a function pointer, like forEach([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like forEach([3, -2, 5], x > 0 ? callback1(x) : callback2(x) )\n callback = Object(_utils_compileInlineExpression__WEBPACK_IMPORTED_MODULE_4__[\"compileInlineExpression\"])(args[1], math, scope);\n }\n }\n\n return _forEach(x, callback);\n }", "title": "" }, { "docid": "dee2fef877d74ccf4aae77acebbafa8c", "score": "0.5366676", "text": "function run() {\n var index = -1;\n var input = slice$1.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input));\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index];\n var params = slice$1.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap_1(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "title": "" }, { "docid": "40772723c99cdef02ad8b598166f932d", "score": "0.5352392", "text": "function run() {\n var index = -1;\n var input = slice$1.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input));\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index];\n var params = slice$1.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap_1(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "title": "" }, { "docid": "600bcfd1023c2605a011b1b63c0f1aee", "score": "0.5349443", "text": "function invoke (fn) {\n return fn(2,3);\n}", "title": "" }, { "docid": "472a489633f74a1cc2c957044204bdf8", "score": "0.5339908", "text": "function run() {\n var index = -1;\n var input = slice.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done);\n }\n\n next.apply(null, [null].concat(input));\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "title": "" }, { "docid": "472a489633f74a1cc2c957044204bdf8", "score": "0.5339908", "text": "function run() {\n var index = -1;\n var input = slice.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done);\n }\n\n next.apply(null, [null].concat(input));\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index];\n var params = slice.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return;\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "title": "" }, { "docid": "7f5148000b8a1d3d805c71eba1fd9611", "score": "0.5339828", "text": "static scopedEval(thisContext, namedArgs, code) {\n // TODO: use entries -v\n const argPairs = Object.keys(namedArgs).map(key => [key, namedArgs[key]]);\n const argNames = argPairs.map(pair => pair[0]);\n const argValues = argPairs.map(pair => pair[1]);\n const func = new Function(...argNames, code);\n return func.apply(thisContext, argValues);\n }", "title": "" }, { "docid": "fdefd20848909859bda7990bc747be4c", "score": "0.5319725", "text": "function myForEach(arr, func){\n\tfor(var i = 0; i < arr.length; i++){\n\t\tfunc(arr[i]);\n\t}\n}", "title": "" }, { "docid": "143656cbf7d045b92afacb52ee3d910a", "score": "0.5313776", "text": "function change(array, f) {\n for (var i = 0; i < array.length; i++) {\n array[i] = f(array[i]);\n }\n}", "title": "" }, { "docid": "111efd057b81cadc575b138308675c70", "score": "0.5291862", "text": "function ApplyToThis(f) {\n return function (a) { return f(this, a); };\n}", "title": "" }, { "docid": "111efd057b81cadc575b138308675c70", "score": "0.5291862", "text": "function ApplyToThis(f) {\n return function (a) { return f(this, a); };\n}", "title": "" }, { "docid": "111efd057b81cadc575b138308675c70", "score": "0.5291862", "text": "function ApplyToThis(f) {\n return function (a) { return f(this, a); };\n}", "title": "" }, { "docid": "0540825e9fa4b93bf78ac469fd11d4e9", "score": "0.5286539", "text": "function callWith() {\n var args = arguments;\n return function (fn) {\n return fn.apply(this, args);\n };\n }", "title": "" }, { "docid": "928a4c80bd057065fd7f513c6e042d77", "score": "0.5273314", "text": "function executeEach(arr, fun) {\n var i = -1;\n while (++i < arr.length) {\n if (arr[i]) {\n fun(arr[i]);\n }\n }\n }", "title": "" }, { "docid": "f91049966135c97cf6cfb34f6c528789", "score": "0.5266382", "text": "function myForEach(arr, fun) {\n for (let item of arr) {\n fun(item);\n }\n}", "title": "" }, { "docid": "976e4321844ba9d555195fc92dabb790", "score": "0.52644074", "text": "function runFunction (f, env, args) {\n\treturn f.apply (env, args);\n}", "title": "" }, { "docid": "0dffee46c7815e6c6e4df782e7efdec7", "score": "0.5258772", "text": "function call() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}", "title": "" }, { "docid": "af4f793fba95b668d4344a4cd3ad2ae9", "score": "0.525443", "text": "use(fn) {\r\n const args = [this];\r\n for (var i = 1; i < arguments.length; i++) {\r\n args.push(arguments[i]);\r\n }\r\n fn.apply(null, args);\r\n return this;\r\n }", "title": "" }, { "docid": "a9a9adea50cf42ebaff566ee2e313370", "score": "0.52508706", "text": "function Item(fun, array) {\n\t\t\tthis.fun = fun;\n\t\t\tthis.array = array;\n\t\t}", "title": "" }, { "docid": "7138ff517fa615e77c0dcd95f7262e4f", "score": "0.5246725", "text": "function myForEach(arr, func) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tfunc(arr[i]);\n\t}\n}", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "7b44e840a0222e23e169e2a2a49f36ca", "score": "0.5245197", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }", "title": "" }, { "docid": "72cf7bff9c5836c2379f12554da4e85f", "score": "0.5243505", "text": "function flow() {\n var functions = arguments;\n return function(array) {\n var value = array;\n for (var i = 0; i < functions.length; i++) {\n value = functions[i](value);\n }\n return value;\n }\n}", "title": "" }, { "docid": "26e5d8d456e859661e7ba1686cec664c", "score": "0.5237122", "text": "call(input, kwargs) { return input.square().sum();}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" }, { "docid": "f8897adcb38c98dcb8bccb40299310bf", "score": "0.5236807", "text": "function Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}", "title": "" } ]
32e8df885f1ce8a2300020a5a2d257c5
Parses litrelated declaration members.
[ { "docid": "c1056f87edd1889bda587768c9442ec9", "score": "0.5273478", "text": "function discoverMembers$1(node, context) {\n var ts = context.ts;\n // Never pick up members not declared directly on the declaration node being traversed\n if (node.parent !== context.declarationNode) {\n return undefined;\n }\n // static get properties() { return { myProp: {type: String} } }\n if (ts.isGetAccessor(node) && hasModifier(node, ts.SyntaxKind.StaticKeyword)) {\n var name_1 = node.name.getText();\n if (name_1 === \"properties\" && node.body != null) {\n var returnStatement = node.body.statements.find(ts.isReturnStatement.bind(ts));\n if (returnStatement != null) {\n return parseStaticProperties(returnStatement, context);\n }\n }\n }\n // @property({type: String}) myProp = \"hello\";\n else if (ts.isSetAccessor(node) || ts.isGetAccessor(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node)) {\n return parsePropertyDecorator(node, context);\n }\n}", "title": "" } ]
[ { "docid": "3fad2253b7019619bc891d9a57c0858c", "score": "0.58919966", "text": "parseVarHead(decl) {\n super.parseVarHead(decl);\n\n if (this.match(types.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.finishNode(decl.id, decl.id.type);\n }\n }", "title": "" }, { "docid": "033341ddd298eccc0b68526a1fec8cb4", "score": "0.57371163", "text": "tsParseDeclaration(node, value, next) {\n switch (value) {\n case \"abstract\":\n if (next || this.match(types._class)) {\n const cls = node;\n cls.abstract = true;\n if (next) this.next();\n return this.parseClass(cls,\n /* isStatement */\n true,\n /* optionalId */\n false);\n }\n\n break;\n\n case \"enum\":\n if (next || this.match(types.name)) {\n if (next) this.next();\n return this.tsParseEnumDeclaration(node,\n /* isConst */\n false);\n }\n\n break;\n\n case \"interface\":\n if (next || this.match(types.name)) {\n if (next) this.next();\n return this.tsParseInterfaceDeclaration(node);\n }\n\n break;\n\n case \"module\":\n if (next) this.next();\n\n if (this.match(types.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (next || this.match(types.name)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n\n break;\n\n case \"namespace\":\n if (next || this.match(types.name)) {\n if (next) this.next();\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n\n break;\n\n case \"type\":\n if (next || this.match(types.name)) {\n if (next) this.next();\n return this.tsParseTypeAliasDeclaration(node);\n }\n\n break;\n }\n }", "title": "" }, { "docid": "2c97c94830878357fe4482b1aefc6e90", "score": "0.5605703", "text": "for (const subnode of node.body) {\n\t\t\tyield* searchDeclarations(subnode)\n\t\t}", "title": "" }, { "docid": "a2c765313009b1360b76d783b7b48011", "score": "0.55851096", "text": "function parsedeclarations(index){ // take a string from the munged array and parse it into an object of property: value pairs\n\t\tvar str = munged[index].replace(/^{|}parser/g, ''); // find the string and remove the surrounding braces\n\t\tstr = munge(str); // make sure any internal braces or strings are escaped\n var parsed = {};\n str.split(';').forEach(function (decl){\n decl = decl.split(':');\n if (decl.length < 2) return;\n parsed[restore(decl[0])] = restore(decl.slice(1).join(':'));\n });\n return parsed;\n }", "title": "" }, { "docid": "3a4b4cad3252e580cfe841e33f6fbcd6", "score": "0.5578044", "text": "onDeclaration(context, reflection, node) {\n if (node && node.symbol && node.jsDoc) {\n let tags = [];\n node.jsDoc.forEach(node => tags = tags.concat((node.tags || [])\n .filter(tag => tag.tagName && tag.tagName.text === 'name')));\n if (tags.length) {\n const ref = reflection;\n // Heads up - if user declared more than 1 tag we take the last one\n this.respectThisNames.push({ renameTo: tags[tags.length - 1].comment, reflection });\n }\n }\n }", "title": "" }, { "docid": "eb87cdd123ae05684ddec167896e6444", "score": "0.55491513", "text": "parseLocalDeclaration() {\n const node = this.startNode();\n this.expect(Token.LET);\n node.name = this.parseIdentifier();\n this.expect(Token.ASSIGN);\n node.value = this.parseExpression();\n this.expect(Token.SEMICOLON);\n return this.finishNode(node, 'LocalDeclaration');\n }", "title": "" }, { "docid": "2d6b27eda0bb9636fa9d3ea50ef2c96a", "score": "0.55321705", "text": "[[\n \"VariableDeclaration\",\n \"FunctionDeclaration\",\n \"FunctionExpression\",\n \"ArrowFunctionExpression\",\n \"ClassDeclaration\",\n \"ClassExpression\",\n \"CatchClause\"\n ]](node) {\n for (const variable of sourceCode.getDeclaredVariables(node)) {\n if (isGoodName(variable.name)) {\n continue;\n }\n const id = variable.identifiers[0];\n\n // Report declaration.\n if (!(ignoreDestructuring && equalsToOriginalName(id))) {\n report(id);\n }\n\n /*\n * For backward compatibility, report references as well.\n * It looks unnecessary because declarations are reported.\n */\n for (const reference of variable.references) {\n if (reference.init) {\n continue; // Skip the write references of initializers.\n }\n reportReferenceId(reference.identifier);\n }\n }\n }", "title": "" }, { "docid": "59f4cb748b417a49bcd830e852463f80", "score": "0.54858154", "text": "parseImportSpecifiers(node) {\n let first = true;\n\n if (this.shouldParseDefaultImport(node)) {\n // import defaultObj, { x, y as z } from '...'\n this.parseImportSpecifierLocal(node, this.startNode(), \"ImportDefaultSpecifier\", \"default import specifier\");\n if (!this.eat(types.comma)) return;\n }\n\n if (this.match(types.star)) {\n const specifier = this.startNode();\n this.next();\n this.expectContextual(\"as\");\n this.parseImportSpecifierLocal(node, specifier, \"ImportNamespaceSpecifier\", \"import namespace specifier\");\n return;\n }\n\n this.expect(types.braceL);\n\n while (!this.eat(types.braceR)) {\n if (first) {\n first = false;\n } else {\n // Detect an attempt to deep destructure\n if (this.eat(types.colon)) {\n this.unexpected(null, \"ES2015 named imports do not destructure. \" + \"Use another statement for destructuring after the import.\");\n } // XXX: LSC Commaless\n\n\n this.expectListSeparator();\n if (this.eat(types.braceR)) break;\n }\n\n this.parseImportSpecifier(node);\n }\n }", "title": "" }, { "docid": "f1cb6341e6bb840d2d5acc483c6a898a", "score": "0.5468794", "text": "onDeclaration(context, reflection, node) {\n if (node && node.symbol && node.jsDoc) {\n let tags = [];\n node.jsDoc.forEach(node => tags = tags.concat((node.tags || [])\n .filter(tag => tag.tagName && tag.tagName.text === 'asMemberOf')));\n if (tags.length) {\n this.asMemberOfPool.push({ parentName: tags[tags.length - 1].comment, reflection });\n }\n }\n }", "title": "" }, { "docid": "d46fd5497abc8da2efc3e38cf644e96b", "score": "0.53974104", "text": "parseVectorAccess(from) {\n if (from == 'struct') {\n this.structArgs.arrayArgs = this.arrayArgs\n this.accessor.append.push(this.structArgs)\n } else if (from == 'array') {\n this.accessor.append.push(this.arrayArgs)\n }\n console.log(this.accessor);\n if (this.consume(\".\")) {\n let structIdentifier = this.currentLexeme;\n if (this.consume(\"Identifier\", true)) {\n this.structArgs.identifier = structIdentifier;\n this.parseVectorDeclaration(\"struct\");\n }\n }\n }", "title": "" }, { "docid": "921da5661ca4075a5f03791f3c621acd", "score": "0.53778833", "text": "VariableDeclaration(node) {\n this.meta.set('kind-of-declaration', node.kind);\n this.baseVisit(node);\n node.declarations.forEach(declaration => this.graph.addEdge(declaration, node));\n this.meta.delete('kind-of-declaration');\n }", "title": "" }, { "docid": "739af5cfa6ab3e2eaae830965c389e91", "score": "0.5375583", "text": "function parseVariableDeclaration() {\n var type = parseType()\n var id,\n value\n\n if (at('[')){\n match('[')\n match(']')\n id = match('ID')\n match('=')\n value = parseArray(type)\n match('derp')\n } else {\n id = match('ID')\n if(at('=')){\n match('=')\n value = parseExpression()\n }\n\tmatch('derp')\n }\n return new VariableDeclaration(id, type, value)\n}", "title": "" }, { "docid": "64c6347b580ab5c11a29dcd6570c2174", "score": "0.5328839", "text": "visitDeclaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "de1fe9a1713d5e26ad82a11cc2df6e57", "score": "0.52814114", "text": "enterMemberDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "f39b681311920cc3f21e81cec94807a4", "score": "0.5258521", "text": "VariableDeclarationList() {\n const declarations = [this.VariableDeclaration()];\n\n while (this.#checkIfLookahead(tokens.COMA) && this.#eat(tokens.COMA)) {\n declarations.push(this.VariableDeclaration());\n }\n\n return declarations;\n }", "title": "" }, { "docid": "eee6081101f6c1c268b3f3d52a558a2b", "score": "0.52089155", "text": "function declaration(toks, i, n, handler) {\n var property = toks[i++];\n if (!ident.test(property)) {\n return i+1; // skip one token.\n }\n var tok;\n if (i < n && toks[i] === ' ') { ++i; }\n if (i == n || toks[i] !== ':') {\n // skip tokens to next semi or close bracket.\n while (i < n && (tok = toks[i]) !== ';' && tok !== '}') { ++i; }\n return i;\n }\n ++i;\n if (i < n && toks[i] === ' ') { ++i; }\n\n // None of the rules we care about want atrules or blocks in value, so\n // we look for any+ but that is the same as selector but not zero-length.\n // This gets us the benefit of not emitting any value with mismatched\n // brackets.\n var s = i, e = selector(toks, i, n, false);\n if (e < 0) {\n // Skip malformed content per selector calling convention.\n e = ~e;\n } else {\n var value = [], valuelen = 0;\n for (var j = s; j < e; ++j) {\n tok = toks[j];\n if (tok !== ' ') {\n value[valuelen++] = tok;\n }\n }\n // One of the following is now true:\n // (1) e is flush with the end of the tokens as in <... style=\"x:y\">.\n // (2) tok[e] points to a ';' in which case we need to consume the semi.\n // (3) tok[e] points to a '}' in which case we don't consume it.\n // (4) else there is bogus unparsed value content at toks[e:].\n // Allow declaration flush with end for style attr body.\n if (e < n) { // 2, 3, or 4\n do {\n tok = toks[e];\n if (tok === ';' || tok === '}') { break; }\n // Don't emit the property if there is questionable trailing content.\n valuelen = 0;\n } while (++e < n);\n if (tok === ';') {\n ++e;\n }\n }\n if (valuelen && handler.declaration) {\n // TODO: coerce non-keyword ident tokens to quoted strings.\n handler.declaration(property.toLowerCase(), value);\n }\n }\n return e;\n }", "title": "" }, { "docid": "eee6081101f6c1c268b3f3d52a558a2b", "score": "0.52089155", "text": "function declaration(toks, i, n, handler) {\n var property = toks[i++];\n if (!ident.test(property)) {\n return i+1; // skip one token.\n }\n var tok;\n if (i < n && toks[i] === ' ') { ++i; }\n if (i == n || toks[i] !== ':') {\n // skip tokens to next semi or close bracket.\n while (i < n && (tok = toks[i]) !== ';' && tok !== '}') { ++i; }\n return i;\n }\n ++i;\n if (i < n && toks[i] === ' ') { ++i; }\n\n // None of the rules we care about want atrules or blocks in value, so\n // we look for any+ but that is the same as selector but not zero-length.\n // This gets us the benefit of not emitting any value with mismatched\n // brackets.\n var s = i, e = selector(toks, i, n, false);\n if (e < 0) {\n // Skip malformed content per selector calling convention.\n e = ~e;\n } else {\n var value = [], valuelen = 0;\n for (var j = s; j < e; ++j) {\n tok = toks[j];\n if (tok !== ' ') {\n value[valuelen++] = tok;\n }\n }\n // One of the following is now true:\n // (1) e is flush with the end of the tokens as in <... style=\"x:y\">.\n // (2) tok[e] points to a ';' in which case we need to consume the semi.\n // (3) tok[e] points to a '}' in which case we don't consume it.\n // (4) else there is bogus unparsed value content at toks[e:].\n // Allow declaration flush with end for style attr body.\n if (e < n) { // 2, 3, or 4\n do {\n tok = toks[e];\n if (tok === ';' || tok === '}') { break; }\n // Don't emit the property if there is questionable trailing content.\n valuelen = 0;\n } while (++e < n);\n if (tok === ';') {\n ++e;\n }\n }\n if (valuelen && handler.declaration) {\n // TODO: coerce non-keyword ident tokens to quoted strings.\n handler.declaration(property.toLowerCase(), value);\n }\n }\n return e;\n }", "title": "" }, { "docid": "68795c5b3d0fa64248dbee73202afc22", "score": "0.51915234", "text": "parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }", "title": "" }, { "docid": "68795c5b3d0fa64248dbee73202afc22", "score": "0.51915234", "text": "parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }", "title": "" }, { "docid": "1b1b41730a7ea09420f9f7566ef7f1df", "score": "0.5173137", "text": "parseVar(node, isFor, kind) {\n const declarations = node.declarations = []; // $FlowFixMe\n\n node.kind = kind.keyword;\n\n for (;;) {\n const decl = this.startNode();\n this.parseVarHead(decl);\n this.parseVarInit(decl, isFor, kind); // LSC\n\n declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(types.comma)) break;\n }\n\n return node;\n }", "title": "" }, { "docid": "73f61fb5d4bc7fadae69e36b3794cd65", "score": "0.5152353", "text": "ImportDeclaration(node) {\n for (const variable of sourceCode.getDeclaredVariables(node)) {\n if (isGoodName(variable.name)) {\n continue;\n }\n const id = variable.identifiers[0];\n\n // Report declaration.\n if (!(ignoreImports && equalsToOriginalName(id))) {\n report(id);\n }\n\n /*\n * For backward compatibility, report references as well.\n * It looks unnecessary because declarations are reported.\n */\n for (const reference of variable.references) {\n reportReferenceId(reference.identifier);\n }\n }\n }", "title": "" }, { "docid": "4c9963e28834c0dfa43d7eb3908a0885", "score": "0.51311487", "text": "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = this.atLineStart ? PlainValue.Node.endOfIndent(src, offset) : PlainValue.Node.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === PlainValue.Char.ANCHOR || ch === PlainValue.Char.COMMENT || ch === PlainValue.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n const lineStart = offset + 1;\n const inEnd = PlainValue.Node.endOfIndent(src, lineStart);\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === PlainValue.Type.SEQ_ITEM && parent.context.atLineStart;\n if (!PlainValue.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === PlainValue.Char.COMMENT) {\n const end = PlainValue.Node.endOfLine(src, offset + 1);\n props.push(new PlainValue.Range(offset, end));\n offset = end;\n } else {\n let end = PlainValue.Node.endOfIdentifier(src, offset + 1);\n\n if (ch === PlainValue.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = PlainValue.Node.endOfIdentifier(src, end + 5);\n }\n\n props.push(new PlainValue.Range(offset, end));\n lineHasProps = true;\n offset = PlainValue.Node.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && PlainValue.Node.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "title": "" }, { "docid": "8fd7fef60abfc6b632d9daecf876137a", "score": "0.5120411", "text": "function declaration(toks, i, n, handler) {\n var property = toks[i++];\n if (!ident.test(property)) {\n return skipDeclaration(toks, i, n);\n }\n var tok;\n if (i < n && toks[i] === ' ') { ++i; }\n if (i == n || toks[i] !== ':') {\n return skipDeclaration(toks, i, n);\n }\n ++i;\n if (i < n && toks[i] === ' ') { ++i; }\n\n // None of the rules we care about want atrules or blocks in value, so\n // we look for any+ but that is the same as selector but not zero-length.\n // This gets us the benefit of not emitting any value with mismatched\n // brackets.\n var s = i, e = selector(toks, i, n, false);\n if (e < 0) {\n // Skip malformed content per selector calling convention.\n e = ~e;\n } else {\n var value = [], valuelen = 0;\n for (var j = s; j < e; ++j) {\n tok = toks[j];\n if (tok !== ' ') {\n value[valuelen++] = tok;\n }\n }\n // One of the following is now true:\n // (1) e is flush with the end of the tokens as in <... style=\"x:y\">.\n // (2) tok[e] points to a ';' in which case we need to consume the semi.\n // (3) tok[e] points to a '}' in which case we don't consume it.\n // (4) else there is bogus unparsed value content at toks[e:].\n // Allow declaration flush with end for style attr body.\n if (e < n) { // 2, 3, or 4\n do {\n tok = toks[e];\n if (tok === ';' || tok === '}') { break; }\n // Don't emit the property if there is questionable trailing content.\n valuelen = 0;\n } while (++e < n);\n if (tok === ';') {\n ++e;\n }\n }\n if (valuelen && handler['declaration']) {\n // TODO: coerce non-keyword ident tokens to quoted strings.\n handler['declaration'](property.toLowerCase(), value);\n }\n }\n return e;\n }", "title": "" }, { "docid": "152698d1d4d71e5aa1547d4940943ccc", "score": "0.5107174", "text": "parseImportSpecifiers(node) {\n node.importKind = \"value\";\n let kind = null;\n\n if (this.match(types._typeof)) {\n kind = \"typeof\";\n } else if (this.isContextual(\"type\")) {\n kind = \"type\";\n }\n\n if (kind) {\n const lh = this.lookahead(); // import type * is not allowed\n\n if (kind === \"type\" && lh.type === types.star) {\n this.unexpected(lh.start);\n }\n\n if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) {\n this.next();\n node.importKind = kind;\n }\n }\n\n super.parseImportSpecifiers(node);\n }", "title": "" }, { "docid": "1434f491450cb57621a55b5414984623", "score": "0.5098486", "text": "function discoverMembers(node, context) {\n var e_1, _a, e_2, _b;\n var _c, _d;\n var ts = context.ts, checker = context.checker;\n // Never pick up members not declared directly on the declaration node being traversed\n if (node.parent !== context.declarationNode) {\n return undefined;\n }\n // static get observedAttributes() { return ['c', 'l']; }\n if (ts.isGetAccessor(node) && hasModifier(node, ts.SyntaxKind.StaticKeyword)) {\n if (node.name.getText() === \"observedAttributes\" && node.body != null) {\n var members = [];\n // Find either the first \"return\" statement or the first \"array literal expression\"\n var arrayLiteralExpression = (_d = (_c = node.body.statements.find(function (statement) { return ts.isReturnStatement(statement); })) === null || _c === void 0 ? void 0 : _c.expression) !== null && _d !== void 0 ? _d : node.body.statements.find(function (statement) { return ts.isArrayLiteralExpression(statement); });\n if (arrayLiteralExpression != null && ts.isArrayLiteralExpression(arrayLiteralExpression)) {\n try {\n // Emit an attribute for each string literal in the array.\n for (var _e = __values(arrayLiteralExpression.elements), _f = _e.next(); !_f.done; _f = _e.next()) {\n var attrNameNode = _f.value;\n var attrName = ts.isStringLiteralLike(attrNameNode) ? attrNameNode.text : undefined;\n if (attrName == null)\n continue;\n members.push({\n priority: \"medium\",\n node: attrNameNode,\n jsDoc: getJsDoc(attrNameNode, ts),\n kind: \"attribute\",\n attrName: attrName,\n type: undefined // () => ({ kind: \"ANY\" } as SimpleType),\n });\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n return members;\n }\n }\n // class { myProp = \"hello\"; }\n else if (ts.isPropertyDeclaration(node) || ts.isPropertySignature(node)) {\n var name_1 = node.name, initializer = node.initializer;\n if (ts.isIdentifier(name_1) || ts.isStringLiteralLike(name_1)) {\n // Always ignore the \"prototype\" property\n if (name_1.text === \"prototype\") {\n return undefined;\n }\n // Find default value based on initializer\n var resolvedDefaultValue = initializer != null ? resolveNodeValue(initializer, context) : undefined;\n var def = resolvedDefaultValue != null ? resolvedDefaultValue.value : initializer === null || initializer === void 0 ? void 0 : initializer.getText();\n return [\n {\n priority: \"high\",\n node: node,\n kind: \"property\",\n jsDoc: getJsDoc(node, ts),\n propName: name_1.text,\n type: lazy(function () { return checker.getTypeAtLocation(node); }),\n default: def,\n visibility: getMemberVisibilityFromNode(node, ts),\n modifiers: getModifiersFromNode(node, ts)\n //required: isPropertyRequired(node, context.checker),\n }\n ];\n }\n }\n // class { set myProp(value: string) { ... } }\n else if (ts.isSetAccessor(node) || ts.isGetAccessor(node)) {\n var name_2 = node.name, parameters = node.parameters;\n if (ts.isIdentifier(name_2)) {\n var parameter_1 = ts.isSetAccessor(node) != null && (parameters === null || parameters === void 0 ? void 0 : parameters.length) > 0 ? parameters[0] : undefined;\n return [\n {\n priority: \"high\",\n node: node,\n jsDoc: getJsDoc(node, ts),\n kind: \"property\",\n propName: name_2.text,\n type: lazy(function () { return (parameter_1 == null ? context.checker.getTypeAtLocation(node) : context.checker.getTypeAtLocation(parameter_1)); }),\n visibility: getMemberVisibilityFromNode(node, ts),\n modifiers: getModifiersFromNode(node, ts)\n }\n ];\n }\n }\n // constructor { super(); this.title = \"Hello\"; }\n else if (ts.isConstructorDeclaration(node)) {\n if (node.body != null) {\n var assignments = node.body.statements\n .filter(function (stmt) { return ts.isExpressionStatement(stmt); })\n .map(function (stmt) { return stmt.expression; })\n .filter(function (exp) { return ts.isBinaryExpression(exp); });\n var members = [];\n var _loop_1 = function (assignment) {\n var left = assignment.left, right = assignment.right;\n if (ts.isPropertyAccessExpression(left)) {\n if (left.expression.kind === ts.SyntaxKind.ThisKeyword) {\n var propName = left.name.getText();\n var resolvedInitializer = resolveNodeValue(right, context);\n var def = resolvedInitializer != null ? resolvedInitializer.value : undefined; //right.getText();\n members.push({\n priority: \"low\",\n node: node,\n kind: \"property\",\n propName: propName,\n default: def,\n type: function () { return relaxType(tsSimpleType.toSimpleType(checker.getTypeAtLocation(right), checker)); },\n jsDoc: getJsDoc(assignment.parent, ts),\n visibility: isNamePrivate(propName) ? \"private\" : undefined\n });\n }\n }\n };\n try {\n for (var assignments_1 = __values(assignments), assignments_1_1 = assignments_1.next(); !assignments_1_1.done; assignments_1_1 = assignments_1.next()) {\n var assignment = assignments_1_1.value;\n _loop_1(assignment);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (assignments_1_1 && !assignments_1_1.done && (_b = assignments_1.return)) _b.call(assignments_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return members;\n }\n }\n return undefined;\n}", "title": "" }, { "docid": "c7154cb20c7ea127775d155be5ef35fd", "score": "0.50932133", "text": "parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(_tokenKind.TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: _kinds.Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives\n });\n }", "title": "" }, { "docid": "0241d54f9535c03264f492c9f55c2267", "score": "0.50868326", "text": "function getFieldDocsFromDeclaration(declaration, context) {\n var e_6, _a;\n var _b, _c;\n var fieldDocs = [];\n try {\n for (var _d = __values(filterVisibility(context.config.visibility, declaration.members)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var member = _e.value;\n if (member.propName != null) {\n fieldDocs.push({\n kind: \"field\",\n name: member.propName,\n privacy: member.visibility,\n description: (_b = member.jsDoc) === null || _b === void 0 ? void 0 : _b.description,\n type: getTypeHintFromType(member.typeHint || ((_c = member.type) === null || _c === void 0 ? void 0 : _c.call(member)), context.checker, context.config),\n default: member.default != null ? JSON.stringify(member.default) : undefined,\n inheritedFrom: getInheritedFromReference(declaration, member, context),\n summary: getSummaryFromJsDoc(member.jsDoc)\n // TODO: \"static\"\n });\n }\n }\n }\n catch (e_6_1) { e_6 = { error: e_6_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n }\n finally { if (e_6) throw e_6.error; }\n }\n return fieldDocs;\n}", "title": "" }, { "docid": "44d9b3303a01041d69bfbe57c13ca525", "score": "0.5081763", "text": "function parseNamedType(parser) { // 594\n\t var start = parser.token.start; // 595\n\t return { // 596\n\t kind: _kinds.NAMED_TYPE, // 597\n\t name: parseName(parser), // 598\n\t loc: loc(parser, start) // 599\n\t }; // 600\n\t} // 601", "title": "" }, { "docid": "e671f05c2e4f3a2f8601e27826a04484", "score": "0.5074434", "text": "function parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "eeb5ae958ffa118b79b6a8885d052df5", "score": "0.507398", "text": "function parseFieldDefinition(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer);\n return {\n kind: _kinds.FIELD_DEFINITION,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "eeb5ae958ffa118b79b6a8885d052df5", "score": "0.507398", "text": "function parseFieldDefinition(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer);\n return {\n kind: _kinds.FIELD_DEFINITION,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "eeb5ae958ffa118b79b6a8885d052df5", "score": "0.507398", "text": "function parseFieldDefinition(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer);\n return {\n kind: _kinds.FIELD_DEFINITION,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "ab2c27a3abd670b195b33c9a252ea80c", "score": "0.50700694", "text": "function PsiGraphsParser () {\n //Properties \n}", "title": "" }, { "docid": "a8e0ea5c0be202c19489d9af621a27c3", "score": "0.506907", "text": "function parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds__WEBPACK_IMPORTED_MODULE_4__[\"Kind\"].FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "4a0052899283a18dee71e747d15779ca", "score": "0.50649416", "text": "parseVariableDefinitions() {\n return this.optionalMany(\n _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].PAREN_L,\n this.parseVariableDefinition,\n _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].PAREN_R,\n );\n }", "title": "" }, { "docid": "4a0052899283a18dee71e747d15779ca", "score": "0.50649416", "text": "parseVariableDefinitions() {\n return this.optionalMany(\n _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].PAREN_L,\n this.parseVariableDefinition,\n _tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].PAREN_R,\n );\n }", "title": "" }, { "docid": "eb49f95d1948c01baab7ade1574d42ac", "score": "0.50526756", "text": "VariableDeclarationList() {\n // Implement here...\n }", "title": "" }, { "docid": "8401539ec5f8873fec3966fa57ea749c", "score": "0.5033497", "text": "function parseConstLetDeclaration(kind) {\n\t var declarations;\n\n\t expectKeyword(kind);\n\n\t declarations = parseVariableDeclarationList(kind);\n\n\t consumeSemicolon();\n\n\t return {\n\t type: Syntax.VariableDeclaration,\n\t declarations: declarations,\n\t kind: kind\n\t };\n\t }", "title": "" }, { "docid": "0ab9bfc5cdcb09816bef942b43df9dc4", "score": "0.5022644", "text": "function parseObjectDeclaration() {\n var type = match('thang')\n var id = match('ID')\n match('=')\n match('dur')\n var properties = []\n do {\n properties.push(parsePropertyDeclaration())\n } while (at(['nom','werd','buul']))\n match('urp')\n return new ObjectDeclaration(id, properties)\n}", "title": "" }, { "docid": "8127f2dd747e12c6d8762402eb5d4a55", "score": "0.5011936", "text": "visitVardeclcomma(ctx, attributes) {\n let brackets = {};\n /* BRACKETS.auxtype = VARDECLCOMMA.auxtype */\n brackets.auxtype = attributes.auxtype;\n brackets = this.visitBrackets(ctx.getChild(2), brackets);\n\n /* addType(ident.id, BRACKETS.type) */\n this.addType(ctx.getChild(1), brackets.type);\n }", "title": "" }, { "docid": "42aa156c127eb98d673487915dd8455b", "score": "0.49959087", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n }", "title": "" }, { "docid": "42aa156c127eb98d673487915dd8455b", "score": "0.49959087", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n }", "title": "" }, { "docid": "42aa156c127eb98d673487915dd8455b", "score": "0.49959087", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n }", "title": "" }, { "docid": "42aa156c127eb98d673487915dd8455b", "score": "0.49959087", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n }", "title": "" }, { "docid": "42aa156c127eb98d673487915dd8455b", "score": "0.49959087", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n }", "title": "" }, { "docid": "42aa156c127eb98d673487915dd8455b", "score": "0.49959087", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n }", "title": "" }, { "docid": "1bb1640042c6f28664bebe280cc50206", "score": "0.499587", "text": "function parseFieldDefinition(parser) { // 732\n\t var start = parser.token.start; // 733\n\t var name = parseName(parser); // 734\n\t var args = parseArgumentDefs(parser); // 735\n\t expect(parser, _lexer.TokenKind.COLON); // 736\n\t var type = parseType(parser); // 737\n\t var directives = parseDirectives(parser); // 738\n\t return { // 739\n\t kind: _kinds.FIELD_DEFINITION, // 740\n\t name: name, // 741\n\t arguments: args, // 742\n\t type: type, // 743\n\t directives: directives, // 744\n\t loc: loc(parser, start) // 745\n\t }; // 746\n\t} // 747", "title": "" }, { "docid": "4a9269abdd8e3632d9ab2b2ec6a3140d", "score": "0.49909005", "text": "function parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, _lexer.TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: _kinds.Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}", "title": "" }, { "docid": "bbbca43fd2dcd9c849c49e449d297c7d", "score": "0.49898762", "text": "jsxParseElementName() {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n\n while (this.eat(types.dot)) {\n const newNode = this.startNodeAt(startPos, startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n\n return node;\n }", "title": "" }, { "docid": "2a74ba005479754dd38bb17a2b5ae7c6", "score": "0.4987621", "text": "function parseVarDecl() {\n\tdebug(\"Parsing Var Decl\")\n\tCST.addNode(B_DECLARE)\n\tif (match(K_ID) == kSuccess) {\n\t CST.addNode(lastToken)\n\t CST.goUp() /* from the leaf node representing the type of the variable being declared\n\t to its parent (the declare node) */\n\t CST.addNode(thisToken)\n\t CST.goUp() /* from the leaf node representing the name of the variable being declared\n\t to its parent (the declare node) */\n\t}\n\tCST.goUp() // from the declare node to its parent\n\treturn\t\n }", "title": "" }, { "docid": "98dd0c47ed93d809c9535c107f140034", "score": "0.49848413", "text": "parseDeclareStmt() {\n \n\n this.match('auto')\n if(this.lookahead.type !== 'id'){\n throw 'syntax error'\n } \n const id = new Id(this.lookahead.value)\n\n this.match(this.lookahead.value)\n this.match('=')\n const right = this.parseExpr()\n return new DeclareStmt(id, right)\n }", "title": "" }, { "docid": "c0d8eafc03488d7a49d3dcc84d3b5728", "score": "0.49793252", "text": "function parseImportSpecifiers() {\n\t var nodes = [],\n\t first = true;\n\t if (tokType === _name) {\n\t // import defaultObj, { x, y as z } from '...'\n\t var node = startNode();\n\t node.id = parseIdent();\n\t checkLVal(node.id, true);\n\t node.name = null;\n\t node['default'] = true;\n\t nodes.push(finishNode(node, \"ImportSpecifier\"));\n\t if (!eat(_comma)) return nodes;\n\t }\n\t if (tokType === _star) {\n\t var node = startNode();\n\t next();\n\t if (tokType !== _name || tokVal !== \"as\") unexpected();\n\t next();\n\t node.name = parseIdent();\n\t checkLVal(node.name, true);\n\t nodes.push(finishNode(node, \"ImportBatchSpecifier\"));\n\t return nodes;\n\t }\n\t expect(_braceL);\n\t while (!eat(_braceR)) {\n\t if (!first) {\n\t expect(_comma);\n\t if (options.allowTrailingCommas && eat(_braceR)) break;\n\t } else first = false;\n\n\t var node = startNode();\n\t node.id = parseIdent(true);\n\t if (tokType === _name && tokVal === \"as\") {\n\t next();\n\t node.name = parseIdent();\n\t } else {\n\t node.name = null;\n\t }\n\t checkLVal(node.name || node.id, true);\n\t node['default'] = false;\n\t nodes.push(finishNode(node, \"ImportSpecifier\"));\n\t }\n\t return nodes;\n\t }", "title": "" }, { "docid": "9add83984d651c921dc569cc60002931", "score": "0.49748772", "text": "objj_parseImportStatement()\n {\n let node = this.startNode(),\n objj = {};\n\n this.next();\n node.objj = objj;\n\n // Because we use a custom tokenizer for @import filenames,\n // it's guaranteed this.type will be tt.string or tt.filename.\n objj.local = this.type === tt.string;\n objj.filename = this.value;\n this.next();\n\n return this.finishNode(node, \"objj_ImportStatement\");\n }", "title": "" }, { "docid": "71ff8b89bfad7ffd03300ecdc25077c9", "score": "0.49747527", "text": "function parseImportSpecifiers() {\n var nodes = [], first = true;\n if (tokType === _name) {\n // import defaultObj, { x, y as z } from '...'\n var node = startNode();\n node.id = parseIdent();\n checkLVal(node.id, true);\n node.name = null;\n node['default'] = true;\n nodes.push(finishNode(node, \"ImportSpecifier\"));\n if (!eat(_comma)) return nodes;\n }\n if (tokType === _star) {\n var node = startNode();\n next();\n if (tokType !== _name || tokVal !== \"as\") unexpected();\n next();\n node.name = parseIdent();\n checkLVal(node.name, true);\n nodes.push(finishNode(node, \"ImportBatchSpecifier\"));\n return nodes;\n }\n expect(_braceL);\n while (!eat(_braceR)) {\n if (!first) {\n expect(_comma);\n if (options.allowTrailingCommas && eat(_braceR)) break;\n } else first = false;\n\n var node = startNode();\n node.id = parseIdent(true);\n if (tokType === _name && tokVal === \"as\") {\n next();\n node.name = parseIdent();\n } else {\n node.name = null;\n }\n checkLVal(node.name || node.id, true);\n node['default'] = false;\n nodes.push(finishNode(node, \"ImportSpecifier\"));\n }\n return nodes;\n }", "title": "" }, { "docid": "71ff8b89bfad7ffd03300ecdc25077c9", "score": "0.49747527", "text": "function parseImportSpecifiers() {\n var nodes = [], first = true;\n if (tokType === _name) {\n // import defaultObj, { x, y as z } from '...'\n var node = startNode();\n node.id = parseIdent();\n checkLVal(node.id, true);\n node.name = null;\n node['default'] = true;\n nodes.push(finishNode(node, \"ImportSpecifier\"));\n if (!eat(_comma)) return nodes;\n }\n if (tokType === _star) {\n var node = startNode();\n next();\n if (tokType !== _name || tokVal !== \"as\") unexpected();\n next();\n node.name = parseIdent();\n checkLVal(node.name, true);\n nodes.push(finishNode(node, \"ImportBatchSpecifier\"));\n return nodes;\n }\n expect(_braceL);\n while (!eat(_braceR)) {\n if (!first) {\n expect(_comma);\n if (options.allowTrailingCommas && eat(_braceR)) break;\n } else first = false;\n\n var node = startNode();\n node.id = parseIdent(true);\n if (tokType === _name && tokVal === \"as\") {\n next();\n node.name = parseIdent();\n } else {\n node.name = null;\n }\n checkLVal(node.name || node.id, true);\n node['default'] = false;\n nodes.push(finishNode(node, \"ImportSpecifier\"));\n }\n return nodes;\n }", "title": "" }, { "docid": "f286159c7b045251aced36b4213e6dbb", "score": "0.49665782", "text": "parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }", "title": "" }, { "docid": "f286159c7b045251aced36b4213e6dbb", "score": "0.49665782", "text": "parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }", "title": "" }, { "docid": "2ed4624454bdd7a36ef151f588641516", "score": "0.49603227", "text": "_readDeclarationPunctuation(token) {\n // SPARQL-style declarations don't have punctuation\n if (this._sparqlStyle) {\n this._sparqlStyle = false;\n return this._readInTopContext(token);\n }\n\n if (token.type !== '.')\n return this._error('Expected declaration to end with a dot', token);\n return this._readInTopContext;\n }", "title": "" }, { "docid": "2ed4624454bdd7a36ef151f588641516", "score": "0.49603227", "text": "_readDeclarationPunctuation(token) {\n // SPARQL-style declarations don't have punctuation\n if (this._sparqlStyle) {\n this._sparqlStyle = false;\n return this._readInTopContext(token);\n }\n\n if (token.type !== '.')\n return this._error('Expected declaration to end with a dot', token);\n return this._readInTopContext;\n }", "title": "" }, { "docid": "8ecf46725e6faee372be8d52dbef8087", "score": "0.49590263", "text": "enterFieldDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "119cefb506ed13d1d90bfdec0fb8a302", "score": "0.49573782", "text": "parseStatement(declaration, topLevel) {\n if (this.match(types.at)) {\n this.parseDecorators(true);\n }\n\n return this.parseStatementContent(declaration, topLevel);\n }", "title": "" }, { "docid": "945ef8627dc851419f101ab8854e2c55", "score": "0.49532148", "text": "enterTypeDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "1a604dffae9ee4fcd3413d458dcce256", "score": "0.4943243", "text": "function StructDefinition(t, x)\r\n\t{\r\n\t\tvar f = new Node(t);\r\n\t\tt.mustMatch(jsdef.IDENTIFIER);\r\n\t\tf.name = t.token().value;\r\n\t\tt.mustMatch(jsdef.LEFT_CURLY);\r\n\t\tfor(;t.peek()!=jsdef.RIGHT_CURLY;t.peek()!=jsdef.RIGHT_CURLY && t.mustMatch(jsdef.SEMICOLON))\r\n\t\t{\r\n\t\t\ttt = t.peek();\r\n\t\t\tif(tt==jsdef.UNION)\r\n\t\t\t{\r\n\t\t\t\tt.mustMatch(jsdef.UNION);\r\n\t\t\t\tvar u = StructDefinition(t,x);\r\n\t\t\t\tfor(var i=0; i<u.length; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tu[i].union=true;\r\n\t\t\t\t\tf.push(u[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tt.mustMatch(jsdef.IDENTIFIER);\r\n\t\t\t\tvar a = new Node(t, jsdef.IDENTIFIER);\r\n\t\t\t\ta.name = t.token().value;\r\n\t\t\t\tt.mustMatch(jsdef.COLON);\r\n\t\t\t\tmatchVartype(t, a, \"vartype\");\r\n\t\t\t\tf.push(a);\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.mustMatch(jsdef.RIGHT_CURLY);\r\n\t\tf.end = t.cursor;\r\n\t\tf.line_end = t.line_start;\r\n\t\treturn f;\r\n\t}", "title": "" }, { "docid": "dadf9608b750d9a397a43be2b7c85e51", "score": "0.49377453", "text": "function is_variable_declaration(stmt) {\n return is_tagged_object(stmt, \"variable_declaration\");\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.49233449", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "b9bcc82d074220df1c405c99797a8de0", "score": "0.49233449", "text": "function parseUnionMembers(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "16f81a49797e3acf04d60c40785ed5a5", "score": "0.49233028", "text": "parseStatement(){\n this.freeTemporaryMemory();\n\n switch(this.tokens.front())\n {\n case TT.type.TOKEN_STR_var:\n console.error(\"Misplaced vardef at \",this.tokens.front().pos);\n return false;\n case TT.type.TOKEN_STR_onevent:\n return this.parseOnEvent();\n case TT.type.TOKEN_STR_sub:\n return this.parseSubDecl();\n default: return this.parseBlockStatement();\n }\n }", "title": "" }, { "docid": "cbc2760ac458e61b64ac980a99c88d4a", "score": "0.49181825", "text": "function pushDestructuringVarDecls(n, s) {\n for (var i in n) {\n var sub = n[i];\n if (sub.type === IDENTIFIER) {\n s.varDecls.push(sub);\n } else {\n pushDestructuringVarDecls(sub, s);\n }\n }\n}", "title": "" }, { "docid": "db90821a83855fad36c418ac08bd1607", "score": "0.4914716", "text": "parseIdent(liberal, isBinding) {\n const ident = super.parseIdent(liberal, isBinding)\n if (this._inFieldValue && ident.name == \"arguments\") this.raise(ident.start, \"A class field initializer may not contain arguments\")\n return ident\n }", "title": "" }, { "docid": "db90821a83855fad36c418ac08bd1607", "score": "0.4914716", "text": "parseIdent(liberal, isBinding) {\n const ident = super.parseIdent(liberal, isBinding)\n if (this._inFieldValue && ident.name == \"arguments\") this.raise(ident.start, \"A class field initializer may not contain arguments\")\n return ident\n }", "title": "" }, { "docid": "0165b0d019a138d9a5f90eec512b1633", "score": "0.49144202", "text": "enterLocalTypeDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "61457cfba5597b82a69685eaa5066626", "score": "0.49081042", "text": "function _parse(tree) {\n\t\t\tif (tree.type)\n\t\t\t\tself.trigger(tree.type, tree);\n\n\t\t\tif (self.report.length > MAXERR)\n\t\t\t\treturn;\n\n\t\t\t_.each(tree, function (val, key) {\n\t\t\t\tif (val === null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif (!_.isObject(val) && !_.isArray(val))\n\t\t\t\t\treturn;\n\n\t\t\t\tswitch (val.type) {\n\t\t\t\tcase \"ExpressionStatement\":\n\t\t\t\t\tif (val.expression.type === \"Literal\" && val.expression.value === \"use strict\")\n\t\t\t\t\t\tself.scopes.current.strict = true;\n\t\t\t\t\t_parse(val);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FunctionDeclaration\":\n\t\t\t\t\tself.scopes.addVariable({ name: val.id.name });\n\t\t\t\t\tself.scopes.push(val.id.name);\n\n\t\t\t\t\t// If this function is not empty, parse its leading comments (if any).\n\t\t\t\t\tif (val.body.type === \"BlockStatement\" && val.body.body.length > 0)\n\t\t\t\t\t\t_parseComments(val.range[0], val.body.body[0].range[0]);\n\n\t\t\t\t\t_parse(val);\n\t\t\t\t\tself.scopes.pop();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FunctionExpression\":\n\t\t\t\t\tif (val.id && val.id.type === \"Identifier\")\n\t\t\t\t\t\tself.scopes.addVariable({ name: val.id.name });\n\t\t\t\t\tself.scopes.push(\"(anon)\");\n\n\t\t\t\t\t// If this function is not empty, parse its leading comments (if any).\n\t\t\t\t\tif (val.body.type === \"BlockStatement\" && val.body.body.length > 0)\n\t\t\t\t\t\t_parseComments(val.range[0], val.body.body[0].range[0]);\n\n\t\t\t\t\t_parse(val);\n\t\t\t\t\tself.scopes.pop();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"WithStatement\":\n\t\t\t\t\tself.scopes.runtimeOnly = true;\n\t\t\t\t\t_parse(val);\n\t\t\t\t\tself.scopes.runtimeOnly = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t_parse(val);\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "4a052227dd2598fff8d2db48afdc4223", "score": "0.4886459", "text": "VariableDeclaration(path) {\n // TODO: handle multiple declarations\n const name = path.node.declarations[0].id.name;\n const val = path.node.declarations[0].init.extra.raw;\n genericAst.body.push({\"type\": \"varAssign\", \"varId\" : name, \"varValue\" : val});\n }", "title": "" }, { "docid": "bfa91eddbb1730cf7f54e12f1307d2c9", "score": "0.48800436", "text": "function resolveDeclarations(node, context) {\n if (node == null)\n return [];\n var symbol = getSymbol(node, context);\n if (symbol == null)\n return [];\n return resolveSymbolDeclarations(symbol);\n}", "title": "" }, { "docid": "c5c1111295210f1e0dec4d93c4f9b06f", "score": "0.48732248", "text": "function parseUnionMembers(lexer) {\n var members = [];\n do {\n members.push(parseNamedType(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return members;\n}", "title": "" }, { "docid": "abb21913b21f247c64340eb7370688dc", "score": "0.4872685", "text": "parse(scope, tokens) {}", "title": "" }, { "docid": "8ae9c124878e6c670ff1e737780f0dbf", "score": "0.4872548", "text": "parseVariableDefinitions() {\n return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseVariableDefinition, _tokenKind.TokenKind.PAREN_R);\n }", "title": "" }, { "docid": "2d0af2eaa589e3d3a8daddb615acfc3f", "score": "0.4868773", "text": "parseClassElementName() {\n if (this.test(Token.PRIVATE_IDENTIFIER)) {\n return this.parsePrivateIdentifier();\n }\n return this.parsePropertyName();\n }", "title": "" }, { "docid": "29835b81e2a0cda70dcb90e1c683bfeb", "score": "0.48678765", "text": "function PsiPaintParser () {\n //Properties \n}", "title": "" }, { "docid": "eb88093c495a855a9d9dfe286d47b500", "score": "0.4864347", "text": "parseDeclareStmt() {\n this.match('var');\n if (this.lookahead.type !== 'id') {\n throw 'syntax error';\n }\n const id = new terminal_1.Identifier(this.lookahead.value);\n this.match(this.lookahead.value);\n this.match('=');\n const right = this.parseExpr();\n return new statement_1.DeclareStmt(id, right);\n }", "title": "" }, { "docid": "3beac5122d74a3c202232bc2c91a3527", "score": "0.48545468", "text": "varDecl() {\n const params = [this.variable()];\n while (this.lexer.isCurrentTokenType(TokenType.COMMA)) {\n this.eat(TokenType.COMMA);\n params.push(this.variable());\n }\n this.eat(TokenType.COLON);\n const type = this.typeSpec();\n return params.map(param => new VarDeclarationNode(param, type));\n }", "title": "" }, { "docid": "5bd5d3f5528ce7cfd1a57cb38a089afa", "score": "0.48522708", "text": "function Declaration(str) {\n var parts = str.split('/')\n\n this.version = parts[0]\n this.assets = parts[1] || 'all'\n }", "title": "" }, { "docid": "5bd5d3f5528ce7cfd1a57cb38a089afa", "score": "0.48522708", "text": "function Declaration(str) {\n var parts = str.split('/')\n\n this.version = parts[0]\n this.assets = parts[1] || 'all'\n }", "title": "" }, { "docid": "0dd45e12f8b83260911c51ad512f5a93", "score": "0.4842974", "text": "function parseField(parser) { // 298\n\t var start = parser.token.start; // 299\n // 300\n\t var nameOrAlias = parseName(parser); // 301\n\t var alias = void 0; // 302\n\t var name = void 0; // 303\n\t if (skip(parser, _lexer.TokenKind.COLON)) { // 304\n\t alias = nameOrAlias; // 305\n\t name = parseName(parser); // 306\n\t } else { // 307\n\t alias = null; // 308\n\t name = nameOrAlias; // 309\n\t } // 310\n // 311\n\t return { // 312\n\t kind: _kinds.FIELD, // 313\n\t alias: alias, // 314\n\t name: name, // 315\n\t arguments: parseArguments(parser), // 316\n\t directives: parseDirectives(parser), // 317\n\t selectionSet: peek(parser, _lexer.TokenKind.BRACE_L) ? parseSelectionSet(parser) : null, // 318\n\t loc: loc(parser, start) // 319\n\t }; // 320\n\t} // 321", "title": "" }, { "docid": "8afbae2469aa1153383ff26e3e7bd7dd", "score": "0.48243558", "text": "function parseVar(node, noIn, kind) {\n\t node.declarations = [];\n\t node.kind = kind;\n\t for (;;) {\n\t var decl = startNode();\n\t decl.id = options.ecmaVersion >= 6 ? toAssignable(parseExprAtom()) : parseIdent();\n\t checkLVal(decl.id, true);\n\t decl.init = eat(_eq) ? parseExpression(true, noIn) : kind === _const.keyword ? unexpected() : null;\n\t node.declarations.push(finishNode(decl, \"VariableDeclarator\"));\n\t if (!eat(_comma)) break;\n\t }\n\t return node;\n\t }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "c12d9c6ccbff66cbc751cd9e9ae45c3c", "score": "0.48016044", "text": "function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }", "title": "" }, { "docid": "5c2d8736c32543997a7b32b089713a32", "score": "0.47981867", "text": "enterDecl(ctx) {\n\t}", "title": "" }, { "docid": "30dc18c37e613b57fecbc781c259a241", "score": "0.47968704", "text": "function collect_decls (body) {\n let rv = [];\n body.forEach ( function bodyForeach(statement){\n if (statement.type === VariableDeclaration || statement.type === FunctionDeclaration)\n rv.push(statement);\n });\n return rv;\n }", "title": "" }, { "docid": "2828124ce0282c1b5a9ece9faa137147", "score": "0.4789472", "text": "function parseConstLetDeclaration(kind) {\n var declarations;\n\n skipComment();\n delegate.markStart();\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind));\n }", "title": "" }, { "docid": "c3f7a68f8401427196a87874171ae46e", "score": "0.47838262", "text": "function getAttributeDocsFromDeclaration(declaration, context) {\n var e_3, _a;\n var _b, _c;\n var attributeDocs = [];\n try {\n for (var _d = __values(filterVisibility(context.config.visibility, declaration.members)), _e = _d.next(); !_e.done; _e = _d.next()) {\n var member = _e.value;\n if (member.attrName != null) {\n attributeDocs.push({\n name: member.attrName,\n fieldName: member.propName,\n defaultValue: member.default != null ? JSON.stringify(member.default) : undefined,\n description: (_b = member.jsDoc) === null || _b === void 0 ? void 0 : _b.description,\n type: getTypeHintFromType(member.typeHint || ((_c = member.type) === null || _c === void 0 ? void 0 : _c.call(member)), context.checker, context.config),\n inheritedFrom: getInheritedFromReference(declaration, member, context)\n });\n }\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_a = _d.return)) _a.call(_d);\n }\n finally { if (e_3) throw e_3.error; }\n }\n return attributeDocs;\n}", "title": "" }, { "docid": "b73c83eb2f129aea344b4eca6a490dd1", "score": "0.4781353", "text": "getDeclarations(index){\n var t = this;\n var declarationHead = t.getActualDeclaration();\n var headOpen = \"\";\n var headClose = \"\";\n var declarationHolder = $(document.createElement('div')).addClass('js_declaration-holder');\n\n for(var x = 0; x < declarationHead[index].length; x++){\n var declarationSpan = $(document.createElement('span')).addClass('declartion-span js_declaration-span');\n declarationSpan.text(declarationHead[index][x]);\n declarationHolder.append(declarationSpan);\n }\n\n return declarationHolder;\n }", "title": "" } ]
a40852386b1e2e4121d129042616fd6a
Get ICM link from the Add Movie result
[ { "docid": "0dae9e32a05684cc1da1cc9a49426d0f", "score": "0.579885", "text": "function icm_link (src) {\r\n var a = $x(\"id('content')//ul//a\", src);\r\n if(a.length == 1 && a[0].href.indexOf(\"http://www.imdb.com\") == -1)\r\n return 'http://icheckmovies.com'+a[0].href;\r\n}", "title": "" } ]
[ { "docid": "5d901f903bd45d6105721cff1c30b7d8", "score": "0.62957305", "text": "function makeIMDbUrl(movietitle) {\n\t\tvar imdburl = 'http://www.imdb.com/find?q='+ movietitle +';tt=on;nm=on;mx=20;';\n\t\treturn imdburl;\n\t}", "title": "" }, { "docid": "01d828ad560be9dcdde0c66266115bac", "score": "0.62941444", "text": "function makeIMDbUrl(movietitle) {\n\t\tvar imdburl = 'http://www.imdb.com/find?q='+ encodeURIComponent(movietitle) +';tt=on;nm=on;mx=20;';\n\t\treturn imdburl;\n\t}", "title": "" }, { "docid": "0f83f58a9f8309254025b5379ca3cfc4", "score": "0.62103784", "text": "function getURL() {\n return {\n omDbURL: \"http://www.omdbapi.com/?\",\n MDBurl: \"https://api.themoviedb.org/3/search/movie?api_key=838eabeda5ff3bb866d5c5fc023308d1\"\n };\n}", "title": "" }, { "docid": "0cea3c3cf70e2249c245d545ed4f6441", "score": "0.6082963", "text": "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}", "title": "" }, { "docid": "55542bfad52244a3236ae0013a5f71b5", "score": "0.6079392", "text": "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "title": "" }, { "docid": "4d72574a37baee37b9de7d3646653f92", "score": "0.60251796", "text": "function getFindByImdbUrl(imdb_id) {\n return `${config.api.host}find/${imdb_id}?api_key=${config.api.key}&external_source=imdb_id`;\n }", "title": "" }, { "docid": "387457810980624066b6cc299d8f7a99", "score": "0.60082006", "text": "function retrieveID(){\n var retrievedID = $('#updateId').val();\n retrieveMovie(\"https://eloquent-yew-227217.appspot.com/GetFilm?ID=\"+retrievedID+\"&format=json\");\n}", "title": "" }, { "docid": "cec49499b7e00686d68fcfae5bb92908", "score": "0.59367764", "text": "function getVideoLink(item) {\n var videoID = item.id.videoId;\n var thumb = item.snippet.thumbnails.high.url;\n //build output string\n var output = '<iframe auto src=\"https://youtube.com/embed/' + videoID + '?rel=0\"></iframe>' + '<div class=\"clearfix\"></div>' + '';\n return output;\n }", "title": "" }, { "docid": "e1e1241e2929050bb80e0121644d4a04", "score": "0.59217536", "text": "function makeUrl() {\n return \"https://api.themoviedb.org/3/discover/movie?\"+\n \"api_key=7206d76e96b3e78b399d05fbcda1ea0d&language=en-US%20en-GB&\"+\n \"sort_by=popularity.desc&include_adult=false&include_video=false&page=\" + random(50);\n }", "title": "" }, { "docid": "1bcd811589e03cbd240905c304e2c4de", "score": "0.5828956", "text": "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)}", "title": "" }, { "docid": "ac1e3ec03094686c7a28b176cf2ca8b3", "score": "0.5807662", "text": "function makeIMDbLink(movietitle,movierating,movievotes, movieUrl, tagLine) {\n\t\t\tvar container = document.createElement(\"span\");\n\t\t\tcontainer.appendChild(document.createTextNode(\" \"));\n\n\t\t\tvar newLink = document.createElement(\"a\");\n\t\t\tnewLink.setAttribute(\"href\", movieUrl);\n\t\t\tnewLink.setAttribute(\"target\", \"imdb\");\n newLink.setAttribute(\"title\", tagLine);\n\t\t\tnewLink.appendChild(document.createTextNode(\"(IMDb)\"));\n\t\t\tcontainer.appendChild(newLink);\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\t\n\t\t\tvar boldness = document.createElement(\"b\");\n\t\t\tboldness.appendChild(document.createTextNode(\"IMDb Rating: \"));\n\t\t\tcontainer.appendChild(boldness);\n\t\t\tcontainer.appendChild(document.createTextNode(movierating));\n\t\t\tcontainer.appendChild(document.createElement(\"br\"));\n\t\t\tboldness = document.createElement(\"b\");\n\t\t\tboldness.appendChild(document.createTextNode(\"IMDb Votes: \"));\n\t\t\tcontainer.appendChild(boldness);\n\t\t\tcontainer.appendChild(document.createTextNode(movievotes));\n\t\t\treturn(container);\n\t}", "title": "" }, { "docid": "03ea3762eac42d0b5360c3827b3e8de1", "score": "0.5767846", "text": "function createUrl() {\n todaysDate = moment().format(\"YYYY-MM-DD\");\n return movieAndDinnerObject.movieShowtimeUrl + todaysDate + \"&lat=\" + movieAndDinnerObject.lat + \"&lng=\" + movieAndDinnerObject.long + movieAndDinnerObject.movieShowtimeAPIKey\n // http://data.tmsapi.com/v1.1/movies/showings?startDate=2019-04-10&lat=32.876709&lng=-117.206601&api_key=stp9q5rsr8afbrsfmmzvzubz\n }", "title": "" }, { "docid": "ca26e1b10be5ee706a505bb1b234cc05", "score": "0.5750755", "text": "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "title": "" }, { "docid": "b1b9fe9df09137bb548e3af73af9270d", "score": "0.57353514", "text": "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 }", "title": "" }, { "docid": "d824bc36fec1327e0427d733d00a3cfc", "score": "0.57098705", "text": "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "title": "" }, { "docid": "bde2573abcbc88e442e6a7b1eb31a3a1", "score": "0.57088786", "text": "function redirectToReviews(imdbId) {\n linkReadReview.href = \"http://www.imdb.com/title/\" + imdbId + \"/reviews?ref_=tt_ql_3\";\n}", "title": "" }, { "docid": "d367250af358d518b2811f4fe2a58c5e", "score": "0.5704542", "text": "function clickToAdd(e) {\n var thisMovieImdbId = e.target.id; // grabs movie in search results from id on add button\n // var thisMovieImdbId = allResults[thisMovieId].imdbID; // grabs proper movie information given correct id\n $.ajax({ // Makes the next api request to get full listing on movie, not just search results (which were abbreviated)\n url: \"http://www.omdbapi.com/?i=\" + thisMovieImdbId + \"&r=json\"\n }).done(function(fullMovieListing) {\n\n // Need If Then Poster\n if (fullMovieListing.Poster !== \"N/A\") {\n fullMovieListing.Poster = \"http://img.omdbapi.com/?i=\" + thisMovieImdbId + \"&apikey=8513e0a1\";\n }\n \n // Sends full movie listing, with user login ID, to store on website database\n grabmovies.findMovie(fullMovieListing, authInfo);\n\n });\n }", "title": "" }, { "docid": "f0369253d3a6c6b4e1bf9c92de3d444a", "score": "0.5637185", "text": "function getLink() {\n $http.get(\"songDetails/\" + $rootScope.userLog + \"/\" + songID).then(function (response) {\n var link = response.data.link;\n $scope.playLink = $sce.trustAsResourceUrl(link);\n });\n }", "title": "" }, { "docid": "b201d2624a707d3582be906df2a6e8c0", "score": "0.5609812", "text": "function appendMovieInfo(info, movie) {\n const targetMovie = document.getElementById(movie.imdbID);\n targetMovie.innerHTML = targetMovie.innerHTML + info;\n}", "title": "" }, { "docid": "9c8688d9e1dfd64171f2460687ad6f9e", "score": "0.5602613", "text": "function getMovieSuccess(movie) {\n return {\n type: types.GET_MOVIE_SUCCESS,\n movie\n }\n}", "title": "" }, { "docid": "f8f7c6b279a6ffd8b32fe86c26ef7185", "score": "0.5596758", "text": "function getResourceUrl() { return \"http://\"+location.href.split(\"//\")[1].split(\"/\").splice(0,3).join(\"/\")+'.json?api_key='+MoviePilot.apikey;}", "title": "" }, { "docid": "dd525e7b82a41aa4fc57b7c8ec6cfb35", "score": "0.5558264", "text": "function apicall(indexElement) {\n var idImg = 'movie' + indexElement;\n var idNameMovie = 'name-movie' + indexElement;\n var nameMovie = arrMovies[indexElement];\n console.log(' imagen ' + idImg + ' idNameMovie ' + idNameMovie + ' nameMovie ' + nameMovie);\n $.getJSON('https://www.omdbapi.com/?t=' + nameMovie + '&apikey=a1792c9b').then(function(response) {\n console.log(response);\n // arrNameMovies.push = response.Title;\n // console.log(arrNameMovies);\n // console.log(idYear);\n // var name = response.Title;\n $('#' + idImg).attr('src', response.Poster);\n console.log('#' + idImg);\n $('#' + idNameMovie).text(response.Title);\n });\n // console.log(arrNameMovies);\n }", "title": "" }, { "docid": "498be2172203a2d9cd4e6c577401c8d8", "score": "0.5539036", "text": "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}", "title": "" }, { "docid": "58a82915a42f9feb7892c5c00452ddb0", "score": "0.5533154", "text": "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}", "title": "" }, { "docid": "c4f6d814a95e2ace5709094614a7ada5", "score": "0.55253017", "text": "function displayResult(videoSnippet,videourl) {\n\n var img = new Image(300,300); // width, height values are optional params\n img.src = videoSnippet.thumbnails.high.url;\n $('.sanadtech').append('<h1>'+videoSnippet.title+'</h1>');\n var url= videourl.videoId;\n\n\n console.log(url);\n //$('.sanadtech').append('<a id=\"test\" href=\"hello\">lien de la video</a>');\n var createA = document.createElement('a');\n var createAText = document.createTextNode(\"le lien de la video\");\n createA.setAttribute('href', 'https://www.youtube.com/watch?v='+url);\n createA.appendChild(createAText);\n $('.sanadtech').append(createA);\n $('.sanadtech').append(img);\n}", "title": "" }, { "docid": "8044be4f032166722efb670c0038d065", "score": "0.550984", "text": "function movieDetails(imdbId, cb) {\n request(`http://www.omdbapi.com/?apikey=${omdbKey}&i=${imdbId}&plot=full&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 return cb(JSON.parse(body));\n }\n\n });\n }", "title": "" }, { "docid": "0695131763b4c845105603be55a68388", "score": "0.5506547", "text": "function VIEWAS_aim_IMme(obj) {\n var anchor = myDocument.createElement('a');\n anchor.setAttribute('href', \"aim:goim?screenname=\" + obj.value + \"&message=hello\");\n anchor.setAttribute('title', \"IM me!\");\n anchor.appendChild(myDocument.createTextNode(obj.value));\n return anchor;\n } //aim_IMme", "title": "" }, { "docid": "94067150332f053d04a7ff747499561d", "score": "0.5500321", "text": "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}", "title": "" }, { "docid": "41b3db5eb09c557eea41f1a90ef66bb9", "score": "0.5499138", "text": "function addIDandSelfLink(req, item){\n item.id = item[Datastore.KEY].id;\n item.self = \"https://\" + req.get(\"host\") + req.route.path + \"/\"+ item.id;\n return item;\n}", "title": "" }, { "docid": "fcda2083e63c361ac0d07c9a2588c1eb", "score": "0.5494251", "text": "function getSearchMovieUrl(searchTerm) {\n const url = new URL(`https://api.themoviedb.org/3/search/movie${MOVIE_API_KEY}`);\n const params = {query: searchTerm};\n Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));\n return url;\n}", "title": "" }, { "docid": "944b76be3069e5a0119a219ae6aeb1ac", "score": "0.5451024", "text": "function MovieCard({ movie }) {\n const base_url = 'https://image.tmdb.org/t/p/original';\n return (\n <div className=\"col-md-3\">\n <Link to={`/movies/${movie.id}`}>\n <img className=\"img-fluid\" src={`${base_url}${movie.poster_path}`} alt=\"poster\" />\n <p>{movie.title}</p>\n </Link>\n </div>\n );\n}", "title": "" }, { "docid": "2f251a47a8425f68a1e630c0ea61be0a", "score": "0.5422256", "text": "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "title": "" }, { "docid": "a8dca89e12d3b7b898709457ee77a409", "score": "0.541469", "text": "function getItemLink() {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "71983274be30d56dbeaf17bf459ffed0", "score": "0.54104984", "text": "function bringmovies(x){\n \n console.log(x);\n \n // ajax call para poner el ipa link\n \n $.ajax({\n \n /* b */ method: \"GET\",\n /* c */ url: \"http://www.omdbapi.com/?apikey=92da120d&s=\" + x,\n /* d */ dataType: \"json\"\n \n \n \n }).done(function(data){ //d this is the outcome of the whole request ajax \n // if the input field has something correct hide it\n // if the input field is empty show the alert double == para hacer comparacion no es con una. \n console.log(data);\n \n if(data.Response == \"False\"){ \n $('.alert').css('display', 'block');\n } else if(data.Response == \"True\"){ \n \n $('.alert').css('display', 'none');\n }\n var placeholder = '';\n // this is the array of movies\n var Arrayofmovies = data.Search;\n \n \n $.each(Arrayofmovies , function(index , movie){\n \n \n var id = movie.imdbID;\n console.log(id);\n \n if (movie.Poster == \"N/A\"){\n \n movie.Poster = \"img/posterno.jpg\";\n console.log(\"got nothing\");\n } \n placeholder+=` <a onclick=\"moviedetails('${id}')\"> <div class=\"custom-container\" data-toggle=\"modal\" data-target=\".m1\" >\n <img class=\"poster\" src=\"${movie.Poster}\"> \n <div class=\"overlay\">\n <div class=\"text\" >${movie.Title}</div>\n </div> \n </div> </a>`;\n \n $(\"#list\").html(placeholder);\n });\n \n \n \n });\n \n }", "title": "" }, { "docid": "3f4b6eff3631d3c1e26a857b170e7e08", "score": "0.5398964", "text": "function moviethis(movie_name) {\n request(\"http://www.omdbapi.com/?t=\" + movie_name + \"&y=&plot=short&apikey=trilogy\", function (error, response, body, Title) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n console.log(\"*Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"* Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"* Country produced:\" + JSON.parse(body).Country);\n console.log(\"* Language of the movie:\" + JSON.parse(body).Language);\n console.log(\"* Plot of the movie:\" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"* IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n }\n });\n} // end of movie function----------------------", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "dff0a1e0600d301abdf9ec19f371bd52", "score": "0.53981805", "text": "function getItemLink()\r\n {\r\n return encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "1a1c4d23e8964c007dc8f9b11a9cd385", "score": "0.5394832", "text": "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "title": "" }, { "docid": "fc090310f88e7590da09c4a09bcc51e2", "score": "0.5391689", "text": "function movie() {\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=40e9cece\";\n\n //console.log(queryUrl);\n\n request(queryUrl, function(error, response, body) {\n\n //console.log(response);\n if (error) throw error;\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + 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 // console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).Year); --doesnt have it\n }\n });\n}", "title": "" }, { "docid": "2dfbd44958a89b7035ce5c79e5da0814", "score": "0.5389125", "text": "function getItemLink() {\r\n return encodeURIComponent(window.location.href);\r\n }", "title": "" }, { "docid": "2dfbd44958a89b7035ce5c79e5da0814", "score": "0.5389125", "text": "function getItemLink() {\r\n return encodeURIComponent(window.location.href);\r\n }", "title": "" }, { "docid": "2dfbd44958a89b7035ce5c79e5da0814", "score": "0.5389125", "text": "function getItemLink() {\r\n return encodeURIComponent(window.location.href);\r\n }", "title": "" }, { "docid": "2dfbd44958a89b7035ce5c79e5da0814", "score": "0.5389125", "text": "function getItemLink() {\r\n return encodeURIComponent(window.location.href);\r\n }", "title": "" }, { "docid": "4b0fca2dd1b5f09ea13e6c3799a083e6", "score": "0.53860325", "text": "function movieThis(receivedMovie) {\n\n\n var movie = receivedMovie ? receivedMovie : \"Mr. Nobody\";\n\n // request to omdbapi using movie entered and trilogy api key\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=full&tomatoes=true&r=json&y=&plot=short&apikey=trilogy\", function (error, response, data) {\n\n // IF the request is successful. The status code is 200 if the status returned is OK\n if (!error && response.statusCode === 200) {\n\n // log the command issued to the log.txt file\n logCommand();\n\n // Display Data\n // TITLE, YEAR, IMDB RATING, COUNTRY, LANGUAGE(S), PLOT, ACTORS, ROTTEN TOMATO RATING, ROTTEN TOMATO URL\n console.log(\"Movie Title: \" + JSON.parse(data).Title);\n console.log(\"Release Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"TOMATOMETER: \" + JSON.parse(data).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors/Actresses: \" + JSON.parse(data).Actors);\n }\n\n });\n}", "title": "" }, { "docid": "9eb733f0a4404bfa928d856785801524", "score": "0.5385091", "text": "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "title": "" }, { "docid": "37bbb4d0d711fc8100551f790baa9624", "score": "0.53840935", "text": "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }", "title": "" }, { "docid": "4f3c1b20b4636568aa6e0742f8fc005c", "score": "0.53774273", "text": "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "title": "" }, { "docid": "234467c411f78d2bdd461baea5788cd8", "score": "0.5376656", "text": "function getMovie() {\n\n var movie = \"Pacific Rim\"\n\n request(\"https://www.omdbapi.com/?apikey=\"+ process.env.OMDB_API_KEY +\"&t=\" + value, function (error, response, body) {\n if(error){\n console.log(error)\n }\n\n console.log(JSON.parse(body)['Title'])\n console.log(JSON.parse(body).Title)\n \n });\n}", "title": "" }, { "docid": "8624e1cfaded42d3daba5cfd2f2509fc", "score": "0.5374421", "text": "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 }", "title": "" }, { "docid": "40565e367394ba0af7347b42da32805f", "score": "0.5369576", "text": "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "title": "" }, { "docid": "04753f4d4cf4c9aa685550648eb274d2", "score": "0.5369512", "text": "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 }", "title": "" }, { "docid": "702103e4304158abcb7701fcc8c9a2c6", "score": "0.5365996", "text": "function displaySavedMovieResult(savedMovie){\n\n let movieResult = savedMovie.trim().split(' ').join('+');\n let recMovieURL = \"https://www.omdbapi.com/?t=\" + movieResult + \"&apikey=c88e35f9\";\n\n $.ajax({\n url: recMovieURL,\n method: \"GET\"\n }).then(function(responseResult) {\n //Call function to display the results\n movieResultSection(responseResult);\n \n });\n}", "title": "" }, { "docid": "0a0547e901407e2f1db662f2d1c24a1a", "score": "0.53453463", "text": "function mcAvoyCall() {\n var RandomNumber = Math.floor((Math.random() * jamesMcAvoy.length - 1) + 1);\n var RandomMovie = jamesMcAvoy[RandomNumber];\n\n $.getJSON('https://www.omdbapi.com/?t=' + encodeURI(RandomMovie) + '&h=600&apikey=454a6e93').then(function (response) {\n var image = response.Poster;\n\n if (image !== \"N/A\") {\n $('#mcavoyBack').attr('src', image);\n }\n\n });\n}", "title": "" }, { "docid": "c6b57f836b79ccf7388f864e3cc6f038", "score": "0.534512", "text": "function getResult(e){\n\n\n const xhr = new XMLHttpRequest();\n\n xhr.open('GET',`https://api.themoviedb.org/3/search/movie?api_key=1110f193b789d3675a2ba137ac0b6b96&language=en-US&query=${e.target.value}&page=1&include_adult=false`,true);\n\n xhr.onload = function(){\n if(this.status === 200){\n // console.log(this.responseText);\n\n const result = JSON.parse(this.responseText);\n // console.log(result.results[0]);\n const movieName = result.results[0].original_title;\n const image = result.results[0].poster_path;\n id = result.results[0].id;\n movieId.setAttribute('value',id);\n outputArea.innerHTML = `<li class=\"movie-display\"><p class=\"movie-name\">${movieName}</p> <img class=\"poster\" src=\"https://image.tmdb.org/t/p/w500/${image}\"></li> `\n }\n else{\n if(e.target.value != '')alert('Something went wrong')\n }\n }\n xhr.send();\n}", "title": "" }, { "docid": "7bd80b0ba1f5c2006d6707c7f74a0c83", "score": "0.53418314", "text": "get url() {\n return `https://www.youtube.com/watch?v=${this.video.id}&lc=${this.id}`;\n }", "title": "" }, { "docid": "5339c74f2b60af42f74977a3de1eb4f4", "score": "0.5341056", "text": "function getCustomLink(links, cat) {\r\n\t// Url to add ed2k links to custom application\r\n\r\n\treturn 'http://192.168.0.43/ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n\t//return emuleUrl +'ed2k.php?cat=' + cat + '&post=' + encodeURIComponent(window.location) + '&ed2k=' + links;\r\n}", "title": "" }, { "docid": "299f82c0a82c9a3d5add995fd328eeb2", "score": "0.5340786", "text": "function getMovies(myInput) {\n axios.get('https://www.omdbapi.com?s=' + myInput + '&apikey=5623718')\n .then((response) => {\n let movies = response.data.Search;\n let output = '';\n $.each(movies, (index, movie) => {\n output += `\n <a href=\"movieresult.html?${movie.imdbID}\" class=\"nav-link text-white\">\n <div class=\"movie_card\" style=\"width: 18rem;margin: 0 auto;>\n <div class=\"card h-100\">\n <img src=\"${movie.Poster}\" class=\"poster\">\n <div class=\"card-body\">\n <h5>${movie.Title}</h5>\n </div>\n </div>\n </div>\n </a>\n `;\n });\n $('#movies').html(output);\n })\n .catch((err) => {\n console.log(err);\n });\n}", "title": "" }, { "docid": "d26b4c9ab94439a585a77fdb2a47a969", "score": "0.5339296", "text": "function createResultLink(doc) {\n const [year, month, day] = parseYearMonthDateFromUrl(doc);\n const topic = contentByDate.getTopicName(doc);\n const id = `result-${year}-${month}-${day}-${topic.replace(/\\s/g, '-')}`;\n\n const result = {\n day, doc, id, month, topic, year\n };\n\n result.link = `<a id=\"${id}\"','${contentDivName}')\">${year}/${month}/${day} ${topic}</a>`;\n return result;\n }", "title": "" }, { "docid": "087f5c358bd2df9f30f60cecdc03d074", "score": "0.53343296", "text": "function movieThis(movieName) {\n\n // Default set as Mr. Nobody if user doesn't specify a movie.\n if (movieName == \"\") {\n movieName = \"Mr. Nobody\"\n }\n // Call to and responce from omdb API\n axios.get(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=\" + process.env.MOVIE_SECRET)\n .then(function (response) {\n\n var data = response.data\n\n console.log(\"-------------------------------\");\n console.log(\"* Title: \" + data.Title);\n console.log(\"* Year: \" + data.Year);\n console.log(\"* IMDB: \" + data.Ratings[0].Value);\n console.log(\"* Roten Tomatoes: \" + data.Ratings[1].Value);\n console.log(\"* Country: \" + data.Country);\n console.log(\"* Language: \" + data.Language);\n console.log(\"* Plot: \" + data.Plot);\n console.log(\"* Actors: \" + data.Actors);\n console.log(\"---------------------------------\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "title": "" }, { "docid": "5eb05e575fab12f698c218d382c4d05e", "score": "0.53263056", "text": "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "title": "" }, { "docid": "29d55023e976f2dc939f6d7d81016f22", "score": "0.5325398", "text": "function movieInfo(movieURL) {\n request(movieURL, function(err, response, body) {\n if (!err && response.statusCode == 200) {\n //convert body to string\n body = JSON.parse(body);\n console.log(\"Title: \" + body.Title);\n console.log(\"Year: \" + body.Year);\n console.log(\"Rating: \" + body.Rated);\n console.log(\"Country: \" + body.Country);\n console.log(\"Language: \" + body.Language);\n console.log(\"Plot: \" + body.Plot);\n console.log(\"Cast: \" + body.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n } else {\n log(\"error_log.txt\", command + \" Error: \" + err);\n return;\n };\n });\n}", "title": "" }, { "docid": "0dbb3f76e1f45f61da580d4352888ecc", "score": "0.5318998", "text": "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "title": "" }, { "docid": "02d4efd3c6cc7e704ffcd0c8eb8d3878", "score": "0.5316381", "text": "function addMovieSucceded(result) {\n //notificationService.displaySuccess($scope.genre.Name + ' has been submitted to Home Cinema');\n console.log(\"add triggered 3>\" + result.data.Result);\n $scope.account = result.data.Result.Items;\n //$scope.items = result.data.Result.Items; \n\n $scope.items = result.data;\n\n $scope.page = result.data.Result.Page;\n $scope.pagesCount = result.data.Result.TotalPages;\n $scope.totalCount = result.data.Result.TotalCount;\n //$scope.movie = response.data;\n //if (movieImage) {\n // fileUploadService.uploadImage(movieImage, $scope.movie.ID, redirectToEdit);\n //}\n //else\n // redirectToEdit();\n }", "title": "" }, { "docid": "077e84d0db94c6f4f0802a24ee28b1c4", "score": "0.53086144", "text": "function lookupSpecificMovie () {\n //Calls upon the OMDB api to get data related to the 2009 movie MR. Nobody\n axios.get('http://www.omdbapi.com/?apikey=trilogy&t=Mr.+Nobody')\n .then(function (response) {\n //Node command\n logOutput('Command: node liri.js movie-this ' + response.data.Title);\n //Title of the movie.\n logOutput('Title: ' + response.data.Title);\n //Year the movie came out.\n logOutput('Year: ' + response.data.Year);\n //IMDB Rating of the movie.\n logOutput('IMDB Rating: ' + response.data.Ratings[0].Value);\n //Rotten Tomatoes Rating of the movie.\n logOutput('Rotton Tomatoes Rating ' + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n logOutput('Country ' + response.data.Country);\n //Language of the movie.\n logOutput('Language ' + response.data.Language);\n //Plot of the movie.\n logOutput('Plot ' + response.data.Plot);\n //Actors in the movie.\n logOutput('Actors ' + response.data.Actors);\n logOutput(\"------------\");\n})\n.catch(function (error) {\n //Logs any errors to the log.txt files\n logOutput(error);\n});\n}", "title": "" }, { "docid": "ef3833345087d8bde61275500677df2e", "score": "0.52995366", "text": "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "title": "" }, { "docid": "a5dcfde0a4bd9f19612f482e0dd5755c", "score": "0.5297932", "text": "function detail_action() {\n \n var xhr = new XMLHttpRequest();\n var uri = encodeURI('http://www.omdbapi.com/?i='+ this.attributes['data-imdbid'].value + '&y=&plot=long&r=json')\n\n xhr.open('GET', uri, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n detail_result(JSON.parse(xhr.response))\n }\n }\n\n xhr.send(null);\n \n}", "title": "" }, { "docid": "d0bd3464d1a7f7d2942a9e0d5ff60656", "score": "0.52970153", "text": "function parseLink(){\n\t\t thisLat = parseFloat($.trim($(this).attr('data-lat')));\n thisLng = parseFloat($.trim($(this).attr('data-lng')));\n thisYear = parseInt($(this).attr('data-year'));\n thisTitle = $(this).attr('data-title');\n thisBorough = $(this).attr('data-borough');\n\t\t \n\t\t \t// Get imdb\n\t $.ajax({\n\t type: \"GET\",\n\t\t\t url: \"http://www.omdbapi.com/?r=xml\",\n\t\t\t data:{'t':thisTitle},\n\t dataType: \"xml\",\n\t success: function(xmlIMDB, thisTitle) {\n\t console.log('success');\n\n\t // Get IMDB info\n\t $(xmlIMDB).find('movie').each(function(){\n\t var imdb_title = $(this).attr('title');\n\t var imdb_filmYear = $(this).attr('year');\n\t\t\t\t var imdb_director = $(this).attr('director');\n\t var imdb_plot = $(this).attr('plot');\n\t var imdb_rating = $(this).attr('imdbRating');\n\t\t\t\t var imdb_votes = $(this).attr('imdbVotes');\n\t\t\t\t //var imdb_img = $(this).attr('poster');\n\t\t\t\t var imdb_imgURI = $(this).attr('poster');\n\t\t\t\t var imdb_img = unescape(encodeURIComponent(imdb_imgURI));\n\t\t\t\t $('.overlayContent .title').html(imdb_title);\n\t\t\t\t $('.overlayContent .dir .value').html(imdb_director);\n\t\t\t\t $('.overlayContent .rating .value').html(imdb_rating);\n\t\t\t\t $('.overlayContent .votes .value').html(imdb_votes);\n\t\t\t\t $('.overlayContent .plot .value').html(imdb_plot);\n\t\t\t\t $('.overlayContent .ltSide .imdbImg').attr('src', imdb_img);\n\t });\n\t }\n\t }); // End Get imdb\n\n\n\t\t \tcodeLatLng();\n\t\t}", "title": "" }, { "docid": "ce5698fd3332ea213012b8fe289e781a", "score": "0.5292877", "text": "function MovieDetail(movie, $vivContext) {\n // Get Featured People.\n var api = new _api.API();\n var featuredPeople = api.getCredits(movie['id']);\n for (var i=0; i < featuredPeople['crew'].length; i++) {\n if (featuredPeople['crew'][i]['job'] == 'Director') {\n this.director = featuredPeople['crew'][i]['name'];\n break;\n }\n };\n cast = []\n for (var i=0; i < featuredPeople['cast'].length; i++) {\n if (featuredPeople['cast'][i]['order'] <= 10) {\n cast.push(featuredPeople['cast'][i]['name']);\n } else {\n break;\n }\n }\n this.cast = cast.join(', ');\n\n // Get Synopsis\n this.synopsis = movie['overview'];\n\n // Get IMDB Link\n if (movie['imdb_id'] && movie['imdb_id'] != undefined && movie['imdb_id'] != \"\") {\n this.imdbID = movie['imdb_id'];\n // accessing $vivContext to get the device\n var device = $vivContext.device ;\n if (device == 'bixby-mobile') {\n this.url = 'https://m.imdb.com/title/' + this.imdbID;\n } else {\n this.url = 'https://www.imdb.com/title/' + this.imdbID;\n }\n }\n}", "title": "" }, { "docid": "91499142b72e21987576aac22b8383c7", "score": "0.528483", "text": "function movieThis (movieName) {\n\t//if user does not provide any movie, then default then we assign it a movie\n\tif(movieName === \"\"){\n\t\tmovieName = \"Mr. Nobody\"\n\t}\n\n\t//making custom url for OMDB query search. \n\tvar customURL = \"http://www.omdbapi.com/?t=\"+ movieName +\"&y=&plot=short&tomatoes=true&r=json\";\n\n\t//getting data and printing it on terminal\n\trequestFS(customURL, function (error, response, body) {\n\t\tvar movieData = JSON.parse(body);\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tconsole.log(\"Title: \" + movieData.Title);\n\t\t\tconsole.log(\"Year: \" + movieData.Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + movieData.imdbRating);\n\t\t\tconsole.log(\"Country: \" + movieData.Country);\n\t\t\tconsole.log(\"Lanugage(s): \" + movieData.Language);\n\t\t\tconsole.log(\"Plot: \" + movieData.Plot);\n\t\t\tconsole.log(\"Actors: \" + movieData.Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + movieData.tomatoMeter);\n\t\t\tconsole.log(\"Rotten Tomatoes Link: \" + movieData.tomatoURL);\n\t \t}\n\t});\n}", "title": "" }, { "docid": "944bae1b5c2d19df0da29aed17cf8699", "score": "0.52842367", "text": "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "title": "" }, { "docid": "673d3c3f872b8624c0f753c31a5d6461", "score": "0.5282861", "text": "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}", "title": "" }, { "docid": "ed585a32183b9bd1480f5f59e8601b5b", "score": "0.52823746", "text": "function action(movieName) {\n if (movieName === \"\") {\n movieName = \"Mr Nobody\"\n }\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(queryUrl)\n .then(function(response) {\n console.log(\n `\n Title: ${response.data.Title}\n Release Year: ${response.data.Year}\n IMDB Ratings: ${response.data.imdbRating}\n Rotten Tomatoes Ratings: ${response.data.Ratings[1].Value}\n Country produced: ${response.data.Country}\n Lanuage: ${response.data.Language}\n Plot: ${response.data.Plot}\n Actors: ${response.data.Actors}\n `\n );\n \n })\n .catch(function(error) {\n console.log(error);\n });\n}", "title": "" }, { "docid": "b92e1bfb6aaaf53dbf12d5b62401ef8e", "score": "0.52732295", "text": "function getMovie(movie) {\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\"\n\t}\n\n\trequest(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\n\t\t\t// If the request is successful (i.e. if the response status code is 200)\n\t\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parse the body of the site and recover just the imdbRating\n\t\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\t\t\tvar result = \"Title: \" + JSON.parse(body).Title + \"\\n\" +\n\t\t\t\t\t\"Year: \" + JSON.parse(body).Year + \"\\n\" +\n\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n\" +\n\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n\" +\n\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + \"\\n\" +\n\t\t\t\t\t\"Lang: \" + JSON.parse(body).Language + \"\\n\" +\n\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + \"\\n\" +\n\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors ;\n\t\t\tconsole.log(result)\n\t\t\treturn result\n\t\t\t\t \n\n\t\t\t}\n\t\t\t});\n\n}", "title": "" }, { "docid": "954f5f192896ffb7e8f58d651993c31d", "score": "0.52619326", "text": "function getURLForAnnotationControl(element) {\n return element.parents(\".result-div\").find(\".content .result-title a\").attr(\"href\");\n }", "title": "" }, { "docid": "76c69f5d11dcb84604c53e0cd0e20dd0", "score": "0.52590376", "text": "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}", "title": "" }, { "docid": "a4c27f9d7cb6208c2b2cf35d01dbfd40", "score": "0.5257371", "text": "function getOneMovie(id) {\n AJAXRequest(`${serverURL}/${id}`).then(responseData => console.log(responseData))\n }", "title": "" }, { "docid": "5d962bbaace7dc548a7e991751ba7662", "score": "0.5255658", "text": "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}", "title": "" }, { "docid": "dc390196a6e2e8dea569f8284c47b044", "score": "0.5251078", "text": "function movieThis(movie){\n //console.log(\"Movie This\");\n\n if (movie === undefined){\n movie = \"Mr. Nobody\";\n }\n //else movie = inputs[3];\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&apikey=\" + omdb).then(\n results => {\n //console.log(results.data);\n console.log(\"Title: \" + results.data[\"Title\"]);\n console.log(\"Year: \" + results.data[\"Year\"]);\n //console.log(\"IMDB Rating: \" + results.data[\"Ratings\"][0][\"Value\"]);\n console.log(\"IMDB Rating: \" + results.data[\"imdbRating\"]);\n console.log(\"Rotten Tomatoes Rating: \" + results.data[\"Ratings\"][1][\"Value\"]);\n console.log(\"Country: \" + results.data[\"Country\"]);\n console.log(\"Language: \" + results.data[\"Language\"]);\n console.log(\"Plot: \" + results.data[\"Plot\"]);\n console.log(\"Actors: \" + results.data[\"Actors\"]);\n },\n err => {\n console.log(err);\n }\n );\n}", "title": "" }, { "docid": "55aa099c5d77bbe91e605b8d9cc105eb", "score": "0.5246725", "text": "function addIDandSelfLink(req, item){\n item.id = item[Datastore.KEY].id;\n item.self = \"https://\" + req.get(\"host\") + \"/ships/\" + item.id;\n return item;\n}", "title": "" }, { "docid": "44db8cc21c314b688a297bb5b770444b", "score": "0.52447313", "text": "function getMovieDetails(e){\n e.preventDefault();\n if(e.target.classList.contains('info-btn')){\n let movieItem = e.target.parentElement.parentElement;\n fetch(`https://www.omdbapi.com/?apikey=${apiKey}&i=${movieItem.dataset.id}`)\n .then((response)=>response.json())\n .then((data)=>{\n console.log(data);\n let output = `\n <div class=\"logo-img\">\n <img src=\"${data.Poster}\" alt=\"\">\n </div>\n\n <div class=\"Titles\">\n <h1 class=\"movie-title\">${data.Title}</h1>\n <h3 class=\"movie-category\"><strong>CATEGORY -</strong> ${data.Type}</h3>\n </div>\n\n <div class=\"details\">\n <h2>Details:</h2>\n <ul>\n <li><strong>Genre -</strong> ${data.Genre}</li>\n <li><strong>Released -</strong> ${data.Released}</li>\n <li><strong>Actors -</strong> ${data.Actors}</li>\n <li><strong>Director</strong> ${data.Director}</li>\n <li><strong>Language</strong> ${data.Language}</li>\n <li><strong>Ratings</strong> ${data.imdbRating}</li>\n <li><strong>Language</strong> ${data.Language}</li> \n <li><strong>Box Office</strong> ${data.BoxOffice}</li> \n </ul>\n </div> \n <div class=\"link\"> \n <a href=\"https://imdb.com/title/${data.imdbID}\" target=\"_blank\">get imdb</a>\n </div>\n `;\n movieDetailsContent.innerHTML = output;\n movieDetailsContent.parentElement.classList.add('showMovies')\n\n })\n }\n \n}", "title": "" }, { "docid": "00609323d2013d52d4f2f323aa697012", "score": "0.52446115", "text": "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}", "title": "" }, { "docid": "341d4f0cad3544bdabc89c68fd4ed9e6", "score": "0.5244549", "text": "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}", "title": "" }, { "docid": "5ffc82c82da4eeb481006e1b49748a13", "score": "0.5244298", "text": "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}", "title": "" }, { "docid": "16ce0dfa96cea1cc7f5d3923f88087ec", "score": "0.52435976", "text": "function movieThis(show) {\n // when called, show will be replaced with var = title.\n axios.get('http://www.omdbapi.com/?t=' + show + '&plot=short&apikey=trilogy')\n .then(function (response) {\n // console.log('////////////////AXIOS NO ERROR////////////')\n // console.log(response)\n // * Title of the movie.\n console.log(`Movie: ${response.data.Title}`)\n // * IMDB Rating of the movie.\n console.log(`IMDB Rating is: ${response.data.imdbRating}`)\n // * Year the movie came out.\n console.log(`Year Released : ${response.data.Released}`)\n // * Rotten Tomatoes Rating of the movie.\n console.log(`Rotten Tomatoes Rating : ${response.data.Ratings[1].Value}`)\n // * Country where the movie was produced.\n console.log(`Country : ${response.data.Country}`)\n // * Language of the movie.\n console.log(`Language : ${response.data.Language}`)\n // * Plot of the movie.\n console.log(`Plot : ${response.data.Plot}`)\n // * Actors in the movie.\n console.log(`Actors in movie : ${response.data.Actors}`)\n })\n // log error\n .catch(function (error) {\n console.log('//////////ERROR!!!/////////////')\n console.log(error);\n });\n}", "title": "" }, { "docid": "6816fae09aff4ce01da820d4a907558a", "score": "0.5241947", "text": "get MediaLink() {\n return this.mediaLink;\n }", "title": "" }, { "docid": "a05883aad5927ce44cb55207bafc162d", "score": "0.5231777", "text": "function getIMDBid(title) {\n var resp = showtime.httpGet('http://www.google.com/search?q=imdb+' + encodeURIComponent(showtime.entityDecode(unescape(title))).toString()).toString();\n var imdbid = resp.match(/http:\\/\\/www.imdb.com\\/title\\/(tt\\d+).*?<\\/a>/);\n if (imdbid) imdbid = imdbid[1];\n else {\n imdbid = resp.match(/http:\\/\\/<b>imdb<\\/b>.com\\/title\\/(tt\\d+).*?\\//);\n if (imdbid) imdbid = imdbid[1];\n };\n\tif (!imdbid) { // Trying to get imdbid by original name\n var fTitle = unescape(title).split(\" | \");\n if (fTitle[1]) {\n resp = showtime.httpGet('http://www.google.com/search?q=imdb+' + encodeURIComponent(showtime.entityDecode(fTitle[1])).toString()).toString();\n imdbid = resp.match(/http:\\/\\/www.imdb.com\\/title\\/(tt\\d+).*?<\\/a>/);\n if (imdbid) imdbid = imdbid[1];\n else {\n imdbid = resp.match(/http:\\/\\/<b>imdb<\\/b>.com\\/title\\/(tt\\d+).*?\\//);\n if (imdbid) imdbid = imdbid[1];\n };\n };\n\t}\n return imdbid;\n }", "title": "" }, { "docid": "6520918a44c5bcba75e2fd13e7d80570", "score": "0.52299225", "text": "function addMoviePicture() {\n movie_id = query_params.id;\n item_link = document.createElement(\"A\");\n\n link_pic = document.createElement('img');\n \n\n var pic_id = 0;\n if (movie_id > 1000) \n pic_id = movie_id.toString().charAt(0);\n \n\n var src = 'http://nelson.uib.no/o/' + pic_id + '/' + movie_id + '.jpg';\n link_pic.src = src;\n link_pic.id = \"cover\"\n\n item_link.appendChild(link_pic);\n\n /* Want to put the picture somewhere else on the site? Edit results to your id here. */\n forsideBilde.appendChild(item_link); \n}", "title": "" } ]
f7a7b63b8f5e32446acfd3cd32b8781f
function that takes the values of the input field and passes it to the registerThatUser function
[ { "docid": "a64d1a610d0cacf346f06cacd233e61a", "score": "0.0", "text": "add(e) {\n\t\te.preventDefault()\n\n\t\tlet newuser = {\n\t\t\tname: this.refs.name.value,\n\t\t\temail: this.refs.email.value,\n\t\t\tpassword: this.refs.password.value,\n\t\t\tconvoId: []\n\t\t}\n\n\t\tvar database = this.props.database\n\t\tvar go = true\n\n\t\t// Data Validation\n\n\t\t// Loop through the database\n\t\tfor (let i = database.length - 1; i >= 0; i--) {\n\t\t\t// If there is a match with a user in the database..\n\t\t\tif (database[i].email == newuser.email || database[i].name == newuser.name) {\n\t\t\t\t// ...the user goes back to the starting page (register)\n\t\t\t\tthis.props.changeThatView('failedRegistration', {})\n\t\t\t\tgo = false\n\t\t\t}\n\t\t}\n\n\t\tif (go) {\n\t\t\tthis.props.registerThatUser(newuser)\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "380ca14af2ed42c1540b5838fe506e8c", "score": "0.7040383", "text": "onRegister(value){\n\t\tif (value == null || value.username == null || value.username === '' || value.password == null || value.password === ''){\n\t\t\twindow.alert(i18n.t('LOGIN.GIVE_DATA'));\n\t\t} else {\n\t\t\tuserApi.register(value)\n\t\t\t\t.then(() => {\n\t\t\t\t\twindow.alert(i18n.t('LOGIN.REG_SUCCESS'));\n\t\t\t\t})\n\t\t\t\t.catch(error => {\n\t\t\t\t\twindow.alert(i18n.t(error.response.data.message));\n\t\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "be14e40f7bb339916591d98de310dfc3", "score": "0.69408864", "text": "function register(){\n var username = getFormValue('registeruser');\n var password = getFormValue('registerpass');\n var password2 = getFormValue('registerpass2');\n\n // If the username is not available shake username field\n if ($('registeruser').hasClassName('errorField')){\n $('registeruser').shake();\n return;\n }\n\n if (username && password && password2){\n // check user length\n if ( !isValueInRange(username, 4, 20, 'cinfo', getErrorString('INVALID_USERNAME')) ){\n $('registeruser').shake();\n return;\n }\n\n // check new password length\n if ( !isValueInRange(password, 8, 20, 'cinfo', getString('NEW_PASS_INVALID')) ){\n $('registerpass').setValue(\"\");\n $('registerpass').shake();\n $('registerpass2').setValue(\"\");\n $('registerpass2').shake();\n return;\n }\n\n // if new passwords are equals send the register request\n if (password == password2){\n sendAjax(USER_FUNCTIONS+'register.php', registerCallback, {\n username: username,\n password: password\n });\n } else {\n // show error message\n info('cinfo', getString('NEW_PASS_DIFFERS') , 4);\n $('registerpass2').setValue(\"\");\n $('registerpass2').shake();\n }\n }\n}", "title": "" }, { "docid": "17d4c515b7a40957b2acffbb87066412", "score": "0.6863155", "text": "function register() {\n event.preventDefault();\n var emm = getVal('email1');\n var pss = getVal('pwd1');\n var nmm = getVal('name');\n var dbb = getVal('dob');\n console.log(emm + '\\n' + pss + '\\n' + nmm + '\\n' + dbb);\n\n //Transfer control to firebase-auth sdk\n fireAuth.createUserWithEmailAndPassword(emm, pss)\n .then((user) => {\n saveData(emm, nmm, dbb);\n })\n .catch((error) => {\n //Errors in registration are handled here -auth module\n var erc = error.code;\n var erm = error.message;\n console.log(erc + '\\n' + erm);\n window.alert(\"Following Error Encountered \" + '\\n' + erm);\n });\n}", "title": "" }, { "docid": "5d0161827704ddb3b9606b73ba97c1cc", "score": "0.6837676", "text": "function submitInputs(name,email,phone,zipcode,password){\n apiService.register({\n 'username'\t: name,\n 'email'\t\t: email,\n 'zipcode'\t: zipcode,\n 'password'\t: password\n }).$promise.then(function(result) {\n console.log(result)\n $location.path('/')\n document.getElementById('registerMsg').innerHTML = 'register new user'\n }, function(error) {\n console.log('registration error', error)\n })\n }", "title": "" }, { "docid": "61ebdab94e93c9d8db84bd5b6bf5277c", "score": "0.6790599", "text": "function signup({city, email, dateOfBirth, password, username}){\n// create new user;\nreturn [city, email];\n}", "title": "" }, { "docid": "1dde7824a3e2c1024c9973e8386dfeeb", "score": "0.6748336", "text": "function getValuesReg() {\n var usuario = $('#inputUsr').val();\n var pass = $('#inputPass').val();\n var nombre = $('#inputNom').val();\n var apellido = $('#inputApe').val();\n var curso = $('#curso').val();\n var email = $('#inputEmail').val();\n registraUsuario(usuario, pass, nombre, apellido, curso, email);\n}", "title": "" }, { "docid": "f74b1aa355ad8ebdfc4a27850df5eda3", "score": "0.6722984", "text": "function register(){\n\tvar ROOT = \"https://hungrynorse.appspot.com/_ah/api/hungrynorse/v1/users/\";\n\tvar email = document.getElementById(\"email\");\n\tvar password = document.getElementById(\"password\");\n\tvar displayName = document.getElementById(\"displayName\");\n\t//alert(email.value + password.value + displayName.value);\n\t\n\tROOT += escape(email.value);\n\t$.getJSON( ROOT, {} )\n\t.done(function( data ) {\n\t\tif( data.email !== undefined ){ alert(\"Email address is already taken! Did you forget your password?\"); }\n\t\telse{\n\t\t\tvar ROOT = \"https://hungrynorse.appspot.com/_ah/api/hungrynorse/v1/users/\";\n\t\t\tROOT += displayName.value + \"/\" + encodeURIComponent(email.value) + \"/\" + password.value;\n\t\t\t$.post( ROOT, {} )\n\t\t\t.done( registerResponse )\n\t\t\t.fail( function() { alert(\"Something you entered broke! Please try again!\"); });\n\t\t}\n\t});\n}", "title": "" }, { "docid": "99b3d6d16763bfaf925e0372f2d4d078", "score": "0.6719244", "text": "static register(inputs, CallBack) {\n //verifier si l'email n'exste pas \n connexion.query(\"SELECT * FROM utilisateur WHERE email =? \", [inputs.email], (err, reslt) => {\n if (err) {\n CallBack(\"error\");\n } else if (typeof reslt[0] !== \"undefined\") {\n if (reslt[0].email === inputs.email) { CallBack(\"exist\"); }\n } else {\n let password = sha1(inputs.password);\n connexion.query(\"INSERT INTO utilisateur (nom, prenom, email, mdp, numTel, adresse, date) VALUES (?,?,?,?,?,?,?)\", [inputs.nom, inputs.prenom, inputs.email, password, inputs.tel, inputs.adresse, date], (err, result) => {\n if (err) {\n CallBack('notInsert');\n } else {\n connexion.query(\"SELECT * FROM utilisateur WHERE email =? \", [inputs.email], (err, res) => {\n\n const generateRandomCode = (() => {\n let USABLE_CHARACTERS = \"abcdefghijklmnopqrstuvwxyz0123456789\".split(\"\");\n return length => {\n return new Array(length).fill(null).map(() => {\n return USABLE_CHARACTERS[Math.floor(Math.random() * USABLE_CHARACTERS.length)];\n }).join(\"\");\n }\n })();\n let code = generateRandomCode(6);\n connexion.query(\"INSERT INTO adherent (code, utilisateur_idUtil) VALUES (?,?)\", [code, res[0].idUtil], (err, rlt) => {\n if (err) {\n CallBack(\"error\");\n } else {\n CallBack({\n code: code,\n id: res[0].idUtil,\n });\n }\n });\n });\n }\n });\n }\n });\n }", "title": "" }, { "docid": "95a0d5e8e6fa5d305c68e2ccde6b0301", "score": "0.6700708", "text": "function handleRegistration() {\n username = document.getElementById(\"username\").value\n password = document.getElementById(\"password\").value\n var usrCheck = userNameGetVal()\n var passCheck = passGetVal()\n if (usrCheck && passCheck) {\n var obj = {\n user_name: username,\n user_password: password\n }\n database.ref(\"Account\").push(obj);\n alert(\"Account created!\")\n } else if (usrCheck == false || passCheck == false) {\n alert(\"Please correct all issues before creating account\")\n }\n }", "title": "" }, { "docid": "55b233ab11118c4e532ded555ace1303", "score": "0.6679838", "text": "function btnRegister(){\n\n\n\tlet user = $('#user').val();\n\tlet mail = $('#username_register').val();\n\tlet password = $('#password_register').val();\n\tlet password_confirm = $('#conf_password').val();\n\n\tif(isEmpty(user,mail,password,password_confirm) == true){\n\n\t\tif(validate_mail(mail) == false){\n\n\t\t\tif(validate_password(password,password_confirm) == true){\n\t\t\t\tpostRegister(user,mail,password,password_confirm);\n\t\t\t}\n\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "0840f206e977a4947103aef2e3a23443", "score": "0.6667733", "text": "function register() {\r\n\tvar val = /^(([^<>()\\[\\]\\\\.,;:\\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,}))$/;\r\n\temail = document.getElementById('registerEmail').value;\r\n\tpassword1 = document.getElementById('registerPassword').value;\r\n\tpassword2 = document.getElementById('registerPasswordAgain').value;\r\n\t\r\n\tif(email == '' || password1 == '' || password2 == '') {\r\n\t\tindexModal('Please fill out the form boxes');\r\n\t} else if (val.test(String(email).toLowerCase()) == false) {\r\n\t\tindexModal('Invalid email');\r\n\t} else if(email in loginCredentials) {\r\n\t\tindexModal('Email already taken');\r\n\t} else if(password1 == password2) {\r\n\t\tloginCredentials[email] = password1;\r\n\t\tindexModal('Account created');\r\n\t} else {\r\n\t\tindexModal('Passwords do not match!');\r\n\t}\t\r\n}", "title": "" }, { "docid": "9ff1e79eacffb3727e42d0632469eebb", "score": "0.66587466", "text": "registerCredentials (username, password, confirmed) { \n this.emailInput.setValue(utl.getTimeCode()+username);\n this.passwordInput.setValue(password);\n this.confirmPasswordInput.setValue(confirmed);\n }", "title": "" }, { "docid": "4ea02657b4a1af2083cc36e5c1b519fb", "score": "0.65696585", "text": "async register(parent, {registerInput: {username, email, password, confirmPassword}}, context, info){\n //validate user data\n const {valid, errors} = validateRegisterInput(username, email, password, confirmPassword)\n if(!valid){\n throw new UserInputError('Errors', {errors})\n }\n //make sure user doesn't exist\n //the await is important because an error will be thrown if await is not used\n const user_find = await User.findOne({username});\n if(user_find){\n throw new UserInputError('Username is taken', {\n //the errors object will be used later on the frontend for form validation\n errors: {\n username: 'This username is taken'\n }\n })\n }\n //hash password\n //12 is just a good number for our hashing function\n password = await bcrypt.hash(password, 12);\n\n const newUser = new User({\n email,\n username,\n password,\n createdAt: new Date().toISOString()\n })\n\n const user = await newUser.save()\n\n //create auth token\n const token = generateToken(user)\n\n return {\n ...user._doc,\n id: user._id,\n token\n }\n \n }", "title": "" }, { "docid": "259be26b922f629a2ed988654f270948", "score": "0.6551189", "text": "function registerUser() {\n\t\t\tuserFactory.register({\n\t\t\t\temail: $scope.newAccount.email,\n\t\t\t\tpassword: $scope.newAccount.password\n\t\t\t})\n\t\t\t.then((userData) => {\n\t\t\t\t// any error registering will return the userData as undefined -- if register is successfull then log in and update User Profile Name\n\t\t\t\tif (userData !== undefined ){\n\t\t\t\t\t//Immediately log them in\n\t\t\t\t\tuserFactory.logIn($scope.newAccount)\n\t\t\t\t\t.then((newaccount) => {\n\t\t\t\t\t\tlet name = $scope.displayName;\n\t\t\t\t\t\t//Update profile using the name they provided\n\t\t\t\t\t\tuserFactory.updateDisplayName(name);\n\t\t\t\t\t})\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\taddUser();\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tconsole.log(\"error updating display name\", error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "9fcd382e43d235003c3c8d963f707ff0", "score": "0.6519015", "text": "static singUp(inputs,CallBack){\n\n //check if the email does not exist\n connexion.query(\"SELECT * FROM users WHERE email =? \", [inputs.email], (err, result) => {\n if (err) {\n CallBack(\"error\");\n } else if (typeof result[0] !== \"undefined\" && result[0].email === inputs.email) {\n CallBack(\"exist\"); // si the email exist \n } else {\n //clank the password\n let password = sha1(inputs.password);\n //if the email does not exist we crate new user \n connexion.query(\"INSERT INTO users (nom, prenom, email, password) VALUES (?,?,?,?)\", [inputs.nom, inputs.prenom, inputs.email, password], (err, result) => {\n if (err) {\n CallBack('error');\n }else{\n CallBack(result.insertId);\n }\n });\n }\n });\n\n }", "title": "" }, { "docid": "25fcc9cc0f9b778abf841e9afe002d3d", "score": "0.6510599", "text": "function signUp() {\n let user = {};\n user.firstName = $('#first-name').val();\n user.lastName = $('#last-name').val();\n user.phoneNumber = $('#phone-number').val();\n user.email = $('#email').val();\n user.password = $('#password').val();\n user.confirmPassword = $('#confirm-password').val();\n validateUserDetails(user);\n}", "title": "" }, { "docid": "9d20387e34a41031b74dc498ff84ecb5", "score": "0.649795", "text": "function registerUser(ev) {\n ev.preventDefault();\n let registerUsername = $('#registerUsername');\n let registerName = $('#registerName');\n let registerPassword = $('#registerPasswd');\n\n let usernameVal = registerUsername.val();\n let nameVal = registerName.val();\n let passVal = registerPassword.val();\n\n auth.register(usernameVal, passVal, nameVal)\n .then((userInfo) => {\n saveSession(userInfo);\n registerUsername.val(\"\");\n registerName.val(\"\");\n registerPassword.val(\"\");\n showInfo('User registration successful.');\n }).catch(handleError);\n }", "title": "" }, { "docid": "a8e07736d3b07e1ca48c80e98d3efa9b", "score": "0.64902836", "text": "function setUser(){\t\n\tvar nickname = document.getElementById('input').value; //nome do utilizador\n\tvar type = document.getElementById('typeSelect').value; //tipo de utilizador\n\tif (nickname.length !== 0) {\n\tfetch(\"http://localhost:8081/newUser_field:\" + nickname + \"_field:\" + type, {method: \"POST\"}) //pedido post\n\t\t.then(function(response){\n\t\t\treturn(response.text().then(function(text){ //resposta \n\t\t\t\tcurUser = text; //id do utilizador\n\t\t\t\tdocument.getElementById('input').value = \"\";\n\t\t\t\tSwal.fire(\n\t \t\t\t\t 'Nickname registado com sucesso',\n\t \t\t\t\t 'Bem-vindo!',\n\t \t\t\t\t 'success'\n\t \t\t\t\t)\n\t \t\t\t\tdocument.getElementById(\"registo\").disabled = true;\n\t\t\t\t\t\tinput.placeholder = \"Escreve aqui a tua mensagem ...\";\n\t\t\t}));\n\t\t});\n} else {Swal.fire(\n\t\t 'Escreve um nickname válido!') \n\t}\n}", "title": "" }, { "docid": "28a274e039045e3d4570121218376441", "score": "0.648513", "text": "function register(){\n // Get all our input fields\n email = document.getElementById('email').value\n password = document.getElementById('password').value\n full_name = document.getElementById('full_name').value\n \n\n favourite_song = document.getElementById('favourite_song').value\n milk_before_cereal = document.getElementById('milk_before_cereal').value\n\n //Validate input fields\n if (validate_email(email) == false || validate_password(password) == false) {\n alert('Email or Password is Outta Line!!')\n return\n // Don't continue running the code\n }\n if (validate_field(full_name) == false || validate_field(favourite_song) == false || validate_field(milk_before_cereal) == false)\n {\n alert(' One or More Extra fields is Outta Line!! ')\n return\n }\n\n // Move on with Auth\n auth.creatUserWithEmailAndPassword(email, password)\n .then(function(){\n\n //Declare user variable\n var user = auth.currentUser\n // Add this user to Firebase Databse\n var database_ref = database.ref()\n\n // Create User data \n var user_data = {\n email : email,\n full_name : full_name,\n favourite_song : favourite_song,\n milk_before_cereal :milk_before_cereal,\n last_login : Data.now()\n }\n database_ref.child(' users/' + user.uid).set(user_data)\n\n\n\n\n\n })\n .catch(function(error){\n // Firebase will use this to alert of\n var error_code= error.code\n vae error_message = error.message \n\n alert (error_message)\n })\n \n\n\n }", "title": "" }, { "docid": "e9b67dbe7239edb9edfcf4b79f5bdd15", "score": "0.6471019", "text": "function populateUserInputScreen(firstName, lastName, email, lobster, spearfish, lionfish)\n\t\t\t{\t\t\n\t\t\t\tdocument.getElementById(\"firstName\").value=firstName;\n\t\t\t\tdocument.getElementById(\"lastName\").value=lastName;\n\t\t\t\tdocument.getElementById(\"email\").value=email;\n\t\t\t\tdocument.getElementById(\"lobsterLicence\").value=lobster;\n\t\t\t\tdocument.getElementById(\"spearfishingLicence\").value=spearfish;\n\t\t\t\tdocument.getElementById(\"lionfishPermit\").value=lionfish;\n\t\t\t}", "title": "" }, { "docid": "8e62580c16e51183a1c753f09f0dc8c2", "score": "0.64710104", "text": "function register(){\n\tvar form = document.getElementById(\"register\");\n\t\n\tvar user = form.user.value;\n\tvar pw1 = form.pw1.value;\n\tvar pw2 = form.pw2.value;\n\t\n\t// check username\n\tvar user_re = /^([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]){5,9}$/\n\t\n\t// check pw\n\tvar pw_re = /^\\w{6,10}$/\n\n\tif (user_re.test(user)){\n\t\tif ((pw_re.test(pw1)) & \n\t\t(pw1.search(/[a-z]/)!=-1) & \n\t\t(pw1.search(/[A-Z]/)!=-1) & \n\t\t(pw1.search(/[0-9]/)!=-1)){\n\t\t\tif (pw1===pw2){\n\t\t\t\talert(\"Passed Validation\");\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\talert(\"Invalid Input: Passwords do not match\");\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}else{\t\n\t\t\talert(\"Invalid Input: Password\");\n\t\t\treturn false;\n\t\t};\n\t}else{\n\t\talert(\"Invalid Input: Username\");\n\t\treturn false;\n\t};\n}", "title": "" }, { "docid": "fc315586cfc3426adcd89964ffadf111", "score": "0.6459829", "text": "function register() {\n //Log In\n if (!registered && $(\"#name\").val()) {\n\n //Enable typing and sending\n $(\"#chat-content *\").attr(\"disabled\", false);\n $(\"#wellcome\").append(`<p>Wellcome: <strong>${$(\"#name\").val()}</strong></p>`)\n //Get user name\n name = $(\"#name\").val();\n\n $(\"#name\").attr(\"disabled\", true);\n $(\"#register\").html(\"Log out\");\n\n //registered\n registered = true;\n\n //Joine default room (room 1)\n joinLeave('joined', name, room);\n $('#android').addClass('active');\n\n }\n // Log out\n else {\n\n //disable typing and sending\n $(\"#chat-content *\").attr(\"disabled\", true);\n $(\"#name\").attr(\"disabled\", false);\n\n // username = ''\n $(\"#name\").val(\"\");\n $(\"#register\").html(\"Join\");\n registered = false;\n $('#chatbox').val('');\n $(\"#wellcome\").html();\n //Send request to leave current room\n joinLeave('leaved', name, room);\n\n reset();\n }\n }", "title": "" }, { "docid": "026f2e23e6c02d3f71b2c3d735108148", "score": "0.64578116", "text": "function register(fname_input,lname_input,email_input,password_input,confirm_password_input) {\n\n // Get user inputs\n first_name = $(fname_input).val();\n last_name = $(lname_input).val();\n email = $(email_input).val();\n password = $(password_input).val();\n confirm_password = $(confirm_password_input).val();\n\n // Check if first name has been entered\n if (first_name == \"\") {\n $(fname_input).addClass(\"is-danger\");\n } else {\n $(fname_input).removeClass(\"is-danger\");\n }\n\n // Check if last name has been entered\n if (last_name == \"\") {\n $(lname_input).addClass(\"is-danger\");\n } else {\n $(lname_input).removeClass(\"is-danger\");\n }\n\n // Check if email has been entered\n if (email == \"\") {\n $(email_input).addClass(\"is-danger\");\n } else {\n $(email_input).removeClass(\"is-danger\");\n }\n\n // Check if passwords have been entered and are the same\n if (password != confirm_password || password==\"\") {\n $(password_input).addClass(\"is-danger\");\n $(confirm_password_input).addClass(\"is-danger\");\n $('#register_error').html(\"Passwords do not match\");\n } else {\n $(password_input).removeClass(\"is-danger\");\n $(confirm_password_input).removeClass(\"is-danger\");\n }\n\n // Check if any of the inputs have errors, stop processing if so\n if ($(fname_input).parent().find('.is-danger').length != 0) {\n return false;\n }\n\n // Send data to server to create user\n $.post(\"/applicant/register\",\n {first_name:first_name, last_name:last_name, email:email, password:password},\n function(data) {\n // If user successfully created, send user to jobs page, else show the error message\n if (data == \"Success\") {\n window.location.href = \"/applicant/jobs\"\n } else {\n $('#register_error').html(data);\n }\n });\n\n // Prevent page reload\n return false;\n\n}", "title": "" }, { "docid": "23aaddc2e7e971172c64320443dfb160", "score": "0.64340556", "text": "function userRegistration(ev) {\n ev.preventDefault();\n const registered = {\n email: reg.email,\n name: reg.name,\n password: reg.password,\n };\n\n phoenixRegister(registered).then((isSuccess) => {\n if (isSuccess) {\n phoenixLogin(registered.email, registered.password).then(\n (isLoginSuccess) => {\n if (isLoginSuccess) {\n const successDataFetch = getUserInfo();\n\n if (successDataFetch) {\n history.push(\"/\");\n } else {\n history.push(\"/login\");\n }\n } else {\n history.push(\"/login\");\n }\n }\n );\n }\n });\n }", "title": "" }, { "docid": "ea56e7d7cdd8c5556344496c6e879334", "score": "0.64099985", "text": "function userRegistration() {\n var data = {\n 'fullName': vm.fullName,\n 'email': vm.email,\n 'password': vm.Upwd\n }\n\n userRegistrationService.addUser(data, function (result) {\n if (result === true) {\n $state.go('login');\n } else {\n vm.error = 'Username is already Registered';\n //vm.loading = false;\n \n }\n });\n }", "title": "" }, { "docid": "9fc264a694c89018dd75affe5796b551", "score": "0.64004624", "text": "register (formValue) {\n const user = formValue\n return axios.post(ENDPOINT_PATH + 'user', user).then(response => {\n alert(response.data.message)\n this.setUserLogged(response.data.token)\n return response\n },\n )\n }", "title": "" }, { "docid": "d1dc42cc52895742e54bd6324fde036f", "score": "0.63965964", "text": "function onRegister({ name, username, pwd }) {\r\n //crates a modal\r\n //saves to db\r\n //close the modal\r\n}", "title": "" }, { "docid": "a8badeede3aa319dcf2bc775dcc034ff", "score": "0.63937134", "text": "function signUp(username, password, email, dob, city) { // order of parameters matters here\n // create new user logic\n}", "title": "" }, { "docid": "a539b785836e4ca77b6150bd9be28bc2", "score": "0.6377747", "text": "async register(_, {registerInput: {username, email, password, confirmPassword} }) {\n const {valid, errors} = validateRegisterInput(username, email, password, confirmPassword);\n \n // Check if registration data is valid\n if (!valid) {\n throw new UserInputError('Errors', { errors });\n }\n\n // Check if user already exists\n const user = await User.findOne( {username} );\n if (user) {\n throw new UserInputError('Username: taken', {errors: {username: 'This username already exists'} });\n }\n\n // Once all tests are passed, hash the password to enhance security\n password = await bcrypt.hash(password, 12);\n\n // Save the new user into MongoDB\n const newUser = new User({email, username, password, createdAt: new Date().toISOString() });\n const savedUser = await newUser.save();\n\n // Generate a Login Token for the new user\n const token = generateToken(savedUser);\n\n return { ...savedUser._doc, id: savedUser._id, token };\n // Note: ...savedUser._doc means all the details of the savedUser.\n // In MongoDB, id is auto-generated and is not part of the details.\n }", "title": "" }, { "docid": "f15bc6c4f5c6f00bbb6ffce346e227f6", "score": "0.6361813", "text": "function registerUser(){\n let user = prompt('what is your user name');\n // this will activate the use function once we have entered the prompt.\n welcome();\n}", "title": "" }, { "docid": "3a6fab9343a7cc3d94d463868c025924", "score": "0.6340877", "text": "function register_user(number, callback){\n\tcallback(null, true);\n}", "title": "" }, { "docid": "9913b466a8585e849ab95a445d495c77", "score": "0.63331324", "text": "function registrationFlow(info, sendResponse) {\n // tries to create user. could fail if displayname or email taken\n createUser(info, sendResponse, (user) => {\n // user sign up successful\n setCachedValue('tipp_account', user);\n handleTippUserCreationSuccess(sendResponse);\n });\n }", "title": "" }, { "docid": "7efff1147041232d3bf582f41e52c66f", "score": "0.63325524", "text": "register(firstName, lastName, dob, gender, email, password) {\n return axios.post(API_URL + \"signup\", {\n firstName,\n lastName,\n dob,\n gender,\n email,\n password\n });\n }", "title": "" }, { "docid": "84dccf9c905ff707251554cdbf1c9dfc", "score": "0.6320952", "text": "function mySignUp( { dateOfBirth, username, password, email, city }) {\n return username + ' ' + password + ' ' + email + ' ' + dateOfBirth + ' ' + city;\n}", "title": "" }, { "docid": "24a40f3ea3ab8ccf30a4a08ce72bd75f", "score": "0.6320722", "text": "function registerUser(ev) {\n ev.preventDefault();\n let form = $('#registerForm');\n let registerUsername = form.find('input[name=\"username\"]');\n let registerPassword = form.find('input[name=\"password\"]');\n let repeatPassword = form.find('input[name=\"repeatPass\"]');\n\n let usernameVal = registerUsername.val();\n let passwordVal = registerPassword.val();\n let repeatPasswordVal = repeatPassword.val();\n\n let regExUsername = /^[a-zA-z]{3,}$/; //username should be at least 3 characters long and should contain only english alphabet letters.\n let regExPass = /^[a-zA-z0-9]{6,}$/; //user‘s password should be at least 6 characters long and should contain only english alphabet letters and digits.\n\n if (!regExUsername.test(usernameVal)) {\n return showError('A username should be at least 3 characters long and should contain only english alphabet letters.')\n }\n if (!regExPass.test(passwordVal)) {\n return showError('A user‘s password should be at least 6 characters long and should contain only english alphabet letters and digits.')\n }\n if (passwordVal !== repeatPasswordVal){\n return showError(\"Passwords dosen't match\")\n }\n auth.register(usernameVal, passwordVal)\n .then((userInfo) => {\n registerUsername.val(\"\");\n registerPassword.val(\"\");\n repeatPassword.val(\"\");\n saveSession(userInfo);\n saveSession(userInfo) //!!!! Пропуск\n showInfo('User registration successful.');\n }).catch(handleError);\n }", "title": "" }, { "docid": "93968c4277cfe5461bdf11cb6f37a79e", "score": "0.63170063", "text": "registerForAccount() {\n this.state.blankFields = false;\n this.state.alreadyExistingUser = false;\n if (\n document.getElementsByClassName('firstName')[0].value === '' ||\n document.getElementsByClassName('lastName')[0].value === '' ||\n document.getElementsByClassName('userName')[0].value === '' ||\n document.getElementsByClassName('email')[0].value === '' ||\n document.getElementsByClassName('password')[0].value === ''\n ) {\n this.setState({ blankFields: true });\n } else {\n let requestData = {\n firstName: document.getElementsByClassName('firstName')[0].value,\n lastName: document.getElementsByClassName('lastName')[0].value,\n userName: document.getElementsByClassName('userName')[0].value,\n email: document.getElementsByClassName('email')[0].value,\n password: document.getElementsByClassName('password')[0].value,\n };\n\n this.props.submitData('/signup', requestData, (response, err) => {\n // todo this is all wrong, should be a 400 type error with a message explaining it\n if (response.data.messageCode === 101 || response.data.messageCode === 102) {\n this.setState({\n alreadyExistingUser: true,\n });\n } else {\n this.props.updateUserInfo(\n requestData.firstName,\n requestData.lastName,\n requestData.userName,\n requestData.email,\n response.data._id\n );\n this.props.isLoggedIn(true);\n this.props.displayLoginSignup(false);\n }\n });\n }\n }", "title": "" }, { "docid": "9ad7cb49750afab9edc81b1ee81799dd", "score": "0.6316786", "text": "static async registerUser(_, {first_name, last_name, email, phone, comments, role, status}) {\r\n console.log(\"Upload User\")\r\n try {\r\n let _result = await this.insert({\r\n data: {\r\n\t\t\t\t\tfirst_name,\r\n\t\t\t\t\tlast_name,\r\n\t\t\t\t\temail,\r\n\t\t\t\t\tphone,\r\n\t\t\t\t\tcomments,\r\n\t\t\t\t\trole,\r\n\t\t\t\t\tstatus\r\n\t\t\t\t}\r\n })\r\n return this.getByID(_, {id: _result.insertId})\r\n } catch (err) {\r\n\t\t\treturn (err)\r\n\t\t} finally {\r\n\t\t\tconsole.log(\"Registered User\");\r\n }\r\n }", "title": "" }, { "docid": "dd3ff7e4ad863acd6145fff2ba9a631b", "score": "0.63152295", "text": "function registerHandler(e) {\n e = e || event;\n e.preventDefault();\n e.stopImmediatePropagation();\n\n var formInput = {\n username: document.querySelectorAll('.register__username')[0],\n surname: document.querySelectorAll('.register__surname')[0],\n gender: document.querySelectorAll('.register__gender')[0],\n email: document.querySelectorAll('.register__email')[0],\n address: document.querySelectorAll('.register__address')[0],\n phone: document.querySelectorAll('.register__phone')[0],\n about: document.querySelectorAll('.register__about')[0],\n password: document.querySelectorAll('.register__password')[0],\n confirmPassword: document.querySelectorAll('.register__cpassword')[0]\n }\n\n if (formInput['password'].value !== formInput['confirmPassword'].value) {\n authFormsManager.showError(formInput['password'], \"Error in \" + 'password/or confirm password');\n return;\n }\n\n var valid = true;\n for (var name in formInput) {\n if (formInput.hasOwnProperty(name)) {\n var flag = true;\n if (formInput[name].getAttribute('pattern'))\n flag = new RegExp(formInput[name].getAttribute('pattern'), 'ig').test(formInput[name].value);\n if (!flag) {\n authFormsManager.showError(formInput[name], \"Error in \" + name);\n valid = flag;\n }\n }\n }\n\n if (!valid) return;\n\n var newUser = {};\n for (var prop in formInput) {\n if (formInput.hasOwnProperty(prop) && prop !== 'confirmPassword') {\n newUser[prop] = formInput[prop].value;\n }\n }\n\n $.ajax({\n url: \"/register\",\n type: \"POST\",\n data: newUser\n }).done(function(msg, textStatus) {\n console.log(textStatus + ': ' + msg);\n authFormsManager.registerHide();\n clearFormInput(document.querySelectorAll('.register__form')[0]);\n createDialog('You sussecfully registered!');\n setTimeout(function() {\n removeDialog();\n }, 2000);\n }).fail(function(err) {\n authFormsManager.registerHide();\n createDialog('You already registered!');\n setTimeout(function() {\n removeDialog();\n }, 2000);\n console.log(\"Error: \", err.status + \" \"+ err.statusText);\n });\n }", "title": "" }, { "docid": "9be752112e2e01bad64e5fa71155b4c5", "score": "0.63130593", "text": "function inputUser(name, id) {\n\t\t$.post(\"/api/housemember\", {\n\t\t\tname: name,\n\t\t\tUserId: id,\n\t\t})\n\t\t\t.then((data) => {\n\t\t\t\tconsole.log(\"A new user has been added!\");\n\t\t\t\tlocation.reload();\n\t\t\t})\n\t\t\t.catch(handleLoginErr);\n\t}", "title": "" }, { "docid": "66f9272309695d2cc38c28e00c0bd624", "score": "0.63117635", "text": "registerNewAccount(userName, firstName, lastName,\n email, password, password2, agreeTerms) {\n \n var baseError = \"<p style=\\\"color: red;\\\">\";\n\n // Check if any inputbox is empty.\n if (this.checkIfEmpty([userName, firstName, lastName,\n email, password, password2]) === true)\n {\n this.buildRegisterPage(baseError + \"Make sure every input box is filled with data!</p>\");\n return;\n }\n \n // Check if user agrees with our terms of condition.\n if (agreeTerms === undefined)\n {\n this.buildRegisterPage(baseError + \"You need to agree with the terms of condition to proceed!</p>\");\n return;\n }\n\n // Input validation.\n if (this.inputValidation([userName, firstName, lastName,\n email, password, password2]) === true)\n {\n this.buildRegisterPage(baseError + \"Characters like ' \\\" \\\\ / | ` are not allowed! </p>\");\n return;\n }\n\n // Checking if password has a correct value.\n if (password.length < 8) {\n this.buildRegisterPage(baseError + \"Your password needs to have 8 or more characters!</p>\");\n return;\n }\n if (password !== password2) {\n this.buildRegisterPage(baseError + \"The first password doesn't match the second one! </p>\");\n return;\n }\n\n // Check if user already exists.\n (async () => {\n const result = await this.checkIfAlreadyExists(userName, \"userName\");\n if (result === 1) {\n this.buildRegisterPage(baseError + \"The username is already registered!<br> \" +\n \"Click <a href=\\\"/login\\\">here</a> to login or try another username!</p>\");\n return;\n }\n else {\n const result = await this.checkIfAlreadyExists(email, \"emailAddress\");\n if (result === 1) {\n this.buildRegisterPage(baseError + \"The email-address is already registered! <br>\" +\n \"Click <a href=\\\"/login\\\">here</a> to login or try another email-address!</p>\");\n return;\n }\n this.request.session.newUser = true;\n\n\n const result2 = await this.createNewAccount(userName, firstName, lastName,\n email);\n if (result2 === false) {\n this.buildRegisterPage\n (baseError + \n \"Failed to create a new account! Error code 2001</p>\");\n return;\n }\n\n const result3 = await this.createNewAccount2(email, password);\n if (result3 === false) {\n this.buildRegisterPage\n (baseError + \n \"Failed to create a new account! Error code 2002</p>\");\n return;\n }\n else {\n\n this.request.session.tries = 0;\n this.request.session.username = userName;\n this.request.session.email = email;\n this.request.session.loggedin = true;\n \n this.response.redirect('/my-files');\n }\n }\n })();\n }", "title": "" }, { "docid": "d239fe28efd985132b8d530ac05e583c", "score": "0.6311364", "text": "async register() {\n\n const user = this.ctx.request.body;\n\n // user's email and password doesn't exist\n if (!user.email || !user.password) {\n this.response(403, 'email and password required');\n return;\n }\n\n // user's email format error\n if (!validator.isEmail(user.email)) {\n this.response(403, 'format of email error');\n return;\n }\n\n // generate user's info and encrypt some info\n user.token = this.service.crypto.generateToken(user.email);\n user.password = this.service.crypto.encrypto(user.password);\n user.createAt = Date.parse(new Date());\n user.sspj = 0;\n\n // add new user to table users\n if (!await this.service.users.insert(user)) {\n this.response(403, 'register failed');\n return;\n }\n\n // Judge if the investor referraled by some other\n const referral = this.getToken();\n this.setToken(null);\n if (referral) {\n await this.service.followers.insert({ token: referral, email: user.email });\n }\n\n // active account(through validate email) and redirect to login page\n await this.sendEmail(user.email);\n this.response(203, 'Email has beed sent, please check you email and click active link to active account');\n }", "title": "" }, { "docid": "28c004ba79b1bd9649d8349915bdcd50", "score": "0.63071173", "text": "function register(oucu) {\n\t\t\tvar onSuccess = function(data){\n\t\t\t\tvar obj = $.parseJSON(data);\n\t\t\t\tif (obj.status == \"success\") {\n\t\t\t\t\talert(\"User \" + oucu + \" has been successfully registered.\");\n\t\t\t\t} else {\n\t\t\t\t\talert(\"User \" + oucu + \" is already registered.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Post the user ID using the \"users\" API\n\t\t\tvar uri = \"http://137.108.92.9/openstack/taxi/users\";\n\t\t\tvar params = { OUCU: oucu };\n\t\t\tif (oucu != \"\")\n\t\t\t\t$.post(uri,params,onSuccess);\n\t\t}", "title": "" }, { "docid": "d24285e7e00b8fd57a9653563d929004", "score": "0.6303026", "text": "function registerUser(event) {\n event.preventDefault();\n event.stopPropagation();\n\n const email = document.getElementById('email').value;\n const password = document.getElementById('password').value;\n const username = document.getElementById('username').value;\n localStorage.setItem('username', username)\n // create user with email and password\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function (response) {\n \n if (response.operationType == 'signIn') {\n showHideButtonLoader('registerButton', 'hideLoader');\n // saveUserDataToDB();\n // window.location.href = '/airtime.html';\n }\n }).catch(function (error) {\n if (error.code == 'auth/email-already-in-use') {\n const errorsTranslate = i18next.t('validateForm.emailInUse');\n const errors = [errorsTranslate];\n const elementsWithErrors = ['email'];\n setErrors(errors, elementsWithErrors);\n showHideButtonLoader('registerButton', 'hideLoader');\n }\n });\n\n\n}", "title": "" }, { "docid": "92ba93ceed2e9aa84d4b5bc9e0e61b9f", "score": "0.62971294", "text": "function clickRegister() {\r\n\tvar reglogInput = document.getElementById('login-reg');\r\n\tvar regMailInput = document.getElementById('email');\r\n\tvar regPassInput = document.getElementById('password-reg');\r\n\tvar regConfPassInput = document.getElementById('confPassword');\r\n\tvar name = reglogInput.value;\r\n\tvar email = regMailInput.value;\r\n\tvar password = regPassInput.value;\r\n\tvar confPass = regConfPassInput.value;\r\n\tname = name.replace(/\\s/g, empty);\r\n\temail = email.replace(/\\s/g, empty);\r\n\tpassword = password.replace(/\\s/g, empty);\r\n\tconfPass = confPass.replace(/\\s/g, empty);\r\n\t//validation of input data\r\n\tcheckRegData(name, email, password, confPass);\r\n\tif(count == 0){\r\n\t\tif(document.getElementById('login-reg-error') != null){\r\n\t\t\tclearInput(reglogInput.id);\r\n\t\t}\r\n\t\tif(document.getElementById('email-error') != null){\r\n\t\t\tclearInput(regMailInput.id);\r\n\t\t}\r\n\t\tif(document.getElementById('password-reg-error') != null){\r\n\t\t\tclearInput(regPassInput.id);\r\n\t\t}\r\n\t\tif(document.getElementById('confPassword-error') != null){\r\n\t\t\tclearInput(regConfPassInput.id);\r\n\t\t}\r\n\t\t//sending data to the server and receiving a response\r\n\t\taddUserToDB(name, email, password);\r\n\t}else{\r\n\t\t/*\r\n\t\t * checking for errors and displaying an error message or \r\n\t\t * clearing the input form when data is entered correctly\r\n\t\t */\r\n\t\tif(checkNameMessage.length != 0 && document.getElementById('login-reg-error') == null){\r\n\t\t\t//output a message about incorrect data entered\r\n\t\t\taddErrorMessage(reglogInput, checkNameMessage);\r\n\t\t\tcheckNameMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkNameMessage.length == 0 && document.getElementById('login-reg-error') != null){\r\n\t\t\t\t//clearing the input form when incorrect data is entered\r\n\t\t\t\tclearInput(reglogInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(checkMailMessage.length != 0 && document.getElementById('email-error') == null){\r\n\t\t\taddErrorMessage(regMailInput, checkMailMessage);\r\n\t\t\tcheckMailMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkMailMessage.length == 0 && document.getElementById('email-error') != null){\r\n\t\t\t\tclearInput(regMailInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(checkPassMessage.length != 0 && document.getElementById('password-reg-error') == null){\r\n\t\t\taddErrorMessage(regPassInput, checkPassMessage);\r\n\t\t\tcheckPassMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkPassMessage.length == 0 && document.getElementById('password-reg-error') != null){\r\n\t\t\t\tclearInput(regPassInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(checkConfPassMessage.length != 0 && document.getElementById('confPassword-error') == null){\r\n\t\t\taddErrorMessage(regConfPassInput, checkConfPassMessage);\r\n\t\t\tcheckConfPassMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkConfPassMessage.length == 0 && document.getElementById('confPassword-error') != null){\r\n\t\t\t\tclearInput(regConfPassInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "aff49eb70ced0306e138757a9a9faeab", "score": "0.62927604", "text": "function registerA(user, password) { return { type: \"REGISTER\", user, password }; }", "title": "" }, { "docid": "9a98ccaba2877c7c7ffe96ac1ab5b4b4", "score": "0.62885666", "text": "function handleRegisterPress() {\n if (username !== \"\" && name !== \"\" && email !== \"\" && password !== \"\" && confPassword !== \"\" && passcode !== \"\" && confPasscode !== \"\") {\n if (!validateUsername(username)) {\n displaySnackBar(\"error\", \"Username cannot contain symbol and spaces\");\n return;\n }\n if (!validateName(name)) {\n displaySnackBar(\"error\", \"Name cannot contain symbol and spaces\");\n return;\n }\n if (!validateEmail(email)) {\n displaySnackBar(\"error\", \"Invalid Email id format\");\n return;\n }\n if (password !== confPassword) {\n displaySnackBar(\"error\", \"Password do not match\");\n return;\n }\n if (passcode.length !== 4) {\n displaySnackBar(\"error\", \"Pass code must be 4 digits long\");\n return;\n }\n if (passcode !== confPasscode) {\n displaySnackBar(\"error\", \"Passcode do not match\");\n return;\n }\n\n //all is good\n setIsLoading(true);\n dispatch && dispatch(registerUserAction(username, name, email, password, passcode));\n } else {\n displaySnackBar(\"error\", \"Please fill all the input fields\");\n }\n }", "title": "" }, { "docid": "fdfa8580d0869e224ebce290dfc306ab", "score": "0.62850136", "text": "function addUser () {\n\t//assign variables from input fields\n\tnewNameFirst = $('#add_user .nameFirst input').val();\n\tnewNameLast = $('#add_user .nameLast input').val();\n\tnewEmail = $('#add_user .email input').val();\n\n\tif (newNameFirst && newNameLast && newEmail) {\n\t\t//creates new User instance based on input data\n\t\tnew User({nameFirst:newNameFirst, nameLast:newNameLast, email:newEmail});\n\n\t\t//clears text from input fields\n\t\t$('#add_user .nameFirst input').val(\"\");\n\t\t$('#add_user .nameLast input').val(\"\");\n\t\t$('#add_user .email input').val(\"\");\n\t} else {\n\t\talert('Please enter all required fields');\n\t}\n}", "title": "" }, { "docid": "f9cecfd8db61256b26f3ea29f3a6ab95", "score": "0.62757605", "text": "register(e) {\n\t\tthis.setState({\n\t\t\tpassError: false,\n\t\t\temailError: false,\n\t\t\tregError: false,\n\t\t})\n\t\t// prevent default behavior\n\t\te.preventDefault();\n\n\t\t// set email var and pass var to value of inputs\n\t\tvar newUser = {\n\t\t\temail: this.refs.email.value.trim(),\n\t\t\tpass: this.refs.pass.value.trim(),\n\t\t\tconPass: this.refs.conPass.value.trim(),\n\t\t\tusername: this.refs.username.value.trim(),\n\t\t\tf_name: this.refs.f_name.value.trim(),\n\t\t\tl_name: this.refs.l_name.value.trim(),\n\t\t\tgender: this.refs.gender.value.trim()\n\t\t}\n\n\t\t// If password doesn't match the confirmation password, tell the user.\n\t\tif (newUser.pass != newUser.conPass) {\n\t\t\tthis.setState({\n\t\t\t\tpassError: true\n\t\t\t})\n\t\t\t// stop the function\n\t\t\treturn;\n\t\t}\n\n\t\t// Test if email is in the proper format\n\t\tif ( !(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(newUser.email))) {\n\t\t\tthis.setState({\n\t\t\t\temailError: true\n\t\t\t})\n\t\t\t// stop the function\n\t\t\treturn;\n\t\t}\n\n\t\t// if none of the above errors happened, run our Registration\n\t\telse {\n\t\t\t// authenticate login\n\t\t\tauth.register(newUser, (registered) => {\n\t\t\t\t// if we register the user\n\t\t\t\tif (registered) {\n\t\t\t\t\t// send us to their profile page\n\t\t\t\t\tthis.context.router.push({pathname: '/profile'})\n\t\t\t\t}\n\t\t\t\t// otherwise\n\t\t\t\telse {\n\t\t\t\t\t// tell the user we had a register error\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tregError:true\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "c58348dd2d07157c37aca86a1311dd5f", "score": "0.6274158", "text": "function register () {\n \tif(vm.pass != vm.repeatpass){\n \t\talert(\"Passwords must match!\");\n \t\treturn;\n \t}\n var userData = {\n \"username\": vm.username, \"password\": vm.pass, \"email\": vm.email,\n \"firstName\": vm.firstName, \"lastName\": vm.lastName\n };\n //get radio option\n \n $http.post('/api/users/register/'+vm.type, userData).then(function (response) {\n if (response) {\n $scope.indexCtrl.login(userData);\n }\n },function(response){\n \talert(response.data.response);\n });\n }", "title": "" }, { "docid": "d01411b9dafda35cec1381be6cbff9e4", "score": "0.6263008", "text": "async Register(ctx, username, first_name, last_name) {\n const user = {\n Type: 'user',\n Username: username,\n FirstName: first_name,\n LastName: last_name,\n Token: 0,\n LastUpdated: new Date(),\n };\n return ctx.stub.putState(username, Buffer.from(JSON.stringify(user)));\n }", "title": "" }, { "docid": "d7924064c7750f2fb79d7dab74215478", "score": "0.6251995", "text": "function signup ( email, password, firstName, lastName, birthdate, gender, userMap ) {\n if ( userMap[email] ) {\n return Promise.reject(\"User has already been created!\")\n }\n return got.post('https://qa.api2.fox.com/v2.0/register', {\n headers: generalHeader,\n body: signupBody( email, password, firstName, lastName, birthdate, gender ),\n json: true\n })\n .then( res=> {\n return res;\n })\n .catch( err => {\n console.log(err)\n return err;\n })\n \n}", "title": "" }, { "docid": "911ec4793a907f00189232f9d584dd55", "score": "0.62489265", "text": "function signUpUser({userName, password, email, dateOfBirth, state}) {\n //create new user\n console.log(userName,password,email,dateOfBirth,state);\n}", "title": "" }, { "docid": "c43300c22685c6358b84c87c66c85517", "score": "0.62424195", "text": "function register (username, password){\n\n const newuser = new usermodel({\n\n username: username,\n password: password\n\n })\n newuser.save();\n\n console.log('user added');\n return\n\n}", "title": "" }, { "docid": "56942114d430c9cd9eaf7c53306e1b81", "score": "0.6239112", "text": "function registerUser(username,password,successCallback,failCallback)\n{\n if(password && username)\n {\n db.checkExists('users','username',username,function(){\n //does not exist\n var userInfo = {\n username: username,\n password: pw.generate(password)\n };\n console.log(JSON.stringify(userInfo));\n\n db.insert(\"users\",userInfo,function(){\n successCallback();\n },function(){\n failCallback(\"An internal error occured. Try again later.\");\n });\n\n },function(){\n //exists\n failCallback(\"Username already exists.\");\n });\n }\n else {\n failCallback(\"Please fill out the entire form.\");\n }\n}", "title": "" }, { "docid": "3fa4a6b44a8b8b4807049997b54123be", "score": "0.6229119", "text": "registerName (fname, lname) {\n this.firstNameInput.setValue(fname);\n this.lastNameInput.setValue(lname);\n }", "title": "" }, { "docid": "6b22d60985c51012ec784b50cf11fcfe", "score": "0.62287563", "text": "function signup({ password, email, dateOfBirth, city, username}) {\n console.log(`create new user with username: ${username}` )\n}", "title": "" }, { "docid": "7b5aef750ab249507f9e6a9593f64c58", "score": "0.6226746", "text": "function register(username, password, password2) {\n\n if (username === null || username === '' || typeof username === 'undefined') {\n model.usernameError = \"Username required\";\n model.passError = null;\n model.passError2 = null;\n model.error = null;\n return;\n }\n\n if (password === null || password === '' || typeof password === 'undefined') {\n model.usernameError = null;\n model.passError = \"Password required\";\n model.passError2 = null;\n model.error = null;\n return;\n }\n\n if (password2 === null || password2 === '' || typeof password2 === 'undefined') {\n model.usernameError = null;\n model.passError = null;\n model.passError2 = \"Please verify your password\";\n model.error = null;\n return;\n }\n\n model.usernameError = null;\n model.passError = null;\n model.passError2 = null;\n\n if (password !== password2) {\n model.error = \"Passwords must match\";\n return;\n }\n var found = null; //userService.findUserByUsername(username);\n\n if (found !== null || username === null) {\n model.error = \"Username is not available\";\n } else {\n var user = {\n username: username,\n password: password\n };\n userService\n .register(user)\n .then(function (user) {\n $location.url('/profile');\n });\n\n }\n\n }", "title": "" }, { "docid": "812dfcc4b022bbc394bbea5fd7cdc7bb", "score": "0.62030226", "text": "static async register(data) {\n // add json validation here\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE username = $1`,\n [data.username]\n );\n\n if (duplicateCheck.rows[0]) {\n const err = new Error(\n `There already exists a user with username '${data.username}`);\n err.status = 409;\n throw err;\n }\n\n const hashedPassword = await bcrypt.hash(data.password, BCRYPT_WORK_FACTOR);\n\n const reqObj = Object.entries(data)\n .filter(entry => entry[1].length)\n .reduce((acc, entry, i) => {\n acc.columns = [...acc.columns, entry[0]];\n acc.values = [...acc.values, entry[0] === 'password' ? hashedPassword : entry[1]];\n acc.ref = [...acc.ref, `$${i + 1}`];\n return acc;\n }, {columns: [], values: [], ref: []});\n\n const result = await db.query(\n `INSERT INTO users \n (${reqObj.columns.join(', ')}) \n VALUES (${reqObj.ref.join(', ')}) \n RETURNING username, password, image_url, bio, email, location, header_image_url`,\n reqObj.values);\n\n return result.rows[0];\n }", "title": "" }, { "docid": "63531fb1c0308c13c13900d21563a8c5", "score": "0.6183072", "text": "function RegistrarUsuario(){\r\n\r\n if(txtcor==\"\" txtcor==null){\r\n alert{\"Ingresa el Correo\"};\r\n txtCor.focus();\r\n } else if(txtCon.value==\"\" txtCon==null){\r\n alert(\"Ingrese la Contraseña\");\r\n txtCon.focus();\r\n }else{\r\n //Capturando Valores\r\n var cor=txtCor.value;\r\n var cor=txtCor.value;\r\n //llamamos a la funcion de firebase para crear usuarios\r\n .auth().createUserWithEmailAndPassword(email, password)\r\n .then((userCredential) => {\r\n // Signed in\r\n alert(\"se registró el usuario en firebase\");\r\n Limpiar();\r\n })\r\n.catch((error) => {\r\n alert(\"No se pudo regitrar el usuario en Firebase\");\r\n limpiar();\r\n });\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "80078903738125b7baff5493dc73592c", "score": "0.6182997", "text": "addNewUser(e){\n //e.preventDefault();\n const username = e.target.elements.username.value;\n const email = e.target.elements.email.value;\n const firstName = e.target.elements.firstName.value;\n const lastName = e.target.elements.lastName.value;\n const occupation = e.target.elements.occupation.value;\n const dob = e.target.elements.dob.value;\n\n const address = web3.eth.accounts[0];\n userProfileContract.addUser(address, username, email, firstName, lastName, occupation, dob, {\n from: web3.eth.accounts[0],\n gas: 200000,\n }, (err, results) => {\n if (err) {\n console.error('[UserProfile Contract] Error during addition of new user registration', err);\n } else {\n console.log('[UserProfile Contract] - New user added to system', results.toString());\n }\n });\n }", "title": "" }, { "docid": "c514bdf8f921985a2b770c58e022a8e8", "score": "0.6178682", "text": "function validate() //checks input individually\n{\n\t\t var valid_form = false; //valid form false \n\t\t var reg_details = \"\"; //details for the registraion\n\t\t \n\t\t //User name check\n\t\t var unameX = document.getElementById(\"registerForm\").user.value;\n\t\t \n\t\t if((unameX == null) || (unameX.length == 0)) //if there is no input\n\t\t {\n\t\t\t document.alert(\"Please enter a valid user name!\");\n\t\t\t valid_form = false; //flag error\n\t\t }\n\t\t reg_details += unameX; //add unameX to reg_details\n\t\t reg_details += \" \"; //add space to reg_details\n\t\t \n\t\t //First name check\n\t\t var fnameX = document.getElementById(\"registerForm\").first.value;\n\t\t \n\t\t if((fnameX == null) || (fnameX.length == 0)) //if there is no input\n\t\t {\n\t\t\t document.alert(\"Please enter a valid first name!\");\n\t\t\t valid_form = false; //flag error\n\t\t }\n\t\t reg_details += fnameX; //add fnameX to reg_details\n\t\t reg_details += \" \"; //add space to reg_details\n\t\t \n\t\t //Last name check\n\t\t var lnameX = document.getElementById(\"registerForm\").last.value;\n\t\t \n\t\t if ((lnameX == null) || (lnameX.length == 0)) //if there is no input\n\t\t {\n\t\t\t document.alert(\"Please enter a valid last name!\");\n\t\t\t valid_form = false; //flag error\n\t\t }\n\t\t reg_details += lnameX; //add lnameX to reg_details\n\t\t reg_details += \" \"; //add space to reg_details\n\t\t \n\t\t //Age Check\n\t\t var ageX = document.getElementById(\"registerForm\").age.value; //sets the age value to the input var\n\t\t if ((ageX == null) || (isNaN(ageX)) || (ageX.length ==0)) //if input is null or is not a number or is = 0\n\t\t {\n\t\t\t if (ageX <= 17 || ageX >= 90)\n\t\t\t {\n \t\t\t \tdocument.alert(\"Please enter a valid age.\\n(18 - 90)\");\n\t\t\t \tvalid_form = false; //flag error\n\t\t\t }\n\t\t }\n\t\t reg_details += ageX; //add ageX to reg_details\n\t\t reg_details += \" \"; //add space to reg_details\n\t\t \n\t\t //Password creds, left simple\n\t\t var passwordX = document.getElementById(\"registerForm\").password.value;\n\t\t if (passwordX.length < 5)\n\t\t {\n\t\t\t document.alert(\"Please enter a valid password.\\nMore than six characters.\");\n\t\t\t valid_form = false; //flag error\n\t\t }\n\t\t \n\t\t //Email Check\n\t\t var emailX = document.getElementById(\"registerForm\").email.value;\n\t\t if (email_check(emailX) == false) //if the email field is false\n\t\t {\n\t\t\t document.alert(\"Please enter a valid e-mail.\\nExample: [email protected]\");\n\t\t\t valid_form = false; //flag error\n\t\t }\n\t\t reg_details += emailX; //add emailX to reg_details\n\t\t reg_details += \"\\n\"; //add newline to end of reg_details\n\t\t \n\t\t valid_form = true; //flag from as true to process\n\t\t \n\t\t document.alert(\"DEBUG: Valid reg details: \" + reg_details); // display debug\n}", "title": "" }, { "docid": "70209522155702f11faa0c9a4b4c13fb", "score": "0.6169782", "text": "registerUser(lectureName) {\n Meteor.call('sliderValues.insert', this.state.userID, this.state.value, lectureName, new Date());\n }", "title": "" }, { "docid": "65d9740403b735e8c49a47d706bf2b3c", "score": "0.6159774", "text": "function addUserListener() {\n // Used to minimize and shortify this script\n let values = [ \n getElementValue(\"add-name\"),\n getElementValue(\"add-email\"),\n getElementValue(\"add-pass\"),\n getElementValue(\"add-pass-conf\")\n ];\n\n // Terminate if password is not the same\n if (values[3] != values[2] && values[0] == \"\" && values[1] == \"\") {\n alert(\"Vänligen fyll i all fält korrekt\");\n\n return;\n }\n \n // Adds login function to this function\n let result = registerUser(values[0], values[1], values[2]);\n\n // If result is successful, proceed, else alert user\n if (result != null) {\n // Re-render user table if succeeded\n if (result[\"success\"]) {\n // Re-render actual user table\n refreshUserTable(\"user-table\");\n\n // All popup boxes\n closeAllPopups();\n } else alert(\"Kunde inte lägga till användare\");\n } else alert(\"Vänligen se till att fälten är giltiga\");\n}", "title": "" }, { "docid": "8b36050019d39a98100a62d84a99b8b5", "score": "0.61581886", "text": "function addSignUpInput(event){\n event.preventDefault();\n var inputCount = 0;\n $('#inputDiv input').each(function(index, val) {\n inputCount++;\n });\n //add email input if only user and pass are showing\n if (inputCount == 2) {\n $(\"#pass\").after(\"<input class='form-control inputField' id='email' name='email' type='text' placeholder='Student Email Address: [email protected]'/>\"); \n $(\"#signIn\").text(\"Back\");\n } else if (inputCount == 3) {\n //try to add the user\n addUser();\n } \n \n}", "title": "" }, { "docid": "b6eaa160e013e5e55cb7f7ca791bf4b7", "score": "0.61554253", "text": "function signup() {\n\n}", "title": "" }, { "docid": "838f2c5fff8036e0b2fb875e1901ccaf", "score": "0.6152309", "text": "function signUpUser() {\n\t\n\tvar email =\t$('#registerEmail').val().trim()\n\tvar password = $('#registerPassword').val().trim()\n\n\n\t//registers user using google auth\t\n\n\n\t\tfirebase.auth().createUserWithEmailAndPassword(email, password).catch(function (error) {\n\t\t\t// Handle Errors here.\n\t\t\tvar errorCode = error.code;\n\t\t\tvar errorMessage = error.message;\n\t\t\t// ...\n\n\t\t})\t\n\t}", "title": "" }, { "docid": "d48b7147ba14a17afac1772a998b930a", "score": "0.61482483", "text": "async registerUser(params){\n\t\ttry {\n\t\t\treturn await\n\t\t\t this.db.query(\"INSERT INTO user (`username`,`password`, `surname`, `name`, `age`, `gender`,`relantionshiop`, `country`, `online`) VALUES (?,?,?,?,?,?,?,?,?)\", [params['username'],params['password'],params['surname'],params['name'],params['age'],params['gender'],params['relantionshiop'],params['country'],'Y']);\n } catch (error) {\n\t\t\tconsole.error(error);\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" }, { "docid": "310052ed0d29167e23691896c7aada77", "score": "0.614219", "text": "function userRegister() {\n\tvar email_id1 = $(\"#user_registration input[name=email]\").val();\n\tvar user_pwd1 = $(\"#user_registration input[name=password]\").val();\n\tvar user_cofirmpwd1 = $(\"#user_registration input[name=confirm_password ]\")\n\t\t\t.val();\n\tif (!validateEmail(email_id1)) {\n\t\t$(\"#mobilenoerror\").text(\"\");\n\t\t// console.log(\"bad email\");\n\t\t$(\"#user_registration input[name=email]\").val('');\n\t\t$(\"#user_registration input[name=email]\").focus();\n\t\t$(\"#regemailerror\").text(\"[Enter valid email id]\");\n\t\treturn false;\n\t} else if (!validatePassword(user_pwd1)) {\n\t\t$(\"#mobilenoerror\").text(\"\");\n\t\t$(\"#regemailerror\").text(\"\");\n\t\t// console.log(\"bad password\");\n\t\t$(\"#user_registration input[name=password]\").val('');\n\t\t$(\"#user_registration input[name=confirm_password ]\").val('');\n\t\t$(\"#user_registration input[name=password]\").focus();\n\t\t$(\"#passworderror\")\n\t\t\t\t.text(\n\t\t\t\t\t\t\"[Password must contain at least 6 characters, including Upper/lowercase and numbers.]\");\n\t\treturn false;\n\t} else if (user_pwd1 != user_cofirmpwd1) {\n\t\t$(\"#mobilenoerror\").text(\"\");\n\t\t$(\"#regemailerror\").text(\"\");\n\t\t$(\"#passworderror\").text(\"\");\n\t\t$(\"#passworderror\").text(\"[Password Mismatch Enter Password Again]\");\n\t\t$(\"#user_registration input[name=password]\").val('');\n\t\t$(\"#user_registration input[name=confirm_password ]\").val('');\n\t\t$(\"#user_registration input[name=password]\").focus();\n\t\treturn false;\n\t}\n\t$(\"#mobilenoerror\").text(\"\");\n\t$(\"#regemailerror\").text(\"\");\n\t$(\"#passworderror\").text(\"\");\n\t$(\"#registrationerrormessage\").text(\"\");\n\treturn true;\n\n}", "title": "" }, { "docid": "30b9635b8f155c17b9fd9184795257a1", "score": "0.6138873", "text": "function addUserInfo() {\n sql = 'INSERT into User (Email, Password, Type) VALUE(?, ?, ?);';\n value = [email, pwd, 'Restaurant'];\n conn.query(sql, value, function (err, result) {\n if (err) { console.log('Inserting to User Failed'); }\n else { addLocation(result.insertId); }\n })\n }", "title": "" }, { "docid": "c3129d50201d049df3960c8694203e21", "score": "0.61337984", "text": "function signup(){\n var userNameRef = document.getElementById('username')\n var cellNumberRef = document.getElementById('cellnumber')\n var emailRef = document.getElementById('email')\n var passwordRef = document.getElementById('password')\n var passwordrepeatRef = document.getElementById('passwordrepeat')\n var customError = document.getElementById(\"custom-error\")\nvar user = {\n name: userNameRef.value,\n cellNumber: cellNumberRef.value,\n email: emailRef.value,\n password: passwordRef.value,\n passwordrepeat: passwordrepeatRef.value\n \n}\nvar valid = customValidation(user);\nif (valid){\n console.log('valid', valid)\n firebase.auth().createUserWithEmailAndPassword(user.email,user.password)\n .then(function(success){\n console.log(\"success\", success);\n })\n .catch(function(error){\n console.log(\"error\", error) ;\n setTimeout(()=>{customError.style.display = \"none\";}, 2000)\n \n })\n \n}\nelse{\n console.log('in valid', valid)\n customError.style.display = \"block\";\n setTimeout(()=>{customError.style.display = \"none\";}, 2000)\n}\n\n\n\n// console.log(\"user\",user);\n\n\n\n }", "title": "" }, { "docid": "a32881aef9d7545c44066a3d0a7ddcc2", "score": "0.61324227", "text": "function registerValidation() {\n var first=firstName();\n var last=lastName();\n var user=userName();\n var qual=qualification();\n var special=specialization();\n var password=passwordValidate();\n // var phone=phoneNumber();\n if(first==false || last==false || user==false||password==false || qual==false || special==false ){\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "29f8ad0d456b55e4331ddae84d032822", "score": "0.6130049", "text": "function register(req, res) {\n var username = req.body.username\n var password = Whirlpool(req.body.password)\n var name = req.body.name\n\n function onSave(err, user) {\n if(err != null ) {\n res.json({ error: err.message })\n return\n }\n\n if(user == null) {\n res.json({error: 'User couldn\\'t be registered'})\n return\n }\n\n res.json(user)\n return\n }\n\n User.findOne({ 'username' : username, 'password' : password }, 'id name username',(err, user) => {\n\n if(err != null ) {\n res.json({ error: err.message })\n return\n }\n\n if(user != null) {\n res.json({ error: 'User already exists'})\n return\n }\n\n const newUser = new User({ 'name': name, 'username': username, 'password' : password })\n newUser.save(onSave)\n })\n}", "title": "" }, { "docid": "58db968c41cab3ab5631cd637811cb00", "score": "0.6123909", "text": "function processRegister(req, res, next){\n\tvar user = {\n\t\tlogin : req.body.login,\n\t\tpassword : req.body.password\n\t};\n\n\tUserService.containsUser(user, function(r){\n\t if (!r.hasUser){\n\t\t UserService.addUser(user, function(err){\n\t\t\t if(err){\n\t\t\t\t util.log(\"error on adding user : \" + err);\n\t\t\t\t res.json({status : \"Fail\", message : \"Error on adding user to database...\"});\n\t\t\t } else{\n\t\t\t\t res.json({status : \"OK\", message : \"You have successfully registered\"});\n\t\t\t }\n\t\t });\n\t\t} else {\n\t\t\tres.json({status : \"Fail\", message : \"Such user already exists\"});\n\t\t}\n });\n}", "title": "" }, { "docid": "74be8095a40a93aed442d658b79ae5c0", "score": "0.6114766", "text": "function registerUser(e){\n\n\t\t/*Submit event has a default behavior, for now, it will refresh the page and therefore, we lose our information*/\n\t\te.preventDefault()\n\t\tconsole.log(\"The page will no longer refresh because of submit.\")\n\t\t/*Good Practice: Check the states before passing to fetch*/\t\t\n/*\t\tconsole.log(firstName)\n\t\tconsole.log(lastName)\n\t\tconsole.log(email)\n\t\tconsole.log(mobileNo)\n\t\tconsole.log(password)*/\n\n\t\t/*\n\n\t\tFetch is javascript which will allow us to process requests and receive responses from our api.\n\n\t\tfetch(<urlInString>,{options\n\n\t\t\tmethod: \"requestMethod\",\n\t\t\theaders: {\n\t\t\t\t\n\t\t\t\t'Content-Type': 'application/json'\n\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\t\n\t\t\t\tkey: value\n\n\t\t\t})\n\n\t\t})\n\n\t\t*/\n\n\t\tfetch('https://afternoon-coast-98402.herokuapp.com/api/users/',{\n\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\n\t\t\t\tfirstName: firstName,\n\t\t\t\tlastName: lastName,\n\t\t\t\temail: email,\n\t\t\t\tmobileNo: mobileNo,\n\t\t\t\tpassword: password,\n\t\t\t\tconfirmPassword: confirmPassword\n\n\t\t\t})\n\n\t\t//response should be parsed into an object to be used in javascript, that is with the use of .json()\n\t\t})\n\t\t.then(response => response.json())\n\t\t.then(data => {\n\n\t\t\t//actual response from the server/api\n\t\t\tconsole.log(data)\n\t\t\t//if there is an error like same email or undefined property within the body\n\t\t\t/*\n\t\t\t\t{message: \"message\"}\n\n\t\t\t*/\n\t\t\tif(data.message){\n\n\t\t\t\tSwal.fire({\n\n\t\t\t\t\ticon: \"error\",\n\t\t\t\t\ttitle: \"Registration Failed.\",\n\t\t\t\t\ttext: data.message\n\n\t\t\t\t})\n\n\t\t\t} else {\n\n\t\t\t\tSwal.fire({\n\n\t\t\t\t\ticon: \"success\",\n\t\t\t\t\ttitle: \"Registration Successful!\",\n\t\t\t\t\ttext: \"Thank you for registering.\"\n\n\t\t\t\t})\n\n\t\t\t\t//update the willRedirect state to true after user registers successfully.\n\t\t\t\tsetWillRedirect(true)\n\n\t\t\t}\n\n\t\t})\n\n\t\t//reset input states/ states bound to input to their initial values\n\t\tsetFirstName(\"\")\n\t\tsetLastName(\"\")\n\t\tsetMobileNo(\"\")\n\t\tsetEmail(\"\")\n\t\tsetPassword(\"\")\n\t\tsetConfirmPassword(\"\")\n\n\t}", "title": "" }, { "docid": "4fcdbb23f47d22f77d7cb32b1c25a5a4", "score": "0.6113002", "text": "signUp() {\n }", "title": "" }, { "docid": "a43ee7c95bbcce65a1cf3eee5761e583", "score": "0.61072", "text": "function Registration() {\n const history = useHistory();\n\n // State for the new user\n const [reg, setNewReg] = useState({\n name: \"\",\n email: \"\",\n password: \"\",\n confirm: \"\",\n errorName: \"\",\n errorEmail: \"\",\n errorPassword: \"\",\n });\n\n function updateState(field, ev) {\n let registerUser = Object.assign({}, reg);\n registerUser[field] = ev.target.value;\n registerUser.errorPassword = checkPassword(\n registerUser.password,\n registerUser.confirm\n );\n registerUser.errorName =\n registerUser.name === \"\" ? \"Please enter a name!\" : \"\";\n registerUser.errorEmail =\n registerUser.email === \"\" ? \"Please enter an email!\" : \"\";\n setNewReg(registerUser);\n }\n\n function checkPassword(password, confirm) {\n if (password.length < 6) {\n return \"Password must be at least 6 characters!\"\n } else if (password !== confirm) {\n return \"Passwords must match!\";\n } else {\n return \"\";\n }\n }\n\n // Sets error to empty is user is valid\n function newUserIsValid() {\n return (\n reg.errorName === \"\" &&\n reg.errorEmail === \"\" &&\n reg.errorPassword === \"\"\n );\n }\n\n // Based on tuck's Github\n function userRegistration(ev) {\n ev.preventDefault();\n const registered = {\n email: reg.email,\n name: reg.name,\n password: reg.password,\n };\n\n phoenixRegister(registered).then((isSuccess) => {\n if (isSuccess) {\n phoenixLogin(registered.email, registered.password).then(\n (isLoginSuccess) => {\n if (isLoginSuccess) {\n const successDataFetch = getUserInfo();\n\n if (successDataFetch) {\n history.push(\"/\");\n } else {\n history.push(\"/login\");\n }\n } else {\n history.push(\"/login\");\n }\n }\n );\n }\n });\n }\n\n return (\n <Form onSubmit={userRegistration}>\n <Row><Col>\n\n\n <Form.Group controlId=\"userName\">\n <Form.Label>Full Name:</Form.Label>\n <Form.Control\n type=\"text\"\n placeholder=\"Bob Joe\"\n onChange={(ev) => updateState(\"name\", ev)}\n value={reg.name}\n />\n <Badge variant=\"warning\">{reg.errorName}</Badge>\n </Form.Group>\n\n </Col>\n <Col>\n\n <Form.Group controlId=\"userEmail\">\n <Form.Label>Email:</Form.Label>\n <Form.Control\n type=\"email\"\n placeholder=\"[email protected]\"\n onChange={(ev) => updateState(\"email\", ev)}\n value={reg.email}\n />\n <Badge variant=\"warning\">{reg.errorEmail}</Badge>\n </Form.Group>\n </Col>\n </Row>\n <Row>\n <Col>\n\n <Form.Group controlId=\"userPassword\">\n <Form.Label>Create a password:</Form.Label>\n <Form.Control\n type=\"password\"\n placeholder=\"******\"\n onChange={(ev) => updateState(\"password\", ev)}\n value={reg.password}\n />\n </Form.Group>\n\n </Col>\n <Col>\n\n <Form.Group controlId=\"userConfirm\">\n <Form.Label>Re-enter password:</Form.Label>\n <Form.Control\n type=\"password\"\n placeholder=\"******\"\n onChange={(ev) => updateState(\"confirm\", ev)}\n value={reg.confirm}\n />\n <Badge variant=\"warning\">{reg.errorPassword}</Badge>\n </Form.Group>\n </Col>\n </Row>\n\n <Button variant=\"info\" type=\"submit\" disabled={!newUserIsValid()}>\n Register!\n </Button>\n </Form>\n );\n}", "title": "" }, { "docid": "ebbc69d697a83b4d4a79044d5b0b4719", "score": "0.6103255", "text": "function register(){\n let username=document.getElementById('reg-name').value;\n let userpass=document.getElementById('reg-pass').value; \n window.location.href = `login.html?user=${username}&password=${userpass}`;\n}", "title": "" }, { "docid": "b8c345003f132f6f58fc59c5e05fe00d", "score": "0.6102997", "text": "function signUpUser(email, password, firstName, lastName, companyName, address, phone, taxId, suite, country, city, zip, state, approvedBuyer, admin) {\n $.post(\"/accounts/signup\", {\n email: email,\n password: password,\n firstName: firstName,\n lastName: lastName,\n companyName: companyName,\n address: address,\n phone: phone,\n taxID: taxId,\n suite: suite,\n country: country,\n city: city,\n zip: zip,\n state: state,\n approvedBuyer: approvedBuyer,\n admin: admin\n }).then(function(data) {\n if (data.duplicateUser) {\n alert(\"Sorry, that username has been taken\");\n } else {\n window.location.replace(data);\n }\n }).catch(function(err) {\n console.log(err);\n });\n }", "title": "" }, { "docid": "9fa8677ac2f5071ac768b68d0caf4eb3", "score": "0.60975224", "text": "function createUserClick(){\n var username = document.getElementById(\"new_username_input\").value;\n var password = document.getElementById(\"new_password_input\").value;\n Clotho.createUser(username,password).then(function(result){\n console.log(result);\n if (result != null){\n $('#error_field').text('User is Created! Welcome, '+username+'. Please try logging in now!');\n }\n else{\n $('#error_field').text('Cannot create user; connection may be lost or user may already exist.');\n }\n });\n}", "title": "" }, { "docid": "ee46939248e34efe1fd8eecf7f5e24bb", "score": "0.60962164", "text": "function handleSignUp() {\n // get user sign up info from input fields\n let userInfo = {\n 'username': document.getElementById('name').value,\n 'email': document.getElementById('email').value,\n 'password': document.getElementById('password').value\n }\n\n registerUser(userInfo).then(\n function(responseBody) {\n // deal with error if there is one\n if (responseBody.ERROR) {\n window.showSnackBar(responseBody.ERROR, 'error-snackbar', 4000);\n } else {\n console.log(\"User registered with id: \" + responseBody.userId);\n localStorage.setItem(\"userId\", responseBody.userId);\n localStorage.setItem(\"username\", userInfo.username);\n localStorage.setItem(\"theme\", \"bootstrap\");\n window.location.replace('home.html');\n }\n }\n );\n}", "title": "" }, { "docid": "b88fa06f3310b41c841070d37ace2bbe", "score": "0.6095551", "text": "function saveRegistration() {\n\tif((document.getElementById('uname').value != '') && (document.getElementById('ulogin').value != '') && (document.getElementById('umail').value != '') && document.getElementById('upassword').value != '' && document.getElementById('uconfirm').value != '') {\n\t\tvar valid = false;\n\t\tvar validEmail = document.getElementById('umail').value.match(/\\b(^(\\S+@).+((\\.com)|(\\.net)|(\\.edu)|(\\.mil)|(\\.gov)|(\\.org)|(\\..{2,2}))$)\\b/gi);\n\t\t\n\t\tif(document.getElementById('upassword').value == document.getElementById('uconfirm').value)\n\t\t\tvalid = true;\n\t\telse\n\t\t\talert('No se puede realizar la operaci�n:\\nVerifique su usuario, las contrase�as no coinciden.');\n\t\t\n\t\tif(valid) {\n\t\t\tif(validEmail)\n\t\t\t\tdocument.getElementById('frmuser').submit();\n\t\t\telse\n\t\t\t\talert('No se puede realizar la operaci�n:\\nVerifique sus datos, la direcci�n de correo no es correcta.');\n\t\t}//end if\n }//end if\n \telse {\n \talert('No se puede realizar la operaci�n:\\nVerifique sus datos, hay campos vac�os.');\n\t}//end else\n}//function", "title": "" }, { "docid": "b79c1629391310755b0c4201158151f0", "score": "0.608666", "text": "function _register() {\n params = _generateCredentials(\"new\");\n $.ajax({\n url: domain + '/register',\n type: 'POST',\n contentType: 'application/json',\n dataType: 'json',\n data: params\n })\n .success(function() {\n _success();\n })\n .fail(function() {\n _failure(\"Registration Error\");\n });\n }", "title": "" }, { "docid": "788662519d1c45240b6f5fb37d86b9d0", "score": "0.6082476", "text": "function registerUser(data) {\n var pool = db.pool; // obtain database login attributes\n pool.getConnection(function (error, connection) {\n connection.query( // perform query with encrypter password\n 'INSERT INTO users(name, lastname, password, username, email, birthday) VALUES(?, ?, ?, ?, ?, ?)',\n [data[0], data[1], bcrypt.hashSync(data[2], null, null), data[3], data[4], data[5]],\n function (error, results, fields) {\n connection.release();\n if (error) throw error;\n console.log(\"registered user\");\n }\n )\n });\n}", "title": "" }, { "docid": "0f73d70c1148ecbb5b8fc9dbd7a538e8", "score": "0.6077351", "text": "function register(registerObj, callback)\n {\n var serviceUrl = \"/perc-membership-services/membership/user\";\n\n $.PercServiceUtils.makeXdmJsonRequest(null, serviceUrl, $.PercServiceUtils.TYPE_POST, function(status, results)\n {\n if(status == $.PercServiceUtils.STATUS_SUCCESS){\n callback(status,results.data);\n }\n else{\n var defMsg = $.PercServiceUtils.extractDefaultErrorMessage(results.request);\n callback(status, defMsg);\n }\n \n }, registerObj); \n }", "title": "" }, { "docid": "f70aacfb52c3f29792de6b6f88ccccf0", "score": "0.6072544", "text": "function registration(req, res) {\n var deferred = Q.defer();\n var username = req.body.username;\n var body = 'username=' + username + '&orgName=Org1';\n rp({\n method: 'POST',\n uri: config.Ip + '/users',\n body: body,\n headers: {\n 'User-Agent': 'Request-Promise',\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }).then(function (data) {\n console.log(\"User Enrolled\", data)\n req.data = data;\n // deferred.resolve({ message: \"Registration Successful\" })\n deferred.resolve(initUser(req, res));\n }).catch(function (err) {\n deferred.reject(err);\n })\n return deferred.promise;\n}", "title": "" }, { "docid": "d7eb40527546c0f440ba5d6de5a84726", "score": "0.6065249", "text": "register(req, res) {\n promiseResponseHelper(req, res, UserService.register({\n email: req.body.email,\n password: req.body.password,\n firstname: req.body.firstname,\n lastname: req.body.lastname\n }));\n }", "title": "" }, { "docid": "e0aba61231a5b20b0f44c7d8862a8c8d", "score": "0.60649264", "text": "signupHandleInputChange(event) {\n const { registration } = this.state.signup;\n const { name, value } = event.target;\n this._changeState('signup', 'registration', {\n ...registration, [name]: value\n });\n this.signupToggleButton();\n }", "title": "" }, { "docid": "13af7fa57df175977c9ff5d5ca041ca3", "score": "0.6063945", "text": "function addThisUser( _u, _p ) {\n if( !_u.value || !_p.value ){\n makePopAlert('Something wrong with your input!', 0, 'Damn');\n }else{\n var userName = _u.value, Password = _p.value;\n var level = 1;\n var radio2 = document.getElementById(\"J_popRadio_2\");\n if( radio2.checked ){\n level = 2;\n }\n $.ajax({\n url: '/addUser',\n type: 'POST',\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({name: userName, password: Password, Level: level}),\n timeout: 3000,\n success: function(data){\n makePopAlert( data.msg, data.code, 'OK');\n },\n error: function(r){\n makePopAlert('Server is dead!', 0, 'Damn');\n }\n });\n }\n}", "title": "" }, { "docid": "17cf593e1f63e80f365d859d16dd6e9f", "score": "0.6055208", "text": "function handleRegistration(userId) {\n var classId = $(\".signup-btn\").attr(\"data-id\");\n userid = {\n userId: userId\n };\n API.addStudent(classId, userid);\n }", "title": "" }, { "docid": "98c4b1ad1a12e40e7f871bbe1e395f34", "score": "0.6053174", "text": "function registerUser(request, response) {\n let { firstName, lastName, utuAccount, email, hometown, tyyMember } = request.body\n\n // Validations\n\n if (!firstName || !lastName || !email || !hometown) {\n response.json(httpResponses.onEmptyError)\n } else if (\n !validator.matches(request.body.firstName, /[a-zA-Z\\u00c0-\\u017e- ]{2,20}$/g) ||\n !validator.matches(request.body.lastName, /[a-zA-Z\\u00c0-\\u017e- ]{2,25}$/g) ||\n !validator.isEmail(request.body.email) ||\n !validator.matches(request.body.hometown, /[a-zA-Z\\u00c0-\\u017e- ]{2,25}$/g) ||\n !typeof request.body.tyyMember === 'boolean'\n ) {\n response.json(httpResponses.onValidationError)\n } else {\n // Check that email is unique\n\n Member.findOne({ email: email }).exec(function(err, member) {\n if (err) response.json(httpResponses.onError)\n if (member) {\n response.json(httpResponses.onUserSaveError)\n } else {\n // New temp member record\n\n let newTempMember = new TempMember()\n newTempMember.firstName = formatters.capitalizeFirstLetter(firstName)\n newTempMember.lastName = formatters.capitalizeFirstLetter(lastName)\n newTempMember.utuAccount = utuAccount ? utuAccount.toLowerCase() : ''\n newTempMember.email = email.toLowerCase()\n newTempMember.hometown = formatters.capitalizeFirstLetter(hometown)\n newTempMember.tyyMember = !!tyyMember\n newTempMember.tiviaMember = false\n\n // Save new member\n\n newTempMember.save(error => {\n if (error) {\n return response.json(httpResponses.onUserSaveError)\n }\n\n response.json({\n success: true,\n message: 'Käyttäjätunnus luotu onnistuneesti.',\n memberId: newTempMember._id,\n })\n })\n }\n })\n }\n}", "title": "" }, { "docid": "24202595aff8edc1fdd1a48b7d45e60f", "score": "0.604534", "text": "function userCreation() {\n let emailInput = $(\"#emailInput\").val();\n let passwordInput = $(\"#passwordInput\").val();\n // Set both items to local storage with their respective keys. Proof of concept before use of back end server\n localStorage.setItem(\"Email\", emailInput);\n localStorage.setItem(\"Password\", passwordInput);\n}", "title": "" }, { "docid": "cd7d7a053d3803a85a6074100c165c32", "score": "0.6039144", "text": "function onSubmit() {\n let username = addUserModal.$element.find('input.username').val();\n\n // Check if username was email\n let emailRegex = /^(([^<>()\\[\\]\\\\.,;:\\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 let isEmail = emailRegex.test(username);\n\n // Check if en existing user has the same information\n let existingUser = users.filter((user) => {\n return user.username == username || user.email == username;\n })[0];\n\n // The user was found\n if(existingUser) {\n UI.errorModal(new Error('User \"' + username + '\" already exists'));\n return;\n }\n \n // An email was provided, send invitation \n if(isEmail) {\n let modal = UI.confirmModal(\n 'invite',\n 'Add user',\n 'Do you want to invite a new user with email \"' + username + '\"?',\n () => {\n customApiCall('post', '/api/user/invite', {\n email: username,\n })\n .then(() => {\n UI.messageModal('Invite user', 'Invitation was sent to ' + username);\n })\n .catch(errorModal);\n\n let $buttons = modal.$element.find('button').attr('disabled', true).addClass('disabled');\n\n return false;\n }\n );\n\n return;\n }\n \n // User doesn't exist, create it\n let $passwd;\n\n let modal = UI.confirmModal(\n 'create',\n 'Add user',\n [\n _.p('Set password for new user \"' + username + '\"'),\n $passwd = _.input({required: true, pattern: '.{6,}', class: 'form-control', type: 'text', value: generatePassword(), placeholder: 'Type new password'})\n ],\n () => {\n let password = $passwd.val() || '';\n let scopes = {};\n\n apiCall('post', 'user/new', {\n username: username,\n password: password,\n scopes: {}\n })\n .then(() => {\n UI.messageModal('Create user', 'User \"' + username + '\" was created with password \"' + password + '\".', () => { location.reload(); });\n })\n .catch(errorModal);\n\n let $buttons = modal.$element.find('button').attr('disabled', true).addClass('disabled');\n\n return false;\n }\n );\n }", "title": "" }, { "docid": "d6df5384530f64d468f26fbbec0c0c61", "score": "0.60355526", "text": "function createUser() {\n\n}", "title": "" }, { "docid": "dbaf2b5e90ea81ccaa6b7c72d27f3b5d", "score": "0.6031918", "text": "function storeUserSignUpInfo(){\n const user = {\n username: $('#username').val(),\n password: $('#password').val(),\n firstName: $('#first-name').val(),\n lastName: $('#last-name').val(),\n email: $('#email').val()\n };\n return user;\n}", "title": "" }, { "docid": "2f220e11b7c7a9a24c904f3067eeef85", "score": "0.6017493", "text": "function checkRegister() {\r\n\tvar flag = 0; // 初期値 0 の時は true が入る\r\n\t/*\r\n\tvar flagMail = 0; // 初期値 0 の時は true が入る\r\n\tvar flagUserID_6 = 0; // 初期値 0 の時は true が入る\r\n\tvar flagUserID = 0; // 初期値 0 の時は true が入る\r\n\t*/\r\n\r\n\t/*\r\n\t//ユーザIDチェック(6文字かどうかの判定)\r\n var text = document.form.userID.value;\r\n var n = text.length;\r\n\tif(!(n == 6)){\r\n\t\tflagUserID_6 = 1;\r\n\t}\r\n\t*/\r\n\r\n\t/*\r\n\t//ユーザIDチェック(半角英数字かどうかの判定)\r\n\tif(document.form.userID.value.match(/^[0-9A-Za-z]+$/)){\r\n\t\tflagUserID = 1;\r\n\t}\r\n\t*/\r\n\r\n\t/*\r\n\t//メールチェック\r\n\tif(!document.form.mail.value.match(/.+@.+\\..+/)){\r\n\t\tflagMail = 1;\r\n }\r\n */\r\n\r\n\tif(document.form.userID.value == \"\"){\r\n \tflag = 1;\r\n }\r\n else if(document.form.pass.value == \"\"){\r\n \tflag = 1;\r\n }\r\n else if(document.form.name.value == \"\"){\r\n flag = 1;\r\n }\r\n else if(document.form.mail.value == \"\"){\r\n flag = 1;\r\n }\r\n else if(document.form.botName.value == \"\"){\r\n flag = 1;\r\n }\r\n\r\n\t//判定し結果を返す\r\n\tif(flag){\r\n \twindow.alert('必須項目に未入力があります'); // 入力漏れがあれば警告ダイアログを表示\r\n \treturn false; // 送信を中止\r\n }\r\n else{\r\n \t return true; // 送信を実行\r\n }\r\n\r\n\t/*\r\n\t//ユーザID判定(6文字かどうかの判定)\r\n\tif(flagUserID_6){\r\n\t\twindow.alert('userIDは必ず6文字です');\r\n\t\treturn false; // 送信を中止\r\n }\r\n\r\n\t//ユーザID判定(半角英数字かどうかの判定)\r\n\tif(flagUserID){\r\n\t\twindow.alert('userIDは必ず半角英数です');\r\n\t return false; // 送信を中止\r\n\t}\r\n\r\n\t//メール判定\r\n\tif(flagMail){\r\n\t\twindow.alert('メールアドレスが正しくありません');\r\n\t\t// メールアドレス以外が入力された場合は警告ダイアログを表示\r\n\t\treturn false; // 送信を中止\r\n }\r\n */\r\n\r\n} //checkRegister()", "title": "" }, { "docid": "1d49025b1fedfdb16ab9ee8eb3c070d1", "score": "0.6013459", "text": "function registerSubmit(form) {\n\n //ensure each input is valid, storing results in \n //a respective boolean var\n //parse form argument through for each of these checks\n //check name\n var name = checkName(form);\n //check username\n var username = checkUsername(form);\n //check user password\n var password = checkPassword(form);\n //check usertype\n var userType = checkUserType(form);\n //check email\n var email = checkEmail(form);\n //check address\n var address = checkAddress(form);\n //check phone number\n\tvar phoneNumber = checkPhoneNumber(form);\n \n //if all inputs come up valid, return true \n //if else return false\n\treturn (name && username && email && password && phoneNumber && address && userType);\n\n} // end registerSubmit", "title": "" }, { "docid": "ac9f6e1ee467a923b5e41c3cd3a6298f", "score": "0.6013154", "text": "submit() {\n const errors = this.validate();\n if (errors) {\n Store.changeProperty(\"register.errors\",errors);\n return;\n } else Store.changeProperty(\"register.errors\",{});\n Store.changeProperty(\"activeScreen\",Screens.LOADING);\n const state = Store.getState().register;\n Backend.auth.register(state.name,state.password, (error) => {\n if (error) Store.changeProperties({\"register.errors\":{\"general\":error},\"activeScreen\":Screens.REGISTER});\n else {\n Backend.auth.checkLogin();\n Store.changeProperties({\"register.name\":\"\",\"register.password\":\"\",\"register.errors\":{}});\n }\n })\n }", "title": "" }, { "docid": "63f685a3c618f8ec8f5a9b5756643779", "score": "0.6011815", "text": "function register() {\n // get the value from input\n var registerForm = document.querySelector(\"#registerForm\");\n var email = registerForm.email.value;\n var password = registerForm.password.value;\n var firstName = registerForm.firstName.value;\n var lastName = registerForm.lastName.value;\n var loginID = registerForm.loginID.value;\n var g = document.getElementById('gender');\n var gender = g.options[g.selectedIndex].value;\n var check = true;\n\n // the following code is check the restriction of register and add error\n if(email === \"\"){\n $(\"#email-error\").html(\"*Email is a required field.*\");\n check = false;\n } else if(!validateEmail(email)) {\n $(\"#email-error\").html(\"*Email is not validated.*\");\n check = false;\n } else{\n $(\"#email-error\").html(\"\");\n }\n if(password === \"\"){\n $(\"#password-error\").html(\"*Password is a required field.*\");\n check = false;\n } else if(password.length < 8) {\n $(\"#password-error\").html(\"*Password must be no less than 8 digits.*\");\n check = false;\n }\n else{\n $(\"#password-error\").html(\"\")\n }\n if(firstName === \"\"){\n $(\"#firstName-error\").html(\"*First name is a required field.*\");\n check = false;\n } else{\n $(\"#firstName-error\").html(\"\")\n }\n if(lastName === \"\"){\n $(\"#lastName-error\").html(\"*Last name is a required field.*\");\n check = false;\n } else{\n $(\"#lastName-error\").html(\"\")\n }\n if(loginID === \"\"){\n $(\"#ID-error\").html(\"*Login ID is a required field.*\");\n check = false;\n } else{\n $(\"#ID-error\").html(\"\")\n }\n // if no error occurs, then calling backend to register\n // store the data to database\n if(check){\n const url = \"/register\"\n if(email != \"\" && password != \"\" && firstName != \"\" && lastName != \"\" && loginID != \"\" && gender != \"\") {\n // calling the backend to insert user info\n $.ajax({\n type: \"POST\",\n url: url,\n cache: false,\n data: {'loginID': loginID,\n 'password': password,\n 'firstName': firstName,\n 'lastName': lastName,\n 'email': email,\n 'gender': gender\n },\n success: function(data, status) {\n // expected data to be {data} to indicate the status of register\n // check if the user is Successfully registered\n if(data.data === \"registered\"){\n document.querySelector(\"#registerForm\").email.value = \"\";\n document.querySelector(\"#registerForm\").password.value = \"\";\n document.querySelector(\"#registerForm\").firstName.value = \"\";\n document.querySelector(\"#registerForm\").lastName.value = \"\";\n document.querySelector(\"#registerForm\").loginID.value = \"\";\n $(\"#formCheck\").html(\"\");\n $('#registerModal').modal('hide');\n $(\"#ID-error\").html(\"\")\n $(\"#lastName-error\").html(\"\")\n $(\"#firstName-error\").html(\"\")\n $(\"#password-error\").html(\"\")\n $(\"#email-error\").html(\"\");\n // update the topbar\n topbarChecker();\n // check if the id is existed\n } else if(data.data === \"id is not unique\"){\n $(\"#ID-error\").html(\"*ID has been used*\");\n // check if the email is existed\n } else if(data.data === \"email is not unique\") {\n $(\"#email-error\").html(\"*Email has been used*\");\n }\n },\n error: function(xhr, textStatus, errorThrown) {\n console.log('Error! Status = ' + xhr.status);\n }\n });\n }\n }\n}", "title": "" }, { "docid": "fdea24a3a2ee263a2757fc5721d8c66b", "score": "0.60114735", "text": "function handleCreateUserRequest(username, password) {\n dispatch(initiateRegister({username, password}))\n}", "title": "" }, { "docid": "88272d3e557cec5a8dee9e4c466e4032", "score": "0.60108674", "text": "function register(e) {\n\t\te.preventDefault();\n\t\tconst user = { name, email, password, address, county, zip };\n\t\tcreateUser(user);\n\t\tlogin(user);\n\t\tclose();\n\t}", "title": "" }, { "docid": "0240c33be2c397c52200cc3cab2fa0fd", "score": "0.6007922", "text": "function registerFormHandling() {\n\tevent.preventDefault();\n\tconst inputData = getInputData(true);\n\tfetch(\"/register\", fetchParameterInit(inputData))\n\t\t.then(response => {\n\t\t\tresponseToModal(response, inputData, \"register\");\n\t\t})\n}", "title": "" } ]
3da03a76554b3b8f19b379e63bd043f8
Constructor function to create project item list
[ { "docid": "b1bd56a35008bdaf1a7f47f16122e9f8", "score": "0.59854025", "text": "function ListItems (name, description, url,price){\n this.name = name;\n this.description = description;\n this.url = `./img/${url}`;\n this.itemNumber = i;\n this.price = price;\n availableItems.push(this);\n}", "title": "" } ]
[ { "docid": "5d25ea8d9a745957741e8b949d75b7fd", "score": "0.7075574", "text": "makeProject(project) {\n const li = helper.createElement('li');\n li.id = project.id;\n\n // make project title content-editable\n const title = helper.createElement('h3', 'project-editable');\n title.contentEditable = true;\n title.spellcheck = false;\n title.innerHTML = project.title;\n\n // Project delete button\n const deleteButton = helper.createElement('button', 'delete');\n deleteButton.textContent = 'Delete';\n\n // Append title and button to list item\n li.append(title, deleteButton);\n\n // Append list item to todo list\n this._projectList.append(li);\n }", "title": "" }, { "docid": "01b8c31b9169f1d5237f8db080fdfe8c", "score": "0.7005936", "text": "createItems(){\n this.clearItems();\n\n var projects = atom.history.getProjects();\n var paths = [];\n\n for(var i in projects){\n var historyProject = projects[i];\n var path = historyProject.paths[0];\n\n /// ignore duplicates (TODO: symlinks)\n if(paths.indexOf(path) > -1)\n continue;\n\n paths.push(path);\n\n var project = SweetProject.initializeByHistoryProject(historyProject);\n\n atom.sweetproject = project;\n\n this.createItem(project);\n }\n }", "title": "" }, { "docid": "5f8d1c294cc0fd47af01ca6c6dc81e54", "score": "0.68478125", "text": "constructor(type) {\n this.type = type;\n const prjItems = document.querySelectorAll(`#${type}-projects li`);\n for (const prjItem of prjItems) {\n this.projects.push(\n new ProjectItem(prjItem.id, this.removeProject.bind(this), this.type)\n ); //create JS representation of DOM NODEs\n }\n }", "title": "" }, { "docid": "a4f59626c2da69b6bc99b396705c0a59", "score": "0.666618", "text": "constructor(type) {\n\t\tthis.type = type;\n\t\tconst prjItems = document.querySelectorAll(`#${type}-projects li`);\n\n\t\tfor (const prjItem of prjItems) {\n\t\t\tthis.projects.push(\n\t\t\t\tnew ProjectItem(prjItem.id, this.switchProject.bind(this), this.type)\n\t\t\t);\n\t\t}\n\t\tconsole.log(this.projects);\n\t\tthis.connectDroppable();\n\t}", "title": "" }, { "docid": "1db6823e4969b8c24ab5d288234428d1", "score": "0.65992564", "text": "function Project (name, playlistList) {\n this.name = name; //name of the project1\n this.playlistList = playlistList; //list of playlist in a project1 (A project1 can have 1 or multiple playlist)\n}", "title": "" }, { "docid": "fcd06835799999d6edcc034d6d03d0ec", "score": "0.65480846", "text": "function constructItem() {\n var item = {\n \"workers_id\": $scope.worker_data.worker_id,\n \"status\": 0,\n \"action_time\": $scope.date,\n \"created_at\": $scope.date,\n \"updated_at\": $scope.date,\n \"author_id\": $scope.userId,\n \"updater_id\": $scope.userId\n };\n return item;\n }", "title": "" }, { "docid": "ef973568e74382709a082298cd3b7953", "score": "0.64825505", "text": "renderProjects() {\n //Retrieving the list header\n const listEl = document.getElementById(`${this.type}-projects-list`);\n //Clear the list since we're going to add everything again\n listEl.innerHTML = \"\";\n //Iterate through every project and render it as a list item\n for (const prjItem of this.assignedProjects) {\n new _project_item__WEBPACK_IMPORTED_MODULE_4__.ProjectItem(this.element.querySelector(\"ul\").id, prjItem);\n }\n }", "title": "" }, { "docid": "5d8f980257c1db3b07213b249a0e2384", "score": "0.6466684", "text": "function ProjectList()\n{\n\t// constructor\n\n\tvar self = this;\n\tvar projects = new Array();\n\tvar current;\n\t\n\t// public methods\n\t\n\tthis.addProject = addProject;\n\tthis.removeProject = removeProject;\n\tthis.renderProjectList = renderProjectList;\n\tthis.getCurrent = getCurrent;\n\tthis.setCurrent = setCurrent;\n\tthis.save = save;\n\n\t// implementation\n\n\tfunction addProject (project)\n\t{\n\t\tprojects.push(project);\n\t\tsetCurrent(projects.length - 1);\n\t};\n\t\n\tfunction removeProject (index)\n\t{\t\t\n\t\tif ((current == index) && (current != 0))\n\t\t\tcurrent--;\n\t\n\t\tprojects.splice(index, 1);\n\t};\n\t\n\tfunction getCurrent()\n\t{\n\t\treturn projects[current];\n\t};\n\t\n\tfunction setCurrent (index)\n\t{\t\n\t\tif ((index < 0) || (index >= projects.length))\n\t\t\tInterface.alert('error', 'Sorry, an internal error has occurred: ' +\n\t\t\t\t\t\t\t\t\t\t\t'bad index passed to ProjectList.setCurrent (' + index +\n\t\t\t\t\t\t\t\t\t\t\t'). Please report this bug.');\n\t\telse\n\t\t\tcurrent = index;\n\t};\n\t\n\tfunction renderProjectList (id)\n\t{\n\t\tvar output = '<div class=\"right\">';\n\t\t\n\t\t// right side\n\t\t\n\t\tif (projects.length > 1)\n\t\t{\n\t\t\toutput += '<button title=\"Remove the selected project\" onclick=\"Interface.removeProject()\">';\n\t\t\toutput += '<img src=\"img/trash.png\" width=\"16\" height=\"16\" alt=\"\" />';\n\t\t\toutput += ' Remove ' + projects[current].getName();\n\t\t\toutput += '</button> ';\n\t\t};\n\t\t\n\t\toutput += '<button title=\"Add a new project\" onclick=\"Interface.newProject()\">';\n\t\toutput += '<img src=\"img/newproject.png\" width=\"16\" height=\"16\" alt=\"\" />';\n\t\toutput += ' New Project</button></div>';\n\t\t\n\t\t// left side\n\t\t\n\t\toutput += '<div class=\"left\">Project ';\n\t\toutput += '<select id=\"projectMenu\" onchange=\"projects.save();projects.setCurrent(document.getElementById(\\'projectMenu\\').selectedIndex);updateProjects()\">';\n\t\t\n\t\tfor (var i = 0; i < projects.length; i++)\n\t\t{\n\t\t\toutput += '<option';\n\t\t\t\n\t\t\tif (current == i)\n\t\t\t\toutput += ' selected=\"selected\"';\n\t\t\t\n\t\t\toutput += '>' + projects[i].getName() + '</option>';\n\t\t};\n\t\t\n\t\toutput += '</select></div>';\n\n\t\t$(id).innerHTML = output;\n\t};\n\t\n\tfunction save()\n\t{\t\t\n\t\tprojects[current].saveSettings();\n\t\n\t\tInterface.setStatus('Saving projects...');\n\t\t\n\t\tvar data = new Object();\n\t\t\n\t\tdata.current = current;\n\t\tdata.projects = new Array();\n\t\t\n\t\tfor (var i = 0; i < projects.length; i++)\n\t\t\tdata.projects.push(projects[i].serialize());\n\t\t\n\t\tCookie.set('Tweebox', data.toJSONString());\n\t\t\n\t\t// check to see that that worked\n\t\t\n\t\tif (! Cookie.get('Tweebox'))\n\t\t{\n\t\t\tInterface.alert('error', 'Your projects could not be saved. Make sure you ' +\n\t\t\t\t\t\t\t\t\t\t\t'have enabled cookies in your Web browser.<br /><br />' +\n\t\t\t\t\t\t\t\t\t\t\t'Tweebox will still remember your projects until you ' +\n\t\t\t\t\t\t\t\t\t\t\t'close your browser window.');\n\t\t\talert(document.cookie);\n\t\t}\n\t\telse\n\t\t\tInterface.setStatus('Projects saved.');\n\t};\n}", "title": "" }, { "docid": "dd660fc16e2676458f8f4181b12236ed", "score": "0.6387639", "text": "function Project (rawDataObj) {\n this.title = rawDataObj.title;\n this.category = rawDataObj.category;\n this.author= rawDataObj.author;\n this.authorUrl= rawDataObj.authorUrl;\n this.time = rawDataObj.publishedOn;\n this.body= rawDataObj.body;\n this.all.push(this);\n}", "title": "" }, { "docid": "febb35b833d5d71795e8c648bf5c374f", "score": "0.63729733", "text": "constructor(listofitems){\n\tthis.listofitems = listofitems;\n\n\t}", "title": "" }, { "docid": "a63bf4cb268cd140928fd293df345b72", "score": "0.62571555", "text": "function ToDoList() {\n this.tasks = [];\n this.currentId = 0;\n //this.item = item;\n}", "title": "" }, { "docid": "07c22b958a2a64c5e2330b37bff9f19a", "score": "0.62491435", "text": "function PersonalizedList(listname) {\n this.listname = listname;\n //Array of tasks that will have all the pending todo items\n this.todoTasks = [\"Make Your First To Do Item!\"];\n}", "title": "" }, { "docid": "166cbbc2f35176a2eb7aef0479890d1e", "score": "0.62440157", "text": "function createToDoItem() {\n const nameInput = document.querySelector(\"#name-input\");\n const descInput = document.querySelector(\"#desc-input\");\n const dateInput = document.querySelector(\"#date-input\");\n\n let name = nameInput.value;\n let desc = descInput.value;\n let date = dateInput.value;\n\n let item = ToDoItem(name, desc, date);\n let today = item.getTodayDate();\n\n item.listed = false;\n item.isComplete = false;\n item.createdDate = today;\n\n return item;\n}", "title": "" }, { "docid": "c7a2018c882d2a83cea79c7c9adb5689", "score": "0.6241029", "text": "constructor(props) {\n super(props);\n this.state = {\n projects: [],\n singleProject: \"\",\n };\n \n this.displayProject = this.displayProject.bind(this);\n this.displayProjectNames = this.displayProjectNames.bind(this);\n }", "title": "" }, { "docid": "f33f64bd1252ec5454831aefd8da75d8", "score": "0.6183099", "text": "function parseProjectItem(project) {\n\n\t// htmlString not used, only textualizes what JS below is doing\n\tlet htmlString = `\n\t\t<li id=\"projects-list-`+project.id+`\">\n\t\t\t<div class=\"projects-list-icon\">\n\t\t\t\t<div class=\"projects-list-icon-innerCircle\">\n\t\t\t\t\t<p>View</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<p class=\"projects-list-title\">`+project.title+`</p>\n\t\t\t<p class=\"projects-list-architecture\">`+project.architecture+`</p>\n\t\t\t<p class=\"projects-list-platform\">`+project.platform+`</p>\n\t\t\t<p class=\"projects-list-date\"> </p>\n\n\t\t</li>\n\t`;\n\n\tproject.index = projects_icon.length;\n\n\tvar li = document.createElement(\"li\");\n\tli.id = \"projects-list-\" + project.id;\n\n\tvar pLogo = document.createElement(\"div\");\n\tpLogo.className = \"projects-list-icon\";\n\tif (project.imageOne != undefined) {\n\t\tpLogo.style.backgroundImage = \"url(data:\"+project.imageOne.type+\";base64,\"+project.imageOne.buffer+\")\";\n\t}\n\tli.appendChild(pLogo);\n\tprojects_icon.push(pLogo);\n\n\tvar pTitle = document.createElement(\"p\");\n\tpTitle.className = \"projects-list-title\";\n\tpTitle.innerHTML = project.title;\n\tpLogo.appendChild(pTitle);\n\n\tvar pArchitecture = document.createElement(\"p\");\n\tpArchitecture.className = \"projects-list-architecture\";\n\tpArchitecture.innerHTML = project.architecture;\n\tli.appendChild(pArchitecture);\n\tvar pPlatform = document.createElement(\"p\");\n\tpPlatform.className = \"projects-list-platform\";\n\tpPlatform.innerHTML = \"Platform: \"+project.platform;\n\tli.appendChild(pPlatform);\n\n\t// var pDate = document.createElement(\"p\");\n\t// pDate.className = \"projects-list-date\";\n\t// if (project.update_date != undefined) {\n\t// \tvar yr = project.update_date.substr(0,project.update_date.indexOf(\"-\"));\n\t// \tyr = project.update_date.substr(2, 2);\n\t// \tproject.update_date = project.update_date.substr(project.update_date.indexOf(\"-\")+1);\n\t// \tvar month = project.update_date.substr(0,project.update_date.indexOf(\"-\"));\n\t// \tproject.update_date = project.update_date.substr(project.update_date.indexOf(\"-\")+1);\n\t// \tvar day = project.update_date.substr(0, 2);\n\t// \tpDate.innerHTML = month+\"/\"+day+\"/\"+yr;\n\t// }\n\t// li.appendChild(pDate);\n\n\tli.onmouseenter = () => {\n\t\tTweenLite.to(pLogo, 0.1, {\n\t\t\ttransform: \"scale(1.03)\",\n\t\t\tboxShadow: \"0 0 10px 2px rgba(0,0,0,0.3)\"\n\t\t});\n\t};\n\tli.onmouseleave = () => {\n\t\tTweenLite.to(pLogo, 0.5, {\n\t\t\ttransform: \"scale(1)\",\n\t\t\tboxShadow: \"0 0 4px 2px rgba(0,0,0,0)\"\n\t\t});\n\t}\n\tli.onclick = selectProject(project.id, project.index);\n\n\treturn li;\n}", "title": "" }, { "docid": "16de7a9a95224d9b35b95f7cd0833499", "score": "0.6170319", "text": "constructor() {\n // 'this' is not allowed without super() when creating constructors\n super();\n this.state = {\n // Creating array of objects to be passed to 'Projects' as a property\n // Data should be immutable--\"top-down\" approach\n projects: [],\n todos: []\n\n /*\n projects: [\n {\n title: 'Business Website',\n category: 'Web Design'\n },\n {\n title: 'Social App',\n category: 'Mobile Development'\n },\n {\n title: 'E-Commerce Shopping Cart',\n category: 'Web Development'\n }\n ]\n\n When you have an array of objects, you'd want to create a separate component for each individual item to map through those projects to output respective components\n */\n\n }\n }", "title": "" }, { "docid": "7a4019f28eddcbda0b907f1b39aa723c", "score": "0.61450315", "text": "function ToDoList() {\n \"use strict\"\n\n // extend default settings\n ;\n var settings = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n this.settings = $.extend(true, { namespace: 'ToDoComponent', id: string.random(1) }, settings);\n\n this.DOM = {}; // any instance's cached DOM elements will be here\n this.items = [];\n }", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.6106581", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.6106581", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.6106581", "text": "function ListItem() {}", "title": "" }, { "docid": "c3e85d4de7614606e65b64d64f5a1fdf", "score": "0.6106581", "text": "function ListItem() {}", "title": "" }, { "docid": "84a86d9d5976070d626293d681f53dcd", "score": "0.610557", "text": "constructor(args){\n this.id = args.id\n this.title = args.title\n this.items = args.items || []\n this.tag = args.tag\n this.expanded = args.expanded \n }", "title": "" }, { "docid": "b8a606ab100d79b33f56acce22b8fd43", "score": "0.6063084", "text": "function project(proName, count, status){\n\tthis.proName= proName;\n\tthis.count=count;\n\tthis.status = status;\n}", "title": "" }, { "docid": "4ca5b5dd5b902234ec2f858324c54430", "score": "0.60563046", "text": "function createProject(projectName) {\n return [Date.now().toString(), { projectName: projectName, todos: [] }];\n}", "title": "" }, { "docid": "c7fcf486eb6753c7a01bbc3186f30f27", "score": "0.60067576", "text": "function createProject() {\n\n let projectTitle = projInput.value;\n const newProj = project(projectTitle, projectIndex);\n newProj.createDOM();\n\n // adding new project to projects array\n projects.push(newProj);\n\n projInput.value = '';\n projectIndex++;\n\n sortProjectIndex();\n console.log(projects);\n return newProj;\n\n}", "title": "" }, { "docid": "040842f276f670a0aeef88ec57db7f49", "score": "0.6001905", "text": "function TeamListItem(config) {\n var dataDefaults = {\n icon_url_s: $vf.resourceURL + \"images/project_default.png\"\n };\n this.el = config.el;\n this.data = $.extend({}, dataDefaults, config.data);\n this.template = config.template;\n this.expanded = false;\n this.requested = false;\n this.render();\n }", "title": "" }, { "docid": "c75fbb6c6859bf1a195310a574feae0f", "score": "0.59928226", "text": "function initProjectList (type) {\n var projectsMarkup = ''\n if (type) {\n projectsMarkup = getProjectChunk(projectsClassic, 10)\n } else {\n projectsMarkup = getProjectChunk(projectsSc, 10)\n }\n $('.projectsWidget tbody .leftCol ul')\n .empty()\n .append(projectsMarkup.join(''))\n .append('<li class=\"loadMore text-center\">Load More</li>')\n}", "title": "" }, { "docid": "20d2b586333d8b1a16e22fedb0f61905", "score": "0.59652025", "text": "init(){\n var itemArr = this.subInt();\n itemArr.forEach((obj)=>{\n var newItem = new page(this.dir,obj.file,obj.data);\n this.add(newItem);\n });\n }", "title": "" }, { "docid": "1f75a206fad6bcfcf9c149f8b2e0bf69", "score": "0.595481", "text": "constructor(project) {\n super(project);\n }", "title": "" }, { "docid": "04ceb2491f2a33320a9210e7eba9d7b7", "score": "0.5939042", "text": "constructor(data) {\n console.log(\"list\")\n this.name = data.name\n this._id = data.id\n this.items = data.items || []\n this.list = data.list\n }", "title": "" }, { "docid": "a0ef5fba7a9e4904125839418585c2da", "score": "0.5927421", "text": "function createProject(title, desc, priority) {\n const newProject = { title, desc, priority }\n newProject.taskArr = []\n projectManager.appendToProjects(newProject)\n return newProject\n}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.59253263", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.59253263", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.59253263", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.59253263", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.59253263", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "3be198afb9595d1a40eb40d7c0984712", "score": "0.59253263", "text": "constructor(item) {\n\t\tsuper(item);\n\t}", "title": "" }, { "docid": "6bc5c6a9256cceeaf40110a971f6e673", "score": "0.5922669", "text": "function Project(title) {\n this.title = title;\n this.boards = [];\n this.taskCards = [];\n this.boardFactory = new BoardFactory_1.BoardFactory();\n this.boards.push(this.boardFactory.generateBoard(BoardOptions_1.BoardOptions.MOSCOW));\n this.boards.push(this.boardFactory.generateBoard(BoardOptions_1.BoardOptions.SPRINT));\n this.activeBoardIndex = 0; // which board should display upon opening the project\n this.nextCardNumber = 1;\n }", "title": "" }, { "docid": "1e546d2fbbc6d46d4066496f2b9a3f87", "score": "0.59050906", "text": "addNewItemToList(list, initDescription, initDueDate, initStatus) {\n let newItem = new ToDoListItem(this.nextListItemId++);\n newItem.setDescription(initDescription);\n newItem.setDueDate(initDueDate);\n newItem.setStatus(initStatus);\n list.addItem(newItem);\n if (this.currentList) {\n this.view.refreshList(list);\n }\n }", "title": "" }, { "docid": "3026655dafbb1953f7c9a137872430b5", "score": "0.59026015", "text": "constructor() {\n super()\n this.state = {\n projects: []\n }\n }", "title": "" }, { "docid": "4e7af4243629acd6e6eceefd75cb6539", "score": "0.58950305", "text": "constructor(items) {\n this.items = [];\n if (items) this.items = items;\n }", "title": "" }, { "docid": "a7e75c7b45c3a77af658cf2522232778", "score": "0.5874276", "text": "constructor(props) {\n super(props);\n this.createList = this.createList.bind(this);\n }", "title": "" }, { "docid": "9e13eae785cef3fe1901e07275e1e081", "score": "0.5868721", "text": "addNewItemToList(list, initDescription, initDueDate, initStatus) {\n let newItem = new ToDoListItem(this.nextListItemId++);\n newItem.setDescription(initDescription);\n newItem.setDueDate(initDueDate);\n newItem.setStatus(initStatus);\n list.addItem(newItem);\n if (this.currentList) {\n this.view.refreshLists(list);\n }\n }", "title": "" }, { "docid": "18a16483da2188830b7b30e0d27304df", "score": "0.5868329", "text": "constructor(root, title){\n /*\n Creates a item, sets its root\n */\n this.title = title;\n if (root == null) // the root is root of itself\n root = this;\n this.root = root;\n this.level = root == this ? 0 : (root.level + 1);\n this.index = listItems.length;\n this.children = new Array();\n listItems.push(this);\n if (this != this.root)\n this.root.children.push(this);\n }", "title": "" }, { "docid": "a91549981c9ca7b0ed7cbddb836b2ca3", "score": "0.5859559", "text": "createItem(name, onCreate, itemClass) {\n let node = onCreate(name);\n this._list.createItem\n }", "title": "" }, { "docid": "fc57bfe2f5aedd68623c1a7c6ade5cb5", "score": "0.5850573", "text": "function _create() {\n // default new To Do to currentUserId, caseId, listingId\n vm.selectedItem = {\n personId: vm.currentUserId,\n caseId: vm.caseId,\n listingId: vm.listingId,\n statusId: 1\n };\n }", "title": "" }, { "docid": "2e8b17d36469f12d90dc583bc725e80b", "score": "0.58479106", "text": "buildList() {\n let listHtml = \"\";\n this.displayList.forEach((project, index) => {\n const projectItem = this.projectList[index];\n const cssClass = this.buildProjectCssClasses(index);\n const tags = this.buildProjectTagList(project.tags);\n\n let template = this.buildListItem(projectItem, cssClass, tags);\n listHtml += template;\n });\n return listHtml;\n }", "title": "" }, { "docid": "2e8b17d36469f12d90dc583bc725e80b", "score": "0.58479106", "text": "buildList() {\n let listHtml = \"\";\n this.displayList.forEach((project, index) => {\n const projectItem = this.projectList[index];\n const cssClass = this.buildProjectCssClasses(index);\n const tags = this.buildProjectTagList(project.tags);\n\n let template = this.buildListItem(projectItem, cssClass, tags);\n listHtml += template;\n });\n return listHtml;\n }", "title": "" }, { "docid": "0b622f4c64f19560e5a461d7a82569fe", "score": "0.5847272", "text": "constructor(){\r\n\t\tthis.items = [];\r\n\t}", "title": "" }, { "docid": "26a7bd36bf53cd1cc22b0384f5587ac1", "score": "0.58447313", "text": "function createList(projectName, listArray, ulClassName){ \n var ul = document.createElement('UL');\n ul.className = ulClassName;\n \n for(var i=0; i<listArray.length; i++){\n let li = document.createElement('LI');\n li. innerHTML = listArray[i];\n ul.appendChild(li);\n }\n \n return ul;\n }", "title": "" }, { "docid": "025cfae1f8ddcaec1d252a10f2b9c36f", "score": "0.584328", "text": "contructor(itemList,itemQuantity){\n this.itemList = il;\n this.itemQuantity = iq;\n}", "title": "" }, { "docid": "4ac4941abd52433cdb83f6d561fb6bca", "score": "0.5832607", "text": "function createProject() {\n const theName= document.getElementById(\"projectName\").value;\n const newProject = new Project(theName);\n console.log(newProject);\n projects.push(newProject);\n settingLocalStorage();\n return newProject;\n}", "title": "" }, { "docid": "9423f7a096e9cfce7e42f0276e8d9d77", "score": "0.5821562", "text": "constructor()\n {\n this.items = [];\n }", "title": "" }, { "docid": "6eb12d94f733ed8a7ced00c52abbd571", "score": "0.580975", "text": "constructor(toDoList){\n this._toDoListId = toDoList._id;\n this._title = toDoList.title;\n this._tasks = toDoList.tasks;\n }", "title": "" }, { "docid": "b5527a2a76afc322451117ae0415be1e", "score": "0.5807444", "text": "constructGrid() {\n const itemGutter = parseInt(this.cssVariables.projectItemGutter);\n const listPadding = 0; // parseInt(this.cssVariables.projectListPadding); // no padding for Squarespace\n const listWidth = this.listEl.clientWidth;\n const listInnerWidth = listWidth - listPadding * 2;\n const numCols = this.currentBreakpoint.cols;\n const numItems = this.displayList.length;\n const numGutters = numCols - 1;\n const size = (listInnerWidth - itemGutter * numGutters) / numCols;\n\n // calculate the x,y coordinates of each item in the list\n let i = 0,\n row = 0;\n while (i < numItems) {\n for (let j = 0; j < numCols; j++) {\n let inc = size + itemGutter;\n this.listState.gridCoords[i] = { x: j * inc, y: row * inc };\n i++;\n }\n row++;\n }\n this.listState.numColumns = numCols;\n this.listState.numRows = row;\n this.listState.itemSize = size;\n this.listState.itemGutter = itemGutter;\n this.listState.listPadding = listPadding;\n this.listState.listWidth = listWidth;\n this.listState.listInnerWidth = listInnerWidth;\n }", "title": "" }, { "docid": "b5527a2a76afc322451117ae0415be1e", "score": "0.5807444", "text": "constructGrid() {\n const itemGutter = parseInt(this.cssVariables.projectItemGutter);\n const listPadding = 0; // parseInt(this.cssVariables.projectListPadding); // no padding for Squarespace\n const listWidth = this.listEl.clientWidth;\n const listInnerWidth = listWidth - listPadding * 2;\n const numCols = this.currentBreakpoint.cols;\n const numItems = this.displayList.length;\n const numGutters = numCols - 1;\n const size = (listInnerWidth - itemGutter * numGutters) / numCols;\n\n // calculate the x,y coordinates of each item in the list\n let i = 0,\n row = 0;\n while (i < numItems) {\n for (let j = 0; j < numCols; j++) {\n let inc = size + itemGutter;\n this.listState.gridCoords[i] = { x: j * inc, y: row * inc };\n i++;\n }\n row++;\n }\n this.listState.numColumns = numCols;\n this.listState.numRows = row;\n this.listState.itemSize = size;\n this.listState.itemGutter = itemGutter;\n this.listState.listPadding = listPadding;\n this.listState.listWidth = listWidth;\n this.listState.listInnerWidth = listInnerWidth;\n }", "title": "" }, { "docid": "be8c261bbe075e04ec4740b4c8920c6d", "score": "0.58059907", "text": "constructor() {\n this.items = []\n }", "title": "" }, { "docid": "b6dfafe8b55c13164352092319428e0f", "score": "0.57960224", "text": "constructor(user, shareable, projectsService) {\n this.user = user;\n this.shareable = shareable;\n this.projectsService = projectsService;\n this.name = 'projects';\n this.title = 'Projects';\n }", "title": "" }, { "docid": "7e1455379de407fb3839f3b31892e77e", "score": "0.5778585", "text": "function buildListItem(classes,name) {\n return buildListItem(classes,name,null);\n}", "title": "" }, { "docid": "e0a12b78f57081cc2eb5454e5d55793f", "score": "0.57674", "text": "function injectProjectsUx() {\n for (let i = Projects.ux.length - 1; i > -1; i--) {\n let prj = document.createElement(\"div\")\n prj.classList.add(\"project\")\n prj.setAttribute(\"data-prj-index\", i)\n prj.setAttribute(\"data-prj-type\", Projects.ux[i].type)\n prj.setAttribute(\"data-prj-code\", Projects.ux[i].code)\n\n // Make project span 2 columns if widowed\n // if (i == 0 && Projects.others.length % 2 != 0) {\n\n // prj.classList.add(\"project--widowed\")\n // }\n\n prj.innerHTML = `\n <div class=\"project__img\">\n <img src=\"${Projects.ux[i].thumbnail}\" alt=\"\" />\n </div>\n <div class=\"project__details\">\n <div class=\"project__date\">${Projects.ux[i].date}</div>\n <div class=\"project__title\">${Projects.ux[i].name}</div>\n <div class=\"project__btn\">${projectsIcons.info1}</div>\n </div>\n `\n\n projectsListUx.appendChild(prj)\n }\n}", "title": "" }, { "docid": "97becd2d7d6a18c3ab1d23353b5ccc07", "score": "0.5760681", "text": "createItem(item) {\n\t\t// debugger;\n\t\tconsole.log(\"[UIManager] Create \");\n\n\t\t// get Item data from state\n\t\tvar item = item || this.state.formFields;\n\t\t// copy list values, not reference, using ES6 spread operator\n\t\tvar currentListItems = [...this.state.list];\n\t\t// add new item\n\t\tcurrentListItems.push(item);\n\t\t// apply change to state\n\t\tthis.setState({\n\t\t\tlist: currentListItems\n\t\t});\n\n\t\t// empty fields for next round\n\t\tthis.setState({\n\t\t\tformFields: {\n\t\t\t\tid: '',\n\t\t\t\ttitle: '',\n\t\t\t\tartist: '',\n\t\t\t\talbum: ''\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "05c9b5f39fc9cec41f26f04b22cc74c2", "score": "0.57377714", "text": "constructor(id, updateProjectListsFunction, type) {\n this.id = id;\n // Remove Project Item form projectList (Active) To projectList(Finished) for example\n this.updateProjectListsHandler = updateProjectListsFunction;\n // this.connectMoreInfoButton();\n this.connectSwitchButton(type);\n }", "title": "" }, { "docid": "4eeba3dd6d7b570bd693b14b458b8cf5", "score": "0.57319516", "text": "buildListItem(project, cssClass, tagSpan) {\n let markup = this.generateElement(\n \"span\",\n undefined,\n undefined,\n project.title\n );\n markup = this.generateElement(\n \"div\",\n undefined,\n this.cssClasses.title + \" \" + this.cssClasses.sqSpItemHoverText,\n markup\n );\n markup = this.generateElement(\n \"a\",\n { href: project.url },\n this.cssClasses.sqSpItemHoverLink,\n markup\n );\n markup = this.generateElement(\"div\", project.selector, cssClass, markup);\n\n return markup;\n }", "title": "" }, { "docid": "4eeba3dd6d7b570bd693b14b458b8cf5", "score": "0.57319516", "text": "buildListItem(project, cssClass, tagSpan) {\n let markup = this.generateElement(\n \"span\",\n undefined,\n undefined,\n project.title\n );\n markup = this.generateElement(\n \"div\",\n undefined,\n this.cssClasses.title + \" \" + this.cssClasses.sqSpItemHoverText,\n markup\n );\n markup = this.generateElement(\n \"a\",\n { href: project.url },\n this.cssClasses.sqSpItemHoverLink,\n markup\n );\n markup = this.generateElement(\"div\", project.selector, cssClass, markup);\n\n return markup;\n }", "title": "" }, { "docid": "026f23a0ede4e8f5c5003189c188bd11", "score": "0.5720946", "text": "constructor(){\n this.items=[];\n }", "title": "" }, { "docid": "e19490a076e8c6e729226207e2194ec7", "score": "0.5716308", "text": "addNewItem() {\n let newItem = new ToDoListItem(this.nextListItemId++);\n this.currentList.items.push(newItem);\n this.view.viewList(this.currentList);\n return newItem;\n }", "title": "" }, { "docid": "e19490a076e8c6e729226207e2194ec7", "score": "0.5716308", "text": "addNewItem() {\n let newItem = new ToDoListItem(this.nextListItemId++);\n this.currentList.items.push(newItem);\n this.view.viewList(this.currentList);\n return newItem;\n }", "title": "" }, { "docid": "87238341650de45f3932b58cd6685edc", "score": "0.5696957", "text": "constructor() { \n \n ProjectWithAccess.initialize(this);\n }", "title": "" }, { "docid": "687dde5dd0d0a7075a8d64c5c4169331", "score": "0.56960243", "text": "function createListItem() {\n const listItem = document.createElement('li');\n listItem.innerText = taskInput.value;\n taskInput.value = '';\n taskList.appendChild(listItem);\n}", "title": "" }, { "docid": "0453199b675e125ff073e3a9743a2c5c", "score": "0.5691681", "text": "function prepareProjects() {\n var newProject = {\n id: 'new_project',\n name: 'New project'\n };\n\n ctrl.selectedProject = lodash.isNil(ctrl.selectedProject) ? newProject : ctrl.selectedProject;\n\n ctrl.projectsList = lodash.chain(ctrl.projects).map(function (project) {\n return {\n id: project.metadata.name,\n name: project.metadata.name\n };\n }).sortBy(['name']).value();\n\n ctrl.selectedProject = lodash.isEmpty(ctrl.projectsList) ? newProject : ctrl.selectedProject.id === 'new_project' ? lodash.first(ctrl.projectsList) :\n /* else */ctrl.selectedProject;\n }", "title": "" }, { "docid": "06c2701fd3b59f40439c71b25a25a4f6", "score": "0.56904584", "text": "function Project(\n id,\t\t\t\t\t// alphanumeric string\n name,\n locations,\t\t\t// array of strings\n start_date,\t\t\t// string of day/month/year - e.g. \"31/12/2019\"\n deadline,\t\t\t// string of day/month/year - e.g. \"31/12/2019\"\n hours_required,\t\t// number\n budget,\t\t\t\t// number\n industries,\t\t\t// array of strings\n qual_required,\t\t// idk figure this out later\n rfp_document,\t\t// string\n client,\t\t\t\t// idk figure this out later\n assigned_consultant,// idk figure this out later,\n priority // can be location, budget, etc.\n) {\n this.id = id\n this.name = name\n this.locations = locations\n this.start_date = start_date\n this.deadline = deadline\n this.hours_required = hours_required\n this.budget = budget\n this.industries = industries\n this.qual_required = qual_required\n this.rfp_document = rfp_document\n this.client = client\n this.assigned_consultant = assigned_consultant;\n this.priority = priority;\n}", "title": "" }, { "docid": "66ea1c238523345615d6d093ec8f92c6", "score": "0.56812847", "text": "function buildNewList(item, index) {\n console.log(item);\n var listItem = $('<li>' + listItemString + '</li>');\n var listItemTitle = $('.title', listItem);\n listItemTitle.html(item.name);\n var listItemLocation = $('.location', listItem);\n listItemLocation.html(item.location.address);\n $('#dataList').append(listItem);\n }", "title": "" }, { "docid": "2bb62089ad3777c6c926201ca1648df8", "score": "0.56801325", "text": "function Project (portfolioDataObj) {\n this.name = portfolioDataObj.name;\n this.link = portfolioDataObj.link;\n this.description = portfolioDataObj.description;\n this.image = 'images/' + portfolioDataObj.image;\n}", "title": "" }, { "docid": "05a1dcb9a56489446a384c087a2c71b6", "score": "0.5676085", "text": "create(name) {\n\t\tlet existing_item = this.find(name);\n\t\tif(existing_item){\n\t\t\treturn existing_item;\n\t\t}\n\n\t\tlet available_spaces = this.listElement.find(':empty');\n\n\t\tlet available_space;\n\t\tif(available_spaces.length == 0){\n\t\t\tavailable_space = $('<li></li>')\n\t\t\t\t.on('animationend', function(){\n\t\t\t\t\t$(this).removeClass('blink');\n\t\t\t\t})\n\t\t\t\t.appendTo(this.listElement);\n\t\t}else{\n\t\t\tavailable_space = available_spaces.first();\n\t\t}\n\n\t\tlet new_item = new ResourceItem(name, available_space, this);\n\n\t\tthis.list.push(new_item);\n\n\t\treturn new_item;\n\t}", "title": "" }, { "docid": "1e35447bab1706dae06d21b76d96f2fe", "score": "0.5671239", "text": "function buildItems() {\n itemMap = new ItemMap();\n}", "title": "" }, { "docid": "81905b853556a7a0bb7f381ddc94abe6", "score": "0.56665635", "text": "constructor(currentId = 0) {\n this.items = [];\n this.currentId = currentId;\n }", "title": "" }, { "docid": "317519eb7966a8e9a5376d7b4e96d057", "score": "0.56605893", "text": "function createList(){ \n\tstate.items.forEach(function(item){\n\tvar theHtml = \n\t'<li>' +\n\t\t'<span class=\"shopping-item\">' + item.displayName + '</span>' +\n\t\t'<div class=\"shopping-item-controls\">' +\n\t\t\t'<button class=\"shopping-item-toggle\">' +\n\t\t\t\t'<span class=\"button-label\">check</span>' +\n\t\t\t'</button>' +\n\t\t\t'<button class=\"shopping-item-delete\">' +\n\t\t\t\t'<span class=\"button-label\">delete</span>' +\n\t\t\t'</button>' +\n\t\t'</div>' +\n\t'</li>'\n\t$('.shopping-list').append(theHtml);\n\t});\n}", "title": "" }, { "docid": "5006700befd80bfcfcad1335c97a083f", "score": "0.5658107", "text": "constructor() { \n \n ListSharedItems.initialize(this);\n }", "title": "" }, { "docid": "639bfe527a8255dd2d6b5d23f6438fa3", "score": "0.56573516", "text": "function prepareProjects() {\n var newProject = {\n id: 'new_project',\n name: $i18next.t('functions:NEW_PROJECT', { lng: lng })\n };\n\n ctrl.selectedProject = lodash.isNil(ctrl.selectedProject) ? newProject : ctrl.selectedProject;\n\n ctrl.projectsList = lodash.chain(ctrl.projects).map(function (project) {\n return {\n id: project.metadata.name,\n name: project.metadata.name\n };\n }).sortBy(['name']).value();\n\n ctrl.selectedProject = lodash.isEmpty(ctrl.projectsList) ? newProject : ctrl.selectedProject.id !== 'new_project' ? ctrl.selectedProject : lodash.first(ctrl.projectsList);\n }", "title": "" }, { "docid": "fc5f3bcfae5b1ebfcb355a408dc9c2c2", "score": "0.5649398", "text": "ReturnModularPageItem(project) {\n return <Project\n key={project.name}\n project={project}\n starUpdateFunc={this.UpdateDisplayedProjectsOnFilterButtonClick}\n starFilterFunc={this.RemoveNonStarredRepos}\n />;\n }", "title": "" }, { "docid": "7b0c0101f3bfd7579d609f8ca6b4682e", "score": "0.5648695", "text": "function prepareProjects() {\n var newProject = {\n id: 'new_project',\n name: $i18next.t('functions:NEW_PROJECT', { lng: lng })\n };\n\n ctrl.selectedProject = lodash.isNil(ctrl.selectedProject) ? newProject : ctrl.selectedProject;\n\n ctrl.projectsList = lodash.chain(ctrl.projects).map(function (project) {\n return {\n id: project.metadata.name,\n name: project.metadata.name\n };\n }).sortBy(['name']).value();\n\n ctrl.selectedProject = lodash.isEmpty(ctrl.projectsList) ? newProject : ctrl.selectedProject.id !== 'new_project' ? ctrl.selectedProject :\n /* else */lodash.first(ctrl.projectsList);\n }", "title": "" }, { "docid": "7ab2ea1ea1869dd05f839b5d91c46f94", "score": "0.56480396", "text": "function ToDoList() {\n this.tasks = [];\n this.currentId = 0;\n}", "title": "" }, { "docid": "1528609ebf70376730e0b7262ced2848", "score": "0.56475633", "text": "constructor()\r\n {\r\n this.items = [];\r\n }", "title": "" }, { "docid": "225357c53ae6c009e2f6deb147fd6959", "score": "0.56430405", "text": "constructor() {\n this.items = [];\n }", "title": "" }, { "docid": "225357c53ae6c009e2f6deb147fd6959", "score": "0.56430405", "text": "constructor() {\n this.items = [];\n }", "title": "" }, { "docid": "225357c53ae6c009e2f6deb147fd6959", "score": "0.56430405", "text": "constructor() {\n this.items = [];\n }", "title": "" }, { "docid": "225357c53ae6c009e2f6deb147fd6959", "score": "0.56430405", "text": "constructor() {\n this.items = [];\n }", "title": "" }, { "docid": "b82b35926f841f845453e6cfd955d31d", "score": "0.56422126", "text": "function createListItem(taskData) {\n const li = document.createElement('li');\n const input = document.createElement('input');\n const label = document.createElement('label');\n const removeBtn = document.createElement('span');\n\n li.className = 'todo-item';\n\n input.type = 'checkbox';\n input.className = 'todo-input';\n input.id = taskData.taskId;\n input.checked = taskData.inputChecked;\n input.addEventListener('click', doneTask);\n\n label.className = 'todo-label';\n label.textContent = taskData.labelText;\n label.setAttribute('for', taskData.taskId);\n\n if (taskData.inputChecked) {\n label.style.textDecoration = 'line-through';\n label.style.color = 'grey';\n } else {\n label.style.textDecoration = 'none';\n label.style.color = 'initial';\n itemsCount.textContent = (++itemsCount.textContent).toString();\n }\n\n removeBtn.className = 'todo-remove';\n removeBtn.textContent = 'X';\n removeBtn.addEventListener('click', removeTask);\n\n li.appendChild(input);\n li.appendChild(label);\n li.appendChild(removeBtn);\n todoList.insertBefore(li, todoList.children[0]);\n}", "title": "" }, { "docid": "183fe98820a2b0fb48ebf1c9cef8b8e7", "score": "0.56403077", "text": "addProject(title, description, numOfPeople) {\n //Creating a new project with the input\n const newProject = new _project__WEBPACK_IMPORTED_MODULE_0__.Project(Math.random().toString(), title, description, numOfPeople, _project__WEBPACK_IMPORTED_MODULE_0__.ProjectStatus.Active);\n //Adding the project to the project list\n this.projects.push(newProject);\n this.updateListeners();\n }", "title": "" }, { "docid": "42bc8520212833dac3444bfa83140310", "score": "0.5639681", "text": "function List(name) {\n\tthis.name = name;\n\tthis.items = [];\n}", "title": "" }, { "docid": "431d5677f6a4a7b2a70636451468fcf6", "score": "0.563557", "text": "initList () {\n let y = 0;\n this.node.height = (this.interfaceList.length + 1) * 50;\n for (let i = 0; i < this.initItemCount; ++i) {\n let item = cc.instantiate(this.itemPrefab).getComponent('AnySDKItem');\n let itemName = this.interfaceList[i];\n item.init(this);\n this.node.addChild(item.node);\n y -= 50;\n item.updateItem (i, y, itemName);\n this.itemList.push(item);\n }\n }", "title": "" }, { "docid": "fed303d607a0ade11dd0a2341df72c42", "score": "0.562196", "text": "function setProjectList(projectList) {\n $(\"#project_list\").html(\"\");\n projectList.forEach(project => {\n $(\"#project_list\").append(`<a href=\"#\" class=\"list-group-item list-group-item-action\" id=\"project_list_${project.id}\" onclick=\"selectProject('${project.id}')\">${project.name}</a>`)\n })\n}", "title": "" }, { "docid": "180d2a9c23bd9363f3e9ece226928337", "score": "0.5614774", "text": "constructor()\n {\n this.items = [];\n }", "title": "" }, { "docid": "180d2a9c23bd9363f3e9ece226928337", "score": "0.5614774", "text": "constructor()\n {\n this.items = [];\n }", "title": "" }, { "docid": "180d2a9c23bd9363f3e9ece226928337", "score": "0.5614774", "text": "constructor()\n {\n this.items = [];\n }", "title": "" }, { "docid": "180d2a9c23bd9363f3e9ece226928337", "score": "0.5614774", "text": "constructor()\n {\n this.items = [];\n }", "title": "" }, { "docid": "153ddfd8f2957667efc23e036806dfed", "score": "0.5608942", "text": "function create_album_list_item(album_id, album_name, album_description) {\n var list_item = $(\"<li/>\");\n list_item.addClass(\"nav-item clearfix\");\n list_item.attr(\"album_id\", album_id);\n\n var album_label = $(\"<div/>\");\n album_label.addClass(\"pull-left\");\n\n var album_control = $(\"<div/>\");\n album_control.addClass(\"pull-right\");\n\n var album_link = $(\"<a/>\");\n album_link.addClass(\"nav-link\");\n album_link.attr(\"data-toggle\", album_description);\n album_link.attr(\"href\", \"Album/\" + album_id);\n album_link.text(album_name);\n\n var edit_control = $(\"<i/>\");\n edit_control.addClass(\"album_control glyphicon glyphicon-cog\");\n edit_control.css('padding-right', '4px');\n\n var delete_control = $(\"<i/>\");\n delete_control.addClass(\"album_control glyphicon glyphicon-trash\");\n\n album_label.append(album_link);\n\n album_control.append(edit_control);\n album_control.append(delete_control);\n\n list_item.append(album_label);\n list_item.append(album_control);\n\n return list_item;\n }", "title": "" }, { "docid": "30ec586300f8e1fc0255d01ddda805fe", "score": "0.5607216", "text": "function setupItems()\n{\n itemGloves = new Item(\"Gloves\", gloves);\n itemArray.push(itemGloves);\n itemRedHerring = new Item(\"Red Herring\", redherring);\n itemArray.push(itemRedHerring);\n itemFlowers = new Item(\"Flowers\", null);\n itemArray.push(itemFlowers);\n itemPerfume = new Item(\"Perfume\", null);\n itemArray.push(itemPerfume);\n itemBroom = new Item(\"Broom\", null);\n itemArray.push(itemBroom);\n itemWand = new Item(\"Magic Wand\", null);\n itemArray.push(itemWand);\n}", "title": "" }, { "docid": "593e5e677809f3ea9489515c7f6110c8", "score": "0.5603349", "text": "function Project(id, name, path)\n{\n this.id = id;\n this.name = name;\n this.path = path;\n}", "title": "" }, { "docid": "7d0682614aef494d24a5563db2ce76b4", "score": "0.56028664", "text": "function taskItem(name) {\n this.name = name;\n}", "title": "" } ]
463815f1f8a15473adf3e0a260b647b0
Denotes a required property for a mixin
[ { "docid": "aa390894109dd4f60081554cf88afc5e", "score": "0.557717", "text": "function required() {\n return REQUIRED;\n }", "title": "" } ]
[ { "docid": "15bb8adda7fe42233f4979428700447b", "score": "0.6194119", "text": "willMergeMixin(props) {\n var constructor = this.constructor;\n (true && !(!intersection(Object.keys(props), RESERVED_MODEL_PROPS)[0]) && Ember.assert('`' + intersection(Object.keys(props), RESERVED_MODEL_PROPS)[0] + '` is a reserved property name on DS.Model objects. Please choose a different property name for ' + constructor.toString(), !intersection(Object.keys(props), RESERVED_MODEL_PROPS)[0]));\n (true && !(Object.keys(props).indexOf('id') === -1) && Ember.assert(\"You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: DS.attr('<type>')` from \" + constructor.toString(), Object.keys(props).indexOf('id') === -1));\n }", "title": "" }, { "docid": "3c04867e6d9bd2a315258416a0d4a3d1", "score": "0.5925441", "text": "static get mixin() {\n return undefined;\n }", "title": "" }, { "docid": "b4af2da6ae204dcf127dcb7dd5b3863a", "score": "0.5864917", "text": "required() {\n if(this.objectDetails.isRequired) {this.joiObj = this.joiObj.required();}\n }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "4dfdf2cb7c77fa5086061d529561e188", "score": "0.5775626", "text": "get required() { return this._required; }", "title": "" }, { "docid": "b8d48579bc091e614edef3a34999197d", "score": "0.57579494", "text": "get required() {\n\t\treturn this.__required;\n\t}", "title": "" }, { "docid": "67475dd1297f5d0fdb68c3225816ed91", "score": "0.5737975", "text": "markRequired() {\n TheFragebogen.logger.debug(this.constructor.name + \".markRequired()\", \"This method should be overridden.\");\n }", "title": "" }, { "docid": "9f1781a550a5e6955bda80b58edf1f29", "score": "0.5702208", "text": "function safeMixin(target, source) {\n // summary:\n //\t\tMix in properties skipping a constructor and decorating functions\n //\t\tlike it is done by declare().\n // target: Object\n //\t\tTarget object to accept new properties.\n // source: Object\n //\t\tSource object for new properties.\n // description:\n //\t\tThis function is used to mix in properties like lang.mixin does,\n //\t\tbut it skips a constructor property and decorates functions like\n //\t\tdeclare() does.\n //\n //\t\tIt is meant to be used with classes and objects produced with\n //\t\tdeclare. Functions mixed in with dojo.safeMixin can use\n //\t\tthis.inherited() like normal methods.\n //\n //\t\tThis function is used to implement extend() method of a constructor\n //\t\tproduced with declare().\n //\n // example:\n //\t|\tvar A = declare(null, {\n //\t|\t\tm1: function(){\n //\t|\t\t\tconsole.log(\"A.m1\");\n //\t|\t\t},\n //\t|\t\tm2: function(){\n //\t|\t\t\tconsole.log(\"A.m2\");\n //\t|\t\t}\n //\t|\t});\n //\t|\tvar B = declare(A, {\n //\t|\t\tm1: function(){\n //\t|\t\t\tthis.inherited(arguments);\n //\t|\t\t\tconsole.log(\"B.m1\");\n //\t|\t\t}\n //\t|\t});\n //\t|\tB.extend({\n //\t|\t\tm2: function(){\n //\t|\t\t\tthis.inherited(arguments);\n //\t|\t\t\tconsole.log(\"B.m2\");\n //\t|\t\t}\n //\t|\t});\n //\t|\tvar x = new B();\n //\t|\tdojo.safeMixin(x, {\n //\t|\t\tm1: function(){\n //\t|\t\t\tthis.inherited(arguments);\n //\t|\t\t\tconsole.log(\"X.m1\");\n //\t|\t\t},\n //\t|\t\tm2: function(){\n //\t|\t\t\tthis.inherited(arguments);\n //\t|\t\t\tconsole.log(\"X.m2\");\n //\t|\t\t}\n //\t|\t});\n //\t|\tx.m2();\n //\t|\t// prints:\n //\t|\t// A.m1\n //\t|\t// B.m1\n //\t|\t// X.m1\n var name, t;\n // add props adding metadata for incoming functions skipping a constructor\n for (name in JSProf.LRE(15776, source)) {\n t = JSProf.LWR(15778, t, JSProf.LGE(15777, source, 'name')[name]);\n if ((JSProf.LRE(15779, t) !== JSProf.LGE(15780, op, 'name')[name] || !(JSProf.LRE(15781, name) in JSProf.LRE(15782, op))) && JSProf.LRE(15783, name) != JSProf.LRE(15784, cname)) {\n if (JSProf.LMC(15786, opts, 'call').call(JSProf.LRE(15785, t)) == \"[object Function]\") {\n // non-trivial function method => attach its name\n JSProf.LPD(15788, t, 'nom').nom = JSProf.LRSP(15788, JSProf.LRE(15787, name));\n }\n JSProf.LPE(15790, target, 'name')[name] = JSProf.LRPE(15790, JSProf.LRE(15789, t));\n }\n }\n if (JSProf.LFC(15791, has, false)(\"bug-for-in-skips-shadowed\")) {\n for (var extraNames = JSProf.LGD(15792, lang, '_extraNames')._extraNames, i = JSProf.LGD(15793, extraNames, 'length').length; JSProf.LRE(15794, i);) {\n name = JSProf.LWR(15796, name, JSProf.LGE(15795, extraNames, JSProf.TMPS.t45b6d9231341ef1e1878a4084c112fead72e763e = --i)[JSProf.TMPS.t45b6d9231341ef1e1878a4084c112fead72e763e]);\n t = JSProf.LWR(15798, t, JSProf.LGE(15797, source, 'name')[name]);\n if ((JSProf.LRE(15799, t) !== JSProf.LGE(15800, op, 'name')[name] || !(JSProf.LRE(15801, name) in JSProf.LRE(15802, op))) && JSProf.LRE(15803, name) != JSProf.LRE(15804, cname)) {\n if (JSProf.LMC(15806, opts, 'call').call(JSProf.LRE(15805, t)) == \"[object Function]\") {\n // non-trivial function method => attach its name\n JSProf.LPD(15808, t, 'nom').nom = JSProf.LRSP(15808, JSProf.LRE(15807, name));\n }\n JSProf.LPE(15810, target, 'name')[name] = JSProf.LRPE(15810, JSProf.LRE(15809, t));\n }\n }\n }\n return JSProf.LRE(15811, target);\n }", "title": "" }, { "docid": "010f59a3e7685a319f326d311d225d0c", "score": "0.5679561", "text": "function safeMixin(target, source){\n\t\t// summary:\n\t\t//\t\tMix in properties skipping a constructor and decorating functions\n\t\t//\t\tlike it is done by declare().\n\t\t// target: Object\n\t\t//\t\tTarget object to accept new properties.\n\t\t// source: Object\n\t\t//\t\tSource object for new properties.\n\t\t// description:\n\t\t//\t\tThis function is used to mix in properties like lang.mixin does,\n\t\t//\t\tbut it skips a constructor property and decorates functions like\n\t\t//\t\tdeclare() does.\n\t\t//\n\t\t//\t\tIt is meant to be used with classes and objects produced with\n\t\t//\t\tdeclare. Functions mixed in with dojo.safeMixin can use\n\t\t//\t\tthis.inherited() like normal methods.\n\t\t//\n\t\t//\t\tThis function is used to implement extend() method of a constructor\n\t\t//\t\tproduced with declare().\n\t\t//\n\t\t// example:\n\t\t//\t|\tvar A = declare(null, {\n\t\t//\t|\t\tm1: function(){\n\t\t//\t|\t\t\tconsole.log(\"A.m1\");\n\t\t//\t|\t\t},\n\t\t//\t|\t\tm2: function(){\n\t\t//\t|\t\t\tconsole.log(\"A.m2\");\n\t\t//\t|\t\t}\n\t\t//\t|\t});\n\t\t//\t|\tvar B = declare(A, {\n\t\t//\t|\t\tm1: function(){\n\t\t//\t|\t\t\tthis.inherited(arguments);\n\t\t//\t|\t\t\tconsole.log(\"B.m1\");\n\t\t//\t|\t\t}\n\t\t//\t|\t});\n\t\t//\t|\tB.extend({\n\t\t//\t|\t\tm2: function(){\n\t\t//\t|\t\t\tthis.inherited(arguments);\n\t\t//\t|\t\t\tconsole.log(\"B.m2\");\n\t\t//\t|\t\t}\n\t\t//\t|\t});\n\t\t//\t|\tvar x = new B();\n\t\t//\t|\tdojo.safeMixin(x, {\n\t\t//\t|\t\tm1: function(){\n\t\t//\t|\t\t\tthis.inherited(arguments);\n\t\t//\t|\t\t\tconsole.log(\"X.m1\");\n\t\t//\t|\t\t},\n\t\t//\t|\t\tm2: function(){\n\t\t//\t|\t\t\tthis.inherited(arguments);\n\t\t//\t|\t\t\tconsole.log(\"X.m2\");\n\t\t//\t|\t\t}\n\t\t//\t|\t});\n\t\t//\t|\tx.m2();\n\t\t//\t|\t// prints:\n\t\t//\t|\t// A.m1\n\t\t//\t|\t// B.m1\n\t\t//\t|\t// X.m1\n\n\t\tvar name, t;\n\t\t// add props adding metadata for incoming functions skipping a constructor\n\t\tfor(name in source){\n\t\t\tt = source[name];\n\t\t\tif((t !== op[name] || !(name in op)) && name != cname){\n\t\t\t\tif(opts.call(t) == \"[object Function]\"){\n\t\t\t\t\t// non-trivial function method => attach its name\n\t\t\t\t\tt.nom = name;\n\t\t\t\t}\n\t\t\t\ttarget[name] = t;\n\t\t\t}\n\t\t}\n\t\tif(has(\"bug-for-in-skips-shadowed\")){\n\t\t\tfor(var extraNames= lang._extraNames, i= extraNames.length; i;){\n\t\t\t\tname = extraNames[--i];\n\t\t\t\tt = source[name];\n\t\t\t\tif((t !== op[name] || !(name in op)) && name != cname){\n\t\t\t\t\tif(opts.call(t) == \"[object Function]\"){\n\t\t\t\t\t\t// non-trivial function method => attach its name\n\t\t\t\t\t\t t.nom = name;\n\t\t\t\t\t}\n\t\t\t\t\ttarget[name] = t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "a854867ebdc6757343826598f36d76a6", "score": "0.5628366", "text": "get required() { return this._required }", "title": "" }, { "docid": "2eb2288cd173a8fff9b932452d8b8af1", "score": "0.5612661", "text": "function isRequiredProperty(parentPropertyType, propertyName) {\n return getProperty(parentPropertyType, propertyName).Required;\n}", "title": "" }, { "docid": "9b682eaa52a543acc642eeec9e77eb99", "score": "0.5586619", "text": "function asMixin(to){\r\n to.foo = function(){\r\n console.log(\"property 1\");\r\n }\r\n to.bar = function(){\r\n console.log(\"property 2\");\r\n }\r\n return to;\r\n }", "title": "" }, { "docid": "676ee65c53da5702eaf50466490fb28d", "score": "0.55849475", "text": "static get required() {\n return this.requiredRule;\n }", "title": "" }, { "docid": "e672ba1579a6fa9267bfbf7688c80c3b", "score": "0.5504662", "text": "required(props, name) {\n if (!(name in props)) {\n throw new Error(`Construct of type ${this.typename} is missing required property: ${name}`);\n }\n const value = props[name];\n return value;\n }", "title": "" }, { "docid": "e672ba1579a6fa9267bfbf7688c80c3b", "score": "0.5504662", "text": "required(props, name) {\n if (!(name in props)) {\n throw new Error(`Construct of type ${this.typename} is missing required property: ${name}`);\n }\n const value = props[name];\n return value;\n }", "title": "" }, { "docid": "1f7bedf7b01e2fd4f264d6af40d1e236", "score": "0.5421349", "text": "setRequired(required) {\n this._required = required;\n }", "title": "" }, { "docid": "79fe1fceb2c450d1f741cdf9e865d025", "score": "0.5311673", "text": "function mixin(target, source, force) {\n for (var prop in source) {\n if (!(prop in empty) && (!(prop in target) || force)) {\n target[prop] = source[prop];\n }\n }\n return req;\n }", "title": "" }, { "docid": "cf7292297aca39c4b1bddcc644849b55", "score": "0.5296725", "text": "function checkForInlineMixins(mixin, rtn) {\n if (mixin.mixins) {\n get(mixin.mixins, index, initiatedOnce, rtn);\n }\n }", "title": "" }, { "docid": "13d37a2095ea23a9112790fc413e0c44", "score": "0.5250021", "text": "function required (node) {\n node.required = true;\n}", "title": "" }, { "docid": "2595794a21c9a068c69a9867417fb849", "score": "0.52480984", "text": "function safeMixin(target, source){\n\t\tvar name, t, i = 0, l = d._extraNames.length;\n\t\t// add props adding metadata for incoming functions skipping a constructor\n\t\tfor(name in source){\n\t\t\tt = source[name];\n\t\t\tif((t !== op[name] || !(name in op)) && name != cname){\n\t\t\t\tif(opts.call(t) == \"[object Function]\"){\n\t\t\t\t\t// non-trivial function method => attach its name\n\t\t\t\t\tt.nom = name;\n\t\t\t\t}\n\t\t\t\ttarget[name] = t;\n\t\t\t}\n\t\t}\n\t\t// process unenumerable methods on IE\n\t\tfor(; i < l; ++i){\n\t\t\tname = d._extraNames[i];\n\t\t\tt = source[name];\n\t\t\tif((t !== op[name] || !(name in op)) && name != cname){\n\t\t\t\tif(opts.call(t) == \"[object Function]\"){\n\t\t\t\t\t// non-trivial function method => attach its name\n\t\t\t\t\tt.nom = name;\n\t\t\t\t}\n\t\t\t\ttarget[name] = t;\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t}", "title": "" }, { "docid": "34300065c6bd3c3c3c6ab9bf4b24629d", "score": "0.52009547", "text": "required() {\n\n // Set required state for the input label if a required rule is specified\n return !!_.find(this.rules, function(rule) { return rule.required || rule.required_with || rule.required_if || rule.required_without; });\n }", "title": "" }, { "docid": "a0326a767272137892e9f0bf74cdba20", "score": "0.51314425", "text": "function hasProperty() {\n return false;\n}", "title": "" }, { "docid": "30da19439aa91665c1787371d575b9b2", "score": "0.50850004", "text": "function isRequiredPropType(path) {\n return (0, _getMembers.default)(path).some(member => !member.computed && member.path.node.name === 'isRequired' || member.computed && member.path.node.value === 'isRequired');\n}", "title": "" }, { "docid": "1c9e594fc378bd6bfde8f613b1269f3c", "score": "0.50678384", "text": "required(required = true) {\r\n return this.boolAttr('required', required);\r\n }", "title": "" }, { "docid": "847fdac694d6e161b116397093c84ecc", "score": "0.50587565", "text": "function required() {\n _emberDebug.deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.', false, { id: 'ember-metal.required', until: '3.0.0' });\n return REQUIRED;\n }", "title": "" }, { "docid": "5c1e68055f79ad6e9ea607c51370696f", "score": "0.5040184", "text": "get(propertyName, ...rest) {\n const value = super.get(propertyName, ...rest);\n this._evaluatePropTypes(propertyName, value);\n\n // Continue setting the property as usual\n return value;\n }", "title": "" }, { "docid": "e8dffaf2e7d44e9986cdc10acbba4810", "score": "0.4997576", "text": "function shineMixin(obj) {\n obj.shine = function() {\n console.log(\"Shining Bright!!\");\n }\n}", "title": "" }, { "docid": "248c9bf4f383bfe3e18d981212a6e594", "score": "0.49782148", "text": "addRequiredProperties() {\n if (this.schema && this.schema.properties) {\n for (const propName in this.schema.properties) {\n if (this.model[propName] !== undefined) {\n continue;\n }\n if (this.requiredCache[propName] || this.schemaBuilderMode) {\n // List all properties not only required if we are in schema builder mode\n this.addSchemaProperty(propName);\n }\n }\n }\n }", "title": "" }, { "docid": "c956b89ff6b78e64f11fa9300e8b1f7f", "score": "0.49643824", "text": "function required(){_emberMetalDebug.deprecate('Ember.required is deprecated as its behavior is inconsistent and unreliable.',false,{id:'ember-metal.required',until:'3.0.0'});return REQUIRED;}", "title": "" }, { "docid": "c0d8014f5a10a503aab6df7779ed66af", "score": "0.4954621", "text": "function required(rule,value,source,errors,options,type){if(rule.required&&(!source.hasOwnProperty(rule.field)||isEmptyValue(value,type||rule.type))){errors.push(format(options.messages.required,rule.fullField));}}", "title": "" }, { "docid": "7c81c8cc19fdbe0b9b9d04cf76acdbd0", "score": "0.49080795", "text": "function OptionalDecorator() { }", "title": "" }, { "docid": "7c81c8cc19fdbe0b9b9d04cf76acdbd0", "score": "0.49080795", "text": "function OptionalDecorator() { }", "title": "" }, { "docid": "7c81c8cc19fdbe0b9b9d04cf76acdbd0", "score": "0.49080795", "text": "function OptionalDecorator() { }", "title": "" }, { "docid": "7c81c8cc19fdbe0b9b9d04cf76acdbd0", "score": "0.49080795", "text": "function OptionalDecorator() { }", "title": "" }, { "docid": "8cb767a4ad966c5cdfebf430fa9cc6b5", "score": "0.4905568", "text": "function OptionalDecorator() {}", "title": "" }, { "docid": "8cb767a4ad966c5cdfebf430fa9cc6b5", "score": "0.4905568", "text": "function OptionalDecorator() {}", "title": "" }, { "docid": "eee32efe35793020ebe658740bfc9f34", "score": "0.4905221", "text": "makeRequired() {\n\t\tif (this.inputs && this.inputs.length) {\n\t\t\tthis.inputs[0].required = true;\n\t\t}\n\t\tthis.$el.classList.remove('o-forms-field--optional');\n\t}", "title": "" }, { "docid": "af477df67545e99fd2c1600fda5c3f22", "score": "0.48974526", "text": "get requiredBehavior() {\n\t\treturn this.__requiredBehavior;\n\t}", "title": "" }, { "docid": "45ffb211efedaa161c89e6e356950b3c", "score": "0.4895447", "text": "function assertProp(prop,name,value,vm,absent){if(prop.required&&absent){warn('Missing required prop: \"'+name+'\"',vm);return;}if(value==null&&!prop.required){return;}var type=prop.type;var valid=!type||type===true;var expectedTypes=[];if(type){if(!Array.isArray(type)){type=[type];}for(var i=0;i<type.length&&!valid;i++){var assertedType=assertType(value,type[i]);expectedTypes.push(assertedType.expectedType||'');valid=assertedType.valid;}}if(!valid){warn(getInvalidTypeMessage(name,value,expectedTypes),vm);return;}var validator=prop.validator;if(validator){if(!validator(value)){warn('Invalid prop: custom validator check failed for prop \"'+name+'\".',vm);}}}", "title": "" }, { "docid": "45ffb211efedaa161c89e6e356950b3c", "score": "0.4895447", "text": "function assertProp(prop,name,value,vm,absent){if(prop.required&&absent){warn('Missing required prop: \"'+name+'\"',vm);return;}if(value==null&&!prop.required){return;}var type=prop.type;var valid=!type||type===true;var expectedTypes=[];if(type){if(!Array.isArray(type)){type=[type];}for(var i=0;i<type.length&&!valid;i++){var assertedType=assertType(value,type[i]);expectedTypes.push(assertedType.expectedType||'');valid=assertedType.valid;}}if(!valid){warn(getInvalidTypeMessage(name,value,expectedTypes),vm);return;}var validator=prop.validator;if(validator){if(!validator(value)){warn('Invalid prop: custom validator check failed for prop \"'+name+'\".',vm);}}}", "title": "" }, { "docid": "947b9105ce77e3ed8a5f5ea1e55dd114", "score": "0.48900482", "text": "function isDefined(prop) {\n if (prop === undefined) {\n tfl.logs.create(\"error instantiating object - mandatory field not populated\");\n return false;\n }\n return true; \n }", "title": "" }, { "docid": "1955bb84b84d4da6d3e7cef47dde6788", "score": "0.484034", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"f\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "1955bb84b84d4da6d3e7cef47dde6788", "score": "0.484034", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"f\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "1955bb84b84d4da6d3e7cef47dde6788", "score": "0.484034", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"f\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "1955bb84b84d4da6d3e7cef47dde6788", "score": "0.484034", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"f\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "19fd797aa8bebe2a9a925a6d5bf9fbb3", "score": "0.483212", "text": "function isValidOverrideOf(sourceProp, targetProp) {\n return !forEachProperty(targetProp, function (tp) {\n return ts.getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false;\n });\n }", "title": "" }, { "docid": "effaec8f2191d3bb71fcc237883ac501", "score": "0.48317036", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "effaec8f2191d3bb71fcc237883ac501", "score": "0.48317036", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "effaec8f2191d3bb71fcc237883ac501", "score": "0.48317036", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "effaec8f2191d3bb71fcc237883ac501", "score": "0.48317036", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "effaec8f2191d3bb71fcc237883ac501", "score": "0.48317036", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "effaec8f2191d3bb71fcc237883ac501", "score": "0.48317036", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* isEmptyValue */](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "e3e94de473673ce05c04dbfdb8f80b05", "score": "0.48297787", "text": "function isValidOverrideOf(sourceProp, targetProp) {\n return !forEachProperty(targetProp, function (tp) {\n return getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false;\n });\n }", "title": "" }, { "docid": "76231d877b844381fe6c8827ec980d68", "score": "0.48264667", "text": "function RelationMixin() {\n}", "title": "" }, { "docid": "41fefc2b7f55f9146394df3a5ca64e51", "score": "0.48173836", "text": "get required() {\n\t\treturn this.nativeElement ? this.nativeElement.required : undefined;\n\t}", "title": "" }, { "docid": "8300c7e94083fd9b1e1ded8884858776", "score": "0.4815093", "text": "function loadSingleMixin(mixin, progressCallback) {\n try {\n mixinDictionary.add(mixin.name, mixin);\n if (progressCallback) {\n progressCallback(mixin.name, true, 'Loaded mixin: ' + mixin.name);\n }\n } catch (e) {\n if (progressCallback) {\n progressCallback(mixin.name, false, e.message);\n }\n }\n }", "title": "" }, { "docid": "9cfe1467b03bf139c57eebc1d3f5858a", "score": "0.47832668", "text": "function OptionalDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "title": "" }, { "docid": "5b5716919a83d8ae4864fda5151640f5", "score": "0.47724375", "text": "function validateMixins() {\n for(var id in plugins) {\n\n var plugin = plugins[id];\n\n plugin.module.mixins && plugin.module.mixins.forEach(function(mixin) {\n if (!(mixin in plugins)) {\n console.log('Unexisting mixin \"' + mixin + '\" in plugin \"' + id + '\"');\n delete plugins[id];\n }\n });\n }\n }", "title": "" }, { "docid": "2a40b1d70802ff14fde87dd4464ed2a5", "score": "0.47688663", "text": "function isValidOverrideOf(sourceProp, targetProp) {\n return !forEachProperty(targetProp, function (tp) { return ts.getDeclarationModifierFlagsFromSymbol(tp) & 16 /* Protected */ ?\n !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; });\n }", "title": "" }, { "docid": "52731f645f46f8cbe27063c6e97d05a5", "score": "0.47463363", "text": "function required(rule, value, source, errors, options, type) {\n\t\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type))) {\n\t\t errors.push(util.format(options.messages.required, rule.fullField));\n\t\t }\n\t\t}", "title": "" }, { "docid": "c2328221dace4fbbc527e110b0e401e8", "score": "0.47368723", "text": "function ensureInitializerDefineProp(path, state) {\n if (!state.initializerDefineProp) {\n state.initializerDefineProp = path.scope.generateUidIdentifier('initDefineProp');\n var helper = buildInitializerDefineProperty({\n NAME: state.initializerDefineProp\n });\n path.scope.getProgramParent().path.unshiftContainer('body', helper);\n }\n\n return state.initializerDefineProp;\n }", "title": "" }, { "docid": "1d7d0d95de5015bad0941cdacc5e665c", "score": "0.4731733", "text": "function mixSpecIntoComponent(Constructor, spec) {\n\t\t if (!spec) {\n\t\t if (process.env.NODE_ENV !== 'production') {\n\t\t var typeofSpec = typeof spec;\n\t\t var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n\t\t process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;\n\t\t }\n\n\t\t return;\n\t\t }\n\n\t\t !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;\n\t\t !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;\n\n\t\t var proto = Constructor.prototype;\n\t\t var autoBindPairs = proto.__reactAutoBindPairs;\n\n\t\t // By handling mixins before any other properties, we ensure the same\n\t\t // chaining order is applied to methods with DEFINE_MANY policy, whether\n\t\t // mixins are listed before or after these methods in the spec.\n\t\t if (spec.hasOwnProperty(MIXINS_KEY)) {\n\t\t RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n\t\t }\n\n\t\t for (var name in spec) {\n\t\t if (!spec.hasOwnProperty(name)) {\n\t\t continue;\n\t\t }\n\n\t\t if (name === MIXINS_KEY) {\n\t\t // We have already handled mixins in a special case above.\n\t\t continue;\n\t\t }\n\n\t\t var property = spec[name];\n\t\t var isAlreadyDefined = proto.hasOwnProperty(name);\n\t\t validateMethodOverride(isAlreadyDefined, name);\n\n\t\t if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n\t\t RESERVED_SPEC_KEYS[name](Constructor, property);\n\t\t } else {\n\t\t // Setup methods on prototype:\n\t\t // The following member methods should not be automatically bound:\n\t\t // 1. Expected ReactClass methods (in the \"interface\").\n\t\t // 2. Overridden methods (that were mixed in).\n\t\t var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n\t\t var isFunction = typeof property === 'function';\n\t\t var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n\n\t\t if (shouldAutoBind) {\n\t\t autoBindPairs.push(name, property);\n\t\t proto[name] = property;\n\t\t } else {\n\t\t if (isAlreadyDefined) {\n\t\t var specPolicy = ReactClassInterface[name];\n\n\t\t // These cases should already be caught by validateMethodOverride.\n\t\t !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;\n\n\t\t // For methods which are defined more than once, call the existing\n\t\t // methods before calling the new property, merging if appropriate.\n\t\t if (specPolicy === 'DEFINE_MANY_MERGED') {\n\t\t proto[name] = createMergedResultFunction(proto[name], property);\n\t\t } else if (specPolicy === 'DEFINE_MANY') {\n\t\t proto[name] = createChainedFunction(proto[name], property);\n\t\t }\n\t\t } else {\n\t\t proto[name] = property;\n\t\t if (process.env.NODE_ENV !== 'production') {\n\t\t // Add verbose displayName to the function, which helps when looking\n\t\t // at profiling tools.\n\t\t if (typeof property === 'function' && spec.displayName) {\n\t\t proto[name].displayName = spec.displayName + '_' + name;\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t }\n\t\t}", "title": "" }, { "docid": "d3c17dfa73681f4a4a3555a8de39c68f", "score": "0.47231436", "text": "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {\n\t errors.push(format(options.messages.required, rule.fullField));\n\t }\n\t}", "title": "" }, { "docid": "d3ec15aa8b2055a928cbe67fecd79051", "score": "0.4719852", "text": "get required() {\n return this._required || (this.radioGroup && this.radioGroup.required);\n }", "title": "" }, { "docid": "618b0ecd9800bae6753f1d0120d5b538", "score": "0.4714088", "text": "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type))) {\n\t errors.push(util.format(options.messages.required, rule.fullField));\n\t }\n\t}", "title": "" }, { "docid": "6a6c13732eb5d594dba78f2cee40f023", "score": "0.47132003", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || _util__WEBPACK_IMPORTED_MODULE_0__.isEmptyValue(value, type || rule.type))) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "6a6c13732eb5d594dba78f2cee40f023", "score": "0.47132003", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || _util__WEBPACK_IMPORTED_MODULE_0__.isEmptyValue(value, type || rule.type))) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "b843d8efcd24125d3e3f7dd8188e2d26", "score": "0.47071877", "text": "static get constraints() {\n return ['required'];\n }", "title": "" }, { "docid": "6940368eb4534ee3515cfd7568e4913f", "score": "0.47065845", "text": "decorateRule(rule){if(rule.propertyInfo){return rule.propertyInfo}let info={},properties={},hasProperties=this.collectProperties(rule,properties);if(hasProperties){info.properties=properties;// TODO(sorvell): workaround parser seeing mixins as additional rules\nrule.rules=null}info.cssText=this.collectCssText(rule);rule.propertyInfo=info;return info}", "title": "" }, { "docid": "fb9e40818dbde92a6eed8b7d50a9dc0a", "score": "0.4698948", "text": "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n\t errors.push(util.format(options.messages.required, rule.fullField));\n\t }\n\t}", "title": "" }, { "docid": "fb9e40818dbde92a6eed8b7d50a9dc0a", "score": "0.4698948", "text": "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n\t errors.push(util.format(options.messages.required, rule.fullField));\n\t }\n\t}", "title": "" }, { "docid": "fb9e40818dbde92a6eed8b7d50a9dc0a", "score": "0.4698948", "text": "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n\t errors.push(util.format(options.messages.required, rule.fullField));\n\t }\n\t}", "title": "" }, { "docid": "fb9e40818dbde92a6eed8b7d50a9dc0a", "score": "0.4698948", "text": "function required(rule, value, source, errors, options, type) {\n\t if (rule.required && (!source.hasOwnProperty(rule.field) || util.isEmptyValue(value, type || rule.type))) {\n\t errors.push(util.format(options.messages.required, rule.fullField));\n\t }\n\t}", "title": "" }, { "docid": "d2dc2f6e7cf8404400b28fcd4f6e789d", "score": "0.46929657", "text": "function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (false) {\n var typeofSpec = typeof spec;\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n \n process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;\n }\n \n return;\n }\n \n !(typeof spec !== 'function') ? false ? invariant(false, 'ReactClass: You\\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;\n !!ReactElement.isValidElement(spec) ? false ? invariant(false, 'ReactClass: You\\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;\n \n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs;\n \n // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n \n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n \n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n \n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n \n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n \n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name];\n \n // These cases should already be caught by validateMethodOverride.\n !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? false ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;\n \n // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n if (false) {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "770e2db9d7bf1f0e7193c83ab38fa6ae", "score": "0.46909064", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || __WEBPACK_IMPORTED_MODULE_0__util__[\"isEmptyValue\"](value, type || rule.type))) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "5afdfa208be8b1e9ee682cf000afc018", "score": "0.4674762", "text": "validateProperties() {\n\n \t\tlet retVal = super.validateProperties();\n \t\tretVal = retVal ? this.validateTarget() : retVal;\n\n \t\treturn retVal;\n \t}", "title": "" }, { "docid": "cdbd5837ec10702eef87613b98a1746a", "score": "0.4656275", "text": "markRequired() {\n if (this.node === null) {\n return;\n }\n\n const classNameRequired = (this.className !== undefined ? this.className : \"\") + \"Required\";\n if (!this.isReady()) {\n this.node.classList.add(classNameRequired);\n } else {\n this.node.classList.remove(classNameRequired);\n }\n }", "title": "" }, { "docid": "5a9ec9215b148427f7cf16c743a80851", "score": "0.4648127", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || _util__WEBPACK_IMPORTED_MODULE_0__[\"isEmptyValue\"](value, type || rule.type))) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "5a9ec9215b148427f7cf16c743a80851", "score": "0.4648127", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || _util__WEBPACK_IMPORTED_MODULE_0__[\"isEmptyValue\"](value, type || rule.type))) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "e7cd33d01fe11fdf56c24d2504702890", "score": "0.46451372", "text": "function isRequired(target, propertyKey) {\n return Reflect.getMetadata(EdmNullableProperty, target.prototype, propertyKey) == false ? true : false;\n}", "title": "" }, { "docid": "38442708eda276e58ff96f43b700510e", "score": "0.46361268", "text": "init () {\n this._super(...arguments)\n // this component would like to validate it's own values\n this.registerValidator(this)\n }", "title": "" }, { "docid": "3d8af97b869d9d64bc57126701e16547", "score": "0.46348682", "text": "required(modelName, lodashPath, appModelPart, userContext, handlerSpec, cb) {\n if (!_.isString(appModelPart.required)) {\n return cb();\n }\n\n try {\n const val = vutil.getValue(this, appModelPart, lodashPath);\n const { action } = userContext;\n\n let isRequired;\n if (appModelPart.required.includes('this.')) {\n const requiredData = getRequiredData(modelName, lodashPath);\n const context = {\n data: val,\n row: this,\n modelSchema: appModelPart,\n action,\n indexes: requiredData.indexes,\n parentData: _.get(this, requiredData.parentPath),\n index: requiredData.index,\n path: lodashPath,\n };\n const inlineCode = appLib.butil.getDefaultArgsAndValuesForInlineCode();\n isRequired = new Function(inlineCode.args, `return ${appModelPart.required}`).apply(\n context,\n inlineCode.values\n );\n } else {\n const requiredFunc = new Function('data, row, modelSchema, $action', `return ${appModelPart.required}`);\n isRequired = requiredFunc(val, this, appModelPart, action);\n }\n\n const { type } = appModelPart;\n const isArrayType = type.endsWith('[]') || type === 'Array';\n const isObjectType = type === 'Mixed' || type === 'Object';\n const isString = type === 'String';\n const isBoolean = type === 'Boolean';\n const isEmptyVal =\n _.isNil(val) ||\n ((isArrayType || isObjectType) && _.isEmpty(val)) ||\n (isString && val === '') ||\n (isBoolean && val === false); // this is not supposed to be\n if (isRequired && isEmptyVal) {\n cb(vutil.replaceErrorTemplatePlaceholders(modelName, handlerSpec, val, this, lodashPath, appModelPart));\n } else {\n cb();\n }\n } catch (e) {\n return cb(\n `Error occurred during validating required field ${appModelPart.fullName} for condition ${appModelPart.required}`\n );\n }\n }", "title": "" }, { "docid": "057f0eb806e0ab01edc2e6b19560f7c8", "score": "0.4634732", "text": "notFoo () {\n return this.bar;\n }", "title": "" }, { "docid": "7af9288d8ead484ccde05c289addfdef", "score": "0.46305585", "text": "function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (process.env.NODE_ENV !== 'production') {\n var typeofSpec = typeof spec;\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;\n }\n\n return;\n }\n\n !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;\n !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;\n\n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs;\n\n // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n\n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n\n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n\n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n\n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n\n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name];\n\n // These cases should already be caught by validateMethodOverride.\n !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;\n\n // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n if (process.env.NODE_ENV !== 'production') {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "8d42e4c3d4cea68feeac1178ed0a638c", "score": "0.4628342", "text": "collectProperties(rule,properties){let info=rule.propertyInfo;if(info){if(info.properties){Object.assign(properties,info.properties);return!0}}else{let m,rx=RX.VAR_ASSIGN,cssText=rule.parsedCssText,value,any;while(m=rx.exec(cssText)){// note: group 2 is var, 3 is mixin\nvalue=(m[2]||m[3]).trim();// value of 'inherit' or 'unset' is equivalent to not setting the property here\nif(\"inherit\"!==value||\"unset\"!==value){properties[m[1].trim()]=value}any=!0}return any}}", "title": "" }, { "docid": "05c3f53323774f8b231cf4ef4aadfdc7", "score": "0.4620792", "text": "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "title": "" }, { "docid": "e9fce605ef6a78b2a84cc43df84b6b03", "score": "0.46187633", "text": "function mixin(target, source, force) {\r\n var prop;\r\n for (prop in source) {\r\n if (source.hasOwnProperty(prop) && (!target.hasOwnProperty(prop) || force)) {\r\n target[prop] = source[prop];\r\n } else if (typeof source[prop] === 'object') {\r\n mixin(target[prop], source[prop], force);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "7d6602ba2f678ec92013d097528300dd", "score": "0.4618652", "text": "function requiredField($this) {\n if (!$this.parents('.field').hasClass('required')) {\n //Field required\n $this.parents('.field').addClass('required');\n $this.attr('checked','checked');\n } else {\n //Field not required\n $this.parents('.field').removeClass('required');\n $this.removeAttr('checked');\n }\n}", "title": "" }, { "docid": "d90cc958c823feaaa5c18d8138f3e668", "score": "0.4608564", "text": "function validateProp(prop, key, value, props, required) {\n if (required === void 0) {\n required = true;\n }\n\n var hasProp = value !== null && value !== undefined && value !== '';\n\n if (!hasProp) {\n if (required && prop.required !== false && !prop.hasOwnProperty('def')) {\n throw new Error(\"Prop is required: \" + key);\n }\n\n return;\n }\n\n if (value && typeof value.then === 'function' && prop.promise) {\n return;\n }\n\n if (prop.type === 'function') {\n if (!(typeof value === 'function')) {\n throw new TypeError(\"Prop is not of type function: \" + key);\n }\n } else if (prop.type === 'string') {\n if (typeof value !== 'string') {\n throw new TypeError(\"Prop is not of type string: \" + key);\n }\n } else if (prop.type === 'object') {\n // Since we're sending everything by post-message, everything must be json serializable\n if (prop.sendToChild !== false) {\n try {\n JSON.stringify(value);\n } catch (err) {\n throw new Error(\"Unable to serialize prop: \" + key);\n }\n }\n } else if (prop.type === 'number') {\n if (isNaN(parseInt(value, 10))) {\n throw new TypeError(\"Prop is not a number: \" + key);\n }\n }\n\n if (typeof prop.validate === 'function' && value) {\n prop.validate(value, props);\n }\n}", "title": "" }, { "docid": "efb68bcc9eac8c2c9e709e5ee9b42c47", "score": "0.4605306", "text": "function checkDefined(property) {\n\t\tif (property) {return property} else {return ' '};\n\t\t}", "title": "" }, { "docid": "407afbb553262e6aed26d61c0154aed0", "score": "0.45994183", "text": "function mixSpecIntoComponent(Constructor,spec){if(!spec){if(true){var typeofSpec=typeof spec==='undefined'?'undefined':_typeof2(spec);var isMixinValid=typeofSpec==='object'&&spec!==null;if(true){warning(isMixinValid,\"%s: You're attempting to include a mixin that is either null \"+'or not an object. Check the mixins included by the component, '+'as well as any mixins they include themselves. '+'Expected object but got %s.',Constructor.displayName||'ReactClass',spec===null?null:typeofSpec);}}return;}_invariant(typeof spec!=='function',\"ReactClass: You're attempting to \"+'use a component class or function as a mixin. Instead, just use a '+'regular object.');_invariant(!isValidElement(spec),\"ReactClass: You're attempting to \"+'use a component as a mixin. Instead, just use a regular object.');var proto=Constructor.prototype;var autoBindPairs=proto.__reactAutoBindPairs;// By handling mixins before any other properties, we ensure the same\n// chaining order is applied to methods with DEFINE_MANY policy, whether\n// mixins are listed before or after these methods in the spec.\nif(spec.hasOwnProperty(MIXINS_KEY)){RESERVED_SPEC_KEYS.mixins(Constructor,spec.mixins);}for(var name in spec){if(!spec.hasOwnProperty(name)){continue;}if(name===MIXINS_KEY){// We have already handled mixins in a special case above.\ncontinue;}var property=spec[name];var isAlreadyDefined=proto.hasOwnProperty(name);validateMethodOverride(isAlreadyDefined,name);if(RESERVED_SPEC_KEYS.hasOwnProperty(name)){RESERVED_SPEC_KEYS[name](Constructor,property);}else{// Setup methods on prototype:\n// The following member methods should not be automatically bound:\n// 1. Expected ReactClass methods (in the \"interface\").\n// 2. Overridden methods (that were mixed in).\nvar isReactClassMethod=ReactClassInterface.hasOwnProperty(name);var isFunction=typeof property==='function';var shouldAutoBind=isFunction&&!isReactClassMethod&&!isAlreadyDefined&&spec.autobind!==false;if(shouldAutoBind){autoBindPairs.push(name,property);proto[name]=property;}else{if(isAlreadyDefined){var specPolicy=ReactClassInterface[name];// These cases should already be caught by validateMethodOverride.\n_invariant(isReactClassMethod&&(specPolicy==='DEFINE_MANY_MERGED'||specPolicy==='DEFINE_MANY'),'ReactClass: Unexpected spec policy %s for key %s '+'when mixing in component specs.',specPolicy,name);// For methods which are defined more than once, call the existing\n// methods before calling the new property, merging if appropriate.\nif(specPolicy==='DEFINE_MANY_MERGED'){proto[name]=createMergedResultFunction(proto[name],property);}else if(specPolicy==='DEFINE_MANY'){proto[name]=createChainedFunction(proto[name],property);}}else{proto[name]=property;if(true){// Add verbose displayName to the function, which helps when looking\n// at profiling tools.\nif(typeof property==='function'&&spec.displayName){proto[name].displayName=spec.displayName+'_'+name;}}}}}}}", "title": "" }, { "docid": "4d74e42b138e4d5516718d9974e3bbde", "score": "0.4598726", "text": "function required(rule, value, source, errors, options, type) {\n if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {\n errors.push(format$1(options.messages.required, rule.fullField));\n }\n}", "title": "" }, { "docid": "ae44bcd56d3d84275ebf56f579c86e7b", "score": "0.4596722", "text": "function assertProp(prop,name,value,vm,absent){if(prop.required&&absent){warn('Missing required prop: \"'+name+'\"',vm);return;}if(value==null&&!prop.required){return;}var type=prop.type;var valid=!type||type===true;var expectedTypes=[];if(type){if(!Array.isArray(type)){type=[type];}for(var i=0;i<type.length&&!valid;i++){var assertedType=assertType(value,type[i]);expectedTypes.push(assertedType.expectedType||'');valid=assertedType.valid;}}if(!valid){warn('Invalid prop: type check failed for prop \"'+name+'\".'+' Expected '+expectedTypes.map(capitalize).join(', ')+', got '+Object.prototype.toString.call(value).slice(8,-1)+'.',vm);return;}var validator=prop.validator;if(validator){if(!validator(value)){warn('Invalid prop: custom validator check failed for prop \"'+name+'\".',vm);}}}", "title": "" }, { "docid": "049b972ac579ce48c23dae379f87e0ff", "score": "0.45964685", "text": "function requiredValidation(obs, message, active) {\r\n if (active == null) active = true;\r\n if (typeof active == \"boolean\") {\r\n var boolActive = active;\r\n active = function () { return boolActive; };\r\n }\r\n\r\n if (message == null) message = \"This field is required.\";\r\n if (obs == null) {\r\n console.error(\"No observable found for required message \" + message);\r\n } else {\r\n obs.extend({ validation: { required: { message: message, active: active } } });\r\n }\r\n}", "title": "" } ]
6b5e2daa74364b5b4eb457d0bdf82333
starts a async download of text from the specified url. if "isJson" is true, / the data is requested in json format. when the download is finished, either / successFunc or failFunc is called, with the param "xmlhttp". / / if this is a file on a server, the true text is returned in xmlhttp.responseText. if text is XML, / the XML document object is available in xmlhttp.responseXML.
[ { "docid": "710598477976fcd01b1ec44cc7c8c1f8", "score": "0.58508784", "text": "function httpRead(url, isJson, successFunc, failFunc, callAsync, noCache) {\n callAsync = (callAsync === undefined) ? true : callAsync;\n var xmlhttp = vp.utils.createXMLHttpRequest();\n xmlhttp.open(\"GET\", url, callAsync);\n if (isJson) {\n xmlhttp.setRequestHeader(\"accept\", \"application/json\");\n }\n if (noCache) {\n //xmlhttp.setRequestHeader(\"If-Modified-Since\", \"Sat, 1 Jan 2015 00:00:00 GMT\");\n //---- per http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers ----\n xmlhttp.setRequestHeader(\"Cache-Control\", \"no-cache, no-store, must-revalidate\"); // HTTP 1.1.\n xmlhttp.setRequestHeader(\"Pragma\", \"no-cache\"); // HTTP 1.0.\n xmlhttp.setRequestHeader(\"Expires\", \"2\"); // Proxies.\n }\n xmlhttp.onreadystatechange = function () {\n if ((xmlhttp.readyState == 4) && (xmlhttp.status != 0)) {\n if (xmlhttp.status == 200) {\n if (successFunc != null) {\n successFunc(xmlhttp);\n }\n }\n else {\n if (failFunc != null) {\n failFunc(xmlhttp);\n }\n else {\n throw \"httpRead failed: url=\" + url;\n }\n }\n }\n };\n xmlhttp.send();\n }", "title": "" } ]
[ { "docid": "253e239583b57f07d89a657c70386e66", "score": "0.60459965", "text": "function asyncHttpGet(url, success, failure) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, false);\n xhr.onload = function (/*e*/) {\n if (xhr.readyState === 4 && xhr.status === 200 && success) {\n success(xhr.responseText);\n } else if (failure)\n failure(xhr.statusText);\n };\n xhr.error = function (/*e*/) {\n if (failure)\n failure(xhr.statusText);\n };\n xhr.send(null);\n }", "title": "" }, { "docid": "b976f4ccf6204cac1fefb29887048e71", "score": "0.5848635", "text": "function httpGetAsync(theUrl, callback) {\n\t\t\tvar xmlHttp = new XMLHttpRequest();\n\t\t\txmlHttp.responseType = 'arraybuffer';\n\n\t\t\txmlHttp.onreadystatechange = function() {\n\t\t\t\t//if the XMLHttpRequest was successful run the callback function with the response\n\t\t\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n\t\t\t\t\tcallback(xmlHttp.response);\n\t\t\t\t}\n\t\t\t};\n\t\t\txmlHttp.open(\"GET\", theUrl, true);\n\t\t\t// true bedeutet, dass onreadystate in neuem thread aufgerufen wird\n\t\t\txmlHttp.send(null);\n\t\t}", "title": "" }, { "docid": "b47ed396356a1064d0439b48dd501a20", "score": "0.57482064", "text": "function httpGetAsync(theUrl, callback)\r\n{\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = function() { \r\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\r\n callback(xmlHttp.responseText);\r\n }\r\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \r\n xmlHttp.send(null);\r\n}", "title": "" }, { "docid": "baad1f0332bee1920b13837cfa348166", "score": "0.5706531", "text": "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 }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "5122d7533c48d05346bbd3be0536b250", "score": "0.5701095", "text": "function httpGetAsync(theUrl, callback){\n\n //set a new XML Http request variable\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(){\n console.log(xhr);\n if(xhr.readyState == 4 && xhr.status == 200){\n callback(xhr.responseText);\n }\n }\n xhr.open(\"GET\", theUrl, true);\n xhr.send(null);\n}", "title": "" }, { "docid": "21a32cecf1d3aeb2312171847a9c95c7", "score": "0.5695076", "text": "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 }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "c3eb565890632ab3ada179d40bdae518", "score": "0.5692035", "text": "function httpGetAsync(url, func) {\n var xmlHttp = null;\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.onload = function(e) {func(xmlHttp.responseText)};\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "85c222ecccdafbdba2fe0e167e7a6e30", "score": "0.56842077", "text": "function httpGetAsync(theUrl, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n {\n callback(xmlHttp.responseText);\n }\n }\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous \n \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "da4b413b75834bd473c8a3a5b7ec627e", "score": "0.56502914", "text": "function httpGetAsync(theUrl, callback){\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = function() {\r\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\r\n callback(JSON.parse(xmlHttp.responseText));\r\n }\r\n xmlHttp.open(\"GET\", theUrl, true); // true for asynchronous\r\n xmlHttp.send(null);\r\n}", "title": "" }, { "docid": "2bcf4d9608602b140dd28cb60b264335", "score": "0.5633915", "text": "function httpGetAsync(theUrl, callback) {\n // create the request object\n var xmlHttp = new XMLHttpRequest();\n\n // set the state change callback to capture when the response comes in\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback(xmlHttp.responseText);\n }\n }\n\n // open as a GET call, pass in the url and set async = True\n xmlHttp.open(\"GET\", theUrl, true);\n\n // call send with no params as they were passed in on the url string\n xmlHttp.send(null);\n\n return;\n}", "title": "" }, { "docid": "89ab349ad806da5b6d462f8125c6bbf0", "score": "0.561961", "text": "function HttpClientAsync(aUrl, aCallback) {\n var anHttpRequest = new XMLHttpRequest();\n anHttpRequest.onreadystatechange = function () {\n if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)\n aCallback(anHttpRequest.responseText);\n };\n\n anHttpRequest.open(\"GET\", aUrl, true);\n anHttpRequest.send(null);\n }", "title": "" }, { "docid": "580e1d1e5daf2c209d84c4983ccdaab6", "score": "0.559057", "text": "function httpGetAsync(theUrl, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n if (JSON.parse(xmlHttp.responseText).status == 'ZERO_RESULTS') {\n callback(false, JSON.parse(xmlHttp.responseText));\n } else\n callback(true, JSON.parse(xmlHttp.responseText));\n }\n xmlHttp.open(\"GET\", theUrl, false); // true for asynchronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "9a788ce75ee2d4a87a9ba03660e7f52f", "score": "0.55836326", "text": "function get(url, success, error) {\n const xhr = new XMLHttpRequest()\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n // good job - success!\n success(JSON.parse(xhr.responseText))\n } else {\n // little problem ... error!\n error(xhr)\n }\n }\n }\n\n xhr.open('GET', \"https://rawgit.com/Jonathancollinet/asynchrone-exemple/master\" + url)\n xhr.send()\n }", "title": "" }, { "docid": "2e303a58ad4eb9858c71e2b0b0d148de", "score": "0.5562027", "text": "function httpGetAsync(theUrl, parameters, callback){\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n // console.log(xmlHttp.responseText);\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"GET\", theUrl+parameters, true); // true for asynchronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "dbe93777c4152ad220375045990cc8d8", "score": "0.5561267", "text": "function fetchText(url, callback) {\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n // Success!\n callback(null, request.responseText);\n } else {\n // We reached our target server, but it returned an error\n callback(\"Loaded, but error \" + url);\n }\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n callback(\"Error loading \" + url);\n };\n\n request.send();\n }", "title": "" }, { "docid": "a2be9629c9dbff738f85b6c169dce5fe", "score": "0.5548099", "text": "function XmlHttpGET(xmlhttp, url) {\n try {\n xmlhttp.open(\"GET\", url, true);\n\n xmlhttp.send(null);\n } catch (e) {}\n}", "title": "" }, { "docid": "e5e58377a8fac15dddf618a43142ac1f", "score": "0.55467796", "text": "function returnHttpText(url)\r\n{\r\nvar req = new XMLHttpRequest();\r\nreq.open('GET', url, false);\r\nreq.send(null);\r\nif(req.status == 200)\r\nreturn req.responseText;\r\nelse\r\nreturn 1;\r\n}", "title": "" }, { "docid": "3cc105f9a6aa498e021c146da42c9b10", "score": "0.5522032", "text": "function getText(url, callback) {\n var request = new XMLHttpRequest(); // Create new request\n request.open(\"GET\", url); // Specify URL to fetch\n request.onreadystatechange = function() { // Define event listener\n // If the request is compete and was successful\n if (request.readyState === 4 && request.status === 200) {\n var type = request.getResponseHeader(\"Content-Type\");\n if (type.match(/^text/)) // Make sure response is text\n callback(request.responseText); // Pass it to callback\n }\n };\n request.send(null); // Send the request now\n}", "title": "" }, { "docid": "13e4f4863a18c4f772dac9b31860a62a", "score": "0.55200607", "text": "function httpGetAsync(url, info, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n }\n xmlHttp.open(\"POST\", url, true);\n xmlHttp.send(info);\n}", "title": "" }, { "docid": "802b2244513a492b9d5e05612a56a5ba", "score": "0.55140203", "text": "function open_async_request(method, url, responseType, cb, err) {\n var request;\n if (window.ActiveXObject !== undefined) {\n request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n request.open(method, url, false);\n request.onreadystatechange = function(e) {\n if (request.readyState == 4) {\n var text = request.responseText;\n if (ActiveXObject_responseType_funcs.hasOwnProperty(responseType)) {\n cb(ActiveXObject_responseType_funcs[responseType](text));\n }\n }\n };\n request.send();\n } else {\n request = new XMLHttpRequest();\n request.open(method, url, true);\n request.responseType = responseType;\n // Opera won't load HTML documents unless the MIME type is\n // set to text/xml\n var overriden = false;\n request.onreadystatechange = function callcb(e) {\n if (e.target.readyState == e.target.DONE) {\n if (e.target.response) {\n cb(e.target.response);\n } else if (responseType == \"document\" && !overriden) {\n request = new XMLHttpRequest();\n request.open(method, url, true);\n request.responseType = responseType;\n request.overrideMimeType(\"text/xml\");\n overriden = true;\n request.onreadystatechange = callcb;\n request.send();\n } else {\n err();\n }\n }\n };\n request.send();\n }\n}", "title": "" }, { "docid": "1c3fe4b2bbaa01053e7c6bf5eb66bad4", "score": "0.54880345", "text": "function httpGetAsync(url, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.status == 200 && xmlHttp.readyState == 4) {\n callback(JSON.parse(xmlHttp.responseText));\n }\n }\n xmlHttp.open(\"GET\", url, true); // true = asynchronous \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "01bab3468f6daaa83db5b60c1e44caf4", "score": "0.54828817", "text": "function requestText(url) {\n\t\treturn $.ajax({\n\t\t\turl: url,\n\t\t\tmethod: 'GET',\n\t\t\tdataType: 'html'\n\t\t})\n\t}", "title": "" }, { "docid": "84d2564c9a4e8d7c8ba2b2f9fa7290a0", "score": "0.5464277", "text": "function getFile(url, text)\n{\n var response = null;\n jQuery.ajax({\n url: url ,\n beforeSend:function(){\n LoadingBar_Show(text);\n },\n success:function(data) {\n LoadingBar_Hide();\n response = data;\n },\n error:function(){\n LoadingBar_Hide();\n message(\"Error\", \"There was an error in the Web-Request!\")\n },\n async:false\n });\n LoadingBar_Hide();\n return response;\n}", "title": "" }, { "docid": "9b505a732c105fa51a6b87948cd58e70", "score": "0.5457089", "text": "function send_get(url, success, error, async) {\n var future = $.ajax({\n type: \"GET\",\n url: url,\n async: async,\n contentType: 'application/json;charset=UTF-8'\n })\n future.success(success);\n future.error(error);\n\n}", "title": "" }, { "docid": "fa9929555301901590450b4cc5400fc6", "score": "0.5452525", "text": "function getTextSync(url) {\n var request = new XMLHttpRequest(); // Create new request\n request.open(\"GET\", url, false); // Pass false for synchronous\n request.send(null); // Send the request now\n\n // Throw an error if the request was not 200 OK\n if (request.status !== 200) throw new Error(request.statusText);\n\n // Throw an error if the type was wrong\n var type = request.getResponseHeader(\"Content-Type\");\n if (!type.match(/^text/))\n throw new Error(\"Expected textual response; got: \" + type);\n\n return request.responseText;\n}", "title": "" }, { "docid": "02ae2cd0f0529c9821b8ee34e29c88e3", "score": "0.540452", "text": "function getJSONSynch(url) {\r\n var resp;\r\n var xmlHttp;\r\n\r\n resp = \"\"; //does this ensure data is always a string\r\n xmlHttp = new XMLHttpRequest();\r\n\r\n if (xmlHttp !== null) {\r\n xmlHttp.open(\"GET\", url, false); //what is \"GET\"\r\n xmlHttp.send(null);\r\n resp = xmlHttp.responseText;\r\n }\r\n\r\n return resp;\r\n}", "title": "" }, { "docid": "a8e737aefaee4e69da7ea87b436aa595", "score": "0.5395067", "text": "function getFile(theURL, type, callback) {\n\n jQuery.ajax = (function (_ajax) {\n var protocol = location.protocol,\n hostname = location.hostname,\n exRegex = RegExp(protocol + '//' + hostname),\n YQL = 'http' + (/^https/.test(protocol) ? 's' : '') + '://query.yahooapis.com/v1/public/yql?callback=?',\n query = 'select * from html where url=\"{URL}\" and xpath=\"*\"';\n\n function isExternal(url) {\n return !exRegex.test(url) && /:\\/\\//.test(url);\n }\n\n return function (o) {\n var url = o.url;\n if (o.dataType == 'xml') \n query = 'select * from xml where url=\"{URL}\"';\t// XML\n if (/get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url)) {\n // Manipulate options so that JSONP-x request is made to YQL\n o.url = YQL;\n o.dataType = 'json';\n o.data = {\n q: query.replace('{URL}', url + (o.data ? (/\\?/.test(url) ? '&' : '?') + jQuery.param(o.data) : '')),\n format: 'xml'\n };\n\n // Since it's a JSONP request\n // complete === success\n if (!o.success && o.complete) {\n o.success = o.complete;\n delete o.complete;\n }\n\n o.success = (function (_success) {\n return function (data) {\n if (_success) {\n // Fake XHR callback.\n _success.call(this, {\n // YQL screws with <script>s, Get rid of them\n responseText: (data.results[0] || '').replace(/<script[^>]+?\\/>|<script(.|\\s)*?\\/script>/gi, '')\n }, 'success');\n }\n };\n })(o.success);\n }\n return _ajax.apply(this, arguments); // not special, use base Jquery ajax\n };\n })(jQuery.ajax);\n\n\n return $.ajax({\n url: theURL,\n type: 'GET',\n dataType: type,\n success: function (res) {\n // var text = res.responseText;\n // .. then you can manipulate your text as you wish\n callback ? callback(res) : undefined;\n }\n })\n }", "title": "" }, { "docid": "8df62f2eb8b8c19639861268c7159957", "score": "0.53575784", "text": "function get(url, cb) {\n var xhr = new XMLHttpRequest()\n xhr.open('GET', url, true)\n xhr.onreadystatechange = function(){\n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n cb(null, xhr.responseText)\n }\n else {\n cb(xhr.responseText)\n }\n }\n }\n xhr.send(null)\n}", "title": "" }, { "docid": "0c3e2290badbc5551037114f5c17db37", "score": "0.5344756", "text": "function _loadExtText(url, callback, returnXML) {\n// loads content from an external file on the server\n\n var req = new XMLHttpRequest();\n\n if (window.XMLHttpRequest) { // Mozilla, Safari, ...\n\treq = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // IE\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n \n if (returnXML && req.overrideMimeType) {\n req.overrideMimeType('text/xml');\n }\n\n if (req) {\n req.onreadystatechange = function() {\n if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {\n if (returnXML) {\n callback(req.responseXML);\n } else {\n callback(req.responseText);\n }\n }\n };\n req.open('GET', url);\n req.send(null);\n }\n}", "title": "" }, { "docid": "b01d65d8f11e236b3d5d3b242043b156", "score": "0.5330228", "text": "function httpGetAsync(url, callback) {\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.onreadystatechange = function() {\n\t\tif (xmlHttp.readyState == 4) {\n\t\t\tdisableLoad();\n\t\t\tif (xmlHttp.status == 200) callback(JSON.parse(xmlHttp.responseText));\n\t\t\telse callback(null);\n\t\t}\n\t}\n\txmlHttp.open(\"GET\", url, true);\n\txmlHttp.send(null);\n}", "title": "" }, { "docid": "2841abe0b7bb5182ea88d11aac19d55a", "score": "0.53196615", "text": "function httpGet(theUrl, callback) {\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", theUrl, true);\n\txmlHttp.send(null);\n\txmlHttp.onreadystatechange = function() {\n\t\tif (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n\t\t\tcallback(xmlHttp.responseText);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "7c2a0d5ce1a0987d070da30ccdf33db4", "score": "0.53051615", "text": "function httpGet(url, json_output) {\n if(typeof json_output === 'undefined') {\n json_output = true;\n }\n\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open('GET', url, false);\n xmlHttp.send();\n\n return json_output === false ? xmlHttp.responseText : JSON.parse(xmlHttp.responseText);\n}", "title": "" }, { "docid": "23464fef30e1381766db7143a56ac51d", "score": "0.5298825", "text": "function getAsync(url, callback) {\n var xmlHttpReq = new XMLHttpRequest();\n xmlHttpReq.open(\"GET\", url, true);\n xmlHttpReq.onreadystatechange = function() {\n // Status 200 and ReadyState 4 signal successful request\n if (xmlHttpReq.status == 200 && xmlHttpReq.readyState == 4)\n callback(xmlHttpReq.responseText);\n }\n xmlHttpReq.send(null);\n}", "title": "" }, { "docid": "b100c0e6d8b832d7269fa768ca1a708e", "score": "0.5297768", "text": "function Asynchronous_call(url) {\n var instance = this;\n this._xmlhttp.open('GET', url, true);\n this._xmlhttp.onreadystatechange = function() {\n switch(instance._xmlhttp.readyState) {\n case 1:\n instance.loading();\n break;\n case 2:\n instance.loaded();\n break;\n case 3:\n instance.interactive();\n break;\n case 4:\n instance.complete(instance._xmlhttp.responseText);\n break;\n }\n }\n this._xmlhttp.send(null);\n}", "title": "" }, { "docid": "1664a9d42a80a9cff30ec38323aa6a79", "score": "0.5284725", "text": "function xhrGet(url, callback) {\n const type = 'GET';\n const async = true;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n const { readyState, status } = this;\n const finished = readyState == 4 && status == 200;\n if (finished) {\n const { responseText } = this;\n callback(responseText);\n }\n };\n xhttp.open(type, url, async);\n xhttp.send();\n}", "title": "" }, { "docid": "ae870130aa380b7476b6964db6b8fff0", "score": "0.52556795", "text": "function httpGet(theUrl, theCallback)\n{\n var client = new XMLHttpRequest();\n client.onload = theCallback;\n client.open(\"GET\", theUrl);\n client.send();\n}", "title": "" }, { "docid": "fcc73bd5f5aaec341afb6bbd8032b211", "score": "0.5255564", "text": "function xmlHttp_Get(xmlhttp, url) \n{ \n xmlhttp.open('GET', url, true); \n xmlhttp.send(null); \n}", "title": "" }, { "docid": "20d2b18d113f17b0129c3addf550cdad", "score": "0.5241274", "text": "function getData(url, cb) {\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200){\n cb(JSON.parse(this.responseText)); \n }\n // Code executed if status is not 200\n else if (this.readyState == 4 && this.status != 200){ \n $(\"#data1\").html(\"Name: Luke Skywalker\" );\n $(\"#data2\").html(\"Height: 172\");\n $(\"#data3\").html(\"Mass: 77 \");\n $(\"#data4\").html(\"Hair-colour: blond\");\n } \n };\n xhr.open(\"GET\", url);\n xhr.send();\n }", "title": "" }, { "docid": "51091aa34c09dbf05359a2bd57ab7f59", "score": "0.5228345", "text": "function getHttp(url) {\n var xhr = new XMLHttpRequest(); // a new request\n xhr.open(\"GET\",url,false);\n xhr.send(null);\n return xhr.responseText;\n}", "title": "" }, { "docid": "2317fd36a5850d7fe297841b10e0cead", "score": "0.52281463", "text": "function downloadContent(url) {\n\n gXMLHttpRequest.abort();\n\n // open a synchronous request for the xml source of the module\n gXMLHttpRequest.open(\"GET\", url, false);\n\n // get the source\n gXMLHttpRequest.send(undefined);\n\n if (gXMLHttpRequest.status != 200) {\n if (gXMLHttpRequest.responseText) {\n throw new Error(\"Unable to download the render HTML content for the module. Received the following error message \" +\n \"from the server: \" + gXMLHttpRequest.responseText);\n }\n else {\n throw new Error(\"Unable to download the render HTML content for the module. The server responded with status: \" + gXMLHttpRequest.status);\n }\n }\n\n return gXMLHttpRequest.responseText;\n}", "title": "" }, { "docid": "6f586b249c26a5c6d4060a0b2b2551d7", "score": "0.5225922", "text": "function SendXmlHttpGetRequest(xmlHttp, url) \r\n{\r\n\r\n xmlHttp.open('GET', url, true); \r\n xmlHttp.send(null); \r\n}", "title": "" }, { "docid": "c33601d80d01383b6a3e4ebf33696d88", "score": "0.52133536", "text": "function loadXMLDoc(url,readyStateFunction,async) \n{\n\t// req must be defined by caller with\n\t// var req = false;\n \n\t// branch for native XMLHttpRequest object (Mozilla, Safari...)\n\tif (window.XMLHttpRequest)\n\t{\n\t\treq = new XMLHttpRequest();\n\t\t\n// if (req.overrideMimeType) {\n// req.overrideMimeType('text/xml');\n// }\n\t}\n\t// branch for IE/Windows ActiveX version\n\telse if (window.ActiveXObject)\n\t{\n try\n {\n req = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n catch (e)\n {\n try {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {}\n } \n\t}\n\n\t// If XMLHttpRequestObject req is ok, call URL\n\tif (! req)\n\t{\n \talert('Cannot create XMLHTTP instance');\n \treturn false;\n\t}\n\n\tif (readyStateFunction) req.onreadystatechange = readyStateFunction;\n\t// Exemple of function for readyStateFuncyion:\n\t// function ()\n // {\n // if ( (req.readyState == 4) && (req.status == 200) ) {\n // if (req.responseText == 1) { newStatus = 'AAA'; }\n // if (req.responseText == 0) { newStatus = 'BBB'; }\n // if (currentStatus != newStatus) {\n // if (newStatus == \"AAA\") { obj.innerHTML = 'AAA'; }\n // else { obj.innerHTML = 'BBB'; }\n // currentStatus = newStatus;\n // }\n // }\n // }\n\treq.open(\"GET\", url, async);\n\treq.send(null);\n\treturn req;\n}", "title": "" }, { "docid": "0e61d29aa74bfa93072b84fce3080ccd", "score": "0.5203119", "text": "function httpGet(url,callback) {\n\tvar http = new XMLHttpRequest();\n\thttp.open(\"GET\",url,true);\n\thttp.onreadystatechange = function() {\n\t\tif(http.readyState == 4 && http.status == 200) {\n\t\t\tcallback(null,http.responseText);\n\t\t}\n\t};\n\thttp.send();\n}", "title": "" }, { "docid": "adec810b01fb32a5bc08255f1e16915a", "score": "0.5198551", "text": "function _async_xhrRequest_withCallback(theURL, theCallbackFcn){\n\t\t\tconsole.log('[ network_module.js ] : ' + 'creating _async_xhrRequest ..');\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t//DEBUG\n\t\t\tconsole.log('[ network_module.js ] : ' + 'using URL: ' + theURL);\n\t\t\txhr.open(\"GET\",\n\t\t\t\t\t theURL,\n\t\t\t\t\t true);//false); // now it should be synchronous\n\t\t\t//xhr.setRequestHeader('Content-Type', 'text/xml');\n\t\t\t//xhr.overrideMimeType('text/xml');\n \t\txhr.onreadystatechange = function () {\n \t\tif (xhr.status == 200 && xhr.readyState == 4) {\n\t\t\t\t\tif(xhr.responseText){\n\t\t\t\t\t\tconsole.log('[ network_module.js ] : ' + 'responseText received: ' + xhr.responseText);\n\t\t\t\t\t\treturn xhr.responseText; // return the 'xhr.responseText'\n\t\t\t\t\t}\n\t\t\t\t// future callback Fcn here (caming from anothe Fcn ;p )\n\t\t\t\ttheCallbackFcn(); // execute the 'callbac Fcn' passed as 2nd parameter\n\t\t\t\t//MyApp.Links.setup_history_clicks(); // in case we have to re-add event listeners to freshly loaded content (> ex: if it contain links)\n\t\t\t\treturn true;\n \t\t}\n \t\t};\n\t\t\txhr.send(null);\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "50ab8bebc89e83a40289eaada7a19344", "score": "0.51697016", "text": "function getText(url)\n\t{\n\t\treturn $.ajax(\n\t\t{\n\t\t\ttype: \"GET\",\n\t\t\turl: url,\n\t\t\tcontentType: \"text/plain\",\n\t\t\tprocessData: false\n\t\t});\n\t}", "title": "" }, { "docid": "495942ecea80753424fecf17242b007d", "score": "0.51553524", "text": "function openJson(url, callbackFunc) {\n // initiate a new XMLHttp request\n var xmlhttp = new XMLHttpRequest();\n\n // function to perform upon request completion\n xmlhttp.onreadystatechange = function () {\n // check for completion and ok status\n if (this.readyState == 4 && this.status == 200) {\n // initiate callback function\n callbackFunc(this);\n }\n }\n // create the request specifics\n xmlhttp.open(\"GET\", url, true);\n\n // send the request to the server\n xmlhttp.send();\n}", "title": "" }, { "docid": "82f48af7ac070b8b2a5bfe650f21f04e", "score": "0.51552117", "text": "function httpRequest(url, nextFunction) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(error, data) {\n if (xhr.readyState == 4 && xhr.status == 400) {\n nextFunction(error);\n } else if (xhr.readyState == 4 && xhr.status == 200) {\n data = JSON.parse(xhr.responseText);\n nextFunction(null, data);\n }\n }\n xhr.open('GET', url, true);\n xhr.send();\n }", "title": "" }, { "docid": "a749548f9586f4cda7cf89876c6ccda4", "score": "0.5150791", "text": "function httpRequest(url) {\n var client = new XMLHttpRequest();\n client.onreadystatechange = function() {\n if (client.readyState === 4) {\n ++linkCounter;\n if(linkCounterLocal === linkCounter) {\n afterLink();\n }\n else {\n content += client.responseText;\n }\n }\n };\n client.open(\"GET\", url);\n client.send();\n }", "title": "" }, { "docid": "400fae7df913fc78159df47e1a191b07", "score": "0.5116815", "text": "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "400fae7df913fc78159df47e1a191b07", "score": "0.5116815", "text": "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "f7cbd9a6a4062a06fcc8b612e4b531de", "score": "0.5112386", "text": "function request(cb, url) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) { // Request is completed\n if (xhr.status === 200) { // Request succeeded\n var responseObj = JSON.parse(xhr.responseText); // ok?\n cb(null, responseObj);\n } else { // Error in request\n var errorMessage = xhr.responseText;\n cb(\"Error \" + url + \" \" + errorMessage);\n }\n }\n };\n xhr.open(\"GET\", url, true);\n xhr.send();\n}", "title": "" }, { "docid": "57c5c0d5fa4379de3b4aebb779c50312", "score": "0.50915444", "text": "function requestAsyncContent(url, contentTag) {\n // construct request\n var request;\n if (window.XMLHttpRequest) { // firefox, mozilla, IE7\n request = new XMLHttpRequest();\n } else if (window.ActiveXObject) { // IE6 or before\n request = new ActiveXObject(\"Microsoft.XMLHTTP\"); // jshint ignore:line\n } else {\n return null;\n }\n \n request.open(\"GET\", url, true);\n \n // construct callback wrapper\n function callbackWrapper() {\n if (request.readyState == 4) {\n receiveAsyncContent(request, contentTag);\n }\n }\n request.onreadystatechange = callbackWrapper;\n \n request.send(null);\n }", "title": "" }, { "docid": "d7b36c279f92b54da90f99c882e5c450", "score": "0.5079139", "text": "function xhrLogic(url, line, locObj, max, isFile, callback) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", url, true); // false for asynchronous\r\n var data;\r\n\r\n xhr.onload = function(e) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 200) {\r\n // use the below for more info in output file\r\n // data = xhr.responseText\r\n data = JSONParse(xhr.responseText);\r\n if (isFile) {\r\n callback(line, data, locObj, max);\r\n } else {\r\n var h = document.createElement(\"H1\");\r\n var t = document.createTextNode(xhr.responseText);\r\n // use the below for sparse output in html\r\n // var t = document.createTextNode(data);\r\n h.appendChild(t);\r\n document.body.appendChild(h);\r\n }\r\n } else {\r\n console.error(xhr.statusText);\r\n }\r\n }\r\n };\r\n xhr.onerror = function(e) {\r\n console.error(xhr.statusText);\r\n };\r\n xhr.send(null);\r\n}", "title": "" }, { "docid": "2ae0f6d266ecbe6b76299ded58ac7ab9", "score": "0.50786227", "text": "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false); // false for synchronous request\n xmlHttp.send(null);\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "a248a6b2cbd6751ba763e2311d684abd", "score": "0.50694674", "text": "async function retrieveText(url) {\n return new Promise((resolve, reject) => {\n request.get(url)\n .set('Accept', 'text/plain')\n .end((err, res) => {\n err ? reject(err) : resolve(res.text)\n })\n })\n}", "title": "" }, { "docid": "e12aa1f8df50a01e7469755d475e4b53", "score": "0.50600505", "text": "function httpGetAsync(url, callback_success, callback_error) {\n\t$.ajax({\n\t\turl: url,\n\t\ttype: \"POST\",\n\t\tcontentType: \"application/json; charset=utf-8\",\n\t\tdataType: 'json',\n\t\tsuccess: callback_success,\n\t\terror: callback_error\n\t});\n}", "title": "" }, { "docid": "1b4317cb7e25b14a4210a6720d84d2d1", "score": "0.5057328", "text": "function downloadPage(url)\n{\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", url, true);\n\txmlHttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\txmlHttp.setRequestHeader(\"Connection\", \"close\");\n\t\n\txmlHttp.onreadystatechange = function() \n\t{\n\t\tif(xmlHttp.readyState == 4 && xmlHttp.status == 200) \n\t\t{\n\t\t\teval(\"(\" + xmlHttp.responseText + \")\");\n\t\t}\n\t}\n\t\n\txmlHttp.send();\n}", "title": "" }, { "docid": "aab4c8a87d9a45d262a32549dcca26ec", "score": "0.5053086", "text": "function getJSON(theUrl, xstate, callback) {\n var xmlHttp = null;\n if (window.XMLHttpRequest) {\n xmlHttp = new XMLHttpRequest();\n } else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlHttp.open(\"GET\", theUrl, true);\n xmlHttp.send(null);\n xmlHttp.onreadystatechange = function(state) {\n if (xmlHttp.readyState == 4 && xmlHttp.status && xmlHttp.status >= 200) {\n if (callback) {\n window.setTimeout(callback, 0.01, xmlHttp.status, (xmlHttp.responseText && xmlHttp.responseText.length > 1) ? JSON.parse(xmlHttp.responseText) : null, xstate);\n }\n }\n }\n}", "title": "" }, { "docid": "793380b81db69ce8b5f0efaaf8152a9c", "score": "0.504687", "text": "function getJSON(url, onComplete) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"get\", url, true);\n\txhr.responseType = \"json\";\n\txhr.onload = function() {\n\t\tonComplete(xhr.response);\n\t}\n\txhr.send();\n}", "title": "" }, { "docid": "eb0dd90ce3b3360b080be6746e48d8cd", "score": "0.5040988", "text": "function httpGet(url, callback, callbackFail) {\n var http = new XMLHttpRequest();\n\n http.open(\"GET\", url, true);\n\n http.onreadystatechange = function () {\n if (http.readyState === 4) {\n switch (http.status) {\n case 0:\n case 200:\n callback(new Uint8Array(http.response));\n break;\n default:\n if (callbackFail) {\n callbackFail(http.status);\n }\n }\n }\n };\n\n http.responseType = \"arraybuffer\";\n http.send();\n }", "title": "" }, { "docid": "e8b4f119b60b97bea0f140d4a15a4430", "score": "0.50390697", "text": "function httpGet(theUrl) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", theUrl, false); // false for synchronous request\n xmlHttp.send(null);\n return xmlHttp.responseText;\n }", "title": "" }, { "docid": "60399e77b8b0756722f492022e37d667", "score": "0.5026117", "text": "function load ( url, readyCallback, progressCallback ) {\n var length = 0;\n\n\t\tif ( document.implementation && document.implementation.createDocument ) {\n require([\"text!\"+url], function(responseText){\n var $responseXML = $(responseText);\n readyCallbackFunc = readyCallback;\n parse( $responseXML, readyCallback, url );\n });\n\n\t\t} else {\n\t\t\talert( \"Don't know how to parse XML!\" );\n\t\t}\n\t}", "title": "" }, { "docid": "c1afdb8fe90804ef97568a7feffaf8b6", "score": "0.5026035", "text": "function download(url, callback) {\n http.get(url, function(res) {\n var data = \"\";\n res.on('data', function (chunk) {\n data += chunk;\n });\n res.on(\"end\", function() {\n callback(data);\n });\n }).on(\"error\", function() {\n callback(null);\n });\n}", "title": "" }, { "docid": "6c24e153c5f6f73798c866df26d0bab5", "score": "0.5023747", "text": "function download(url, callback) {\n http.get(url, function(res) {\n var data = \"\";\n res.on('data', function (chunk) {\n data += chunk;\n });\n res.on(\"end\", function() {\n callback(data);\n });\n }).on(\"error\", function(e) {\n\t\tconsole.log(\"Got error: \" + e.message);\n\t\tcallback(null);\n });\n}", "title": "" }, { "docid": "6a4e15168fee29a11ae7a6e81aaf0207", "score": "0.5018567", "text": "function httpGet(theUrl)\n {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.send( null );\n return xmlHttp.responseText;\n }", "title": "" }, { "docid": "285aff216422901783da39b6044dbac0", "score": "0.5009135", "text": "function httpGet(theUrl)\n{\n if (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\n else\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function()\n {\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n {\n return xmlhttp.responseText;\n }\n }\n xmlhttp.open(\"GET\", theUrl, false );\n xmlhttp.send();\n\treturn xmlhttp.responseText; \n}", "title": "" }, { "docid": "523e0220bd60f6a909ad125a6190d1cb", "score": "0.5008542", "text": "function ajax(url, callback) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {callback(xhr.responseText);}\n };\n xhr.open(\"GET\", url, true);\n xhr.send();\n}", "title": "" }, { "docid": "010176f9c53be9146bb1391e7197f0db", "score": "0.500821", "text": "function getData(url,callback) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.send();\n//and then you wait until readyState is 4 and status is 200\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n console.dir(JSON.parse(this.responseText));//allow console view the object directory\n console.log(JSON.parse(this.responseText));//allow console view of the output of grabbing the object behind that url\n callback(JSON.parse(this.responseText));// note that \"callback\" can be call anything you like as long as similar to the argument in this function. This is a technique to allow in invoker -writeToDocument- to call it as an anonymous funtion to return \"data\" as an output of JSON.parse method used here.\n }\n };\n}", "title": "" }, { "docid": "ababc4e3e24040435ae28eba4fa3f997", "score": "0.50019014", "text": "function getJSON(url, callback) {\n let xhr = new XMLHttpRequest();\n xhr.onload = function () { \n callback(this.responseText) \n };\n xhr.open('GET', url, true);\n xhr.send();\n}", "title": "" }, { "docid": "ababc4e3e24040435ae28eba4fa3f997", "score": "0.50019014", "text": "function getJSON(url, callback) {\n let xhr = new XMLHttpRequest();\n xhr.onload = function () { \n callback(this.responseText) \n };\n xhr.open('GET', url, true);\n xhr.send();\n}", "title": "" }, { "docid": "f3cd485a819fd0efac86a933260d5f89", "score": "0.50015765", "text": "function downloadUrl(url, dataSent, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest;\n\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n //request.overrideMimeType('application/xml');\n request.open('POST', url, true);\n request.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n request.send(dataSent);\n}", "title": "" }, { "docid": "0cfa36c67e840e9952a13a2cfd760e27", "score": "0.49919975", "text": "function download(url, callback) {\n\tconsole.log('http request: ' + url);\n\n\trequest(\n\t\turl,\n\t\tfunction (err, res, body) {\n\t\tif (err) {\n\t\t\tconsole.log('err code: ' + err.code);\n\t\t\tconsole.log('err msg: ' + err.message);\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\tcallback(body);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "387fd232d26d1aa453959312ece90b6d", "score": "0.499192", "text": "function makeXMLHttpRequest(url, isAsync, callbackFunc, postData){\n var objXMLHttp = getXMLHttp();\n if (objXMLHttp != null){\n\t\tif(postData == undefined) postData = null;\n objXMLHttp.open((postData != null ? \"POST\" : \"GET\"), url, isAsync);\n if(isAsync){\n // Register a callback for the call\n if(callbackFunc != null){\n objXMLHttp.onreadystatechange = function (){\n\t\t\t if (objXMLHttp.readyState == 4 && objXMLHttp.status == 200)\n\t\t\t\t callbackFunc(objXMLHttp);\n\t\t\t\t\t\t };\n\t\t\t}\n }\n\n\t\tif(postData != null) objXMLHttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\t\t\t \n \n\t\tobjXMLHttp.send(postData);\n \n if(!isAsync && callbackFunc != null) callbackFunc(objXMLHttp);\t\t\n }\n}", "title": "" }, { "docid": "ab15779becf3ebb81d99a7877ae78412", "score": "0.49900132", "text": "function httpGet(theUrl)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, false ); // false for synchronous request\n xmlHttp.setRequestHeader(\"accept\", \"application/json; odata=verbose\");\n xmlHttp.send( null );\n return xmlHttp.responseText;\n}", "title": "" }, { "docid": "89e0dd108cd129d81c70c8387194b88a", "score": "0.4986585", "text": "function makeRequest(url) {\n http_request = false;\n if (window.XMLHttpRequest) { // Mozilla, Safari,...\n http_request = new XMLHttpRequest();\n if (http_request.overrideMimeType) {\n http_request.overrideMimeType('text/plain');\n }\n } else if (window.ActiveXObject) { // IE\n try {\n http_request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {}\n }\n }\n if (!http_request) {\n alert('Falla :( No es posible crear una instancia XMLHTTP');\n return false;\n }\n http_request.onreadystatechange = alertContents;\n http_request.open('GET', url, true);\n http_request.send(null);\n}", "title": "" }, { "docid": "55b6c80ceac9df236cb45174c18917c5", "score": "0.49824932", "text": "function get (URL, callback){\n\nconst xhr = new XMLHttpRequest();\n\nxhr.onreadystatechange = function (){\n const DONE = 4\n const OK = 200\n if (this.readyState === DONE){\n if(this.status === OK ){\n callback(null,JSON.parse(this.responseText)) //todo ok\n }else{\n callback(new Error(`Se produjo un error al revisar el request ${this.status}`))\n //hubo error\n }\n }\n}\n\nxhr.open('GET',URL);\nxhr.send(null);\n}", "title": "" }, { "docid": "e575a47fa55f1fa0125058e401b7da1d", "score": "0.49820378", "text": "function download_page(method, url, callback)\n{\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() \n {\n if(request.readyState == 4 && request.status == 200)\n {\n callback(request.responseText);\n }\n \n return;\n };\n \n request.open(method, url, true);\n request.send();\n \n return;\n}", "title": "" }, { "docid": "b2ba3dcc0ba9f28ee87bd7f9b7ee3133", "score": "0.4950534", "text": "function sendHTTP(text, func) {\n if (!text) {\n return;\n }\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", text, true);\n xhttp.onload = function () {\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n func(this.responseText);\n } else {\n window.setTimeout(alert, 1000);\n }\n };\n xhttp.send();\n}", "title": "" }, { "docid": "a9f258e8a20e03d5914c425e0b861e05", "score": "0.49495858", "text": "function makeRequest(url){\t\t\t\n\thttpRequest = new XMLHttpRequest();\t//creating instance of the class XMLHttpRequest\n\n\tif (!httpRequest) {\t\t\t\t\t\n\t\talert(\"Cannot create XMLHttp instance\"); //error message in case the request fails\n\t\treturn false\n\t}\n\n\thttpRequest.onreadystatechange = alertContents;\t//alertContents will be invoked once a response is recieved\n\thttpRequest.open('GET', url, true); // 1st param is the request method ('GET'), 2nd param is the url of the file I am getting data from, 3rd param states whether the request will be synchronous or asychronous, true for asych and false for sych (asych is almost always better)\n\thttpRequest.send()\n}", "title": "" }, { "docid": "da5b005e40ed0decd4a652d6868330e3", "score": "0.49456137", "text": "function getAjax(url, successFunc, errorFunc) {\n if (!url) return Error('no url specified to getAjax')\n\n successFunc = successFunc || function() { console.info('Success') }\n errorFunc = errorFunc || function() { console.error('Error') }\n\n var req = new XMLHttpRequest()\n req.open('GET', url, true)\n\n req.timeout = 15000 // 15sec timeout\n\n req.onreadystatechange = function() {\n if (this.readyState === 4) {\n if (this.status >= 200 && this.status < 400) {\n var response = this.responseText\n successFunc(response)\n }\n else {\n errorFunc()\n }\n }\n }\n\n req.send();\n }", "title": "" }, { "docid": "636e069b51841bc9fdc9d2810246d134", "score": "0.49414694", "text": "function getAjaxData(urlstr, callback_func, options) {\r\n var myurl = AJAX_HEADER + urlstr + AJAX_TAIL;\r\n var isAsync = true;\r\n var nTimeout = AJAX_TIMEOUT;\r\n var errorCallback = null;\r\n\r\n if (options) {\r\n if (options.sync) {\r\n isAsync = (options.sync == true) ? false : true;\r\n }\r\n if (options.timeout) {\r\n nTimeout = parseInt(options.timeout, 10);\r\n if (isNaN(nTimeout)) {\r\n nTimeout = AJAX_TIMEOUT;\r\n }\r\n\r\n }\r\n errorCallback = options.errorCB;\r\n }\r\n\r\n $.ajax({\r\n async: isAsync,\r\n //cache: false,\r\n type: 'GET',\r\n timeout: nTimeout,\r\n url: myurl,\r\n //dataType: ($.browser.msie) ? \"text\" : \"xml\",\r\n error: function(XMLHttpRequest, textStatus) {\r\n try {\r\n if (jQuery.isFunction(errorCallback)) {\r\n errorCallback(XMLHttpRequest, textStatus);\r\n }\r\n log.error('MAIN : getAjaxData(' + myurl + ') error.');\r\n log.error('MAIN : XMLHttpRequest.readyState = ' + XMLHttpRequest.readyState);\r\n log.error('MAIN : XMLHttpRequest.status = ' + XMLHttpRequest.status);\r\n log.error('MAIN : textStatus ' + textStatus);\r\n }\r\n catch (exception) {\r\n log.error(exception);\r\n }\r\n },\r\n success: function(data) {\r\n log.debug('MAIN : getAjaxData(' + myurl + ') sucess.');\r\n log.trace(data);\r\n var xml;\r\n if (typeof data == 'string' || typeof data == 'number') {\r\n if((-1 != this.url.indexOf('/api/ussd/get') )&&( -1 != data.indexOf(\"content\"))){\r\n data = smsContentDeleteWrongChar(data); \r\n }\r\n if (!window.ActiveXObject) {\r\n var parser = new DOMParser();\r\n xml = parser.parseFromString(data, 'text/xml');\r\n }\r\n else {\r\n //IE\r\n xml = new ActiveXObject('Microsoft.XMLDOM');\r\n xml.async = false;\r\n xml.loadXML(data);\r\n }\r\n }\r\n else {\r\n xml = data;\r\n }\r\n if (typeof callback_func == 'function') {\r\n callback_func($(xml));\r\n }\r\n else {\r\n log.error('callback_func is undefined or not a function');\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "b6144c41519817be456965a731c091cc", "score": "0.4938842", "text": "function getJson (url, successHandler) {\n\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n request.onreadystatechange = function (event) {\n\n /*console.log(\"event: \" + event +\n \" readyState: \" + request.readyState +\n \" status: \" + request.status);*/\n if (4 == request.readyState) {\n if (200 == request.status) {\n\n if (request.responseText) {\n\n successHandler(JSON.parse(request.responseText));\n }\n } else {\n\n message(\"Please check the parameters or try later\")\n }\n }\n };\n\n request.send(null);\n}", "title": "" }, { "docid": "de73b5f7fa141820352db9ae74ff06aa", "score": "0.49361655", "text": "function ajaxGet(url, cbFunction) { \n var req; \n if (window.XMLHttpRequest) { \n req = new XMLHttpRequest();\n } else { \n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n req.onreadystatechange = function () { \n if (this.readyState == 4 &&\n this.status == 200) {\n cbFunction(this); \n }\n };\n req.open(\"GET\", url, true); \n req.send(); \n}", "title": "" }, { "docid": "d950a88cd21db89a453238081cde6e41", "score": "0.49331674", "text": "function httpGet(theUrl)\r\n{\r\n\tvar xmlHttp = null;\r\n\r\n\txmlHttp = new XMLHttpRequest();\r\n\txmlHttp.open( \"GET\", theUrl, false );\r\n\txmlHttp.send( null );\r\n\treturn xmlHttp.responseText;\r\n}", "title": "" }, { "docid": "b9debf214db7ec2a98101c7e00e4cbd7", "score": "0.49311164", "text": "function getDataFromCloudWithId(getTheUrl){\n\n var xhr = new XMLHttpRequest\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n abStack.jsonABData = JSON.parse(xhr.responseText)\n outputJSONData()\n }\n }\n xhr.open(\"GET\", Qt.resolvedUrl(getTheUrl))\n xhr.send()\n console.log(\"function getDataFromCloudWithId finished\")\n}", "title": "" }, { "docid": "02c1068ba49e832785a3f9197ae88c8f", "score": "0.49246463", "text": "function asyncGetFile(url) {\n //Your code here\n console.log(\"Getting text file\");\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n console.log(\"Made promise\");\n });\n}", "title": "" }, { "docid": "6fda91d472975be49901e7d8f3782a7a", "score": "0.49241266", "text": "function download(url)\n {\n var dowReq = new XMLHttpRequest();\n dowReq.open(\"GET\",url,true);\n dowReq.responseType=\"arraybuffer\";\n\n //call back for what to do once the file has been loaded\n dowReq.onload =function(){\n var dowBuffer = dowReq.response;\n\n if(dowBuffer)\n {\n var downloadedBlob = new Blob([dowBuffer]);\n //TODO actually save the file to disk\n }\n }\n\n //callback to update progressMap which in turn is used to update progressbar\n dowReq.onprogress = function(evt)\n {\n console.log(\"Download progress\");\n if(evt.lengthComputable)\n {\n //var fractionComplete=evt.loaded/evt.total;\n progressMap[downloadID]=evt.loaded;\n\n }\n }\n\n //Start the download AJAX request\n dowReq.send();\n }", "title": "" }, { "docid": "76fa1eac1210c067dd4d785803f7bbcb", "score": "0.49239257", "text": "function get_text_resource(url, callback_func)\n{\n fetch(url).then(resp => resp.text()).then(data => callback_func(data));\n}", "title": "" }, { "docid": "ecf6f82a75f17e0f3acc69c323a86242", "score": "0.49200183", "text": "function readFile(url, onLoad, onProgress, onError) {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function() {\n if (request.readyState === XMLHttpRequest.DONE) {\n // TODO: Re-visit https://bugreports.qt.io/browse/QTBUG-45581 is solved in Qt\n if (request.status == 200 || request.status == 0) {\n// var response;\n// TODO: Remove once https://bugreports.qt.io/browse/QTBUG-45862 is fixed in Qt\n// response = request.responseText;\n\n console.time('Process file: \"' + url + '\"');\n onLoad( request.responseText );\n console.timeEnd('Process file: \"' + url + '\"');\n\n }\n// else if ( onError !== undefined ) {\n// onError();\n// }\n }\n// else if (request.readyState === XMLHttpRequest.HEADERS_RECEIVED) {\n// if ( onProgress !== undefined ) {\n// onProgress();\n// }\n// }\n };\n\n request.open( 'GET', url, true );\n request.send( null );\n}", "title": "" }, { "docid": "3784f09a46329e62281c968de651534b", "score": "0.49080643", "text": "function getData(url, cb){\n\n\tlogger.info(\"Extracting data from: \" + url);\n\tlogger.profile(\"311 Extract JSON Data\");\n\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", url, true);\n\txhr.onload = function(err) {\n\t\tlogger.profile(\"311 Extract JSON Data\");\n\t\tvar buffer = xhr.responseText;\n\t\tvar json = JSON.parse(buffer);\n\t\tlogger.info(\"data\");\n\t\tcb(json);\n\t}\n\txhr.onerror = function(err) {\n\t\tlogger.error(\"ERROR: FAILED TO EXTRACT DATA FROM \" + url);\n\t\tlogger.profile(\"311 Extract JSON Data\");\n\t\treturn err;\n\t}\n\txhr.onreadystatechange = function(){\n\t\tswitch(xhr.readyState){\n\t\t\tcase 1:\n\t\t\t\tlogger.info(\"server connection established\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tlogger.info(\"request received \");\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tlogger.info(\"processing request \");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tlogger.info(\"request finished and response is ready\");\n\t\t\t\tbreak;\n\t\t}\n\t}\n\txhr.send();\n}", "title": "" }, { "docid": "033bc36cfed6ccb4820e92338d613c1e", "score": "0.49048385", "text": "function getHTTPObject(url, callback) {\n\tvar request = false;\n\tif(window.XMLHttpRequest) {\n\t\tvar request = new XMLHttpRequest();\n\t} else if(window.ActiveXObject) {\n\t\ttry {\n\t\t\tvar request = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t\t} catch(e) {\n\t\t\ttry {\n\t\t\t\tvar request = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} catch(e) {\n\t\t\t\trequest = false;\n\t\t\t}\n\t\t}\n\t};\n\tif (request) {\n\t\trequest.open('GET', url, true);\n\t\trequest.send(null);\n\t\trequest.onreadystatechange = function() {\n\t\t\tif (request.readyState != 4) return false;\n\t\t\tif (request.status == 200 || request.status == 304) {\n\t\t\t\tcallback(request.responseText)\n\t\t\t}\n\t\t}\n\t};\n}", "title": "" }, { "docid": "ab64b74e2fa2ecd460e80b85b3b18746", "score": "0.49025586", "text": "function httpGetAsyncObj(theUrl, callback, callbackObj) {\n var xmlHttp = new XMLHttpRequest();\n\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n callback.apply(callbackObj, [xmlHttp.responseText, true]);\n } else if (xmlHttp.readyState === 4) {\n // when server doesn't respond in time or there is an error\n callback.apply(callbackObj, [undefined, false]);\n }\n }\n\n xmlHttp.open(\"GET\", theUrl, true); // true for asyncronous\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "36728bbb187ad053af5424ef6426b4fa", "score": "0.49012762", "text": "function httpGetAsync(theUrl, callback)\n{\n this.callback=callback;\n var self =this;\n $.getJSON(theUrl,\n function(json) {\n self.callback(json);\n })\n .fail(function(){displaySearchError();});\n}", "title": "" }, { "docid": "6faf0b55946d91332dfe4752e995e2a9", "score": "0.49004716", "text": "function GetAsyncJSONArray(urls, finalCallback) {\r\n var obj = document.getElementById('progress');\r\n if (fetchCount == 0 ) {\r\n fetchCount = urls.length;\r\n }\r\n\r\n if (urls.length > 0) {\r\n var a = urls.shift();\r\n var URL = a[0];\r\n var desc = a[1];\r\n var cb = a[2];\r\n var xmlHttp = null;\r\n if (window.XMLHttpRequest) {\r\n xmlHttp = new XMLHttpRequest();\r\n } else {\r\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n\r\n if (obj) { obj.innerHTML = \"loading file #\" + ( fetchCount - urls.length ) + \" / \" + fetchCount + \"<br>\" + desc }\r\n\r\n xmlHttp.open(\"GET\", URL, true);\r\n xmlHttp.onreadystatechange = function(state) {\r\n if (xmlHttp.readyState == 4) {\r\n if (cb) {\r\n if (xmlHttp.status == 200) {\r\n cb(JSON.parse(xmlHttp.responseText));\r\n } else {\r\n urlErrors.push(URL)\r\n cb({});\r\n }\r\n }\r\n GetAsyncJSONArray(urls, finalCallback);\r\n }\r\n }\r\n xmlHttp.send(null);\r\n }\r\n else {\r\n if (obj) { obj.innerHTML = \"building page content...\" }\r\n finalCallback();\r\n }\r\n}", "title": "" }, { "docid": "38d747bb58a8feafdaed1d1421d5f682", "score": "0.48984233", "text": "function asyncGetFile(url) {\r\n //Your code here\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", url);\r\n xhr.responseType = \"text\";\r\n xhr.onload = () => resolve(xhr.responseText);\r\n xhr.onerror = () => reject(xhr.statusText);\r\n xhr.send();\r\n console.log(\"Made Promise\");\r\n });\r\n}", "title": "" }, { "docid": "b9dd7f3829a5d905226af03a97d3dd7e", "score": "0.48959944", "text": "function SendRequest( url ) \n{\n\n HTTP_REQUEST.open(\"GET\", url, true); \n HTTP_REQUEST.send(null); \n \n app.ShowProgress( \"Loading...\" ); \n}", "title": "" }, { "docid": "f3babd7bea0bd78cd13e77c90667b6b9", "score": "0.48929802", "text": "function loadTextFileAjaxAsync(filePath, mimeType, callback, errorCallback) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", filePath, false);\n if (mimeType != null) {\n if (xmlhttp.overrideMimeType) {\n xmlhttp.overrideMimeType(mimeType);\n }\n }\n\n xmlhttp.addEventListener('load', function(e) {\n if(xmlhttp.status === 404) {\n //xmlhttp.abort();\n errorCallback();\n } else {\n callback(xmlhttp.responseText);\n }\n });\n\n try {\n xmlhttp.send();\n } catch(e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "6da877a4b10473138d28ff44b9cab312", "score": "0.48879117", "text": "function downloadUrl(url, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest;\n\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n\n request.open('GET', \"/test.xml\", true);\n request.send(null);\n console.log(request)\n}", "title": "" }, { "docid": "69cf5654a9249e563cf2f87d41ebec0b", "score": "0.4881413", "text": "function downloadRequest(url, end) {\n const filepath = url.split('/').reverse()[0];\n const filenamehtml = `${filepath}.html`;\n const tmpfile = `_${filepath}`;\n let result;\n let contentType;\n if (fs.existsSync(filepath)) {\n end(filepath, undefined, url);\n return;\n }\n\n if (fs.existsSync(filenamehtml)) {\n end(filenamehtml, undefined, url);\n return;\n }\n progress(request(url))\n .on('progress', (state) => {\n const { percent, speed } = state;\n result = state;\n console.log(url, `${(percent * 100).toFixed(2)}%`, `${(speed / 1000).toFixed(2)}K`);\n })\n .on('response', (a) => {\n contentType = a.headers['content-type'];\n console.log(contentType, url);\n })\n .on('error', (err) => {\n console.log(err);\n end(result, err, url);\n })\n .on('end', () => {\n let filename = filepath;\n if (contentType) {\n if (contentType != 'application/zip') {\n filename = filenamehtml;\n }\n }\n fs.renameSync(tmpfile, filename);\n end(filename, undefined, url);\n })\n .pipe(fs.createWriteStream(tmpfile));\n}", "title": "" }, { "docid": "6988470fbca7edfa274ac4fb0fc65110", "score": "0.48800397", "text": "function xhrRequest(url, type, state, callback) {\n var xhr = new XMLHttpRequest();\n xhr.onload = function () {\n callback(this.responseText, state);\n };\n xhr.open(type, url);\n xhr.send();\n}", "title": "" } ]
cf272e4d55d54314a48f218a5144c412
Helper to wrap a job execution between two notifications.
[ { "docid": "406307846ccdbe942e05bf9bc2105797", "score": "0.6799653", "text": "async function notificationWrap(job, note) {\n await note.run();\n try {\n let res = await job.run();\n const logs = await job.logs();\n note.conclusion = \"success\";\n note.summary = `Task \"${job.name}\" passed`;\n note.text = \"```\" + res.toString() + \"```\\nComplete\";\n return await note.run();\n } catch (e) {\n const logs = await job.logs();\n note.conclusion = \"failure\";\n note.summary = `Task \"${job.name}\" failed for ${e.buildID}`;\n note.text = \"```\" + logs + \"```\\nFailed with error: \" + e.toString();\n try {\n await note.run();\n } catch (e2) {\n console.error(\"failed to send notification: \" + e2.toString());\n console.error(\"original error: \" + e.toString());\n }\n throw e;\n }\n}", "title": "" } ]
[ { "docid": "9aa4a7b263dc128ad449ee7bf9f18369", "score": "0.6721877", "text": "async function notificationWrap(job, note, conclusion) {\n if (conclusion == null) {\n conclusion = \"success\"\n }\n await note.run();\n try {\n let res = await job.run()\n const logs = await job.logs();\n\n note.conclusion = conclusion;\n note.summary = `Task \"${job.name}\" passed`;\n note.text = note.text = \"```\" + res.toString() + \"```\\nTest Complete\";\n return await note.run();\n } catch (e) {\n const logs = await job.logs();\n note.conclusion = \"failure\";\n note.summary = `Task \"${job.name}\" failed for ${e.buildID}`;\n note.text = \"```\" + logs + \"```\\nFailed with error: \" + e.toString();\n try {\n return await note.run();\n } catch (e2) {\n console.error(\"failed to send notification: \" + e2.toString());\n console.error(\"original error: \" + e.toString());\n return e2;\n }\n }\n}", "title": "" }, { "docid": "9aa4a7b263dc128ad449ee7bf9f18369", "score": "0.6721877", "text": "async function notificationWrap(job, note, conclusion) {\n if (conclusion == null) {\n conclusion = \"success\"\n }\n await note.run();\n try {\n let res = await job.run()\n const logs = await job.logs();\n\n note.conclusion = conclusion;\n note.summary = `Task \"${job.name}\" passed`;\n note.text = note.text = \"```\" + res.toString() + \"```\\nTest Complete\";\n return await note.run();\n } catch (e) {\n const logs = await job.logs();\n note.conclusion = \"failure\";\n note.summary = `Task \"${job.name}\" failed for ${e.buildID}`;\n note.text = \"```\" + logs + \"```\\nFailed with error: \" + e.toString();\n try {\n return await note.run();\n } catch (e2) {\n console.error(\"failed to send notification: \" + e2.toString());\n console.error(\"original error: \" + e.toString());\n return e2;\n }\n }\n}", "title": "" }, { "docid": "fb0f315e59366b72525c868bef0b020c", "score": "0.6651729", "text": "wrap(job) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.send();\n try {\n let res = yield job.run();\n this.conclusion = Conclusion.Success;\n this.summary = `Task \"${job.name}\" passed`;\n this.text = \"```\" + res.toString() + \"```\\nTest Complete\";\n return yield this.send();\n }\n catch (e) {\n const logs = yield job.logs();\n this.conclusion = Conclusion.Failure;\n this.summary = `Task \"${job.name}\" failed for build ${this.externalID}`;\n this.text = \"```\" + logs + \"```\\nFailed with error: \" + e.toString();\n try {\n // Send the notification but we still want to return the original error\n yield this.send();\n return e;\n }\n catch (e2) {\n console.error(\"failed to send notification: \" + e2.toString());\n console.error(\"original error: \" + e.toString());\n return e2;\n }\n }\n });\n }", "title": "" }, { "docid": "48435613d205e2f9e69ba9cc3a7ba6d1", "score": "0.5515489", "text": "function test2() {\n\t// returns a promise \n return job1().then(function(data) {\n // console.log(data + ' play with me ');\n return data + ' play with me '\n });\n}", "title": "" }, { "docid": "482f72e432685c162190f022131b71d4", "score": "0.5302507", "text": "function createJobHandler(fn, options = {}) {\n const handler = (argument, context) => {\n const description = context.description;\n const inboundBus = context.inboundBus;\n const inputChannel = new rxjs_1.Subject();\n let subscription;\n return new rxjs_1.Observable(subject => {\n // Handle input.\n inboundBus.subscribe(message => {\n switch (message.kind) {\n case api_1.JobInboundMessageKind.Ping:\n subject.next({ kind: api_1.JobOutboundMessageKind.Pong, description, id: message.id });\n break;\n case api_1.JobInboundMessageKind.Stop:\n // There's no way to cancel a promise or a synchronous function, but we do cancel\n // observables where possible.\n if (subscription) {\n subscription.unsubscribe();\n }\n subject.next({ kind: api_1.JobOutboundMessageKind.End, description });\n subject.complete();\n // Close all channels.\n channels.forEach(x => x.complete());\n break;\n case api_1.JobInboundMessageKind.Input:\n inputChannel.next(message.value);\n break;\n }\n });\n // Configure a logger to pass in as additional context.\n const logger = new index_2.Logger('job');\n logger.subscribe(entry => {\n subject.next({\n kind: api_1.JobOutboundMessageKind.Log,\n description,\n entry,\n });\n });\n // Execute the function with the additional context.\n subject.next({ kind: api_1.JobOutboundMessageKind.Start, description });\n const channels = new Map();\n const newContext = Object.assign({}, context, { input: inputChannel.asObservable(), logger,\n createChannel(name) {\n if (channels.has(name)) {\n throw new ChannelAlreadyExistException(name);\n }\n const channelSubject = new rxjs_1.Subject();\n channelSubject.subscribe(message => {\n subject.next({\n kind: api_1.JobOutboundMessageKind.ChannelMessage, description, name, message,\n });\n }, error => {\n subject.next({ kind: api_1.JobOutboundMessageKind.ChannelError, description, name, error });\n // This can be reopened.\n channels.delete(name);\n }, () => {\n subject.next({ kind: api_1.JobOutboundMessageKind.ChannelComplete, description, name });\n // This can be reopened.\n channels.delete(name);\n });\n channels.set(name, channelSubject);\n return channelSubject;\n } });\n const result = fn(argument, newContext);\n // If the result is a promise, simply wait for it to complete before reporting the result.\n if (index_3.isPromise(result)) {\n result.then(result => {\n subject.next({ kind: api_1.JobOutboundMessageKind.Output, description, value: result });\n subject.next({ kind: api_1.JobOutboundMessageKind.End, description });\n subject.complete();\n }, err => subject.error(err));\n }\n else if (rxjs_1.isObservable(result)) {\n subscription = result.subscribe((value) => subject.next({ kind: api_1.JobOutboundMessageKind.Output, description, value }), error => subject.error(error), () => {\n subject.next({ kind: api_1.JobOutboundMessageKind.End, description });\n subject.complete();\n });\n return subscription;\n }\n else {\n // If it's a scalar value, report it synchronously.\n subject.next({ kind: api_1.JobOutboundMessageKind.Output, description, value: result });\n subject.next({ kind: api_1.JobOutboundMessageKind.End, description });\n subject.complete();\n }\n });\n };\n return Object.assign(handler, { jobDescription: options });\n}", "title": "" }, { "docid": "a3b36a63989f254ab3195be0442ae71c", "score": "0.5175641", "text": "function addJob(job) {\n var args = [job].concat([].slice.call(arguments, 1));\n setTimeout(job.bind.apply(job, args), options.interval);\n }", "title": "" }, { "docid": "e280a605aba9f0472d26e51d2af6e172", "score": "0.5085982", "text": "function job(callback1, callback2) {\n setTimeout(() => {\n callback1();\n }, 2000);\n let count = 0;\n let timer = setInterval(() => {\n count += 1;\n callback2();\n if (count === 3) {\n clearInterval(timer);\n }\n }, 1000);\n}", "title": "" }, { "docid": "cfe8e0279d7f0028bcf5b74b4b174dd3", "score": "0.5065716", "text": "setJob(job) {\n this.worker.postMessage({\n method: \"job\",\n params: job\n });\n }", "title": "" }, { "docid": "a2433a6dfb8e7a8c9f0e9607a22efae3", "score": "0.5060699", "text": "function processJob (method, data) {\n var job = data.job;\n method.call(null, job, function (err, result) {\n if (err) {\n utils.sendError(data, err.message);\n } else {\n var response = {};\n response.callbackId = data.callbackId;\n response.result = result;\n utils.sendSuccess(response);\n }\n });\n }", "title": "" }, { "docid": "4e89100eea93681b6d2a614014faf721", "score": "0.4982284", "text": "function createLoggerJob(job, logger) {\n const handler = (argument, context) => {\n context.inboundBus.pipe(operators_1.tap(message => logger.info(`Input: ${JSON.stringify(message)}`))).subscribe();\n return job(argument, context).pipe(operators_1.tap(message => logger.info(`Message: ${JSON.stringify(message)}`), error => logger.warn(`Error: ${JSON.stringify(error)}`), () => logger.info(`Completed`)));\n };\n return Object.assign(handler, job);\n}", "title": "" }, { "docid": "533cdbbdb49aa86eebcc28b1a63cca9c", "score": "0.49330968", "text": "setRunningJob(context) {\n const job = context.data;\n if (this.runningJob === null || (this.runningJob.executionId !== job.payload.executionId)) {\n this.runningJob = _.pick(job.payload, ['executionId', 'testSuiteId', 'testId']);\n this.runningJob.currentIndex = 0;\n this.runningJob.active = true;\n } else {\n this.runningJob.testSuiteId = job.payload.testSuiteId;\n this.runningJob.testId = job.payload.testId;\n this.runningJob.active = true;\n }\n context.emit('done', this.cementHelper.brickName);\n }", "title": "" }, { "docid": "526b81f6f7b9a601031bbf974fa8261e", "score": "0.4909957", "text": "function notify(deferred, handler) {\n\t\tvar results = deferred.results;\n\t\tvar method = handler[deferred.status];\n\t\tvar nextDeferred = handler.nextDeferred;\n\t\tvar fn;\n\t\t\n\t\t// pass along the error/result\n\t\tif (!method) {\n\t\t\tfn = nextDeferred[deferred.status.slice(0, -2)];\n\t\t\tfn.apply(nextDeferred, results);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t// run the then\n\t\tvar nextResult = method.apply(deferred.promise, results);\n\t\t\n\t\tif (nextResult && typeof nextResult.then === 'function')\n\t\t\tnextResult.then(nextDeferred.fulfill, nextDeferred.fail);\n\t\telse if (nextResult instanceof Error)\n\t\t\tnextDeferred.fail(nextResult);\n\t\telse if (nextResult === undefined)\n\t\t\t// pass along the error/result\n\t\t\tnextDeferred[deferred.status.slice(0, -2)].apply(nextDeferred, results);\n\t\telse\n\t\t\tnextDeferred.fulfill(nextResult);\n\t}", "title": "" }, { "docid": "0bcbd49e57f03d70b1492525770eba27", "score": "0.4879124", "text": "addWaitingJob(job) {\n this.waitingQueue.push(job);\n }", "title": "" }, { "docid": "f90c045f9e8b79d96127c2454ce6e0a0", "score": "0.48765644", "text": "t3 () {\n return WorkerWrapper.run(function (arg1, arg2) { return `Run ${arg1} and ${arg2}` }, ['with args', 'without arrow function'])\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "title": "" }, { "docid": "b3bf248276bb8b99addd0d295fbf90b1", "score": "0.48547012", "text": "function doNotify(arg) {\n // Note: If the promise is resolved before a tick happens,\n // notifications will never be delivered.\n if (completed) {\n return;\n }\n // If we have not ticked, queue the notification\n if (notTicked) {\n notTicked.push(arg);\n } else {\n executeHandlers(arg);\n }\n\n /**\n * Executes the handlers with the suppied argument\n * @param arg The argument to pass to the notify handlers.\n */\n function executeHandlers(arg) {\n var i;\n for (i = 0; i < notifyHandlers.length; i++) {\n try {\n notifyHandlers[i](arg);\n } catch (err) {\n console.error('Error in promise notify handler');\n console.error(err);\n }\n }\n }\n }", "title": "" }, { "docid": "4562923d5ac4cfe806cdd79e0d8ffafd", "score": "0.48207337", "text": "static make_job(explicitly_start_job=false){\n let the_dex = (window.default_robot ? Dexter.default : Dexter.dexter0)\n let name = ((platform === \"dde\") ? \"dui2_for_\" + the_dex.name : \"dexter_user_interface2\") //the job engine Job name must match the file name (sans .js\")\n if (Job[name] && Job[name].is_active()) { //we're redefining the job so we want to make sure the\n //previous version is stopped first\n Job[name].stop_for_reason(\"interrupted\", \"User is redefining this job.\")\n setTimeout(function(){ dui2.make_job(true) }, 200)\n }\n else { //hits when job is undefined, or is defined but not active.\n //if job is defined but not active, it will be redefined,\n //with a new job_id. This should be fine.\n let new_job = new Job({\n name: name,\n robot: new Brain({name: \"dui_brain\"}),\n when_do_list_done: \"wait\",\n do_list: [dui2.init,\n the_dex.empty_instruction_queue() //needed because the next instruction may need to look a the measured_angles, and we want them updated to where dexter is really at.\n ]\n })\n if(explicitly_start_job) {\n new_job.start()\n }\n // else {} //this job will get started anyway via define_and_start_job which is called by dui2_id.onclick\n }\n }", "title": "" }, { "docid": "34d8c8597a3a3d9cec57037b1d4732f3", "score": "0.4817623", "text": "function sendAJob(job, resolveToJob) {\n return sendJobs([job], resolveToJob).\n then(function(jobs) {\n return resolveToJob && jobs[0];\n });\n}", "title": "" }, { "docid": "8e5ea5c6534225fddd303b97867aa205", "score": "0.46709016", "text": "then(...args){\n utils.attachToPrevious(this.previous).then(x=>{\n var f = args[0];\n this.rl.close();\n f(x);\n })\n }", "title": "" }, { "docid": "d69259e483809e2cb1dbf735c4f696b3", "score": "0.46687075", "text": "send() {\n this.count++;\n var j = new brigadier_1.Job(`${this.name}-${this.count}`, this.notificationJobImage);\n j.imageForcePull = true;\n // GitHub limits this field to 65535 characters, so we\n // trim the length (from the beginning) prior to sending,\n // inserting a placeholder for the text omitted after truncation.\n if (this.text.length > exports.GITHUB_CHECK_TEXT_MAX_CHARS) {\n let textOmittedMsg = \"(Previous text omitted)\\n\";\n this.text = this.text.slice(this.text.length - (exports.GITHUB_CHECK_TEXT_MAX_CHARS - textOmittedMsg.length));\n this.text = textOmittedMsg + this.text;\n }\n j.env = {\n CHECK_CONCLUSION: this.conclusion,\n CHECK_NAME: this.name,\n CHECK_TITLE: this.title,\n CHECK_PAYLOAD: this.payload,\n CHECK_SUMMARY: this.summary,\n CHECK_TEXT: this.text,\n CHECK_DETAILS_URL: this.detailsUrl,\n CHECK_EXTERNAL_ID: this.externalID\n };\n return j.run();\n }", "title": "" }, { "docid": "c4e291707de2c02a0f9e06446330fe9d", "score": "0.4661287", "text": "t2 () {\n return WorkerWrapper.run(() => 'Run without args and with arrow function')\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "title": "" }, { "docid": "9cc7d55c42768380c34d871aa8f0cb73", "score": "0.4655354", "text": "constructor(currentJob) {\n this.currentJob = currentJob;\n }", "title": "" }, { "docid": "8b3308f7f0a3221060d944c5c4c4e9cc", "score": "0.46536416", "text": "job(jid) {\n return this.call('get', jid)\n .then((job) => {\n if (job) {\n // It's a normal job\n return new Job(this, JSON.parse(job));\n } else {\n // Try to get a recurring job\n return this.call('recur.get', jid)\n .then((recurringJob) => {\n if (recurringJob) {\n return new RecurringJob(this, JSON.parse(recurringJob));\n } else {\n return null;\n }\n });\n }\n });\n }", "title": "" }, { "docid": "5657ccc531519049982df75670cf4d23", "score": "0.4646291", "text": "function applyNotification(e, o)\n\t{\n\t\tswitch(o.notification)\n\t\t{\n\t\t\tcase 'effect':\n\t\t\t\t$(e).effect(o.effect, { times:o.effectLoop }, o.effectDuration);\n\t\t\t\treturn;\n\t\t\tcase 'icon':\n\t\t\t\tvar img = Image();\n\t\t\t\t$(img).attr('src', o.iconPath);\n\t\t\t\t$(img).attr('align', 'middle');\n\t\t\t\t$(img).addClass('fv-icon');\n\t\t\t\t$(e).after($(img));\n\t\t\t\t$(img).fadeIn(o.iconDuration);\n\t\t\t\treturn;\n\t\t}\n\t}", "title": "" }, { "docid": "401e5fda753604f2f7dc8be540ede8bd", "score": "0.46437606", "text": "deleteJob(){\n\n }", "title": "" }, { "docid": "2113196cf4fa648ea157bbb48ad38f7f", "score": "0.4642495", "text": "t4 () {\n return WorkerWrapper.run((arg1, arg2) => `Run ${arg1} and ${arg2}`, ['with args', 'with arrow function'])\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "title": "" }, { "docid": "cc96b6d38d6c3c48941e07453ab50781", "score": "0.4631011", "text": "function JobCallback (job, callback) {\n // Nothing to do\n }", "title": "" }, { "docid": "bf6ae58fe19e63736fe8976551f6c2d7", "score": "0.4628329", "text": "notify_observers(job_event, job_id, observer_id) {\n var self = this;\n\n // If this run request includes an observer id, notify all\n // related endpoints that the new job has been started.\n if (_.has(self._observers, observer_id)) {\n logger.debug('Sending ' + job_event + ' for observer ' + observer_id);\n self._observers[observer_id].forEach(function(endpoint) {\n endpoint.send({type: job_event, job_id: job_id});\n });\n }\n }", "title": "" }, { "docid": "5ee437ff26e4a4be21ccf2c03a5ce1c0", "score": "0.46257505", "text": "function finishJob(job, callback) {\n if (typeof (job) === 'undefined') {\n return callback(new wf.BackendInternalError(\n 'WorkflowRedisBackend.finishJob job(Object) required'));\n }\n\n var multi = client.multi();\n var p;\n\n for (p in job) {\n if (typeof (job[p]) === 'object') {\n job[p] = JSON.stringify(job[p]);\n }\n }\n\n return client.lrem('wf_running_jobs', 0, job.uuid,\n function (err, res) {\n if (err) {\n log.error({err: err});\n return callback(new wf.BackendInternalError(err));\n }\n\n if (res <= 0) {\n return callback(new wf.BackendPreconditionFailedError(\n 'Only running jobs can be finished'));\n }\n if (job.execution === 'running') {\n job.execution = 'succeeded';\n }\n\n multi.srem('wf_runner:' + job.runner_id, job.uuid);\n if (job.execution === 'succeeded') {\n multi.rpush('wf_succeeded_jobs', job.uuid);\n } else if (job.execution === 'canceled') {\n multi.rpush('wf_canceled_jobs', job.uuid);\n } else if (job.execution === 'retried') {\n multi.rpush('wf_retried_jobs', job.uuid);\n } else if (job.execution === 'waiting') {\n multi.rpush('wf_waiting_jobs', job.uuid);\n } else {\n multi.rpush('wf_failed_jobs', job.uuid);\n }\n\n multi.hmset('job:' + job.uuid, job);\n multi.hdel('job:' + job.uuid, 'runner_id');\n if (typeof (job.locks) !== 'undefined') {\n multi.hdel('wf_locked_targets', job.uuid);\n }\n return multi.exec(function (err, replies) {\n if (err) {\n log.error({err: err});\n return callback(new wf.BackendInternalError(err));\n } else {\n return getJob(job.uuid, callback);\n }\n });\n });\n }", "title": "" }, { "docid": "7978d3a17c3f71018c3b5985ef44ac94", "score": "0.46077836", "text": "function executeHandlers(arg) {\n var i;\n for (i = 0; i < notifyHandlers.length; i++) {\n try {\n notifyHandlers[i](arg);\n } catch (err) {\n console.error('Error in promise notify handler');\n console.error(err);\n }\n }\n }", "title": "" }, { "docid": "b39e65ffa7c48d688584645c38d8879d", "score": "0.45931157", "text": "function wrapTaskFunction(fn, ctx) {\n return fn.call(ctx, () => ({\n /* ??? in which situation does this */\n }));\n}", "title": "" }, { "docid": "460199ab1669f3833968d0aed313cd08", "score": "0.45891595", "text": "handleVerifyJob (req, res) {\n\n var jobId = req.params.jobId\n const Job = this.Job \n const Employer = this.Employer\n const Mailer = this.mailer\n\n /*\n * First, attempt to find the job to get all the job details.\n */\n\n Job.findOne({\n where: {\n job_id: jobId\n }\n })\n\n .then((job) => {\n \n /*\n * If we couldn't find the job at all\n */\n \n if (job === null) {\n\n res.status(404).json({\n message: 'The requested resource doesnt exist.'\n })\n\n }\n\n /*\n * If the job exists in the database, then we'll go ahead\n * and update it.\n *\n */\n\n else {\n\n /*\n * But hold on, we'll only continue to do all of this if the\n * job isn't already verified. We don't want to send another verified\n * email if the job has already been verified.\n */\n\n if (job.verified === false) {\n\n Job.update({\n verified: 1\n }, {\n where: {\n job_id: jobId\n }\n })\n\n /*\n * Success. We've updated the record and now it's time to send a\n * notification email to the employer of which the job belongs to.\n */\n\n .then((result) => {\n\n Employer.methods.getEmployerInfoById(job.posted_by)\n\n .then((employer) => {\n\n /*\n * We've accumulated all the required employer information to send the email\n * and at this point the job has been verified. Lets send away the email\n * and let the employer know the job is verified.\n */\n\n if (employer[0] !== null && employer[0] !== undefined) {\n\n var employerName = employer[0].user_firstName + \" \" + employer[0].user_lastName\n var email = employer[0].user_email\n var jobTitle = job.title\n\n Mailer.queueJobVerifiedEmail(employerName, email, jobTitle, req.decoded.userId)\n\n /*\n * Successfully queued the job verified email.\n */\n\n .then(() => {\n\n /*\n * Resolve the request.\n */\n\n res.status(200).json({\n message: 'Successfully set job to verified.'\n })\n\n })\n\n /*\n * Could not queue the job verified email.\n */\n\n .catch((err) => {\n\n res.status(500).json({\n success: false,\n message: 'Some error occurred queuing the job verified email.'\n })\n\n })\n\n }\n\n /*\n * Couldn't find the employer that posted the job, weirdly.\n * This must mean that we've deleted the employer profile\n * without deleting the job also. Impossible if we've properly\n * done foreign key relationships.\n */\n\n else {\n\n res.status(500).json({\n message: 'An error (albeit unexpected) occurred.'\n })\n\n }\n\n })\n\n /*\n * Could not get employer data.\n * Probably the result of a SQL error\n */\n\n .catch((err) => {\n\n console.log(err)\n\n res.status(500).json({\n message: 'Could not get employer data.'\n })\n\n })\n\n })\n\n /*\n * For some reason, we couldn't update the sequelize record.\n */\n\n .catch((err) => {\n\n console.log(err)\n\n res.status(500).json({\n message: 'Error occurred trying to update the job to verified.'\n })\n\n })\n }\n\n /*\n * 409 - conflict. We've already verified the job. No need\n * to do it again and resend the verification email.\n */\n\n else {\n\n res.status(409).json({\n message: 'Job already verified and email already sent.'\n })\n\n }\n\n }\n\n\n })\n\n /*\n * Could not get the Job because some sequelize error\n * occurred.\n */\n\n .catch((err) => {\n\n res.status(500).json({\n message: 'Some error occurred trying to call this endpoint'\n })\n\n })\n \n }", "title": "" }, { "docid": "0bfd9cfa4f743a986c987d813b778891", "score": "0.45608705", "text": "notify(noti, type, callback = function () {}) {\n switch (type) {\n case 'success':\n this.props.onDispatchNotification(success(noti));\n break;\n case 'info':\n this.props.onDispatchNotification(info(noti));\n break;\n case 'warning':\n this.props.onDispatchNotification(warning(noti));\n break;\n case 'error':\n this.props.onDispatchNotification(error(noti));\n break;\n default:\n console.log('ERROR IN CALLING this.notify()');\n }\n callback();\n}", "title": "" }, { "docid": "992e3498479c4780c90d40c4093ddf64", "score": "0.45542082", "text": "handleJob(event) {\n\n\n\t\twindow.open(\"https://www.naukri.com/\" + this.state.user.jbin + \"-jobs\")\n\t\twindow.open(\"https://www.indeed.co.in/\" + this.state.user.jbin + \"-jobs\")\n\n\t}", "title": "" }, { "docid": "238ad549ffb0f34c94c29914189f5586", "score": "0.4549782", "text": "[kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }", "title": "" }, { "docid": "238ad549ffb0f34c94c29914189f5586", "score": "0.4549782", "text": "[kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }", "title": "" }, { "docid": "238ad549ffb0f34c94c29914189f5586", "score": "0.4549782", "text": "[kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }", "title": "" }, { "docid": "1d07c5f26e9b7b3f075451ec7da131b6", "score": "0.45412353", "text": "function DoJob(job, dwarfpower) {\n\t//Turn an input of dwarfhours*workrate into outputs.\n\t// For clicks, dwarfpower is 1 so one click on buildings produces 1 build point and consumes 2 wood and 1 stone.\n\t\n}", "title": "" }, { "docid": "c20d2ed624b5f560aef4ffbbf97d1e28", "score": "0.4540026", "text": "function xrxPrintJobProcessing(input, output)\r\n{\r\n return xrxCreateTag('JobProcessing', '', input + output);\r\n}", "title": "" }, { "docid": "0be866645c11111f857759e67e4be764", "score": "0.45337188", "text": "function dispatchWorker(worker, job, done) {\n worker.execute(job, done);\n }", "title": "" }, { "docid": "2e893fc10f1f0051b23d67ffac955d63", "score": "0.45100212", "text": "function createJob(job, meta, callback) {\n if (typeof (job) === 'undefined') {\n return callback(new wf.BackendInternalError(\n 'WorkflowRedisBackend.createJob job(Object) required'));\n }\n\n if (typeof (meta) === 'function') {\n callback = meta;\n meta = {};\n }\n\n var multi = client.multi();\n var p;\n\n for (p in job) {\n if (typeof (job[p]) === 'object') {\n job[p] = JSON.stringify(job[p]);\n }\n }\n job.created_at = (job.created_at) ?\n new Date(job.created_at).getTime() : new Date().getTime();\n job.exec_after = (job.exec_after) ?\n new Date(job.exec_after).getTime() : new Date().getTime();\n\n // Save the job as a Hash\n multi.hmset('job:' + job.uuid, job);\n // Add the uuid to the wf_queued_jobs set in order to be able to use\n // it when we're about to run queued jobs\n multi.rpush('wf_queued_jobs', job.uuid);\n multi.sadd('wf_jobs', job.uuid);\n // If the job has a target, save into 'wf_target:target' to make\n // possible validation of duplicated jobs with same target:\n multi.sadd('wf_target:' + job.target, job.uuid);\n if (typeof (job.locks) !== 'undefined') {\n multi.hset('wf_locked_targets', job.uuid, job.locks);\n }\n // Execute everything on a transaction:\n return multi.exec(function (err, replies) {\n // console.log(replies, false, 8); => [ 'OK', 1, 1 ]\n if (err) {\n log.error({err: err});\n return callback(new wf.BackendInternalError(err));\n } else {\n return _decodeJob(job, function (job) {\n return callback(null, job);\n });\n }\n });\n }", "title": "" }, { "docid": "c5c5090288ceb7ced7ab39a4f1a31ce0", "score": "0.45043966", "text": "t1 () {\n return WorkerWrapper.run(function () { return 'Run without args and without arrow function' })\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "title": "" }, { "docid": "c964ab144c45d4b9dae495104860a9ca", "score": "0.44989613", "text": "function act(routine) {\n var dispatch = store.dispatch\n var promise = Promise.resolve()\n store.dispatch = function() {\n promise = promise.then(function() {\n return Promise.resolve()\n })\n dispatch.apply(null, arguments)\n }\n function settle() {\n return promise\n }\n return Promise.resolve(routine()).then(settle)\n }", "title": "" }, { "docid": "1d8cf7b58b783d70262ffaf6c6f54406", "score": "0.4469193", "text": "function manageExecutionCompletion(rec) {\r\n\r\n deleteWopoDataRecord(rec);\r\n sendEmailOfExecutionCompletion(rec);\r\n}", "title": "" }, { "docid": "96fa3d620088b65e50d6d965e7818aa0", "score": "0.44637758", "text": "function callAndWrap(workerFunction, parameters, transferableObjects) {\n var resultOrPromise;\n try {\n resultOrPromise = workerFunction(parameters, transferableObjects);\n return resultOrPromise; // errors handled by Promise\n } catch (e) {\n return when.reject(e);\n }\n }", "title": "" }, { "docid": "2a018dd98fc8719e9f2feefef690bd96", "score": "0.44623587", "text": "function updateTaskHandler(){\n let id = $(this).data('id');\n updateTask(id);\n\n // Notification of completion\n alert('NICE JOB!')\n\n} // end updateTaskHandler", "title": "" }, { "docid": "b44c3a8713bcd2bb1878c71223cf916b", "score": "0.44584706", "text": "add(job) {\n this.queue.push(job);\n }", "title": "" }, { "docid": "70fc539982c0333c0d734e0de1e93ef3", "score": "0.44474056", "text": "handleFailure(job, err) {\n console.log(`Queue ${job.queue.name}: FAILED`, err);\n }", "title": "" }, { "docid": "461bbdbbd510de49995164f8acbeeea1", "score": "0.4443692", "text": "set_currentJob(newval)\n {\n this.liveFunc.set_currentJob(newval);\n return this._yapi.SUCCESS;\n }", "title": "" }, { "docid": "f807da25ad4d0852aa5dbe9446bc228d", "score": "0.4442183", "text": "get_currentJob()\n {\n return this.liveFunc._currentJob;\n }", "title": "" }, { "docid": "673cdd6772114d6a8fbac2cc04a2ec0e", "score": "0.44402167", "text": "flowStepSuccessDoStuff(job, flowStep){\n this.controller.set('performingManualAction', true);\n // If save param is true, save job first\n if (flowStep.params.save === true) {\n this.store.save('job', job).then(\n () => {\n this.store.find('process', job.id, {status: 'success', step: flowStep.step}).then(\n () => {\n this.refresh(job.id); // Refresh children of current model\n },\n (errorObject) => {\n this.controller.set('performingManualAction', false);\n this.controller.set('error', errorObject.error);\n }\n );\n },\n (errorObject) => {\n this.controller.set('performingManualAction', false);\n this.controller.set('error', errorObject.error);\n }\n );\n } else {\n this.store.find('process', job.id, {status: 'success', step: flowStep.step}).then(\n () => {\n this.refresh(job.id); // Refresh children of current model\n },\n (errorObject) => {\n this.controller.set('performingManualAction', false);\n this.controller.set('error', errorObject.error);\n }\n );\n }\n }", "title": "" }, { "docid": "3f8bff20e99c04b3d0a1056f1468832c", "score": "0.44387314", "text": "function createJob(job\n/*: Job*/\n)\n/*: ActionFunc*/\n{\n return (0, _helpers.bindClientFunc)({\n clientFunc: _client.Client4.createJob,\n onRequest: _action_types.JobTypes.CREATE_JOB_REQUEST,\n onSuccess: [_action_types.JobTypes.RECEIVED_JOB, _action_types.JobTypes.CREATE_JOB_SUCCESS],\n onFailure: _action_types.JobTypes.CREATE_JOB_FAILURE,\n params: [job]\n });\n}", "title": "" }, { "docid": "fb9d23faa1c313c3c2d6e7a6546f0878", "score": "0.44369704", "text": "function queue(wrapper, callback) {\n\tcallback();\n}", "title": "" }, { "docid": "dd91ada103822045098807300af4e218", "score": "0.44344616", "text": "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key]\n bee.on('failed', this.handleFailure).process(handle)\n })\n }", "title": "" }, { "docid": "261b4a186450792892c8e3cf5e192e9e", "score": "0.4428069", "text": "function whatDoYouDo(job, firstName) {}", "title": "" }, { "docid": "e0b83af7ef1d112bbb30ff053e86477b", "score": "0.44177678", "text": "function PromiseReactionJob (reaction, argument) {\n var promiseCapability = reaction['[[Capabilities]]']\n var handler = reaction['[[Handler]]']\n var handlerResult, status\n try {\n if (handler === 'Identity') handlerResult = argument\n else if (handler === 'Thrower') throw argument\n else handlerResult = handler.call(undefined, argument)\n } catch (handlerResult) {\n status = promiseCapability['[[Reject]]'].call(undefined, handlerResult)\n NextJob(status); return\n }\n status = promiseCapability['[[Resolve]]'].call(undefined, handlerResult)\n NextJob(status)\n }", "title": "" }, { "docid": "747e0502a9d88e0c4e9a68a00ede3fa1", "score": "0.44118327", "text": "function somethingElse() {\n console.log('runs another task')\n}", "title": "" }, { "docid": "658ca3b89810615d1e507c335dc96972", "score": "0.4408395", "text": "function cbCallbackClosure(job,jolokia) {\n var responses = [],\n callback = job.callback,\n lastModified = 0;\n\n return {\n cb : addResponse,\n lcb : function(resp,j) {\n addResponse(resp);\n // Callback is called only if at least one non-cached response\n // is obtained. Update job's timestamp internally\n if (responses.length > 0) {\n job.lastModified = lastModified;\n callback.apply(jolokia,responses);\n }\n }\n };\n\n function addResponse(resp,j) {\n // Only remember responses with values and remember lowest timetamp, too.\n if (resp.status != 304) {\n if (lastModified == 0 || resp.timestamp < lastModified ) {\n lastModified = resp.timestamp;\n }\n responses.push(resp);\n }\n }\n }", "title": "" }, { "docid": "d82d75e5f43919454f94b79c350e1fc6", "score": "0.4405243", "text": "function changeJobWrapper () {\n $('input[type=\"radio\"]').click(function () {\n var command = $(this).val();\n // Hide initial message\n $(\".form-area-initial-args-box\").hide();\n // Make all inputs in selected div 'required'\n $(\n `#form_area_${command}_args_box > .form-area-arg-field textarea, .form-area-arg-field select`\n ).each(function () {\n $(this).attr('required', 'required');\n });\n $(`#form_area_${command}_args_box`).show();\n /*\n Iterate over rest of available command divs\n Each has the same class, so check if div id\n contains selected job. If not, remove 'required'\n attribute and clean field value.\n */\n $('.form-area-job-args-box').each(function () {\n elementId = $(this).attr('id');\n if (!elementId.includes(command)) {\n $(this).hide();\n $('.form-area-arg-field > textarea, select', this).each(function () {\n $(this).removeAttr('required');\n $(this).val('');\n })\n }\n });\n });\n}", "title": "" }, { "docid": "1098cb103f72e4ec12edcd5028636503", "score": "0.44031394", "text": "function putJobSuccess(message) {\n console.log(message)\n codepipeline.putJobSuccessResult({ jobId },\n (err, data) => {\n if (err)\n context.fail(err)\n else\n context.succeed(message)\n })\n }", "title": "" }, { "docid": "162912e34aa374fc0ad42935fa4ba807", "score": "0.43982515", "text": "then (...args) {\n return originalThen.call(this, ...args);\n }", "title": "" }, { "docid": "5fcbfb2170056ea46d7ff88525c859c1", "score": "0.4394849", "text": "function callbackified(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}var maybeCb=args.pop();if(typeof maybeCb!=='function'){throw new TypeError('The last argument must be of type Function');}var self=this;var cb=function cb(){return maybeCb.apply(self,arguments);};// In true node style we process the callback on `nextTick` with all the\n// implications (stack, `uncaughtException`, `async_hooks`)\noriginal.apply(this,args).then(function(ret){process.nextTick(cb,null,ret);},function(rej){process.nextTick(callbackifyOnRejected,rej,cb);});}", "title": "" }, { "docid": "8777195850379a71bcafeaec3ad5fba9", "score": "0.43912897", "text": "function workOnI(){ work.I(workOnJ); }", "title": "" }, { "docid": "32b606f787b8331a1b1b0fa0c45accf2", "score": "0.4390666", "text": "handleFailure(job, err) {\n\t\tconsole.log(`Queue ${job.queue.name}: FAILED`, err);\n\t}", "title": "" }, { "docid": "d1553f86b3fc0af744d19b408c019199", "score": "0.4388234", "text": "function runningJob(job) {\n if (!job) {\n setProgress(status);\n $('.play').removeClass('active')\n $('body').css('background-color', '#EEEEEE');\n $('.play-button').show();\n sortable.options.disabled = false;\n return\n }\n\n $('.cancel').slideUp(100);\n $('.download').slideUp(100);\n $('.edit').slideUp(100);\n\n // $('.preview').slideUp(100); // Here if the live viewer button moves\n $('.preview').off('click');\n $('.preview').click(function(e) {\n e.preventDefault();\n fabmo.launchApp('previewer', {\n 'job': job._id,\n \"isLive\": true\n });\n hideDropDown();\n });\n\n $('body').css('background-color', '#898989');\n $('.topjob').addClass('running');\n $('.up-next').css('left', '-2000px');\n $('.no-jobs').css('left', '-2000px');\n $('.now-running').css('left', '0px');\n $('.play-button').show();\n if (!$('.play').hasClass('active')){\n $('.play').addClass('active');\n }\n sortable.options.disabled = true;\n}", "title": "" }, { "docid": "dd08528d1bbf1202de0b55148ebdfd0f", "score": "0.43831462", "text": "function wsmanJobFactory(\n BaseJob,\n Logger,\n util,\n assert,\n Promise,\n _,\n waterline,\n WsmanTool,\n Constants,\n configuration,\n encryption,\n HttpTool,\n errors\n) {\n var logger = Logger.initialize(wsmanJobFactory);\n\n /**\n *\n * @param {Object} options\n * @param {Object} context\n * @param {String} taskId\n * @constructor\n */\n function WsmanJob(options, context, taskId) {\n WsmanJob.super_.call(this, logger, options, context, taskId);\n this.routingKey = options.serviceId;\n this.nodeId =options.nodeId;\n this.dellConfigs = undefined; \n \n \n }\n \n util.inherits(WsmanJob, BaseJob);\n\n\n\t /*\n\t * Initialize basic configuration for the job\n\t *\n\t */\n \n \n\n WsmanJob.prototype.initJob = function () {\n\t\tvar self = this;\n\t\t\t\n\t\n\t\tself.dellConfigs = configuration.get('dell');\n\n\t\tif (!self.dellConfigs || \n\t\t\t !self.dellConfigs.services.powerThermalMonitoring){\n\t\t\tthrow new errors.NotFoundError(\n\t\t\t'Dell web service configuration is not defined in wsmanConfig.json.');\n\t\t}\n\t\t\n\t\tself.powerThermalConfigs=self.dellConfigs.services.powerThermalMonitoring; \t \n\t\tself.apiServer=self.powerThermalConfigs.host;\n\t\t\t\t\n\t\treturn waterline.obms.findByNode(self.nodeId, 'dell-wsman-obm-service', true)\n\t\t .then(function(obm) {\n \t if (!obm) { \n \tthrow new errors.NotFoundError('Failed to find Wsman obm settings'); \n }\n \t\n self.oobServerAddress=obm.config.host;\n \t self.userConfig={\t\n \t\t \"user\" :obm.config.user,\n \t\t \"password\" : encryption.decrypt(obm.config.password)\n \t };\n \t \t \t \t \n \t }) ; \n\t\t\n\t\t\n\t}\t\n\n \n \n \n /**\n * @function _run\n * @description the jobs internal run method\n */\n \n WsmanJob.prototype._run = function run() {\n var self = this;\n \n return self._subscribeWsmanCommand(self.routingKey, function(data) {\n return Promise.resolve(self.initJob())\n .then(function (){\n \t return Promise.resolve(self.getPowerMonitoring())\n \t .then(function (result){\n \t \tdata.result=result; \t\t\t \n return self._publishWsmanCommandResult(\n self.routingKey,data.config.command,data)\n \t\t })\n \t }) \n \t\t\t \n \t.catch(function(error){\n \t logger.error(\"error occured \"+error); \n });\n });\n } \n \n \n\t/*\n\t* Print the result for RestAPI Response\n\t*/\n\t\n WsmanJob.prototype.printResult = function (result) {\n\t\t\n\t\tlogger.info(JSON.stringify(result,null,4));\n\n\t};\n\n\t\n\t\n\tWsmanJob.prototype.getPowerMonitoring = function() {\n\t\tvar self = this;\n\t\t\t\t\n\t\tvar apiHost=self.apiServer;\n\t\tvar path=self.powerThermalConfigs.endpoints.powerthermal;\n\t\tvar method='POST';\n\t\t\t\n\t\tif (!self.userConfig){\n\t\t\tthrow (\"No user configuration data provided \");\n\t\t}\n\t\tvar data= {\n\t\t\t\n\t\t\t\t\"serverAddress\": self.oobServerAddress,\n\t\t\t\t\"userName\" :self.userConfig.user,\n\t\t\t\t\"password\" :self.userConfig.password,\n\t\t\t};\n\t\t\n\t\treturn self.clientRequest(apiHost,path,method,data);\n\t} ;\n\t\n\t\n \n \n /*\n\t * Client Request API\n\t * \n\t * \n\t */\n\n\tWsmanJob.prototype.clientRequest = function(host, path, method, data) {\n\t\tvar self = this;\n\n\t\tvar parse = urlParse(host);\n\n\t\tvar setups = {};\n\n\t\tsetups.url = {};\n\t\tsetups.url.protocol = parse.protocol.replace(':','').trim();\n\t\tsetups.url.host = parse.host.split(':')[0];\n\t\tsetups.url.port = parse.port;\n\t\tsetups.url.path = path || '/';\n\n\t\tsetups.method = method || 'GET';\n\t\tsetups.credential = {};\n\t\tsetups.verifySSl = false;\n\t\tsetups.headers = {'Content-Type': 'application/json'};\n\t\tsetups.recvTimeoutMs = (30*1000);\n\t\tsetups.data = data || '';\n\t\t\t\n\t\t\n\t\tself.printResult(setups);\n\t\t\n\t\tvar http = new HttpTool();\n\t\treturn http.setupRequest(setups)\n\t\t.then(function(){\n\t\t\treturn http.runRequest();\n\t\t})\n\t\t.then(function(response){\n\t\t if (response.httpStatusCode > 206) {\n\t\t\t var errorMsg = _.get(\n\t\t\t response,\n\t\t\t 'body.error.message', 'IP is NOT valid or httpStatusCode > 206');\n\t\t\tthrow new Error(errorMsg);\n\t\t }\n\n\t\tif (response.body.length > 0) {\n\t\t\tresponse.body = JSON.parse(response.body);\n\t\t }\n\t\treturn response.body;\n\t\t});\n\t};\n \n \n \n return WsmanJob;\n}", "title": "" }, { "docid": "1158554b35df3a30e6f0f30f3ba88632", "score": "0.43827638", "text": "function job(option, param) {\n window.parent.job(option, param);\n}", "title": "" }, { "docid": "284ba8608ed06bb7aacc9b4a46c2295a", "score": "0.4382198", "text": "function callJolokia(jolokia,jobs) {\n return function() {\n var errorCbs = [],\n successCbs = [],\n i, j,\n len = jobs.length;\n var requests = [];\n for (i = 0; i < len; i++) {\n var job = jobs[i];\n // Can happen when job has been deleted\n // TODO: Can be probably optimized so that only the existing keys of jobs can be visited\n if (!job) { continue; }\n var reqsLen = job.requests.length;\n if (job.success) {\n // Success/error pair of callbacks. For multiple request,\n // these callback will be called multiple times\n var successCb = cbSuccessClosure(job,i);\n var errorCb = cbErrorClosure(job,i);\n for (j = 0; j < reqsLen; j++) {\n requests.push(prepareRequest(job,j));\n successCbs.push(successCb);\n errorCbs.push(errorCb);\n }\n } else {\n // Job should have a single callback (job.callback) which will be\n // called once with all responses at once as an array\n var callback = cbCallbackClosure(job,jolokia);\n // Add callbacks which collect the responses\n for (j = 0; j < reqsLen - 1; j++) {\n requests.push(prepareRequest(job,j));\n successCbs.push(callback.cb);\n errorCbs.push(callback.cb);\n }\n // Add final callback which finally will call the job.callback with all\n // collected responses.\n requests.push(prepareRequest(job,reqsLen-1));\n successCbs.push(callback.lcb);\n errorCbs.push(callback.lcb);\n }\n }\n var opts = {\n // Dispatch to the build up callbacks, request by request\n success: function(resp, j) {\n return successCbs[j].apply(jolokia, [resp, j]);\n },\n error: function(resp, j) {\n return errorCbs[j].apply(jolokia, [resp, j]);\n }\n };\n return jolokia.request(requests, opts);\n };\n }", "title": "" }, { "docid": "7f1f290b21f834c7f7e55e1f3bc922c3", "score": "0.43809882", "text": "_addJob() {\n this.core.log.verbose(`Saving new job ${this.id} for ${this.queue}`);\n return this.core.client\n .addjob(\n this._toQueueKey('jobs'),\n this._toQueueKey('waiting'),\n this._toQueueKey('stats'),\n this.toData(),\n !!this.options.unique,\n this.id\n ).then((id) => {\n if (this.options.unique && id === 0) {\n this.status = 'duplicate';\n return Promise.reject(new Error(`ERR_DUPLICATE: Job ${this.id} already exists, save has been aborted.`));\n }\n\n this.core.log.verbose(`Saved job for ${this.queue}`);\n\n this.id = id;\n this.status = 'saved';\n return Promise.resolve(this.toObject(true));\n });\n }", "title": "" }, { "docid": "bae667536ebc03a8f0f0bc0e54fe91e5", "score": "0.4375097", "text": "backtrackTheChain() {\r\n this.orderQueue.forEach(([waitingPromise, successCallback]) => {\r\n //if the passed arg is not a function simply return the observed value w.out executing\r\n if (typeof successCallback !== 'function') return waitingPromise.onFulfilled(this.val);\r\n const res = successCallback(this.val);\r\n if (res && res.then === 'function') { //check if promise\r\n res.then(val => waitingPromise.onFulfilled(val), val => waitingPromise.onRejected(val));\r\n } else {\r\n waitingPromise.onFulfilled(res);\r\n }\r\n })\r\n this.orderQueue = [];\r\n }", "title": "" }, { "docid": "38801bce8b465ef36d70e08c95d2f1d6", "score": "0.43599528", "text": "createJobs () {\n }", "title": "" }, { "docid": "41d6bb8bce4f9bdd483ecf681165681c", "score": "0.4356631", "text": "notification(notification) {\n let self = this;\n return new Promise(function (resolve, reject) {\n if (typeof notification === 'string') {\n try {\n notification = JSON.parse(notification);\n }\n catch (err) {\n reject(new MidtransNotificationError('fail to parse `notification` string as JSON. Use JSON string or Object as `notification`. with message:' +\n err.message));\n }\n }\n self\n .status(notification.transaction_id)\n .then((res) => resolve(res))\n .catch((err) => reject(err));\n });\n }", "title": "" }, { "docid": "bad0ea390f2e921ba4c9477cc4785e6e", "score": "0.4354921", "text": "async processSyncOperation (job, syncType) {\n const { id } = job\n const { syncRequestParameters } = job.data\n\n const isValidSyncJobData = (\n ('baseURL' in syncRequestParameters) &&\n ('url' in syncRequestParameters) &&\n ('method' in syncRequestParameters) &&\n ('data' in syncRequestParameters)\n )\n if (!isValidSyncJobData) {\n logger.error(`Invalid sync data found`, job.data)\n return\n }\n\n const userWallet = syncRequestParameters.data.wallet[0]\n const secondaryEndpoint = syncRequestParameters.baseURL\n\n /**\n * Remove sync from syncDeDuplicator once it moves to Active status, before processing\n * It is ok for two identical syncs to be present in Active and Waiting, just not two in Waiting\n */\n this.syncDeDuplicator.removeSync(syncType, userWallet, secondaryEndpoint)\n\n // primaryClockValue is used in additionalSyncIsRequired() call below\n const primaryClockValue = (await this.getUserPrimaryClockValues([userWallet]))[userWallet]\n\n this.log(`------------------Process SYNC | User ${userWallet} | Secondary: ${secondaryEndpoint} | Primary clock value ${primaryClockValue} | type: ${syncType} | jobID: ${id} ------------------`)\n\n // Issue sync request to secondary\n await axios(syncRequestParameters)\n\n // Wait until has sync has completed (within time threshold)\n const additionalSyncRequired = await this.additionalSyncIsRequired(\n userWallet,\n primaryClockValue,\n secondaryEndpoint,\n syncType\n )\n\n /**\n * Re-enqueue sync if required\n *\n * TODO can infinite loop on failing sync ops, but should not block any users as\n * it enqueues job to the end of the queue\n */\n if (additionalSyncRequired) {\n await this.enqueueSync({\n userWallet,\n primaryEndpoint: this.endpoint,\n secondaryEndpoint,\n syncType\n })\n }\n\n // Exit when sync status is computed\n this.log(`------------------END Process SYNC | jobID: ${id}------------------`)\n }", "title": "" }, { "docid": "d85093cdaae9a90f72971d1f9d444f0c", "score": "0.43495345", "text": "function success_handler(object_link, desc, after) {\n\tif (job_count.length == 1 && after != null) {\n\t\tafter();\n\t}\n\n\tvar log = document.getElementById('log');\n\tlog.innerHTML = '&nbsp;' + job_count.pop() + ' ' + object_link + ' : <span class=\"text-success\">' + desc + \"</span><br/>\\n\" + log.innerHTML;\n\tif (job_count.length == 0) {\n\t\tlog.innerHTML = \"Done!\\n<br/>\"+log.innerHTML;\n $(\".stop_button\").hide();\n\t}\n}", "title": "" }, { "docid": "5f7a4cd76715d8eb4f13a79937341e7b", "score": "0.43482167", "text": "handleDenyJob (req, res) {\n\n var jobId = req.params.jobId\n const Job = this.Job\n const ReqHelper = this.reqHelper\n const Employer = this.Employer\n const Mailer = this.mailer\n\n /*\n * Get job details. Most importantly, we just need to know who posted\n * the job so that we can get the employer email, name and job title.\n */\n\n Job.findOne({\n where: {\n job_id: jobId\n }\n })\n\n /*\n * Found the job, we can go ahead and take what we need from it.\n */\n\n .then((job) => {\n\n var employerId = job.posted_by;\n\n /*\n * Now delete the job and any associated stuff \n * for that job.\n */\n\n ReqHelper.forceDeleteJob(jobId)\n\n .then((result) => {\n\n Employer.methods.getEmployerInfoById(employerId)\n\n .then((employer) => {\n\n /*\n * Now send the mail to the employer of the job.\n */\n\n if (employer[0] !== null && employer[0] !== undefined) {\n\n var employerName = employer[0].user_firstName + \" \" + employer[0].user_lastName\n var email = employer[0].user_email\n var jobTitle = job.title\n\n Mailer.queueJobRejectedEmail(employerName, email, jobTitle, req.decoded.userId)\n\n /*\n * Successfully queued the job rejected email.\n */\n\n .then(() => {\n\n /*\n * Resolve the request.\n */\n\n res.status(200).json({\n message: 'Successfully removed the job that was rejected.'\n })\n\n })\n\n /*\n * Failued to queue the job rejected email.\n */\n\n .catch((err) => {\n\n res.status(500).json({\n message: 'Failed to queue the job rejected email.',\n success: false\n })\n\n }) \n\n } \n\n else {\n\n res.status(404).json({\n message: 'Apparently there was no employer found to send an email to'\n })\n\n }\n\n })\n\n /*\n * Some issue trying to get the employer info.\n */\n\n .catch((err) => {\n\n console.log(err)\n\n res.status(500).json({\n message: 'There was a problem acquiring employer information to send en email.'\n })\n\n\n })\n\n })\n\n /*\n * There was a problem deleting all the material\n * in the database for that job.\n */\n\n .catch((err) => {\n\n console.log(err)\n\n res.status(500).json({\n message: 'Problem deleting job from db.'\n })\n\n })\n\n })\n\n .catch((err) => {\n console.log(err)\n\n res.status(500).json({\n message: \"Problem actually finding the job to delete from jobid=\" + jobId\n })\n\n })\n }", "title": "" }, { "docid": "8b642474476c696569166ec50a8b38c3", "score": "0.4344182", "text": "function handleFinish(values) {\n job.current = getJob(values, job.current, writeMessage);\n setBusy(job.current.pendingTime);\n }", "title": "" }, { "docid": "9e99bc47876e731a31d948bdeb4a99c2", "score": "0.4344158", "text": "function requeueJob() {\n var dialogInstance = $uibModal.open({\n templateUrl: 'components/confirmation-dialog/confirmation-dialog.view.html',\n controller: 'ConfirmationDialogController',\n controllerAs: 'confirmationDialogCtrl',\n resolve: {\n confirmationText: function() {\n return 'This will re-submit the job for execution. Are you sure?';\n }\n }\n });\n\n dialogInstance.result.then(function(accept) {\n if (accept) {\n var jobData = vm.job;\n JobsManager.createJob(jobData).then(function(job) {\n scope.jobId = job.id;\n vm.job = job;\n });\n }\n });\n }", "title": "" }, { "docid": "ef5a60edce0eebcb7b51d4fc33152087", "score": "0.43435338", "text": "function queueJob(job, callback) {\n if (typeof (job) === 'undefined') {\n return callback(new wf.BackendInternalError(\n 'WorkflowRedisBackend.queueJob job(Object) required'));\n }\n var multi = client.multi();\n var p;\n\n for (p in job) {\n if (typeof (job[p]) === 'object') {\n job[p] = JSON.stringify(job[p]);\n }\n }\n\n if (typeof (job.created_at) === 'string') {\n job.created_at = String(new Date(job.created_at).getTime());\n }\n if (typeof (job.exec_after) === 'string') {\n job.exec_after = String(new Date(job.exec_after).getTime());\n }\n\n return client.lrem('wf_running_jobs', 0, job.uuid,\n function (err, res) {\n if (err) {\n log.error({err: err});\n return callback(new wf.BackendInternalError(err));\n }\n\n if (res <= 0) {\n return callback(new wf.BackendPreconditionFailedError(\n 'Only running jobs can be queued again'));\n }\n job.execution = 'queued';\n multi.srem('wf_runner:' + job.runner_id, job.uuid);\n multi.rpush('wf_queued_jobs', job.uuid);\n multi.hmset('job:' + job.uuid, job);\n multi.hdel('job:' + job.uuid, 'runner_id');\n return multi.exec(function (err, replies) {\n if (err) {\n log.error({err: err});\n return callback(new wf.BackendInternalError(err));\n } else {\n return getJob(job.uuid, callback);\n }\n });\n });\n }", "title": "" }, { "docid": "8f9be6eb9910313d8c3a689d08de4761", "score": "0.4340757", "text": "queueJob(name, job, callback) {\n return this.queue(name).queueJob(job, callback);\n }", "title": "" }, { "docid": "a81b768fd1a1228fab87cb4a0ea464af", "score": "0.43405423", "text": "ended (exitCode, detail) {\r\n if (this.cancelRequested) {\r\n this.setState('cancelled');\r\n this.append('Job cancelled.');\r\n } else {\r\n this.setState((exitCode > 0) ? 'errored' : 'ended');\r\n if (detail) {\r\n this.append(`Job ended with error: ${detail}`);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c1cbfc0fd3b2a14422aef3ee6cc6e2f0", "score": "0.43365884", "text": "startNotificationTask() {\n // Set up listeners on `bind` and `unbind` for notifications\n this.setupNotification('bind', 'unbind');\n // Create an async iterator for the `notification` event as a queue\n this.notificationQueue = (0, p_event_1.iterator)(this, 'notification', {\n // Do not end the iterator if an error event is emitted on the\n // subscription manager\n rejectionEvents: [],\n });\n return this.processNotifications();\n }", "title": "" }, { "docid": "53484fbba1b86c0344e020f737260bc7", "score": "0.4335754", "text": "function Notification(){}", "title": "" }, { "docid": "70345c00a800ebeedeb2bc4e56dc35b9", "score": "0.43355945", "text": "wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }", "title": "" }, { "docid": "191e2dd61357443339a83d255bd54a42", "score": "0.43343353", "text": "work() {}", "title": "" }, { "docid": "f878b79e2aa8a77da17d06431ac50d71", "score": "0.43340394", "text": "function job_status(client, data) {\n}", "title": "" }, { "docid": "ae9938263f014d4e022411c365d2a45f", "score": "0.43281728", "text": "success(notification) {\n notification = normalize(notification, \"success\");\n return notification;\n }", "title": "" }, { "docid": "7f23bc35eff4001e6ce4d529ca00f544", "score": "0.43233275", "text": "function PromiseReactionJob(reaction, argument) {\n var promiseCapability = reaction['[[Capabilities]]'];\n var handler = reaction['[[Handler]]'];\n var handlerResult, status;\n try {\n if (handler === 'Identity') handlerResult = argument;\n else if (handler === 'Thrower') throw argument;\n else handlerResult = handler.call(undefined, argument);\n } catch (handlerResult) {\n status = promiseCapability['[[Reject]]'].call(undefined, handlerResult);\n NextJob(status); return;\n }\n status = promiseCapability['[[Resolve]]'].call(undefined, handlerResult);\n NextJob(status);\n }", "title": "" }, { "docid": "dc84cbabc9ad7bd132393adbe8f4191a", "score": "0.43213037", "text": "watchExecution () {\n this.controller.runTree.on('start', (execution) => {\n const detail = JSON.stringify({\n type: 'executionStart',\n data: {\n execution: {\n executionId: execution.id,\n name: execution.name,\n staticTree: execution.staticTree,\n datetime: execution.datetime\n }\n }\n })\n\n if (this.isConnected) {\n const event = new window.CustomEvent('cerebral2.client.message', {detail})\n window.dispatchEvent(event)\n } else {\n this.backlog.push(detail)\n }\n })\n this.controller.runTree.on('end', (execution) => {\n const detail = JSON.stringify({\n type: 'executionEnd',\n data: {\n execution: {\n executionId: execution.id\n }\n }\n })\n this.latestExecutionId = execution.id\n\n if (this.isConnected) {\n const event = new window.CustomEvent('cerebral2.client.message', {detail})\n window.dispatchEvent(event)\n } else {\n this.backlog.push(detail)\n }\n })\n this.controller.runTree.on('pathStart', (path, execution, funcDetails) => {\n const detail = JSON.stringify({\n type: 'executionPathStart',\n data: {\n execution: {\n executionId: execution.id,\n functionIndex: funcDetails.functionIndex,\n path\n }\n }\n })\n\n if (this.isConnected) {\n const event = new window.CustomEvent('cerebral2.client.message', {detail})\n window.dispatchEvent(event)\n } else {\n this.backlog.push(detail)\n }\n })\n this.controller.runTree.on('functionStart', (execution, funcDetails, payload) => {\n const detail = JSON.stringify({\n type: 'execution',\n data: {\n execution: {\n executionId: execution.id,\n functionIndex: funcDetails.functionIndex,\n payload,\n data: null\n }\n }\n })\n\n if (this.isConnected) {\n const event = new window.CustomEvent('cerebral2.client.message', {detail})\n window.dispatchEvent(event)\n } else {\n this.backlog.push(detail)\n }\n })\n }", "title": "" }, { "docid": "e1bfab98f8a442ad1dd1d64a8c0cd445", "score": "0.43201593", "text": "function Fay$$then(a){\n return function(b){\n return Fay$$bind(a)(function(_){\n return b;\n });\n };\n}", "title": "" }, { "docid": "e7e2354a7b50cec03182a59eb71bc23d", "score": "0.43162546", "text": "function callbackified(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i])}var maybeCb=args.pop();if(typeof maybeCb!==\"function\"){throw new TypeError(\"The last argument must be of type Function\")}var self=this;var cb=function(){return maybeCb.apply(self,arguments)};// In true node style we process the callback on `nextTick` with all the\n// implications (stack, `uncaughtException`, `async_hooks`)\noriginal.apply(this,args).then(function(ret){process.nextTick(cb.bind(null,null,ret))},function(rej){process.nextTick(callbackifyOnRejected.bind(null,rej,cb))})}", "title": "" }, { "docid": "b7b92522614ac6d8b44b631b9920d7e9", "score": "0.43159628", "text": "async end(job, success, results) {\n // context object gets an update to avoid a\n // race condition with checkStopped\n job.ended = true;\n return self.db.updateOne({ _id: job._id }, {\n $set: {\n ended: true,\n status: success ? 'completed' : 'failed',\n results: results\n }\n });\n }", "title": "" }, { "docid": "bd0abb41aa3fbc7ebf93e4d5c523fa95", "score": "0.43074346", "text": "success(notification) {\n notification = normalize(notification)\n notification.level = 'success'\n this.dispatch(notification)\n }", "title": "" }, { "docid": "0bbb9dfc214457a68bf076740ebc8666", "score": "0.43044102", "text": "removeWaitingJob(job) {\n this.waitingQueue = this.waitingQueue.filter(function(item) {\n return item !== job;\n });\n }", "title": "" }, { "docid": "bf422dc6c1f7d7225faa201ae1efeaa2", "score": "0.4302125", "text": "t5 () {\n return WorkerWrapper.run((arg1, arg2) => `Run ${arg1} and ${arg2}`)\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "title": "" }, { "docid": "bc731c0d526b553f2ab930394ce15404", "score": "0.4285186", "text": "function _decodeJob(job, callback) {\n [\n 'chain',\n 'onerror',\n 'chain_results',\n 'onerror_results',\n 'oncancel',\n 'oncancel_results',\n 'params',\n 'num_attempts'\n ].forEach(function (property) {\n try {\n job[property] = JSON.parse(job[property]);\n } catch (e) {}\n });\n\n // exec_after when saved as a timestamp comes back from Redis as a\n // string and cannot be parsed properlly by Date object\n if (isNaN(new Date(job.exec_after).getTime())) {\n job.exec_after = Number(job.exec_after);\n }\n if (isNaN(new Date(job.created_at).getTime())) {\n job.created_at = Number(job.created_at);\n }\n return callback(job);\n }", "title": "" }, { "docid": "da2574c20439d4b47846b447a0042e14", "score": "0.4283738", "text": "processQueue() {\n jobs.forEach(job => {\n const { bee, handle } = this.queues[job.key];\n bee.on('failed', this.hadleFailure).process(handle);\n });\n }", "title": "" }, { "docid": "7d553b2daa0e2992267feccc4a9625ba", "score": "0.4280816", "text": "function query(job) {\n ruser.io('/r/job/query')\n .data({ job: job })\n .end(function(res) {\n console.log('Job Status=' + res.get('status') + ' rJob=' + job);\n\n jobPending = res.get('status') !== 'Completed';\n\n if (!jobPending) { \n console.log('AuthJobExecuteCode: retrieved background ' +\n 'job result on project, rJob=' + res.get('job').job);\n }\n }); \n}", "title": "" }, { "docid": "ca5d12934a1218e26baeb487e794c898", "score": "0.4277007", "text": "function job() {\n return new Promise(function(resolve, reject) {\n setTimeout(reject, 500, 'Error happened');\n });\n}", "title": "" }, { "docid": "82db91060dd344242ac9cf2a54539510", "score": "0.42598325", "text": "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}", "title": "" }, { "docid": "f80d1b6a015bc5089465db3c2ecd09e1", "score": "0.42563942", "text": "function handle(log, config, environment, job, handlerCallback) {\n log.debug('vler-das-xform-vpr-handler.handle : received job %j', job);\n\n if (!job) {\n log.error('vler-das-xform-vpr-handler.handle : Job was null or undefined');\n return setTimeout(handlerCallback, 0, errorUtil.createFatal('No job given to handle'));\n }\n\n if (!job.type || job.type !== jobUtil.vlerDasXformVprType()) {\n log.error('vler-das-xform-vpr-handler.handle : job type was invalid: %s', job.type);\n return setTimeout(handlerCallback, 0, errorUtil.createFatal('Incorrect job type'));\n }\n\n if (!jobUtil.isValid(jobUtil.vlerDasXformVprType(), job)) {\n log.error('vler-das-xform-vpr-handler.handle : job was invalid jpid=%s', job.jpid);\n return setTimeout(handlerCallback, 0, errorUtil.createFatal('Invalid job'));\n }\n\n let document = job.record;\n\n let kind = _.get(document, 'kind');\n let xmlDoc = _.get(document, 'xmlDoc');\n\n convertXmltoHtml(log, xmlDoc, kind, function(htmlDoc) {\n compressHtml(log, config, htmlDoc, function(resultHtml, compressed) {\n let vprVlerDocument = vlerDasDocumentToVPR(document, resultHtml, kind, job.requestStampTime, compressed);\n createAndPublishJob(log, environment, job, vprVlerDocument, handlerCallback);\n });\n });\n}", "title": "" }, { "docid": "e764568a65ad975ea9f110882a496a7c", "score": "0.42559284", "text": "function interQues(job){\n if(job === 'teacher'){\n return function(name){\n console.log(name + 'is a teacher')\n }\n }\n else if (job === 'Desiger'){\n return function(name){\n console.log(name + 'is a designer')\n }\n }\n else{\n return function(name){\n console.log(name + 'What do you do')\n }\n }\n}", "title": "" } ]
0780b259087e8648ffd58d17cb2f9c57
run a bunch of calls in series.. test will fail if any return an error
[ { "docid": "2c29c422f768cb8241b05b47e4a48d0b", "score": "0.0", "text": "function createApp(vmc, appName, appDir, cb) {\n async.series([\n function(callback) { vmc.login(callback);},\n function(callback) { vmc.deleteApp(appName, function(err, data){ callback();});}, // ignore any error from delete\n function(callback) { vmc.push(appName, appDir, callback);},\n function(callback) { vmc.deleteService('redis-' + appName, function(err, data){ callback();});}, // ignore any error from delete\n function(callback) { vmc.createService('redis-' + appName, 'redis', callback);},\n function(callback) { vmc.bindService('redis-' + appName, appName, callback);},\n function(callback) { vmc.start(appName, callback);},\n function(callback) { vmc.addEnv(appName, 'variable1', 'value1', callback);},\n function(callback) { vmc.delEnv(appName, 'variable1', callback);}\n ], cb);\n}", "title": "" } ]
[ { "docid": "47d5ea62b607e925de2a76a2e95bf502", "score": "0.68169314", "text": "runTests() {\n this.test1();\n this.test2();\n this.test3();\n this.keepAsking = false;\n }", "title": "" }, { "docid": "8039ea5a8e988a89769609812aa8c6ec", "score": "0.67657053", "text": "function callallfunctions(calls, callback) {\n async.series(calls, function(err, result) {\n /* this code will run after all calls finished the job or\n when any of the calls passes an error */\n\n if (err) {\n console.log('##############################');\n console.log(err);\n console.log('##############################');\n }\n console.log('##############################');\n console.log('all function called');\n console.log('##############################');\n callback(null, result)\n });\n}", "title": "" }, { "docid": "1028d28a2bedf25c8346cc1c390ba410", "score": "0.6691754", "text": "tests(before, done) {\n async.eachSeries(testCases, (testCase, testDone) => {\n runOneTest(before, testCase.testDescription, testCase.testMethod, testDone);\n }, done);\n }", "title": "" }, { "docid": "58f5f070e2f723c34a2a6e81d9d50ce5", "score": "0.66201776", "text": "function run_all_tests() {\n // client_tests = client_tests.sort(randOrd);\n // Run all the tests\n client_tests.forEach(function (t) { \n var function_name = t.name;\n try {\n t(); \n } catch(error) {\n sys.puts(sys.inspect(error));\n finished_test({function_name:error});\n }\n });\n}", "title": "" }, { "docid": "0b37c5ff83aff30125744998732b3982", "score": "0.6592014", "text": "runAll(callback) {\n\t\tthis.runOne((error, result) => {\n\t\t\tif (error)\n\t\t\t{\n\t\t\t\tconsole.error('Error in test %s: %s', this.name, error);\n\t\t\t}\n\t\t\tif (result)\n\t\t\t{\n\t\t\t\tconsole.log('Finished test %s: %s', this.name, result.getSummary());\n\t\t\t}\n\t\t\tif (this.finished)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.finished = true;\n\t\t\tcallback(error, result);\n\t\t})\n\t}", "title": "" }, { "docid": "a35eb547e8ca930936642f07400b9a61", "score": "0.6580461", "text": "function runTests(tests) {\r\n var currentTest = tests.shift();\r\n\r\n while (currentTest) {\r\n try {\r\n console.log('Running test ' + currentTest.name);\r\n currentTest.call();\r\n currentTest = tests.shift();\r\n } catch (e) {\r\n console.log(\r\n 'Failed: ' + currentTest.name + '\\nwith exception: ' + e.message);\r\n\r\n fail();\r\n }\r\n }\r\n\r\n // All tests passed.\r\n pass('');\r\n }", "title": "" }, { "docid": "762bde2dc25f27b60094a241f4e1cc96", "score": "0.65756494", "text": "runTests(runOptions, panic, next) {\n let fired = false;\n let {\n tests,\n value,\n originalValue,\n path,\n options\n } = runOptions;\n let panicOnce = arg => {\n if (fired) return;\n fired = true;\n panic(arg, value);\n };\n let nextOnce = arg => {\n if (fired) return;\n fired = true;\n next(arg, value);\n };\n let count = tests.length;\n let nestedErrors = [];\n if (!count) return nextOnce([]);\n let args = {\n value,\n originalValue,\n path,\n options,\n schema: this\n };\n for (let i = 0; i < tests.length; i++) {\n const test = tests[i];\n test(args, panicOnce, function finishTestRun(err) {\n if (err) {\n nestedErrors = nestedErrors.concat(err);\n }\n if (--count <= 0) {\n nextOnce(nestedErrors);\n }\n });\n }\n }", "title": "" }, { "docid": "e8128cd77c7198a4817fdd186fa4eadf", "score": "0.6486899", "text": "function run_tests() {\n var passcount = 0;\n for ( var i = 0; i < this.tests.length; i++ ) {\n var pack = this.tests[i];\n try {\n var theVal = pack[THE_FUNC].apply(null,pack[THE_IN]);\n\n if ( pack[THE_PASSCRASH] != 'crash' && !pack[THE_OP](theVal,pack[THE_OUT]) )\n printLine('Test ' + i + ' failed:\\n' + pack[THE_OUT] + '\\n' +\n pack[THE_NEGSTRING] + '\\n' + theVal );\n else if ( pack[THE_PASSCRASH] == 'crash' )\n printLine('Test ' + i + ' was expected to crash with error ' +\n pack[THE_ERR] + ' but did not.')\n else\n passcount += 1;\n }\n catch (err) {\n if ( pack[THE_PASSCRASH] == 'crash' && err == pack[THE_OUT] )\n passcount += 1;\n else if ( pack[THE_PASSCRASH] == 'crash' )\n printLine('Test ' + i + ' was expected to crash with error ' +\n pack[THE_ERR] + ' but crashed with '+ err +'.')\n else\n printLine('Test ' + i + ' crashed with error: '+err+'.');\n }\n }\n printLine( 'Tests : ' + passcount + \"/\" + this.tests.length + ' passed' );\n}", "title": "" }, { "docid": "4784be443f30e81d5bc507478a72489e", "score": "0.6471147", "text": "static callAll(pa /*, ... each subsequent arg is a function to handle the result of the next promise in pa */) {\n const args = arguments;\n return new Promise(function (resolve, reject) {\n Promise.all(pa).then(function (ret) {\n for (let i = 0; i < ret.length; i++)\n if (!ret[i]._Success) {\n resolve(true); // error\n return;\n }\n for (let i=1 ; i < args.length && i <= ret.length ; i++) {\n let fun = args[i];\n if (fun)\n fun(ret[i-1]);\n }\n resolve(false); // success\n });\n });\n }", "title": "" }, { "docid": "37f5bc9f961b5a4c5633180d4bc4e484", "score": "0.6440382", "text": "async function run() {\n let testcount = 0;\n const results = await Promise.all(promises);\n const failGroups = results.filter(r => !r.success).map(r => r.groupName);\n for (let result of results) {\n testcount++;\n if (!failGroups.includes(result.groupName)) {\n continue;\n }\n console.log(\n `%c${result.groupName}/${result.unitName} ${result.success ? 'OK' : 'FAIL'}`,\n `color: ${result.success ? 'darkgreen' : 'darkred'}`\n )\n }\n const failures = failGroups.length;\n const successes = testcount - failures;\n console.log(\n `%c${testcount} tests, ${successes} successes, ${failures} failures.`,\n 'color: darkblue',\n );\n }", "title": "" }, { "docid": "279b2701bebb28c2af52ba58d8f6f1be", "score": "0.63101697", "text": "async function runTests(runs) {\n\tconst sizes = [500, 1000, 2000, 4000, 8000, 16000, 32000, 64000];\n\n\tconsole.time(\"10k runs async\");\n\tasync.eachLimit(sizes, 1, (item, next) => {\n\t\tconst parallel_limit = process.env.UV_THREADPOOL_SIZE || 4;\n\n\t\tasync.timesLimit(runs, parallel_limit, (run, runCb) => {\n\t\t\trunTestASync(item, (err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\trunCb(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\trunCb();\n\t\t\t});\n\t\t}, (err) => {\n\t\t\tif (err) {\n\t\t\t\tnext(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnext();\n\t\t});\n\t}, (err) => {\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.timeEnd(\"10k runs async\");\n\t\t\n\t\tconsole.time(\"10k runs sync\");\n\t\tasync.timesLimit(runs, 1, (run, next) => {\n\t\t\tasync.eachLimit(sizes, 1, (item, cb) => {\n\t\t\t\trunTestSync(item, (err) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tcb(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tcb();\n\t\t\t\t})\n\t\t\t}, (err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tnext(err);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tnext();\n\t\t\t});\n\t\t}, (err) => {\n\t\t\tif (err) {\n\t\t\t\tconsole.error(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconsole.timeEnd(\"10k runs sync\");\n\n\t\t\tconsole.log(\"done running all tests\");\n\t\n\t\t\tfor (let i = 0; i < sizes.length; i++) {\n\t\t\t\tconsole.log(\"==============================\");\n\t\t\t\tconsole.log(\"current size:\", sizes[i]);\n\t\t\t\tconsole.log(\"deflate async:\", times[sizes[i]].deflate_async.reduce((a, b) => { return a + b; }) / (times[sizes[i]].deflate_async.length + 1) + \"ms\");\n\t\t\t\tconsole.log(\"inflate async:\", times[sizes[i]].inflate_async.reduce((a, b) => { return a + b; }) / (times[sizes[i]].inflate_async.length + 1) + \"ms\");\n\t\t\t\tconsole.log(\"deflate sync:\", times[sizes[i]].deflate_sync.reduce((a, b) => { return a + b; }) / (times[sizes[i]].deflate_sync.length + 1)+ \"ms\");\n\t\t\t\tconsole.log(\"inflate sync:\", times[sizes[i]].inflate_sync.reduce((a, b) => { return a + b; }) / (times[sizes[i]].inflate_sync.length + 1) + \"ms\");\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "8c9419829966297f6e8e89353365c549", "score": "0.630347", "text": "function TestRunner_runAll( result ) \n{ \n this.mElapsedTime = new Date();\n this.mSuites.run( result ); \n this.mElapsedTime = new Date() - this.mElapsedTime;\n}", "title": "" }, { "docid": "49f17fd185e14cb0911c1bf2550d87af", "score": "0.62936866", "text": "run() {\n console.log(new Date().toISOString(), '[Test]', 'Running the test');\n const promiseArray = [weather.getWeather(this), news.getNews(this), weather.getWeatherMap(this)];\n Promise.all(promiseArray)\n .then((data) => {\n this.setResults('news', data[1]);\n this.setResults('weather', data[0]);\n this.setResults('map', data[2]);\n })\n .catch((err) => {\n this.setError(err);\n });\n\n }", "title": "" }, { "docid": "9b7e58b467eb16fbb0a615c46d40de37", "score": "0.6273448", "text": "startTests(){\n //loops through testArray\n testArray.forEach(function(test){\n //triggers run from the array\n test.run();\n });\n }", "title": "" }, { "docid": "f8e2c69bd5551435fec82b8bff063e53", "score": "0.62107635", "text": "run() {\n let startTime = Date.now();\n const funcDomain = domain.create();\n funcDomain.on('error', e => {\n if (e instanceof BailoutError) this._end();\n else this.erroer('unhandledException', e);\n });\n process.nextTick(() => {\n startTime = Date.now();\n funcDomain.run(() => {\n this.runNow();\n if (!this.options.async) {\n this.waitingSubtests = true;\n process.nextTick(() => {\n if (!this.done && !this._hasPendingSubtests()) this.end();\n });\n }\n });\n });\n this.on('done', () => {\n this.metadata.time = Date.now() - startTime;\n funcDomain.exit();\n });\n }", "title": "" }, { "docid": "cd9b4c4a9250208e816229a30f050536", "score": "0.6182503", "text": "function _runTests () {\n\t\tif ( _testRunning || _lastRunTest >= _tests.length ) {\n\t\t\treturn false;\n\t\t}\n\t\t_testRunning = true;\n\t\tvar test = _lastRunTest++;\n\t\tif ( _isNode ) {\n\t\t\tprocess.nextTick( function () { runTest( test ); } );\n\t\t}\n\t\telse {\n\t\t\tsetTimeout( function () { runTest( test ); }, 1 );\n\t\t}\n\t}", "title": "" }, { "docid": "cb4592daf197b5e0065795239cf2ea95", "score": "0.6180136", "text": "function exec() {\n\tif (tests.some(isOnly)) tests.forEach(deRank)\n\tsetTimeout(runNext, 0)\n}", "title": "" }, { "docid": "db3762c7e932e70df7b306585db7a294", "score": "0.61713654", "text": "async testAll(...args) {\n const container = containers.get(this);\n return this.parallel(list => {\n apparatusLogic_1.eachTest(container.suite, (test) => {\n if (test !== container.test) { // infinite recursion safety\n list.push(container.runtime.processTest(container.suite, container.test, test, args.slice()));\n }\n });\n });\n }", "title": "" }, { "docid": "c955a331906e45060b6a9655ab38c466", "score": "0.6132218", "text": "function run() {\n // `run` runs all the tests in the `tests` array\n tests.forEach(test => {\n // For each test, we try to execute the\n\t\t// provided function. \n try {\n test.fn()\n // If there is no exception\n\t\t\t// that means it ran correctly\n console.log('✅', test.name)\n\n } catch(e) {\n // Exceptions, if any, are caught\n\t\t\t// and the test is considered failed\n console.log('❌', test.name)\n\n // the stack error\n console.log(e.stack)\n }\n })\n}", "title": "" }, { "docid": "50225d0ad680bbc143e08d12c791141f", "score": "0.6080277", "text": "function testRun()\n{\n\tconst successes = {\n\t\ta: function(callback) {\n\t\t\tcallback(null, 'a');\n\t\t},\n\t\tb: [function(callback) {\n\t\t\tcallback(null, 'b0');\n\t\t}, function two(callback) {\n\t\t\tcallback(null, 'b1');\n\t\t}],\n\t};\n\trunAll(successes, function(error, result) {\n\t\tconsole.assert(result.success, 'Root should be success');\n\t\tconsole.assert(result.results.a, 'Should have result for a');\n\t\tconsole.assert(result.results.a.success, 'Should have success for a');\n\t\tconsole.assert(result.results.a.message == 'a', 'Should have an a for a');\n\t\tconsole.assert(result.results.b, 'Should have result for b');\n\t\tconsole.assert(result.results.b.success, 'Should have success for b');\n\t\tconsole.assert(result.results.b.results[0], 'Should have result for b[0]');\n\t\tconsole.assert(result.results.b.results[0].success, 'Should have success for b[0]');\n\t\tconsole.assert(result.results.b.results[0].message == 'b0', 'Should have b0 for b[0]');\n\t\tconsole.assert(result.results.b.results.two, 'Should have result for two');\n\t\tconsole.assert(result.results.b.results.two.success, 'Should have success for two');\n\t\tconsole.assert(result.results.b.results.two.message == 'b1', 'Should have b1 for two');\n\t\tconsole.log('Test run successfully without failures: %s', result);\n\t});\n\tconst failures = {\n\t\tc: {\n\t\t\td: function(callback) {\n\t\t\t\tcallback('d');\n\t\t\t},\n\t\t\te: function(callback) {\n\t\t\t\tcallback(null, 'e');\n\t\t\t},\n\t\t\tf: function() {\n\t\t\t\tthrow new Error('exception');\n\t\t\t},\n\t\t},\n\t}\n\trunAll(failures, function(error) {\n\t\tconsole.log(error)\n\t\tconsole.assert(error.failure, 'Root should be failure');\n\t\tconsole.assert(error.results.c, 'Should have result for b');\n\t\tconsole.assert(error.results.c.failure, 'Should have failure for c');\n\t\tconsole.assert(error.results.c.results.d, 'Should have result for c.d');\n\t\tconsole.assert(error.results.c.results.d.message == 'd', 'Should have a d for c.d');\n\t\tconsole.assert(error.results.c.results.e, 'Should have result for c.e');\n\t\tconsole.assert(error.results.c.results.e.success, 'Should have success for c.e');\n\t\tconsole.assert(error.results.c.results.e.message == 'e', 'Should have an e for c.e');\n\t\tconsole.assert(error.results.c.results.f, 'Should have result for c.f');\n\t\tconsole.assert(error.results.c.results.f.failure, 'Should have failure for b.e');\n\t\tconsole.log('Test run successful with 2 failures: %s', error);\n\t})\n}", "title": "" }, { "docid": "ee3c9b483d9b071880b77a37ce097c71", "score": "0.6074715", "text": "async function run(iteration: number) {\n let decisions = [];\n for (let i = 0; i <= DEFAULT_COINS.length - 1; i++) {\n try {\n decisions = await check(DEFAULT_COINS[i], iteration);\n } catch (e) {\n logIt({\n form: \"error\",\n message: e\n });\n break;\n }\n\n if (Array.isArray(decisions)) {\n decisions.map(({ id, advice, message }) =>\n logIt({\n form: \"notice\",\n message\n })\n );\n }\n console.log(\"-----------\");\n }\n console.log(\">>>>>>>>>>>>\");\n logIt({\n form: \"notice\",\n message: \"RUN COMPLETE >>>\"\n });\n logIt({\n message: `checking again in 1 minute`\n });\n if (iteration / FIFTEEN_MINS_MS) {\n logIt({\n message: `messaging user within the next minute.`\n });\n }\n console.log(\">>>>>>>>>>>>\");\n}", "title": "" }, { "docid": "220b44f3346e0221e726a928054a0a39", "score": "0.6067438", "text": "function next() {\n var t = tests.shift();\n if (t)\n run(t);\n else if (callback)\n callback(suite);\n }", "title": "" }, { "docid": "486cb5375c95fa5f47a92b707bcf6024", "score": "0.6052664", "text": "function retryAll() {\r\n}", "title": "" }, { "docid": "bbeafc94abba2d6e60ea2a9721750e08", "score": "0.6045751", "text": "async function runTests() {\n //Grabs the name of each method in the table and does callAPI function\n methods.forEach(function (method) {\n const methodName = method.innerHTML;\n callAPI(methodName);\n });\n}", "title": "" }, { "docid": "0e240e8f68afdea152917a6b79ffdf48", "score": "0.6034871", "text": "function tryToRun(fn, times, onFailed) {\n times = ~~times || 5;\n var delayTime = 250;\n function nextCycle() {\n if (!times--) {\n if (onFailed)\n { onFailed(); }\n return;\n }\n try {\n if (fn())\n { return; }\n }\n catch (e) { }\n setTimeout(nextCycle, delayTime);\n delayTime *= 2;\n }\n setTimeout(nextCycle, 0);\n }", "title": "" }, { "docid": "b294e6e9db6dc0936727776e6c527ad5", "score": "0.6004172", "text": "function runTests(statements, delay) {\n var con1 = connect();\n var con2 = connect();\n\n enableLockMonitor(con1);\n createTestData(con1);\n\n var promise = Q();\n\n statements.forEach(function buildPromiseForTest(statement) {\n if (Array.isArray(statement)) {\n // Run two statements against each other\n var statement2 = statement[1];\n statement = statement[0];\n } else {\n // Run the same statement against itself\n statement2 = statement;\n }\n promise = promise\n .then(function runOneTest() {\n return runTest(con1, con2, statement, statement2, delay);\n })\n .then(logStatus.bind(null, statement));\n });\n\n promise.done(function tearDown() {\n disableLockMonitor(con1);\n con1.end();\n con2.end();\n });\n }", "title": "" }, { "docid": "14f2614c3c00cdf92d48335a68ec3479", "score": "0.599708", "text": "function runTest1() { //function runs test 1 when called.\n firstThing(\"TEST 1\");\n secondThing(\"TEST 1\");\n thirdThing(\"TEST 1\");\n}", "title": "" }, { "docid": "c0f093eeb0b939c342b2d1d87e8be921", "score": "0.59045845", "text": "function RUN_ALL_TESTS() {\n console.log('> itShouldMeasureExecutionTime');\n measuringExecutionTime();\n itShouldEmailDataRow();\n}", "title": "" }, { "docid": "9f9e2496b11699b001d0d04db09a3489", "score": "0.59040093", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleepIn(true, false);\n document.getElementById(\"output\").innerHTML += nextOne(true, false);\n //test third method, etc\n}", "title": "" }, { "docid": "9f9e2496b11699b001d0d04db09a3489", "score": "0.59040093", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleepIn(true, false);\n document.getElementById(\"output\").innerHTML += nextOne(true, false);\n //test third method, etc\n}", "title": "" }, { "docid": "9f9e2496b11699b001d0d04db09a3489", "score": "0.59040093", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleepIn(true, false);\n document.getElementById(\"output\").innerHTML += nextOne(true, false);\n //test third method, etc\n}", "title": "" }, { "docid": "ad2bfb4d993ec09609cff97d3e487f08", "score": "0.58690107", "text": "function runShTest(golden, test) {\n for (let i = 3; --i >= 0;) {\n if (golden === '_ERR_') {\n expect(test).to.throw();\n } else {\n let result = uw(test());\n expect(golden).to.equal(result);\n }\n }\n}", "title": "" }, { "docid": "6c0e4045db4bef935c4b37bcd8c74a15", "score": "0.58650684", "text": "function test_host_refresh_multiple() {}", "title": "" }, { "docid": "7bb0c234bd4993290370a8fba7a62980", "score": "0.58638716", "text": "async runTests () {\n const success = await this.downloadLogs()\n if (!success) {\n console.log('Issue with download logs. Exiting')\n return\n }\n\n await this.usageReport()\n\n await this.endpointReport()\n\n await this.errorReport()\n\n // utils.log(`log analysis complete.`);\n utils.log(' ')\n }", "title": "" }, { "docid": "4a25e1b06bb16c1638df18ae7c3fea09", "score": "0.58598614", "text": "function runSetups( callback ) {\n var i = 0; // Remember: Each setup function could be asynchron\n runSetup(); // and must performed sequentially\n function runSetup() { // to avoid mutual influence.\n if ( i === setups.length )\n return callback();\n setups[ i++ ]( suite, runSetup ); // recursive call\n }\n }", "title": "" }, { "docid": "8781873a1661f29d6a9772e95ad0c3dc", "score": "0.585895", "text": "runOne(callback) {\n\t\tif (isEmpty(this.series))\n\t\t{\n\t\t\treturn callback(null, this.result);\n\t\t}\n\t\tfor (const key in this.series)\n\t\t{\n\t\t\tconst value = this.series[key];\n\t\t\tif (!value)\n\t\t\t{\n\t\t\t\treturn callback('Empty test for ' + key);\n\t\t\t}\n\t\t\telse if (typeof value == 'object')\n\t\t\t{\n\t\t\t\tconst runner = new Runner(key, value);\n\t\t\t\treturn runner.runAll(error => {\n\t\t\t\t\tif (error)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.error('Could not run all functions');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.result.add(runner.result);\n\t\t\t\t\tthis.deleteAndRunNext(key, callback);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse if (typeof value == 'function')\n\t\t\t{\n\t\t\t\tlet testName = key;\n\t\t\t\tif (isNumber(key) && value.name)\n\t\t\t\t{\n\t\t\t\t\ttestName = value.name;\n\t\t\t\t}\n\t\t\t\t// it is a function to run\n\t\t\t\tnext = this.getNext(key, testName, callback);\n\t\t\t\tif (value.length == 0) {\n\t\t\t\t\treturn value().then(result => next(null, result)).catch(error => next(error))\n\n\t\t\t\t} else {\n\t\t\t\t\treturn value(next);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.error('Key %s has an invalid value %s', key, value);\n\t\t\t\treturn this.deleteAndRunNext(key, callback);\n\t\t\t}\n\t\t\t// only the first element in the series is used;\n\t\t\t// the rest are called by recursion in deleteAndRunNext()\n\t\t}\n\t}", "title": "" }, { "docid": "1d3f3058cb9004b19ba54de96b4fe1b2", "score": "0.5849686", "text": "function runMulti() {\n\n var interval = cli.interval || 100\n log('Multi called: ' + cli.multi + ' with interval ' + interval)\n\n var instances = []\n for (var i = 0; i < cli.multi; i++) {\n instances.push(i)\n }\n\n async.each(instances, runInstance, finish)\n\n // Start instances <interval> miliseconds apart\n function runInstance(i, next) {\n setTimeout(function() {\n log('Starting instance ' + i)\n reporter.run(tests, false, function(err) {\n log('Instance ' + i + ' finished')\n next(err)\n })\n }, i * interval)\n }\n}", "title": "" }, { "docid": "6fc8d45c366ca3a502acb4874c8c8695", "score": "0.5834681", "text": "function RunNextSetup() {\n if (index < length) {\n try {\n suite.benchmarks[index].Setup();\n } catch (e) {\n suite.NotifyError(e);\n return null;\n }\n return RunNextBenchmark;\n }\n suite.NotifyResult();\n return null;\n }", "title": "" }, { "docid": "bd05d186ac76932bceaa8c4e0cf33d45", "score": "0.5825933", "text": "function makeCall(svcConfig, params) {\n \n if ( counter == null ){\n counter = 1;\n }\n \n while ( counter != 0 ){\n if ( mockCall ) {\n result = service.setMock().call(params);\n } else if ( pipelineError ) {\n result = service.setThrowOnError().call(params);\t\n } else {\n result = service.call(params);\n }\n counter--;\n }\n }", "title": "" }, { "docid": "ddb3b4995f95228cb4b505c0830a79c2", "score": "0.58164996", "text": "function executeNextFn() {\n var nextFunction = fn.shift();\n if (nextFunction) {\n if (index === 0) {\n\n nextFunction(args, function(err, result) {\n if (err) {\n return callback(err, null);\n } else if (result && result.status === 'failed') {\n return callback(null, result);\n } else if (result && result.status === 'success') {\n oResp = result;\n executeNextFn();\n }\n });\n\n index++;\n\n } else {\n\n nextFunction(args, oResp, function(err, result){\n if (err) {\n return callback(err, null);\n } else if (result && result.status === 'failed') {\n return callback(null, result);\n } else if (result && result.status === 'success') {\n oResp = result;\n executeNextFn();\n }\n });\n\n }\n } else {\n callback(null, oResp);\n }\n }", "title": "" }, { "docid": "500f3d27140f2b2b1901595cf7d42b98", "score": "0.5815833", "text": "function dispatchingTests(){\n console.log(\"----------Starting Dispatching Tests----------\")\n testQueue0()\n testQueue1()\n testQueue2()\n testQueue3()\n testQueue4()\n console.log(\"\\n\")\n}", "title": "" }, { "docid": "44220a78027ddfd3cb18d900314d6730", "score": "0.5804728", "text": "function runTests() {\r\n // parse through nodes array and fire off tests\r\n scr.setHome(STARTX, STARTY);\r\n c.nodes.forEach((node) => {\r\n pos = scr.nextXY();\r\n runATest(pos, node);\r\n });\r\n}", "title": "" }, { "docid": "ceef0b0969eedda1b65559a4002a3263", "score": "0.57881653", "text": "function nextTest () {\n currentKey = keys[i++];\n if (currentKey) {\n test[currentKey](done);\n } else {\n sys.puts((\"FAILURES: \" + errCnt + \"/\" + keys.length + \"\\n\").magenta);\n } \n }", "title": "" }, { "docid": "b9ecc6496d064c2a5d7bafa1e21fea21", "score": "0.5786916", "text": "function runTestMethodsSeq(currentIndex, testMethods, contractObject, nextContract, nextMethod) {\n // if contract has no tests, then skip the test contract\n if (testMethods.length === 0) {\n // Test contract is complete\n nextContract();\n return;\n }\n\n // the next method index to test\n const nextIndex = currentIndex + 1;\n\n // assemble tx object\n const methodTxObject = Object.assign({}, txObject);\n const methodName = testMethods[currentIndex].name;\n const methodReport = {\n txObject: methodTxObject,\n index: currentIndex,\n name: methodName,\n receipt: {},\n status: 'success',\n logs: [],\n uncaughtThrow: false,\n startTime: ((new Date()).getTime()),\n duration: 0,\n };\n\n // fire testmethod tx\n const fireTestMethod = () => {\n // assert true log\n const assertEqLogEvent = contractObject.AssertEqLog({}, {}); // eslint-disable-line\n\n // fire after each method\n const afterEachMethod = () => {\n contractObject.afterEach(Object.assign({}, methodTxObject), (afterEachError, afterEachTxHash) => {\n if (afterEachError) {\n throwError(`while firing afterEach method after method ${methodName}: ${afterEachError}`);\n } else {\n getTransactionSuccess(web3, afterEachTxHash, (txSuccessError) => {\n if (txSuccessError) {\n throwError(`error while getting transaction method success for afterEach method after '${methodName}': ${txSuccessError}`);\n } else {\n completeMethod();\n }\n });\n }\n });\n };\n\n // setup fire test method after testing it\n const setupCompleteMethod = () => {\n // if after method available, fire it\n if (typeof contractObject[`after_${methodName}`] === 'function') {\n // before each\n contractObject[`after_${methodName}`](Object.assign({}, methodTxObject), (afterError, afterTxHash) => {\n if (afterError) {\n throwError(`while firing before_${methodName} after method ${methodName}: ${afterError}`);\n } else {\n getTransactionSuccess(web3, afterTxHash, (txSuccessError) => {\n if (txSuccessError) {\n throwError(`error while getting transaction method success for method 'after_${methodName}' before method '${methodName}': ${txSuccessError}`);\n } else {\n // fire after each method, then complete test\n afterEachMethod();\n }\n });\n }\n });\n } else {\n // complete afterEach method then complete test\n afterEachMethod();\n }\n };\n\n // complte out method, no errors\n const completeMethod = () => {\n // calculate duration\n methodReport.duration = ((new Date()).getTime()) - methodReport.startTime;\n\n // report all non comparison logs\n methodReport.logs.forEach((methodLog, methodLogIndex) => {\n // if it is not a comparison log\n if (methodLog.comparison === false) {\n const message = methodLog.args._message; // eslint-disable-line\n const logValue = methodLog.args._logValue; // eslint-disable-line\n\n // report uint log\n report(`\n -----------------\n\n ${chalk.green('log uint256 value')}\n index: ${methodLogIndex}\n value: ${logValue}\n message: ${message}\n `);\n }\n });\n\n // compiling contracts\n if (methodReport.status === 'failure') {\n report(` ${chalk.red(symbols.err)} ${chalk.dim(methodName)} ${chalk.red(`(${methodReport.duration}ms)`)}`);\n\n // if the log status is a failure log\n if (methodReport.uncaughtThrow === true) {\n report(`\n -----------------\n\n ${chalk.red('assertion failed (assertThrow)')}\n index: no index\n type: throw\n value (e): VM 'Invalid Jump'\n value (a): TX success\n message: Expected method to throw causing VM 'Invalid Jump', method transacted without invalid jump.\n `);\n }\n\n // cycle through logs and report errors\n methodReport.logs.forEach((methodLog, methodLogIndex) => {\n const message = methodLog.args._message; // eslint-disable-line\n const logType = methodLog.type;\n\n // if the log status is a failure log\n if (methodLog.comparison === true && methodLog.status === 'failure') {\n const actual = bytes32ToType(logType, methodLog.args._actualValue); // eslint-disable-line\n const expected = bytes32ToType(logType, methodLog.args._expectedValue); // eslint-disable-line\n\n report(`\n -----------------\n\n ${chalk.red(`assertion failed (${methodLog.assertType})`)}\n index: ${methodLogIndex}\n type: ${logType}\n value (e): ${actual}\n value (a): ${expected}\n message: ${message}\n `);\n }\n });\n } else {\n report(` ${chalk.green(symbols.ok)} ${chalk.dim(methodName)} ${chalk.red(`(${methodReport.duration}ms)`)}`);\n }\n\n // fire next method, this is fired every method\n nextMethod(methodReport);\n\n // new index is less than length\n if (nextIndex < testMethods.length) {\n runTestMethodsSeq(nextIndex, testMethods, contractObject, nextContract, nextMethod);\n } else {\n // Test contract is complete\n nextContract();\n }\n };\n\n contractObject[methodName](methodTxObject, (methodError, methodTxHash) => {\n // has method error\n if (methodError) {\n if (String(methodName.toLowerCase()).includes('throw')\n && (JSON.stringify(methodError.message).toLowerCase().includes('jump')\n || JSON.stringify(methodError.message).toLowerCase().includes('vm exception')\n || JSON.stringify(methodError.message).toLowerCase().includes('out of gas'))) {\n setupCompleteMethod();\n } else {\n throwError(`error while testing method '${methodName}': ${methodError}`);\n }\n } else {\n // if the method is expected to throw and doesn't, report failure\n if (String(methodName.toLowerCase()).includes('throw')) {\n methodReport.status = 'failure';\n methodReport.uncaughtThrow = true;\n }\n\n // transaction is success\n // set timeout to wait for log propigation\n getTransactionSuccess(web3, methodTxHash, (txSuccessError, txReceipt) => {\n if (txSuccessError) {\n throwError(`error while getting transaction success method '${methodName}': ${methodError}`);\n } else {\n // if success, set the receipt\n methodReport.receipt = txReceipt;\n\n // if the receipt has logs\n if (txReceipt.logs.length > 0) {\n // go through logs, find AssertEq logs\n for (var logIndex = 0; logIndex < txReceipt.logs.length; logIndex++) { // eslint-disable-line\n // if log is a uint log `log_uint`\n if (txReceipt.logs[logIndex].topics.includes('0x5a71b4cb8bb5bc53d31d782572a043ec542e2d000214f85ace0bbe93131dc98a')) {\n // decode the log data\n const logData = Interface.decodeParams(['uint256', 'string'], txReceipt.logs[logIndex].data);\n\n // build a log object similar to web3\n const logDataObject = {\n _logValue: logData[0],\n _message: logData[1],\n };\n\n // log value, log message\n const logValue = logDataObject._logValue; // eslint-disable-line\n const logMessage = logDataObject._message; // eslint-disable-line\n\n // report log data if necessary\n methodReport.logs[logIndex] = {\n comparison: false,\n type: 'uint256',\n args: logDataObject,\n logIndex,\n };\n }\n\n // if the log is an AssertEq log\n if (txReceipt.logs[logIndex].topics.includes('0xd59a9828799793dbbfb45a334a81ebcf5a204d2ff45f7ee7561756b5d2d3c4b2')) {\n // decode the log data\n const logData = Interface.decodeParams(['string', 'string', 'bytes32', 'bytes32', 'string'], txReceipt.logs[logIndex].data);\n\n // build a log object similar to web3\n const logDataObject = {\n _assertType: logData[0],\n _type: logData[1],\n _actualValue: logData[2],\n _expectedValue: logData[3],\n _message: logData[4],\n };\n\n // report log data if necessary\n methodReport.logs[logIndex] = {\n comparison: true,\n assertType: logDataObject._assertType, // eslint-disable-line\n type: logDataObject._type, // eslint-disable-line\n args: logDataObject,\n logIndex,\n status: 'success',\n };\n\n // if actual does not equal expected, mark as failure, report error\n if (logDataObject._actualValue !== logDataObject._expectedValue) { // eslint-disable-line\n methodReport.status = 'failure';\n methodReport.logs[logIndex].status = 'failure';\n }\n }\n }\n }\n\n // complete method processing\n setupCompleteMethod();\n }\n });\n }\n });\n };\n\n // get time increase\n const timeIncrease = getTimeIncreaseFromName(methodName);\n const blockIncrease = getBlockIncreaseFromName(methodName);\n\n // setup fire test method before testing it\n const setupTestMethod = () => {\n // if there is an increase time command\n // then increase the time and mine a block\n if (timeIncrease > 0) {\n increaseProviderTime(provider, timeIncrease, (increaseTimeError) => {\n if (increaseTimeError) {\n throwError(`error while increasing TestRPC provider time by ${timeIncrease} seconds: ${increaseTimeError}`);\n } else {\n fireTestMethod();\n }\n });\n } else {\n if (blockIncrease > 0) {\n increaseProviderBlock(provider, blockIncrease, (increaseBlockError) => {\n if (increaseBlockError) {\n throwError(`error while increasing TestRPC provider by ${blockIncrease} blocks: ${increaseBlockError}`);\n } else {\n fireTestMethod();\n }\n });\n } else {\n // fire the test method\n fireTestMethod();\n }\n }\n };\n\n // fire before method\n const fireBeforeMethod = () => {\n // before each\n contractObject[`before_${methodName}`](Object.assign({}, methodTxObject), (beforeError, beforeTxHash) => {\n if (beforeError) {\n throwError(`while firing before_${methodName} before method ${methodName}: ${beforeError}`);\n } else {\n getTransactionSuccess(web3, beforeTxHash, (txSuccessError) => {\n if (txSuccessError) {\n throwError(`error while getting transaction method success for before_${methodName} method before '${methodName}': ${txSuccessError}`);\n } else {\n setupTestMethod();\n }\n });\n }\n });\n };\n\n // before each\n contractObject.beforeEach(Object.assign({}, methodTxObject), (beforeEachError, beforeEachTxHash) => {\n if (beforeEachError) {\n throwError(`while firing beforeEach method before method ${methodName}: ${beforeEachError}`);\n } else {\n getTransactionSuccess(web3, beforeEachTxHash, (txSuccessError) => {\n if (txSuccessError) {\n throwError(`error while getting transaction method success for beforeEach method before '${methodName}': ${txSuccessError}`);\n } else {\n // if before method available, fire it\n if (typeof contractObject[`before_${methodName}`] === 'function') {\n fireBeforeMethod();\n } else {\n setupTestMethod();\n }\n }\n });\n }\n });\n}", "title": "" }, { "docid": "b64dddc18a807756b6e141de8131fea8", "score": "0.57816505", "text": "function RUN_ALL() {\n MochaInstanceAll.run(function(failures) {\n process.on('exit', function() {\n process.exit(failures);\n });\n });\n}", "title": "" }, { "docid": "a2cee0436da19413240415d695a1001d", "score": "0.57752115", "text": "function ex(cmds) {\n var len = cmds.length;\n for(var i=0; i< len; i++) {\n console.log('=> '+cmds[i]);\n exec(cmds[i]); // all async. nothing to be done about it.\n }\n}", "title": "" }, { "docid": "2976bf4c76ddb814bbd696e66122c644", "score": "0.5773298", "text": "function callHandlers(testCase) {\n for (var call of testCase.calls('promise')) {\n call.callback();\n }\n }", "title": "" }, { "docid": "49688a9a681e984607e098f6dfd562d8", "score": "0.5768531", "text": "async executeTests() {\n this.currentCaseIndex = 0;\n this.resultsHandler.printTestsStart(this.casesManager.selectedCases);\n while (this.currentCaseIndex < this.casesManager.selectedCases.length) {\n await this.executeCurrentCase();\n this.currentCaseIndex++;\n }\n this.resultsHandler.printTestsEnd();\n this.resultsHandler.close();\n // grace period to allow ResultHandler to finish writing the file\n setTimeout(onEnd => {\n process.exit();\n }, 1000);\n }", "title": "" }, { "docid": "e4be94ca8033d609bd284f8bdb39278a", "score": "0.57590216", "text": "function test(callback) {\n if (jiff_instances[0] == null || !jiff_instances[0].isReady()) {\n console.log('Please wait!');\n return;\n }\n has_failed = false;\n\n // Run every test and accumulate all the promises\n var promises = [];\n for (var i = 0; i < tests.length; i++) {\n for (var j = 0; j < jiff_instances.length; j++) {\n var promise = single_test(i, jiff_instances[j]);\n if (promise != null) {\n promises.push(promise);\n }\n }\n }\n\n // When all is done, check whether any failures were encountered\n Promise.all(promises).then(function () {\n for (var i = 0; i < jiff_instances.length; i++) {\n jiff_instances[i].disconnect();\n }\n jiff_instances = null;\n callback(!has_failed);\n });\n}", "title": "" }, { "docid": "2a7fc6eaab47903c56cbf9ab0780570b", "score": "0.5742841", "text": "async run(/* arguments */) {\n const args = arguments;\n assert(!this.ran);\n this.ran = true;\n await Promise.each(this._checks, async check => {\n try {\n await check(...args);\n }\n catch (error) {\n Gadgets.KeepGoingOrThrow(error);\n }\n });\n }", "title": "" }, { "docid": "1bab117328ec7b11e02ea8a2e5669cc8", "score": "0.5742717", "text": "function runTests(testCases, suffix = '', buildUrl = self.buildUrl, sendData = self.sendData) {\n for (const testCase of testCases) {\n const id = token();\n async_test((test) => {\n const url = buildUrl(id);\n assert_true(sendData(url, testCase.data), 'sendBeacon should succeed');\n waitForResult(id).then(() => test.done(), test.step_func((e) => {throw e;}));\n }, `Verify 'navigator.sendbeacon()' successfully sends for variant: ${testCase.name}${suffix}`);\n };\n}", "title": "" }, { "docid": "b6f17ed50ac5194b4a886bc457539433", "score": "0.573924", "text": "function runTests(inputArg, replArg) {\n // Sets context\n input = inputArg;\n repl = replArg;\n \n // Runs them all\n step3Tests.forEach(assert);\n step4Tests.forEach(assert);\n step5Tests.forEach(assert);\n step6Tests.forEach(assert);\n}", "title": "" }, { "docid": "dfa2a32b374701396ebd1e25bef1cfb8", "score": "0.5717233", "text": "function call()\n\t\t\t{\n\t\t\t\t// Check if count doesn't exceeds or if there aren't any functions to call\n\t\t\t\tif (funcArray.length == 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tif(conta_chamadas_simultaneas >= MAX_REQUESTS || funcArray.length == 0) {\n\t\t\t\t\t// Call call() after 100ms\n\t\t\t\t\tsetTimeout(function() { call() }, CALL_WAIT);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tconta_chamadas_simultaneas++; \n\t\t\t\t\tvar parametros = funcArray.pop();\n\t\t\t\t\tvar token = parametros.token;\n\t\t\t\t\tvar codigo = parametros.codigo;\n\t\t\t\t\tvar nome = parametros.nome;\n\t\t\t\t\tvar obs = parametros.obs;\n\t\t\t\t\tvar entidade = parametros.entidade;\n\t\t\t\t\tvar uri_arquivo = parametros.uri_arquivo \n\t\t\t\t\tuploadFoto(uri_arquivo, token, codigo, nome, obs, entidade );\n\t\t\t\t\tcall();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "c0dabba61c196541736192fafff1f8fe", "score": "0.5702113", "text": "function onBatches(err, results) {\n var cassert = CollapsedAssert();\n cassert.ifError(err);\n\n var statuses = [];\n for (var i = 0; i < results.length; i++) {\n cassert.ifError(results[i].err, 'expect no batch error');\n cassert.ifError(results[i].value.errors.length > 0,\n 'expect zero errors in batch');\n statuses.push(results[i].value);\n }\n cassert.report(assert, 'expected no errors');\n\n var statusTable = findServerHostDistribution(statuses);\n\n var uniqHosts = Object.keys(statusTable);\n if (uniqHosts.length < 35) {\n checkConnections();\n checkDistributions(statusTable);\n } else {\n assert.ok(true, 'SKIP: suprisingly large number of peers reached');\n }\n\n assert.end();\n }", "title": "" }, { "docid": "4f546f115efd1d68b2fdae0e36848b96", "score": "0.5697441", "text": "function RepeatedTest_run( result )\n{\n for( var i = 0; i < this.mTimesRepeat; i++ )\n {\n if( result.shouldStop())\n break;\n TestDecorator.prototype.run.call( this, result );\n }\n}", "title": "" }, { "docid": "0aea83cc43ea0cb1bbb0347e40756edd", "score": "0.56972265", "text": "function testrun(n, next) {\n\tsuite(\"#\" + n, function(test, testInfo, suiteDone){\n\t\tlogger.i(\"test #\" + n);\n\t\t\n\t\trequest({\n\t\t\turi: settings.url,\n\t\t\tencoding: null\n\t\t}, function(err, res, body){\n\t\t\t// Add info to runner.results\n\t\t\ttestInfo(\"err\", err);\n\t\t\ttestInfo(\"res\", res);\n\t\t\tconsole.log(body.length);\n\t\t\ttestInfo(\"body\", body);\n\t\t\tsuiteDone();\n\t\t\tnext();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "5a7816e95c77b4211eb73d5f2028ec30", "score": "0.5694977", "text": "function sequencingTests(){\n console.log(\"----------Starting Sequencing Tests----------\")\n testSequenceReturnOrder()\n testSequenceDispatching()\n console.log(\"\\n\")\n}", "title": "" }, { "docid": "7ccbab9861851901260497f63c934d0a", "score": "0.5694472", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "7ccbab9861851901260497f63c934d0a", "score": "0.5694472", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "16fca69e6a4b837377c90225bbdfc171", "score": "0.5687897", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "16fca69e6a4b837377c90225bbdfc171", "score": "0.5687897", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "16fca69e6a4b837377c90225bbdfc171", "score": "0.5687897", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "16fca69e6a4b837377c90225bbdfc171", "score": "0.5687897", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "16fca69e6a4b837377c90225bbdfc171", "score": "0.5687897", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error('You do not have enough test cases');\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "adc26496023b7c5eb4aa64a1fd24492b", "score": "0.56858176", "text": "function runAllTests(renderOnDone, logOutput) {\n\t\ttest_findRedundantLinearPossibilities(logOutput);\n\t\ttest_findRedundantBoxPossibilities(logOutput);\n\t\ttest_findRedundantAdjacentGridPossibilities(logOutput);\n\t\ttest_findSubgridPossibilities(logOutput);\t\t\n\t\ttest_isPossibilitiesLinear();\n\t\ttest_removeSinglePossibility(renderOnDone);\n\t\ttest_isSolved(logOutput);\n\t\ttest_isRemoved();\n\t\ttest_flushToBeRemoved();\n\t\ttest_getBinarySolutionPosition(logOutput);\n\t\ttest_countRemainingSolutions();\n\t\ttest_renderEditMode();\n\t}", "title": "" }, { "docid": "192cc6edd26fd390fbcbc8e533513ee5", "score": "0.56823707", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error(\"You do not have enough test cases\");\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "192cc6edd26fd390fbcbc8e533513ee5", "score": "0.56823707", "text": "function runTest(i) {\n if (i >= inputs.length) throw new Error(\"You do not have enough test cases\");\n let expected = outputs[i];\n let actual = f(inputs[i]);\n verifyEquals(expected, actual);\n}", "title": "" }, { "docid": "59bbf9aa1316e4e839618676d2e87a0b", "score": "0.5664294", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n document.getElementById(\"output\").innerHTML += string_times(true, false);\n //test third method, etc\n}", "title": "" }, { "docid": "ba652a7ed90e5fe1e8c8e9521b06d1fb", "score": "0.56587553", "text": "function runAutomatedTests(times) {\n\ttimes = parseInt(times) || NUMBER_OF_TESTS;\n\tvar objCount = document.getElementById(\"objectCount\").value || NUMBER_OF_OBJECTS;\n\tvar timeResult = {};\n\tvar allObjects = getNObjects(objCount);\n\tfor(var i=0; i<times;i++) {\n\t\ttimeResult = startTest(allObjects);\n\t\tmanageCounters(timeResult);\n\t}\n\tdisplayResult(timeResult);\n}", "title": "" }, { "docid": "52227da681f3ebed457a0d34dda061fb", "score": "0.5655807", "text": "async function runExample() {\n\ttry {\n\n\t\t// Put together some options to use in each test\n\t\tconst options = require('./generate_pa11y.json');\n options['log'] = {\n debug: console.log,\n error: console.error,\n info: console.log\n }\n\n identity = (x) => x;\n urls = options['urls']\n\n\t\t// Run tests against multiple URLs\n run = [];\n for (let i = 0; i < urls.length; i++) {\n options1 = Object.assign({}, options);\n options1.actions = options.actions.map(identity);\n options1.actions.push('navigate to ' + urls[i]);\n run.push(pa11y(urls[i], options1));\n }\n\t\tconst results = await Promise.all(run);\n\n const report = {\"total\": results.length,\"passes\": 0,\"errors\": 0, \"results\": {} }\n for (let i = 0; i < results.length; i++) {\n console.log(results[i].pageUrl);\n report.results[results[i].pageUrl] = results[i].issues;\n }\n\n const stream = fs.createWriteStream(\"pa11y-ci-results.json\");\n stream.once('open', function(fd) {\n stream.write(new Buffer.from(JSON.stringify(report)));\n stream.end();\n });\n\n\t} catch (error) {\n\n\t\t// Output an error if it occurred\n\t\tconsole.error(error.message);\n\n\t}\n}", "title": "" }, { "docid": "5e34248bedab8804ff9be8439d92cf76", "score": "0.56495667", "text": "function test(testname,starturl,func){ //Container function for creating a test\r\n\ttests[testname]={}; //Creates test\r\n\ttests[testname].starturl=starturl; //Records starting url\r\n\ttests[testname].page=require('webpage').create(); //Creates page for test\r\n\ttests[testname].page.viewportSize={width:1680,height:720}; //Sets page size\r\n\ttests[testname].page.testname=testname; //Sets testname within page for easier access later\r\n\t//Custom page functions\r\n\ttests[testname].page.renderelement=function(element,filename){ //Function to screenshot an element\r\n\t\tvar oldclip = this.clipRect //Saves original screenshot boundries\r\n\t\tthis.clipRect = this.evaluate(function(element){ //Gets boundries of element\r\n\t\t\treturn document.querySelector(element).getBoundingClientRect();\r\n\t\t},element);\r\n\t\tthis.render(filename); //Screenshots element\r\n\t\tthis.clipRect = oldclip; //Reverts screenshot boundries to original\r\n\t};\r\n\ttests[testname].page.click=function(element){\r\n\t\t////Write failure case here\r\n\t\tthis.evaluate(function(element){\r\n\t\t\tdocument.querySelector(element).click();\r\n\t\t},element)\r\n\t}\r\n\t//Test steps builder\r\n\ttests[testname].page.steps=[];\r\n\ttests[testname].page.step=function(action,target,filename){\r\n\t\tthis.steps.push([action,target,filename]);\r\n\t}\r\n\t//Function to execute steps\r\n\ttests[testname].page.execute=function(progress){\r\n\t\tif(!progress){progress=0}\r\n\t\tconsole.log(\"progress \"+progress);\r\n\t\tif(this.steps.length>progress){\r\n\t\t\tconsole.log(\"running step \"+progress+\" of \"+this.steps.length)\r\n\t\t\tconsole.log(this.steps[progress][0]+\" ON \"+this.steps[progress][1])\r\n\t\t\tthis[this.steps[progress][0]](this.steps[progress][1],this.steps[progress][2]);\r\n\t\t\tconsole.log(\"ran step\")\r\n\t\t\tprogress++;\r\n\t\t\tvar testid=this.testname;\r\n\t\t\tsetTimeout(function(){tests[testid].page.execute(progress)},3000);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthis.end(\"Pass\");\r\n\t\t}\r\n\t}\r\n\t//Function to end test\r\n\ttests[testname].page.end=function(result){\r\n\t\tthis.close(); //Closes the page to save memory\r\n\t\tdelete tests[testname].page; //Removes page data from JSON to save space\r\n\t\ttests[testname].result=result; //Records result to JSON\r\n\t\tif(Object.keys(tests).length==Object.keys(tests).filter(function(x){return(tests[x].result!=undefined? true: false)}).length){ //If number of results matches number of tests\r\n\t\t\tconsole.log(\"All tests done\");\r\n\t\t\tfor(x in tests){\r\n\t\t\t\tconsole.log(x+\" \"+tests[x].result);\r\n\t\t\t}\r\n\t\t\tfs.write(\"results.json\", JSON.stringify(tests));\r\n\t\t\tphantom.exit();\r\n\t\t}\r\n\t}\r\n\tvar newfunc = new Function(func.toString().replace(/^function\\s*\\(\\)\\s*\\{/,\"\").replace(/(\\}$)/g,\"this.execute();\"));\r\n\ttests[testname].page.open(starturl,newfunc);\r\n\t\r\n}", "title": "" }, { "docid": "7f0897471de4d8a5d1d2b12a3dfebefe", "score": "0.56480616", "text": "async function makeMultipleRequests() {\n console.log('making multiple requests...')\n const result1 = await mockNetworkRequest();\n console.log('back from first request in multiple requests');\n const result2 = await mockNetworkRequest();\n console.log('back from second request in multiple requests');\n try {\n const result3 = await mockNetworkRequest(true);\n } catch(err) {\n console.log(`there was an error: ${err}`);\n }\n}", "title": "" }, { "docid": "78f082ecc6fb8b249cd563fef5682d7e", "score": "0.5642853", "text": "function runOperations(nFactor)\n{\n\tdebugIt(\"running operations\");\n\tpingSite();\n\tpostToThingsSpeak(nFactor);\n\tsetTimeout(sleepController, NMILIPERMIN);\t//sleep a minute, before considering turning off the wifi connection\n}", "title": "" }, { "docid": "4df4ea96ec0c58d81a8b705d02571c9e", "score": "0.5642004", "text": "function run_routine() {\n it('should return proper object', function (done) {\n // this.timeout(5000);\n mock_dt.tradingsymbol = 'YESBANK';\n seneca.act('role:routine,cmd:run_routine', mock_dt, function (err, val) {\n if (err) done(err);\n default_api_test(err, val);\n // strategy_config\n expect(val.strategy_config).is.an('array');\n expect(val.strategy_config.length).to.equal(1);\n check_strategy_config(null, val.strategy_config[0]);\n // evaluator_config\n expect(val.evaluator_config).is.an('array');\n expect(val.evaluator_config.length).to.equal(1);\n check_evaluator_config(null, val.evaluator_config[0]);\n done();\n });\n });\n }", "title": "" }, { "docid": "528f1a5910795a352dc65fd7e8dd6bb8", "score": "0.56257594", "text": "function doLotsOfWork(type, tiredEshraq, res){\n console.log(`Doing lots of ${type}`);\n setTimeout(function(){\n tiredEshraq(res)\n }, 5000);\n}", "title": "" }, { "docid": "fbb8b1e617d940913073b2edde392591", "score": "0.5624794", "text": "function run () {\n eventsNotEmited.forEach(function (eventData, type) {\n var key = Object.keys(eventData)[0];\n var isEndEvent = (key === 'end');\n var isStartEvent = (key === 'start');\n\n if (isStartEvent) return;\n\n if (isEndEvent && !isLast) {\n return;\n }\n\n try {\n customRunner[key](eventData[key]);\n } catch (evt) {}\n });\n // if all events saved finish test and exit queue\n if (isDataFull) {\n isFinished = true;\n queue.end();\n }\n }", "title": "" }, { "docid": "f9b97e93f3beb8378a18b9dbb15e83e0", "score": "0.5610685", "text": "function runnerLoop(options, expectedArray, functionToCall) {\n\t// contains:\n\t// - 8 occurrences of \"find me\", case insensitive, whole word or not. Of which\n\t// - 5 occurrences case insensitive, whole word. Of which:\n\t// - 1 not surrounded by any other text\n\t// - 2 separated from each other by only one character\n\t// - 2 capitalised\n\t// - 1 all upper-case\n\t// - 2 all lower-case\n\t// - 3 occurrences case insensitive, not whole word. Of which:\n\t// - 1 all upper-case\n\t// - 2 all lower case\n\t// - 2 immediately following one another\n\t//\n\tfor (var i = 0; i < expectedArray.length; i++) {\n\t\t/*:DOC testHTMLContent = <div><p id=\"1\">Find Me</p><table><tr><td><div><ul><li id=\"2\">Here you go, Find Me please and FIND MEE too.</ul></div></td><td id=\"3\">Find me find me canyoufind mefind me</td><td id=\"4\">Lol, rem hip soum. FIND ME!</td></tr></table></div> */\n\t\tif (functionToCall === TrouveurFunctions.count) {\n\t\t\trunnerCount(expectedArray[i].given, this.testHTMLContent, options, expectedArray[i].expected);\n\t\t} else if (functionToCall === TrouveurFunctions.find || functionToCall === TrouveurFunctions.replace){\n\t\t\trunnerFindOrReplace(expectedArray[i].given, this.testHTMLContent, options, expectedArray[i].expected, functionToCall);\n\t\t} else if (functionToCall === TrouveurFunctions.highlight) {\n\t\t\trunnerHighlight(expectedArray[i].given, this.testHTMLContent, options, expectedArray[i].expected);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b90f34b6102af21d600ef69a7cf48e77", "score": "0.56047106", "text": "function execute() {\n for(var suiteName in self.tests){\n if(self.tests.hasOwnProperty(suiteName)) {\n var subTests = self.tests[suiteName];\n console.log('\\x1b[36m%s\\x1b[0m', '\\n- ' + `SUITE: ${suiteName}`);\n subTests.forEach((subTest) => {\n if(subTest.hasOwnProperty('testName')) {\n self.runTest(subTest, suiteName)\n }\n })\n }\n }\n }", "title": "" }, { "docid": "f19bd14db5e833a86c2e38a2622fca14", "score": "0.5601149", "text": "function runSteps(steps, callback) {\n var ix = 0;\n (function _loop(err, a1, a2) {\n if (err || ix >= steps.length) return callback(err, a1, a2);\n steps[ix++](_loop, a1, a2);\n })()\n}", "title": "" }, { "docid": "48fe8368c09038ffa9c697087cc7279f", "score": "0.5597486", "text": "function prepareAndDoNextRound() {\n prepareForNextRound();\n doNextRound();\n}", "title": "" }, { "docid": "778700d5b1a0104c4200f739b217be3e", "score": "0.5595535", "text": "async function stabilityCheck(func) \n{\n for(let i=0;i<1000;i++)\n {\n await func()\n\n }\n}", "title": "" }, { "docid": "4e5d08b60e1af7ba271c015282a6bba9", "score": "0.55929816", "text": "function test (url) {\n return function (done) {\n var finished = after(count, completed(url, done));\n for (var i = 0; i < count; i++) load(url, finished);\n };\n }", "title": "" }, { "docid": "79afdd842ee9670fc632bbbd5925221a", "score": "0.55919814", "text": "function runATest(p,n) {\r\n scr.label(p, n.name);\r\n switch(n.test) {\r\n case \"ping\":\r\n test.ping(n.ip, n.log).then((out) => {\r\n if (out) {\r\n scr.up(p);\r\n } else {\r\n scr.down(p);\r\n }\r\n });\r\n break;\r\n case \"http\":\r\n test.http(n.ip, n.port, n.log).then((out) => {\r\n if (out) {\r\n scr.up(p);\r\n } else {\r\n scr.down(p);\r\n }\r\n });\r\n break;\r\n case \"https\":\r\n test.https(n.ip, n.port, n.log).then((out) => {\r\n if (out) {\r\n scr.up(p);\r\n } else {\r\n scr.down(p);\r\n }\r\n });\r\n break;\r\n case \"dnsquery\":\r\n test.dnsquery(n.ip, n.log).then((out) => {\r\n if (out) {\r\n scr.up(p);\r\n } else {\r\n scr.down(p);\r\n }\r\n });\r\n break;\r\n case \"extcmd\":\r\n test.extcmd(n.cmd, n.log).then((out) => {\r\n if (out) {\r\n scr.up(p);\r\n } else {\r\n scr.down(p);\r\n }\r\n });\r\n break;\r\n case \"wpchk\":\r\n test.wpchk(n.fqdn, n.log).then((out) => {\r\n if (out) {\r\n scr.up(p);\r\n } else {\r\n scr.down(p);\r\n }\r\n });\r\n break;\r\n default:\r\n scr.unkn(p);\r\n break\r\n }\r\n setTimeout(runATest, n.freq, p, n); // Reschedule test\r\n}", "title": "" }, { "docid": "773ec6191914b1837f5cc278d0b44295", "score": "0.5575751", "text": "function LOOPCALL(state) {\n var stack = state.stack;\n var fn = stack.pop();\n var c = stack.pop();\n\n if (exports.DEBUG) { console.log(state.step, 'LOOPCALL[]', fn, c); }\n\n // saves callers program\n var cip = state.ip;\n var cprog = state.prog;\n\n state.prog = state.funcs[fn];\n\n // executes the function\n for (var i = 0; i < c; i++) {\n exec(state);\n\n if (exports.DEBUG) { console.log(\n ++state.step,\n i + 1 < c ? 'next loopcall' : 'done loopcall',\n i\n ); }\n }\n\n // restores the callers program\n state.ip = cip;\n state.prog = cprog;\n}", "title": "" }, { "docid": "773ec6191914b1837f5cc278d0b44295", "score": "0.5575751", "text": "function LOOPCALL(state) {\n var stack = state.stack;\n var fn = stack.pop();\n var c = stack.pop();\n\n if (exports.DEBUG) { console.log(state.step, 'LOOPCALL[]', fn, c); }\n\n // saves callers program\n var cip = state.ip;\n var cprog = state.prog;\n\n state.prog = state.funcs[fn];\n\n // executes the function\n for (var i = 0; i < c; i++) {\n exec(state);\n\n if (exports.DEBUG) { console.log(\n ++state.step,\n i + 1 < c ? 'next loopcall' : 'done loopcall',\n i\n ); }\n }\n\n // restores the callers program\n state.ip = cip;\n state.prog = cprog;\n}", "title": "" }, { "docid": "c026ac0e2327e9e028506d2c3c0924c9", "score": "0.55657923", "text": "function runDiagnostics() {\n $('#diag_log').empty();\n\n var counter = 0;\n var before = new Date();\n startTest('*** ALL TESTS STARTED ***')\n .then(function () { counter++; return testCreateNewNote(); })\n .then(function () { counter++; return testTemplateNote(); })\n .then(function () { counter++; return testCancelTemplateNoteEditing(); })\n .then(function () { counter++; return testEditNoteText(); })\n .then(function () { counter++; return testCancelEditingNoteText(); })\n .then(function () { counter++; return testBasicFormatting(); })\n .then(function () { counter++; return testDeleteNote(); })\n .then(function () { counter++; return testUndoDeleteNote(); })\n .then(function () { counter++; return testSearch(); })\n .then(function () { counter++; return testEditNoteTitle(); })\n .then(function () { counter++; return testCreateNewNoteSpecial(); })\n .then(function () { counter++; return testLoadNotesInBatches(); })\n .then(function () { counter++; return testEditNoteMakeTitlesTheSame(); })\n .then(function () { counter++; return testLoadOneMoreNote(); })\n .then(function () { counter++; return testEditNoteTextMakeEmpty(); })\n .then(function () { counter++; return testShareNote(); })\n .then(function () { counter++; return testAutoSuggest(); })\n .then(function () { counter++; return testTextAreaSize(); })\n .then(function () { counter++; return testNoteLoadingOrder(); })\n\n .then(function () {\n var after = new Date();\n reportInfo('Total tests: ' + counter + '. Time elapsed: ' + (after.getTime() - before.getTime()));\n\n return reportSuccess('*** ALL TESTS PASSED ***');\n })\n .catch(function (err) { reportError('*** TESTS FAILED ***'); });\n}", "title": "" }, { "docid": "5d033f15bf2fb39367c69b6da9311b71", "score": "0.5563791", "text": "testExecTwiceReuse() {\n this.testExecTwice(true);\n }", "title": "" }, { "docid": "eddf05815e15f75b067e19616a6c631f", "score": "0.55620515", "text": "function runSetup() { // to avoid mutual influence.\n if ( i === setups.length )\n return callback();\n setups[ i++ ]( suite, runSetup ); // recursive call\n }", "title": "" }, { "docid": "d5f89d1fce1a84c077fd9f1e306d4d0a", "score": "0.5560991", "text": "function tester() {\n document.getElementById(\"output\").innerHTML += sleep_in(true, false);\n document.getElementById(\"output\").innerHTML += monkey_trouble(true, false);\n //test third method, etc\n}", "title": "" }, { "docid": "15f85057cc318b82dcd39d334c3cf932", "score": "0.5558051", "text": "function call3Times(fun) {\n fun();\n fun();\n fun();\n}", "title": "" }, { "docid": "0f42b5ed8f9f8e768382f4e4f62cc618", "score": "0.55520725", "text": "function runTest(){\n testMetaDataParsing();\n testIteration();\n}", "title": "" }, { "docid": "af14c1f5bb153d2f088cc653c320d585", "score": "0.5550404", "text": "async function checkSeriesOfTransactions(maxRounds) {\n //will be saved as test result\n let failedTxs = [];\n let validatorsMissedTxs = [];\n let passed = true;\n let validatorsArr;\n try {\n validatorsArr = await testHelper.getValidators(web3);\n } catch (error) {\n console.error(error);\n return error;\n }\n console.log('got validators, validatorsArr.length: ' + validatorsArr.length + \", validatorsArr: \" + validatorsArr);\n for (let round = 0; round < maxRounds; round++) {\n console.log(\"checkSeriesOfTransactions round: \" + round);\n for (let i = 0; i < validatorsArr.length; i++) {\n console.log(\"i: \" + i);\n let transactionResult;\n // todo from account 1 to 2 and backward or from node with higher balance to lower\n try {\n transactionResult = await checkTxSending(validatorsArr);\n } catch (error) {\n console.error(error);\n return error;\n }\n if (!transactionResult.passed) {\n passed = false;\n console.log(\"Transaction failed, error: \" + transactionResult.errorMessage);\n failedTxs.push(transactionResult);\n }\n }\n console.log(\"validatorsSet size: \" + validatorsMinedTxSet.size);\n console.log(\"validatorsMinedTx: \" + JSON.stringify(validatorsMinedTx));\n if (validatorsMinedTxSet.size === validatorsArr.length) {\n //all validators mined blocks with txs so no need to continue test\n break;\n }\n }\n if (validatorsMinedTxSet.size !== validatorsArr.length) {\n passed = false;\n //determine what validator node didn't mine tx\n for (let i = 0; i < validatorsArr.length; i++) {\n if (!validatorsMinedTxSet.has(validatorsArr[i])) {\n validatorsMissedTxs.push(validatorsArr[i]);\n }\n }\n }\n // todo save maxRounds\n sqlDao.addToTxsTable([new Date(Date.now()).toISOString(), (passed) ? 1 : 0, lastBlock, JSON.stringify(validatorsMissedTxs), JSON.stringify(failedTxs)]);\n console.log('passed: ' + passed + ', JSON.stringify(validatorsMissedTxs): '\n + JSON.stringify(validatorsMissedTxs) + ', JSON.stringify(failedTxs): ' + JSON.stringify(failedTxs));\n //TODO save number of mined non-empty blocks for every validator\n sqlDao.closeDb();\n}", "title": "" }, { "docid": "5013a05e07a34cc470e0a4e6eec3743a", "score": "0.5543993", "text": "multiPing(count, wait = 50) {\n const fns = new Array(count).fill(this.ping);\n return new Promise(resolve => {\n const results = new Array(count);\n return fns.reduce((p, c, i) => {\n return p\n .then(c.bind(this))\n .then(data => results[i] = Object.assign({ index: i }, data)) // update results array\n .then(pwait.bind(null, wait)); // wait 50ms before next one is executed\n }, Promise.resolve())\n .then(() => resolve(results));\n });\n }", "title": "" }, { "docid": "aea168b7fcca4d1b84fcfbaacca18449", "score": "0.5527192", "text": "function runSteps(steps, next) {\n var newSteps = [];\n\n _.each(steps, function(step) {\n newSteps.push(function(done) {\n var fnName = functionName(step);\n var index = steps.indexOf(step) + 1;\n\n console.log('\\n' + index + ') - ' + fnName + ' ---------------------');\n\n step(done);\n });\n });\n\n async.series(newSteps, next);\n}", "title": "" }, { "docid": "3003f695c5875a4934ce859aed73bb1e", "score": "0.5520679", "text": "function repeathMe(numTimes, callback) {\n for (var i = 0; i < numTimes; i++) {\n callback();\n }\n}", "title": "" }, { "docid": "508f0f32777875eda08f441da3b7a2b6", "score": "0.5520037", "text": "async function looping(testArray) {\n await openWeb(testArray[i]);\n // Create a new empty promise (don't do that with real people ;)\n var sequence = Promise.resolve();\n\n // Loop over each file, and add on a promise to the\n // end of the 'sequence' promise.\n testArray.forEach(function(url) {\n // Chain one computation onto the sequence\n sequence = sequence\n .then(function() {\n return looping(url);\n })\n .then(function(result) {\n looping(result); // Resolves for each file, one at a time.\n });\n });\n\n // This will resolve after the entire chain is resolved\n return sequence;\n}", "title": "" }, { "docid": "5002e761a91c6b303499f6a1189f667e", "score": "0.5519219", "text": "function onBatches(err, results) {\n var cassert = CollapsedAssert();\n cassert.ifError(err);\n\n var statuses = [];\n for (var i = 0; i < results.length; i++) {\n cassert.ifError(results[i].err, 'expect no batch error');\n cassert.ifError(results[i].value.errors.length > 0,\n 'expect zero errors in batch');\n\n statuses.push(results[i].value);\n }\n cassert.report(assert, 'expected no errors');\n\n var statusTable = findServerHostDistribution(statuses);\n\n cassert = verifyConnections(cluster, 5, 5);\n cassert.report(assert, 'expected batch connections to be fine');\n\n cassert = verifyDistributions(statusTable, {\n min: 395,\n sum: 1000,\n median: [180, 220],\n mean: [195, 205],\n max: 300,\n p75: [200, 250],\n p95: 275\n });\n cassert.report(assert, 'expected request distribution to be ok');\n\n assert.end();\n }", "title": "" }, { "docid": "eae626a00c51985f4b0c0d73ccd6172c", "score": "0.55155504", "text": "function runNextTest() {\n\n // all tests finished? => abort and perform callback\n if ( i === tests.length ) return callback();\n\n // has website area?\n if ( self.element ) {\n\n // show that another test will be executed\n main_elem.querySelector( '#executed' ).appendChild( self.ccm.helper.loading( self ) );\n\n // render table row for current test\n var test_elem = self.ccm.helper.html( my.html.test, tests[ i ].name );\n table_elem.appendChild( test_elem ) ;\n\n // for the moment render loading as result\n var result_elem = test_elem.querySelector( '.result' );\n result_elem.appendChild( self.ccm.helper.loading( self ) );\n\n }\n\n // prepare test suite object for the current test\n var suite = {\n\n ccm: self.ccm, // provide reference to ccm framework\n\n /** finishes current test with a positive result */\n passed: function () {\n addResult( true );\n finishTest();\n },\n\n /**\n * finishes current test with a negative result\n * @param {string} [message] - message that explains why the test has failed\n */\n failed: function ( message ) {\n addResult( false );\n if ( message ) addMessage( message );\n finishTest();\n },\n\n /**\n * finishes current test with positive result if the given condition is true\n * @param {boolean} condition\n */\n assertTrue: function ( condition ) {\n addResult( condition );\n finishTest();\n },\n\n /**\n * finishes current test with negative result if the given condition is true\n * @param {boolean} condition\n */\n assertFalse: function ( condition ) {\n addResult( !condition );\n finishTest();\n },\n\n /**\n * finishes current test with positive result if given expected and actual value contains same data\n * @param {object} expected\n * @param {object} actual\n */\n assertSame: function ( expected, actual ) {\n var result = expected === actual;\n addResult( result );\n if ( !result ) addComparison( expected, actual );\n finishTest();\n },\n\n /**\n * finishes current test with positive result if given expected value equals given actual value\n * @param {object} expected\n * @param {object} actual\n */\n assertEquals: function ( expected, actual ) {\n suite.assertSame( JSON.stringify( expected ), JSON.stringify( actual ) );\n },\n\n /**\n * finishes current test with positive result if given expected and actual value NOT contains same data\n * @param {object} expected\n * @param {object} actual\n */\n assertNotSame: function ( expected, actual ) {\n var result = expected !== actual;\n addResult( result );\n finishTest();\n },\n\n /**\n * finishes current test with positive result if given expected value NOT equals given actual value\n * @param {object} expected\n * @param {object} actual\n */\n assertNotEquals: function ( expected, actual ) {\n suite.assertNotSame( JSON.stringify( expected ), JSON.stringify( actual ) );\n }\n\n };\n\n // run setup functions and then run current test\n runSetups( function () { tests[ i ]( suite ); } );\n\n /** runs all relevant setup functions (recursive function) */\n function runSetups( callback ) {\n var i = 0; // Remember: Each setup function could be asynchron\n runSetup(); // and must performed sequentially\n function runSetup() { // to avoid mutual influence.\n if ( i === setups.length )\n return callback();\n setups[ i++ ]( suite, runSetup ); // recursive call\n }\n }\n\n /** replaces loading icon with test result and increases passed or failed counter */\n function addResult( result ) {\n var value = result ? 'passed' : 'failed';\n if ( result ) results.passed++; else results.failed++;\n if ( self.element ) self.ccm.helper.setContent( result_elem, self.ccm.helper.html( my.html.result, { value: value } ) );\n results.details[ package_path + '.' + tests[ i ].name ] = result;\n }\n\n /** show message as detail information for a failed test */\n function addMessage( message ) {\n if ( self.element ) test_elem.appendChild( self.ccm.helper.html( my.html.message, message ) );\n results.details[ package_path + '.' + tests[ i ].name ] = message;\n }\n\n /** show expected and actual value as detail information for a failed test */\n function addComparison( expected, actual ) {\n if ( self.element ) test_elem.appendChild( self.ccm.helper.html( my.html.comparison, expected, actual ) );\n results.details[ package_path + '.' + tests[ i ].name ] = { expected: expected, actual: actual };\n }\n\n /** increases test counters, updates summary section and starts running next test */\n function finishTest() {\n i++; results.executed++;\n if ( self.element ) {\n main_elem.querySelector( '#executed' ).innerHTML = results.executed.toString();\n main_elem.querySelector( '#passed' ).innerHTML = results. passed.toString();\n main_elem.querySelector( '#failed' ).innerHTML = results. failed.toString();\n }\n runFinallies( runNextTest ); // recursive call\n\n /** runs all relevant finally functions (recursive function) */\n function runFinallies( callback ) {\n var i = 0; // Remember: Each finalize function could be asynchron\n runFinally(); // and must performed sequentially\n function runFinally() { // to avoid mutual influence.\n if ( i === finallies.length )\n return callback();\n finallies[ i++ ]( suite, runFinally ); // recursive call\n }\n }\n }\n\n }", "title": "" }, { "docid": "2dd50c9451506bbaa912c8045ac681cb", "score": "0.5511822", "text": "function runPosts (url, data, totalRuns, timeout, verbose) {\n counter++\n let remaining = totalRuns - counter\n if (remaining === 0) {\n return\n }\n\n let tmpTimeout = timeout * counter\n setTimeout(function () {\n var generator = fuzzer.mutate.object(data)\n let mutatedData = generator()\n if (verbose) {\n console.log('Mutated Data:\\n', colors.cyan(JSON.stringify(mutatedData, '', 2)))\n }\n request.post(url, mutatedData, function (err, res, body) {\n if (err) {\n console.log(colors.red('ERROR', err))\n }\n if (!err) {\n // console.log(body)\n switch (res.statusCode) {\n case 200:\n case 201:\n console.log('HTTP request status:', colors.green(res.statusCode + ' (Remaining timeout: ' + timeout + 'ms runs: ' + remaining + ')'))\n break\n case 500:\n console.log(colors.red('SERVER ERROR'))\n console.log(colors.red('DATA:\\n', JSON.stringify(mutatedData, '', 2)))\n break\n default:\n console.log('HTTP request status:', colors.yellow(res.statusCode + ' (Remaining timeout: ' + timeout + 'ms runs: ' + remaining + ')')) // mutatedData\n }\n }\n\n runPosts(url, data, totalRuns, timeout, verbose)\n // res.on('end', function () { })\n // res.on('data', function (e) { })\n // res.on('error', function (e) { })\n })\n }, tmpTimeout)\n}", "title": "" }, { "docid": "48c4a6ade51de19abe80bdbdb0be9172", "score": "0.55065906", "text": "function onBatches(err, results) {\n var cassert = CollapsedAssert();\n cassert.ifError(err);\n\n var statuses = [];\n for (var i = 0; i < results.length; i++) {\n cassert.ifError(results[i].err, 'expect no batch error');\n cassert.ifError(results[i].value.errors.length > 0,\n 'expect zero errors in batch');\n statuses.push(results[i].value);\n }\n cassert.report(assert, 'expected no errors');\n\n var statusTable = findServerHostDistribution(statuses);\n\n cassert = verifyConnections(cluster, 10, 12);\n cassert.report(assert, 'expected batch connections to be fine');\n\n cassert = verifyDistributions(statusTable, {\n min: 40,\n sum: 1000,\n median: [40, 60],\n mean: [45, 55],\n max: 120,\n p75: [50, 70],\n p95: 100,\n variance: 500\n });\n cassert.report(assert, 'expected request distribution to be ok');\n\n assert.end();\n }", "title": "" }, { "docid": "ca731ea49ae1c0b0108c6edf7b4fecb4", "score": "0.55061275", "text": "async callable(caller, test, apparatus, container, args) {\n const log = [];\n test.callCount++;\n if (!test.hasFunction) {\n log.push(\"ignored because has no function\");\n test.createStub(caller, args, log);\n return Promise.resolve();\n }\n this.awaiting++;\n args.unshift(apparatus);\n const start = perf_hooks_1.performance.now();\n try {\n log.push(`init by ${caller ? caller.breadCrumbs.join(\">\") : 'core'}`);\n const response = test.handler.apply(test.context, args);\n if (response instanceof Promise) {\n log.push(`promise detected`);\n return new Promise((done) => {\n let resolved = false;\n let counter = 0;\n let promiseReturned = false;\n log.push(`timer started`);\n const timer = setInterval(() => {\n if (promiseReturned) {\n log.push(\"timer disgarded\");\n clearInterval(timer);\n }\n else {\n if (counter > test.timeout) {\n log.push(\"timer protocol invoked\");\n clearInterval(timer);\n resolved = true;\n coolKids_1.whenFunction(apparatus[\"beforeThrowingHandler\"])();\n this.returned++;\n const error = new Error(`Timeout Error: [${test.breadCrumbs.join(\"/\")}] took longer than ${test.timeout}ms to run`);\n log.push(`timer resolved`);\n test.createFailure(caller, error, args, container.spotlights, container.warnings, start, log);\n done();\n }\n else {\n log.push(`timer incremented to: ${counter}`);\n counter += 1000;\n }\n }\n }, 1000);\n response\n .then(() => {\n promiseReturned = true;\n if (!resolved) {\n this.returned++;\n log.push(`resolved`);\n test.createSuccess(caller, args, container.spotlights, container.warnings, start, log);\n done();\n }\n })\n .catch(err => {\n promiseReturned = true;\n if (!resolved) {\n coolKids_1.whenFunction(apparatus[\"beforeThrowingHandler\"])();\n this.returned++;\n log.push(`resolved with error`);\n test.createFailure(caller, err, args, container.spotlights, container.warnings, start, log);\n done();\n }\n });\n });\n }\n else {\n this.returned++;\n test.createSuccess(caller, args, container.spotlights, container.warnings, start, log);\n return Promise.resolve();\n }\n }\n catch (err) {\n coolKids_1.whenFunction(apparatus[\"beforeThrowingHandler\"])();\n this.returned++;\n log.push(`resolved synchronously with error`);\n test.createFailure(caller, err, args, container.spotlights, container.warnings, start, log);\n return Promise.resolve();\n }\n }", "title": "" } ]
92f92f07983659bd374fe61e768afdcc
Chain conversions given the request and the original response Also sets the responseXXX fields on the jqXHR instance
[ { "docid": "efb277e04b85aeae1cacc2659311374d", "score": "0.5959999", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev, converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n current = dataTypes.shift();\n // Convert to each sequential dataType\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n prev = current;\n current = dataTypes.shift();\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === '*') {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== '*' && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + ' ' + current] || converters['* ' + current];\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(' ');\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + ' ' + tmp[0]] || converters['* ' + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: 'parsererror',\n error: conv ? e : 'No conversion from ' + prev + ' to ' + current\n };\n }\n }\n }\n }\n }\n }\n return {\n state: 'success',\n data: response\n };\n }", "title": "" } ]
[ { "docid": "21a6bafbae9450becdae248516301fd7", "score": "0.62648493", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters) {converters[conv.toLowerCase()] = s.converters[conv];}}current = dataTypes.shift(); // Convert to each sequential dataType\nwhile(current) {if(s.responseFields[current]){jqXHR[s.responseFields[current]] = response;} // Apply the dataFilter if provided\nif(!prev && isSuccess && s.dataFilter){response = s.dataFilter(response,s.dataType);}prev = current;current = dataTypes.shift();if(current){ // There's only work to do if current dataType is non-auto\nif(current === \"*\"){current = prev; // Convert response if prev dataType is non-auto and differs from current\n}else if(prev !== \"*\" && prev !== current){ // Seek a direct converter\nconv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\nif(!conv){for(conv2 in converters) { // If conv2 outputs current\ntmp = conv2.split(\" \");if(tmp[1] === current){ // If prev can be converted to accepted input\nconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];if(conv){ // Condense equivalence converters\nif(conv === true){conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n}else if(converters[conv2] !== true){current = tmp[0];dataTypes.unshift(tmp[1]);}break;}}}} // Apply converter (if not an equivalence)\nif(conv !== true){ // Unless errors are allowed to bubble, catch and return them\nif(conv && s[\"throws\"]){response = conv(response);}else {try{response = conv(response);}catch(e) {return {state:\"parsererror\",error:conv?e:\"No conversion from \" + prev + \" to \" + current};}}}}}}return {state:\"success\",data:response};}", "title": "" }, { "docid": "5e2ba82b8bfa8d455f1cd1f4369105e5", "score": "0.6223466", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\n\tdataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\n\tif(dataTypes[1]){for(conv in s.converters) {converters[conv.toLowerCase()] = s.converters[conv];}}current = dataTypes.shift(); // Convert to each sequential dataType\n\twhile(current) {if(s.responseFields[current]){jqXHR[s.responseFields[current]] = response;} // Apply the dataFilter if provided\n\tif(!prev && isSuccess && s.dataFilter){response = s.dataFilter(response,s.dataType);}prev = current;current = dataTypes.shift();if(current){ // There's only work to do if current dataType is non-auto\n\tif(current === \"*\"){current = prev; // Convert response if prev dataType is non-auto and differs from current\n\t}else if(prev !== \"*\" && prev !== current){ // Seek a direct converter\n\tconv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\tif(!conv){for(conv2 in converters) { // If conv2 outputs current\n\ttmp = conv2.split(\" \");if(tmp[1] === current){ // If prev can be converted to accepted input\n\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];if(conv){ // Condense equivalence converters\n\tif(conv === true){conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n\t}else if(converters[conv2] !== true){current = tmp[0];dataTypes.unshift(tmp[1]);}break;}}}} // Apply converter (if not an equivalence)\n\tif(conv !== true){ // Unless errors are allowed to bubble, catch and return them\n\tif(conv && s[\"throws\"]){response = conv(response);}else {try{response = conv(response);}catch(e) {return {state:\"parsererror\",error:conv?e:\"No conversion from \" + prev + \" to \" + current};}}}}}}return {state:\"success\",data:response};}", "title": "" }, { "docid": "5e2ba82b8bfa8d455f1cd1f4369105e5", "score": "0.6223466", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={}, // Work with a copy of dataTypes in case we need to modify it for conversion\n\tdataTypes=s.dataTypes.slice(); // Create converters map with lowercased keys\n\tif(dataTypes[1]){for(conv in s.converters) {converters[conv.toLowerCase()] = s.converters[conv];}}current = dataTypes.shift(); // Convert to each sequential dataType\n\twhile(current) {if(s.responseFields[current]){jqXHR[s.responseFields[current]] = response;} // Apply the dataFilter if provided\n\tif(!prev && isSuccess && s.dataFilter){response = s.dataFilter(response,s.dataType);}prev = current;current = dataTypes.shift();if(current){ // There's only work to do if current dataType is non-auto\n\tif(current === \"*\"){current = prev; // Convert response if prev dataType is non-auto and differs from current\n\t}else if(prev !== \"*\" && prev !== current){ // Seek a direct converter\n\tconv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\tif(!conv){for(conv2 in converters) { // If conv2 outputs current\n\ttmp = conv2.split(\" \");if(tmp[1] === current){ // If prev can be converted to accepted input\n\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];if(conv){ // Condense equivalence converters\n\tif(conv === true){conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n\t}else if(converters[conv2] !== true){current = tmp[0];dataTypes.unshift(tmp[1]);}break;}}}} // Apply converter (if not an equivalence)\n\tif(conv !== true){ // Unless errors are allowed to bubble, catch and return them\n\tif(conv && s[\"throws\"]){response = conv(response);}else {try{response = conv(response);}catch(e) {return {state:\"parsererror\",error:conv?e:\"No conversion from \" + prev + \" to \" + current};}}}}}}return {state:\"success\",data:response};}", "title": "" }, { "docid": "fbf02a7885e976970bfc46c36e5ec842", "score": "0.618564", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s[\"throws\"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "fbf02a7885e976970bfc46c36e5ec842", "score": "0.618564", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s[\"throws\"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "fbf02a7885e976970bfc46c36e5ec842", "score": "0.618564", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s[\"throws\"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "fbf02a7885e976970bfc46c36e5ec842", "score": "0.618564", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s[\"throws\"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "3288369de10e950b64e96d394794d97b", "score": "0.61795634", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "3288369de10e950b64e96d394794d97b", "score": "0.61795634", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "3288369de10e950b64e96d394794d97b", "score": "0.61795634", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "3288369de10e950b64e96d394794d97b", "score": "0.61795634", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "3288369de10e950b64e96d394794d97b", "score": "0.61795634", "text": "function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},// Work with a copy of dataTypes in case we need to modify it for conversion\ndataTypes=s.dataTypes.slice();// Create converters map with lowercased keys\nif(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}current=dataTypes.shift();// Convert to each sequential dataType\nwhile(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}// Apply the dataFilter if provided\nif(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}prev=current;current=dataTypes.shift();if(current){// There's only work to do if current dataType is non-auto\nif(current===\"*\"){current=prev;// Convert response if prev dataType is non-auto and differs from current\n}else if(prev!==\"*\"&&prev!==current){// Seek a direct converter\nconv=converters[prev+\" \"+current]||converters[\"* \"+current];// If none found, seek a pair\nif(!conv){for(conv2 in converters){// If conv2 outputs current\ntmp=conv2.split(\" \");if(tmp[1]===current){// If prev can be converted to accepted input\nconv=converters[prev+\" \"+tmp[0]]||converters[\"* \"+tmp[0]];if(conv){// Condense equivalence converters\nif(conv===true){conv=converters[conv2];// Otherwise, insert the intermediate dataType\n}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}break;}}}}// Apply converter (if not an equivalence)\nif(conv!==true){// Unless errors are allowed to bubble, catch and return them\nif(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:\"parsererror\",error:conv?e:\"No conversion from \"+prev+\" to \"+current};}}}}}}return{state:\"success\",data:response};}", "title": "" }, { "docid": "50874a4eafcea1ae8c5af6776330ec64", "score": "0.60880023", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "50874a4eafcea1ae8c5af6776330ec64", "score": "0.60880023", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "458c2c52ee3b1dae2616f5c2329ef51e", "score": "0.6075834", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "458c2c52ee3b1dae2616f5c2329ef51e", "score": "0.6075834", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "458c2c52ee3b1dae2616f5c2329ef51e", "score": "0.6075834", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "458c2c52ee3b1dae2616f5c2329ef51e", "score": "0.6075834", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys\n\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift(); // Convert to each sequential dataType\n\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n } // Apply the dataFilter if provided\n\n\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current]; // If none found, seek a pair\n\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n\n break;\n }\n }\n }\n } // Apply converter (if not an equivalence)\n\n\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "222bde25d415c77b12fdb41a2438ecfe", "score": "0.5983215", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "d6339d0b625b71d8f4d6a47e2be31a0f", "score": "0.5983215", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "df43502bb2b7ed99eda38491e88c0298", "score": "0.59742326", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev, converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n current = dataTypes.shift();\n // Convert to each sequential dataType\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n prev = current;\n current = dataTypes.shift();\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === '*') {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== '*' && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + ' ' + current] || converters['* ' + current];\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(' ');\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + ' ' + tmp[0]] || converters['* ' + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s['throws']) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: 'parsererror',\n error: conv ? e : 'No conversion from ' + prev + ' to ' + current\n };\n }\n }\n }\n }\n }\n }\n return {\n state: 'success',\n data: response\n };\n }", "title": "" }, { "docid": "e33636b2575080add924042771e4d39b", "score": "0.5973394", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv =\n converters[prev + \" \" + current] ||\n converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv =\n converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv\n ? e\n : \"No conversion from \" +\n prev +\n \" to \" +\n current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "005172cb34f238e4eb756c18a0a06eae", "score": "0.597183", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev, converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n current = dataTypes.shift();\n // Convert to each sequential dataType\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n prev = current;\n current = dataTypes.shift();\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === '*') {\n current = prev; // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== '*' && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + ' ' + current] || converters['* ' + current];\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(' ');\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + ' ' + tmp[0]] || converters['* ' + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2]; // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: 'parsererror',\n error: conv ? e : 'No conversion from ' + prev + ' to ' + current\n };\n }\n }\n }\n }\n }\n }\n return {\n state: 'success',\n data: response\n };\n }", "title": "" }, { "docid": "c6d52f394a8ffdc18d6b549a1c9eac83", "score": "0.5971582", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: \"success\",\n data: response\n };\n }", "title": "" }, { "docid": "bc09b11f6c62f53d0a67837ebdfe57ba", "score": "0.5969893", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "title": "" }, { "docid": "bc09b11f6c62f53d0a67837ebdfe57ba", "score": "0.5969893", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n}", "title": "" }, { "docid": "e63a5ef581adcf9c66cad5c67e8d2e6a", "score": "0.5967369", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n \n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n \n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n \n current = dataTypes.shift();\n \n // Convert to each sequential dataType\n while ( current ) {\n \n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n \n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n \n prev = current;\n current = dataTypes.shift();\n \n if ( current ) {\n \n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n \n current = prev;\n \n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n \n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n \n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n \n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n \n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n \n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n \n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n \n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n \n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s.throws ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n \n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "e5cd2b646be9e494afb1b3314846790f", "score": "0.5964534", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === '*') {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== '*' && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + ' ' + current] || converters['* ' + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(' ');\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + ' ' + tmp[0]] ||\n converters['* ' + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: 'parsererror',\n error: conv ? e : 'No conversion from ' + prev + ' to ' + current\n };\n }\n }\n }\n }\n }\n }\n\n return {\n state: 'success',\n data: response\n };\n }", "title": "" }, { "docid": "11664e39a906fdca2bcf0541f01dd60e", "score": "0.59563625", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n \n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n \n current = dataTypes.shift();\n \n // Convert to each sequential dataType\n while ( current ) {\n \n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n \n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n \n prev = current;\n current = dataTypes.shift();\n \n if ( current ) {\n \n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n \n current = prev;\n \n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n \n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n \n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n \n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n \n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n \n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n \n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n \n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n \n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "2be65eb0fc70965abd19bf3943534f2c", "score": "0.59528065", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s[ \"throws\" ] ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "4480ab49ba5360f04c00a94239f34fd5", "score": "0.5950653", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) { // jscs:ignore requireDotNotation\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "title": "" }, { "docid": "4480ab49ba5360f04c00a94239f34fd5", "score": "0.5950653", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if (current) {\n\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] ||\n converters[\"* \" + tmp[0]];\n if (conv) {\n\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s[\"throws\"]) { // jscs:ignore requireDotNotation\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return {state: \"success\", data: response};\n }", "title": "" }, { "docid": "ff3b6883bc75a2c54d0ce24d1f9e023e", "score": "0.5933541", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n var conv2, current, conv, tmp, prev,\n converters = {},\n\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if ( dataTypes[ 1 ] ) {\n for ( conv in s.converters ) {\n converters[ conv.toLowerCase() ] = s.converters[ conv ];\n }\n }\n\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while ( current ) {\n\n if ( s.responseFields[ current ] ) {\n jqXHR[ s.responseFields[ current ] ] = response;\n }\n\n // Apply the dataFilter if provided\n if ( !prev && isSuccess && s.dataFilter ) {\n response = s.dataFilter( response, s.dataType );\n }\n\n prev = current;\n current = dataTypes.shift();\n\n if ( current ) {\n\n // There's only work to do if current dataType is non-auto\n if ( current === \"*\" ) {\n\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if ( prev !== \"*\" && prev !== current ) {\n\n // Seek a direct converter\n conv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n // If none found, seek a pair\n if ( !conv ) {\n for ( conv2 in converters ) {\n\n // If conv2 outputs current\n tmp = conv2.split( \" \" );\n if ( tmp[ 1 ] === current ) {\n\n // If prev can be converted to accepted input\n conv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n converters[ \"* \" + tmp[ 0 ] ];\n if ( conv ) {\n\n // Condense equivalence converters\n if ( conv === true ) {\n conv = converters[ conv2 ];\n\n // Otherwise, insert the intermediate dataType\n } else if ( converters[ conv2 ] !== true ) {\n current = tmp[ 0 ];\n dataTypes.unshift( tmp[ 1 ] );\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if ( conv !== true ) {\n\n // Unless errors are allowed to bubble, catch and return them\n if ( conv && s.throws ) {\n response = conv( response );\n } else {\n try {\n response = conv( response );\n } catch ( e ) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n\n return { state: \"success\", data: response };\n }", "title": "" }, { "docid": "bbb82b83b4035dc5c32ef2a1498c4d43", "score": "0.5835514", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\t\t\t\t\t\t\tvar conv2,\n\t\t\t\t\t\t\t\t current,\n\t\t\t\t\t\t\t\t conv,\n\t\t\t\t\t\t\t\t tmp,\n\t\t\t\t\t\t\t\t prev,\n\t\t\t\t\t\t\t\t converters = {},\n\n\n\t\t\t\t\t\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\t\t\t\t\t\tdataTypes = s.dataTypes.slice();\n\n\t\t\t\t\t\t\t\t// Create converters map with lowercased keys\n\t\t\t\t\t\t\t\tif (dataTypes[1]) {\n\t\t\t\t\t\t\t\t\tfor (conv in s.converters) {\n\t\t\t\t\t\t\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcurrent = dataTypes.shift();\n\n\t\t\t\t\t\t\t\t// Convert to each sequential dataType\n\t\t\t\t\t\t\t\twhile (current) {\n\n\t\t\t\t\t\t\t\t\tif (s.responseFields[current]) {\n\t\t\t\t\t\t\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Apply the dataFilter if provided\n\t\t\t\t\t\t\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\t\t\t\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tprev = current;\n\t\t\t\t\t\t\t\t\tcurrent = dataTypes.shift();\n\n\t\t\t\t\t\t\t\t\tif (current) {\n\n\t\t\t\t\t\t\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\t\t\t\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\t\t\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t\t\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t\t\t\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t\t\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t\t\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\t\t\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\t\t\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\t\t\t\t\t\t\tif (conv && s[\"throws\"]) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jscs:ignore requireDotNotation\n\t\t\t\t\t\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn { state: \"success\", data: response };\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "070411056d659bb83a2dbbd4779aafdc", "score": "0.58018446", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\n\tvar conv2, current, conv, tmp, prev,\n\n\t\tconverters = {},\n\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\n\t\tdataTypes = s.dataTypes.slice();\n\n\n\n\t// Create converters map with lowercased keys\n\n\tif ( dataTypes[ 1 ] ) {\n\n\t\tfor ( conv in s.converters ) {\n\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\n\t\t}\n\n\t}\n\n\n\n\tcurrent = dataTypes.shift();\n\n\n\n\t// Convert to each sequential dataType\n\n\twhile ( current ) {\n\n\n\n\t\tif ( s.responseFields[ current ] ) {\n\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\n\t\t}\n\n\n\n\t\t// Apply the dataFilter if provided\n\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\n\t\t}\n\n\n\n\t\tprev = current;\n\n\t\tcurrent = dataTypes.shift();\n\n\n\n\t\tif ( current ) {\n\n\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\n\t\t\tif ( current === \"*\" ) {\n\n\n\n\t\t\t\tcurrent = prev;\n\n\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\n\n\t\t\t\t// Seek a direct converter\n\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\n\n\t\t\t\t// If none found, seek a pair\n\n\t\t\t\tif ( !conv ) {\n\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\n\n\t\t\t\t\t\t// If conv2 outputs current\n\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\n\t\t\t\t\t\t\tif ( conv ) {\n\n\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\n\t\t\t\tif ( conv !== true ) {\n\n\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\n\t\t\t\t\tif ( conv && s.throws ) {\n\n\t\t\t\t\t\tresponse = conv( response );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\tresponse = conv( response );\n\n\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\treturn {\n\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\n\n\treturn { state: \"success\", data: response };\n\n}", "title": "" }, { "docid": "ee526be9d87292335f998b2ed80abffc", "score": "0.5752818", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\r\n\tvar conv2, current, conv, tmp, prev,\r\n\t\tconverters = {},\r\n\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\tdataTypes = s.dataTypes.slice();\r\n\r\n\t// Create converters map with lowercased keys\r\n\tif ( dataTypes[ 1 ] ) {\r\n\t\tfor ( conv in s.converters ) {\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\n\t\t}\r\n\t}\r\n\r\n\tcurrent = dataTypes.shift();\r\n\r\n\t// Convert to each sequential dataType\r\n\twhile ( current ) {\r\n\r\n\t\tif ( s.responseFields[ current ] ) {\r\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\r\n\t\t}\r\n\r\n\t\t// Apply the dataFilter if provided\r\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\r\n\t\t\tresponse = s.dataFilter( response, s.dataType );\r\n\t\t}\r\n\r\n\t\tprev = current;\r\n\t\tcurrent = dataTypes.shift();\r\n\r\n\t\tif ( current ) {\r\n\r\n\t\t\t// There's only work to do if current dataType is non-auto\r\n\t\t\tif ( current === \"*\" ) {\r\n\r\n\t\t\t\tcurrent = prev;\r\n\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\r\n\r\n\t\t\t\t// Seek a direct converter\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\n\r\n\t\t\t\t// If none found, seek a pair\r\n\t\t\t\tif ( !conv ) {\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\n\r\n\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\n\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\n\t\t\t\t\t\t\tif ( conv ) {\r\n\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\n\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\r\n\t\t\t\t\t\t\t\t}\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}\r\n\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\tif ( conv !== true ) {\r\n\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\tif ( conv && s.throws ) {\r\n\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t\t} catch ( e ) {\r\n\t\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\r\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\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\r\n\treturn { state: \"success\", data: response };\r\n}", "title": "" }, { "docid": "5ac7b85df681be6a643652ab69818637", "score": "0.5745981", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\r\n\tvar conv2, current, conv, tmp, prev,\r\n\t\tconverters = {},\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\tdataTypes = s.dataTypes.slice();\r\n\r\n\t// Create converters map with lowercased keys\r\n\tif ( dataTypes[ 1 ] ) {\r\n\t\tfor ( conv in s.converters ) {\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\n\t\t}\r\n\t}\r\n\r\n\tcurrent = dataTypes.shift();\r\n\r\n\t// Convert to each sequential dataType\r\n\twhile ( current ) {\r\n\r\n\t\tif ( s.responseFields[ current ] ) {\r\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\r\n\t\t}\r\n\r\n\t\t// Apply the dataFilter if provided\r\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\r\n\t\t\tresponse = s.dataFilter( response, s.dataType );\r\n\t\t}\r\n\r\n\t\tprev = current;\r\n\t\tcurrent = dataTypes.shift();\r\n\r\n\t\tif ( current ) {\r\n\r\n\t\t\t// There's only work to do if current dataType is non-auto\r\n\t\t\tif ( current === \"*\" ) {\r\n\r\n\t\t\t\tcurrent = prev;\r\n\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\r\n\r\n\t\t\t\t// Seek a direct converter\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\n\r\n\t\t\t\t// If none found, seek a pair\r\n\t\t\t\tif ( !conv ) {\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\n\r\n\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\n\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\n\t\t\t\t\t\t\tif ( conv ) {\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\n\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\r\n\t\t\t\t\t\t\t\t}\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}\r\n\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\tif ( conv !== true ) {\r\n\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\r\n\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t\t} catch ( e ) {\r\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\r\n\treturn { state: \"success\", data: response };\r\n}", "title": "" }, { "docid": "eb7c10e99d26acc1fb9d1328508c74be", "score": "0.5744899", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\r\n\tvar conv2, current, conv, tmp, prev,\r\n\t\tconverters = {},\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\tdataTypes = s.dataTypes.slice();\r\n\r\n\t// Create converters map with lowercased keys\r\n\tif ( dataTypes[ 1 ] ) {\r\n\t\tfor ( conv in s.converters ) {\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\n\t\t}\r\n\t}\r\n\r\n\tcurrent = dataTypes.shift();\r\n\r\n\t// Convert to each sequential dataType\r\n\twhile ( current ) {\r\n\r\n\t\tif ( s.responseFields[ current ] ) {\r\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\r\n\t\t}\r\n\r\n\t\t// Apply the dataFilter if provided\r\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\r\n\t\t\tresponse = s.dataFilter( response, s.dataType );\r\n\t\t}\r\n\r\n\t\tprev = current;\r\n\t\tcurrent = dataTypes.shift();\r\n\r\n\t\tif ( current ) {\r\n\r\n\t\t// There's only work to do if current dataType is non-auto\r\n\t\t\tif ( current === \"*\" ) {\r\n\r\n\t\t\t\tcurrent = prev;\r\n\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\r\n\r\n\t\t\t\t// Seek a direct converter\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\n\r\n\t\t\t\t// If none found, seek a pair\r\n\t\t\t\tif ( !conv ) {\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\n\r\n\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\n\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\n\t\t\t\t\t\t\tif ( conv ) {\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\n\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\r\n\t\t\t\t\t\t\t\t}\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}\r\n\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\tif ( conv !== true ) {\r\n\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\r\n\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t\t} catch ( e ) {\r\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\r\n\treturn { state: \"success\", data: response };\r\n}", "title": "" }, { "docid": "eb7c10e99d26acc1fb9d1328508c74be", "score": "0.5744899", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\r\n\tvar conv2, current, conv, tmp, prev,\r\n\t\tconverters = {},\r\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\r\n\t\tdataTypes = s.dataTypes.slice();\r\n\r\n\t// Create converters map with lowercased keys\r\n\tif ( dataTypes[ 1 ] ) {\r\n\t\tfor ( conv in s.converters ) {\r\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\r\n\t\t}\r\n\t}\r\n\r\n\tcurrent = dataTypes.shift();\r\n\r\n\t// Convert to each sequential dataType\r\n\twhile ( current ) {\r\n\r\n\t\tif ( s.responseFields[ current ] ) {\r\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\r\n\t\t}\r\n\r\n\t\t// Apply the dataFilter if provided\r\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\r\n\t\t\tresponse = s.dataFilter( response, s.dataType );\r\n\t\t}\r\n\r\n\t\tprev = current;\r\n\t\tcurrent = dataTypes.shift();\r\n\r\n\t\tif ( current ) {\r\n\r\n\t\t// There's only work to do if current dataType is non-auto\r\n\t\t\tif ( current === \"*\" ) {\r\n\r\n\t\t\t\tcurrent = prev;\r\n\r\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\r\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\r\n\r\n\t\t\t\t// Seek a direct converter\r\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\r\n\r\n\t\t\t\t// If none found, seek a pair\r\n\t\t\t\tif ( !conv ) {\r\n\t\t\t\t\tfor ( conv2 in converters ) {\r\n\r\n\t\t\t\t\t\t// If conv2 outputs current\r\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\r\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\r\n\r\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\r\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\r\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\r\n\t\t\t\t\t\t\tif ( conv ) {\r\n\t\t\t\t\t\t\t\t// Condense equivalence converters\r\n\t\t\t\t\t\t\t\tif ( conv === true ) {\r\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\r\n\r\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\r\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\r\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\r\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\r\n\t\t\t\t\t\t\t\t}\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}\r\n\r\n\t\t\t\t// Apply converter (if not an equivalence)\r\n\t\t\t\tif ( conv !== true ) {\r\n\r\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\r\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\r\n\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tresponse = conv( response );\r\n\t\t\t\t\t\t} catch ( e ) {\r\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\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\r\n\treturn { state: \"success\", data: response };\r\n}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "7536cc09e34217213ad8cb66739c49a6", "score": "0.57383716", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\tvar conv2,\n\t\t current,\n\t\t conv,\n\t\t tmp,\n\t\t prev,\n\t\t converters = {},\n\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t\t// Create converters map with lowercased keys\n\t\tif (dataTypes[1]) {\n\t\t\tfor (conv in s.converters) {\n\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t}\n\t\t}\n\n\t\tcurrent = dataTypes.shift();\n\n\t\t// Convert to each sequential dataType\n\t\twhile (current) {\n\n\t\t\tif (s.responseFields[current]) {\n\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t}\n\n\t\t\t// Apply the dataFilter if provided\n\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t}\n\n\t\t\tprev = current;\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\tif (current) {\n\n\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\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\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { state: \"success\", data: response };\n\t}", "title": "" }, { "docid": "e4f192e33f72da867aa438b072d4894d", "score": "0.57057244", "text": "function ajaxConvert(s, response, jqXHR, isSuccess) {\n\t\t\tvar conv2,\n\t\t\t current,\n\t\t\t conv,\n\t\t\t tmp,\n\t\t\t prev,\n\t\t\t converters = {},\n\n\n\t\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\t\tdataTypes = s.dataTypes.slice();\n\n\t\t\t// Create converters map with lowercased keys\n\t\t\tif (dataTypes[1]) {\n\t\t\t\tfor (conv in s.converters) {\n\t\t\t\t\tconverters[conv.toLowerCase()] = s.converters[conv];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent = dataTypes.shift();\n\n\t\t\t// Convert to each sequential dataType\n\t\t\twhile (current) {\n\n\t\t\t\tif (s.responseFields[current]) {\n\t\t\t\t\tjqXHR[s.responseFields[current]] = response;\n\t\t\t\t}\n\n\t\t\t\t// Apply the dataFilter if provided\n\t\t\t\tif (!prev && isSuccess && s.dataFilter) {\n\t\t\t\t\tresponse = s.dataFilter(response, s.dataType);\n\t\t\t\t}\n\n\t\t\t\tprev = current;\n\t\t\t\tcurrent = dataTypes.shift();\n\n\t\t\t\tif (current) {\n\n\t\t\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\t\t\tif (current === \"*\") {\n\n\t\t\t\t\t\tcurrent = prev;\n\n\t\t\t\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t\t\t} else if (prev !== \"*\" && prev !== current) {\n\n\t\t\t\t\t\t// Seek a direct converter\n\t\t\t\t\t\tconv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n\t\t\t\t\t\t// If none found, seek a pair\n\t\t\t\t\t\tif (!conv) {\n\t\t\t\t\t\t\tfor (conv2 in converters) {\n\n\t\t\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\t\t\ttmp = conv2.split(\" \");\n\t\t\t\t\t\t\t\tif (tmp[1] === current) {\n\n\t\t\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\t\t\tconv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n\t\t\t\t\t\t\t\t\tif (conv) {\n\n\t\t\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\t\t\tif (conv === true) {\n\t\t\t\t\t\t\t\t\t\t\tconv = converters[conv2];\n\n\t\t\t\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t\t\t} else if (converters[conv2] !== true) {\n\t\t\t\t\t\t\t\t\t\t\tcurrent = tmp[0];\n\t\t\t\t\t\t\t\t\t\t\tdataTypes.unshift(tmp[1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\t\t\tif (conv !== true) {\n\n\t\t\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\t\t\tif (conv && s.throws) {\n\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tresponse = conv(response);\n\t\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { state: \"success\", data: response };\n\t\t}", "title": "" }, { "docid": "66b4ef464dddb576eb6385db171aea07", "score": "0.5705618", "text": "function done( status, statusText, responses, headers ) {\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status ? 4 : 0;\n\n\t\t\tvar isSuccess,\n\t\t\t\tsuccess,\n\t\t\t\terror,\n\t\t\t\tresponse = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,\n\t\t\t\tlastModified,\n\t\t\t\tetag;\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tif ( ( lastModified = jqXHR.getResponseHeader( \"Last-Modified\" ) ) ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = lastModified;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( etag = jqXHR.getResponseHeader( \"Etag\" ) ) ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = etag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuccess = ajaxConvert( s, response );\n\t\t\t\t\t\tstatusText = \"success\";\n\t\t\t\t\t\tisSuccess = true;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// We have a parsererror\n\t\t\t\t\t\tstatusText = \"parsererror\";\n\t\t\t\t\t\terror = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = statusText;\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "66b4ef464dddb576eb6385db171aea07", "score": "0.5705618", "text": "function done( status, statusText, responses, headers ) {\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status ? 4 : 0;\n\n\t\t\tvar isSuccess,\n\t\t\t\tsuccess,\n\t\t\t\terror,\n\t\t\t\tresponse = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,\n\t\t\t\tlastModified,\n\t\t\t\tetag;\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tif ( ( lastModified = jqXHR.getResponseHeader( \"Last-Modified\" ) ) ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = lastModified;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( etag = jqXHR.getResponseHeader( \"Etag\" ) ) ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = etag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuccess = ajaxConvert( s, response );\n\t\t\t\t\t\tstatusText = \"success\";\n\t\t\t\t\t\tisSuccess = true;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// We have a parsererror\n\t\t\t\t\t\tstatusText = \"parsererror\";\n\t\t\t\t\t\terror = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = statusText;\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "66b4ef464dddb576eb6385db171aea07", "score": "0.5705618", "text": "function done( status, statusText, responses, headers ) {\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status ? 4 : 0;\n\n\t\t\tvar isSuccess,\n\t\t\t\tsuccess,\n\t\t\t\terror,\n\t\t\t\tresponse = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,\n\t\t\t\tlastModified,\n\t\t\t\tetag;\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tif ( ( lastModified = jqXHR.getResponseHeader( \"Last-Modified\" ) ) ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = lastModified;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( etag = jqXHR.getResponseHeader( \"Etag\" ) ) ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = etag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuccess = ajaxConvert( s, response );\n\t\t\t\t\t\tstatusText = \"success\";\n\t\t\t\t\t\tisSuccess = true;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// We have a parsererror\n\t\t\t\t\t\tstatusText = \"parsererror\";\n\t\t\t\t\t\terror = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = statusText;\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "66b4ef464dddb576eb6385db171aea07", "score": "0.5705618", "text": "function done( status, statusText, responses, headers ) {\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status ? 4 : 0;\n\n\t\t\tvar isSuccess,\n\t\t\t\tsuccess,\n\t\t\t\terror,\n\t\t\t\tresponse = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,\n\t\t\t\tlastModified,\n\t\t\t\tetag;\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tif ( ( lastModified = jqXHR.getResponseHeader( \"Last-Modified\" ) ) ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = lastModified;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( etag = jqXHR.getResponseHeader( \"Etag\" ) ) ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = etag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuccess = ajaxConvert( s, response );\n\t\t\t\t\t\tstatusText = \"success\";\n\t\t\t\t\t\tisSuccess = true;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// We have a parsererror\n\t\t\t\t\t\tstatusText = \"parsererror\";\n\t\t\t\t\t\terror = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = statusText;\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "66b4ef464dddb576eb6385db171aea07", "score": "0.5705618", "text": "function done( status, statusText, responses, headers ) {\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status ? 4 : 0;\n\n\t\t\tvar isSuccess,\n\t\t\t\tsuccess,\n\t\t\t\terror,\n\t\t\t\tresponse = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,\n\t\t\t\tlastModified,\n\t\t\t\tetag;\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tif ( ( lastModified = jqXHR.getResponseHeader( \"Last-Modified\" ) ) ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = lastModified;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( etag = jqXHR.getResponseHeader( \"Etag\" ) ) ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = etag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuccess = ajaxConvert( s, response );\n\t\t\t\t\t\tstatusText = \"success\";\n\t\t\t\t\t\tisSuccess = true;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// We have a parsererror\n\t\t\t\t\t\tstatusText = \"parsererror\";\n\t\t\t\t\t\terror = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = statusText;\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "66b4ef464dddb576eb6385db171aea07", "score": "0.5705618", "text": "function done( status, statusText, responses, headers ) {\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status ? 4 : 0;\n\n\t\t\tvar isSuccess,\n\t\t\t\tsuccess,\n\t\t\t\terror,\n\t\t\t\tresponse = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,\n\t\t\t\tlastModified,\n\t\t\t\tetag;\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( status >= 200 && status < 300 || status === 304 ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\n\t\t\t\t\tif ( ( lastModified = jqXHR.getResponseHeader( \"Last-Modified\" ) ) ) {\n\t\t\t\t\t\tjQuery.lastModified[ ifModifiedKey ] = lastModified;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ( etag = jqXHR.getResponseHeader( \"Etag\" ) ) ) {\n\t\t\t\t\t\tjQuery.etag[ ifModifiedKey ] = etag;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If not modified\n\t\t\t\tif ( status === 304 ) {\n\n\t\t\t\t\tstatusText = \"notmodified\";\n\t\t\t\t\tisSuccess = true;\n\n\t\t\t\t// If we have data\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsuccess = ajaxConvert( s, response );\n\t\t\t\t\t\tstatusText = \"success\";\n\t\t\t\t\t\tisSuccess = true;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t// We have a parsererror\n\t\t\t\t\t\tstatusText = \"parsererror\";\n\t\t\t\t\t\terror = e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We extract error from statusText\n\t\t\t\t// then normalize statusText and status for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif( !statusText || status ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = statusText;\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajax\" + ( isSuccess ? \"Success\" : \"Error\" ),\n\t\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5105f392906d1765d7049bd6fbc72405", "score": "0.5703494", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\tcurrent = dataTypes.shift();\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\t\tif ( current ) {\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\t\t\t\tcurrent = prev;\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" }, { "docid": "396f21d2495f40834d312ec7941dc753", "score": "0.5695332", "text": "function ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}", "title": "" } ]
62ff1fdf967d17e55ab34120151f2b5d
need to get if the user is logged in or not
[ { "docid": "a39cd65483dc04f3adfb55a4d1dd1025", "score": "0.0", "text": "componentDidMount() {\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ authenticated: true });\n }\n });\n }", "title": "" } ]
[ { "docid": "de525bcc06d149cd86b900014226fb90", "score": "0.8541557", "text": "function isLoggedIn(){\n\t\t\treturn loggedIn; \n\t\t}", "title": "" }, { "docid": "680abb6b092ced5ec8ae3345a8f5b4d2", "score": "0.8518826", "text": "function isLoggedIn() {\n return !!user;\n }", "title": "" }, { "docid": "3161d76d7782a7e7f98bf3a9431da1ba", "score": "0.849396", "text": "function IsLoggedIn(){\n return loggedIn;\n }", "title": "" }, { "docid": "f80cbae86de8ed301655ed026f67efdc", "score": "0.8373854", "text": "function userLoggedIn() {\n return USER.id > 0;\n}", "title": "" }, { "docid": "4d1d4edd7c050cf15c0631dba97b6101", "score": "0.8352722", "text": "function isLoggedIn() {\n\tif (getUser()) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "335e191d023fd05568f6282d4699d2eb", "score": "0.83353394", "text": "function ifLoggedIn(){\n\t\t\treturn this.isLoggedIn;\n\t\t}", "title": "" }, { "docid": "b4481a00f31ee38ec101a458acb10dc3", "score": "0.82419676", "text": "function isLoggedIn() {\n const username = getLoginUserName();\n return (username ? true : false);\n}", "title": "" }, { "docid": "b2a9f04f62cfde002248c7419447744e", "score": "0.8236077", "text": "isUserLoggedIn() {\r\n var _a, _b;\r\n return Boolean((_b = (_a = this.readStateFromStorage()) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.access_token);\r\n }", "title": "" }, { "docid": "219dc4a22eed804ec50374e5e4999e2e", "score": "0.8204134", "text": "isLoggedIn() {}", "title": "" }, { "docid": "fc59e1053a5e46bde7b4f38e8c43154a", "score": "0.81836444", "text": "function userIsLoggedIn() {\r\n let userAuthToken = sessionStorage.getItem('authToken');\r\n return userAuthToken != '' && userAuthToken != null && userAuthToken != undefined;\r\n }", "title": "" }, { "docid": "18301f5b2d602d36e3ed80844da1683b", "score": "0.8154032", "text": "isUserLoggedIn() {\n let user = sessionStorage.getItem(USER_NAME_SESSION_ATTRIBUTE_NAME)\n if (user === null) return false\n return true\n }", "title": "" }, { "docid": "87994c39852ba65ff996568c77cd11d6", "score": "0.813476", "text": "function isLoggedIn() {\n return (sessionStorage && sessionStorage.user_id) ? true : false;\n}", "title": "" }, { "docid": "566af5c2f760eaffc29fc285b16547db", "score": "0.81316614", "text": "get isUserLoggedIn() {\n return !!this.__userApiToken__\n }", "title": "" }, { "docid": "418c8448f160fcd41196afa8b586eb5c", "score": "0.81281465", "text": "function isLoggedIn(){\n if(store.get('id_token'))\n return true;\n\n return false;\n }", "title": "" }, { "docid": "baf1507da1989d00755594d834558c0e", "score": "0.81253195", "text": "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "title": "" }, { "docid": "baf1507da1989d00755594d834558c0e", "score": "0.81253195", "text": "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "title": "" }, { "docid": "c2b835d0b6a2c084ae470ffefc42d8a9", "score": "0.81226707", "text": "isLoggedIn(state) {\n\t\treturn !!state.currentUser;\n\t}", "title": "" }, { "docid": "6189399b1a15906c849c2cde79fbbdeb", "score": "0.8082576", "text": "isLoggedIn() {\n const token = this.getToken();\n return !!token && !this.isTokenExpired(token);\n }", "title": "" }, { "docid": "aaddb739fc6830612727ea028d93a4af", "score": "0.80779064", "text": "isLoggedIn() {\n return this.Auth.getAuthData();\n }", "title": "" }, { "docid": "f2c7525b8b8b9ef79d7e5a538908923f", "score": "0.80776185", "text": "function userloggedIn() {\n\tif (window.sessionStorage.getItem(\"sessionToken\") === null || user === null || typeof user === 'undefined')\n\t\treturn false;\n\n\treturn true;\n}", "title": "" }, { "docid": "f7b4469f3419a06b3017465cbc1d0d3f", "score": "0.8077435", "text": "get isLoggedIn() {\n return !!(localStorage.token && this.props.user.id)\n }", "title": "" }, { "docid": "095121ff576b08e5d5e26b6c2e4dd319", "score": "0.8074183", "text": "function isAuthenticated(){\n return !!Session.username;\n }", "title": "" }, { "docid": "0b1d96944c7a4d61b5f59d9dcdff3c7e", "score": "0.80737174", "text": "isLoggedIn() {\n return this.user !== null && Object.keys(this.user).length > 0;\n }", "title": "" }, { "docid": "e71cced56352d2cd91f93ef01738ed21", "score": "0.8044791", "text": "function logged_in(ctx) {\n return ctx.username != null;\n}", "title": "" }, { "docid": "c439a0680fb1ee0c3f90974785c5e823", "score": "0.8031742", "text": "loggedIn(){\n\t\tconst token = this.getToken();\n\t\treturn !!token && !this.isTokenExpired(token);\n\t}", "title": "" }, { "docid": "3b5c35d7181351487b351a31982d7d03", "score": "0.7996158", "text": "function isloged() {\r\n if (!authContext.auth.login) return null;\r\n if (authContext.auth.login !== undefined && authContext.auth.login)\r\n return true;\r\n else return false;\r\n }", "title": "" }, { "docid": "a12faf31b30a69c1d31bfdfca7364023", "score": "0.7990501", "text": "isLoggedIn() {\n return this.isValidToken();\n }", "title": "" }, { "docid": "e6a04e4e2d5d93e46375126328e63a10", "score": "0.79834235", "text": "function loggedIn() {\n return cookieIsSet('user');\n}", "title": "" }, { "docid": "389aa4c00cc1287ee4c800ebadaf342d", "score": "0.7929214", "text": "async isLogged () {\n if (!this._session.user) return false\n const user = await this.getUser()\n return user && user.status == this._activeStatus\n }", "title": "" }, { "docid": "94a5cdc2e7cf5f0ca83aa0633ee01745", "score": "0.78946596", "text": "function isLoggedIn() {\n return getCookie('token') !== '' && getCookie('token') !== undefined\n }", "title": "" }, { "docid": "2f7de690caea9cabb9931fce2bd369d3", "score": "0.7887636", "text": "function isLoggedIn() { \n return (myOverlay.meta.loginuser != null && myOverlay.meta.loginuser == 'true'); \n }", "title": "" }, { "docid": "2505a584694d1c18340edde7e3e2beba", "score": "0.78863645", "text": "function isAuthenticated() {\n return !!session.getCurrentUser();\n }", "title": "" }, { "docid": "466acae300247655bc8da404c33322cd", "score": "0.78718466", "text": "function loggedIn() {\n return !!PDK.getSession();\n}", "title": "" }, { "docid": "45ca87c756a6dfc6a1ba9907eaa5c87e", "score": "0.7862128", "text": "function IsUserLoggedIn() {\n if (\n (GetSubCookieValue('User', 'Indy.MasterId') != null) &&\n (GetSubCookieValue('User', 'Indy.FirstName') != null) &&\n (GetSubCookieValue('User', 'Indy.MasterId') != '') &&\n (GetSubCookieValue('User', 'Indy.FirstName') != '')\n )\n { return true; }\n\n else\n { return false; }\n}", "title": "" }, { "docid": "1d13b0e73f3aaa07f13dc3aff3af0de9", "score": "0.7838081", "text": "function isUser() {\n return isLogged().then(function (res) {\n return res.data.user;\n })\n }", "title": "" }, { "docid": "e7927d13553fea1469aff95185463721", "score": "0.78246236", "text": "function isAuthent() {\n\treturn localStorage.getItem(\"userId\");\n}", "title": "" }, { "docid": "002f1f8c376cb8ca737e75e4c5f639a4", "score": "0.7777577", "text": "isAuthenticated() {\n \n if(!window.localStorage.getItem(\"isLoggedIn\"))\n return false;\n \n if(window.localStorage.getItem(\"isLoggedIn\")==\"false\")\n return false;\n else\n return true;\n }", "title": "" }, { "docid": "2b477c69a43c20eca23811770015eb70", "score": "0.77730817", "text": "function userLoggedIn(response) {\n if(typeof response.locals.user !== \"undefined\" && typeof response.locals.user.id !== \"undefined\") {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "048bbd40399b13208b3afa3161b982bf", "score": "0.77699953", "text": "function loggedIn() {\n return md.loggedIn;\n }", "title": "" }, { "docid": "5880e54958498802c5bc1fbf70830c2e", "score": "0.7768777", "text": "function isUserSignedIn() {\n return !!getAuth().currentUser;\n}", "title": "" }, { "docid": "f5d054bc304a9ccf5417492a649144a5", "score": "0.77499187", "text": "loggedIn () {\n return !!localStorage.id_token && !auth.isTokenExpired(localStorage.id_token);\n }", "title": "" }, { "docid": "8d8ae9048adec38d15b9a19d1edadc7c", "score": "0.7743315", "text": "function userLoggedIn() {\n if (Object.keys(user).length === 0 && user.constructor === Object) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "9a426315745a3c27a8167dfae21a89c4", "score": "0.7740677", "text": "isLoggedIn() {\n return typeof localStorage.getItem('authorizedUserDetails') === 'string';\n }", "title": "" }, { "docid": "a2280ecc99380c2f3acbf68df6315e7f", "score": "0.7731746", "text": "function checkIfAuthUser(){\n\treturn (sessionStorage && sessionStorage.getItem('token'));\n}", "title": "" }, { "docid": "44c83c40745a4362dabc3fe7d1cb4c04", "score": "0.7684669", "text": "function getLoggedIn() {\n\t\t\t\treturn loggedIn;\n\t\t\t}", "title": "" }, { "docid": "7f248acd3e817fef46b898d9f04af7d3", "score": "0.7657865", "text": "function isLoggedIn(req, res) {\n\tres.send(req.isAuthenticated() ? req.user : '0');\n}", "title": "" }, { "docid": "0399682fb4ca70cab83aa4ed4486a982", "score": "0.7652394", "text": "isLoggedIn() {\n const username = window.localStorage.getItem(\"username\");\n const key = window.localStorage.getItem(\"key\");\n return !!username && !!key; // !! converts to bool\n }", "title": "" }, { "docid": "4922379b4afc1de46ccee8659aa2fb6d", "score": "0.7646897", "text": "function isLoggedIn() {\n return docCookies.hasItem(\"isLoggedIn\");\n}", "title": "" }, { "docid": "933691aeeffce8c02492917ab6f33c42", "score": "0.76135594", "text": "function loggedIn(){\n\treturn dojo.byId(\"loggedIn\").value == \"True\";\n}", "title": "" }, { "docid": "1bf023dbf15a0c8bdec99cf1606a74cc", "score": "0.76077056", "text": "function isLoggedIn(req) {\n\treturn req.session.currentUser !== null && typeof req.session.currentUser !== 'undefined';\n}", "title": "" }, { "docid": "4fffe6e42a5a212e46388d6adbdf5571", "score": "0.755974", "text": "isLoggedIn(req) { return true; }", "title": "" }, { "docid": "897f2c4d2fe0d5d6e6c986e83e6d1429", "score": "0.7557546", "text": "logged_in()\r\n {\r\n return this.loggedin\r\n }", "title": "" }, { "docid": "8f9354479d31fb9b926f7f2d58fb5058", "score": "0.7529677", "text": "function checkAuth() {\n\t\t$.get('/current-user', function (data){\n\t\t\tconsole.log(data);\n\t\t\tif (data.user){\n\t\t\t\t$('.not-logged-in').hide();\n\t\t\t\t$('.logged-in').show();\n\t\t\t\t$('.test-button').show();\n\t\t\t\tconsole.log('logged in!');\n\t\t\t\t}else {\n\t\t\t\t$('.not-logged-in').show();\n\t\t\t\t$('.logged-in').hide();\n\t\t\t\tconsole.log('error logging in');\n\t\t\t}\n\t\t}\n\t)}", "title": "" }, { "docid": "3e2c90b10a032fd3a7c021c8a3327e50", "score": "0.7528044", "text": "get isLoggedIn() {\n return this.loggedIn;\n }", "title": "" }, { "docid": "5445799bfff571f14d273de3d14187e9", "score": "0.75255746", "text": "get isAuthenticated() {\n return !!this.currentUser;\n }", "title": "" }, { "docid": "787009d6d975c9acf5d6ed187c967b4f", "score": "0.7520861", "text": "function isUserSignedIn() {\n\n return !!firebase.auth().currentUser;\n\n }", "title": "" }, { "docid": "8b67e40b613b04b8d7cda844612774e1", "score": "0.75197405", "text": "function isLoggedIn(req) {\n \tif (req.session.user) {\n \t\treturn true;\n \t}\n \treturn false;\n }", "title": "" }, { "docid": "c8db93d24fadbaa05f304ed09041b842", "score": "0.7505558", "text": "function isUserLogged(){\n return JSON.parse(localStorage.getItem('user'));\n }", "title": "" }, { "docid": "312fe40c30b479c2c941ffcd123a3fa2", "score": "0.7499756", "text": "function isUserSignedIn() {\n\treturn !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "6d8baaf35b7665f48540c4511d8a7421", "score": "0.74938583", "text": "isLoggedIn() {\n return this.apiService.get('auth/is-authorized').pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"tap\"])((user) => {\n this.setUser(user);\n this.isLoged.next(true);\n }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"catchError\"])(err => {\n this.isLoged.next(false);\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_1__[\"throwError\"])(false);\n }));\n }", "title": "" }, { "docid": "5fcc6bff6c77f11b04b9a2a9d18670a1", "score": "0.7473558", "text": "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n console.log(\"isUserSignedIn\" + isUserSignedIn)\n}", "title": "" }, { "docid": "902867f859c5d90f46af7973824fef96", "score": "0.74732894", "text": "loggedInStatus(state) {\n return state.isLoggedIn\n }", "title": "" }, { "docid": "c50a5efd08c4a5c60521f1b852fb0958", "score": "0.74344087", "text": "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n let user = await User.getLoggedInUser(token, username);\n\n // get an instance of StoryList\n storyList = await StoryList.getStories();\n generateStories(user, storyList.stories);\n\n if (user) {\n showNavForLoggedInUser();\n updateUserInfo(user);\n }\n\n return user\n }", "title": "" }, { "docid": "a38baa3edd92e63473d4cf875bed86fe", "score": "0.7428816", "text": "static isLoggedIn()\n {\n return AutoAPI.token.length > 0;\n }", "title": "" }, { "docid": "84fc23adcdd3b562bba17a5309f5ac1a", "score": "0.7417491", "text": "function isLoggedIn(req, res, next) {\n if(req.isAuthenticated()) return next();\n res.json(req.user.dataValues.username);\n }", "title": "" }, { "docid": "3dd058a2026fc09eaf335c9b50097b1f", "score": "0.7410014", "text": "get _loggedIn() {\n return this._cachedAuthToken != \"\";\n }", "title": "" }, { "docid": "eee28909057c03fac7efe3d6bd34d028", "score": "0.7400774", "text": "get isSignedIn() {\n\t\treturn !!this.user;\n\t}", "title": "" }, { "docid": "649858961461ce4e4e7cab0ec79f21fd", "score": "0.73986745", "text": "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "649858961461ce4e4e7cab0ec79f21fd", "score": "0.73986745", "text": "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "649858961461ce4e4e7cab0ec79f21fd", "score": "0.73986745", "text": "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "649858961461ce4e4e7cab0ec79f21fd", "score": "0.73986745", "text": "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "e45ea511c5cbf58e27c56e2107fb0ed6", "score": "0.73940796", "text": "function isAuthenticated() {\n\t\treturn $http.get('./api/user/self').then(\n\t\t\tres => {\n\t\t\t\tvm.user.isLogged = !!res;\n\t\t\t\tvm.user.name = res.data.employee.fullname;\n\t\t\t\tvm.user.roles = res.data.roles;\n\n\t\t\t\tvm.user.isAdmin = vm.user.roles.includes('ADMIN');\n\t\t\t\tvm.user.isManager = vm.user.roles.includes('MANAGER');\n\t\t\t\tvm.user.isUser = vm.user.roles.includes('USER');\n\n\t\t\t\treturn vm.user.isLogged;\n\t\t\t},\n\t\t\terr => {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "159d425bf5ea6d233ada21f69afad042", "score": "0.73867506", "text": "function isAuthenticated(){\n return !!$cookies.get('authenticatedAccount');\n }", "title": "" }, { "docid": "0db481f4415cfc8243ee96b7e0adc68a", "score": "0.7362287", "text": "getLoggedInUser () {\n\t\t\treturn m_config.loggedInUser;\n }", "title": "" }, { "docid": "3bcfde94c42de6f728811e834ecf289d", "score": "0.73604834", "text": "function isLoggedIn() {\n var firebaseUser = firebaseRef.getAuth();\n // console.log(\"IS_LOGGED_IN. firebaseUser:\", firebaseUser);\n var user = null;\n if (firebaseUser) {\n\n user = firebaseUser[firebaseUser.provider];\n // hack for displayName to exist\n if (firebaseUser[firebaseUser.provider].displayName) {\n user.displayName = firebaseUser[firebaseUser.provider].displayName;\n } else {\n user.displayName = firebaseUser[firebaseUser.provider].email;\n }\n user.uid = firebaseUser.uid;\n }\n\n return user;\n}", "title": "" }, { "docid": "96ce8627ab518cf479597efb8ccfcec3", "score": "0.73598444", "text": "function doIsAuth(){\n if (sessionVal == \"in\"){\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "53765086dce52da3e00884ee43f861da", "score": "0.7356939", "text": "function getUserLoggedIn() {\n\t//console.log('getUserLoggedIn');\n\t\n\t// Not used anymore\n\t\t\n\t\n}", "title": "" }, { "docid": "bc1b6eb711c8c35bc2e37f4a0ff8e7ab", "score": "0.7352245", "text": "function isLoggedIn(req, res) {\n\n var id = 0;\n\n console.log(\"SESSION VARIABLE IS: \" + req.session.current_id);\n\n if (req.session.current_id) {\n id = req.session.current_id;\n }\n\n models.getUserFromDb(id, function(error, result) {\n if (error || result == null || result.length != 1) {\n res.status(500).json({success: false, data: error});\n }\n else {\n var username = result[0];\n res.status(200).json(result[0]);\n }\n });\n}", "title": "" }, { "docid": "72ea5cde2792647407b8db00f7b21804", "score": "0.7344162", "text": "function isUserLoggedIn(userIdCookie) {\n if (userIdCookie) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "511da39f598332461343b61c0cad1434", "score": "0.7339312", "text": "async function checkIfLoggedIn() {\n\t// let's see if we're logged in\n\tconst token = localStorage.getItem('token');\n\tconst username = localStorage.getItem('username');\n\tif (!token || !username) return false;\n\n\t// if there is a token in localStorage, call User.getLoggedInUser\n\t// to get an instance of User with the right details\n\t// this is designed to run once, on page load\n\tcurrentUser = await User.getLoggedInUser(token, username);\n}", "title": "" }, { "docid": "92d237642a32456788cf581193adbd3d", "score": "0.73367", "text": "function loggedIn() {\n var users = JSON.parse(localStorage.getItem(\"users\"));\n if (users) {\n var loggedIn = false;\n users.forEach(function (user) {\n if (user.loggedIn) {\n loggedIn = true;\n }\n });\n }\n return loggedIn;\n}", "title": "" }, { "docid": "e62ff569f64ee2219855c538172f078a", "score": "0.73284453", "text": "function useLoginStatus() {\n console.log(\"In useLoginStatus\");\n const currentUser = useCurrentUser();\n if (currentUser) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "1ac68c6b4e28f5fd88158afd4542a895", "score": "0.7327127", "text": "function isLoggedOut() {\n return Object.keys(user)[0] === undefined\n }", "title": "" }, { "docid": "06debf8c3c7e2c1351e4fda7686fb317", "score": "0.73237056", "text": "async function checkIfLoggedIn() {\n\t\tconst token = localStorage.getItem('token');\n\t\tconst username = localStorage.getItem('username');\n\t\tcurrentUser = await User.getLoggedInUser(token, username);\n\t\tawait generateStories();\n\n\t\tif (currentUser) {\n\t\t\tshowProfile();\n\t\t\tshowNavForLoggedInUser();\n\t\t}\n\t}", "title": "" }, { "docid": "73d74255f8264ba88f1462e455ec0292", "score": "0.7313643", "text": "function _isLogged() {\n\t\t\t\treturn Session.hasSession();\n\t\t\t}", "title": "" }, { "docid": "b82de723f7375e784af7691f1b885b6a", "score": "0.7308632", "text": "userEstaLogado () {\n return this.loggedIn\n }", "title": "" }, { "docid": "db11b2020b772970eff08ef5e1a8a142", "score": "0.7300292", "text": "static isUserAuthenticated(){\n return localStorage.getItem('token')!==null;\n }", "title": "" }, { "docid": "9e50210fb889d512f6d7759512d52b46", "score": "0.7282804", "text": "function isLoggedIn() {\n\t\t\t\tvar deferred = $q.defer();\n\n\t\t\t\t$http.get(ACCOUNT_URL+\"/check\")\n\t\t\t\t.success(function(data){\n\t\t\t\t\tif(data.success) {\n\t\t\t\t\t\tloggedIn = true;\n\t\t\t\t\t\tdeferred.resolve(data);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tloggedIn = false;\n\t\t\t\t\t\tdeferred.reject(data);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn deferred.promise;\n\t\t\t}", "title": "" }, { "docid": "7931096fda7bdb841312b26ba6116e2c", "score": "0.7279197", "text": "function isUserAuthed() {\n var auth = $('#auth');\n if(auth.data('authed') === \"True\") {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "d2ca31d1e43157503fce2ac81d5abea1", "score": "0.7248477", "text": "static isUserAuthenticated() {\n \n var userAuthorizationToken = window.localStorage.getItem(AppPropertiesClass.LOCAL_STORAGE_USER_AUTHORIZATION_TOKEN);\n\n if (userAuthorizationToken !== \"\") {\n var tokenObject = JSON.parse(userAuthorizationToken);\n //window.alert(this.tokenObject.expires_in);\n // User is Authorized\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "b74a765c54f71f923788980729071f97", "score": "0.7237841", "text": "async isLoggedIn() {\n let session = hello('facebook').getAuthResponse()\n let currentTime = (new Date()).getTime() / 1000\n return session && session.access_token && session.expires > currentTime\n }", "title": "" }, { "docid": "01aecbeaf4d3d438239ef0f18dcb5b6c", "score": "0.7224649", "text": "function isUserLockedIn() {\n if ($window.sessionStorage[\"userInfo\"]) {\n //TODO after the browser refresh the userInfo is not doing anything.\n userInfo = JSON.parse($window.sessionStorage[\"userInfo\"]);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "360477e3d7ded902c573b111393001e4", "score": "0.72008973", "text": "function checkLoginStatus () {\n const LS_KEY = 'blog_user'\n const fromLs = localStorage.getItem(LS_KEY)\n if (fromLs) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "8d1e5d3a967e317d062518ff88d5de76", "score": "0.7195408", "text": "function isUserSignedIn() {\n // TODO 6: Return true if a user is signed-in.\n return !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "92b5de131f3da246e45a31370c75c7bf", "score": "0.7186827", "text": "isUserLoggedIn() {\r\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"combineLatest\"])([\r\n this.authStorageService.getToken(),\r\n this.userIdService.isEmulated(),\r\n this.authStorageService.getTokenTarget(),\r\n ]).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])(([token, isEmulated, tokenTarget]) => Boolean(token === null || token === void 0 ? void 0 : token.access_token) &&\r\n (tokenTarget === TokenTarget.User ||\r\n (tokenTarget === TokenTarget.CSAgent && isEmulated))));\r\n }", "title": "" }, { "docid": "818909538293ccad5bc38c66642ef99a", "score": "0.71793634", "text": "function isLoggedOn() {\n if (localStorage.getItem('e_mail') == null) {\n return false;\n }\n \n return true;\n }", "title": "" }, { "docid": "961be5053408085ab52c69d1ae820f74", "score": "0.71771795", "text": "function IsUserLoggedIn(value)\n{\n isLoggedIn = value;\n //console.log('Logged in : ' + value );\n}", "title": "" }, { "docid": "b521b78e22a3475af376c95f71c7e66d", "score": "0.71733385", "text": "async function checkIfLoggedIn() {\n // let's see if we're logged in\n const token = localStorage.getItem(\"token\");\n const username = localStorage.getItem(\"username\");\n // if there is a token in localStorage, call User.getLoggedInUser\n // to get an instance of User with the right details\n // this is designed to run once, on page load\n currentUser = await User.getLoggedInUser(token, username);\n await generateStories();\n\n if (currentUser) {\n showNavForLoggedInUser();\n }\n }", "title": "" }, { "docid": "c1d15da8244dd9f4c575b9e85269c010", "score": "0.7160272", "text": "function _hasUser() {\n\n return !!currentUser;\n }", "title": "" }, { "docid": "7cbdf0b3ba0bc3b0a8f0e2dc270282aa", "score": "0.71485555", "text": "function isUserSignedIn() {\n // Return true if a user is signed-in.\n return !!firebase.auth().currentUser;\n}", "title": "" }, { "docid": "bfcfd58f00fa113444573d443e6348b5", "score": "0.7145512", "text": "function isUserLoggedIn(fn){\n getCookieValue(\"c_user\", function (value) {\n if(value){\n fn(true);\n }\n else{\n fn(false);\n }\n });\n}", "title": "" } ]
8d52ae1b20aac1315201f245ea138e01
helper function for delay
[ { "docid": "46b5982b358c6074dd9e1e7dbd0b5660", "score": "0.0", "text": "function Sleep(milliseconds) {\r\n return new Promise(resolve => setTimeout(resolve, milliseconds));\r\n}", "title": "" } ]
[ { "docid": "a41d86a0c3e4afb035cdb430ddbb081e", "score": "0.8098239", "text": "function delay(func, wait) {\n\n}", "title": "" }, { "docid": "f76acaedd434aa10a44dc11ee020a564", "score": "0.77264106", "text": "function delay(func)\n {\n setTimeout(func());\n }", "title": "" }, { "docid": "4e788697bb25cacb82fedb1015a8ab31", "score": "0.7644037", "text": "function runAfterDelay(delay, callback){\n \nsetTimeout(callback, delay*1000);//seconds changed to min-seconds\n}", "title": "" }, { "docid": "b6a04c671ab95bc95392863cd3a3d545", "score": "0.7520825", "text": "function delay(d, i) { return i * 50 }", "title": "" }, { "docid": "bd885f5059013e23eb8e1dd3a2a40903", "score": "0.7481267", "text": "function delay(func, wait) {\r\n\tsetTimeout(func,wait);\r\n}", "title": "" }, { "docid": "4d67fd9669c2e887606b41a04a53754b", "score": "0.7320763", "text": "function ac_delay(funct,delay) {\n \t// delay before start of action\n \tsetTimeout(funct,delay);\n}", "title": "" }, { "docid": "868e4c83eb3a1bde5575bd9e48b130ae", "score": "0.7318666", "text": "function delay(func, wait) {\n setTimeout(function(){\n func()},wait);\n}", "title": "" }, { "docid": "07285134ca3f4be9b44c8e09c3d3992c", "score": "0.7215641", "text": "delay (prm) {\n try {\n return this.confmng(\"delay\",prm);\n\t} catch (e) {\n console.error(e.stack);\n throw e;\n }\n }", "title": "" }, { "docid": "045b690fe7809f54792dca2bb97e3306", "score": "0.7191844", "text": "function delay(ms) {\n\t\tvar args = [].slice.call(arguments);\n\t\treturn function delayThunk(cb) {\n\t\t\tsleep.apply(null, args.concat(cb));\n\t\t};\n\t}", "title": "" }, { "docid": "090978c8b67aaa8b37ae591d522b8f91", "score": "0.7172895", "text": "function delay(ms) {\n     const date = Date.now();\n    let currentDate = null;\n \n     do {\n         currentDate = Date.now();\n     } while (currentDate - date < ms);\n }", "title": "" }, { "docid": "b5ebd233a52590a210fc0361cdcdd0a2", "score": "0.71451545", "text": "function _delay(func, wait) {\n var args = Array.prototype.slice.call(arguments, 2);\n return setTimeout(function () {\n return func.apply(null, args);\n }, wait);\n }", "title": "" }, { "docid": "16bc1d74ca0f4dd0412ef2d62af5635e", "score": "0.7040147", "text": "function delay(arg, callback) {\n setTimeout(() => {\n callback(arg + '1')\n }, 1000);\n}", "title": "" }, { "docid": "c2ebf1c80646655a7c11ed351d656d15", "score": "0.7033962", "text": "function delay(func, wait) {\n setTimeout(() => func(), wait);\n}", "title": "" }, { "docid": "02df542385e32b0c3a6ff97eec2fc081", "score": "0.69853735", "text": "function delay(func, wait, ...args) {\n setTimeout(() => func(...args), wait);\n}", "title": "" }, { "docid": "e031d265b83487aea583ce19bf426a87", "score": "0.69659394", "text": "delay(ctx) {\n\t\t\t\t\t\t\t\tif (ctx.type !== \"data\" || ctx.xStarted) {\n\t\t\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tctx.xStarted = true;\n\t\t\t\t\t\t\t\treturn ctx.index * 1000 * props.t;\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "fac92a3a2a03a9048e8a8322f4f642e6", "score": "0.6958594", "text": "createDelay() {\n timedEvent = this.time.delayedCall(600, this.onEvent, [], this);\n }", "title": "" }, { "docid": "72a38d44d012efa36415c5a1e4752615", "score": "0.6937126", "text": "function delay(func, wait) {\n setTimeout(() => {\n func.call(...arguments);\n }, wait);\n}", "title": "" }, { "docid": "c637c0288a14e9087101eeca86ca68b6", "score": "0.6933709", "text": "function defer(func) {\n // return delay.apply({}, [func, 1].concat( slice.call(arguments, 1) ));\n setTimeout(func, 0);\n }", "title": "" }, { "docid": "db5481192d97b8b236dc1c93465f514a", "score": "0.6923033", "text": "function Sleep(delay) {\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n }", "title": "" }, { "docid": "5dd315f4053a6507d263f4527763ec8d", "score": "0.690626", "text": "function delay(func, wait) {\n return (...args) => setTimeout(func, wait, ...args);\n}", "title": "" }, { "docid": "b2a6dd40d7d82b08d8cc86198b1dc1f6", "score": "0.69038796", "text": "function sleep(delay) {\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n }", "title": "" }, { "docid": "4fee12941c8345f540ac107f1ec00b37", "score": "0.6889322", "text": "function withoutDelay1() {\n console.log(\"withoutDelay1\");\n}", "title": "" }, { "docid": "2db25ab4b7f19d96d568eb523d345162", "score": "0.6884319", "text": "function delayedTimer(msg, time){\n setTimeout(function(){\n console.log(msg);\n }, time)\n}", "title": "" }, { "docid": "db4da1d5e9c9dcd1779ec9fd6f0229ec", "score": "0.6846577", "text": "function delay(fn, ms) {\n let timer = 0;\n return function (...args) {\n clearTimeout(timer);\n timer = setTimeout(fn.bind(this, ...args), ms || 0);\n };\n }", "title": "" }, { "docid": "9f7920fde756cb5f637de34f6b82c48e", "score": "0.6838952", "text": "function delay(i){\n clearTimeout(i)\n }", "title": "" }, { "docid": "52db43f9d5004965f4690f18c32a68ea", "score": "0.68278015", "text": "function first_delay(){\n //Simulate a 5 second delay\n setTimeout(function(){console.log(1)}, 5001)\n}", "title": "" }, { "docid": "e8ff2646640a70ae9ceab83d77c0fe84", "score": "0.6808027", "text": "function delay_handler(string) {\r\n time = Globals.Realtime();\r\n if (time - kill_time == UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"Killsay Delay\") && state == true) {\r\n display(say);\r\n state = false;\r\n say = \"\";\r\n }\r\n}", "title": "" }, { "docid": "ad3d3ee73ffe7ba321b35c15416325ad", "score": "0.68016213", "text": "delay(fun, time) {\n if (this.currentProcess) {\n this.currentProcess.status = process_state.SLEEPING;\n if (Number.isInteger(time)) {\n this.scheduler.scheduleFuture(this.currentProcess.pid, time, fun);\n }\n }\n }", "title": "" }, { "docid": "3f4b70641c700acd6f7843ff1f493676", "score": "0.6794885", "text": "function sleep(delay) {\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n}", "title": "" }, { "docid": "90bcb0a95bdf720449dddad5a1a1d748", "score": "0.6788416", "text": "function setTimeout(fn, delay){\n\t\t\t\t\t// wait for 'delay' milliseconds\n\t\t\t\t\tfn(); // <-- call site!\n\t\t\t\t}", "title": "" }, { "docid": "6cb2b5bc3f1097b000d615884e034ab1", "score": "0.67873186", "text": "function first_delay(){\n setTimeout(first, 5000) //waits 5 seconds and then runs the function first\n}", "title": "" }, { "docid": "4e19642a3af6ab416158a37e4f03bfda", "score": "0.6772092", "text": "function firstDelay(){\n // Simulate a delay of 5 seconds\n setTimeout(first, 5000)\n}", "title": "" }, { "docid": "ae14085a14f3a6ef15eca348be7cd460", "score": "0.67699283", "text": "function runAfterDelay(delay, callback) {\n setTimeout(callback, delay * 1000);\n}", "title": "" }, { "docid": "a37d5f2438bc9fad78dd1583346cf81e", "score": "0.67314863", "text": "function first_delay(){\n // simulate delay\n setTimeout( function(){\n console.log(1);\n }, 5000)\n}", "title": "" }, { "docid": "828606dbb30a82c88d872f95ca5cdabd", "score": "0.6718891", "text": "function delay(ms) {return new Promise(resolve => setTimeout(resolve, ms))}", "title": "" }, { "docid": "32f4ab7d060e5ca073e14cea16685be5", "score": "0.67184645", "text": "function delay(callback, ms){\n /* Creamos una variable timer la cual se unicializa en 0 */\n var timer = 0;\n /*Retornamos una funcion*/\n return function(){\n /* */\n var context = this,\n args = arguments;\n clearTimeout(timer);\n /*Limpiamos la variable timer por si algún x o y motivo tiene un setTimeout */\n timer = setTimeout(function () {\n /*Le aplicamos un setTimeout a la variable timer */\n\n callback.apply(context, args);\n /*Aplicamos un callback de nuestro contexto\n los argumentos y los milisegundos */\n }, ms || 0);\n\n }\n }", "title": "" }, { "docid": "3a23a09ad4edd16dbe6792452eb8e2fe", "score": "0.66935176", "text": "function delay(){\n setTimeout(sayHello, 4000);\n}", "title": "" }, { "docid": "50e40731f5aaa5ce0af944d0de68216e", "score": "0.66916144", "text": "function afterDelay(delay, fn) {\n return setTimeout(fn, delay);\n }", "title": "" }, { "docid": "a7f7c1370fe6a9bedacad910af5c119c", "score": "0.6690442", "text": "function runAfterDelay (delay, callback) {\n setTimeout (()=>{callback()}, delay*1000)\n}", "title": "" }, { "docid": "a1a82e1de868335377f255c040da2ea7", "score": "0.6673398", "text": "function sleep(delay) {\n const start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n}", "title": "" }, { "docid": "2b558c0d66d6768a26d3d9b2f5691c99", "score": "0.66333467", "text": "function delay(campo){\n setTimeout(function() {\n comprobarVacio(campo);\n }, 400);\n}", "title": "" }, { "docid": "3a591ca9bc145f117ac579455cd7bda1", "score": "0.6626715", "text": "function sleep(millis, callback) \r\n{\r\n setTimeout(function()\r\n { callback(); }\r\n , millis);\r\n}", "title": "" }, { "docid": "ce4d66abed0dd41e58598da4641c8618", "score": "0.6620525", "text": "function delay1s(){\n delayed = false;\n setTimeout(function(){ \n delayed = true;\n }, 1000);\n}", "title": "" }, { "docid": "aab6e9171e09f01fc7aae1ef4b04b49e", "score": "0.6616661", "text": "static delay(duration)\n\t{\n\t\treturn new Action(\n\t\t\tfunction(target, deltaTime, totalTime)\n\t\t\t{\n\t\t\t\treturn totalTime >= duration;\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "0f5f05da6d71c8a718b1ff2026cd8bfa", "score": "0.6614367", "text": "function updateDelay() {\n var delay = 50 * Math.pow(2, parseInt(document.getElementById(\"delay\").value));\n document.getElementById(\"delayOutput\").innerText = delay + \"ms\";\n updateDatasource();\n updateView();\n }", "title": "" }, { "docid": "288d3b3a5fdb5bf2af9ac2a090617ffa", "score": "0.6574986", "text": "sleep(time, cb) {\n if (cb) setTimeout(cb, time);\n }", "title": "" }, { "docid": "dd07a00019da2b652c43cfeb95139526", "score": "0.65737617", "text": "delayAttack(skeleton, delay) {\n setTimeout(() => {\n this.enemyAttackEffect(skeleton);\n }, delay);\n }", "title": "" }, { "docid": "98bb95d439d3ae68d65e582f5b848120", "score": "0.65658975", "text": "function timeoutfunc() {}", "title": "" }, { "docid": "7b34ee178423ca987224d64f6cbe1253", "score": "0.6540017", "text": "function setCallBackTimeOut(delay) {\n $timeout(function() {\n terminalText1 = document.querySelector('.terminalText1');\n animationText.style.position = 'absolute';\n animationText.style.top = '50%';\n animationText.style.left = '50%';\n terminalText1.className += ' centerTextAfterAnim';\n blinkPipe.parentNode.removeChild(blinkPipe);\n $rootScope.$broadcast('terminalTextFinish');\n }, delay);\n }", "title": "" }, { "docid": "f8ced9c01c5f6db91c3ff8b59b8da239", "score": "0.6523255", "text": "function delay(delta) {\n return ((_delta) => {\n return (\n function (next) {\n return (\n (_next) => {\n return {\n run: () => {\n setTimeout(_next.run, _delta)\n }\n }\n }\n )(next)\n }\n )\n })(delta)\n}", "title": "" }, { "docid": "70f6106841e120c13437eeb2735eb7d7", "score": "0.6520894", "text": "function delayedGreet() {\n // ADD CODE HERE\n}", "title": "" }, { "docid": "2e2eda0a3aadb8499a251eb3831f4dc0", "score": "0.65065724", "text": "delay(ms) {\r\n return new TestFlow(this.previous.then(() => {\r\n return new Promise((resolve, reject) => { setTimeout(() => resolve(), ms); });\r\n }), this.adapter);\r\n }", "title": "" }, { "docid": "cb84f8a349fb4dbf169a40347ec018cf", "score": "0.650005", "text": "function delay(callback, ms) {\n var timer = 0;\n return function () {\n var context = this, args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n callback.apply(context, args);\n }, ms || 0);\n };\n }", "title": "" }, { "docid": "bb523bf6b82cbbf55fa3f6f407643de2", "score": "0.64897966", "text": "function showDelay(result) {\n setTimeout(() => {\n console.log(result);\n }, 1000);\n}", "title": "" }, { "docid": "9e21f1a0e0346978f150be97e7f8a2b4", "score": "0.6489232", "text": "delay() {\n return new Date().getTime() - config.delayAmount >= 1000;\n }", "title": "" }, { "docid": "ddd94505139c6179ce99e217bb863b0b", "score": "0.64875746", "text": "get needsTimeoutForDelay() {\n return true;\n }", "title": "" }, { "docid": "48de57e167e18c0faa8acd68c77bb614", "score": "0.6470373", "text": "setTimeout() {}", "title": "" }, { "docid": "18ff1e640f7e08d13082c09c2bdac294", "score": "0.646095", "text": "function getDelay (player, types) {\n\tvar timer = 1;\n\tprint(timer+\"\\n\");\n\tif (timer < 1 + types.delayTime) {\n\t\ttimer = 1 + Math.floor((Math.random() * types.delayTime));\n\t\tprint(timer+\"\\n\");\n\t}\n\treturn timer;\n}", "title": "" }, { "docid": "18be3af52063d16391c0cef61f41125b", "score": "0.6449398", "text": "function delay(ms, value) {\n\t// Part 1 TODO: add your implementation here\n\tvar promise1=new Promise((res,rej) => {\n\t\tsetTimeout(res, ms, value);\n\t});\n\treturn promise1;\n}", "title": "" }, { "docid": "b03e0dbf39623c020b0dfa40812c71ac", "score": "0.64411724", "text": "function delay(callback, ms) {\n var timer = 0;\n return function() {\n var context = this, args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n callback.apply(context, args);\n }, ms || 0);\n };\n}", "title": "" }, { "docid": "b73b034570538e3a75d334b861aed082", "score": "0.6438008", "text": "function setTimeout() {\r\n \"use strict\";\r\n\r\n var args = [];\r\n Array.prototype.push.apply(args, arguments); // (...args) not working in jd2\r\n\r\n if (args.length === 0) {\r\n return;\r\n }\r\n\r\n var func = args.shift();\r\n var time = args.shift() || 0;\r\n\r\n callAsync(function() {\r\n sleep(time);\r\n func.apply(null, args);\r\n }, JD_HOME + \"/eventscripter/system/bin/dummy.bat\");\r\n}", "title": "" }, { "docid": "0b36102eeb2ab2e76fe2d74e7c912ff2", "score": "0.64351946", "text": "function delay() {\n let delay = Math.floor(Math.random() * (5000 - 2000)) + 2000\n console.log('delay', delay)\n return new Promise(resolve => setTimeout(resolve, delay))\n }", "title": "" }, { "docid": "7593f14d146d2393515d091b0b338190", "score": "0.64342874", "text": "function delay(delay, fn, ...param) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(fn(...param)), delay\n });\n });\n}", "title": "" }, { "docid": "8f5e765fd750da5ae123e21ea430d85b", "score": "0.64229256", "text": "function liftDelay(time) {\n\t// time is in milliseconds\n\tconsole.log('Timer delay initiated. Lift will be delayed by ' + time + ' milliseconds');\n\n\tsetTimeout(function() {\n\t\tconsole.log('Lift starting!');\n\t\tstartLift(); // start the lift\n\t}, time);\n}", "title": "" }, { "docid": "36cd74be9d6d38bef93648e34995f8e6", "score": "0.6405517", "text": "function Delay(ms){\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}", "title": "" }, { "docid": "276a5cabe158704d6af3be3865dfe4a0", "score": "0.6400255", "text": "function delay(callback, ms) {\n var timer = 0;\n return function () {\n var context = this,\n args = arguments;\n clearTimeout(timer);\n timer = setTimeout(function () {\n callback.apply(context, args);\n }, ms || 0);\n };\n}", "title": "" }, { "docid": "7ba50deb53ba5e0f0ca0bf06378335ff", "score": "0.6396448", "text": "function sleep(ms) {\n sleepus(ms * 1000);\n}", "title": "" }, { "docid": "76fd8338a3c88b4e0f0b51f2b7e3308a", "score": "0.63827723", "text": "function delay() {\n let delay = Math.floor(Math.random() * (5000 - 2000)) + 2000\n console.log('delay', delay)\n return new Promise(resolve => setTimeout(resolve, delay))\n }", "title": "" }, { "docid": "d560843381dc39984ec5137c3bfc1808", "score": "0.63805276", "text": "delay(arr) {\n clearTimeout(this.TO);\n var nextArr = asArray(this.next).map((item, ind)=>item + (arr[ind] || 0));\n this.schedule(this.cb, dateFromArray(nextArr), this.recur);\n }", "title": "" }, { "docid": "0f00bcb6496e1b503f8b459fd08707a2", "score": "0.63775426", "text": "function startup_delay(next) {\n window.setTimeout(function () {\n next();\n }, 10000);\n}", "title": "" }, { "docid": "c10c59ac7d65a8a84a7ebd0bd882ca07", "score": "0.63729095", "text": "function delay(ms) {\n\t return function (target, property, descriptor) {\n\t var orig = descriptor.value;\n\t descriptor.value = function () {\n\t var _this = this;\n\t var args = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i - 0] = arguments[_i];\n\t }\n\t setTimeout(function () {\n\t //call function with original arguments after timeout ms\n\t orig.apply(_this, args);\n\t }, ms);\n\t };\n\t return descriptor;\n\t };\n\t}", "title": "" }, { "docid": "c1e5dad6cf0d954bf7f246e7ff2bc136", "score": "0.63707995", "text": "function onTimeout(fn, delay){\n if(delay){\n setTimeout(fn, delay);\n } else {\n fn();\n }\n }", "title": "" }, { "docid": "302331d52ffac76989869e391778619b", "score": "0.63703126", "text": "check_delayed_ply() {\n let ply = this.delayed_ply;\n if (ply > -2)\n this.set_ply(ply);\n }", "title": "" }, { "docid": "f8d3410a8f5c23ff12a65e542b8e4b48", "score": "0.63634276", "text": "function runAfterDelay(delay,callback2) {\n setTimeout(()=> {\n callback2();\n }, delay*1000);\n}", "title": "" }, { "docid": "2820c4be985461bbaf0b53dc727402e6", "score": "0.63633305", "text": "sleep(milliseconds) {\n const date = Date.now();\n let currentDate = null;\n do {\n currentDate = Date.now();\n console.log('.');\n } while (currentDate - date < milliseconds);\n }", "title": "" }, { "docid": "f678b66c7f55ce0660f853289be76bab", "score": "0.6361459", "text": "get needsTimeoutForDelay() {\n return false;\n }", "title": "" }, { "docid": "64df6279e54ff4230feebc4ee1f6fe17", "score": "0.6358048", "text": "delay(time) {\n return new Promise((resolve) => {\n setTimeout(resolve, time);\n });\n }", "title": "" }, { "docid": "af1e60b9b38a418af5b8a09cd2cb2cb9", "score": "0.63473594", "text": "throttle(callback, delay) {\n var previousCall = new Date().getTime();\n return function() {\n var time = new Date().getTime();\n\n if ((time - previousCall) >= delay) {\n previousCall = time;\n callback.apply(null, arguments);\n }\n };\n }", "title": "" }, { "docid": "848f063fe0d35a36fc1599beb86f7356", "score": "0.63395655", "text": "function W(){return j.setTimeout(function(){_e=void 0}),_e=Date.now()}", "title": "" }, { "docid": "37960ddec38ff85c0c34e4fd792552ec", "score": "0.6338507", "text": "function delay(f) {\n return () => {\n f.x = f.x;\n if (typeof f.x === 'undefined') {\n f.x = f();\n }\n return f.x;\n }\n}", "title": "" }, { "docid": "248cdc195c16004bfe2f12c56d7d04e0", "score": "0.63284934", "text": "function delayLog(delay1, stringToLog){\n setTimeout(()=> {\n console.log(stringToLog);\n }, delay1*1000);\n}", "title": "" }, { "docid": "1cf8b43a868801e95fa3283fb479080e", "score": "0.63209265", "text": "function sleep(time, callback){\n\t setTimeout(callback, time);\n }", "title": "" }, { "docid": "c31675196c80d95888cb52897e73dcc5", "score": "0.6318005", "text": "function delayedShow() {\n console.log('After 5 sec');\n}", "title": "" }, { "docid": "6a9aa774a625c4c2906b14b0f8faa676", "score": "0.62991655", "text": "function sleep(msec) {\n\tvar then = new Date().getTime()+msec;\n\twhile (then >= new Date().getTime()){\n\t}\n}", "title": "" }, { "docid": "6a9aa774a625c4c2906b14b0f8faa676", "score": "0.62991655", "text": "function sleep(msec) {\n\tvar then = new Date().getTime()+msec;\n\twhile (then >= new Date().getTime()){\n\t}\n}", "title": "" }, { "docid": "6cf39f04f324ce5066007c9cf268f9d1", "score": "0.6296564", "text": "function getRunner(delay,outputElement) {\n var time=3000;\n return function(msg,test) {\n setTimeout(function() {\n outputElement.innerHTML=msg;\n test();\n },time);\n time += delay;\n };\n }", "title": "" }, { "docid": "f23c8c9fedc093d6a92b32b43aa90da5", "score": "0.6289144", "text": "function sleep(millis) {\n\t// var date = new Date();\n\t// var curDate = null;\n\t// do {\n\t// curDate = new Date();\n\t// } while (curDate - date < millis);\n\n\tconsole.log(\"HELLO\");\n\tsetTimeout(function() {\n\t\tconsole.log(\"THIS IS\");\n\t}, millis);\n\tconsole.log(\"DOG\");\n}", "title": "" }, { "docid": "bdf69f7a64e21adacd5bc9ac73c0ab2a", "score": "0.6285815", "text": "function delay(ms) {\n return function(x) {\n return new Promise(resolve => setTimeout(() => resolve(x), ms));\n };\n }", "title": "" }, { "docid": "d0889a17ba1a10774fd7aa8f5cac660e", "score": "0.628362", "text": "function waitForFewSeconds(seconds){\n\t\n\tif(seconds!==null){\n\t\ttarget.delay(seconds);\n\t}\n\telse{\n\t\tUIALogger.logMessage(\"---Shouldnot be null---\"+seconds);\n\t\tthrow error;\n\t}\t\n}", "title": "" }, { "docid": "e1249902574bd20d955e0cec69f72001", "score": "0.626861", "text": "function delay(interval) \n {\n return it(' Starting delay , where 10sec = 1 min', done => \n {\n setTimeout(() => done(), interval)\n \n }).timeout(interval + 100 ) // The extra 100ms should guarantee the test will not fail due to exceeded timeout\n }", "title": "" }, { "docid": "9898e507a579a227927a22e84f2a369c", "score": "0.62667406", "text": "function defer1(ms){\n func = this;\n return function(x,y){\n setTimeout(func,ms,x,y);\n }\n }", "title": "" }, { "docid": "833b4b97c1ee2339c378bd6ce2b44bb8", "score": "0.6260612", "text": "function delay(seconds) {\n return new $.Deferred(defered => setTimeout(() => defered.resolve(), seconds * 1000))\n}", "title": "" }, { "docid": "cd41b1934d3c6eadc59f7ce89f0b3b28", "score": "0.6259299", "text": "function delay(element, opacity) {\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(element).animate({\n\t\t\t\t\topacity: opacity, \n\t\t\t\t}, 150);\n\t\t\t}, $(element).index() * offset)\n\t\t}", "title": "" }, { "docid": "954fa213a53a83462415bb3a24e8e042", "score": "0.6256588", "text": "function delay (ms){\nreturn new Promise((resolve)=>{\n setTimeout(()=>{\n resolve();\n },ms);\n});\n}", "title": "" }, { "docid": "929e1c5586a9873f93a75f16d959df32", "score": "0.6244404", "text": "function delayEvent( type, instance, container ) { // 14693\n\t\t\treturn function( event ) { // 14694\n\t\t\t\tcontainer._trigger( type, event, instance._uiHash( instance ) ); // 14695\n\t\t\t}; // 14696\n\t\t} // 14697", "title": "" }, { "docid": "f50cb08e199fa84d6b566c01df099662", "score": "0.6242117", "text": "function sleep(millis, callback) {\n setTimeout(function()\n { callback(); }, millis);\n }", "title": "" }, { "docid": "b6b11e1c8acd1c2fe86c85f334394ee1", "score": "0.6237404", "text": "function pauseScript(ms) {var ms1 = getRndtime(ms); var aDate = new Date(); var crtDate = new Date(); do {crtDate = new Date();} while (crtDate - aDate < ms1);}", "title": "" }, { "docid": "9212f50df2d8e0d193a73de1c1caa1ce", "score": "0.6235292", "text": "function soon(fn /*, args...*/) {\n fn = _.partial.apply(_, arguments);\n return _.delay(fn, _.random(0, 200));\n}", "title": "" }, { "docid": "2e9c2061e55d474cfc57b332542f8f16", "score": "0.6232339", "text": "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "title": "" }, { "docid": "2e9c2061e55d474cfc57b332542f8f16", "score": "0.6232339", "text": "function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}", "title": "" }, { "docid": "bd0cd032b3d723bded114deb05ca13c9", "score": "0.6231617", "text": "fbMessageDelay(delay, id, options) {\n return this.startsTyping(id).then(() => {\n return promiseDelay(delay).then(() => {\n return this.fbMessage(id, options)\n });\n });\n }", "title": "" } ]
43450f12bde8269a6713e7439517f0c9
Sets a blank array and pushes user input into it
[ { "docid": "3ef82b47490e2fbffad0d1b798dc4bae", "score": "0.0", "text": "function printQuestionMarks(num) {\n var arr = [];\n \n for (var i = 0; i < num; i++) {\n arr.push(\"?\");\n }\n \n return arr.toString();\n}", "title": "" } ]
[ { "docid": "1ad600980f3da3f49ea07ac83de83ee5", "score": "0.6457616", "text": "function populate(){\n rl.question(\"Enter a string to add to the array ('#' to exit): \", (ans) => {\n\n\t // Recursive case, adds elements to array\n\t if (ans !== '#'){\n\t\tsortedArr.push(ans);\n\t\tpopulate();\n\t }\n\n\t // Base case, user chooses to stop adding elements \n\t else{\n\t\trl.close();\n\t\treturn ans;\n\t }\n\t});\n}", "title": "" }, { "docid": "d3c70aada03b81f43e41a7ba52fd6425", "score": "0.643226", "text": "function addArr() {\n let arrLength = +prompt(\"Enter array length\");\n let res = [];\n\n for (let i = 0; i < arrLength; i++) {\n res.push(+prompt('Enter Array\"a'));\n }\n return res;\n}", "title": "" }, { "docid": "dccb0b46a82cc33f44d24a592c853573", "score": "0.6314025", "text": "function readArray() {\n var number = prompt(\"Enter no. of elements to insert:\")\n for (var i = 0; i < number; i++) {\n unSortedArray.push(prompt(\"Enter the number:\"));\n }\n}", "title": "" }, { "docid": "139fb3b16e23d2b7046c45257cd63b51", "score": "0.63061243", "text": "function addData() {\r\n //THe last element of the array is the value we input to say if the thing was a seven or not\r\n a[9] = document.getElementById(\"is7\").value;\r\n\r\n if ((a[9] != 1 && a[9] != 0)) {\r\n a[9] = 0;\r\n alert(\"Enter a 1 or 0 in the text box\");\r\n return;\r\n }\r\n //Remove leading 0s\r\n a[9] = parseInt(a[9], 10);\r\n\r\n \r\n arr.push(a.splice(0));\r\n\r\n a = new Array(10);\r\n a.fill(0);\r\n\r\n return;\r\n}", "title": "" }, { "docid": "1e7c38fdd8cf3022931b42058cbaa6d8", "score": "0.62769467", "text": "function arrayinput(){\r\n\r\n pharr.push(ph);\r\n charr.push(ch);\r\n maarr.push(ma);\r\n avgarr.push(avg);\r\n totarr.push(tot);\r\n nmarr.push(nm);\r\n gradearr.push(grade);\r\n ns = pharr.length;\r\n }", "title": "" }, { "docid": "1cde47d744c0332833e86d6c02b0dd0e", "score": "0.610684", "text": "function inputClearFunc() {\n\tdefinedArray = [];\n\tdefinedArrayLength = definedArray.length;\n\tdocument.getElementById(\"output\").value = \"\";\n\tconsole.log(\"cleared definedArray and length \", definedArray, definedArrayLength);\n\n}", "title": "" }, { "docid": "68212d90f49f4ebf2c59259e73b1d044", "score": "0.60770315", "text": "array(row, column) {\n var arr = [];\n for (var i = 0; i < row; i++) {\n arr[i] = [];\n\n for (var j = 0; j < column; j++) {\n\n var element = read.question(\"Enter the value :\")\n arr[i][j]= element+\"\";\n\n }\n\n }\n console.log(arr);\n }", "title": "" }, { "docid": "d1d3767d9f1b65e047e6ca9595820a42", "score": "0.6038144", "text": "function addItems(arr){\nvar blankArr=[];\nblankArr.push(arr);\nconsole.log(blankArr);\n}", "title": "" }, { "docid": "6ce0c7b29b5885a98d12e3723eb5effd", "score": "0.60308564", "text": "function puntenToevoegen() {\n // ophalen input en omzetten in variable\n\tvar getalElement = document.getElementById('puntenAantal');\n var puntenAantal = getalElement.value; \n\n // als de value van input iets bevat pushen naar array(anders niet)\n if(puntenAantal == ''){\n \n } else{\n punten.push(puntenAantal);\n }\n\t\t\n}", "title": "" }, { "docid": "4bed3d49f79a06c178f8a84ccf363728", "score": "0.6023959", "text": "inputArray(input) {\n\n if (this.gameActive) {\n this.input.push(input)\n \n const typedInput = this.input.join(\"\");\n const keyInput = document.getElementById('keyInput');\n \n keyInput.textContent = typedInput;\n this.matchPhrase()\n // console.log(this.input)\n }\n }", "title": "" }, { "docid": "e4151183ebead052ca532fb065f14717", "score": "0.5943634", "text": "function problem1(){\n var input = [];\n\n while(enter !== 'q') {\n var enter = prompt('Type anything. Press q to quit.');\n\n if(enter !== 'q') {\n input.push(enter);\n }\n\n\n }\n for(x = 0; x < input.length; x++) {\n console.log(input[x]);\n }\n}", "title": "" }, { "docid": "13cd2a4638b43aaec01429bbc93e1976", "score": "0.5930566", "text": "function populateArray(name, age, grade) {\r\n\tstudentsArray.push({ \r\n\t\t\"name\": name, \r\n\t\t\"age\": age, \r\n\t\t\"grade\": grade });\r\n\t\t\r\n\tdocument.getElementById(\"txtName\").focus();\r\n\r\n}", "title": "" }, { "docid": "83ebd53554931b83118046a524a7d34f", "score": "0.5923876", "text": "function setNewItemX() {\n var myContent = prompt('Give me some text!?');\n var newX = insertX.push(myContent);\n}", "title": "" }, { "docid": "457861491a8b0025a37219beea4a92fe", "score": "0.5871283", "text": "function inputAddFunc() {\n\n\tlet inputVal = document.getElementById(\"arrayIptValue\").value;\n\n\t// console.log((document.getElementById(\"arrayIptValue\").value));\n\tconsole.log(\"inputVal = \", inputVal);\n\n\tif(isNaN(inputVal)) {\n\t\tconsole.log(\"inputVal is NaN\", inputVal);\n\t\tdocument.getElementById(\"output\").value = \"Input is NaN = \" + inputVal;\n\n// CAN'T print string value?\n\n\t} else {\n\t\tconsole.log(\"Add to the array\");\n\n\t\tdefinedArray[definedArray.length] = Number(inputVal);\t// add input value to array\n\t\tdefinedArrayLength = definedArray.length;\t//update the array length\n\n\t\tdocument.getElementById(\"output\").value = \"New array input = \" + inputVal;\n\t\tconsole.log(\"New array = \", definedArray);\n\t}\n}", "title": "" }, { "docid": "6b2f7e66f49773bc5225d7ca5a265192", "score": "0.58657163", "text": "function emptyArrays() {\r\n\tnameArray = [];\r\n\tphoneArray = [];\r\n}", "title": "" }, { "docid": "ada5ebe5826aafec3e2c9b07cb03d72e", "score": "0.5849713", "text": "function input_array() {\n a.show();\n if (viz.auto_next) viz.pause();\n $('#array').show();\n //$('#autofillArray').show();\n}", "title": "" }, { "docid": "0094c0258ea4088d9308b348d5beec2b", "score": "0.58375585", "text": "function addToArray() {\n if (lowercase === true) {\n pwArray.push(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\")\n }\n\n if (uppercase === true) {\n pwArray.push(\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\")\n }\n\n if (numeric === true) {\n pwArray.push(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\");\n }\n\n if (special === true) {\n pwArray.push(\"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"+\", \"=\", \"{\", \"}\", \"[\", \"]\", \";\", \":\", \"'\", \"?\", \"/\", \"-\", \"_\", \"<\", \">\", \",\", \"|\", \"~\");\n }\n\n // a break clause in the function if no characters are selected\n if (lowercase === false && uppercase === false && numeric === false && special === false) {\n alert(\"You did not select any characters. Please try again.\");\n breakPoint = false;\n }\n console.log(pwArray);\n}", "title": "" }, { "docid": "a8c8fb42ac4ab7d93ec4c9a30a23ef3e", "score": "0.58311474", "text": "function nada(){\n\nvar local =[];\n \t \n \tvar userCount = [];\n \tvar newArray = [];\n\n\t$('input').keypress(function (e) {\n var key = e.which;\n if(key == 13) \n {\n\n\n var inputentry = $(this).val();\n\n\tlocal.push(inputentry);\n\t var users = local.length;\n\t console.log(local);\n\t\n\t\n\t\n\n\n\ngetID(users,userCount);\nassignID(local,userCount, newArray);\npostInfo(newArray);\n\t\n\n\n\n }\n}); \n\n}", "title": "" }, { "docid": "350dc041794e6d449abf26dbd7a9fe4f", "score": "0.58172596", "text": "function addDatatoArray(){\n\n var name = $(\"#add_data_name\").val();\n var code = $(\"#add_data_drugCode\").val();\n var dosage = $(\"#add_data_dosage\").val();\n\n if (name === \"\" || code === \"\" || dosage === \"\" ){\n alert(\"Inputs cannot be empty\");\n }else{\n nameArray.push(name);\n codeArray.push(code);\n dosageArray.push(dosage);\n $(\"#add_data_name\").val(\"\");\n $(\"#add_data_drugCode\").val(\"\");\n $(\"#add_data_dosage\").val(\"\");\n }\n\n\n}", "title": "" }, { "docid": "198f1ba16a51b969166cd2e81693a9df", "score": "0.5815303", "text": "function pushAll(array, input) {\n var length = input.length;\n for (var i = 0; i < length; ++i) {\n array.push(input[i]);\n }\n}", "title": "" }, { "docid": "4e4a76096e39c71648d47f3a9784494a", "score": "0.5814649", "text": "function InitApp(e){\n\n if(e.key != \"Enter\")return\n if(e.target.value == \"\")return\n if(e.target.value <= 0)return\n if(isNaN(e.target.value))return\n \n FillArrayAleatorio(e.target.value)\n e.target.value = \"\"\n}", "title": "" }, { "docid": "dccec802be088991fa41216f8ddb1ce5", "score": "0.58005714", "text": "function emptyPoemArray() {\n poemArray = [];\n}", "title": "" }, { "docid": "69c112911c6d5cc849d15474ffe8af84", "score": "0.5784108", "text": "function emptyArray(array1) {\n userMoves = [];\n $(\"#scoreBox\").text(gameScore)\n }", "title": "" }, { "docid": "c4d1d1391a8198e15840b58cb86e22fb", "score": "0.5753263", "text": "function pushItem(){\n\tvar x = {};\n\tx.groceries = document.getElementById(\"textfield\").value;\n\tarray.push(x);\n\tdocument.getElementById(\"textfield\").value = \"\";\n}", "title": "" }, { "docid": "29de3acf2cd917e8d0235ae833daacc3", "score": "0.57410073", "text": "function AddValueArrayMax(){\r\n\tarrarMax.push($('#txtNumeroMax').val());\r\n\t$('#txtNumeroMax').val('');\r\n}", "title": "" }, { "docid": "13cd985c93979530de6abd252980237a", "score": "0.57055116", "text": "function addToDomAndArray() {\n const addToDoInputBox = document.querySelector(\".todo-input\");\n const toDoText = addToDoInputBox.value;\n addToDoIntoArray(toDoText);\n printTodo(toDoText);\n addToDoInputBox.value = \"\";\n}", "title": "" }, { "docid": "5f25830bcfd5a2c9f78b3ce506ef2d44", "score": "0.57001954", "text": "function addToArray(){\n //set local varibles\n var valueArray = [];\n var outputString = \"\";\n //Grab user inputs and add to an array\n valueArray[0] = parseInt(document.getElementById(\"value1\").value);\n valueArray[1] = parseInt(document.getElementById(\"value2\").value);\n valueArray[2] = parseInt(document.getElementById(\"value3\").value);\n \n //itterate through the array and print the values to the screen\n for (var i = 0; i < valueArray.length; i++){\n outputString += \"The value in array position \" + i + \" is \" + valueArray[i] + \"<br>\";\n }\n document.getElementById(\"output\").innerHTML = outputString;\n}", "title": "" }, { "docid": "6bf76b7d63bce06daaa8ddf8025811b5", "score": "0.5678666", "text": "function arrayPusher (input) {\n if(input.textBody.search(search1) !== -1) {\n postWall.stopArray.push(input);\n } else if (input.textBody.search(search2) !== -1) {\n postWall.goArray.push(input);\n } else if (input.textBody.search(search3) !== -1) {\n postWall.contArray.push(input);\n };\n}", "title": "" }, { "docid": "10fc8d9b9cd5dd825bb7ef5f95318d77", "score": "0.56299824", "text": "static ensureArray (input) {\n return [].concat.apply([], Array.of(input));\n }", "title": "" }, { "docid": "d4a10564f6f51d67bf1ca3c8888ddb7b", "score": "0.5619616", "text": "function updateColorArray() {\n\n let chosenColor = document.getElementById('color').value; //assigning a variable to the value of the id tag we'd like to get the info from! \n \n favColors.push(chosenColor); // then push this variable to the array\n\n if (chosenColor.length != 0) { //next, create if statement! if users input does not equal a blank or ZERO characters typed in then?\n\n localStorage.setItem('colorArray', JSON.stringify(favColors)); // set the localstorage ('name of varaible', then stringify the variable OG array)\n displayListOfColors(); //call on the function that will display the list!\n } else { \n alert(\"ENTER A COLOR FOO!\"); //else? what would you like to happen when they dont type anything in the input text? \n }\n}", "title": "" }, { "docid": "0df6d7371b0026cd41ea475b5daf3825", "score": "0.5601522", "text": "function clearArray()\n {\n legalMoves.Clear();\n legalMoves.push(64);\n }", "title": "" }, { "docid": "7fc71c6f16c6a6fac2f95ab66e080333", "score": "0.55958724", "text": "function entry_to_array() {\r\n let entry_toArray = [];\r\n for (let i = 0; ; i++ ) {\r\n let entry = prompt(`array element ${i+1}`);\r\n if (entry !== null) { \r\n if (isNaN(entry) || entry === ' ') {\r\n entry_toArray.push (entry);\r\n \r\n } else {\r\n entry_toArray.push ((+entry));\r\n \r\n }\r\n } else {break;}\r\n }\r\n return entry_toArray;\r\n }", "title": "" }, { "docid": "735f81643e8776b211f66b747d1f4aa1", "score": "0.5587654", "text": "function entry_to_array() {\r\n let entry_toArray = [];\r\n for (let i = 0; ; i++ ) {\r\n let entry = prompt(`array element ${i+1}`);\r\n if (entry !== null) { \r\n if (isNaN(entry)) {\r\n entry_toArray.push (entry);\r\n \r\n } else {\r\n entry_toArray.push ((+entry));\r\n \r\n }\r\n } else {break;}\r\n }\r\n //console.log (`there were ${countNums} numbers and ${countString} strings in the array you entered `)\r\n return entry_toArray;\r\n }", "title": "" }, { "docid": "24d973c6b78bbc419f2209e51eca9b34", "score": "0.5582137", "text": "function createNewType(){\n let t = document.getElementById('types').value;\n console.log(t);\n if(t === 'options'){\n let p = prompt(\"enter new type\",\"\");\n if (p != null){\n type.push(p);\n }\n render();\n\n }\n}", "title": "" }, { "docid": "4f61f90d0597db3a915880010f7bcb54", "score": "0.5575238", "text": "function setCustomer() {\n window.customer.push(document.getElementById('fname').value);\n window.customer.push(document.getElementById('lname').value);\n window.customer.push(document.getElementById('phone').value);\n window.customer.push(document.getElementById('email').value);\n window.customer.push(document.getElementById('address1').value);\n window.customer.push(document.getElementById('address2').value);\n window.customer.push(getProvince());\n window.customer.push(document.getElementById('city').value);\n window.customer.push(document.getElementById('postal').value);\n}", "title": "" }, { "docid": "013b6872ed4083c4da290d2e08bb7d3d", "score": "0.5564121", "text": "function datapusher(input_arr, location){\n for(i = 0; i < input_arr[location].length; i++){\n experiment.push(input_arr[location][i]);\n }\n}", "title": "" }, { "docid": "4d1e7d97f225ad249abd49a7b962314d", "score": "0.5555053", "text": "function userInput(event) {\n event.preventDefault();\n for (var i = 0; i < 9; i++) {\n var task = tasksLocation[i];\n var taskContent = task.val();\n storedTaskInput.splice(8, 8, taskContent);\n }\n // call function to save to local storage\n storeInputs();\n }", "title": "" }, { "docid": "597b8eb9ddb0ae8900a6a83f04785070", "score": "0.5552093", "text": "function addPatient(){\n let answer = \"yes\";\n while (answer.toLowerCase() === \"yes\") {\n pushPatient(\n prompt(\"Enter first name\"),\n prompt(\"Enter last name\"),\n parseInt(prompt(\"Enter age in years\")),\n parseInt(prompt(\"Enter height in inches\")),\n parseInt(prompt(\"Enter weight in pounds\")),\n [prompt(\"Allergies?\")],\n [\"None\"], //default array for medical history\n );\n\n\n\n let another = prompt(\"Add another patient? (yes or no)\");\n if (another.toLowerCase() === \"no\")\n {\n answer = \"no\";\n };\n\n };\n}", "title": "" }, { "docid": "84c3e4ee91548107977274e1af005dbf", "score": "0.5544459", "text": "function makeArray(input) {\n if (!array_isArray(input)) {\n if (isNullOrUndefined(input)) {\n input = [];\n }\n else {\n input = [input];\n }\n }\n return input;\n }", "title": "" }, { "docid": "8c341134153606ce2adac0fcfb3bcc25", "score": "0.55409765", "text": "function pushArrayEmail() {\n inputEmail.innerText.replace(/\\r?\\n?\\s/g, \"\").split(\",\").map(item => {\n if (!emailArray.includes(item) && item && item !== placeholder.replace(/\\r?\\n?\\s/g, \"\")) {\n emailArray = [...emailArray, item];\n inputEmail.innerHTML = \"\";\n generateEmailList()\n } else {\n inputEmail.innerHTML = \"\";\n }\n });\n mailCounter ? mailCount() : false;\n }", "title": "" }, { "docid": "e458fce950d8c3edb60be7558b0c3acb", "score": "0.5531069", "text": "function inputShowFunc() {\n\n\tconsole.log(\"The array contents are:\\n\", definedArray);\n\tdocument.getElementById(\"output\").value = \"Array: \" + definedArray;\n}", "title": "" }, { "docid": "7a4e8c926fc67ca2057c809d8c92c680", "score": "0.5529664", "text": "function putInputInArray(event) {\n console.log( 'submit button clicked');\n //preventing infitnite page refresh\n event.preventDefault();\n\n //define values\n let firstName = $(\"#first-name-input\").val();\n let lastName = $('#last-name-input').val();\n let id = $('#id-input').val();\n let title = $('#title-input').val();\n let annualSalary = $('#annual-salary-input').val();\n let newEmployee = {firstName, lastName, id, title, annualSalary};\n console.log(newEmployee);\n \n //push inputs into array\n employeeArray.push(newEmployee);\n console.log('employee array:', employeeArray );\n\n// clear out our input values from the form\n $('#first-name-input').val('');\n $('#last-name-input').val('');\n $('#id-input').val('');\n $('#title-input').val('');\n $('#annual-salary-input').val('');\n\n //call function to DOM \n showEmployees(employeeArray);\n sumOfSalary(newEmployee.annualSalary);\n}", "title": "" }, { "docid": "f96ad651b93edba5ad85bb6acb811c96", "score": "0.55285525", "text": "function addInput(){\n\t// Getting the state\n\tvar state = wave.getState();\n\t\n\t// Retrieves topics from storage.\n\tvar jsonString = state.get('topics','[]');\n\t\n\t// Converts JSON to an array of topics\n\tvar topics = toObject(jsonString);\n\t\n\t// Push textbox value into the array and set the textbox to blank\n\ttopics.push(document.getElementById('textBox').value);\n\tdocument.getElementById('textBox').value = '';\n\t\n\t// Create an array for the topic and add it to the \"master\" array.\n\tvar votes = toObject(state.get('votes','[]'));\n\tvotes.push(new Array());\n\t\n\t// Submit everything to storage\n\tstate.submitDelta({'topics' : toJSON(topics), 'votes' : toJSON(votes)});\n}", "title": "" }, { "docid": "71be5bb91fa969bcf808b1083204255d", "score": "0.5524425", "text": "function submit() {\r\n document.getElementById(\"menu\").style.display = \"none\"; \r\n document.getElementById(\"menu-page\").style.display = \"block\"; \r\n var name_1 = document.getElementById(\"input\").value;\r\n name_of_pizza.push(name_1);\r\n var step_1 = document.getElementById(\"A\").value;\r\n var step_2 = document.getElementById(\"B\").value;\r\n var step_3 = document.getElementById(\"C\").value;\r\n var step_4 = document.getElementById(\"D\").value;\r\n var step_5 = document.getElementById(\"E\").value;\r\n steps.push(step_1);\r\n steps.push(step_2);\r\n steps.push(step_3);\r\n steps.push(step_4);\r\n steps.push(step_5);\r\n console.log(name_of_pizza)\r\n console.log(steps);\r\n}", "title": "" }, { "docid": "441075356f2a5a0533c87be9c0fccf26", "score": "0.5519498", "text": "function getInputVals(e){\n e.preventDefault();\n console.log(inc);\n console.log(num);\n\n if(inc < num){\n\n for(var i=0; i< theForm.elements.length - 1; i++){\n\n inputs[inc].push(theForm.elements[i].value);\n }\n if (upItem === true || response === true){\n var arrTemp = [];\n arrTemp = inputs[inc];\n if(disItem === true){\n createRow(arrTemp,inc);\n }\n upItem = false;\n response = false;\n }\n\n console.log(inputs[inc]);\n inc++;\n}\n else{\n response = confirm(\"You wanted to log \"+num+\" Activities. Do you want to add more?\");\n\n if (response === true){\n num++;\n inputs[inc] = [];\n\n }\n }\n}", "title": "" }, { "docid": "661b474359c78c80eccf5fd6d54c703d", "score": "0.5493708", "text": "function movieList () {\r\n\tmovieTitle = PROMPT.question(`\\nPlease enter your movie.`);\r\n\tmovieList = [];\r\n\tmovieList = movieList.push(`${movieTitle}`); \r\n}", "title": "" }, { "docid": "db060d175c3d3073701ad6508bd39ef4", "score": "0.5461863", "text": "push(item) {\n let i=0\n while (this.array[i]) {\n i++\n }\n if (i<array.length-1) {\n array[i] = item\n } else {\n //make an entirely new array because you have run out of space\n }\n }", "title": "" }, { "docid": "7e5539353836daf14cfb96b95823dd1f", "score": "0.54511833", "text": "function settingWord() {\n randomWord = [];\n randomWord.push(generateWord());\n console.log(randomWord[0] + ' is random.');\n // Set up the answer blanks\n for (let i = 0; i < randomWord[0].length; i++) {\n answerArr[i] = \" __ \";\n }\n console.log(answerArr);\n }", "title": "" }, { "docid": "1249836ab7486c441a631538d8f42953", "score": "0.54438895", "text": "function addItem()\n{\n\tvar newItem = prompt(\"Enter new item\");\n\n\t\tlist.push(newItem); //push adds item to end of array\n\t\tconsole.log(\"Item Added\");\n}", "title": "" }, { "docid": "83b366ea49d4da5a187ef88ce8b7b0a9", "score": "0.5435234", "text": "function Init(){\r\n // write code here\r\n arr = [];\r\n}", "title": "" }, { "docid": "42d972626c03078cf1360dc19b6b788d", "score": "0.5435015", "text": "function fillCoches() {\n for (var i = 0; i < 3; i++) { //3 iteraciones porque queremos 3 nombres de coches\n var temp = prompt(\"Escribe marca de tu \" + iteracion[i] + \" coche.\");\n coches[i] = (temp == null || temp == \"\") ? \"ninguno\" : temp; //si el input es cancelado, se escribe \"ninguno\" en el array\n }\n outputMarcasCochesDocument(); //FLUCHO DEL PROGRAMA SIGUE\n}", "title": "" }, { "docid": "6f23d70d00ed66c2b3e922ddf77ec243", "score": "0.5432764", "text": "function clearEntry() {\n var userInputScreen = document.querySelector('.userInputScreen');\n var inputArr = userInputScreen.value.split(' ');\n\n if (userInputScreen.value === '') return;\n\n // remove the last element in the array of values entered by the user\n inputArr.splice(inputArr.length - 1, 1);\n // update the calculator screen\n userInputScreen.value = inputArr.join(' ');\n\n userInputScreen.focus();\n }", "title": "" }, { "docid": "9ae12a39178adb79512eb0a39759a38d", "score": "0.54259473", "text": "function takeInputs(userData, anything){\n\tuserDataa.push(userData);\n\tconsole.log(userDataa);\n\tanything(userData);\n}", "title": "" }, { "docid": "2f14337f96d6dae75482313b47aa721d", "score": "0.5425369", "text": "function set_input() {\n\tfor (i = 0; i < 4; i++) {\n\t\tinput[i].value = account_dat[dat_index[i]];\n\t}\n}", "title": "" }, { "docid": "d62595e32df94d5ba74230f2adf33f90", "score": "0.5425067", "text": "function populateArray () {\n listOfCities.push(txtCity)\n }", "title": "" }, { "docid": "6768516cd23bb43731bf45dd814be0c0", "score": "0.54152995", "text": "function add_element_to_array() {\n array[x] = document.getElementById(\"text1\").value;\n alert(\"Element: \" + array[x] + \" Added at index \" + x);\n x++;\n document.getElementById(\"text1\").value = \"\";\n\n // Display\n // function display_array() {\n var e = '';\n var y;\n for (y = 0; y < array.length; y += 1) {\n e += \"Number Added: \" + array[y] + \"<br>\";\n }\n document.getElementById(\"Result\").innerHTML = e;\n\n}", "title": "" }, { "docid": "d225806551c18d4270b06b21b48ee0f8", "score": "0.5402055", "text": "function populateArray(textbox){\n let names = textbox.value.split(\"\\n\");\n let arr = [];\n for(let i = 0; i < names.length; i++){\n arr.push(names[i]);\n }\n return arr;\n}", "title": "" }, { "docid": "7314bc11eca2c4cf9699402b1b3aebb1", "score": "0.5385565", "text": "function submit()\r\n{\r\n //whatever value there is in the name_of_guest text input, push it into an array:\r\n GuestList.push(document.getElementById(\"name_of_guest\").value);\r\n //print that array's value in console:\r\n console.log(GuestList);\r\n//Display that value in the html page:\r\n document.getElementById(\"show_written_text\").innerHTML = GuestList;\r\n}", "title": "" }, { "docid": "bc0acdd3b4582c5e42cfddaea7f232ac", "score": "0.53777707", "text": "function getTheInput(e,count) {\n if(e.type === 'keypress'){\n\n // Make sure enter key is pressed\n if(e.which == 13 || e.keycode == 13){\n // let inputdata = [];\n inputdata = document.getElementById('inputbox1').value;\n counter ++;\n console.log(counter);\n counter++;\n dataarray[counter] = inputdata;\n console.log(\"ur input\"+dataarray);\n buttonClickCounter();\n }\n else {}\n }\n // let inputdata = []\n inputdata = document.getElementById('inputbox1').value;\n}", "title": "" }, { "docid": "98fcbd416a10514a43855db584d8d40c", "score": "0.5374704", "text": "function addTask(){\n taskText=document.getElementById('taskText').value;\n if(taskText !=null){\n taskText=taskText.toUpperCase();\n todoList.push(taskText);\n document.getElementById('taskText').value=\"\";\n arrayDisplay();\n }\n}", "title": "" }, { "docid": "9da37f39c221131117e0432206ddb944", "score": "0.53696", "text": "function zero_input() {\n return [0, 0, 0, 0, 0];\n }", "title": "" }, { "docid": "512edd91b907d8ea62893df55ac37b7d", "score": "0.5368905", "text": "function storeInMain() {\n\tinputArray.push(inputArea.value);\n\tlocalStorage.setItem(\"notes\", JSON.stringify(inputArray));\n}", "title": "" }, { "docid": "e5923cd5523596ac129b8148d7a52114", "score": "0.5353075", "text": "function g(lista){\n lista.length = 0\n lista.push( 77 )\n lista.push( 88 )\n}", "title": "" }, { "docid": "cc91a2a919db77b8c61fae1e41145b31", "score": "0.5344645", "text": "function pusher(x) {\n arr.push(x)\n}", "title": "" }, { "docid": "103c95b7c1a54d3516e175c67c8c353f", "score": "0.5344525", "text": "function ToArrayConver(values) {\r\n var values = prompt(\"Enter array values using comma ','\");\r\n values = values.split(\",\");\r\n for (i = 0; i < values.length; i++) {\r\n if (isNaN(parseInt(values[i]))) {\r\n values[i] = values[i];\r\n } else {\r\n values[i] = parseInt(values[i]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ab2d94e8fedf90bc61e1d8ec5d2fb9f1", "score": "0.53386045", "text": "function creararray (){\n let valores = prompt (\"Introduce valores separados por comas \")\n let arr = valores.split(','); \n\n console.log(arr);\n alert(arr)\n}", "title": "" }, { "docid": "259e8231245bb8df4377ae3c00638d95", "score": "0.53378147", "text": "push(value) {\n this.arr[this.length] = value\n this.length++\n }", "title": "" }, { "docid": "d769261460d42c657e91e9d684829839", "score": "0.53351253", "text": "function tambahPenumpang(){\r\n console.log(\"Tambah Penumpang\")\r\n let nama = prompt(\"Input Nama\\t: \")\r\n let alamat = prompt(\"Input Alamat\\t: \")\r\n let noHP = prompt(\"Input NoHP\\t: \")\r\n let noKTP = prompt(\"Input NoKTP\\t: \")\r\n \r\n //memasukan object kedalam array\r\n let penumpang = new Penumpang(nama,alamat, noHP,noKTP)\r\n array.push(penumpang)\r\n }", "title": "" }, { "docid": "b22c7668c4b4f5a42bfc8881db48a3cf", "score": "0.53336567", "text": "function pushNum() {\n numbers.push(25)\n}", "title": "" }, { "docid": "4c117c174bdedf61ed3acd6633905654", "score": "0.53334475", "text": "function getPlayerNames(boxes){\nlet box = document.querySelector(boxes);\n\n console.log(boxes);\n\n let input = box.value;\nconsole.log(input);\n if (input != \"\") {\n playerNames.push(input);\n }\n\n console.log(playerNames);\n\n}", "title": "" }, { "docid": "85bd261342b49321c3669d5a610af191", "score": "0.53300124", "text": "function createBlankSpots(array) {\n compChoiceBlankArray = BlankArray.concat(array);\n compChoiceBlankArray.fill(\"_\")\n document.getElementById(\"current-word\").textContent = compChoiceBlankArray.join(\" \");\n}", "title": "" }, { "docid": "e8506ebfb8d39938cec118a5b9825e28", "score": "0.5327641", "text": "push(val) {\n this.array[this.array.length] = val;\n }", "title": "" }, { "docid": "849c8a8855495064d109576b8b8d5a1f", "score": "0.5323815", "text": "function randomArray(){\n var numArray = [];\n var firstNumTemp;\n var lastNumTemp;\n\n //Initialize array - random numbers 1 to 100\n for (var i=0; i<5; i++){\n numArray[i] = Math.floor((Math.random() * 100)+1);\n }\n\n //Write initial array to page\n document.getElementById('randomNumArray').value=numArray;\n\n //Peel off first and last array elements\n firstNumTemp = numArray.shift();\n lastNumTemp = numArray.pop();\n\n //Write elements and subset to page\n document.getElementById('firstArrayNum').value=firstNumTemp;\n document.getElementById('lastArrayNum').value=lastNumTemp;\n document.getElementById('subsetArray').value=numArray;\n\n //Add first and last elements back - reverse order\n numArray.unshift(lastNumTemp);\n numArray.push(firstNumTemp);\n\n //Write updated array\n document.getElementById('updatedArray').value=numArray;\n}", "title": "" }, { "docid": "6200b667dfe7b4a8a9dddda83cdf3876", "score": "0.53078026", "text": "function storeNumber(button) {\n if (numString === '' && numArray.length === 0) {\n return;\n } else {\n numArray.push(numString);\n numArray.push(button);\n numString = ''; \n }\n}", "title": "" }, { "docid": "dd5029e5fe8886d7c5e6f7ba4a3f0ef0", "score": "0.53074324", "text": "function addTodoToArray(todo) {\n arrayDefault.push(todo);\n}", "title": "" }, { "docid": "412c20d5ccd5522a460a9c8f81b55ed5", "score": "0.53015745", "text": "function getUserInput() {\n let fieldCountNum = 0;\n for (var i = 0; i < fieldCount; i++) {\n fieldCountNum++;\n let userSaidWhat = document.getElementById('field' + fieldCountNum).value;\n userInput.push(userSaidWhat);\n }\n}", "title": "" }, { "docid": "c115c3a74fc43c90361c671908dd54b3", "score": "0.5299987", "text": "function processInput(arr) {\n //COMPLETE THIS FUNCTION\n console.log(arr);\n}", "title": "" }, { "docid": "7785463cd2df2bc6f0bee163999cdcb5", "score": "0.52888906", "text": "function insert() {\r\n if (\r\n passwordInput.value != confirmPasswordInput.value ||\r\n fullNameInput.value == \"\" ||\r\n userNameInput.value == \"\" ||\r\n emailtInput.value.includes(\"@\") == \"\"\r\n ) {\r\n alert(\r\n \"Error message please enter the correct input value and try again. Like email and password must be correct\"\r\n );\r\n return false;\r\n }\r\n//push into the array whatever value the users enter in the input\r\n FullName.push(fullNameInput.value);\r\n UserName.push(userNameInput.value);\r\n Email.push(emailtInput.value);\r\n Password.push(passwordInput.value);\r\n confirmPassword.push(confirmPasswordInput.value);\r\n clearAndShow(); // after this call the clear and show function to clear the input and still display textboxes\r\n}", "title": "" }, { "docid": "5be934dcc265aa538e9c2501d540b442", "score": "0.5288167", "text": "function clear_entry() {\n if(inputs[0] && inputs[1] && inputs[2] !== '') {\n inputs.pop();\n $('#screen').text(inputs[1]);\n inputs[2] = '';\n } else if(inputs[0] && inputs[1] && inputs[2] === '') {\n inputs = [inputs[0]];\n i = 0;\n $('#screen').text(inputs[0]);\n } else {\n inputs = [''];\n i = 0;\n $('#screen').text('');\n }\n}", "title": "" }, { "docid": "84a676e0edf9535498762158cf2346cd", "score": "0.5287975", "text": "function setInput (words){\n input = words;\n console.log(input);\n }", "title": "" }, { "docid": "d9b166b94693db66c8bc9ed223c038c1", "score": "0.5286421", "text": "function limpiarDatos(inputs) {\r\n var i;\r\n for (i = 0; i < inputs.length; i++) {\r\n inputs[i].value = \"\";\r\n }\r\n }", "title": "" }, { "docid": "93d087d9c2b0e0d3e905d78c49e87825", "score": "0.52861524", "text": "function emptyArray(array) {\n\tarray.length = 0;\n}", "title": "" }, { "docid": "e3dabf85341992c3de8f74e09dce3dda", "score": "0.52852446", "text": "function pushNumericInput(num){\n if(numericInput.length <=11){\n // Only one decimal per number please\n if(num == \".\"){\n if(numericInput.length == 0){\n numericInput.push(0)\n }\n if(numericInput.indexOf(\".\") == -1){\n numericInput.push(\".\")\n }\n }\n else if(numericInput.length === 1 && num === 0 && numericInput[0] === 0){\n numericInput[0] = num\n }\n else if(numericInput.length === 1 && num !== 0 && numericInput[0] === 0){\n numericInput[0] = num\n }\n else{\n numericInput.push(num)\n }\n }\n display.textContent = numericInput.join(\"\")\n console.log(numericInput)\n}", "title": "" }, { "docid": "305a01d2a3eea19485d58ae07c91ffc6", "score": "0.5279321", "text": "function createArray(){\n\tvar address = window.prompt(\"Enter your wallet addres: \");\n\tvar previousMeasure = window.prompt(\"Last month metering in kWh: \");\n\tvar actualMeasure = window.prompt(\"Actual month metering in kWh \");\n\tvar differenceMeasure = actualMeasure - previousMeasure;\n\tvar arrayMeasure = [address, previousMeasure, actualMeasure, differenceMeasure]\n\ttableData.push(arrayMeasure)\n\treturn alert(\"Value added\")\n\n}", "title": "" }, { "docid": "9187a49460f86c8289a53ac1d8417de6", "score": "0.5278249", "text": "function createBabyArrays(){\n for (var k = 0; k < num1; k++) {\n tempArray = null;\n tempArray = outputArray.splice(k, num1);\n outputArray.unshift(tempArray);\n };\n }", "title": "" }, { "docid": "1d1b81f66004689edda39cdef05ce850", "score": "0.5272331", "text": "function add_joueur(){\n //afficher et stocker les joueurs\n joueurs.push(prompt(\"Ecrire un nom de jouer en majuscule.\"));\n\n //tester variable joueurs\n if(joueurs!=null)\n {\n alert(joueurs.length); \n document.getElementById(\"affiche_joueur\").innerHTML = joueurs;\n} else {\n alert(\"vous n'avez pas indiqué de nom de joueur.\");}\n }", "title": "" }, { "docid": "db1cee7707434cc3b03c97239ca041e9", "score": "0.52679956", "text": "function addPlayerToArray(player){\n if(player == 'reset'){\n user_pick = '{\"theTeam\":[]}'\n return user_pick\n }else{\n user_pick = JSON.parse(user_pick)\n user_pick['theTeam'].push(player);\n user_pick = JSON.stringify(user_pick)\n return user_pick\n }\n}", "title": "" }, { "docid": "9ab43ba9905856dfed054260e0a214fa", "score": "0.5259876", "text": "function main() {\n do {\n var input = prompt(\"Give in your 16nrs to have them converted into a multidimensional array:\");\n } while (input.length != 16);\n\n var multiArrayInput = createMultiArray(input);\n console.log(multiArrayInput);\n\n var pickANr = prompt(\"Which nr do you wish to find the positions of?\");\n findPosition(pickANr, multiArrayInput);\n}", "title": "" }, { "docid": "e8f84732fe8167c7bafcaeabf24deea8", "score": "0.5249734", "text": "function array(){\nvar arr=[];\n\tarr[0] = document.getElementById('fstarr1').value;\n\tarr[1] = document.getElementById('sndarr1').value;\n\tarr[2] = document.getElementById('trtharr1').value;\nvar barr=[];\t\n\tfor (i=0;i<arr.length;i++){\n\t\tbarr.push(arr[arr.length-(i+1)]);\n\t}\n\tvar p=document.createElement(\"p\");\n\tvar text=document.createTextNode(barr[0]+barr[1]+barr[2]);\n\tp.appendChild(text);\n\tvar area = document.getElementById('addarray');\n\tarea.appendChild(p);\n}", "title": "" }, { "docid": "6bc0dbc088b4923d21cf2f1fe7e2301f", "score": "0.52445483", "text": "function addToArr(){\n var resultArr = []; \n \n //Parses input as integer, checks if NaN and adds input variable\n var currentSeconds = isItNan(parseInt(document.getElementById(\"secs\").value)); \n var currentMinutes = isItNan(parseInt(document.getElementById(\"mins\").value)); \n var currentHours = isItNan(parseInt(document.getElementById(\"hrs\").value));\n \n //Pushes variables to a local array\n resultArr.push(currentHours, currentMinutes, currentSeconds);\n \n //Pushes array to global array\n globalArr.push(resultArr);\n \n //Runs next function\n toTimestamp()\n \n}", "title": "" }, { "docid": "1639de811f394e88e72cf075adef791d", "score": "0.5244413", "text": "function setScoreBoardArray() {\n if (scoreBoardArray.indexOf(null, 0) == -1) {\n scoreBoardArray.shift();\n scoreBoardArray.push(currentScore.textContent + levelName);\n }\n else {\n let index = scoreBoardArray.indexOf(null, 0);\n scoreBoardArray[index] = currentScore.textContent + levelName;\n };\n localStorage.setItem('scoreBoardArray', JSON.stringify(scoreBoardArray));\n}", "title": "" }, { "docid": "591bfd25dc74ea471cafd9ea298a3118", "score": "0.5244324", "text": "function resetVal(array) { // define the elements to have their value reset\n for (i=0;i<array.length;i++) {\n array[i].value = \"\";\n }\n}", "title": "" }, { "docid": "b1b24e45ad8970af91bb1b4e4742edeb", "score": "0.5241477", "text": "function submitInitial() {\n var initText = userInitial.value.trim()\n if (initText === \"\") {\n return;\n } \n savedHighScore.push(initText);\n userInitial.value = \"\";\n storeHighScore ();\n submitInitial()\n}", "title": "" }, { "docid": "973a2d80e7cf6be63c28b0b9ad37e3ec", "score": "0.52365404", "text": "function push() {\n var a = [];\n a.push(1);\n console.log(a);\n a.push(2);\n console.log(a);\n a[0] = 3;\n console.log(a);\n}", "title": "" }, { "docid": "2c046aec17929ccefb340761acab5721", "score": "0.52345216", "text": "function addPersonnageFromInputName() {\n const inputElem = document.getElementById('input_name');\n personnages.push(inputElem.value);\n inputElem.value = '';\n sync();\n}", "title": "" }, { "docid": "fe124f188a6993699474af3cb8b4d4d6", "score": "0.52320576", "text": "function myfirst()\n{\n items[0]= document.getElementById(\"input1\").value;\n items[1]= document.getElementById(\"input2\").value;\n items[2]= document.getElementById(\"input3\").value;\n \n \n document.getElementById(\"demo\").innerHTML = items;\n \n \n}", "title": "" }, { "docid": "d6d83c0ede030d37ba36aeee7952310d", "score": "0.5224726", "text": "function namesToArray(){\n\t//Set the array to null before adding values \n\tplayersArray = [];\n\tfor(var i=0; i < numberOfPlayers; i++){\n\tvar getName = document.getElementById(i.toString()).value;\n\tbeforePlayersSet[i].name = getName;\n\tbeforePlayersSet[i].points = 0;\n\tplayersArray.push(beforePlayersSet[i]);\n\t}\n\t\n\tdocument.getElementById('printRange').innerHTML = \"<p></p>\";\n\tdocument.getElementById('printPlayerText').innerHTML = \"<p></p>\";\n\tstartQuiz();\n}", "title": "" }, { "docid": "36d69bb27f7bd56278522e64f357086f", "score": "0.52147955", "text": "enterArrayval(ctx) {\n\t}", "title": "" }, { "docid": "0bd1691ed26d8b750298fee6f68c6204", "score": "0.5214276", "text": "function empty(){\n //length erases data in array (better than remove method)\n globalArray.length = 0;\n cloneArr.length = 0;\n }", "title": "" }, { "docid": "96bfe879c18f0ee5e1fc08181e182dc8", "score": "0.52074075", "text": "function emptyCheckInValues() {\n cinvname.value = \"\";\n cinfname.innerHTML = \"\";\n venue = null;\n users = [];\n}", "title": "" }, { "docid": "1e88ca804cca7371d59ed61125c78f1a", "score": "0.5200564", "text": "function clear (array) {\n if (!array) {\n return;\n }\n\n if (isValidDrumName(array)) {\n return array.fill(false);\n } else {\n return;\n }\n\n}", "title": "" } ]
07a0d08639752c30ea9fb9feadccca42
READ search function called on click of the search bar button, it should take the input and userID and post to the API
[ { "docid": "4d0202cb83a6145b1447d2a3887cb6ea", "score": "0.63920856", "text": "function searchFuntion() {\n // get userID\n readCookie();\n\n // get search bar input\n let searchResult = $(\"#searchBar\").val();\n\n // create package sent to API\n let jsonPayload = JSON.stringify({\n userID: userID,\n search: searchResult.replace(/\\s\\s+/g, ' '),\n });\n\n // Get data from API\n let url = baseURL + '/SearchContacts.' + extension;\n\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\n \"Content-type\",\n \"application/json; charset=UTF-8\"\n );\n\n try {\n // let the user know what is happening\n toastr.info(\"Gathering Contacts!\");\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n $(\"#contacts\").html(\"Contact(s) List\");\n\n let jsonObject = JSON.parse(xhr.responseText);\n\n $('#contactsTable').DataTable().destroy();\n\n // build the table for the contacts\n buildTable(jsonObject.contacts, jsonObject.contacts.length);\n\n $('#contactsTable').DataTable({\n \"retrieve\": true,\n \"pagingType\": \"simple_numbers\", // \"simple\" option for 'Previous' and 'Next' buttons only\n \"searching\" : false\n });\n }\n };\n xhr.send(jsonPayload);\n } catch (err) {\n $(\"#contactsList\").html(err.message);\n }\n\n}", "title": "" } ]
[ { "docid": "840f2d4cad4bc1411f20a4d7f205f188", "score": "0.74152786", "text": "function handleOnSearch() {\n handleUserToSearch(userToSearch);\n const fullApiPath = path + userToSearch;\n getDataByUser(fullApiPath);\n }", "title": "" }, { "docid": "2783f29efc30bf24849f4165db448184", "score": "0.7405043", "text": "function handleSearchButtonClick(event) {\n console.log(event.target);\n //read the value of the search field and store it\n let userInput=$(\"#searchInput\").val().trim();\n //call the news api to get the news\n callNewsApi(userInput);\n console.log(userInput);\n //call the stockprice api to get the data \n callStockPriceApi(userInput);\n //call the news api to get the news\n callNewsApi(userInput)\n $('#searchInput').val(' ')\n}", "title": "" }, { "docid": "88640ea4e5f36693012e26f027f93cfc", "score": "0.7208273", "text": "function onSearchButtonClick() {\n\t\t// Input from search box\n\t\timdbSearch($('#search-box').val());\n\t}", "title": "" }, { "docid": "eeda65cfa7882b706417788a54fcead5", "score": "0.71432626", "text": "searchUser() {\n console.log(\"search user\");\n }", "title": "" }, { "docid": "3ecc1900d6a517a494603913687056e6", "score": "0.71359414", "text": "function handleSubmit(e) {\n e.preventDefault();\n userQuery = document.getElementById(\"search\").value;\n fetchSearchResults(userQuery);\n \n}", "title": "" }, { "docid": "8c64ac476e576f3256c63ce0039e0659", "score": "0.7111553", "text": "function handleSearch() {\n //Then I get the value that was entered into the search input\n makeWeatherRequest(search);\n}", "title": "" }, { "docid": "aa332dd294518cf6a68167b611b842e4", "score": "0.6954129", "text": "function onSearchButtonClick() {\n\t\t// 1. Input value\n\t\tconsole.log(\"Search: \" + $('#search-box').val());\n\t\timdbSearch($('#search-box').val());\n\t\t// $('#results').html($('#search-box').val());\n\n\t}", "title": "" }, { "docid": "9549954faefaa7d89fff0e2416007948", "score": "0.69530016", "text": "function doSearch(event)\n{\n event.preventDefault();\n searchinput.blur();\n\n var searchops = {\n reverse : searchreverseoption.checked,\n sort: searchsortoption.value,\n value : searchinput.value,\n search : {\n pages : searchpagesoption.checked,\n users : searchusersoption.checked,\n categories : searchcategoriesoption.checked\n }\n };\n\n //Don't search on empty\n if(!searchops.value)\n {\n handleSearchResults(false);\n return;\n }\n\n globals.api.Search(searchops, data =>\n {\n log.Datalog(\"see devlog for search data\", data);\n handleSearchResults(data.data);\n });\n}", "title": "" }, { "docid": "0c68a4e0c6ca0ff68fa4d32cbeefae2a", "score": "0.69081074", "text": "function search() {\n let query = document.getElementById('search-input').value.trim();\n let category = document.getElementById('search-type').value;\n fetch('/petgram/posts?search=' + query + '&type=' + category)\n .then(statusCheck)\n .then(resp => resp.json())\n .then(searchResults)\n .catch(handleError);\n }", "title": "" }, { "docid": "73b7a4160c3b57160c264012a27a0f29", "score": "0.6879813", "text": "function search() {\n var username, searchterms, subreddit = \"\";\n if ($('#user').val() != \"\") {$('#after_search').val($('#after_search').val() + \" user=\" + $('#user').val() + \"::\");}\n if ($('#search_terms').val() != \"\") {$('#after_search').val($('#after_search').val() + \" search=\" + $('#search_terms').val() + \"::\");}\n if ($('#subreddit').val() != \"\") {$('#after_search').val($('#after_search').val() + \" subreddit=\" + $('#subreddit').val() + \"::\");}\n\n username = $('#user').val();\n searchterms = $('#search_terms').val();\n subreddit = $('#subreddit').val();\n\n $('.wrapper').addClass('hidden');\n $('#searched_results_display').removeClass('hidden');\n getComments(username, searchterms, subreddit);\n\n }", "title": "" }, { "docid": "373756e427a814a5c8926595d4454e1b", "score": "0.6874683", "text": "function handleSearch () {\n $('#js-search').on('submit', function (event){\n event.preventDefault();\n let usrInput = $(this).find('.js-search-query').val();\n setFilter(usrInput);\n renderShoppingList();\n });\n}", "title": "" }, { "docid": "0911068a00220eab5472a53de2269bee", "score": "0.6868232", "text": "function handleSubmit(event) {\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 let searchTerm = input.value.split(\" \").join(\"+\")\n console.log(\"\")\n callAPI(searchTerm)\n}", "title": "" }, { "docid": "389c27320d36cb21aae840845b4573b0", "score": "0.6862354", "text": "function search() {\r\n\t\tvar queryString = getInputValue( 'queryString', this.parentDoc );\r\n\t\ttry {\r\n submitGetRequest( this.url + \"?action=searchNominatim&queryString=\" + queryString, handleSearchNominatim, null, false );\r\n } catch(e) {\r\n alert( 1 + JSON.stringify( e ) );\r\n }\r\n\t}", "title": "" }, { "docid": "4cf1fb8fe5d6bc5574f81a4500064180", "score": "0.68455577", "text": "function search() {\n // Prevent a race condition by disallowing searches while a search is underway\n if (!loading) {\n setError(false);\n setLoading(true);\n props.setLoading(true);\n setLastSearch(keywords);\n props.setAcronymFilterList([]);\n\n fetchBioPortalApiKey(globalLoginDisplay, (apiKey) => {\n // Then also make a request to recommender and update filtered list.\n let url = new URL(vocabLinks[\"recommender\"][\"base\"]);\n url.searchParams.set(\"apikey\", apiKey);\n url.searchParams.set(\"input\", encodeURIComponent(keywords));\n fetchWithReLogin(globalLoginDisplay, url)\n .then((response) => (response.ok ? response.json() : Promise.reject(response)))\n .then((data) => {\n props.setAcronymFilterList(extractList(data));\n props.setParentFilterTable(true);\n })\n .catch(() => {\n setError(true);\n })\n .finally(() => {\n setLoading(false);\n props.setLoading(false);\n });\n },\n () => {\n setError(true);\n }\n );\n }\n }", "title": "" }, { "docid": "670074ca6c08a88621928f345104eb19", "score": "0.6813586", "text": "function search_field_input() {\n var search_text = document.getElementById(\"search_text\").value;\n build_user_buttons(search_text);\n}", "title": "" }, { "docid": "944e93c5a81e40b66e060623d029a837", "score": "0.67859626", "text": "function process(){ \n if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0){ \n filter = document.getElementById('filter').style.display=\"block\"; \n //Store the keyword form the search box in a variable \n userInput = encodeURIComponent(document.getElementById(\"userInput\").value); \n /*Send the request, make sure you give 3 parameters \n 1-Method, 2- url, 3- true or false \n */ \n xmlHttp.open(\"GET\", \"search.php?userInput=\"+userInput, true); \n //set the function which takes care of response \n xmlHttp.onreadystatechange = handleResponse; \n xmlHttp.send(null); \n }else{ \n } \n }", "title": "" }, { "docid": "25064fa28f47cc09803b78b8610252c7", "score": "0.67856777", "text": "function search(e){\n e.preventDefault();\n \n var alert = document.querySelector(\"#alert\");\n \n var xhttp = new XMLHttpRequest();\n const METHOD = \"GET\";\n const URL = \"https://api.github.com/users/\";\n\n xhttp.open(METHOD, URL + getUserToSearch(), true);\n xhttp.send();\n xhttp.onreadystatechange = function(){\n if (xhttp.readyState == 4 && xhttp.status == 200){\n if (alert != null || alert != \"\"){\n alert.innerHTML = \"\";\n };\n var user = JSON.parse(xhttp.responseText);\n console.log(user);\n printOutput(user);\n getUserBtn(user); \n }\n if(xhttp.status == 404){ \n var profile = document.querySelector(\".user-container\")\n if (profile != null || profile != \"\"){\n profile.innerHTML = \"\";\n };\n alert.innerHTML = \"User not found, try with another\";\n }\n } \n \n}", "title": "" }, { "docid": "db60a75f5a8091055fe790f91799029e", "score": "0.6781416", "text": "search() {\n let query = this.refs.query.value;\n\n if (this.refs.searchType.value === 'users') {\n this.searchUser(query);\n } else if (this.refs.searchType.value === 'repos') {\n this.searchRepo(query);\n }\n }", "title": "" }, { "docid": "37f04346ebfd3e7d18ce27383aeca582", "score": "0.6765906", "text": "function searchForHandle() {\n $(\".search-button\").on(\"click\", function(event) {\n event.preventDefault();\n let $searchHandle = $(\"#search-handle-input\")\n .val()\n .toLowerCase();\n console.log($searchHandle);\n fetchUserRepos($searchHandle);\n });\n}", "title": "" }, { "docid": "a1ad2365add3b9e8dcf170675db8f147", "score": "0.67630994", "text": "function handleSearch() {\n searchArray = [];\n const textSearch = textAreaSearch.value;\n if (!textSearch) {\n warningSearch.classList.remove('hidden');\n } else {\n warningSearch.classList.add('hidden');\n fetch(`//api.tvmaze.com/search/shows?q=${textSearch}`)\n .then((response) => response.json())\n .then((dataAPIList) => {\n for (let i = 0; i < dataAPIList.length; i++) {\n const dataAPI = dataAPIList[i].show;\n const idFromAPI = dataAPI.id;\n const nameFromAPI = dataAPI.name;\n const imgFromAPI = existMediumImg(dataAPI.image);\n const networkFromAPI = existNameNetwork(dataAPI.network);\n searchArray.push(\n new SearchItem(idFromAPI, nameFromAPI, imgFromAPI, networkFromAPI)\n );\n }\n\n paintSearch();\n addFavEvent();\n });\n }\n}", "title": "" }, { "docid": "f46f324106c1cc34631dca0fa37b928b", "score": "0.6752998", "text": "function getResults(event) {\n\tevent.preventDefault();\n\tresetResults();\n\tconst query = document.querySelector('#searchInput').value.trim();\n\tgithub_Api.searchUser(query, showUserData, notResults);\n\tgithub_Api.searchReposOfUser(query, showReposData, undefined);\n}", "title": "" }, { "docid": "875ff326d7262ad2eeb00a7c10f68214", "score": "0.67503005", "text": "function searchUsers()\n{\n\t\n}", "title": "" }, { "docid": "95b88f1f930d97930bce2ccbf2c39384", "score": "0.6747786", "text": "function captureInput() {\n let userInput = inputDiv.value;\n let newAPI = new API (apiKey, userInput);\n newAPI.nameSearch();\n}", "title": "" }, { "docid": "3210ffd8897378ef75a71a28da0f54e0", "score": "0.67229754", "text": "function handleUserSearch() {\n $('.js-content-container').on('click', '.js-submit', event => {\n event.preventDefault();\n const searchTerm = $('#searchSubject').val();\n\n getUserSearch(searchTerm);\n store.searchStarted = false;\n })\n}", "title": "" }, { "docid": "e4bfd9a6aac416c4d78a85408da23fe8", "score": "0.67005515", "text": "function SearchFunction() {\n document.clear();\n \n search = document.getElementById(\"searchInput\");\n\n //prepare the request \n event.preventDefault();\n \nxhr.open ('GET','https://api.themoviedb.org/3/search/movie?api_key=01b7287a4e8d89aa13eac1e37af27329&language=en-US&query='+search.value,true);\n//send the request\nxhr.send(null); // no data needs to be sent to server\n }", "title": "" }, { "docid": "63c7f8b32dd1866391e517bb5ff1b038", "score": "0.66963327", "text": "function onSearch(e) {\r\n // Stop default action\r\n e.preventDefault();\r\n // Show preloader\r\n ui.showLoader();\r\n // Reset country and categories selects\r\n ui.resetSelect('#country');\r\n ui.resetSelect('#categories');\r\n // Disable category select\r\n ui.disabledSelect(true, '#categories');\r\n // Reset resources select\r\n ui.resetSelect('#resources');\r\n // Save search words for get request\r\n let searchWords = searchForm.elements.searchInput.value;\r\n // Clear input\r\n searchForm.reset();\r\n // Make get request and handle results\r\n newsHandler(`https://newsapi.org/v2/top-headlines?q=${searchWords}&apiKey=${apiKey}`);\r\n}", "title": "" }, { "docid": "fe3cc80a3128dac06dd83e956ba819bc", "score": "0.6695441", "text": "handleSearch() {\n }", "title": "" }, { "docid": "40cfa5a58567f972bf6c3665ef79c813", "score": "0.66872054", "text": "function search () {\n // pulisco la pagina\n $('main').html('');\n // recupero l'input dell'utente e svuoto la casella\n var input = $('#input-search').val();\n $('#input-search').val('');\n // assegno a variabili gli url delle due chiamate ajax\n var urlMovies = 'https://api.themoviedb.org/3/search/movie';\n var urlSeries = 'https://api.themoviedb.org/3/search/tv';\n // se l'input non è vuoto faccio la ricerca\n if (input !== '') {\n ajaxCall(urlMovies, input, 'movies');\n ajaxCall(urlSeries, input, 'series');\n }\n}", "title": "" }, { "docid": "8aa2e19d6c3518a5ab8ad3a10432192b", "score": "0.6684783", "text": "function searchUsers(searchStr){\n console.log('getUsers called');\n if(!searchStr){\n searchStr = document.getElementById('search').value;\n }\n grout.Users.search(searchStr).then(function(users){\n console.log('search users loaded:', users);\n document.getElementById(\"search-output\").innerHTML = JSON.stringify(users);\n });\n }", "title": "" }, { "docid": "492805faa827c9eb3225f9979a1ece07", "score": "0.66790044", "text": "function handleSearch(e) {\n e.preventDefault() \n \n fetch(`https://newsapi.org/v2/everything?q=${query}&from=${from}&to=${to}`, {\n \"method\": \"GET\",\n \"headers\": {\n \"X-Api-Key\": \"YOURAPIKEYHERE\"\n }\n })\n .then(response => response.json())\n .then(response => {\n setArticles(response.articles);\n })\n .catch(err => { \n console.log(err); \n });\n }", "title": "" }, { "docid": "eaad5acddab1b29d1e244b5b86fc8f42", "score": "0.6667035", "text": "function searchUser() {\n resultHtml.innerHTML = \"\";\n let searchNavbar = document.querySelectorAll(\"#search-nav input\");\n fetch(`https://api.github.com/search/users?q=${searchNavbar[0].value}`, {\n method: \"GET\"\n })\n .then(datos => {\n return datos.json();\n })\n .then(datos => {\n //Si el resultado es correcto mostrara todos los usuarios\n if (datos.total_count) {\n resultHtml.innerHTML += \"<h1>Resultados</h1>\";\n for (let user of datos.items) {\n resultHtml.innerHTML += `<p onclick=fullUserHtml('${user.login}')>${\n user.login\n }</p>`;\n }\n // search(user.login);\n\n //Si el resultado fuera incorrecto creara un ventana que diga error\n } else {\n console.log(\"Ningun nombre coincide con el nomnbre de usuario dado\");\n resultHtml.innerHTML = \"<div class='error-search'>Does not exist</div>\";\n }\n })\n .catch(datos => {\n console.error(`El error es ${datos}`);\n });\n}", "title": "" }, { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.66494876", "text": "function search() {}", "title": "" }, { "docid": "c249ebdea23b322cb05fdd4c8ed8dcaf", "score": "0.66461575", "text": "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "title": "" }, { "docid": "6d53985208b5aaf8553c280e9c26c559", "score": "0.66275084", "text": "function handleSearchButton() {\n $(\".search_button\").click(function(event) {\n event.preventDefault();\n if (TEXTBOX_MODE === false) {\n startTextboxMode();\n } else {\n getUserTextboxInput();\n if (USER_INPUT !== \"\") {\n processInput(USER_INPUT);\n }\n }\n });\n }", "title": "" }, { "docid": "b285ead1a413722c951fd3acbe882500", "score": "0.66270524", "text": "function searchClicked() {\r\n console.log(\"Search button clicked.\");\r\n\r\n isViewingEntry = false;\r\n\r\n // Resets results\r\n info.innerHTML = \"\";\r\n tempLine = \"\"; // Resets displayed search results\r\n\r\n // Save and trim search term\r\n let searchTerm = document.querySelector(\"#searchBar\").value;\r\n searchTerm = searchTerm.trim();\r\n let tempSearchTerm = searchTerm.replace(\" \", \"-\"); //Replace any spaces with dash for use in search\r\n\r\n // Save selected type value\r\n let types = document.querySelector(\"#type\");\r\n let typeValue = types[types.selectedIndex].value;\r\n\r\n // Save selected search limit\r\n let limit = document.querySelector(\"#limit\").value;\r\n\r\n // Checks if user has selected type, will then scan shorter list of Pokemon and get results\r\n if(typeValue != \"all\") {\r\n getData(\"https://pokeapi.co/api/v2/type/\" + typeValue);\r\n\r\n return; // Exits function as search is completed on smaller list\r\n }\r\n \r\n // Scan global Pokemon list for any Pokemon names with a substring that matches the term\r\n for(let i = 0; i < pokeNameList.length; i++) {\r\n if(pokeNameList[i].includes(tempSearchTerm)) {\r\n getData(pokeUrlList[i]);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "86a50464e1987ac857555466ddcc672d", "score": "0.66249657", "text": "searchForUsers(e){\n // e.preventDefault();\n axios.get(`http://54.201.151.137:3000/search_for_users?search_term=${this.state.user_input_search}`).then((result)=>{\n this.setState({\n user_search_results: result.data.items\n })\n })\n }", "title": "" }, { "docid": "ef5d71f26b84dad334eae18c81970cce", "score": "0.6617759", "text": "function searchRecipe(e) {\n e.preventDefault()\n\n // Clear previous search results\n let node = document.getElementById(\"photo-grid\");\n node.innerHTML = '';\n\n // Get user's input\n let searchquery = $('#transcript').val();\n console.log(\"SEARCH QUERY: \", searchquery);\n\n var params = { q: searchquery };\n var body = {};\n var additionalParams = {};\n\n searchAPI(params, body, additionalParams);\n}", "title": "" }, { "docid": "f16e5c2cdbc3da563f9f88705e5c4cb2", "score": "0.6615733", "text": "function searchBtnClickHandler() {\n searchMember($(\"#inputSearch\").val());\n}", "title": "" }, { "docid": "7ee5e1c3705e7c9395299ff1f95e9c1f", "score": "0.65953344", "text": "handleSearchInputChange(value) {\n // err handling\n if (!value) {\n console.log(`App.handleSearchInputChange() received an invalid value`)\n return\n }\n\n this.fetchUsers(value)\n }", "title": "" }, { "docid": "7f4927b55f1d5c5b3ca2a77a064143d8", "score": "0.6576636", "text": "function searchInputHandler(){\n let SearchString = document.getElementById(\"Search-Bar\").value;\n if(SearchString === \"\"){\n removeSearchResults();\n return;\n }\n let response = searchCountries(SearchString, displayResults, handleError);\n}", "title": "" }, { "docid": "d9f788859c136e23a2c92a237c7ff38e", "score": "0.65663064", "text": "search(querySearch) {\n \n }", "title": "" }, { "docid": "4eb4107c6fb90e3aa396fdd616103ab5", "score": "0.65608424", "text": "function searchSubmitBtnHandler() {\n //Vytiahne aktualnu hodnutu search fieldu\n const searchValue = searchFieldEl.value;\n\n // Ak je field prazdny vypise chybu\n if (searchValue.length === 0) {\n showError('Vyhladavany nazov ucebne je prilis kratky');\n return;\n }\n\n // Vyhlada vyhovujuce meistnosti\n const rooms = getAutocompleteOptions(searchValue)\n\n // Ak nenaslo ziadne meistnsoti tak zobrazi chybu\n if (rooms.length === 0) {\n showError('Nenasla sa ziadna miesnost');\n return;\n }\n\n //Zobrazi mapu pre prvu meistnost v zoznamie miestnosti ktore sa nasli\n showMapForRoom(rooms[0])\n}", "title": "" }, { "docid": "684d6c95ad2b29cc09f9e66047842ccb", "score": "0.65604764", "text": "function handleSearch(input){ \n props.handleSearch(input)\n }", "title": "" }, { "docid": "8482782fa09bffb76c27ffa8fdd53844", "score": "0.65409636", "text": "getQuery(){\r\n //Validation check before\r\n if(this.checktext()){\r\n //Search users with user name from text input\r\n return fetch('http://10.0.2.2:3333/api/v0.0.5/search_user/?q='+this.state.queryname)\r\n .then((response) => response.json())\r\n .then((responseJson) => {\r\n this.setState({\r\n //sets state of searched detail as the json reponse from query\r\n searchedDetails: responseJson,\r\n });\r\n })\r\n }\r\n}", "title": "" }, { "docid": "2487bb85c1a8ba4386e85bdbc2f6e81d", "score": "0.65401596", "text": "function getAllUsers() {\n var searchInput = document.getElementById(\"searchbar\").value;\n UserController.ReturnAll(searchInput, onGetAllUsers);\n}", "title": "" }, { "docid": "50a491c3c4ea1eefd8f32925d5856902", "score": "0.6506358", "text": "onSubmit(event) {\n event.preventDefault();\n const searchQuery = this.q.value;\n if (searchQuery === '') {\n this.getApiData(this.apiUrl);\n } else {\n this.searchMovies(searchQuery);\n }\n }", "title": "" }, { "docid": "ef851cc48f79628aa579c4416cc77dce", "score": "0.6502514", "text": "function startSearch(apiUrl) {\n \n // variables defined for easier referencing of elements\n let searchBtn = document.getElementById('search-btn');\n let searchInput = document.getElementById('search');\n \n // start searching through posts when the user searches\n searchBtn.onclick = () => {\n localStorage.setItem('search', 'true');\n getAllPosts(apiUrl);\n }\n \n // check when the user stops and starts search \n searchInput.addEventListener('input', function() {\n \n // when the user is no longer searching, reload the user's feed \n // i.e when the search field value is empty\n if (searchInput.value == '') {\n localStorage.setItem('search', 'false');\n reconstructFeed(apiUrl);\n } \n \n });\n}", "title": "" }, { "docid": "3bf1bdd1f0c925708521fa1e8fd2bbec", "score": "0.6499973", "text": "function searchButtonClicked() {\r\n setSearchButtonText('Searching');\r\n getResults(document.getElementById('searchQueryInput').value, 1);\r\n}", "title": "" }, { "docid": "3363953a14514489e93c01a230f3061c", "score": "0.64991957", "text": "function searchAll(event) {\n //search bar input - perform fetch with query\n event.preventDefault();\n const searchInput = document.getElementById('search-input').value;\n getPodcastsInSearch(searchInput);\n}", "title": "" }, { "docid": "8c9be466d7cb5adb41ef7406b625b50b", "score": "0.6497687", "text": "async function getSearch(event) {\n console.log(\"getSearch se lance\");\n event.preventDefault();\n\n let searchRequest = search.value;\n\n await getSearchResults(`https://deezerdevs-deezer.p.rapidapi.com/search?q=${searchRequest}`, myInit);\n console.log(\"getSearchResults est terminée\");\n\n search.value = '';\n}", "title": "" }, { "docid": "9cdb79c92f4bd1899a5fe61697fb4c1c", "score": "0.6496406", "text": "async searchBooks() {\n //Prevent page from reloading on search\n var form = document.getElementById(\"searchForm\");\n function handleForm(event) { event.preventDefault(); } \n form.addEventListener('submit', handleForm);\n //get search terms from user input\n const searchQ = searchBy();\n const filter = searchFilter();\n const input = document.getElementById(\"user-query\").value;\n if (input === '') { window.alert('Please enter search terms to search.') };\n let myKey = 'AIzaSyDPR8cteFuQVST1bDSeXmc42TCeWggqyxo';\n // use the getJSON function and the position provided to build out the correct URL to get the data we need. Store it into this._booksearch, then return it\n const query = this.baseUrl + `${searchQ}${input}${filter}&startIndex=0&maxResults=40&key=${myKey}`;\n this.bookSearch = await getJSON(query);\n return this.bookSearch;\n }", "title": "" }, { "docid": "82c9d7304b9db02394f9b3a1b0bd6c10", "score": "0.64951235", "text": "function search() {\n notice(\"searching...\");\n\n input(\"#main-search-box\", items.join(\" \"), function () {\n submit(\"#global-search\", function () {\n waitFor(\"#results.search-results\", function () {\n getAllSearchResults(function (ids) {\n crawl(ids, function () {\n notice(\"Crawl ends.\")\n });\n });\n });\n });\n\n });\n}", "title": "" }, { "docid": "75791be2b8bd9f1a484d5bf4cf016605", "score": "0.64917463", "text": "function search(event) {\n event.preventDefault();\n sendApiRequest(cityInput.value, onCityInformationUpdated);\n}", "title": "" }, { "docid": "1a1ac8a3da2d2233e98e3c05207b425f", "score": "0.6486046", "text": "static searchHandler(input) {\n // Di sini kita akan berhubungan langsung dengan data bukan?\n // Karena itu kita akan melemparnya ke model !\n\n // Jangan lupa setelah menerima hasil dari model,\n // Kemudian akan dilempar ke View untuk dijadikan output kepada user ! \n let result = Model.readAndWrite(input);\n\n // Nah pada saat ini, kita tidak bisa memilih \n // apakah error, atau success ?\n // sehingga kita hanya menggunakan showSuccess saja\n View.showSuccess(result);\n }", "title": "" }, { "docid": "59a4af1d1279844789013e09b52dc1b5", "score": "0.6484481", "text": "function search() {\n let term = input.value();\n\n // URL for querying the times\n let url = 'https://api.nytimes.com/svc/search/v2/articlesearch.json?'\n + 'api-key=99cfea65a5bb30650b3d31eb1713233e:15:73386102'\n + '&q=' + term;\n\n // Query the URL, set a callback\n // 'jsonp' is needed for security\n loadJSON(url, gotData);\n}", "title": "" }, { "docid": "f680cb206f7f829e47911bc83c4368be", "score": "0.6475323", "text": "function search() {\n\t\tvar searchVal = searchText.getValue();\n\n\t\tsources.genFood.searchBar({\n\t\t\targuments: [searchVal],\n\t\t\tonSuccess: function(event) {\n\t\t\t\tsources.genFood.setEntityCollection(event.result);\n\t\t\t},\n\t\t\tonError: WAKL.err.handler\n\t\t});\n\t}", "title": "" }, { "docid": "aeb0d1b4450d99075366ddc028a43c61", "score": "0.647307", "text": "function searchUser() {\n bool = true;\n document.getElementById(\"not-found\").innerHTML = '';\n document.getElementById(\"user\").innerHTML = '';\n document.getElementById(\"repos\").innerHTML = '';\n\n var user = document.getElementById(\"searchbox\").value;\n var http = new XMLHttpRequest();\n http.open(\"GET\", \"https://api.github.com/users/\" + user);\n http.onload = function(e) {\n if (http.readyState === 4) {\n if (http.status === 200) {\n foundUser(http.responseText); // If user found. calls foundUser for parsing and building the user div.\n } else {\n console.error(http.statusText);\n notFound(); // Else builds not found message.\n }\n }\n };\n http.onerror = function(e) {\n console.error(http.statusText);\n };\n http.send();\n}", "title": "" }, { "docid": "a676dce8db1590ab9afe91b65496f140", "score": "0.6472202", "text": "function handleSubmit(event) {\n event.preventDefault();\n let city = document.querySelector(\"#search-input\").value;\n search(city);\n}", "title": "" }, { "docid": "c42aaf371c9cfb6d971a48c50e230747", "score": "0.6452698", "text": "function onSearch(buttonId) {\n //reading search input\n document.title = document.getElementById('query').value;\n var pageNo = document.getElementById(buttonId).value;\n pageNo = parseInt(pageNo);\n //news content request input\n var aspects = ['title', 'summary'];\n var resultContext = {\n offset: pageNo,\n aspects: aspects,\n maxResults: 10\n };\n //preparing search content fetching with http\n var http = new XMLHttpRequest();\n var params = {\n queryString: document.getElementById('query').value,\n resultContext: resultContext\n }\n\n http.open('POST', searchService, true);\n http.setRequestHeader('Content-type', 'application/json');\n http.send(JSON.stringify(params)) // Make sure to stringify\n http.onload = function () {\n // on search reading search response and populating search result with headlines summary and pagination\n var myJson = JSON.parse(this.responseText);\n if (this.responseText.error != true) {\n var res = myJson.data;\n var txt = '';\n txt = '<div class=\"search-results o-teaser-collection\" ><div class=\"search-results__heading\"><div class=\"search-results__heading-title\"> <h2 class=\"o-teaser-collection__heading o-teaser-collection__heading--half-width\"> Viewing Search Results for <strong>\"' + document.getElementById('query').value + '\"</strong> </h2> </div> </div>';\n if ((res.results[0].results != undefined) &&\n (res.results[0].results.length >= 0)) {\n for (var i in res.results[0].results) {\n var title = res.results[0].results[i].title;\n var apiUrl = res.results[0].results[i].apiUrl;\n var summary = res.results[0].results[i].summary.excerpt;\n txt += '<ul class=\"search-results__list\" > <li class=\"search-results__list-item\" > <div class=\"search-item\"> <div class=\"search-item__teaser\"> <div class=\"o-teaser o-teaser--article o-teaser--small o-teaser--has-image js-teaser\" > <div class=\"o-teaser__content\"><div class=\"o-teaser__heading\"> <a href=' + apiUrl + ' class=\"js-teaser-heading-link\">' + title.title + '</a> </div> <p class=\"o-teaser__standfirst\"> <a href=' + apiUrl + ' class=\"js-teaser-standfirst-link\"><span>' + summary + '</span> </a> </p> </div> </div> </div> </div> </li> </ul>';\n }\n txt += '</div>';\n document.getElementById('search-content').innerHTML = txt;\n document.getElementById('pagination').style.display = 'block';\n document.getElementById('prev').style.display = 'block';\n document.getElementById('curr').style.display = 'block';\n document.getElementById('next').style.display = 'block';\n var currPage = pageNo + 1;\n document.getElementById('prev').value = pageNo - 1;\n document.getElementById('next').value = pageNo + 1;\n document.getElementById('curr').innerHTML = \"Page \" + currPage;\n if (pageNo == 0) {\n document.getElementById('prev').style.display = 'none';\n }\n } else {\n txt = '<div class=\"search-results o-teaser-collection\" ><div class=\"search-results__heading\"><div class=\"search-results__heading-title\"> <h2 class=\"o-teaser-collection__heading o-teaser-collection__heading--half-width\"> No result found for <strong>\"' + document.getElementById('query').value + '\"</strong> </h2> </div> </div>'\n document.getElementById('search-content').innerHTML = txt;\n document.getElementById('prev').style.display = 'none';\n document.getElementById('next').style.display = 'none';\n document.getElementById('curr').style.display = 'none';\n document.getElementById('pagination').style.display = 'none';\n }\n }\n }\n}", "title": "" }, { "docid": "b3ba23e1e3c3b7df28edf901209a6b26", "score": "0.64385617", "text": "function searchMovies(e) {\n\te.preventDefault();\n\tlet searchText = document.getElementById('searchText').value;\n getMovies(searchText);\n}", "title": "" }, { "docid": "1f8a314a5b410f29a819f97b66a56ede", "score": "0.6438517", "text": "function searchh(){\n\tvar food = document.getElementById(\"search_meal\").value;\n\turl_api += food; \n\tfetchData();\n}", "title": "" }, { "docid": "0259f1963ec181a76e9ca9a0853265ca", "score": "0.6435972", "text": "function handleSearch(searchParam) {\n //probando si funciona el callback\n console.log(searchParam);\n setSearchParam(searchParam);\n }", "title": "" }, { "docid": "b4b9ee8ab759f49102f688d8b58e42f2", "score": "0.6432344", "text": "function handleSearch(event) {\n event.preventDefault();\n movieEl.innerHTML = \"\";\n playlistEl.innerHTML = \"\";\n movieTitle = movieSearch.value;\n getAPI(movieTitle)\n}", "title": "" }, { "docid": "904584775b432885a890906708bc6c23", "score": "0.6429323", "text": "onTextInput(event) {\n this.searchValue = event.target.value;\n if (this.searchValue.trim().length >= 1) {\n this.showSearchBoxList = true;\n const apiEndpoint = `${\"https://maps.googleapis.com/maps/api/place/autocomplete/json?key=\"}${this.apiKey}&types=(${this.searchType})&language=${dxp.i18n.languages[0]}&input=${this.searchValue}`;\n this.getData(apiEndpoint).then(async (data) => {\n if (data) {\n this.filterItemsJson = data;\n if (this.filterItemsJson['predictions']) {\n this.filterItemsJson = this.filterItemsJson['predictions'];\n }\n if (this.filterItemsJson.length) {\n this.responseFlag = true;\n }\n }\n });\n }\n if (this.showSearchBoxList === false) {\n this.showSearchBoxList = !this.showSearchBoxList;\n }\n }", "title": "" }, { "docid": "3f0502db8689873eddfdd126e9c7a499", "score": "0.64273316", "text": "search() {\n // only send search request if input is more than 3 chars\n if (this.searchValue.length < 3) {\n this.searchLoading = false\n this.searching = false\n return\n }\n\n // creating search object\n args = {name: '', sid: ''}\n if (this.searchType === 'name')\n args.name = this.searchValue\n else\n args.sid = this.searchValue\n\n // sending search object\n ipcRenderer.send('search', {type: 'student', info: args})\n\n // spins the loading icon\n this.searchLoading = true\n\n\n ipcRenderer.on('responseSearch', (e, result) => {\n if (result) {\n this.noResult = false\n this.searchResults = result\n this.searchLoading = false\n this.searching = true\n } else {\n this.searchResults = []\n this.searchLoading = false\n this.searching = true\n this.noResult = true\n }\n\n })\n }", "title": "" }, { "docid": "91f512b8ed3957b15b7c74a0ba36f66a", "score": "0.6424884", "text": "function search() {\n $scope.books = null;\n // hide keyboard\n if (window.cordova && window.cordova.plugins.Keyboard) {\n cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);\n }\n var searchQuery = $scope.searchQuery;\n if (searchQuery && (searchQuery.isbn || searchQuery.keyword)) {\n // reset search\n booksInventory = {};\n inventoryService.read().then(function (response) {\n booksInventory = response.books;\n $log.debug('Start searching with criteria:');\n retrieve(searchQuery);\n },\n function (response) {\n $log.error('Error during reading inventory for search with critera ' + JSON.stringify(searchQuery) + ':' + JSON.stringify(response));\n });\n } else {\n // TODO move to wrapper\n if (typeof cordova != 'undefined') {\n navigator.notification.alert('Please enter search details.', null, 'Info');\n } else {\n alert('Please enter search details.');\n }\n }\n }", "title": "" }, { "docid": "e4926f49a6e83696fb4d423bc6383ad4", "score": "0.6422161", "text": "function searchAll() {\n\n // Type of search\n if (searchcmb.value === 'psn') {\n searchByThis = 'person';\n }\n else {\n searchByThis = 'movie';\n }\n\n content = \"listData\";\n loading = \"loadSearch\";\n\n // My API Key\n var myAPIKey = '?api_key=7ce83203cac071b99a03223afe399640';\n\n // Search call\n var apiSearch = 'https://api.themoviedb.org/3/search/' + searchByThis;\n\n // Complementary data for search\n var comSearch = '&language=es&page=1&include_adult=false&sort_by=popularity.desc&query=';\n\n var queryInput = searchtxt.value;\n\n // Call ajax request\n var url = apiSearch + myAPIKey + comSearch + queryInput;\n\n callRequest(url);\n}", "title": "" }, { "docid": "49909c57461522cba7ee00a5e1bc1066", "score": "0.6420222", "text": "function search() {\n cityName = $(\"#cityNameSearch\").val();\n\n getWeather(cityName);\n storedSearches();\n renderStoredSearches();\n }", "title": "" }, { "docid": "028390881e45275ad11dab048574316c", "score": "0.64147204", "text": "function searchFunction () {\n activateSearch($searchInput, 'input');\n activateSearch($submit, 'click');\n}", "title": "" }, { "docid": "0fc0df2ab79959971092c223b20b5860", "score": "0.64138323", "text": "function search(event) {\n event.preventDefault();\n let search = document.querySelector(\"#search-text-input\");\n let h1 = document.querySelector(\"h1\");\n h1.innerHTML = `${search.value}`;\n searchCity(search.value);\n}", "title": "" }, { "docid": "99aabc60dc8cbf8c3fb531fe7daf0393", "score": "0.64047205", "text": "function searchHandler(ev) {\n try {\n // Prevent the default behaviour of form submit\n ev.preventDefault();\n\n reset();\n const searchTerm = searchInput.value.trim();\n // Checks whether searchTerm is empty\n if (searchTerm) {\n getSongs(searchTerm);\n } else {\n noResult.textContent = `No results found`;\n noResult.classList.add('visible');\n }\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "93b5b6dbb38c83750e28b58c9d5554af", "score": "0.6403478", "text": "function searchPosts(searchRequest) {\n // Removes previous feed.\n let uList = document.getElementById(\"feed\");\n while (uList.hasChildNodes()) uList.removeChild(uList.firstChild);\n\n // Sets options to get user details.\n let tokenString = \"Token \" + localStorage.token;\n const options = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': tokenString\n }\n }\n\n // The url for accessing user of current user.\n let user = localStorage.getItem(\"api\") + \"/user/\";\n fetch(user, options)\n .then(response => response.json())\n .then(data => {\n // Cycles through all the followers.\n for (let i = 0; i < data.following.length; i++) {\n searchFollowing(data.following[i], options, searchRequest);\n }\n });\n}", "title": "" }, { "docid": "e78344fd7fedd4b406fbca48bb97c774", "score": "0.6401703", "text": "function userSearch(){\n email= location.search.split('email=')[1];\n $.ajax({\n url: `https://ltv-data-api.herokuapp.com/api/v1/records.json?email=${email}`,\n cache: false,\n contentType: false,\n processData: false,\n method: 'GET',\n type: 'GET',\n success: function(data){\n $(\".spinner-div\").hide();\n\n if(Object.keys(data).length === 0){\n $(\"#number-results\").text(\"0 Results\");\n $(\"#results-desc\").text(descNoResults);\n $(\".results-container-user\").css(\"padding-top\", \"15em\");\n $(\".results-container-user\").css(\"padding-bottom\", \"15em\");\n }else{\n $(\"#number-results\").text(\"1 Result\");\n $(\"#results-desc\").text(descResults);\n \n $(\"#info-displayed\").append(`\n <h3>${data.first_name} ${data.last_name}, 35</h3>\n <p>${data.description}</p>\n <div class=\"row\">\n <div class=\"col-lg-6 col-md-6\">\n <h4>Address</h4>\n <p>${data.address}</p>\n\n <h4>Email</h4>\n <p>${data.email}</p>\n </div>\n <div class=\"col-lg-6 col-md-6\">\n <h4>Phone Numbers</h4>\n <div class=\"phone-numbers-list\">\n ${Object.keys(data.phone_numbers).map(function (key) {\n return \"<p>\" + data.phone_numbers[key] + \"</p>\" \n }).join(\"\")}\n </div>\n \n\n <h4>Relatives</h4>\n ${Object.keys(data.relatives).map(function (key) {\n return \"<p>\" + data.relatives[key] + \"</p>\" \n }).join(\"\")}\n </div>\n </div>\n `);\n\n $(\".user-information\").show();\n\n }\n\n $(\".results-container-user\").show();\n $(\".search-container-results\").show();\n \n }\n });\n}", "title": "" }, { "docid": "fa12912718b9b9dfd68e3bd0564cad48", "score": "0.6397877", "text": "function searchBarSubmitValue()\n{\n let searchValue = select(\"#searchField\");\n let searchString = searchValue.value();\n console.log(\"/testing/\"+searchString);\n fullScreenLayover.hide();\n loader.show();\n mainGrid.clear();\n fullScreenLayover.clearDots();\n loadJSON(\"/testing/\"+searchString,on_loadJson,on_notLoadJson);\n\n}", "title": "" }, { "docid": "8264b6bebb47ec5c36bd4392a17abe8e", "score": "0.6396921", "text": "handleSearchKeyword() {\n console.log('Inside Search Click');\n\t\t\t\t// endpoint URL\n //let endpointURL = 'https://www.goodreads.com/search/index.xml?' \n //+'key=2ZI3MEgz3oVj6v6h0nCTZA'+'&q=' + this.searchValue ;\n\t\t\t\t //console.log('endpointURL'+endpointURL);\n if (this.searchValue !== '') {\n\t\t\t\t\t\tconsole.log('Search Value '+this.searchValue);\n searchGoodReadBooks({searchStr : this.searchValue})\n .then(result => {\n // set @track contacts variable with return contact list from server \n this.matchingBookList = result;\n\t\t\t\t\t\t\t\t\t\tconsole.log('jsonResponse ===> '+ result);\n\t\t\t\t\t\t\t\t\t\tconsole.log('jsonResponse ===> '+ result.data);\n })\n .catch(error => {\n const event = new ShowToastEvent({\n title: 'Error',\n variant: 'error',\n message: 'Data Not Present',\n });\n this.dispatchEvent(event);\n // reset Books var with null \n this.matchingBookList = null;\n });\n } else {\n // fire toast event if input field is blank\n const event = new ShowToastEvent({\n variant: 'error',\n message: 'Search text missing..',\n });\n this.dispatchEvent(event);\n }\n }", "title": "" }, { "docid": "b637f52b05843821c92f75989f033107", "score": "0.6396765", "text": "function handleSearch(event) {\n event.preventDefault();\n\n var searchText = document.getElementById('searchtext').value;\n console.log('handleSearch', searchText);\n\n var stringTokens = searchText.split(' ');\n for (var index = 0; index < stringTokens.length; index++) {\n doSearch(stringTokens[index]);\n }\n}", "title": "" }, { "docid": "b835625be0f242654dbfef6c98bdee5e", "score": "0.63964057", "text": "function handleSubmit() {\n $('#exercise-form').submit( event => {\n event.preventDefault();\n const userTerm = $('#search-field').val();\n getTerm(userTerm);\n \n });\n}", "title": "" }, { "docid": "c131970831270a9a8285d513e3294801", "score": "0.6394105", "text": "function search() {\n document.querySelector('#searchResults').innerHTML = ''\n var searchTerm = document.querySelector('#search_input').value\n\n fetch('http://thinksaydo.com/tiyproxy.php?url=' + encodeURIComponent('https://openapi.etsy.com/v2/listings/active?api_key=h9oq2yf3twf4ziejn10b717i&keywords=' + encodeURIComponent(searchTerm) + '&includes=Images,Shop'))\n .then(response => response.json())\n .then(response => createResultCard(response.results))\n}", "title": "" }, { "docid": "32a5509fcb53155209c8260a2a6a8e46", "score": "0.6391724", "text": "function search() {\n axios.get(props.url + \"/search?net_id=\" + id).then((response) => {\n setResult(response.data[0])\n });\n }", "title": "" }, { "docid": "241d9a4bb59fb8a4a7a2ce63b0350492", "score": "0.6388494", "text": "search() {\n\n }", "title": "" }, { "docid": "756d6353c84475d340ba774235482b69", "score": "0.63826996", "text": "async function handleSubmit(event) {\n // prevent page from reloading when form is submitted\n event.preventDefault();\n // Get the value of the input\n const inputValue = document.querySelector(\".js-search-input\").value;\n // Remove the whitespace and tabs from the input\n const searchQuery = inputValue.trim();\n // Clear the previous results\n searchResults.innerHTML = \"\";\n // Remove hidden class from spinner element\n spinner.classList.remove(\"hidden\");\n try {\n // Get the results from the API\n const results = await searchWikipedia(searchQuery);\n // If there is no results\n if (results.query.searchinfo.totalhits === 0) {\n alert(\"No results found. Try different keywords\");\n return;\n }\n // Display the results of the search by the aid of the function\n displayResults(results);\n } catch (err) {\n console.log(err);\n alert(\"Failed to search Wikipedia!\");\n } finally {\n // Add hidden class to spinner element\n spinner.classList.add(\"hidden\");\n }\n}", "title": "" }, { "docid": "5d2b444ee0aa7ca59d84e0e164dac0ac", "score": "0.63768685", "text": "function spotifySearch(userInput) {\n \n const songName = userInput;\n \n \n spotify.search({ type: 'track', query: songName, limit: 5 }, function(err, data) {\n if (err) {\n return console.log(err);\n }\n // log data about the song passed as an argument or 'The Sign' as default\n if (songName) {\n console.log(`The artist is: ${data.tracks.items[0].artists[0].name}`); \n console.log(`The song is: ${data.tracks.items[0].name}`);\n console.log(`The album is: ${data.tracks.items[0].album.name}`);\n console.log(`You can listen at: ${data.tracks.items[0].external_urls.spotify}`);\n } else {\n console.log('Something went wrong')\n }\n });\n}", "title": "" }, { "docid": "55a871ebba56fbec16b5131976af0ebd", "score": "0.637619", "text": "function search(event) {\n const value = event.target.value;\n setState(value);\n setStateCategory(\"\");\n const searched = searchFor(value, \"title\", notes);\n if (searched.length > 0) {\n setMainData(searched);\n }\n if (value.length === 0) {\n setMainData(notes);\n }\n }", "title": "" }, { "docid": "b5820c080ac6985446cc920c536feaaa", "score": "0.63744015", "text": "function results_search() {\n var val = val_cur = input.val(),\n my_req_num = req_num += 1;\n if(!val || val.length < 2) return;\n $.ajax({ url: \"https://graph.facebook.com/\" + val })\n .done(function(results) { results_parse(results, val, my_req_num); });\n }", "title": "" }, { "docid": "e381a25810f85b597eeb4974d08cdfde", "score": "0.6374116", "text": "function getInputField() { //this function take value, which user write in input field\n document.getElementById('searchSubmit').addEventListener('click', function (event) {\n weatherApp.searchField = document.getElementById('searchField');\n weatherApp.query = \"http://api.openweathermap.org/data/2.5/weather?q=\"+weatherApp.searchField.value+\"&units=metric&APPID=\"+weatherApp.key; // make query\n $.getJSON(weatherApp.query, function (weather) {\n weatherApp.mainName = weather.name; // get city name\n weatherApp.mainCountry = weather.sys.country; // get country\n weatherApp.mainTemp = weather.main.temp; // get temperature\n weatherApp.mainWeather = weather.weather[0].description; // get weather (cloudy, rainy etc.)\n console.log(weatherApp.mainName, ' ', weatherApp.mainCountry, ' ', weatherApp.mainTemp, ' ', weatherApp.mainWeather);\n insertData(weatherApp.mainName, weatherApp.mainCountry, weatherApp.mainTemp, weatherApp.mainWeather);\n });\n });\n}", "title": "" }, { "docid": "f153692729eeea7fc5d1fc686908271e", "score": "0.63726026", "text": "function search() {\t\t\t\t\n\t\t\tconsole.log(\"search()\");\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n //stDeleteProperties();\n\n\t\t\tAssaySearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t vm.results = data;\n\t\t\t vm.selectedIndex = 0;\n\t\t\t if (vm.results.length > 0) {\n\t\t\t\t loadObject();\n\t\t\t }\n // do not clear entire form if no results are returned\n\t\t\t else {\n\t\t vm.results = [];\n\t\t vm.selectedIndex = -1;\n\t\t\t\t //clear();\n\t\t\t }\n\t\t pageScope.loadingEnd();\n\t\t setFocus();\n\t\t }, function(err) {\n\t\t\t pageScope.handleError(vm, \"API ERROR: AssaySearchAPI.search\");\n\t\t pageScope.loadingEnd();\n\t\t setFocus();\n\t\t });\n\t\t}", "title": "" }, { "docid": "b75257a4c356b8028d5035cc365f526a", "score": "0.6372485", "text": "function searchInput(event) {\n event.preventDefault();\n let city = document.querySelector(\"#search-input\").value;\n searchCity(city);\n}", "title": "" }, { "docid": "cada61faf5aeb9db1acddfe3156ede82", "score": "0.6363215", "text": "function clickable_info(toSearch){\n document.getElementById(\"search-query-value\").value=toSearch.data.par;\n SearchLogic();\n }", "title": "" }, { "docid": "69505370a72c265f005fc7536ff5762c", "score": "0.6362516", "text": "function doSearch() {\n var keyword = $search.val();\n api.getReposSearch(keyword, doResults);\n }", "title": "" }, { "docid": "1c6e57d7347c1aec76728c31cf6db2b2", "score": "0.63619477", "text": "async function fetchSearchData(userInput) {\n try {\n const url = `https://cors-anywhere.herokuapp.com/https://itunes.apple.com/search?media=music&term=${userInput}&limit=60`;\n const response = await axios.get(url);\n const data = response.data.results;\n showSearchResults(data);\n } catch (error) {\n console.log(`Error: ${error}`);\n }\n}", "title": "" }, { "docid": "0927d79024e068efe58397b1f086c7c5", "score": "0.6355926", "text": "function search () {\n var searchText = $('#searchText').val();\n searchExperience(searchText);\n }", "title": "" }, { "docid": "9bbfec99dc9fd753373971e4c8677cad", "score": "0.63549596", "text": "function handleSearch(event) {\n event.preventDefault();\n // console.log('click', event)\n const query = searchQuery(searchValue)\n console.log(query)\n history.push(`/search/${query}`);\n setLoading((prev) => !prev)\n }", "title": "" }, { "docid": "f8ab6d0374d323995c92403badd9a9c3", "score": "0.63548356", "text": "async search(SelectedPage, MaxNumberPerItemsPage) {\n /// if the selected values are null then set them to their\n /// default values\n if (!(SelectedPage == null))\n this.state.SelectedPage = SelectedPage;\n if (!(MaxNumberPerItemsPage == null))\n this.state.MaxNumberPerItemsPage = MaxNumberPerItemsPage;\n let searchVal = GetAllRecords;\n if (this.state.searchValue != null && this.state.searchValue != '')\n searchVal = this.state.searchValue;\n\n /// call the api action with the necessary variables\n /// to get a list of intended Users\n await this.props.getUsers(\n /// values need for search functionality\n /// to work on the server\n this.state.SelectedPage,\n this.state.MaxNumberPerItemsPage,\n searchVal,\n this.state.filterRoleValue,\n // call back method from the action after the call ends\n ((result) => {\n /// if there are any errors set the alert list to it\n if (result.errors.length > 0) {\n this.setState({ alertList: result.errors });\n return;\n }\n /// else there are no errors so set the user list and total count number of the request\n this.setState({ userList: result.userList, listTotalCount: result.totalCount });\n }).bind(this));\n }", "title": "" }, { "docid": "798a525d1cc8b7bba79276a9eba0872f", "score": "0.63492113", "text": "function search_click(){\n var query_name = document.getElementById(eventType + \"_input\");\n console.log(\"in btn :\" + eventType);\n if (query_name.value){\n console.log(query_name.value);\n console.log(\"send_request\");\n send_request(query_name.value.toUpperCase());\n }\n else alert(\"type the name\");\n\n}", "title": "" }, { "docid": "6730afabca9ac3b175c8cd0ae45c00c7", "score": "0.6347916", "text": "handleSubmit(event) {\n this.fetch(\"search\", this.state.input);\n event.preventDefault();\n }", "title": "" }, { "docid": "2bae5ef45c790c789aa4f397f3597c13", "score": "0.6346019", "text": "function getAllSearchedItems() {\n var searchInput = document.getElementById(\"searchbar\").value;\n ModelController.SearchDatabase(searchInput, onSearchItems);\n}", "title": "" }, { "docid": "601bb88709fb34e381eacca53ed380fb", "score": "0.6345926", "text": "async searchByInput(){\n let resultElem = document.getElementById('search-results');\n let msg = document.getElementById('search-field').value;\n if(msg == \"\"){ // Return no results if query is empty\n resultElem.innerHTML = \"\";\n return;\n }\n let data = await this._pullData();\n // Filter by input text\n data = data.filter(entry => entry.commit.message.includes(msg));\n if(data.length == 0){\n resultElem.innerHTML = 'No matching message found';\n } else { // Show every matching result as a hyperlink inside results div.\n resultElem.innerHTML = '';\n data.map(entry => {\n let curNode = document.createElement('div');\n let link = document.createElement('a');\n let linkText = document.createTextNode(entry.commit.message);\n link.href = entry.html_url;\n link.target = '_blank';\n link.appendChild(linkText);\n curNode.appendChild(link);\n resultElem.appendChild(curNode);\n resultElem.appendChild(document.createElement('br'));\n });\n }\n }", "title": "" }, { "docid": "02b46511a5cbc95175724e09331ddce1", "score": "0.6344028", "text": "function search(projectKey) {\n console.log(projectKey);\n AP.context.getToken(function(token) {\n let sku = document.getElementById(\"sku\").value;\n resetSearch();\n let request = new XMLHttpRequest();\n let endpoint = '/tagSearch?projectKey=' + projectKey + \"&sku=\" + sku;\n request.open('GET', endpoint);\n request.setRequestHeader(\"Authorization\", \"JWT \" + token)\n request.send();\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n document.getElementById('results').innerHTML = request.responseText;\n }\n };\n });\n}", "title": "" }, { "docid": "d18a02db861b88859a9fb090b19d8566", "score": "0.634342", "text": "searchHandler(event) {\n this.setSearch(event.target.value);\n this.searchFilter(event.target.value, this.state.databaseLimit);\n }", "title": "" }, { "docid": "c13c53643c091d8646fd8c60f1a299d2", "score": "0.6339943", "text": "async function handleSubmit(event){\n \n // prevent page from reloading when form is submitted\nevent.preventDefault();\n\n //get the value of the input field\n const inputValue = document.querySelector('.js-search-input').value;\n \n //remove whitespace from the input and save it to new variable \n const searchQuery = inputValue.trim();\n console.log(searchQuery);\n \n try{\n\n //created a variable, which saves result of 'search query'\n const results = await searchWikipedia(searchQuery);\n displayResults(results);\n console.log(results);\n } \n \n catch(err){\nconsole.log(err);\n alert('failed to search on wiki');\n }\n}", "title": "" } ]
9eb99327ebe6dfabc479f5f6122554bc
Return a function that can categorize strings (expected to represent a single [grapheme cluster]( into one of: Word (contains an alphanumeric character or a character explicitly listed in the local language's `"wordChars"` language data, which should be a string) Space (contains only whitespace) Other (anything else)
[ { "docid": "887fa526832ef7bbeea002d8594d8c56", "score": "0.60321903", "text": "charCategorizer(at) {\n return makeCategorizer(this.languageDataAt(\"wordChars\", at).join(\"\"));\n }", "title": "" } ]
[ { "docid": "c953ac3372daabe03c0fca84724bd99a", "score": "0.72885156", "text": "function category(word) {\n if (isWhitespace(word)) {\n return 'whitespace';\n } else if (isLetter(word)) {\n return 'letter';\n } else if (isNumber(word)) {\n return 'number';\n } else {\n return 'misc';\n }\n}", "title": "" }, { "docid": "49e0b86e7bd6826bf4c6c50e3fa58f41", "score": "0.64461094", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function quote(word) {\n return JSON.stringify(word).replace(/[\\u2028\\u2029]/g, function(s) {\n switch (s) {\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n }\n return s;\n });\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + quote(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + quote(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "1a98dc4a221badd2451800d39f234fa8", "score": "0.6321124", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "1a98dc4a221badd2451800d39f234fa8", "score": "0.6321124", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "1a98dc4a221badd2451800d39f234fa8", "score": "0.6321124", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "1a98dc4a221badd2451800d39f234fa8", "score": "0.6321124", "text": "function makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "83774bb93638fd85116687170c8624ef", "score": "0.6284451", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length === words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length === 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "df2266be0124946ccfbb8bcf6558fa6e", "score": "0.6266808", "text": "function makePredicate(words){if(!(words instanceof Array))words = words.split(\" \");var f=\"\",cats=[];out: for(var i=0;i < words.length;++i) {for(var j=0;j < cats.length;++j) if(cats[j][0].length == words[i].length){cats[j].push(words[i]);continue out;}cats.push([words[i]]);}function compareTo(arr){if(arr.length == 1)return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";f += \"switch(str){\";for(var i=0;i < arr.length;++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";f += \"return true}return false;\";} // When there are more than three length categories, an outer\n// switch first dispatches on the lengths, to save on comparisons.\nif(cats.length > 3){cats.sort(function(a,b){return b.length - a.length;});f += \"switch(str.length){\";for(var i=0;i < cats.length;++i) {var cat=cats[i];f += \"case \" + cat[0].length + \":\";compareTo(cat);}f += \"}\"; // Otherwise, simply generate a flat `switch` statement.\n}else {compareTo(words);}return new Function(\"str\",f);}", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f79262be1b911b9e0ab9b02c6c5216b3", "score": "0.62659895", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n // Otherwise, simply generate a flat `switch` statement.\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n }", "title": "" }, { "docid": "f6d0d135c5ecdcf46e9a8ebf48f4bcf9", "score": "0.62159765", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\",\n cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j) {\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n }cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) {\n return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n }f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) {\n f += \"case \" + JSON.stringify(arr[i]) + \":\";\n }f += \"return true}return false;\";\n }\n\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n\n if (cats.length > 3) {\n cats.sort(function (a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\"\n\n // Otherwise, simply generate a flat `switch` statement.\n\n ;\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "7c688479098d3bc4d73a3e5a03c78b7a", "score": "0.6214373", "text": "function categorizeChars(token) {\n return token.replace(/[^aeiouy]y/g, 'CV').replace(/[aeiou]/g, 'V').replace(/[^V]/g, 'C');\n}", "title": "" }, { "docid": "82377298fec9ba2e74f371e027c3bcb5", "score": "0.61849403", "text": "function categorizeGroups(token) {\n return token.replace(/[^aeiouy]+y/g, 'CV').replace(/[aeiou]+/g, 'V').replace(/[^V]+/g, 'C');\n}", "title": "" }, { "docid": "97852590dad73bcf6e7dc3701d23ae31", "score": "0.615699", "text": "function makePredicate(words) {\n\t words = words.split(\" \");\n\t var f = \"\",\n\t cats = [];\n\t out: for (var i = 0; i < words.length; ++i) {\n\t for (var j = 0; j < cats.length; ++j) if (cats[j][0].length == words[i].length) {\n\t cats[j].push(words[i]);\n\t continue out;\n\t }\n\t cats.push([words[i]]);\n\t }\n\t function compareTo(arr) {\n\t if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n\t f += \"switch(str){\";\n\t for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n\t f += \"return true}return false;\";\n\t }\n\n\t // When there are more than three length categories, an outer\n\t // switch first dispatches on the lengths, to save on comparisons.\n\n\t if (cats.length > 3) {\n\t cats.sort(function (a, b) {\n\t return b.length - a.length;\n\t });\n\t f += \"switch(str.length){\";\n\t for (var i = 0; i < cats.length; ++i) {\n\t var cat = cats[i];\n\t f += \"case \" + cat[0].length + \":\";\n\t compareTo(cat);\n\t }\n\t f += \"}\";\n\n\t // Otherwise, simply generate a flat `switch` statement.\n\t } else {\n\t compareTo(words);\n\t }\n\t return new Function(\"str\", f);\n\t }", "title": "" }, { "docid": "a69296a3dc7f953fea8a94b6bbe2d9db", "score": "0.5997949", "text": "function makePredicate(words) {\n words = words.split(\" \");\n var f = \"\",\n cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n\n if (cats.length > 3) {\n cats.sort(function(a, b) {\n return b.length - a.length;\n });\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n}", "title": "" }, { "docid": "9ab29e1cc95069f53708a877e0e87f99", "score": "0.58192015", "text": "function getWord() {\n var a = new Array('abate','aberrant','abscond','accolade','acerbic','acumen','adulation','adulterate','aesthetic','aggrandize','alacrity','alchemy','amalgamate','ameliorate','amenable','anachronism','anomaly','approbation','archaic','arduous','ascetic','assuage','astringent','audacious','austere','avarice','aver','axiom','bolster','bombast','bombastic','bucolic','burgeon','cacophony','canon','canonical','capricious','castigation','catalyst','caustic','censure','chary','chicanery','cogent','complaisance','connoisseur','contentious','contrite','convention','convoluted','credulous','culpable','cynicism','dearth','decorum','demur','derision','desiccate','diatribe','didactic','dilettante','disabuse','discordant','discretion','disinterested','disparage','disparate','dissemble','divulge','dogmatic','ebullience','eccentric','eclectic','effrontery','elegy','eloquent','emollient','empirical','endemic','enervate','enigmatic','ennui','ephemeral','equivocate','erudite','esoteric','eulogy','evanescent','exacerbate','exculpate','exigent','exonerate','extemporaneous','facetious','fallacy','fawn','fervent','filibuster','flout','fortuitous','fulminate','furtive','garrulous','germane','glib','grandiloquence','gregarious','hackneyed','halcyon','harangue','hedonism','hegemony','heretical','hubris','hyperbole','iconoclast','idolatrous','imminent','immutable','impassive','impecunious','imperturbable','impetuous','implacable','impunity','inchoate','incipient','indifferent','inert','infelicitous','ingenuous','inimical','innocuous','insipid','intractable','intransigent','intrepid','inured','inveigle','irascible','laconic','laud','loquacious','lucid','luminous','magnanimity','malevolent','malleable','martial','maverick','mendacity','mercurial','meticulous','misanthrope','mitigate','mollify','morose','mundane','nebulous','neologism','neophyte','noxious','obdurate','obfuscate','obsequious','obstinate','obtuse','obviate','occlude','odious','onerous','opaque','opprobrium','oscillation','ostentatious','paean','parody','pedagogy','pedantic','penurious','penury','perennial','perfidy','perfunctory','pernicious','perspicacious','peruse','pervade','pervasive','phlegmatic','pine','pious','pirate','pith','pithy','placate','platitude','plethora','plummet','polemical','pragmatic','prattle','precipitate','precursor','predilection','preen','prescience','presumptuous','prevaricate','pristine','probity','proclivity','prodigal','prodigious','profligate','profuse','proliferate','prolific','propensity','prosaic','pungent','putrefy','quaff','qualm','querulous','query','quiescence','quixotic','quotidian','rancorous','rarefy','recalcitrant','recant','recondite','redoubtable','refulgent','refute','relegate','renege','repudiate','rescind','reticent','reverent','rhetoric','salubrious','sanction','satire','sedulous','shard','solicitous','solvent','soporific','sordid','sparse','specious','spendthrift','sporadic','spurious','squalid','squander','static','stoic','stupefy','stymie','subpoena','subtle','succinct','superfluous','supplant','surfeit','synthesis','tacit','tenacity','terse','tirade','torpid','torque','tortuous','tout','transient','trenchant','truculent','ubiquitous','unfeigned','untenable','urbane','vacillate','variegated','veracity','vexation','vigilant','vilify','virulent','viscous','vituperate','volatile','voracious','waver','zealous');\n return a[parseInt(Math.random()* a.length)];\n}", "title": "" }, { "docid": "e470568ea42cb4184e8ce68825123e8f", "score": "0.570355", "text": "function wordCloudMap(text) {\n const cloud = new Map();\n let wordStartIndex = 0;\n let wordLength = 0;\n\n for (let index = 0; index < text.length; index += 1) {\n const char = text[index].toLowerCase();\n if (char >= \"a\" && char <= \"z\") {\n if (wordLength === 0) {\n wordStartIndex = index;\n }\n wordLength += 1;\n } else if ((char === \"-\" || char === \"'\") && wordLength > 0) {\n wordLength += 1;\n } else if (wordLength > 0) {\n const word = text\n .slice(wordStartIndex, wordStartIndex + wordLength)\n .toLowerCase();\n cloud.set(word, (cloud.get(word) || 0) + 1)\n wordStartIndex += wordLength;\n wordLength = 0;\n }\n\n if (index === text.length - 1 && wordLength > 0) {\n const word = text\n .slice(wordStartIndex, wordStartIndex + wordLength)\n .toLowerCase();\n cloud.set(word, (cloud.get(word) || 0) + 1)\n }\n }\n \n return cloud;\n}", "title": "" }, { "docid": "5f6b6d4a2f99a77aa8bee5f7b3dfe577", "score": "0.56730586", "text": "function makePredicate(words){words=words.split(\" \");return function(str){return words.indexOf(str)>=0;};}// Reserved word lists for various dialects of the language", "title": "" }, { "docid": "611231d8f53b5be565d5c04bf031aa6d", "score": "0.566499", "text": "correctCategory(category) {\n function stringHasSubstring(str, substr) {\n if (!str || !substr)\n return\n let returnVar = false;\n for(let i = 0; i < str.length; i++){\n if(str[i].toLowerCase().includes(substr.toLowerCase()))\n returnVar = true;\n }\n return returnVar \n }\n\n return function (element) {\n const keywords = getTagsForCategory(category);\n return keywords.filter(kw => stringHasSubstring(element.tags, kw)).length ? element : null\n }\n\n }", "title": "" }, { "docid": "784cfec9d79a5194bd127635a0a46e53", "score": "0.56255776", "text": "function string_of_category(param) {\n switch (param) {\n case 0 : \n return \"animal\";\n case 1 : \n return \"career\";\n case 2 : \n return \"celebrity\";\n case 3 : \n return \"dev\";\n case 4 : \n return \"fashion\";\n case 5 : \n return \"food\";\n case 6 : \n return \"history\";\n case 7 : \n return \"money\";\n case 8 : \n return \"music\";\n case 9 : \n return \"political\";\n case 10 : \n return \"religion\";\n case 11 : \n return \"science\";\n case 12 : \n return \"sport\";\n case 13 : \n return \"travel\";\n \n }\n}", "title": "" }, { "docid": "6ecc4077a7155f6dad2cb89e76dbdd56", "score": "0.54844666", "text": "function categorize(data, keywords) {\n // let categories = new Object()\n let category \n\n `${data.title} ${data.snippet}`.toLowerCase().split(' ').forEach(word => {\n\n // the first word that shows up in keywords is the category\n let pureWord = word.replace(/[^a-z]/gi, '');\n if(pureWord in keywords){\n category =({\n id: 1,\n name: pureWord,\n type: 'category',\n })\n };\n })\n //find the most common category in a snippet\n// category = Object.keys(categories).reduce((accumulator, key) => {\n// return category[key] > category[accumulator]\n// }); \n\n return category\n}", "title": "" }, { "docid": "062156c71a82b48da82ca8da77c3cc49", "score": "0.5426203", "text": "function categorizeByEmotions(wordList) {\n var wordsCategorizedByEmotion = EMOTIONS.reduce(function (filteredWords, emotion) {\n if (!filteredWords[emotion]) {\n filteredWords[emotion] = [];\n }\n filteredWords[emotion].push(filterWordsForEmotion(wordList, emotion));\n return filteredWords;\n }, {});\n return wordsCategorizedByEmotion;\n}", "title": "" }, { "docid": "db831b43435c14ddd1f84f172058201f", "score": "0.54240364", "text": "function tokenize(code){\r\n\tvar i=-1,c,isAlpha,isDigit,whitespace;\r\n\t\r\n\tfunction next(){\r\n\t\ti++;\r\n\t\tc=code.charAt(i);\r\n\t\t//woah woah calm down don't worry I'm not some idiot who uses apostrophe strings...\r\n\t\t//These are single CHARACTERS (that is, in a language that has a char type, these should be chars and not strings)\r\n\t\tisAlpha=(c>='A'&&c<='Z'||c>='a'&&c<='z');\r\n\t\tisDigit=(c>='0'&&c<='9');\r\n\t}\r\n\t\r\n\tfunction jump(pos){\r\n\t\ti=pos-1;\r\n\t\tnext();\r\n\t}\r\n\t\r\n\tvar prev=0;\r\n\tfunction pushWord(){\r\n\t\tvar start=prev;\r\n\t\tprev=i;\r\n\t\tvar upper=code.substring(whitespace,i).toUpperCase();\r\n\t\tvar type;\r\n\t\t//bitwise not\r\n\t\tif(upper===\"NOT\")\r\n\t\t\ttype=\"unary\";\r\n\t\t//word operators\r\n\t\telse if(upper===\"DIV\"||upper===\"MOD\"||upper===\"AND\"||upper===\"OR\"||upper===\"XOR\")\r\n\t\t\ttype=\"operator\";\r\n\t\t//true/false\r\n\t\telse if(upper===\"TRUE\"||upper===\"FALSE\")\r\n\t\t\ttype=\"number\";\r\n\t\t//other keyword\r\n\t\telse if(KEYWORDS.indexOf(upper)!==-1)\r\n\t\t\ttype=upper;\r\n\t\t//not a keyword\r\n\t\telse\r\n\t\t\ttype=\"word\";\r\n\t\treturn {type:type,text:code.substring(start,i),word:upper};\r\n\t}\r\n\t\r\n\t\r\n\tfunction push(type){\r\n\t\tvar start=prev;\r\n\t\tprev=i;\r\n\t\treturn {type:type,text:code.substring(start,i)};\r\n\t}\r\n\t\r\n\tnext();\r\n\treturn function(){\r\n\t\t//read whitespace\r\n\t\twhile(c===\" \"||c===\"\\t\")\r\n\t\t\tnext();\r\n\t\t//if this is the end, push a special ending token\r\n\t\tif(c==='')\r\n\t\t\treturn push(\"eof\");\r\n\t\t//store the start of the non-whitespace\r\n\t\twhitespace=i;\r\n\t\t//\"word\" (keywords, functions, variables)\r\n\t\tif(isAlpha||c==='_'){\r\n\t\t\tnext();\r\n\t\t\twhile(isAlpha||isDigit||c==='_')\r\n\t\t\t\tnext();\r\n\t\t\tif(c==='#'||c==='%'||c==='$'){\r\n\t\t\t\tnext();\r\n\t\t\t\t//return push(\"word\");\r\n\t\t\t}\r\n\t\t\treturn pushWord();\r\n\t\t//numbers\r\n\t\t}else if(isDigit||c==='.'){\r\n\t\t\twhile(isDigit)\r\n\t\t\t\tnext();\r\n\t\t\tif(c==='.'){\r\n\t\t\t\tnext();\r\n\t\t\t\tif(isDigit){\r\n\t\t\t\t\tnext();\r\n\t\t\t\t\twhile(isDigit)\r\n\t\t\t\t\t\tnext();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(c==='#')\r\n\t\t\t\t\t\tnext();\r\n\t\t\t\t\treturn push(\"number\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(c==='E'||c==='e'){\r\n\t\t\t\tvar ePos=i;\r\n\t\t\t\tnext();\r\n\t\t\t\tif(c==='+'||c==='-')\r\n\t\t\t\t\tnext();\r\n\t\t\t\tif(isDigit){\r\n\t\t\t\t\tnext();\r\n\t\t\t\t\twhile(isDigit)\r\n\t\t\t\t\t\tnext();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tjump(ePos);\r\n\t\t\t\t\treturn push(\"error\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(c==='#')\r\n\t\t\t\tnext();\r\n\t\t\treturn push(\"number\");\r\n\t\t}else switch(c){\r\n\t\t//strings\r\n\t\tcase '\"':\r\n\t\t\tnext();\r\n\t\t\twhile(c && c!=='\"' && c!=='\\n' && c!=='\\r')\r\n\t\t\t\tnext();\r\n\t\t\tif(c==='\"')\r\n\t\t\t\tnext();\r\n\t\t\treturn push(\"string\");\r\n\t\t//comments\r\n\t\tbreak;case '\\'':\r\n\t\t\tnext();\r\n\t\t\twhile(c && c!=='\\n' && c!=='\\r')\r\n\t\t\t\tnext();\r\n\t\t\treturn push(\"comment\");\r\n\t\t//logical AND, hexadecimal, binary\r\n\t\tbreak;case '&':\r\n\t\t\tnext();\r\n\t\t\tswitch(c){\r\n\t\t\t\tcase '&':\r\n\t\t\t\t\tnext();\r\n\t\t\t\t\treturn push(\"operator\");\r\n\t\t\t\tbreak;case 'H':case 'h':\r\n\t\t\t\t\tvar hPos=i;\r\n\t\t\t\t\tnext();\r\n\t\t\t\t\tif(isDigit||c>='A'&&c<='F'||c>='a'&&c<='f'){\r\n\t\t\t\t\t\tnext();\r\n\t\t\t\t\t\twhile(isDigit||c>='A'&&c<='F'||c>='a'&&c<='f')\r\n\t\t\t\t\t\t\tnext();\r\n\t\t\t\t\t\treturn push(\"number\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tjump(hPos);\r\n\t\t\t\t\treturn push(\"error\");\r\n\t\t\t\tbreak;case 'B':case 'b':\r\n\t\t\t\t\tvar bPos=i;\r\n\t\t\t\t\tnext();\r\n\t\t\t\t\tif(c==='0'||c==='1'){\r\n\t\t\t\t\t\tnext();\r\n\t\t\t\t\t\twhile(c==='0'||c==='1')\r\n\t\t\t\t\t\t\tnext();\r\n\t\t\t\t\t\treturn push(\"number\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tjump(bPos);\r\n\t\t\t\t\treturn push(\"error\");\r\n\t\t\t\tbreak;default:\r\n\t\t\t\t\treturn push(\"error\");\r\n\t\t\t}\r\n\t\t//labels\r\n\t\tbreak;case '@':\r\n\t\t\tnext();\r\n\t\t\tif(isDigit||isAlpha||c===\"_\"){\r\n\t\t\t\tnext();\r\n\t\t\t\twhile(isDigit||isAlpha||c===\"_\")\r\n\t\t\t\t\tnext();\r\n\t\t\t\treturn push(\"label\");\r\n\t\t\t}\r\n\t\t\treturn push(\"error\");\r\n\t\t//constants\r\n\t\tbreak;case '#':\r\n\t\t\tnext();\r\n\t\t\tif(isDigit||isAlpha){\r\n\t\t\t\tnext();\r\n\t\t\t\twhile(isDigit||isAlpha)\r\n\t\t\t\t\tnext();\r\n\t\t\t\treturn push(\"number\");\r\n\t\t\t}\r\n\t\t\treturn push(\"error\");\r\n\t\t//logical or\r\n\t\tbreak;case '|':\r\n\t\t\tnext();\r\n\t\t\tif(c==='|'){\r\n\t\t\t\tnext();\r\n\t\t\t\treturn push(\"operator\");\r\n\t\t\t}\r\n\t\t\treturn push(\"error\");\r\n\t\t//less than, less than or equal, left shift\r\n\t\tbreak;case '<':\r\n\t\t\tnext();\r\n\t\t\tif(c==='='||c==='<')\r\n\t\t\t\tnext();\r\n\t\t\treturn push(\"operator\");\r\n\t\t//greater than, greater than or equal, right shift\r\n\t\tbreak;case '>':\r\n\t\t\tnext();\r\n\t\t\tif(c==='='||c==='>')\r\n\t\t\t\tnext();\r\n\t\t\treturn push(\"operator\");\r\n\t\t//equal, equal more\r\n\t\tbreak;case '=':\r\n\t\t\tnext();\r\n\t\t\tif(c==='='){\r\n\t\t\t\tnext();\r\n\t\t\t\treturn push(\"operator\");\r\n\t\t\t}\r\n\t\t\treturn push(\"=\");\r\n\t\t//logical not, not equal\r\n\t\tbreak;case '!':\r\n\t\t\tnext();\r\n\t\t\tif(c==='='){\r\n\t\t\t\tnext();\r\n\t\t\t\treturn push(\"operator\");\r\n\t\t\t}\r\n\t\t\treturn push(\"unary\");\r\n\t\tbreak;case '-':\r\n\t\t\tnext();\r\n\t\t\treturn push(\"minus\");\r\n\t\t//add, subtract, multiply, divide\r\n\t\tbreak;case '+':case '*':case '/':\r\n\t\t\tnext();\r\n\t\t\treturn push(\"operator\");\r\n\t\t//other\r\n\t\tbreak;case '\\n':case '\\r':\r\n\t\t\tnext();\r\n\t\t\treturn push(\"linebreak\");\r\n\t\t//characters\r\n\t\tbreak;case '(':case ')':case '[':case ']':case ',':case ';':case ':':\r\n\t\t\tvar chr=c;\r\n\t\t\tnext();\r\n\t\t\treturn push(chr);\r\n\t\t//print shortcut\r\n\t\tbreak;case '?':\r\n\t\t\tnext();\r\n\t\t\treturn push(\"PRINT\");\r\n\t\t//other\r\n\t\tbreak;default:\r\n\t\t\tnext();\r\n\t\t\treturn push(\"text\");\r\n\t\t}\r\n\t};\r\n}", "title": "" }, { "docid": "559918929f7db9f10d9d5c30a4a38e42", "score": "0.53854483", "text": "function categorize(type) {\n var result;\n\n property.forEach(function(t) {\n if( type == t) { result = \"property\"; }\n });\n violent.forEach(function(t) {\n if( type == t) { result = \"violent\"; }\n });\n rape.forEach(function(t) {\n if( type == t) { result = \"rape\"; }\n });\n homicide.forEach(function(t) {\n if( type == t) { result = \"homicide\"; }\n });\n gun.forEach(function(t) {\n if( type == t) { result = \"gun\"; }\n });\n\n if(!result) { result = \"other\"; }\n\n return result;\n }", "title": "" }, { "docid": "028b20105d4c9b8f2ff131068639c54d", "score": "0.53810734", "text": "function words(str) {\n let container = str.toLowerCase().split(' ');\n // trim all misc. characters off words\n for (let i = 0; i < container.length; i++) {\n let word = container[i];\n if (word.charCodeAt(0) < 97 || word.charCodeAt(0) > 122) {\n container[i] = word.substring(1);\n }\n if (word.charCodeAt(word.length - 1) > 122 || word.charCodeAt(word.length - 1) < 97) {\n container[i] = word.substring(0, word.length - 1);\n }\n if (word.charCodeAt(word.length - 2) > 122 || word.charCodeAt(word.length - 2) < 97) {\n container[i] = word.substring(0, word.length - 2);\n }\n \n }\n // console.log(container);\n // Now we have an array of each word in the string, lower case and we can compare and count\n let wordCount = {};\n for (let i = 0; i < container.length; i++) {\n let word = container[i];\n if (!wordCount[word]) {\n wordCount[word] = 1;\n } else {\n wordCount[word]++;\n }\n }\n // console.log(wordCount.toString(key, value));\n let newContainer = []\n for (let [key, value] of Object.entries(wordCount)) {\n newContainer.push(`${key} = ${value}`);\n }\n let newString = newContainer.join(', ');\n console.log(newString);\n}", "title": "" }, { "docid": "677131086529203787a5e4c6ffb7db3b", "score": "0.536304", "text": "function lolspace_tokenise(str)\n{\n var tokens = [];\n var string = [];\n for (var i=0; i<str.length; i++)\n {\n var str_ = str.substr(i);\n var match = null;\n if ((match = /^A\\b/.exec(str_)))\n tokens.push('A');\n else if ( (match = (/^I HAS A(?=\\s)/.exec(str_))) )\n tokens.push('DECLARE');\n else if( (match = (/^(R|IT[SZ])(?=\\s)/.exec(str_))) )\n tokens.push('ASSIGN');\n else if( (match = (/^G[EI]MMEH(?=\\s)/.exec(str_))) )\n tokens.push('PROMPT');\n else if( (match = /^MAEK(?=\\s)/.exec(str_)) )\n tokens.push('CAST');\n \n else if( (match = /^(NOOB|YARN|NUMBR|NUMBAR|TROOF|BUKKIT)(?=\\s)/.exec(str_)) )\n tokens.push('TYPE');\n else if( (match = /^(SMALL?E?R|BIGG?E?R) THAN\\b/.exec(str_)) )\n tokens.push('CMP_OP');\n else if( (match = /^O RLY\\?/.exec(str_)) )\n tokens.push('START_IF');\n else if ( (match = /^YA RLY\\b/.exec(str_)) )\n tokens.push('IF');\n else if ( (match = /^MEBBE\\b/.exec(str_)) )\n tokens.push('ELSE_IF');\n else if ( (match = /^NO WAI\\b/.exec(str_)) )\n tokens.push('ELSE');\n else if( (match = /^OIC\\b/.exec(str_)))\n tokens.push('END_IF');\n \n else if( (match = /^AN\\b/.exec(str_)) )\n tokens.push('COMMA')\n \n else if ( (match = /^((\\-\\s*)?\\d+(\\.\\d+)?|true|false|@\\d+(!\\w+){0,2})\\b/.exec(str_)))\n tokens.push('LITERAL');\n \n // operators, oh joy\n \n else if( (match = (/^(((SUM|DIFF|PRODUKT|MOD|QUOSHUNT|BOTH|EITHER|BIGGR|SMALLR|WON) OF)|BOTH SAEM|DIFFRINT)\\b/.exec(str_))))\n tokens.push('BINARY_OP');\n \n else if( (match = (/^(ALL|ANY|CHR|ORD|LEN) OF\\b/.exec(str_))))\n tokens.push('NARY_OP');\n // bukkit assignment\n else if( (match = (/^GOT\\b/.exec(str_)) ))\n tokens.push('NARY_OP');\n \n else if( (match = (/^NOT\\b/.exec(str_))))\n tokens.push('NARY_OP');\n \n else if ( (match = /^IM IN [YU]R \\w+$/.exec(str_)))\n tokens.push('LOOP_INF');\n else if( (match = /^IM IN [YU]R [a-zA-Z]\\w+/.exec(str_)))\n tokens.push('LOOP');\n else if( (match = /^IM OUTTA [YU]R \\w+\\b/.exec(str_)))\n tokens.push('END_LOOP');\n else if( (match = /^(WILE|TILL?)\\b/.exec(str_)))\n tokens.push('LOOP_CONDITION');\n else if( (match = /^(UPPIN|NERFIN) [YU]R\\b/.exec(str_)))\n tokens.push('LOOP_ACTION');\n \n else if ( (match = /^!!*/.exec(str_)))\n tokens.push('SCREECH');\n else if ( (match = /^\\?/.exec(str_)))\n tokens.push('QUESTION_MARK');\n else if( (match = /^UPZ\\b/.exec(str_)))\n tokens.push('INC_OP');\n \n else if ( (match = /^VISIBLE\\b/.exec(str_)) )\n tokens.push('STDOUT');\n \n else if( (match = /^IZ\\b/.exec(str_)))\n tokens.push('INLINE_IF');\n else if( (match = /^KTHX\\b/.exec(str_)))\n tokens.push('INLINE_IF_END');\n else if( (match = /^GTFO\\b/.exec(str_)))\n tokens.push('BREAK');\n else if( (match = /^WTF\\\\?\\b/.exec(str_)))\n tokens.push('SWITCH');\n \n else if( (match = /^OMG\\b/.exec(str_)))\n tokens.push('SWITCH_CASE');\n else if( (match = /^OMGWTF\\b/.exec(str_)))\n tokens.push('SWITCH_CASE_DEFAULT'); \n \n \n else if (match = /^SMOOSH\\b/.exec(str_))\n tokens.push('NARY_OP');\n \n // Nothing denotes an empty array, so we treat it as a termination\n else if( match = /^(MKAY|NOTHING?(?: ELSE)?)\\b/.exec(str_))\n tokens.push('OP_TERM');\n \n else if( (match = (/^HOW DUZ I\\b/).exec(str_)) )\n tokens.push('FUNC_DEF');\n else if( (match = (/^YR\\b/).exec(str_)) )\n tokens.push('VAR');\n else if( (match = (/^FOUND\\b/).exec(str_)))\n tokens.push('RETURN');\n else if( (match = (/^IF U SAY SO\\b/).exec(str_)) )\n tokens.push('FUNC_DEF_END');\n // BRJOU\n else if( (match = (/^CAN HAS\\b/).exec(str_)) )\n tokens.push('REQUIRE');\n else if( (match = (/^DUZ WA(I|Y)T\\b/).exec(str_)) )\n tokens.push('WAIT_PARAM');\n else if( (match = (/^WA(I|Y)T\\b/).exec(str_)) )\n tokens.push('WAIT');\n else if( (match = (/^LATE?R\\b/).exec(str_)) )\n tokens.push('LATER');\n else if( (match = (/^WIZ\\b/).exec(str_)) )\n tokens.push('PAREN');\n else if( (match = (/^WIZ\\b/).exec(str_)) )\n tokens.push('PAREN');\n else if( (match = (/^ENUF\\b/).exec(str_)) )\n tokens.push('CLOSE');\n \n // BRJOU: added ~ and also _ at start\n else if( (match = (/^[a-zA-Z@_][a-zA-Z0-9_~]*(\\!\\w+)*/.exec(str_))) )\n tokens.push('IDENTIIFER');\n \n if (match)\n {\n i+=match[0].length-1;\n string.push(match[0]);\n }\n else if ((match = str_.match(/^\\S+/)))\n {\n lolspace_error('Tokeniser: unrecognised sequence:\\n' + str_.match(/^\\S+/) + '\\n' + str_.substr(i));\n i+=match[0].length-1;\n }\n \n \n \n }\n if (tokens.length != string.length)\n lolspace_error('Somehow I ended up with a different number of tokens than matches. This is fatal. Sorry.') \n var ret = [];\n for (var i=0; i<tokens.length; i++)\n {\n ret.push(tokens[i]);\n ret.push(string[i]);\n }\n return ret;\n}", "title": "" }, { "docid": "919b17c123654cf64ddbd81a5d6646c9", "score": "0.53601766", "text": "function categorize(ps) {\n // TODO - finish\n}", "title": "" }, { "docid": "0a7b22fb3e082ccb7c7a866805c5eb09", "score": "0.53556657", "text": "function word_check(word) {\n if (word.length > 6) {\n return \"long\";\n }\n else if (word.length < 6) {\n return \"short\";\n }\n else if (word.length == 6) {\n return \"medium\";\n }\n}", "title": "" }, { "docid": "9c6c38da69179a6de5bd0ddbaeb40bf4", "score": "0.5305614", "text": "function sanitizeCategory(value) {\n\n return _.map(\n value.split(' '),\n /*function(d) { return d.charAt(0).toUpperCase() + d.slice(1).toLowerCase(); }).join(' '); */\n function (d) {\n return d.charAt(0).toUpperCase() + d.slice(1);\n }).join(' ').replace(/,/g, '; ');\n}", "title": "" }, { "docid": "23a41805225fd16ecb91ac254f5c0eb0", "score": "0.5279562", "text": "function thesaurus(word) {\n return word;\n}", "title": "" }, { "docid": "f48fe81be39d60a255223e45fcb98778", "score": "0.5220056", "text": "function findThe(str, perfectUniverse) {\n\tarr = str.split(' ');\n\tvar filtered = arr.filter(function(value){return value.length == 3});\n\tvar the = highestCount(filtered);\n\tvar andfiltered = [];\n\tfor (var i = 0; i < filtered.length; i++) {\n\t\tif (filtered[i] != the){\n\t\t\tandfiltered.push(filtered[i]);\n\t\t}\n\t};\n\tvar and = highestCount(andfiltered);\n\tconsole.log('I think the is represented by '+the+', and and is represented by '+and);\n\tvar alph = '!!!!!!!!!!!!!!!!!!!!!!!!!!!'.split('');\n\t//r alph = 'abcdefghijklmnopqrstuvwxyz'\n\talph[0] = and.split('')[0];\n\talph[3] = and.split('')[2];\n\talph[13] = and.split('')[1];\n\talph[4] = the.split('')[2];\n\talph[7] = the.split('')[1];\n\talph[19] = the.split('')[0];\n\tfor (var j = 0; j < alph.length; j++) {\n\t\tif (alph[j] != '!'){\n\t\t\tvar index = perfectUniverse.indexOf(alph[j].toLowerCase());\n\t\t\tperfectUniverse[index]= perfectUniverse[j];\n\t\t\tperfectUniverse[j] = alph[j];\n\t\t}\n\t};\n\treturn perfectUniverse.map(function(x){return x.toLowerCase()});\n}", "title": "" }, { "docid": "a46df68b36c3af7233bc34b96a6d5bb9", "score": "0.5202529", "text": "function splitTextByCharCount(text, maxChars, fullWords, rtl) {\r\n // Maybe the text fits?\r\n if (text.length <= maxChars) {\r\n return [text];\r\n }\r\n // Init result\r\n var res = [];\r\n // Split by words or by charts\r\n if (fullWords) {\r\n // Split by words first\r\n // Split by spacing\r\n var currentIndex = -1;\r\n var tmpText = text.replace(/([,;:!?\\\\\\/\\.]+[\\s]+|[\\s])/g, _Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"] + \"$1\" + _Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"]);\r\n var words = tmpText.split(_Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"]);\r\n // Process each word\r\n for (var i = 0; i < words.length; i++) {\r\n // Get word and symbol count\r\n var word = words[i];\r\n var wordLength = word.length;\r\n // Ignore empty words\r\n if (wordLength === 0) {\r\n continue;\r\n }\r\n // Check word length\r\n //if ((wordLength > maxChars) && fullWords !== true) {\r\n if (wordLength > maxChars) {\r\n // A single word is longer than allowed symbol count\r\n // Break it up\r\n if (rtl) {\r\n word = reverseString(word);\r\n }\r\n var parts = word.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n // TODO is this correct ?\r\n if (parts) {\r\n if (rtl) {\r\n for (var x = 0; x < parts.length; x++) {\r\n parts[x] = reverseString(parts[x]);\r\n }\r\n //parts.reverse();\r\n }\r\n res = res.concat(parts);\r\n }\r\n }\r\n else {\r\n // Init current line\r\n if (currentIndex === -1) {\r\n res.push(\"\");\r\n currentIndex = 0;\r\n }\r\n // Check if we need to break into another line\r\n if (((res[currentIndex].length + wordLength + 1) > maxChars) && res[currentIndex] !== \"\") {\r\n res.push(\"\");\r\n currentIndex++;\r\n }\r\n // Add word\r\n res[currentIndex] += word;\r\n }\r\n // Update index\r\n currentIndex = res.length - 1;\r\n }\r\n }\r\n else {\r\n // Splitting by anywhere (living la vida facil)\r\n var parts = text.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n if (parts) {\r\n if (rtl) {\r\n for (var x = 0; x < parts.length; x++) {\r\n parts[x] = reverseString(parts[x]);\r\n }\r\n }\r\n res = parts;\r\n }\r\n }\r\n // Do we have only one word that does not fit?\r\n // Since fullWords is set and we can't split the word, we end up with empty\r\n // set.\r\n if (res.length == 1 && fullWords && (res[0].length > maxChars)) {\r\n res = [];\r\n }\r\n return res;\r\n}", "title": "" }, { "docid": "8e17b2438711ca01c0fe1d19e97a170f", "score": "0.51826155", "text": "function determineCategoryID(string) {\n var stringElementID = \"Other\";\n\n // mentoringServies\n if (string.includes(\"mentoring services\")) {\n stringElementID = categoryIDArray[0];\n }\n // jobDevelopment\n else if (string.includes(\"job development\")) {\n stringElementID = categoryIDArray[1];\n }\n // mentalHealth\n else if (string.includes(\"mental\")) {\n stringElementID = categoryIDArray[2];\n }\n // governmentAgencies\n else if (string.includes(\"Government Agencies\")) {\n stringElementID = categoryIDArray[3];\n }\n // probationParole\n else if (string.includes(\"Probation\")) {\n stringElementID = categoryIDArray[4];\n }\n // housingResources\n else if (string.includes(\"Housing\")) {\n stringElementID = categoryIDArray[5];\n }\n // educationMentoring\n else if (string.includes(\"Education\")) {\n stringElementID = categoryIDArray[6];\n }\n // religiousOrganizations\n else if (string.includes(\"Religious\")) {\n stringElementID = categoryIDArray[7];\n }\n // healthcareRecovery\n else if (string.includes(\"Healthcare\")) {\n stringElementID = categoryIDArray[8];\n }\n\n return stringElementID;\n}", "title": "" }, { "docid": "800fdc3a2a2798f09e813c678409aa9c", "score": "0.51643014", "text": "function colorCategory(cy) {\n\n if (cy == \"8028 Informatica Magistrale 1 anno\") {\n return \"#000000\"; // BLACK //\"coral\";\n }\n else if (cy == \"8028 Informatica Magistrale 2 anno\") {\n return \"#737373\"; // GRAY //\"orange\";\n }\n else if (cy == \"8009 Informatica Triennale 1 anno\") {\n return \"#800000\"; \n }\n else if (cy == \"8009 Informatica Triennale 2 anno\") {\n return \"#cc3300\"; \n }\n else if (cy == \"8009 Informatica Triennale 3 anno\") {\n return \"#ff9966\" \n }\n else if (cy == \"8014 Informatica per il Management 1 anno\") {\n return \"#003300\" \n }\n else if (cy == \"8014 Informatica per il Management 2 anno\") {\n return \"#339966\" \n }\n else if(cy==\"8014 Informatica per il Management 3 anno\"){\n return \"#009999\" \n }\n\n}", "title": "" }, { "docid": "fb20cd8fffc5db27fc74f0421c6e7dfa", "score": "0.5147511", "text": "function displayWord() {\n var tempWord = [];\n for(var i=0; i<exposed.length; i++) {\n if (exposed[i]) tempWord.push(myChars[i]);\n else tempWord.push(\"*\");\n }\n\n return tempWord.join(\"\");\n}", "title": "" }, { "docid": "30ad1f06d892277bb724fed3faef331e", "score": "0.51278657", "text": "function wordCloud(str) {\n const words = str.split(' ');\n const letters = 'abcdefghijklmnopqrstuvwxyz';\n const wordCounts = {};\n\n for (let i = 0; i < words.length; i++) {\n let word = words[i].toLowerCase();\n if (!letters.includes(word[0])) {\n word = word.slice(1);\n }\n if (!letters.includes(word[word.length - 1])) {\n word = word.slice(0,word.length - 1);\n }\n\n if (wordCounts[word]) {\n wordCounts[word]++;\n } else {\n wordCounts[word] = 1;\n }\n }\n\n return wordCounts;\n}", "title": "" }, { "docid": "e13610c85b7ec9796d229c5cb820e219", "score": "0.5125967", "text": "function charFreq(string) {\n //...\n}", "title": "" }, { "docid": "4a145f0f49e13ab978aaec816ee0e3d0", "score": "0.5123447", "text": "function compairCategoryName(xmlname, definitionName)\n {\n //exact match\n if(xmlname == definitionName)\n {\n return true;\n }\n /*\n var defnameSplit = definitionName.split(\" \");\n \n var foundwords = 0;\n var ignoredWords = 0;\n var totalWords = defnameSplit.length;\n for(i = 0; i < defnameSplit.length; i++)\n {\n //console.log(\"looking for \" + defnameSplit[i].toLowerCase() + \" in \" + xmlname);\n if( xmlname.indexOf(defnameSplit[i]) > 0)\n {\n //console.log(\"found \" + defnameSplit[i].toLowerCase());\n //found word in string\n foundwords++;\n }\n else if(defnameSplit[i].toLowerCase() == \"activities\")\n {\n console.log(\"\\tshould ignore \" + defnameSplit[i].toLowerCase());\n ignoredWords++;\n totalWords -= 1;\n }\n }\n \n if(totalWords <= foundwords)\n return true;\n \n return false;\n */\n }", "title": "" }, { "docid": "4a9aed02c79d526f9109300ee17408a6", "score": "0.5123275", "text": "function mostRecurringWords(string, int) {\r\n spaceIndex = [];\r\n for(var i = 0; i < string.length; i++) {\r\n if(string[i] == ' ') {\r\n spaceIndex.push(i);\r\n spaceIndex[0] - 0\r\n }\r\n }\r\n function addWordToObj() {\r\n if(spaceIndex.length == 1) {\r\n\r\n }\r\n spaceIndex[]\r\n }\r\n\r\n}", "title": "" }, { "docid": "9f9dfe351f4733253065241a1cd1a0ed", "score": "0.5113758", "text": "function cjkTokenize(wordsList){\n var allTokens= new Array();\n var notCJKTokens= new Array();\n var j=0;\n for(j=0;j<wordsList.length;j++){\n var word = wordsList[j];\n if(getAvgAsciiValue(word) < 127){\n notCJKTokens.push(word);\n } else { \n var tokenizer = new CJKTokenizer(word);\n var tokensTmp = tokenizer.getAllTokens();\n allTokens = allTokens.concat(tokensTmp);\n }\n }\n allTokens = allTokens.concat(tokenize(notCJKTokens));\n return allTokens;\n}", "title": "" }, { "docid": "a9b15e31fe2b75269056265fd1dd7588", "score": "0.5105901", "text": "static get phrase() { return `(?:${this.CFWS_op}${this.word_chain}(?:${this.CFWS}${this.word_chain})*${this.CFWS_op})`; }", "title": "" }, { "docid": "c7ddc1e853ddd7b9f3414909fc8513dd", "score": "0.51056427", "text": "function CATEGORIES() {}", "title": "" }, { "docid": "33ed4fe98b72a63f3d6717a94eeaec27", "score": "0.5102236", "text": "function wordCloudMap(text) {\n const wordCloud = new Map();\n\n let wordStartingIndex = 0;\n let wordLength = 0;\n \n for (let index = 0; index < text.length; index += 1) {\n const char = text[index];\n\n if (isLetter(char) || (isWordPunctuation(char) && wordLength > 0)) {\n if (wordLength === 0) {\n wordStartingIndex = index;\n } \n\n wordLength += 1;\n } else {\n if (wordLength > 0) {\n addWordToMapInPlace(\n text.slice(wordStartingIndex, wordStartingIndex + wordLength),\n wordCloud);\n\n wordLength = 0;\n }\n }\n \n // if this is the last character in text\n if (index === text.length - 1 && wordLength > 0) {\n addWordToMapInPlace(\n text.slice(wordStartingIndex, wordStartingIndex + wordLength),\n wordCloud);\n }\n }\n\n return wordCloud;\n}", "title": "" }, { "docid": "384e57f1be1deabb8424c3729703e760", "score": "0.50847036", "text": "function sluginate( text ){\n\t return text.toLowerCase().replace(/([^\\w]|^the\\s)+/g,'-').replace(/(^-|-$)/g,\"\");\n\t}", "title": "" }, { "docid": "09a3cbe34ef419d9c83fd5d07472946e", "score": "0.50635856", "text": "function wordConstant() {\n var result\n if (ch && ch == 't') {\n _true()\n result = true\n } else if (ch && ch == 'f') {\n _false()\n result = false\n } else if (ch && ch == 'n') {\n _null()\n result = null\n }\n return result\n }", "title": "" }, { "docid": "ebb6dedd325536ceb31224e1b6f74b07", "score": "0.5049669", "text": "function countWords(stringOfWords) {\nif (stringOfWords.length === 0){\n return {};\n}\n\nlet words = stringOfWords.split(' ');\nlet countWords = {};\n\nfor(let i = 0 ; i <words.length ; i++){\n let currentChara = words[i];\n if (countWords[currentChara] === undefined){\n countWords[currentChara] =1;\n }\n else {\n countWords[currentChara]++ ; \n }\n}return countWords;\n}", "title": "" }, { "docid": "e04663eb5e50d183509f1cb8ee8f8770", "score": "0.5045145", "text": "function Words(string) {\r\n this.str = string;\r\n return this.str.split(\" \");\r\n}", "title": "" }, { "docid": "7f47c7ae37d1287daf362e216067f41f", "score": "0.5040257", "text": "function dupEncoder(word) {\r\n return word.toLowerCase().split('').map((el, i, arr) => arr.filter(val => val == el).length > 1 ? ')' : '(').join('');\r\n} // One line function FTW!!!", "title": "" }, { "docid": "2f6fcd9d31437519ec5cc01c209f7650", "score": "0.50397974", "text": "function wordCountEngine(document) {\n let dict = new Map();\n document = document.toLowerCase();\n let curWord = \"\";\n for (let i = 0; i < document.length; i++) {\n if (document[i].match(/[a-z]/i)) {\n curWord += document[i];\n }\n if (document[i] === \" \" || i === document.length - 1) {\n if (curWord.length > 0) {\n dict.has(curWord)\n ? dict.set(curWord, dict.get(curWord) + 1)\n : dict.set(curWord, 1);\n curWord = \"\";\n }\n }\n }\n\n let arr = [];\n for (let i = 0; i < dict.size - 1; i++) {\n arr.push([]);\n }\n for (let [x, y] of dict) {\n arr[y].push([x, y.toString()]);\n }\n let returnArr = [];\n for (let i = arr.length - 1; i >= 0; i--) {\n if (arr[i].length > 0) {\n for (let j = 0; j < arr[i].length; j++) {\n returnArr.push(arr[i][j]);\n }\n }\n }\n return returnArr;\n}", "title": "" }, { "docid": "a1addd6a48d37b31eca354335220cbd2", "score": "0.50345683", "text": "function formatCategory(c){\n var formatted = string.trim(c).toLowerCase().replace(/ /g, \"_\").replace(/\\./g, \"_\");\n if (isSamplesDebug) {\n console.log(\"formatCategory\", c, formatted);\n }\n return formatted;\n }", "title": "" }, { "docid": "53678bd182b760b913602bfc14a64d88", "score": "0.5034474", "text": "function createWord(word) {\n let wordContainer = document.getElementsByClassName(\"word-container\");\n for (let i = 0; i < word.length; i++) {\n checkSpaceInWords(wordContainer, word[i]);\n }\n}", "title": "" }, { "docid": "007f78812afc461081ad0d16ac8e646a", "score": "0.50232786", "text": "function helloWorld(word)\r\n{\r\n if (word === 'EN')\r\n {\r\n return \"Hello World\"\r\n }\r\n else if (word === 'DE')\r\n {\r\n return \"Hallo Welt\"\r\n }\r\n else if (word === 'ES')\r\n {\r\n return \"Hola Mundo\"\r\n }\r\n else if (word === 'FR')\r\n {\r\n return \"Bonjour le Monde\"\r\n }\r\n}", "title": "" }, { "docid": "b1027060c7806a0c5ba9c73df022c601", "score": "0.50175285", "text": "getKeywords(string) {\n let ref = this.reference;\n let index = [];\n string = string.replace(/(~|`|!|@|#|$|%|^|&|\\*|\\(|\\)|{|}|\\[|\\]|;|:|\\\"|'|<|,|\\.|>|\\?|\\/|\\\\|\\||-|_|\\+|=)/g, '');\n let words = string.split(\" \");\n words.forEach(function (word) {\n if (ref[word.toLowerCase()]) {\n index = index.concat(ref[word.toLowerCase()]);\n }\n })\n if (index.length === 0) {\n index = ref[\"other\"];\n }\n return (index);\n }", "title": "" }, { "docid": "b590611651183421454e382e7dd7f291", "score": "0.50137776", "text": "function is_word_char (c){\n return /[A-Za-zÀ-ɏΐ-ϿЀ-ԧ]/.test(c);\n}", "title": "" }, { "docid": "331d0b8c894f761bdfab8ad594bd7f31", "score": "0.5011284", "text": "function markovize(str){\n let newStr = removeEverythingExceptWords(str);\n let strArr = newStr.split(' ');\n let returnObj = {};\n strArr.forEach(function(word, i){\n if (returnObj[word.toUpperCase()] === undefined && strArr[i+1] !== undefined && strArr[i+1] !== ''){\n returnObj[word.toUpperCase()] = [strArr[i+1].toUpperCase()];\n } else if (strArr[i+1] !== undefined && strArr[i+1] !== ''){\n returnObj[word.toUpperCase()].push(strArr[i+1].toUpperCase());\n }\n });\n return returnObj;\n }", "title": "" }, { "docid": "31b787471edb164f8a5e039e10989cf4", "score": "0.5003372", "text": "function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation(code)) {\n return 2\n }\n}", "title": "" }, { "docid": "31b787471edb164f8a5e039e10989cf4", "score": "0.5003372", "text": "function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace(code) ||\n unicodeWhitespace(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation(code)) {\n return 2\n }\n}", "title": "" }, { "docid": "da69697e2d209d903aa787029178c550", "score": "0.5001831", "text": "function contourChars(){\n\t//\n\t//rule object\n\tvar rules={};\n\t/*\n\t* -----------------------------------------\n\t* right down neighborhood: c0 and c1 to c3\n\t* [c0|c1]\n\t* [c2|c3]\n\t*\n\t* v_i = {c0!=$c_i?1:0}, and i = 1, 2 and 3\n\t* rule: rules[`${v_1}${v_2}${v_3}`]\n\t* -----------------------------------------\n\t*/\n\t//U+287c: \"⡼\"\n\trules['111']='\\u287c';\n\t//\n\t//U+285c: \"⡜\";\n\trules['110']='\\u285c';\n\t//\n\t//U+2838: \"⠸\";\n\trules['101']='\\u2838';\n\t//\n\t//U+2818: \"⠘\";\n\trules['100']='\\u2818';\n\t//\n\t//U+2864: \"⡤\";\n\trules['011']='\\u2864';\n\t//\n\t//U+2844: \"⡄\";\n\trules['010']='\\u2844';\n\t//\n\t//U+2820: \"⠠\";\n\trules['001']='\\u2820';\n\t//\n\t//U+2800: \"⠀\";\n\trules['000']='\\u2800';\n\t//\n\treturn rules;\n}", "title": "" }, { "docid": "e55003353a20beeec7a4f8ece42f3180", "score": "0.49998397", "text": "function classifyCharacter(code) {\n if (\n code === null ||\n markdownLineEndingOrSpace_1(code) ||\n unicodeWhitespace_1(code)\n ) {\n return 1\n }\n\n if (unicodePunctuation_1(code)) {\n return 2\n }\n}", "title": "" }, { "docid": "fd439a7763f888a4aabfa24f7fe45b52", "score": "0.49997005", "text": "function buildWord(word) {\n let result = \"\";\n for (let i=0; i < word.length; i++) {\n let currentChar = word[i];\n if (/^[-.,:;'\"?!@#$%&()+=]+$/.test(currentChar)) {\n currentChar = getKeyByValue(currentChar);\n result += chars[currentChar];\n } else {\n result += chars[currentChar.toUpperCase()];\n }\n }\n return result;\n }", "title": "" }, { "docid": "c6b1e1650682b7999a960bf834e87cb1", "score": "0.49986693", "text": "function categoryFirstLetter(string) {\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "title": "" }, { "docid": "41b8f4652685f5f36d33fa4660b988a2", "score": "0.4996143", "text": "makeWord() {\n let wordStr = '';\n\n while (this.currentCharacter !== null &&\n TokenTypes.CHARS.includes(this.currentCharacter) ||\n TokenTypes.DIGITS.includes(this.currentCharacter)) {\n\n wordStr += this.currentCharacter;\n this.advance();\n }\n\n return wordStr;\n }", "title": "" }, { "docid": "de4e96a4d8e9fb09a488c66055f51b0b", "score": "0.49896395", "text": "function extractCategoryMap(oSentence) {\n var res = {};\n debuglog(debuglog.enabled ? ('extractCategoryMap ' + JSON.stringify(oSentence)) : '-');\n oSentence.forEach(function (oWord, iIndex) {\n if (oWord.category === IFMatch.CAT_CATEGORY) {\n res[oWord.matchedString] = res[oWord.matchedString] || [];\n res[oWord.matchedString].push({ pos: iIndex });\n }\n });\n utils.deepFreeze(res);\n return res;\n}", "title": "" }, { "docid": "add08812948c95d0ccac50036561a2e8", "score": "0.49894646", "text": "* tokenise(string)\n {\n for (let [char, class_] of this.lemmatise(string))\n {\n switch (class_)\n {\n case 'a':\n switch (char.toLowerCase())\n {\n case 'and':\n yield [char, 'and'];\n continue;\n case 'or':\n yield [char, 'or'];\n continue;\n case 'not':\n yield [char, 'not'];\n continue;\n }\n break;\n case '-':\n yield [char, 'not'];\n continue;\n case ' ':\n continue;\n case '0':\n yield [char, 'a'];\n continue;\n }\n yield [char, class_];\n }\n }", "title": "" }, { "docid": "b3b8bb4bc28bb66670aac23600a77ee5", "score": "0.49745998", "text": "function categorize(keyword) {\n if (keyword.trim() == \"\") {\n return \"\";\n }\n var catSheet = SpreadsheetApp.getActive().getSheetByName(\"Keywords & Categories\");\n var firstRow = 2;\n var lastRow = Math.max(catSheet.getLastRow(), 1);\n var numRows = lastRow - firstRow + 1;\n \n keyword = keyword.toLowerCase();\n \n var data = catSheet.getRange(firstRow, 1, lastRow, 2).getValues(); // create an array of data from columns A and B\n\n // Try to find exact match first\n for (var nn = 0; nn < numRows; ++nn) {\n if (data[nn][0] == keyword) { // if a match in column A is found, break the loop\n break;\n };\n }\n var mostPopularCategory = data[nn][1];\n if ((nn < numRows) && (mostPopularCategory != \"\")) {\n return mostPopularCategory;\n };\n \n // If exact match was not found, try to find a partial match\n for (var nn = 0; nn < numRows; ++nn) {\n if ((data[nn][0].indexOf(keyword) != -1) || (keyword.indexOf(data[nn][0]) != -1)) {\n break;\n };\n }\n var mostPopularCategory = data[nn][1];\n if ((nn < numRows) && (mostPopularCategory != \"\")) {\n return mostPopularCategory;\n };\n \n return \"\";\n}", "title": "" }, { "docid": "aa6ac4dc88bf5add70aeb9ce672c355d", "score": "0.4961565", "text": "function Words(wordList, i) {\n\tvar word = '';\n\tvar length = values.textAmount;\n\tvar bComma = length >= 7;\n\tvar bColon = false; //length >= 14;\n\tvar bSemicolon = length >= 14;\n\tvar bEmDash = length >= 14;\n\n\tvar source;\n\tif (wordList[0] != 'lorem' && values.bWithLatin) source = merge(wordList, lorem);\n\telse source = source = merge(wordList, new Array());\n\n\tvar w = source[i];\n\tif(values.bTitle) w = InitialCap(w);\n\n\tif (i >= 3 && i != length - 1 && values.bPunctuation) {\n\t\tif (randomInt(0, 9) == 1 && bComma) {\n\t\t\tword = rtrim(word) + ', ';\n\t\t\tbComma = false;\n\t\t}\n\t\telse if (randomInt(0, 18) == 1 && bColon) {\n\t\t\tword = rtrim(word) + ': ';\n\t\t\tbColon = false;\n\t\t}\n\t\telse if (randomInt(0, 18) == 1 && bSemicolon) {\n\t\t\tword = rtrim(word) + '; ';\n\t\t\tbSemicolon = false;\n\t\t}\n\t\telse if (randomInt(0, 36) == 1 && bEmDash) {\n\t\t\tword = rtrim(word) + ' ' + String.fromCharCode(8212) + ' ';\n\t\t\tbEmDash = false;\n\t\t}\n\t\telse {\n\t\t\tword += ' ';\n\t\t}\n\t}\n\telse {\n\t\tword += ' ';\n\t}\n\tword += w;\n\n\treturn word;\n}", "title": "" }, { "docid": "8a4f5ee4d25001148b5d35e018d2507b", "score": "0.49479344", "text": "function aWanalysis(analizedWord){\n\tvar analizedWordObj = {\n\t\taWoriginal:analizedWord,\n\t\tanalizedWord:analizedWord.toLowerCase(),\n\t\taWSplitted: analizedWord.toLowerCase().split(''),\n\t\taWindexOfVowels: findAndIndexMultipleStrings(vowels,analizedWord),\n\t\tindexOfDiptongos:findDiptongos(analizedWord.toLowerCase().split('')),\n\t\tindexOfHiatos:findAndIndexMultipleStrings(allPosibleHiatos,analizedWord),\n\t\tindexOfdobleLetters:findAndIndexMultipleStrings(dobleLetters,analizedWord),\n\t\tindexOfunsplittables:findAndIndexMultipleStrings(unsplittables,analizedWord),\n\t\taWTotalySplitted:false,\n\t}\n\treturn analizedWordObj\n}", "title": "" }, { "docid": "6ecc6016d74b1b17ee73740dd2ea840a", "score": "0.49459806", "text": "function createMetrics(text){\n\tif (typeof text !== 'string') \n\t\tthrow (\"text must be a string\");\n\tconst str = simplify(text);\n\tconst strw = str.split(' ');\n\tconst uniqueWords = (strw.filter((w, index) => strw.indexOf(w) === index)).length;\n\tconst longWords = (strw.filter(w => w.length >= 6)).length;\n\tconst totalLetters = str.replace(/[^A-Z]/gi, \"\").length;\n\tconst wordOccurrences = {};\n\tfor (const w of strw) \n\t\twordOccurrences[w] = wordOccurrences[w] ? wordOccurrences[w] + 1 : 1;\n\tconst totalWords = strw.length;\n\tvar wordAvg = 0;\n\tfor (i = 0; i < totalWords; i++)\n wordAvg += strw[i].length;\n var averageWordLength = wordAvg / totalWords;\n\treturn{\n\ttotalLetters,\n\ttotalWords,\n\tuniqueWords,\n\tlongWords,\n\taverageWordLength,\n\twordOccurrences\n\t};\n}", "title": "" }, { "docid": "9d6aefe9817d732c3cc4ea31180e4849", "score": "0.4943315", "text": "function sentensify(str) {\r\n // Only change code below this line\r\n let newArray = str.split(/\\s|_|(?=[A-Z])|\\W/)\r\n let newArray1 = newArray.join(\" \");\r\n return newArray1;\r\n\r\n // Only change code above this line\r\n}", "title": "" }, { "docid": "e3d6ee37002e4a3e30c8a5a61f8c6d1e", "score": "0.49418086", "text": "function addChar(sMiniscule, sClass, bSkipCapital){\r\n function addMinisculeChar(sMiniscule){\r\n var nPosition = aClass[sClass].length;\r\n var sMajuscule = sMiniscule.toUpperCase();\r\n var sCapital = (bSkipCapital) ? \"\":getCapital(sMiniscule);\r\n aChars[sMiniscule] = {sMiniscule:sMiniscule, sMajuscule:sMajuscule, sCapital:sCapital, sClass:sClass, nPos:nPosition, bIsMiniscule:true}; \r\n return nPosition; \r\n }\r\n function getCapital(sString){\r\n return sString.charAt(0).toUpperCase()+sString.substring(1);\r\n }\r\n \r\n if (!aClass[sClass]){\r\n aClass[sClass] = new Array();\r\n }\r\n if (!sMiniscule.match(/.+\\|.+/g)){\r\n var nPosition = addMinisculeChar(sMiniscule);\r\n aClass[sClass][nPosition] = aChars[sMiniscule];\r\n }else{\r\n var asWords = sMiniscule.match(/([^|]+)/g);\r\n var asMiniscule = new Array();\r\n var nPosition;\r\n for(var i=0;i<asWords.length;i++){\r\n nPosition = addMinisculeChar(asWords[i]);\r\n asMiniscule[i] = aChars[asWords[i]]; \r\n }\r\n aClass[sClass][nPosition] = asMiniscule;\r\n }\r\n}", "title": "" }, { "docid": "dd3e901bb849134687d798ddc9fb4619", "score": "0.4939602", "text": "function funnelWords(arr){\n // Designate an array for the strings that are to be extracted from the above elements.\n var allKeyWords = [];\n // Use switch to extract strings from the relevant location for each element.\n for(var i = 0; i<arr.length; i++ ){\n switch (allKeySources[i].tagName.toLowerCase()) {\n case 'meta':\n allKeyWords.push(allKeySources[i].content);\n break;\n case 'img':\n allKeyWords.push(allKeySources[i].alt);\n break;\n case 'h1':\n case 'h2':\n case 'h3':\n allKeyWords.push(allKeySources[i].textContent);\n break;\n }\n }\n // Turn the strings into one string, replace the redundant words with whitespace, turn the string back into\n // an array and delete empty strings.\n return allKeyWords.toString().replace(expression,' ').toLowerCase().split(' ').filter(function(word){return word.length>2});\n }", "title": "" }, { "docid": "130392e916b20a0add59bdc28228bf87", "score": "0.49391046", "text": "function characterMapping(str) {\n let bucket = str.split(\"\");\n let counter = 0;\n let chart = bucket.reduce((total, x) => {\n if(typeof total[x] === 'undefined'){\n total[x] = counter;\n counter++;\n }\n return total;\n }, {});\n\n for(let x = 0; x < bucket.length; x++){\n bucket[x] = chart[bucket[x]];\n }\n\n return bucket;\n}", "title": "" }, { "docid": "7abda54df923fae9552cb88764fcc300", "score": "0.49371716", "text": "populateWordsToCounts(str) {\n const strLen = str.length\n let currWordArr = []\n\n for (let i = 0; i <= strLen; i++) {\n const currChar = str[i],\n isCharValid = this.isValidChar(currChar)\n /* If currChar is a not valid(like standalone or trailing punctuation)\n and we've already handled the word before it, skip it */\n if (!isCharValid && currWordArr.length === 0) continue\n /*\n If currChar is valid (apostrophes and letters) or if it is a hyphen surrounded by letters,\n consider it a letter and push into currWordArr\n Otherwise we've reached end of word\n 1. Create lowercase string from currWordArr and check if it exists in the map\n 2. Get and set the word count accordingly\n 3. Reset currWordArr to be empty\n */\n if (isCharValid || (currChar === '-' && this.isLetter(str[i + 1]))) {\n currWordArr.push(currChar)\n } else {\n const currWord = currWordArr.join('').toLowerCase()\n\n const wordCount = this.wordsToCounts.has(currWord)\n ? this.wordsToCounts.get(currWord) + 1\n : 1\n\n this.wordsToCounts.set(currWord, wordCount)\n currWordArr = []\n }\n }\n }", "title": "" }, { "docid": "31ff2695105bb61b6a8fbd2b2700dbb0", "score": "0.49354503", "text": "function buildCharacterMap(str){\n const characterMap = {};\n const cleanedString = str.replace(/[^\\w]/g,\"\").toLowerCase();\n for(let character of cleanedString){//iterating through the current string\n characterMap[character] +=1 || 1;\n }\n return characterMap;\n}", "title": "" }, { "docid": "dd739486a8855ce68db71a48f65edfc0", "score": "0.4928084", "text": "function latinWords(){\n let newArray = loremIpsum.split(\" \");\n let repeatWord = 0;\n //console.log(newArray)\n for (let word of newArray){\n //console.log(word) \n if (word.toLowerCase() === \"Latin\".toLowerCase()){\n repeatWord ++\n }\n } return repeatWord\n }", "title": "" }, { "docid": "0ab1f07f19873727ff8bb820992021b7", "score": "0.49268532", "text": "function GetWord()\n{\n var word = \"\";\n var col = GetCurrColor();\n switch(col)\n {\n case \"pink\":\n word = \"interesting\";\n break;\n case \"green\":\n word = \"confusing\";\n break;\n case \"yellow\":\n word = \"surprising\";\n break;\n case \"purple\":\n word = \"creepy\"\n break;\n }\n return word;\n}", "title": "" }, { "docid": "18edbc7b6cdd696fb01804f3c6377fc9", "score": "0.49165285", "text": "function categorizeCountries(arr) {\n a = arr.filter(item => item.match(/^A/));\n b = arr.filter(item => item.match(/^B/));\n c = arr.filter(item => item.match(/^C/));\n d = arr.filter(item => item.match(/^D/));\n e = arr.filter(item => item.match(/^E/));\n f = arr.filter(item => item.match(/^F/));\n g = arr.filter(item => item.match(/^G/));\n h = arr.filter(item => item.match(/^H/));\n i = arr.filter(item => item.match(/^I/));\n j = arr.filter(item => item.match(/^J/));\n k = arr.filter(item => item.match(/^K/));\n l = arr.filter(item => item.match(/^L/));\n m = arr.filter(item => item.match(/^M/));\n n = arr.filter(item => item.match(/^N/));\n o = arr.filter(item => item.match(/^O/));\n p = arr.filter(item => item.match(/^P/));\n q = arr.filter(item => item.match(/^Q/));\n r = arr.filter(item => item.match(/^R/));\n s = arr.filter(item => item.match(/^S/));\n t = arr.filter(item => item.match(/^T/));\n u = arr.filter(item => item.match(/^U/));\n v = arr.filter(item => item.match(/^V/));\n w = arr.filter(item => item.match(/^W/));\n x = arr.filter(item => item.match(/^X/));\n y = arr.filter(item => item.match(/^Y/));\n z = arr.filter(item => item.match(/^Z/));\n let sortArr = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z];\n var longest = 0;\n for (i = 0; i < sortArr.length; i++) {\n if (sortArr[i].length > longest) {\n longest = sortArr[i].length;\n longestItem = sortArr[i];\n }\n }\n console.log('The most countries begin with the letter ' + longestItem[0].charAt(0) + ' and the amount of countries is ' + longestItem.length);\n }", "title": "" }, { "docid": "72935473af5f8b434d2e5d8ee11c2409", "score": "0.4913347", "text": "function cutASyllable(analizedWord){\n\t// var wordProcess =[]\n\t// var analizedWord = analizedWordArr[analizedWordArr.length-1]\n\tvar firstVowelIndex = aWanalysis(analizedWord).aWindexOfVowels[0]\n\tvar firstHiatoIndex = aWanalysis(analizedWord).indexOfHiatos[0]\n\tvar firstDiptongoIndex = aWanalysis(analizedWord).indexOfDiptongos[0]\n\tvar firstUnsplittableIndex = aWanalysis(analizedWord).indexOfunsplittables[0]\n\tvar secondVowelIndex = aWanalysis(analizedWord).aWindexOfVowels[1]\n\tvar thirdVowelIndex = aWanalysis(analizedWord).aWindexOfVowels[2]\n\tvar firstRepeatedLetterIndex = aWanalysis(analizedWord).indexOfdobleLetters[0]\n\tvar consonantsBetweenVowels =aWanalysis(analizedWord).aWindexOfVowels[1] -aWanalysis(analizedWord).aWindexOfVowels[0]\n\tvar wordBeingCut = null\n\tvar firstSyllable = null\n\n\t\n\t// console.log(consonantsBetweenVowels, 'consonantsBetweenVowels')\n\tfunction cutFirstSyllableHere(whereToCut){\n\t\t\tfirstSyllable = analizedWord.substring(0,whereToCut);\n\t\t\twordBeingCut= analizedWord.substring(whereToCut);\n\n\t}\n\t\n\tif (analizedWord.length < 2 ){\n\t\tcutFirstSyllableHere(analizedWord.length)\n\t// if its there an hiato, cut the syllable between vowels\n\t} else if (firstVowelIndex === firstHiatoIndex ){\n\t\tcutFirstSyllableHere(firstHiatoIndex+1)\n\t//else if its there a diptongo, cut the syllable one before the third vowel\t\n\t} else if (firstVowelIndex === firstDiptongoIndex) {\n\t\tcutFirstSyllableHere(thirdVowelIndex-1)\n\t//else if, there is a repeated letter, cut the syllable two letter before the second vowel \n\t} else if(secondVowelIndex-2 === firstRepeatedLetterIndex){\n\t\tcutFirstSyllableHere(secondVowelIndex-2)\n\t\t//else if, there are four consonants between the first vowel and the second, split it after the second consonant\n\t} else if(secondVowelIndex-5 === firstVowelIndex){\n\t\tcutFirstSyllableHere(secondVowelIndex-2)\n\t\t//else if, there are three consonants between the first vowel and the second, \n\t} else if(secondVowelIndex-4 === firstVowelIndex){\n\n\t\tif(firstUnsplittableIndex === firstVowelIndex+1 ){\n\n\t\tcutFirstSyllableHere(firstVowelIndex+3)}\n\t\telse if(firstUnsplittableIndex === firstVowelIndex+2 ){\n\t\tcutFirstSyllableHere(firstVowelIndex+2)\n\t\t}else{\n\t\t\tcutFirstSyllableHere(firstVowelIndex+3)\n\t\t}\n\n\t\t//else if, there are two consonants between the first vowel and the second, \n\t} else if(secondVowelIndex-3 === firstVowelIndex){\n\t\tif(firstUnsplittableIndex === firstVowelIndex+1 ){\n\t\tcutFirstSyllableHere(firstVowelIndex+1)\n\t\t}else{\n\t\t\tcutFirstSyllableHere(firstVowelIndex+2)\n\t\t}\n\t\t\n\t\t\t\t\n\t//if there aren't any diptongo or hiato, cut the first syllable one letter before the second vowel. \n\t}else{\n\t\tcutFirstSyllableHere(secondVowelIndex-1)\n\t}\n\n\t\n\t// wordProcess.push(firstSyllable)\n\t// wordProcess.push(wordBeingCut)\n\n\tif(firstSyllable === ''){\n\t\tvar wordProcess = [wordBeingCut]\n\t}else if (firstSyllable === ''){\n\t\tvar wordProcess = [wordBeingCut]\n\t} else {\n\t\tvar wordProcess = [firstSyllable ,wordBeingCut ]\n\t}\n\n\treturn wordProcess\n}", "title": "" }, { "docid": "0f395d51ad9f0f810e94570767519bd0", "score": "0.4909719", "text": "function multipleAccidental(stringArray) {\n\t\"use strict\";\n\n\t// List of word multiples\n\tvar wordMultiple = [\n\t\t[\"single\",\t\t\t1],\n\t\t[\"double\",\t\t\t2],\n\t\t[\"triple\",\t\t\t3],\n\t\t[\"quadruple\",\t\t4],\n\t\t[\"quintuple\",\t\t5],\n\t\t[\"pentuple\",\t\t5],\n\t\t[\"sextuple\",\t\t6],\n\t\t[\"hextuple\",\t\t6],\n\t\t[\"septuple\",\t\t7],\n\t\t[\"octuple\",\t\t\t8],\n\t\t[\"nonuple\",\t\t\t9],\n\t\t[\"decuple\",\t\t\t10],\n\t\t[\"hendecuple\",\t11],\n\t\t[\"undecuple\",\t\t11],\n\t\t[\"duodecuple\",\t12]\n\t];\n\n\t// Loop through each element of stringArray\n\tfor (i = 0; i < stringArray.length; i++) {\n\t\t// Loop through each element of wordMultiple\n\t\tfor (j = 0; j < wordMultiple.length; j++) {\n\t\t\t// If the element of stringArray matches the first element of wordMultiple\n\t\t\tif (stringArray[i] === wordMultiple[j][0]) {\n\t\t\t\t// If the next element of stringArray is \"sharp\" or \"flat\"\n\t\t\t\tif (stringArray[i+1] === \"sharp\" || stringArray[i+1] === \"flat\") {\n\t\t\t\t\t// Replace word multiple with \"wordMultiple\"\n\t\t\t\t\tstringArray[i] = \"wordMultiple\";\n\t\t\t\t\t// Add n-1 of the accidental word to the array (e.g. \"triple sharp\" becomes \"triple sharp sharp sharp\")\n\t\t\t\t\tfor (k = 0; k < wordMultiple[j][1] - 1; k++) {\n\t\t\t\t\t\tstringArray[i] += \" \" + stringArray[i+1];\n\t\t\t\t\t}\n\t\t\t\t// Skip the next iteration of the loop (it is either \"sharp\" or \"flat\")s\n\t\t\t\ti += 1;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Take out spaces and make each word its own element\n\tstringArray = stringArray.join(\" \").split(\" \");\n\n\treturn stringArray;\n\n} // End of multipleAccidental", "title": "" }, { "docid": "b5cbdda97f967262554142cc0dce03ec", "score": "0.4904307", "text": "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "title": "" }, { "docid": "b5cbdda97f967262554142cc0dce03ec", "score": "0.4904307", "text": "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "title": "" }, { "docid": "b5cbdda97f967262554142cc0dce03ec", "score": "0.4904307", "text": "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "title": "" }, { "docid": "b5cbdda97f967262554142cc0dce03ec", "score": "0.4904307", "text": "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "title": "" }, { "docid": "b5cbdda97f967262554142cc0dce03ec", "score": "0.4904307", "text": "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "title": "" }, { "docid": "b5cbdda97f967262554142cc0dce03ec", "score": "0.4904307", "text": "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "title": "" }, { "docid": "2c46f1632346014fbf9e6ae140bf424e", "score": "0.49024925", "text": "function StrToWordsArray(Str){\n var Result = [];\n var k = 0;\n for(var i = 0; i < Str.length - 1; i++){\n if (Result[k] == undefined) Result[k] = \"\";\n Result[k] += Str[i];\n if (/^[A-Z]+$/.test(Str[i + 1]) && !(/^[A-Z]+$/.test(Str[i]))) {\n k++;\n }\n if (Str[i + 1] == '-' || Str[i + 1] == '_') {\n k++;\n i++;\n }\n };\n Result[k] += Str[Str.length - 1];\n for(var i = 0; i < Result.length; i++){\n Result[i] = Result[i].toLowerCase();\n };\n return Result;\n}", "title": "" }, { "docid": "b403d612dd818bd56adc3d5c8686a58e", "score": "0.49022618", "text": "function wordMatchr(str,returnLog) {\n\tstr = str.toLowerCase();//clean the string. This makes false positives more common, but allows us to effectively search if the spaces are broken up incorrectly \n\tvar occurrences = 0;\n\tvar diGraphCount = 0;\n\tvar logger=[];\n\tfor (var i = 0, len = mostCommon.length; i < len; i++) {\n\t\tif (str.indexOf(' '+mostCommon[i].toLowerCase()+' ') > -1) {\n\t\t\toccurrences++;\n\t\t\tif (returnLog !== undefined) logger.push(mostCommon[i]);\n\t\t}\n\t}\n\tfor (var j = 0; j < diGraphs.length; j++) {\n\t\tdiGraphCount+=getMatchIndexes(str,diGraphs[j]).length\n\t};\n\tif (returnLog !== undefined) {\n\t\treturn [parseInt(occurrences + (diGraphCount/10)),logger];\n\t} \n\treturn (parseInt(occurrences + (diGraphCount/10)));\n}", "title": "" }, { "docid": "b97b3ad514ef488c25998dac1a87d912", "score": "0.48989362", "text": "function getSurfix(word){\n surfix =\"\"; //word surfix\n specialsurfix =\"\"; //word surfix only for those wordswith seven-nine letters that won't be labeled with number \"1\"\n var word_length=word.length;\n\n //a word's surfix can have different word length \n var one_letter= word.slice(word_length-1, word_length);\n var two_letters= word.slice(word_length-2, word_length);\n var three_letters = word.slice(word_length-3, word_length);\n var four_letters= word.slice(word_length-4, word_length);\n var five_letters = word.slice(word_length-5, word_length);\n\n if (one_letter==\"y\"){\n surfix = \"y\";\n }\n else{\n /*even when word_length is among 1-6, \n word with surfix \"ness\" and \"ly\" not obey the first six letter rule\n */ \n for (j=0;j<wordSurfix.length;j++){\n if(wordSurfix[j]== two_letters){\n surfix= two_letters;\n } else if(wordSurfix[j]== three_letters){\n surfix = three_letters;\n } else if(wordSurfix[j]== four_letters){\n surfix = four_letters;\n } else if(wordSurfix[j]== five_letters){\n surfix = five_letters;\n } else {\n surfix = \"#\";\n }\n if(surfix != \"#\")break;\n }\n\n //special surfix\n if (word_length <7){\n var wSurfix=wordSurfix;\n }\n else if (word_length ==7){\n var wSurfix=sevenSurfix;\n }\n else if (word_length ==8){\n var wSurfix=eightSurfix;\n }\n else{\n var wSurfix=nineSurfix;\n }\n\n for (j=0;j<wSurfix.length;j++){\n if(wSurfix[j]== two_letters){\n specialsurfix= two_letters;\n }\n else if(wSurfix[j]== three_letters){\n specialsurfix = three_letters;\n }\n else if(wSurfix[j]== four_letters){\n specialsurfix = four_letters;\n } else if(wSurfix[j]== five_letters){\n specialsurfix = five_letters;\n }else{\n specialsurfix = \"#\";\n }\n if(specialsurfix != \"#\")break;\n } \n } \n}", "title": "" }, { "docid": "7623e5273aacc3fe0cfbec730e7fd8ea", "score": "0.48968664", "text": "function getSmarter(text){\n\tlet text_nospace = text.split(\" \").join(\"\")\n\tlet tokens = text_nospace.split(\":\")\n\tlet cat = tokens[1]\n\tlet new_command = tokens[2]\n\tlet score_command_list = fuzzyset_learning_cats.get(cat)\n\tif (score_command_list == null){\n\t\treturn false\n\t}\n\n\tlet chosen_cat = score_command_list[0][1]\n\tconsole.log(chosen_cat)\n\tif (chosen_cat == LEARNING_CATS[0]){\n\t\tfuzzyset_teach.add(new_command)\n\t\tfuzzyset_list[0].list_words.add(new_command)\n\t\twriteToFile(fuzzyset_list[0].list_words, fuzzyset_list[0].filename)\n\t} else if (chosen_cat == LEARNING_CATS[1]){\n\t\tfuzzyset_images.add(new_command)\n\t\tfuzzyset_list[1].list_words.add(new_command)\n\t\twriteToFile(fuzzyset_list[1].list_words, fuzzyset_list[1].filename)\n\t}else if (chosen_cat == LEARNING_CATS[2]){\n\t\tfuzzyset_help.add(new_command)\n\t\tfuzzyset_list[2].list_words.add(new_command)\n\t\twriteToFile(fuzzyset_list[2].list_words, fuzzyset_list[2].filename)\n\t}else if (chosen_cat == LEARNING_CATS[3]){\n\t\tfuzzyset_greet.add(new_command)\n\t\tfuzzyset_list[3].list_words.add(new_command)\n\t\twriteToFile(fuzzyset_list[3].list_words, fuzzyset_list[3].filename)\n\t}\n\treturn true\n}", "title": "" }, { "docid": "38ed5a42852adbf927df3d5192725e6a", "score": "0.48921978", "text": "function categorize(input, option1, option2){\n\t//Find all the words in all the dictionaries, so each dict can be filled out for all words\n\tvar allWords = $.extend({},input, option1, option2);\n\t//console.log(\"input: \"+Object.keys(input).length);\n\t//console.log(\"option1: \"+Object.keys(option1).length);\n\t//console.log(\"option2: \"+Object.keys(option2).length);\n\t//console.log(\"allWords: \"+Object.keys(allWords).length);\n\t//console.log(\"---\");\n\t\n\t//make vectors with counts for all words`\n\tvar vectorInput = [];\n\tvar vectorOption1 = [];\n\tvar vectorOption2 = [];\n\tfor(var key in allWords) {\n\t\t//console.log(\"input key-val: \"+key+\"-\"+input[key]);\n\t\t//console.log(\"option1 key-val: \"+key+\"-\"+option1[key]);\n\t\t//console.log(\"option2 key-val: \"+key+\"-\"+option2[key]);\n\t\tif (input[key]>=0){\n\t\t\tvectorInput.push(input[key]);\n\t\t}\n\t\telse if (input[key]==undefined){\n\t\t\tvectorInput.push(0);\n\t\t}\n\t\tif (option1[key]>=0){\n\t\t\tvectorOption1.push(option1[key]);\n\t\t}\n\t\telse if (option1[key]==undefined){\n\t\t\tvectorOption1.push(0);\n\t\t}\t\t\n\t\tif (option2[key]>=0){\n\t\t\tvectorOption2.push(option2[key]);\n\t\t}\n\t\telse if (option2[key]==undefined){\n\t\t\tvectorOption2.push(0);\n\t\t}\t\t\n\t}\n\t//console.log(\"input: \"+vectorInput.length);\n\t//console.log(\" \"+vectorInput);\n\t//console.log(\"Option1: \"+vectorOption1.length);\n\t//console.log(\" \"+vectorOption1);\n\t//console.log(\"Option2: \"+vectorOption2.length);\n\t//console.log(\" \"+vectorOption2);\n\t\n\t//calculate cos\n\tvar cos1 = math.dot(vectorOption1,vectorInput)/(math.norm(vectorOption1)*math.norm(vectorInput));\n var cos2 = math.dot(vectorOption2,vectorInput)/(math.norm(vectorOption2)*math.norm(vectorInput));\n\t\n\t\n //make output\n\tvar winnerString = \"\";\n if (cos1 > cos2){\n\t\twinnerString += \"<p><b>Your text most matches Kirk!</b></p>\";\n\t}\n\telse if(cos1 < cos2){\n\t\twinnerString += \"<p><b>Your text most matches Spock!</b></p>\";\n\t}\n\telse{\n\t\twinnerString += \"<p><b>It's a tie!</b></p>\";\n\t}\n\n\twinnerString += \"<p>Kirk's cos = \"+cos1+\"<p>\";\n\twinnerString += \"<p>Spock's cos = \"+cos2+\"<p>\";\n\twinnerString += \"<p>Biggest cosine / smallest angle wins<p><br/>\";\n\t\n\tvar counter = 0;\n\twinnerString +=\"<table>\";//add borders to hd, td...\n\twinnerString +=\"<tr><th>Word</th><th>Kirk</th><th>you</th><th>Spock</th></tr>\";\n\tfor (var word in allWords){\n\t\twinnerString +=\"<tr>\";\n\t\twinnerString += \"<td >\"+word+\"</td>\";\n\t\twinnerString += \"<td style='padding:5px;text-align:center;'>\"+Math.round(vectorOption1[counter]*10000)/10000+\"</td>\";\n\t\twinnerString += \"<td style='padding:5px;text-align:center;'>\"+Math.round(vectorInput[counter]*10000)/10000+\"</td>\";\n\t\twinnerString += \"<td style='padding:5px;text-align:center;'>\"+Math.round(vectorOption2[counter]*10000)/10000+\"</td>\";\n\t\twinnerString +=\"</tr>\";\n\t\tcounter +=1;\n\t}\n\twinnerString +=\"</table>\";\n\t\n\t//make output div visible\n\tdocument.getElementById(\"inoutput\").style.visibility = \"visible\";\n\t\n\treturn winnerString; \n}", "title": "" }, { "docid": "711bfdee2f34ac976641b99c362a18af", "score": "0.4877233", "text": "function CategoryWordList(inCategory) {\r\n this.category = inCategory;\r\n this.acroWordMap = []; /* Key=Acronym, Val=AcroWordList */\r\n}", "title": "" }, { "docid": "09a45023106ae2426adac24500813a2c", "score": "0.4876425", "text": "function canMakeWord (\n word,\n characters = 'BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM'\n) {\n const wordArray = word.toUpperCase().split('');\n const charArray = characters.split(' ').map(item => item.split(''));\n\n const charObject = charArray.reduce((acc, item) => {\n item.forEach((char) => {\n acc[char] = ++acc[char] || 1;\n });\n\n return acc;\n }, {});\n\n const check = (arr, obj) => {\n if (arr.length === 0) {\n return wordArray.every(char => --obj[char] > -1);\n }\n\n const item = arr[0];\n const newArr = arr.slice(1);\n\n if (wordArray.includes(item[0]) && wordArray.includes(item[1])) {\n const newObj0 = { ...obj };\n const newObj1 = { ...obj };\n newObj0[item[0]]--;\n newObj1[item[1]]--;\n return check(newArr, newObj0) || check(newArr, newObj1);\n } else return check(newArr, { ...obj });\n };\n\n return check(charArray, charObject);\n}", "title": "" }, { "docid": "3ffdb95b9f72079713f2798db6f47354", "score": "0.48759744", "text": "function specialCases(source, word) {\n if (word in {\n \"fn:true\": \"\",\n \"fn:false\": \"\"\n } && source.lookAhead(\"()\", false)) {\n source.next();\n source.next();\n source.get();\n return {\n type: \"function\",\n style: \"xqueryAtom\",\n content: word + \"()\"\n };\n }\n else if (word in {\n \"node\": \"\",\n \"item\": \"\",\n \"text\": \"\"\n } && source.lookAhead(\"()\", false)) {\n source.next();\n source.next();\n source.get();\n return {\n type: \"function\",\n style: \"xqueryType\",\n content: word + \"()\"\n };\n }\n else if (source.lookAhead(\"(\")) {\n return {\n type: \"function\",\n style: \"xqueryFunction\",\n content: word\n };\n }\n else return null;\n }", "title": "" }, { "docid": "86260cb0cc353198a695e2e0089ad0fa", "score": "0.48728457", "text": "getProcessedArray(array) {\r\n let commonEnglishWords = ['and', 'the']\r\n let length1 = array.length;\r\n for (let i = 0; i < length1; i++) {\r\n let length2 = array[i].length;\r\n for (let j = 0; j < length2; j++) {\r\n if (commonEnglishWords.includes(array[i][j].toLowerCase()) || array[i][j].length < 3) {\r\n array[i][j] = \"\";\r\n }\r\n }\r\n }\r\n return array;\r\n }", "title": "" } ]
c10011dda5b7d3afba8a762124793155
SHOWS ALL HIGH SCORES
[ { "docid": "14290305e3aeca42b024c9165ee5b981", "score": "0.0", "text": "function showHighScores() {\n header.style.display = \"none\"; \n allDone.style.display = \"none\";\n finalScoreIs.style.display = \"none\" \n initials.style.display = \"none\" \n initialBtn.style.display = \"none\" \n initialInput.style.display = \"none\" \n highScoreButtons.style.display = \"block\"; // Show Final Score Page \n \n var getInitials = document.getElementById(\"initialInput\").value;\n var highScoreArray = JSON.parse(localStorage.getItem(\"highScore\")) || [];\n var localStorageArray = { score: secondsLeft, initials: getInitials };\n highScoreArray.push(localStorageArray)\n localStorage.setItem(\"highScore\", JSON.stringify(highScoreArray));\n var highScores = getInitials + \": \" + secondsLeft;\n\n $(\"#highScoreList\").append(highScores)\n}", "title": "" } ]
[ { "docid": "cb2e79bc77ead593f1fe79b0d3ad60c7", "score": "0.60131216", "text": "function drawShelves() {\n drawShelf(LOWER_SHELF_Y);\n drawShelf(UPPER_SHELF_Y);\n}", "title": "" }, { "docid": "a3bbc27c00ec9b722580c977f19da487", "score": "0.5887372", "text": "function C009_Library_Yuki_LeaveForHole() {\n\tC009_Library_Yuki_PenInHole = false;\n\tC009_Library_Search_PenInHole = false;\n\tC009_Library_Yuki_PenAvail = false;\n\tC009_Library_Library_CurrentZone = \"008\";\n\tC009_Library_Search_CurrentStage = 85;\n\tSetScene(CurrentChapter, \"Search\");\n}", "title": "" }, { "docid": "20d0f2ccd93bc1d634d6aa69c68f3e89", "score": "0.5701074", "text": "_triggerSpyVictory() {\n\t\tthis.setState({\n\t\t\tgameOver: 'spies'\n\t\t});\n\t}", "title": "" }, { "docid": "715071ef68b9e01b7c6f0bbd09cf39fd", "score": "0.56961507", "text": "function Disable_mouse_actions(){\n\t\t\tself.half_hard_chesse_sign.mouseEnabled = false;\n\t\t\tself.blue_chesse_sign.mouseEnabled = false;\n\t\t\tself.soft_chesse_sign.mouseEnabled = false;\n\t\t\tself.mold_cheese_sign.mouseEnabled = false;\n\t\t\tself.hard_cheese_sign.mouseEnabled = false;\n\t\t\tself.cooked_chesse_sign.mouseEnabled = false;\n\t\t\t\n\t\t\t//Chesses\n\t\t\tself.masadam_chesse.mouseEnabled = false;\n\t\t\tself.bulgarian_cheese.mouseEnabled = false;\n\t\t\tself.mozzarella_cheese.mouseEnabled = false;\n\t\t\t\n\t\t\tself.santmor_chesse.mouseEnabled = false;\n\t\t\tself.gononzola_cheese.mouseEnabled = false;\n\t\t\tself.roquefort_cheese.mouseEnabled = false;\n\t\t\t\n\t\t\tself.cottage_cheese.mouseEnabled = false;\n\t\t\tself.tzfatit_cheese.mouseEnabled = false;\n\t\t\tself.pate_cheese.mouseEnabled = false;\n\t\t\t\n\t\t\tself.bri_cheese.mouseEnabled = false;\n\t\t\tself.camembert_cheese.mouseEnabled = false;\n\t\t\tself.tom_cheese.mouseEnabled = false;\n\t\t\t\n\t\t\tself.emmental_cheese.mouseEnabled = false;\n\t\t\tself.parmesan_chesse.mouseEnabled = false;\n\t\t\tself.yellow_cheese.mouseEnabled = false;\n\t\t\t\n\t\t\tself.gruyere_cheese.mouseEnabled = false;\n\t\t\tself.borsen_cheese.mouseEnabled = false;\n\t\t\tself.dreamy_cheese.mouseEnabled = false;\n\t\t\t\n\t\t\t//Flags\n\t\t\tself.italy_flag.mouseEnabled = false;\n\t\t\tself.greece_flag.mouseEnabled = false;\n\t\t\tself.netherlands_flag.mouseEnabled = false;\n\t\t\tself.israel_flag.mouseEnabled = false;\n\t\t\tself.france_flag.mouseEnabled = false;\n\t\t\tself.switzerland_flag.mouseEnabled = false;\n\t\t}", "title": "" }, { "docid": "39e57a19bc7e9368b4e71ce067b23792", "score": "0.56920904", "text": "function soritraj_score_toggle(){\n\tif(sortiraj_po_scoreu) sortiraj_po_scoreu = false;\n\t\telse sortiraj_po_scoreu = true;\n\tupdate_pretraga();\n}", "title": "" }, { "docid": "33af727565e8e7b49bd952b370b45f4d", "score": "0.56548613", "text": "function EnSecuencia() {\n\t\t\tSecuencial = true;\n\t\t\tfor (var i = 2; i <= NumeroBotones; i++) {\n\t\t\t\troot[\"b\" + i].mouseEnabled = false;\n\t\t\t}\n\t\t\troot.b1.resalte.alpha = 100;\n\t\t}", "title": "" }, { "docid": "33af727565e8e7b49bd952b370b45f4d", "score": "0.56548613", "text": "function EnSecuencia() {\n\t\t\tSecuencial = true;\n\t\t\tfor (var i = 2; i <= NumeroBotones; i++) {\n\t\t\t\troot[\"b\" + i].mouseEnabled = false;\n\t\t\t}\n\t\t\troot.b1.resalte.alpha = 100;\n\t\t}", "title": "" }, { "docid": "1c5a33ce6c8af2d6abc5d63215f743bc", "score": "0.5645452", "text": "function C101_KinbakuClub_Lauren_StrokeBreasts() {\n\tCurrentTime = CurrentTime + 30000;\n\tif (ActorGetValue(ActorLove) < 10) ActorChangeAttitude(1, 0);\n}", "title": "" }, { "docid": "47ab80cd404973f8b2edb8d6eddea737", "score": "0.56394506", "text": "function setHot() {\n\thot = 1;\n}", "title": "" }, { "docid": "0b29c64446687f6c9cb123a04be74aac", "score": "0.56310046", "text": "function toggleHighshelf(params={}) {\n if(biquadFilter == null)\n return;\n if (params.highshelf) {\n biquadFilter.frequency.setValueAtTime(1000, audioCtx.currentTime); // we created the `biquadFilter` (i.e. \"treble\") node last time\n biquadFilter.gain.setValueAtTime(5, audioCtx.currentTime);\n } else {\n biquadFilter.gain.setValueAtTime(0, audioCtx.currentTime);\n }\n}", "title": "" }, { "docid": "7885fc2a37090174e42f12236c4386a0", "score": "0.56182355", "text": "function over_masadam_chesse(){\n\t\t\t//Show information cheese when hover\n\t\t\tself.information_on_sign.visible = true;\n\t\t\t\n\t\t\t//Show cheese information sign on left side\n\t\t\tself.information_on_sign.gotoAndStop(1);\n\t\t\t\n\t\t\t//Cheese\n\t\t\tself.bulgarian_cheese.gotoAndStop(1);\n\t\t\tself.mozzarella_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.santmor_chesse.gotoAndStop(1);\n\t\t\tself.gononzola_cheese.gotoAndStop(1);\n\t\t\tself.roquefort_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.cottage_cheese.gotoAndStop(1);\n\t\t\tself.tzfatit_cheese.gotoAndStop(1);\n\t\t\tself.pate_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.bri_cheese.gotoAndStop(1);\n\t\t\tself.camembert_cheese.gotoAndStop(1);\n\t\t\tself.tom_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.emmental_cheese.gotoAndStop(1);\n\t\t\tself.parmesan_chesse.gotoAndStop(1);\n\t\t\tself.yellow_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.gruyere_cheese.gotoAndStop(1);\n\t\t\tself.borsen_cheese.gotoAndStop(1);\n\t\t\tself.dreamy_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\t//Flags\n\t\t\tself.italy_flag.gotoAndStop(1);\n\t\t\tself.greece_flag.gotoAndStop(1);\n\t\t\tself.israel_flag.gotoAndStop(1);\n\t\t\tself.france_flag.gotoAndStop(1);\n\t\t\tself.switzerland_flag.gotoAndStop(1);\n\t\t}", "title": "" }, { "docid": "878c8c58bd7c55cd90e09cf511d3b549", "score": "0.5609104", "text": "function showHighScores() {\n addScores();\n highScoresEl.classList.remove(\"hide\");\n backBtn.classList.remove(\"hide\");\n clearButton.classList.remove(\"hide\");\n highScoreButton.classList.add(\"hide\");\n startButton.classList.add(\"hide\");\n userScore.classList.add(\"hide\");\n finalMessage.classList.add(\"hide\");\n directionsEl.classList.add(\"hide\");\n }", "title": "" }, { "docid": "e6410e84a967f671773a3ea79bd2190c", "score": "0.56063277", "text": "function unScareGhosts () {ghosts.forEach(ghost => ghost.isScared = false)}", "title": "" }, { "docid": "826d22b7177016ddecf78e999d6450d6", "score": "0.5606209", "text": "function resetHands() {\n cpuScissor.classList.add('invisible');\n cpuRock.classList.add('invisible');\n cpuPaper.classList.add('invisible');\n playerScissor.classList.add('invisible');\n playerRock.classList.add('invisible');\n playerPaper.classList.add('invisible');\n}", "title": "" }, { "docid": "d6daabc0dd8fef4c909ad2510061d6ad", "score": "0.55945706", "text": "function climbStairs() {\n\n}", "title": "" }, { "docid": "2f435cd00808c85c508a49487d44321b", "score": "0.5581095", "text": "toggleBlow()\n {\n this.blow=this.blow?0:1;\n }", "title": "" }, { "docid": "44f8f0f77072259c44c9a7619a9a30fe", "score": "0.5579996", "text": "function showHighscore() {\n\t setModuleDisplay('block');\n\t setMessage(\"\", \"\", \"\", \"\");\n\t writeOutScores();\n\t}", "title": "" }, { "docid": "6fea60072e73efd0f84e842cf139da75", "score": "0.55551946", "text": "function venusStory() {\n\tif (venRate < 100) {\n\t\tbackground(10, 10, 100, 70);\n\t}\n\n\tif (venRate > 120) {\n\t\tbackground(255);\n\t\t//water();\n\t}\n\n\tif (venRate > 700) {\n\t\tspaceselect = true;\n\t\tvenus.animation = false;\n\t\tvenus.possible = false;\n\t}\n\tconsole.log(venRate);\n\tvenRate += 1;\n}", "title": "" }, { "docid": "33fd70a891596b50d5f274fcc5b95da3", "score": "0.55390584", "text": "shovel(index) {\n const plot = this.plotList[index];\n if (!plot.isUnlocked) {\n return;\n }\n if (plot.isSafeLocked) {\n return;\n }\n if (plot.isEmpty()) {\n return;\n }\n if (plot.stage() == PlotStage.Berry) {\n this.harvest(index);\n return;\n }\n if (this.shovelAmt() <= 0) {\n return;\n }\n plot.die(true);\n GameHelper.incrementObservable(this.shovelAmt, -1);\n GameHelper.incrementObservable(App.game.statistics.totalShovelsUsed, 1);\n }", "title": "" }, { "docid": "8556ae2eb93318f378652ac80614812e", "score": "0.55353147", "text": "function mouseClicked () {\n haircolour++;\n if (haircolour>3) {\n haircolour = 1;\n }\n \n }", "title": "" }, { "docid": "b1f177ccb069706e3f368e2a518f9ec2", "score": "0.5526933", "text": "function toggleWinnerLine(s) {\n if (s === 0) {\n for (var i = 0; i < winScenario.length; i = i + 1) {\n $('#' + indexToId(winScenario[i])).addClass('win');\n }\n } else if (s === 1) {\n for (var i = 0; i < winScenario.length; i = i + 1) {\n $('#' + indexToId(winScenario[i])).removeClass('win');\n }\n }\n }", "title": "" }, { "docid": "1d6d8e49a3658c1db1a50edf6a734906", "score": "0.5509864", "text": "function C101_KinbakuClub_Lauren_HandsTooHigh() {\n\tCurrentTime = CurrentTime + 20000;\n\tC101_KinbakuClub_Lauren_HasClip = false;\n\tC101_KinbakuClub_Lauren_LocateClip = true;\n}", "title": "" }, { "docid": "e190d36af62311c05b65920c9b223af5", "score": "0.5493411", "text": "function viewHighScores () {\n welcome.setAttribute(\"style\", \"visibility: hidden\");\n questionAnswers.setAttribute(\"style\", \"visibility: hidden\");\n allDone.setAttribute(\"style\", \"visibility: hidden\");\n renderHighScores();\n}", "title": "" }, { "docid": "9be3b2493196afe88f30176896755227", "score": "0.54931486", "text": "function showerOver() {\n instructionsText.html(\"You got \" + currentDucks + showerOverText);\n playGame = false;\n gameOver = true;\n showerSound.stop();\n}", "title": "" }, { "docid": "36fb485b6259268fdd3360e0b80ac767", "score": "0.5491866", "text": "showShiningElements() {\n this.shiningElements.removeClass(CLASS_OF_THE_BLOCKED_SHINING);\n }", "title": "" }, { "docid": "5c0fa1322c87688c5d733a36a45b1302", "score": "0.5490182", "text": "function game_over(){\n if(points > high_score){\n check_other_highscores(points);\n high_score = points;\n set_high_score(points);\n }\n game_running = false;\n current_screen = \"game_over\";\n draw_game_over();\n cancelAnimationFrame(myReq);\n}", "title": "" }, { "docid": "41aaff85666f7bebd42dd3bdb1e10bab", "score": "0.5480359", "text": "function setWins() {\r\n \r\n}", "title": "" }, { "docid": "b866cdcda601293d38f68cc27bd705b5", "score": "0.5474011", "text": "_idleSynths() {\n\t\tthis._hide([SYNTH_PLAY_HAND_LEFT, SYNTH_PLAY_HAND_RIGHT]);\n\t\tthis._show([SYNTH_IDLE_HAND_LEFT, SYNTH_IDLE_HAND_RIGHT]);\n\t\tthis._toggle('#synthb', c.CLASS_FADED, !this[$synthPlayback]);\n\t}", "title": "" }, { "docid": "ef72ed2656f4a302d48f75a300ecbc9c", "score": "0.54646134", "text": "function toggleStas(){\n\tmap.closeInfoWindow();\n\tcount = 0;\n\tif(this.id ==\"plotStaTrue\"){\n\t\tplotStas = 1;\n\t\tplotStations();\n\t}else{\n\t\tplotStas = 0;\n\t\tfor (var i = 0; i<stamarker.length; i++){\n\t\t\tstamarker[i].remove();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "064ca8f6f51bd0bb0d03674d5ae07545", "score": "0.5458816", "text": "_triggerResistanceVictory() {\n\t\tthis.setState({\n\t\t\tgameOver: 'resistance'\n\t\t});\n\t}", "title": "" }, { "docid": "2575276d8aee25daf25ab8b7b5119b07", "score": "0.54561317", "text": "function ballPowerUpCollide() {\r\n powerUp.visible = false;\r\n ball.fill = powerUpColor;\r\n console.log(\"Power Up acquired! You can smash through bricks now.\");\r\n}", "title": "" }, { "docid": "bcae36b959e471cb8c864723afe5ba6b", "score": "0.54423535", "text": "function slap() {\n target.health -= 1 + addMods();\n target.hits++;\n update();\n}", "title": "" }, { "docid": "6cd92a1023bb370d45b5fa3329751ea7", "score": "0.54379815", "text": "function toggleWiseman() {\r\n\t\twiseFight = !wiseFight;\r\n\t\tGM_setValue(\"wiseFight\", wiseFight);\r\n\t\tif(wiseFight)\r\n\t\t{\r\n\t\t\t$(\"#xwise\").attr(\"value\", \"Wise:Fight\");\r\n\t\t}\r\n\t\telse\r\n\t\t{ \r\n\t\t\t$(\"#xwise\").attr(\"value\", \"Wise:Accept\");\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "cba2b648b4ed2bb7c08065c29dc4d994", "score": "0.54340404", "text": "function strobeHighScoreTextColour() {\n if (currentHighScoreColourIndex < highScoreColours.length - 1) {\n currentHighScoreColourIndex++;\n } else {\n // reset\n currentHighScoreColourIndex = 0;\n }\n isUpdatingHighScoreColour = false;\n }", "title": "" }, { "docid": "4e916107cb6947982e9a947b504c0c71", "score": "0.54263353", "text": "highLight(index){\n for (let i =0;i < this.stars.length;i++){\n this.stars[i].classList.toggle('full',i <= index);\n }\n }", "title": "" }, { "docid": "7b78c0cea0b013a6d1b9bf2500f16fd8", "score": "0.54245776", "text": "function pBlackjack(score){\r\n if (score===21||score>21){\r\n dealerPlay();\r\n $(\".hit,.stand\").css(\"visibility\",\"hidden\")\r\n }\r\n}", "title": "" }, { "docid": "d3a14b0762a2f0c4efefa7b10bff7521", "score": "0.5423563", "text": "function updateLose(){\n\t\tupdateWin();\n\t}", "title": "" }, { "docid": "878579227d5a97b4bae982ce12f5490d", "score": "0.5423172", "text": "function powerPelletEaten () {\r\n\t\t\tif (squares[pacmanCurrentIndex].classList.contains(\"power-pellet\")) {\r\n\t\t\t\tscore += 10;\r\n\t\t\t\ttoWin += 10;\r\n\t\t\t\t//ghosts.forEach(ghost => ghost.isScared = true);\r\n\t\t\t\t//setTimeout(unScareGhosts, 7000);\r\n\t\t\t\tsquares[pacmanCurrentIndex].classList.remove(\"power-pellet\");\r\n\t\t\t\teatlist=eatlist+\"-\";\r\n\t\t\t}\r\n\t\t\tscoreDisplay.innerHTML = score;\r\n\t\t}", "title": "" }, { "docid": "3285840ebd034d48c10ff00fa590841e", "score": "0.5423154", "text": "function strobeHelpColours() {\n if (currentHelpColourIndex < bonusColours.length) {\n currentHelpColourIndex++;\n } else {\n currentHelpColourIndex = 0;\n }\n isUpdatingHelpColour = false;\n }", "title": "" }, { "docid": "f158b45be42ca8e5368190e91b9f9dc3", "score": "0.5414776", "text": "function updateOverblowUI(){\n\t\t$(\"#overblows\").toggleClass(\"obs-on\", overblows)\n\t\t\t\t\t\t\t\t .toggleClass(\"obs-off\", !overblows);\n\t\t$(\"#mainTable .overblow\").toggle(overblows);\n\t}", "title": "" }, { "docid": "eab11caae9ef58a7fd8cf139717999da", "score": "0.54100376", "text": "function maptoggle(e) {\n // read the value from the slider\n var value = slider.value;\n\n var mapId = \"PERCENT OVER \" + value + \" MIN\";\n\n map.setLayoutProperty('PERCENT OVER 30 MIN', 'visibility', 'none');\n map.setLayoutProperty('PERCENT OVER 60 MIN', 'visibility', 'none');\n map.setLayoutProperty('PERCENT OVER 90 MIN', 'visibility', 'none');\n map.setLayoutProperty('PERCENT OVER 120 MIN', 'visibility', 'none');\n\n map.setLayoutProperty(mapId, 'visibility', 'visible');\n}", "title": "" }, { "docid": "fb63722c734a63e459a4089127fc9133", "score": "0.5405907", "text": "function reveal() {\n let board = document.getElementById(\"board\").children;\n for(let i = 0; i < 256; i++) {\n let piece = board[i];\n if(piece.className == \"mine\") {\n piece.style.backgroundColor = \"red\";\n }\n\t\t\tpiece.onclick = null;\n\t\t\tpiece.onmouseover = null;\n }\n }", "title": "" }, { "docid": "0f6267cd6e061209dba67dc8a08615e5", "score": "0.53905", "text": "function onMouseOut (event)\n{\n\t//When the mouse has been removed, move the smoke off-screen.\n\t//This is cheap and dirty; really they should stop generating all together.\n\tParticles.startXpos = -255;\n\tParticles.startYpos = 350;\n\tconsole.log(\"beans\");\n}", "title": "" }, { "docid": "5377c272cec700856ebbbc7d26d8ed16", "score": "0.5389954", "text": "function WinLoose () {\n if (score === compPick) {\n wins++;\n $('#wins').text(wins)\n reset();\n } else if (score > compPick) {\n losses++;\n $('#losses').text(losses);\n reset();\n };\n }", "title": "" }, { "docid": "6ccd53634f453263e89fad10dfa2eb5c", "score": "0.53850716", "text": "function unScareGhosts() {\n\n ghosts.forEach(function(ghost) {ghost.isScared = false})\n\n}", "title": "" }, { "docid": "ad09e0241472d07f5fbce2a961ef6896", "score": "0.5377106", "text": "hit()\n {\n while(this.hand.getHandTotal()<17)\n {\n super.hit();\n }\n }", "title": "" }, { "docid": "09ed062502458e95607d5893a879745e", "score": "0.53739095", "text": "drawScore() {\n\t\tRoundScore(this.ctx, this.player1Selction.wins, false);\n\t\tRoundScore(this.ctx, this.player2Selction.wins, true);\n\t}", "title": "" }, { "docid": "537cee66340f8e29f6321a0260bd240b", "score": "0.5372761", "text": "function leftScore() { \n for(let i in highscores) { \n $scoreRight.show(500); \n if($(highscores[i]).hasClass('active')) {\n i == 1 && $scoreLeft.hide(500);\n $(highscores[i]).removeClass('active'); \n $(highscores[(--i)]).addClass('active');\n break;\n }\n } \n }", "title": "" }, { "docid": "1331c00bf79e64e758976eaaa16193fd", "score": "0.5370929", "text": "function mouseOutfunc() {\n heart.innerHTML = \"favorite\";\n }", "title": "" }, { "docid": "fb05e55939e7f4317b5d6df10d32fb96", "score": "0.5369177", "text": "function playAreaHighlight() {\n\tif (!splitTurn) {\n\t\tplayerHand.addClass('red');\n\t}\n\telse {\n\t\tplayerHand.removeClass('red');\n\t\tplayerHand2.addClass('red');\n\t}\n}", "title": "" }, { "docid": "27661db6d83ec782ea2f89b2abd2248e", "score": "0.5369075", "text": "overHeat() {\n this.functional = false;\n }", "title": "" }, { "docid": "00a9be9e898acea6d2224cc9a4e671b8", "score": "0.5367082", "text": "static set showColliderSleep(value) {}", "title": "" }, { "docid": "993b627cfa3bbeaad7bf43e53c0b4d9c", "score": "0.5359074", "text": "function setScreen () {\n\tluke.toggleOn();\n\tluke.toggleOff1();\n\tluke.toggleOff2();\n\tluke.toggleOff3();\n\tobiwan.toggleOn();\n\tobiwan.toggleOff1();\n\tobiwan.toggleOff2();\n\tobiwan.toggleOff3();\n\tdarthvader.toggleOn();\n\tdarthvader.toggleOff1();\n\tdarthvader.toggleOff2();\n\tdarthvader.toggleOff3();\n\tdarthmaul.toggleOn();\n\tdarthmaul.toggleOff1();\n\tdarthmaul.toggleOff2();\n\tdarthmaul.toggleOff3();\n}", "title": "" }, { "docid": "57ddd9f398c8381e68a18b2817c62ecc", "score": "0.53576815", "text": "function memResetHighScores() {\n Game.highScores = [0, 0, 0];\n memSaveHighScores();\n Game.refreshScreen();\n}", "title": "" }, { "docid": "11f5cee28956330f0e0a7f977a9f0f0d", "score": "0.535346", "text": "function showerEffect(ctx){\n \n if(flow===false){\n flow=true;\n showerX+=2;\n }\n else{\n flow=false;\n showerX-=2;\n } \n}", "title": "" }, { "docid": "78cb09485539fff84a4e2f506e1d84c2", "score": "0.5344469", "text": "if (m_iHighScore>m_iBeatenHighScore) {\n // remember that it was beaten\n m_iBeatenHighScore = m_iHighScore;\n // tell that to player\n m_soHighScore.Set3DParameters(25.0f, 5.0f, 1.0f, 1.0f);\n //PlaySound(m_soHighScore, SOUND_HIGHSCORE, 0); !!!!####!!!!\n }", "title": "" }, { "docid": "8da6245761fb644f706c32d31afef1c4", "score": "0.53405285", "text": "drawHighScore() {\n this.canvasCtx.save();\n this.canvasCtx.globalAlpha = .8;\n for (let i = this.highScore.length - 1; i >= 0; i--) {\n this.draw(i, parseInt(this.highScore[i], 10), true);\n }\n this.canvasCtx.restore();\n }", "title": "" }, { "docid": "ba981f352f8125ea04ac47d0320ff433", "score": "0.5329069", "text": "silverCollision(silver, i) {\n if (\n this.me.player.x >= silver.x - 25 &&\n this.me.player.x <= silver.x + 25 &&\n this.me.player.y >= silver.y - 25 &&\n this.me.player.y <= silver.y + 25\n ) {\n // because the x, y coordinates of the meat and\n // player never line up perfectly, give a range\n // of overlapping variables\n delete this.silverObj[i];\n silver.destroy();\n this.score++;\n this.humanAnvilSfx.play();\n this.scoreTextValue.text = this.score.toString();\n if (this.score % 10 === 0 && this.score !== 0) {\n this.humanBladeSfx.play();\n this.switchRoles();\n } else if (this.score % 10 >= 1 || this.score !== 0) {\n this.humanAnvilSfx.play();\n }\n this.socket.emit('forge', { id: this.me.id, score: this.score });\n }\n }", "title": "" }, { "docid": "fc9b02e4a52f5d45e6d3d69b7180292f", "score": "0.53251016", "text": "function gameOver() {\n if (syrups == 0) {\n divy.classList.remove(\"hidden\");\n canvas.classList.add(\"hidden\");\n score.textContent = 10;\n\n }\n}", "title": "" }, { "docid": "148a4f37f0443afd5cf251a8f01e7e2c", "score": "0.5317529", "text": "function overlapVirusesWeapons(scene) {\n scene.physics.add.overlap(weapons, viruses, (weapon, virus) => {\n virus.disableBody(true, true);\n soundFallingVirus.play();\n if (viruses.countActive(true) > 0) {\n createNewVirus();\n }\n createNewVirusesIfNoLeft(scene);\n incrementScoreShown();\n if (isHighScoreReached()) {\n scene.physics.pause();\n createSweatAlert(\"Your last highScore was reached\", \"Do you want to continue or stop playing?\", \"success\", null, [\"No, stop playing\", \"Yes please continue to play\"]).then(playOrNot => {\n if (playOrNot) {\n scene.physics.resume();\n }\n });\n }\n });\n}", "title": "" }, { "docid": "6bd39794a7eb9d2d95e7a800918ce8c8", "score": "0.5314175", "text": "function toggleLowshelf(params={}) {\n if(lowShelfBiquadFilter == null)\n return;\n if (params.lowshelf) {\n lowShelfBiquadFilter.frequency.setValueAtTime(1000, audioCtx.currentTime);\n lowShelfBiquadFilter.gain.setValueAtTime(5, audioCtx.currentTime);\n } else {\n lowShelfBiquadFilter.gain.setValueAtTime(0, audioCtx.currentTime);\n }\n}", "title": "" }, { "docid": "5a467187bf58b4f8ec6fb651fb931c16", "score": "0.5310533", "text": "onSight(){\n console.log('sightHit');\n descriptionSet('Behind the painting is a hole punched in the wall.\\nA couple of flies go in and out.');\n }", "title": "" }, { "docid": "85a4bf29bf0a81d5f4d264a358bc31db", "score": "0.5304635", "text": "highScoreToggle() {\n let rules = document.getElementById('showRules')\n let highScore = document.getElementById('showHighScore')\n this.updateHighScoreList()\n //console.log(highScore.style.display)\n if (highScore.style.display == 'block' || rules.style.display == 'block') {\n highScore.style.display = 'none'\n rules.style.display = 'none'\n } else {\n highScore.style.display = 'block' || rules.style.display == 'block'\n }\n }", "title": "" }, { "docid": "99fc4a36dd066813a77815d95a3c2f46", "score": "0.5300169", "text": "function over_italy_flag(){\n\t\t\n\t\t\t//Don't show information sign when hover\n\t\t\tself.information_on_sign.visible = false;\n\t\t\t\n\t\t\t//Light signs releted to cheese flags\n\t\t\tself.half_hard_chesse_sign.gotoAndStop(0);\n\t\t\tself.blue_chesse_sign.gotoAndStop(0);\n\t\t\tself.soft_chesse_sign.gotoAndStop(1);\n\t\t\tself.mold_cheese_sign.gotoAndStop(1);\n\t\t\tself.hard_cheese_sign.gotoAndStop(0);\n\t\t\tself.cooked_chesse_sign.gotoAndStop(1);\n\t\t\t\n\t\t\t//Light cheese\n\t\t\tself.masadam_chesse.gotoAndStop(1);\n\t\t\t\n\t\t\tself.santmor_chesse.gotoAndStop(1);\n\t\t\n\t\t\tself.roquefort_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.cottage_cheese.gotoAndStop(1);\n\t\t\tself.tzfatit_cheese.gotoAndStop(1);\n\t\t\tself.pate_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.bri_cheese.gotoAndStop(1);\n\t\t\tself.camembert_cheese.gotoAndStop(1);\n\t\t\tself.tom_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.emmental_cheese.gotoAndStop(1);\n\t\t\tself.yellow_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\tself.gruyere_cheese.gotoAndStop(1);\n\t\t\tself.borsen_cheese.gotoAndStop(1);\n\t\t\tself.dreamy_cheese.gotoAndStop(1);\n\t\t\t\n\t\t\t//Light flags\n\t\t\tself.italy_flag.gotoAndStop(0);\n\t\t\tself.greece_flag.gotoAndStop(1);\n\t\t\tself.netherlands_flag.gotoAndStop(1);\n\t\t\tself.israel_flag.gotoAndStop(1);\n\t\t\tself.france_flag.gotoAndStop(1);\n\t\t\tself.switzerland_flag.gotoAndStop(1);\n\t\t\t\n\t\t\t\n\t\t}", "title": "" }, { "docid": "b0f3439205f43240b6dd422d16dc5771", "score": "0.529873", "text": "checkIfSceneSwitch() {\n if (this.baddiesCaught === 4) { //triggers that amount of baddies that each dog should get\n console.log(\"itstrue\") // I feel like this part is half working. It does not trigger the amount of spies properly but it was an iniative.\n }\n }", "title": "" }, { "docid": "79b2738be483cfec789387a4d4490f15", "score": "0.52986735", "text": "function bigWin(){\n if(affectSound){\n littleWinner.pause();\n jackpotWinner.play();\n play = false;\n }\n }", "title": "" }, { "docid": "2afcd46d0794ce9c1c78a119f00ce844", "score": "0.52846116", "text": "hideShiningElements() {\n this.shiningElements.addClass(CLASS_OF_THE_BLOCKED_SHINING);\n }", "title": "" }, { "docid": "f4cef573127651864a269ab2c2f7d388", "score": "0.5280448", "text": "function rightScore() {\n for(let i in highscores) { \n $scoreLeft.show(500); \n if($(highscores[i]).hasClass('active')) {\n i == 1 && $scoreRight.hide(500);\n $(highscores[i]).removeClass('active'); \n $(highscores[(++i)]).addClass('active');\n break;\n } \n } \n }", "title": "" }, { "docid": "498d1616206824b0254dca6a86a0b91c", "score": "0.5278616", "text": "_showScores() {\r\n // Removes show class from everyone except the screen to show\r\n this.splashElement.removeClass('show');\r\n this.gameElement.removeClass('show');\r\n this.scoresElement.removeClass('hide');\r\n this.endElement.removeClass('show');\r\n this.creditsElement.removeClass('show');\r\n\r\n // Adds hide class to everyone except the screen to show\r\n this.splashElement.addClass('hide');\r\n this.gameElement.addClass('hide');\r\n this.scoresElement.addClass('show');\r\n this.endElement.addClass('hide');\r\n this.creditsElement.addClass('hide');\r\n\r\n // Stops all music to prevent overlaps\r\n this._stopAllMusic();\r\n\r\n // Play theme music\r\n APP.MUSIC.IDLE.play();\r\n }", "title": "" }, { "docid": "82b413266e38ae8ea33a0c76202458db", "score": "0.5275253", "text": "function Purify (rainy, enemy)\r\n{\r\n //updates the score and normalize the birds tint\r\nrainy.body.enable = false;\r\n score+=10;\r\n enemy.setTint(0xffffff);\r\n\r\n}", "title": "" }, { "docid": "afb75f2db922cbb38d6a199966086b67", "score": "0.52682495", "text": "function shide(){ // GT: Looks like this controls only which magnitude range is shown\n\tvar grp = this.id;\n\tvar checked = this.checked;\n\tcheckBoxes(grp);\n\tmanageList(grp, checked);\n\tif (grp == \"eqAll\"){\n\t\teqNum = 0;\n\t}\n\tfor (var i=0; i<gmarkers.length; i++) {\n\t\tif (grp == \"eqAll\"){ //if 'eqall' button is clicked(shows all or hides all)\n\t\t\tif(checked){\n\t\t\t\tgmarkers[i].show();\n\t\t\t\teqNum++;\n\t\t\t}else{\n\t\t\t\tif(gmarkers[i].grp.substr(0,2) =='eq' ){\n\t\t\t\t\tgmarkers[i].hide();\n\t\t\t\t\teqNum--;\n\t\t\t\t\tmap.closeInfoWindow();\n\t\t\t\t}\t\n\t\t\t}\n\t\t}else{\n\t\t\tif (gmarkers[i].grp == grp){//individual button clicked\n\t\t\t\tif(checked){\n \t\t\tgmarkers[i].show();\n\t\t\t\t\teqNum++;\n\t\t\t\t}else{\n\t\t\t\t\tgmarkers[i].hide();\n\t\t\t\t\teqNum--;\n\t\t\t\t\tmap.closeInfoWindow();\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t} \t\n\t$(\"numberEQs\").innerHTML= eqNum;\n\tupdateXsec();\n}", "title": "" }, { "docid": "da4f3999429bfab7f35747a2fe3358ef", "score": "0.52651197", "text": "function toggleSun(){\n\tif(sun.intensity === 1)\n\t\tsun.intensity = 0;\n\telse\n\t\tsun.intensity = 1;\n}", "title": "" }, { "docid": "f4917d9234946ce05d7354c128e781a0", "score": "0.52640903", "text": "function showSquirtle (event) {\n\t\t\tdocument\n\t\t\t\t.querySelector(\"h3.water\")\n\t\t\t\t.textContent = \"#003, Tiny Turtle Pokémon\"\n\t\t}", "title": "" }, { "docid": "339d3b852d031a57a8d73d35886a6978", "score": "0.52614254", "text": "function slap() {\n myTarget.health -= 1 * addMods();\n myTarget.hits++;\n //alert(health)\n\n update()\n}", "title": "" }, { "docid": "80ee177a2ca1f61e712d44b3501cbe5d", "score": "0.525766", "text": "function whack(e) {\n score++;\n hitAudio.play();\n\n // Bring walrus down once clicked\n this.parentElement.classList.remove(\"up\");\n scoreboard.textContent = score;\n }", "title": "" }, { "docid": "6e1e1d11a3624bbd76ed6d10531437c8", "score": "0.5254734", "text": "function mouseOver() {\n $(document).mousemove(function (event) {\n //mouse controls lazer sights\n document.body.style.cursor = 'none';\n sights.position.x = 3.55 * (-window.innerWidth / 2 + event.pageX);\n sights.position.y = 3.55 * (window.innerHeight / 2 - event.pageY);\n sightsMoved = true;\n });\n}", "title": "" }, { "docid": "3001892eda9d8fd888f37c0d40c13f33", "score": "0.52544844", "text": "displayShots(){\r\n switch(this.shotCount){\r\n case 1:\r\n this.syringeOne.style.color = 'grey';\r\n this.syringeTwo.style.textShadow ='0 0 1rem white';\r\n this.syringeOne.style.textShadow ='none';\r\n\r\n break;\r\n case 2:\r\n this.syringeTwo.style.color = 'grey';\r\n this.syringeThree.style.textShadow ='0 0 1rem white';\r\n this.syringeTwo.style.textShadow ='none';\r\n\r\n break;\r\n case 3:\r\n this.syringeThree.style.color = 'grey';\r\n this.syringeThree.style.textShadow ='0 0 1rem white';\r\n this.syringeThree.style.textShadow ='none';\r\n\r\n break; \r\n default:\r\n return;\r\n }\r\n }", "title": "" }, { "docid": "2a225937303fac16e09e449a90f2aee4", "score": "0.5251725", "text": "function gameOver(){\r\n alert(\"Przegrałeś. Twój wynik to: \"+points+ \". Odśwież by spróbować ponownie\");\r\n active = false;\r\n return;\r\n }", "title": "" }, { "docid": "df101cd054bf5eace6546a4dfed1ad24", "score": "0.5247567", "text": "function swarmslowdown()\t{\n\tfor (var i = 0; i < swarm.fireflies.length; i++) {\n\t\tvar change = map(gameposition, 12800, 13200, 0, 2);\n\t\t\tswarm.fireflies[i].position.x -= change;\n\t\t\tswarm.fireflies[i].center.x -= change;\n\t}\n}", "title": "" }, { "docid": "35e6d393abccbdff11f3e7f85cbc84b7", "score": "0.52465945", "text": "function drawSilly(){\n C.sprite({n:\"points\",w:50,h:30, x:0,y:0,z:0,html:\"+50\"})\n selectFeatures()\n C.plane({n:\"s_jetstream\",g:\"silly\",w:35,h:65,x:0,y:0,z:-20,b:\"linear-gradient(red, yellow)\",rx:-90,css:\"triangle-bottom\"});\n document.getElementById(\"s_jetstream\").style.visibility = \"hidden\";\n C.sprite({n:\"s_body\",g:\"silly\",w:40,h:50,x:0,y:0,z:20,b:colors[color][0],css:\"circle\"});\n if (eyes > 1) {\n C.plane({n:\"s_eyes\",g:\"silly\",w:30,h:16,y:20,z:32,html:eye_sets[eyes],rx:-70,o:\"bottom\",css:\"glasses\"});\n }\n else\n {\n C.plane({n:\"s_eyes\",g:\"silly\",w:30,h:16,y:20,z:27,html:eye_sets[eyes],rx:-70,o:\"bottom\",css:\"face\"});\n }\n C.plane({n:\"s_mouth\",g:\"silly\",w:30,h:16,y:20,z:10,html:mouths[mouth],rx:-95,o:\"bottom\",css:\"face\"});\n C.cube({n:\"s_firstleg\",g:\"silly\",w:10,h:22,x:20,y:0,z:-10,b:colors[color][0],b1:colors[color][2],b2:colors[color][1]});\n C.cube({n:\"s_secondleg\",g:\"silly\",w:10,h:22,x:-20,y:0,z:-10,b:colors[color][0],b1:colors[color][2],b2:colors[color][1]});\n}", "title": "" }, { "docid": "72b07568fd1df8fc09dd0a66904678e5", "score": "0.52464885", "text": "function toggleSpirit() {\r\n battle.lock_action(this, 0, 'spirit');\r\n}", "title": "" }, { "docid": "c237de286c5bba72a0002fb8862c266f", "score": "0.5244599", "text": "function updateScoreGame(gameScore,lives){\n\tdocument.getElementById(\"scoreUpdates\").innerHTML = \"score: \" + gameScore;\n\tif (lives <= 2){\n\t\tdocument.getElementById(\"shinyness0\").style.display = \"none\";\n\t\tif (lives <= 1){\n\t\t\tdocument.getElementById(\"shinyness1\").style.display = \"none\";\n\t\t\tif (lives = 0){\n\t\t\t\tdocument.getElementById(\"shinyness2\").style.display = \"none\";\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "e0db295925ccbb83aefcc9e6509b80e3", "score": "0.52346283", "text": "function gameOver() {\n\tclearUndo();\n\t$one('body').classList.add('game-over');\n}", "title": "" }, { "docid": "b294698305feb0db868d9ec9ada29b55", "score": "0.5231503", "text": "function powerPelletEaten() {\n if (squares[pacmanCurrentIndex].classList.contains(\"power-pellet\")) {\n // adding 10 points to the score\n score += 10;\n // adding isScared to the ghosts\n ghosts.forEach((ghost) => (ghost.isScared = true));\n // setting scare time to 10 seconds\n setTimeout(unScareGhost, 10000);\n // removing the power pellet class\n squares[pacmanCurrentIndex].classList.remove(\"power-pellet\");\n }\n }", "title": "" }, { "docid": "2e2bdfbb27929990636be6ba6ec625d5", "score": "0.52308035", "text": "function handleViewHighScore() {\n sceneOne.style.display = \"none\";\n sceneTwo.style.display = \"none\";\n sceneThree.style.display = \"none\";\n updateScoreBoard();\n sceneFour.style.display = \"block\";\n}", "title": "" }, { "docid": "cf6df78cdb99eed63dddbcccea250c2b", "score": "0.5226197", "text": "function toggleDraw(){\n draw_flag = !draw_flag;\n if(!draw_flag) hideScore();\n else showScore();\n}", "title": "" }, { "docid": "682a3314fc9077f3c695ee6ff997e6e6", "score": "0.5225693", "text": "function overlapVirusesPlayer(scene) {\n scene.physics.add.overlap(player, viruses, (player, virus) => {\n if (virus.body.touching.down) {\n soundGameOver.play();\n scene.physics.pause();\n player.setTint(0xff0000);\n gameOver = true;\n saveScoreHighScoreIfhigherThanLast();\n let messageAboutHighScore = (score > highScore) ? `You died! Your new highScore is: ${score}` : \"You died, as you did not surpass your highscore, it was left untouched\";\n createSweatAlert(\"Oh no!\", messageAboutHighScore, \"info\", \"Ok, thank you\");\n } else {\n disableVirusIfWalkedOver(scene, virus);\n }\n });\n}", "title": "" }, { "docid": "fef9289a5a2ca6d9feadd4bb1019c948", "score": "0.5218898", "text": "function C008_DramaClass_Julia_Strip() {\n\tActorSetCloth(\"Underwear\");\n\tCurrentTime = CurrentTime + 50000;\n}", "title": "" }, { "docid": "34c4875fb73a53e05a01cb838ed8aae8", "score": "0.5218727", "text": "function power_scorch() {\r\n\r\n combat.defense_action = \"Scorch!\";\r\n \r\n // check miss\r\n var hit_chance = Math.random();\r\n if (hit_chance < 0.30) {\r\n combat.defense_result = \"Miss!\";\r\n sounds_play(SFX_MISS);\r\n return;\r\n }\r\n \r\n sounds_play(SFX_FIRE);\r\n\r\n var atk_min = enemy.stats[combat.enemy.type].atk_min;\r\n var atk_max = enemy.stats[combat.enemy.type].atk_max;\r\n var attack_damage = Math.round(Math.random() * (atk_max - atk_min)) + atk_min;\r\n\r\n // scorch works like an enemy crit\r\n attack_damage += atk_min;\r\n\r\n // armor absorb\r\n attack_damage -= info.armors[avatar.armor].def;\r\n if (attack_damage <= 0) attack_damage = 1;\r\n \r\n avatar.hp -= attack_damage;\r\n combat.defense_result = attack_damage + \" damage\";\r\n \r\n combat.hero_hurt = true;\r\n \r\n}", "title": "" }, { "docid": "fdc3372f09d27bca485d49db715b7628", "score": "0.5218185", "text": "function ABILITY_MAJOR_HEAL(actor){\n actor.restoreHP(40);\n}", "title": "" }, { "docid": "c50fba89a291ab1bae02e6d345021ff2", "score": "0.52117115", "text": "function Stall(){\n if (scorePlayer > scorePC ) {\n giveComputerCard();\n Stall();\n }else{\n evaluate();\n }\n\n }", "title": "" }, { "docid": "82604368757d325a99a3cb8b5bd4833d", "score": "0.52101177", "text": "function displayHighScores() {\n addNewLine();\n console.log(pokeYellowAndBlue.underline.bold(\"HIGH SCORES\"));\n // Iterating through each top scorer's entry in the topScorers array, and displaying his/her name alongside the score he/she scored.\n for(let player = 0; player < topScorers.length; player++) {\n console.log(pokeBlue((player+1)+'.) '+pokeYellow.italic(topScorers[player].userName)+\"\\t------->\\t\")+pokeYellow.italic(topScorers[player].score));\n }\n addNewLine();\n}", "title": "" }, { "docid": "d6af796376dd9818ffbf2e9fb188f3f6", "score": "0.52091247", "text": "function toggleAllStories() {\n\t\t$allStoriesList.toggle();\n\t}", "title": "" }, { "docid": "593f30377bf4bca5270f0956c1ed3139", "score": "0.52088296", "text": "function powerPelletEaten() {\n\t\tif (squares[pacmanCurrentPosition].classList.contains('power-pellet')) {\n\t\t\tscore += 10;\n\t\t\tscoreDisplay.textContent = score;\n\t\t\tghosts.forEach((ghost) => {\n\t\t\t\tghost.isScared = true;\n\t\t\t});\n\t\t\tsetTimeout(makeGhostUnscared(), 10000);\n\t\t\tsquares[pacmanCurrentPosition].classList.remove('power-pellet');\n\t\t}\n\t}", "title": "" }, { "docid": "27e3c2b204cdfc13639a890bf6699318", "score": "0.52075267", "text": "toggleHighPerf() {\n this.update({\n resolution: this.get('resolution') === 5 ? 1 : 5,\n });\n }", "title": "" }, { "docid": "8f4d636a9383068a557c7bc4ce8a7be7", "score": "0.5207141", "text": "function checkLose(){\n for(var i = 0; i < monsters.length; i++ ){\n \t if(monsters[i].monsterY >= 9 * monsterHeigth){\n for(var j = 0; j < monsters[i].spArr.length; j++ ){\n if( !monsters[i].spArr[j].isKilled){\n \t window.cancelAnimationFrame(req); \n \t ctx.clearRect(0, 0, canvas.width, canvas.height); \n ctx.fillStyle = \"red\"; \n ctx.font = 'bold 30px sans-serif'; \n ctx.fillText(\"YOU LOSE \", 180, 200);\n ctx.fillText(\"Press F5 for restart!\", 120, 240);\n ctx.fillText(\"Your score:\" + score, 130, 280);\n youLose = true;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "744af5c80e2becee06612c60479ddd07", "score": "0.5204805", "text": "function ABILITY_DIVINE_HEAL(actor){\n actor.restoreHP(9999);\n}", "title": "" }, { "docid": "72f2dca31d2a2509cec1112be58253c5", "score": "0.52032006", "text": "function winGame(){\n\tfor(var b=0; b<MAXBALLS; ++b)\n\t\tballs_Group.getAt(b).kill();\n\tdrops_Group.removeAll(true);\n\tpaddle_Sprite.visible = false;\n\twarningLine_Sprite.visible = false;\n}", "title": "" }, { "docid": "44dacdae5e3cbad183e22450d4e9b0fe", "score": "0.5201096", "text": "function drawGame(){\n drawBall();\n drawBallShadow();\n drawPlayersShadow();\n drawPlayers();\n drawScores();\n drawWalls();\n drawShields();\n setScore(1,0);\n setScore(2,0);\n drawAxis();\n}", "title": "" }, { "docid": "b7154d789986d53cc124c91971eee595", "score": "0.5198844", "text": "function estiahToggleAllRollovers() {\r\n var i = document.getElementById(\"pvp_all_rollover\");\r\n if (i.style.display == \"\") {\r\n i.style.display = \"none\";\r\n }\r\n else {\r\n updateAllRollovers(i);\r\n i.style.display = \"\";\r\n }\r\n}", "title": "" }, { "docid": "841570eb5fad931be52435940e3709e9", "score": "0.5196386", "text": "function updatePipes(){\r\n for(i of pipes){\r\n //If past the pipe's entrance, count the pipe as scored and increment the score variable\r\n if(((c.width / 2) - c.height / 4) > i.x && !i.scored){ \r\n i.scored = true;\r\n score++;\r\n }\r\n\r\n\r\n i.x -= 0.005 * c.height; //move each pipe to the left\r\n if(Math.abs(bird.height * c.height - i.gapY) > i.gapHeight / 2 && ((c.width / 2) - c.height / 4) > i.x && ((c.width / 2) - c.height / 4) < i.x + i.width){ //If the bird is outside of the gap but in the pipe\r\n gameOver = true; //If the bird touches the pipe, end the game\r\n }\r\n ctx.fillRect(i.x, 0, i.width, i.gapY - i.gapHeight / 2);//Draw the top of the pipe\r\n ctx.fillRect(i.x, i.gapY + i.gapHeight/2, i.width, c.height);//Draw the top of the pipe\r\n\r\n }\r\n}", "title": "" } ]
2c6112cd24362bb5ca0599b0439cc4bc
function section Returns a list of values either sorted or not depending on parameters
[ { "docid": "e5366fbb20fe13c007f617b5357af848", "score": "0.55975366", "text": "function returnList(attr, sort) {\n var list = [...new Set(data.map(obj => obj[attr]))];\n if (sort === true)\n list = list.sort();\n return list;\n}", "title": "" } ]
[ { "docid": "c5cd5c4fb49a753bccf3763648f84d49", "score": "0.6661487", "text": "function Sort() {}", "title": "" }, { "docid": "c5cd5c4fb49a753bccf3763648f84d49", "score": "0.6661487", "text": "function Sort() {}", "title": "" }, { "docid": "eb04b2ada6294d9b67a938bad6365118", "score": "0.63069993", "text": "function sorted (array) {\n\n}", "title": "" }, { "docid": "38abeb92da6cd2a29c8c3d29f83b3a9a", "score": "0.6302725", "text": "function exec_sort(query_sort){\n return [[options_mapping[query_sort][0], options_mapping[query_sort][1]]];\n}", "title": "" }, { "docid": "7ce7c7f60bfaf554656aa6b77d7ff5d1", "score": "0.6265936", "text": "function sorterFunction(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "3f01fe78afc866875f941f13f80d7d00", "score": "0.60811895", "text": "function PutInOrder(){\n var args = [].slice.call(arguments);\n var array2 = args.sort();\n // console.log(array2);\n return array2;\n }", "title": "" }, { "docid": "7d0164d6661ec3b57675c75ce9dea7b5", "score": "0.60569704", "text": "function sortByAge() {}", "title": "" }, { "docid": "1b0a9c83c8bb2162c106e2b68c9658f8", "score": "0.60251313", "text": "function sort() {\n var result = [reportVm.predicate + ',' + (reportVm.reverse ? 'asc' : 'desc')];\n return result;\n }", "title": "" }, { "docid": "56cca568bce6bba49022beef8d206323", "score": "0.6024513", "text": "function sorter(a, b){\n return a - b;\n }", "title": "" }, { "docid": "dea15cdf07bf8a00e65c626af9df5088", "score": "0.60189146", "text": "function sortValues () {\n\t'use strict';\n\tvar input = document.getElementById('sv-input').value.split(',');\n\tvar output = document.getElementById('sv-output');\n\n\tif (Number(input[0]) > Number(input[1]) && Number(input[0]) > Number(input[2])) {\n\n\t\tif (Number(input[1]) > Number(input[2])) {\n\t\t\toutput.innerHTML = input[0] + '; ' + input[1] + '; ' + input[2];\n\t\t}\n\t\telse {\n\t\t\toutput.innerHTML = input[0] + '; ' + input[2] + '; ' + input[1];\n\t\t}\n\t}\n\telse if (Number(input[1]) > Number(input[0]) && Number(input[1]) > Number(input[2])) {\n\n\t\tif (Number(input[0]) > Number(input[2])) {\n\t\t\toutput.innerHTML = input[1] + '; ' + input[0] + '; ' + input[2];\n\t\t}\n\t\telse {\n\t\t\toutput.innerHTML = input[1] + '; ' + input[2] + '; ' + input[0];\n\t\t}\n\t}\n\telse if (Number(input[2]) > Number(input[0]) && Number(input[2]) > Number(input[1])) {\n\n\t\tif (Number(input[0]) > Number(input[1])) {\n\t\t\toutput.innerHTML = input[2] + '; ' + input[0] + '; ' + input[1];\n\t\t}\n\t\telse {\n\t\t\toutput.innerHTML = input[2] + '; ' + input[1] + '; ' + input[0];\n\t\t}\n\t}\n\telse {\n\t\toutput.innerHTML = input[0] + ' = ' + input[1] + ' = ' + input[2];\n\t}\n}", "title": "" }, { "docid": "032287ec7052abf8f974b7f9aef522ef", "score": "0.5970156", "text": "function optionSortByValue(arry) {\n\tstart = 0;\n\tstop = arry.length - 1;\n\tfor (k = start; k <= stop; k++) {\n\t\tfor (l = k + 1; l <= stop; l++) {\n\t\t\tif (arry[k].value > arry[l].value) {\n\t\t\t\tflipOptions(arry[k], arry[l]);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c982be86d6e1acedd8f063c740756d4a", "score": "0.59545034", "text": "sortApplianceLists(returnType, value) {\r\n var appliances = this.returnGasAppliances();\r\n if (returnType == 'make') {\r\n var make = [];\r\n for (var i = appliances.length - 1; i >= 0; i--) {\r\n var thisAppliance = appliances[i];\r\n if (make.length != 0) {\r\n var exists = false;\r\n for (var x in make) {\r\n var thisMake = make[x];\r\n if (thisMake.Make == thisAppliance.Make) {\r\n exists = true;\r\n }\r\n }\r\n if (!exists) {\r\n make.push({ Make: thisAppliance.Make });\r\n }\r\n }\r\n else {\r\n make.push({ Make: thisAppliance.Make });\r\n }\r\n }\r\n var makeList = make.sort();\r\n return makeList;\r\n }\r\n else if (returnType == 'model') {\r\n var model = [];\r\n for (var i = appliances.length - 1; i >= 0; i--) {\r\n var thisAppliance = appliances[i];\r\n if (thisAppliance.Make == value) {\r\n model.push({ MODEL: thisAppliance.MODEL, GCNo: thisAppliance.GCNo });\r\n }\r\n }\r\n var modelList = model.sort();\r\n return modelList;\r\n }\r\n }", "title": "" }, { "docid": "95393a65bb8f66148ebff3d508c29bf9", "score": "0.59420824", "text": "function sortNums(numbers,desc=false) {\n \n }", "title": "" }, { "docid": "2a042ad79583dfd5fefca841b71ce493", "score": "0.5921266", "text": "function readSortOrder(){\n var active_form = $('#shared_controls div.sort-controls');\n\n var opts = active_form.find(\".sort-select\").children();\n var sort_order = [];\n var flippers = $(\"#shared_controls .sortflip\");\n\n for ( var i = 0; i < opts.length; i++){\n var key_for_term = opts[i].value;\n var order_for_term = $(opts[i]).attr(\"direction\"); \n if ( $(flippers[i]).hasClass('glyphicon-sort-by-attributes') ){\n order_for_term = 'asc'; }else{\n order_for_term = 'desc'; }\n var d = {};\n d[key_for_term] = { 'order' : order_for_term }; \n sort_order.push(d);\n }\n return sort_order;\n }", "title": "" }, { "docid": "d7584060ab2756ce5638cecde4b5ca43", "score": "0.58954656", "text": "_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 }", "title": "" }, { "docid": "34c0f475c762036f8411d2b112f1b498", "score": "0.5889657", "text": "function sort(obj,arg1,arg2) {\n if(arg1 === 'values' && arg2 === 'ascending'){\n\n\t\t\t var myObj = {};\n \t\t\t var arr = [];\n \tfor(var key in obj){\n arr.push(obj[key]) \n }\n arr.sort(function(a, b) {\n return a - b;\n });\n \n\t\tfor(var j = 0; j < arr.length; j++) {\n\t\t\t\tmyObj[j]= arr[j];\n }\n\t\treturn myObj;\n\n\n}else if(arg1 === 'values' && arg2 === 'descending'){\n\n\t\t var myObj = {};\n \t\t\t var arr = [];\n \tfor(var key in obj){\n arr.push(obj[key]) \n }\n arr.reverse(function(a, b) {\n return a - b;\n });\n \tvar j = 0\n\t\tfor(j = arr.length; j > -1; j--) {\n\t\t\t\tmyObj[j]= arr[j];\n }\n\t\treturn myObj;\n\n}else if(arg1 !== 'values' || arg1 !== 'keys' || arg2 !== 'descending' || arg2 !== 'ascending'){\n console.log(\"missing argument here!\");\n }\n\t\n}", "title": "" }, { "docid": "df418671ddecf63a6f210923d86f28d1", "score": "0.5889231", "text": "function ascArray() {\n function mainArrayAsc(anyArray, criterion) {\n var perc = Math.round((anyArray.length * 0.1));\n anyArray.sort(function (a, b) {\n return a[criterion] - b[criterion];\n });\n sorterAsc = anyArray.slice(0, perc);\n\n // if there is one more value in the json that equals the last member of the sorter array, add this one to the sorter array, too\n // last item sorterArray equals first item of json array\n for (var i = perc; i < anyArray.length; i++) {\n if (sorterAsc[perc - 1][criterion] == anyArray[i][criterion]) {\n sorterAsc.push(anyArray[i]);\n } else {\n break\n }\n }\n }\n // invoke function depending on which website has been selected\n if (document.URL.includes(\"attendance\")) {\n mainArrayAsc(members, \"missed_votes_pct\")\n } else {\n mainArrayAsc(members, \"votes_with_party_pct\")\n }\n}", "title": "" }, { "docid": "597cf87e26d745258773982ba1365627", "score": "0.58884674", "text": "function sortNodeList(nodeList,sortField,sortFieldType,isDesc)\n{\n /*\n sort the node list base on field criteria\n - nodeList : the input nodelist\n - sortField : field to sort\n - sortFieldType : \"number\" : number , \"date\" : date\n - isDesc : descending order \n \n */\n //var resultNodeList = new Array();\n var tmpValue1, tmpValue2;\n \n switch (sortFieldType)\n {\n case \"number\":\n if (isDesc)\n {\n for(var i=0; i< nodeList.length; i++)\n {\n for (var j=i +1; j<nodeList.length - 1; j++)\n {\n tmpValue1 = getXMLNumber(nodeList[i],sortField,true);\n tmpValue2 = getXMLNumber(nodeList[j],sortField,true);\n if (tmpValue1 < tmpValue2)\n {\n var tmpNode = nodeList[i];\n nodeList[i] = nodeList[j];\n nodeList[j] = tmpNode;\n }\n }\n }\n }\n break;\n case \"date\":\n if (isDesc)\n {\n for(var i=0; i< nodeList.length; i++)\n {\n for (var j=i +1; j<nodeList.length - 1; j++)\n {\n tmpValue1 = getXMLNumber(nodeList[i],sortField,true);\n tmpValue2 = getXMLNumber(nodeList[j],sortField,true);\n if (compareDates(tmpValue1,\"dd/MM/yyyy\",tmpValue2,\"dd/MM/yyyy\") == 0 ) //tmpValue1 < tmpValue2\n {\n var tmpNode = nodeList[i];\n nodeList[i] = nodeList[j];\n nodeList[j] = tmpNode;\n }\n }\n }\n }\n break;\n }\n return nodeList;\n}", "title": "" }, { "docid": "f7df24fd7b8070c04ea7accf231e8223", "score": "0.5888188", "text": "function GetSortOrder(prop) { \n return function(a, b) {\n if(isNaN(Number(a[prop]))==false){\n return a[prop]-b[prop];\n }\n else{\n return a[prop].localeCompare(b[prop]);\n }\n } \n}", "title": "" }, { "docid": "32faca2a6fc632c5753dd8beb172540d", "score": "0.5884944", "text": "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "title": "" }, { "docid": "32faca2a6fc632c5753dd8beb172540d", "score": "0.5884944", "text": "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "title": "" }, { "docid": "97fe227bc8192cde658e24213b09adcd", "score": "0.5860987", "text": "function dd(a){a=a.Ra();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].$a;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(ed);b.sort(ed);return[c,b]}", "title": "" }, { "docid": "1d68ea2f3d45bbf8c7ab0f1281a15b52", "score": "0.58590114", "text": "function customSort(a,b) {\n\treturn 1;\n}", "title": "" }, { "docid": "1d68ea2f3d45bbf8c7ab0f1281a15b52", "score": "0.58590114", "text": "function customSort(a,b) {\n\treturn 1;\n}", "title": "" }, { "docid": "c237df5eb9fda8b29fc1205c5d6beadc", "score": "0.5857277", "text": "sortedArray(e) {\n\t\t\tif (e === 'rankStarDesc') {\n\t\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\t\tfunction compare(a, b) {\n\t\t\t\t\tif (a.rankStar < b.rankStar) return -1;\n\t\t\t\t\tif (a.rankStar > b.rankStar) return 1;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn this.items.sort(compare);\n\t\t\t} else if (e === 'rankStarAsc') {\n\t\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\t\tfunction compare(a, b) {\n\t\t\t\t\tif (a.rankStar > b.rankStar) return -1;\n\t\t\t\t\tif (a.rankStar < b.rankStar) return 1;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn this.items.sort(compare);\n\t\t\t} else if (e === 'pricedesc') {\n\t\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\t\tfunction compare(a, b) {\n\t\t\t\t\tif (a.minPrice1 < b.minPrice1) return -1;\n\t\t\t\t\tif (a.minPrice1 > b.minPrice1) return 1;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn this.items.sort(compare);\n\t\t\t} else if (e === 'priceasc') {\n\t\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\t\tfunction compare(a, b) {\n\t\t\t\t\tif (a.minPrice1 > b.minPrice1) return -1;\n\t\t\t\t\tif (a.minPrice1 < b.minPrice1) return 1;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn this.items.sort(compare);\n\t\t\t\t// eslint-disable-next-line no-empty\n\t\t\t} else if (e === 'none') {\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5493710d60d923524c3872bb6f7a3fff", "score": "0.58462244", "text": "_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 }", "title": "" }, { "docid": "7ee17cdcdbc2243d5b7c25ba34c96977", "score": "0.5841706", "text": "function mergeSort(list){\n\n}", "title": "" }, { "docid": "5278a9bd058d13dac2a0797a615e8f9f", "score": "0.58139133", "text": "sortResults(filteredResults) {\n // For each of the 7 possible sort fields, set -1/0/1 for order \n // 'or' the results to if sort required - 0 equates to false, -1/1 true\n // Switch input element comparess based on ascending/descending required\n var sortedResults = filteredResults.sort((a, b) => {\n\n var res = [0, 0, 0, 0, 0, 0, 0]\n for (var i = 0; i < this.state.sortOrder.length; i++) {\n\n switch (this.state.sortOrder[i].itemName) {\n\n case \"Region\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = a.reg < b.reg ? -1 : a.reg > b.reg ? 1 : 0;\n } else {\n res[i] = a.reg > b.reg ? -1 : a.reg < b.reg ? 1 : 0;\n }\n break;\n\n case \"Constituency\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = a.con < b.con ? -1 : a.con > b.con ? 1 : 0;\n } else {\n res[i] = a.con > b.con ? -1 : a.con < b.con ? 1 : 0;\n }\n break;\n\n case \"Party\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = a.party < b.party ? -1 : a.party > b.party ? 1 : 0;\n } else {\n res[i] = a.party > b.party ? -1 : a.party < b.party ? 1 : 0;\n }\n break;\n\n case \"MP\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = a.mprev < b.mprev ? -1 : a.mprev > b.mprev ? 1 : 0;\n } else {\n res[i] = a.mprev > b.mprev ? -1 : a.mprev < b.mprev ? 1 : 0;\n }\n break;\n\n case \"Prev_Party\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = a.prevparty < b.prevparty ? -1 : a.prevparty > b.prevparty ? 1 : 0;\n } else {\n res[i] = a.prevparty > b.prevparty ? -1 : a.prevparty < b.prevparty ? 1 : 0;\n }\n break;\n\n case \"2nd_Party\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = a.secparty < b.secparty ? -1 : a.secparty > b.secparty ? 1 : 0;\n } else {\n res[i] = a.secparty > b.secparty ? -1 : a.secparty < b.secparty ? 1 : 0;\n }\n break;\n\n case \"Margin\":\n if (this.state.sortOrder[i].ascending) {\n res[i] = parseFloat(a.mar) < parseFloat(b.mar) ? -1 :\n parseFloat(a.mar) > parseFloat(b.mar) ? 1 : 0;\n } else {\n res[i] = parseFloat(a.mar) > parseFloat(b.mar) ? -1 :\n parseFloat(a.mar) < parseFloat(b.mar) ? 1 : 0;\n }\n break;\n } // switch\n } // for\n\n return (res[0] || res[1] || res[2] || res[3] || res[4])\n }) // sort\n\n return sortedResults\n }", "title": "" }, { "docid": "3a0a852bf7c664b1976aaf8ec76addf0", "score": "0.5783363", "text": "sorted() {\n if (this.enableSortAge) {\n return this.filteredBreeds.slice(0).sort((a, b) => a.age < b.age ? this.sorting : -this.sorting);\n } else {\n return this.filteredBreeds;\n }\n }", "title": "" }, { "docid": "b455f8cc2e077917a06585d02f32b704", "score": "0.57709235", "text": "orderBy(f) {\n return new Iter([...this.a].sort((x, y) => f(x) < f(y) ? -1 : 1));\n }", "title": "" }, { "docid": "92058df7541b4a6069b7d4a4ff38b990", "score": "0.57642514", "text": "breakParamSort (param) {\n const p = param.split('-')\n const key = (p[0] === 'date') ? 'creationDate' : p[0]\n const value = (p[1] === 'asc') ? 1 : -1\n return { [key]: value }\n }", "title": "" }, { "docid": "deed90e11a2a46953e2ef9c22b6b39e9", "score": "0.5762144", "text": "get allowSorting() {\n return this._aa(1024);\n }", "title": "" }, { "docid": "4a25ecfa06b62e024acb577ecb5b22da", "score": "0.57592374", "text": "function sortbyvalue(arrayIn){\n\tarrayIn.sort(function compare(a,b){\n\t\tif (a[1] > b[1])\n\t\t\treturn 1;\n\t\tif (a[1] < b[1])\n\t\t\treturn -1;\n\t\tif (a[0] > b[0])\n\t\t\treturn 1;\n\t\tif (a[0] < b[0])\n\t\t\treturn -1;\n\t\treturn 0;\n\t});\n\treturn arrayIn;\n}", "title": "" }, { "docid": "95bfcf107ed8b9722ff1320ded0008c6", "score": "0.57529974", "text": "function Uc(a){a=a.rc();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].Ql;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(Vc);b.sort(Vc);return[c,b]}", "title": "" }, { "docid": "9b30b156220d8df83f2549c71812ffd4", "score": "0.574699", "text": "sorted() {\n\t\treturn this.set.sort((a, b) => a - b)\n\t}", "title": "" }, { "docid": "f14d3a8bbc36a46b9c6555197962518c", "score": "0.57446784", "text": "function temperatureCompare(){\n return function(value1,value2){\n if(value1<value2){\n return -1;\n }else if(value1>value2){\n return 1;\n }else{\n return 0;\n }\n }\n }//sort function", "title": "" }, { "docid": "f0f82ecfc30b44c92643a3651c0deaf8", "score": "0.57425594", "text": "function myFunction(a) {\n return a.sort((first, second) => second - first)\n}", "title": "" }, { "docid": "2bfa96f2659e78f7a058b9b48a570ba3", "score": "0.57411516", "text": "function sortByPrices(value){\r\n \r\n if(value == 'lowToHigh'){\r\n console.log('asd')\r\n sortedPrices.sort(function (a, b) {\r\n return a.price - b.price;\r\n });\r\n console.log(sortedPrices)\r\n }\r\n if(value == 'highToLow'){\r\n console.log('asd')\r\n sortedPrices.sort(function (a, b) {\r\n return b.price - a.price;\r\n });\r\n console.log(sortedPrices)\r\n }\r\n showProducts(sortedPrices)\r\n}", "title": "" }, { "docid": "1ec8637c9ac61ce63c983f21624cc4a8", "score": "0.57280797", "text": "function googleSortArray(sortlist){\n\tvar sortout=[];\n\tvar srt=sortlist.split(';');\n\tfor(i in srt){\n\t\tvar st={};\n\t\tvar srtt=srt[i].split(',');\n\t\tst.column=parseInt(srtt[0]);\n\t\tswitch(srtt[1]){\n\t\t\tcase \"true\":\n\t\t\t\tst.desc=true;\n\t\t\tbreak;\n\t\t\tcase \"false\":\n\t\t\t\tst.desc=false;\n\t\t\tbreak;\n\t\t}\n\t\tsortout.push(st);\n\t}\n\treturn sortout;\n}", "title": "" }, { "docid": "b6a7b7d110a1517ad337b2faaf0c14ba", "score": "0.571213", "text": "function getOrder(){\n var first = parseFloat(doc1.value);\n var second = parseFloat(doc2.value);\n var third = parseFloat(doc3.value);\n var fourth = parseFloat(doc4.value);\n var fifth = parseFloat(doc5.value);\n var sixth = parseFloat(doc6.value);\n \n var list = [first,second,third,fourth,fifth,sixth];\n var sorted = list.sort((a,b) => a - b);\n\n output.innerHTML = sorted;\n}", "title": "" }, { "docid": "611e6c03719a5145a113aa222d3f32b3", "score": "0.56828016", "text": "getSortedData() {\n const { data } = this.props\n const { sorting } = this.state\n return orderBy(data, [ sorting.column ], [ sorting.direction ? 'asc' : 'desc' ])\n }", "title": "" }, { "docid": "c20ab278afa98dd4e57121dae04606ec", "score": "0.567779", "text": "function multisort() {\n var attrs = arguments;\n console.log('multisort init: ', attrs);\n return function (a, b) {\n for (var i = 0, l = attrs.length; i < l; i++) {\n var attr = attrs[i];\n var k = attr[0];\n var asc = attr[1];\n\n var a_ = a[k];\n var b_ = b[k];\n // a_ && console.log('ms', a, b, a_, b_, a_ < b_, a_ > b_);\n if (a_ < b_) return asc * -1;\n if (b_ > a_) return asc * 1;\n }\n return 0;\n };\n\n }", "title": "" }, { "docid": "59b4d7ce6022164eafc2c288c88ef169", "score": "0.56724256", "text": "function inRuleOrder(v, a) {\n var o = options.ort;\n return (o ? a : v) + \", \" + (o ? v : a);\n }", "title": "" }, { "docid": "59b4d7ce6022164eafc2c288c88ef169", "score": "0.56724256", "text": "function inRuleOrder(v, a) {\n var o = options.ort;\n return (o ? a : v) + \", \" + (o ? v : a);\n }", "title": "" }, { "docid": "59b4d7ce6022164eafc2c288c88ef169", "score": "0.56724256", "text": "function inRuleOrder(v, a) {\n var o = options.ort;\n return (o ? a : v) + \", \" + (o ? v : a);\n }", "title": "" }, { "docid": "59b4d7ce6022164eafc2c288c88ef169", "score": "0.56724256", "text": "function inRuleOrder(v, a) {\n var o = options.ort;\n return (o ? a : v) + \", \" + (o ? v : a);\n }", "title": "" }, { "docid": "59b4d7ce6022164eafc2c288c88ef169", "score": "0.56724256", "text": "function inRuleOrder(v, a) {\n var o = options.ort;\n return (o ? a : v) + \", \" + (o ? v : a);\n }", "title": "" }, { "docid": "4ec4e46d22362936ce5fef7d083f29e9", "score": "0.5671276", "text": "function Ng(a){a=a.Ta();for(var b=[],c=[],d=0;d<a.length;d++){var e=a[d].$a;e&&(e=e.call(a[d]))&&(e[2]?b.push(e):c.push(e))}c.sort(Og);b.sort(Og);return[c,b]}", "title": "" }, { "docid": "dc1aa787644033214144586bd8815d68", "score": "0.56689537", "text": "sortBySuit() {\n\n }", "title": "" }, { "docid": "80899a2c681673913398592c479a47a5", "score": "0.56488687", "text": "function sortBy( list,policyList ){\n var customizer = function(list , property, isReverse){\n if(isReverse){\n //sorts in ascending and then reverses the array to get descending;\n list = _.reverse(_.sortBy(list , [property]));\n }\n else{\n //sorts in ascending;\n list = _.sortBy(list , [property]);\n }\n return list;\n }\n \n policyList.map(policy =>{\n var param = null;\n switch(policy){\n case \"FIFO\" : param = \"createdAt:1\" ; break;\n case \"LILO\" : param = \"createdAt:-1\" ; break;\n case \"Expiry First\" : param = \"shelfLife:1\"; break;\n case \"Expiry Last\" : param = \"shelfLife:-1\"; break;\n case \"Expiry date\" : param = \"shelfLife:1\"; break;\n case \"Highest MRP\" : param = \"mrp:-1\";break;\n case \"Lowest MRP\" : param = \"mrp:1\";break;\n case \"Highest Cost\" : param = \"purchasePrice:-1\";break;\n case \"Lowest Cost\" : param = \"purchasePrice:1\" ; break;\n case \"Offer First\" : param = \"offer:-1\";break;\n case \"Offer Last\" : param = \"offer:1\";break;\n }\n var property = param.split(\":\")[0];\n var order = parseInt(param.split(\":\")[1]);\n var isReverse = order === 1 ? false : true;\n console.log(\"---property---\" ,property , \"-----order---\" , order , \"----isReverse---\" , isReverse );\n var result = customizer(list , property , isReverse);\n console.log(\"---result---\" , result);\n });\n \n}", "title": "" }, { "docid": "4527717e8938fddb6a6cb48716b1a93c", "score": "0.56485003", "text": "function sortbyvalue(obj) {\n var sortable = [];\n for (var key in obj)\n if (obj.hasOwnProperty(key))\n sortable.push([key, obj[key]]);\n sortable.sort(function (a, b) {\n return b[1] - a[1];\n });\n return sortable;\n}", "title": "" }, { "docid": "9365a75229d22c104a78df362d574a3a", "score": "0.5613962", "text": "sort() {\n const ret = [].sort.apply(this, arguments);\n this._registerAtomic('$set', this);\n return ret;\n }", "title": "" }, { "docid": "4390f0f22edf3fd913a347908868caf3", "score": "0.5608119", "text": "function sortItems(a, b) {\n return a - b;\n}", "title": "" }, { "docid": "63267b641e22070c863c4062d4e7107d", "score": "0.5598361", "text": "function getSortOptions() {\n\tvar sortCol='';\n\tvar direction='asc';\n\tfor (var i=0; i<columnStatus.length; i++) {\n\t\tif (columnStatus[i]!=0) {\n\t\t\tsortCol=cIDs[i];\n\t\t\tif (columnStatus[i]==-1) {\n\t\t\t\tdirection='desc';\n\t\t\t}\n\t\t}\t\n\t}\n\treturn [sortCol,direction];\n}", "title": "" }, { "docid": "45510db3646bcb765bdbf2c0d72633de", "score": "0.5592", "text": "function sort_numbers(args){\n sort_custom({\n 'array': args['array'],\n 'reverse': args['reverse'] || false,\n 'todo': function(a, b){\n return a - b;\n },\n });\n}", "title": "" }, { "docid": "0065e461385287dbe28d1c55f5d2b82c", "score": "0.55857015", "text": "function mergeSort2(){\n\t\n}", "title": "" }, { "docid": "2f68b72fcc703c19811e50db2be8d359", "score": "0.5585554", "text": "function inRuleOrder ( v, a ) {\n\t\tvar o = options.ort;\n\t\treturn (o?a:v) + ', ' + (o?v:a);\n\t}", "title": "" }, { "docid": "2f68b72fcc703c19811e50db2be8d359", "score": "0.5585554", "text": "function inRuleOrder ( v, a ) {\n\t\tvar o = options.ort;\n\t\treturn (o?a:v) + ', ' + (o?v:a);\n\t}", "title": "" }, { "docid": "2f68b72fcc703c19811e50db2be8d359", "score": "0.5585554", "text": "function inRuleOrder ( v, a ) {\n\t\tvar o = options.ort;\n\t\treturn (o?a:v) + ', ' + (o?v:a);\n\t}", "title": "" }, { "docid": "638dbae4564aa51cd044d945704cee0f", "score": "0.5564629", "text": "function multiDiArraySortBy(field, reverse, dataConv){\r\n var key = dataConv ? \r\n function(x) {return dataConv(x[field])} : \r\n function(x) {return x[field]};\r\n reverse = !reverse ? 1 : -1;\r\n return function (a, b) {\r\n return a = key(a), b = key(b), reverse * ((a > b) - (b > a));\r\n } \r\n}//end of function multiDiArraySortBy", "title": "" }, { "docid": "3428580361405ccd97f2d4ee4b24608f", "score": "0.55629134", "text": "function sortTasks(arr) {\n const sortPriority = document.querySelector('#priority-select').value;\n const red = []\n const yellow = []\n const green = []\n let arrayOfTasks = []\n arr.forEach((ele) => {\n if (ele.dataset.id === 'red') {\n red.push(ele)\n } else if (ele.dataset.id === 'yellow') {\n yellow.push(ele)\n } else if (ele.dataset.id === 'green') {\n green.push(ele)\n }\n })\n if (sortPriority === 'red') {\n arrayOfTasks = red.concat(yellow, green)\n } else if (sortPriority === 'yellow') {\n arrayOfTasks = yellow.concat(red, green)\n } else if (sortPriority === 'green') {\n arrayOfTasks = green.concat(red, yellow)\n }\n return arrayOfTasks\n }", "title": "" }, { "docid": "39037484698347ac5b884adf4b393596", "score": "0.55489993", "text": "orderByDesc(f) {\n return new Iter([...this.a].sort((x, y) => f(y) < f(x) ? -1 : 1));\n }", "title": "" }, { "docid": "db406b13f58f2f47f334c4fc1d05f191", "score": "0.5543054", "text": "function GetSortOrder(prop) { \n\t\treturn function(a, b) { \n\t\t\tif (a[prop] > b[prop]) { \n\t\t\t\treturn 1; \n\t\t\t} else if (a[prop] < b[prop]) { \n\t\t\t\treturn -1; \n\t\t\t} \n\t\t\treturn 0; \n\t\t} \n\t}", "title": "" }, { "docid": "658eea1ed5149521b997cac127977df6", "score": "0.5538015", "text": "getSortedData(data) {\n if (!this.sort.active || this.sort.direction === '') {\n return data;\n }\n return data.sort((a, b) => {\n const isAsc = this.sort.direction === 'asc';\n switch (this.sort.active) {\n case 'name': return compare(a.title, b.title, isAsc);\n case 'id': return compare(+a.id, +b.id, isAsc);\n default: return 0;\n }\n });\n }", "title": "" }, { "docid": "ae946a3327e58cfeaadab74b4e8d59a7", "score": "0.55298793", "text": "function listsort(obj, by, num, cs) {\r\n\tobj = (typeof obj == \"string\") ? document.getElementById(obj) : obj;\r\n\tby = (parseInt(\"0\" + by) > 5) ? 0 : parseInt(\"0\" + by);\r\n\tif (obj.tagName.toLowerCase() != \"select\" && obj.length < 2)\r\n\t\treturn false;\r\n\tvar elements = new Array();\r\n\tfor (i=0; i<obj.length; i++) {\r\n\t\telements[elements.length] = new Array(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);\r\n\t}\r\n\tsort2d(elements, by, num, cs);\r\n\tfor (i=0; i<obj.length; i++) {\r\n\t\tobj[i].text = elements[i][0];\r\n\t\tobj[i].value = elements[i][1];\r\n\t\tobj[i].style.color = elements[i][2];\r\n\t\tobj[i].style.backgroundColor = elements[i][3];\r\n\t\tobj[i].className = elements[i][4];\r\n\t\tobj[i].id = elements[i][5];\r\n\t\tobj[i].selected = elements[i][6];\r\n\t}\r\n}", "title": "" }, { "docid": "1ccf1ffd6a09827f682dee7ea2094764", "score": "0.55278546", "text": "function sort(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "93e756303a464f73439e41ac1b1c020f", "score": "0.5527645", "text": "function sortParameters() {\n if (sortedBy.parameters !== undefined) {\n parameters.sort(getFieldComparator(sortedBy.parameters));\n }\n }", "title": "" }, { "docid": "050da98e6fb10a809ae1f33cfdd47534", "score": "0.55229056", "text": "function descArray() {\n function mainArrayDesc(anyArray, criterion) {\n var perc = Math.round((anyArray.length * 0.1));\n anyArray.sort(function (a, b) {\n return b[criterion] - a[criterion]\n });\n sorterDesc = anyArray.slice(0, perc);\n\n for (var i = 0; i < anyArray.length; i++) {\n if (sorterDesc[perc - 1][criterion] == anyArray[i][criterion]) {\n sorterDesc.push(anyArray[i]);\n } else {\n break\n }\n }\n }\n console.log(sorterDesc);\n for (var i = 0; i < sorterDesc.length; i++) {\n if (sorterDesc[sorterDesc.length - 1][criterion] === anyArray[i][criterion]) {\n sorterDesc = sorterDesc.push(anyArray[i])\n } else {\n break\n }\n }\n console.log(sorterDesc);\n if (document.URL.includes(\"attendance\")) {\n mainArrayDesc(members, \"missed_votes_pct\")\n } else {\n mainArrayDesc(members, \"votes_with_party_pct\")\n }\n}", "title": "" }, { "docid": "dab3274ba7e2b0b0c242efcc22709c11", "score": "0.55207026", "text": "function selectionSort() {\n\n if (jsConsole.read('#arr') !== '') {\n\n var arr = (jsConsole.read('#arr')).split(','),\n len = arr.length,\n i, j,\n indexOfMin,\n sorted = [];\n\n for (i = 0; i < len; i += 1) {\n\n arr[i] = parseInt(arr[i]);\n }\n\n jsConsole.writeLine('array = [' + arr + ']');\n jsConsole.writeLine('');\n\n for (i = 0; i < len; i += 1) {\n\n indexOfMin = i;\n\n for (j = i + 1; j < len; j += 1) {\n\n if (arr[j] < arr[indexOfMin]) {\n\n indexOfMin = j;\n }\n }\n\n sorted.push(arr[indexOfMin]);\n arr[indexOfMin] = arr[i];\n }\n\n jsConsole.writeLine('sorted = [' + sorted + ']');\n jsConsole.writeLine('');\n\n } else {\n\n jsConsole.writeLine('ERROR : Array is empty');\n }\n}", "title": "" }, { "docid": "78d4bb958d0b6f2c55f4b404cca22d46", "score": "0.5513258", "text": "function SORT(){\n return {\n type:SORT_PRODUCTS\n\n }\n}", "title": "" }, { "docid": "08ec81450ec58061f61a3f78ee9b42ad", "score": "0.5508846", "text": "sortData(field, arr, orderBy) { \n if (orderBy === 'asc') {\n return arr.sort((a, b) => {\n let parsedA = parseFloat(a[field]);\n let parsedB = parseFloat(b[field]);\n if (!this.isNumber(parsedA) || !this.isNumber(parsedB) ) {\n // if either one isnt a number, take a and b to be strings\n // for a field like Lng, a value of \"34T\", it would still be parsed as 34\n let x = a[field].toLowerCase();\n let y = b[field].toLowerCase();\n if (x < y) {return -1;}\n if (x > y) {return 1;}\n return 0;\n }\n else {\n return parsedA - parsedB;\n }\n });\n }\n else {\n return arr.sort((a, b) => {\n let parsedA = parseFloat(a[field]);\n let parsedB = parseFloat(b[field]);\n if (!this.isNumber(parsedA) || !this.isNumber(parsedB) ) {\n // if either one isnt a number, take a and b to be strings\n // for a field like Lng, a value of \"34T\", it would still be parsed as 34\n let x = a[field].toLowerCase();\n let y = b[field].toLowerCase();\n if (x > y) {return -1;}\n if (x < y) {return 1;}\n return 0;\n }\n else {\n return parsedB - parsedA;\n }\n });\n }\n }", "title": "" }, { "docid": "7d2e2f297458cd6db728be818d7a277a", "score": "0.55085254", "text": "function sortNumberVal(a, b) {\n return sortNumber(a.value, b.value);\n}", "title": "" }, { "docid": "c43b63e878216e03bc0c714d6cb9a229", "score": "0.5502967", "text": "function sortResults(lst, prop, asc) {\n lst = lst.sort(function (a, b) {\n if (asc) return (a[prop] > b[prop]);\n else return (b[prop] > a[prop]);\n });\n showResults(lst);\n}", "title": "" }, { "docid": "e5f04c864fe2fd9d645182e268dfbdd8", "score": "0.55016977", "text": "function sort_priority(result,en){\n\n\tvar temp = [];\n\tif(en===undefined)\n\t\treturn result;\n\ten = en.toUpperCase();\n\tvar year = en.substr(0,4);\n\tvar dept = en.substr(4,2).toUpperCase();\n\tvar j=0;\n\tfor(var i =0;i<result.length;i++)\n\t{\n\t\tif(result[i]['entry'].substr(0,4)===year)\n\t\t{\n\t\t\ttemp[j++]=result[i];\n\t\t}\n\t}\n\tj=0;\n\tvar temp1=[];\n\tfor(var i=0;i<temp.length;i++)\n\t{\n\t\tif(temp[i]['entry'].substr(4,2)===dept)\n\t\t{\n\t\t\ttemp1[j++]=temp[i];\n\t\t}\n\t}\n\tvar ans =[];\n\tj=0;\n\tfor(var i=0;i<temp1.length;i++)\n\t{\n\t\tans[j++]=temp1[i];\t\n\t}\n\tfor(var i=0;i<temp.length;i++)\n\t{\n\t\tif(!ans.includes(temp[i]))\n\t\t{\n\t\t\tans[j++]=temp[i];\n\t\t}\n\t}\n\tfor(var i=0;i<result.length;i++)\n\t{\n\t\tif(!ans.includes(result[i]))\n\t\t{\n\t\t\tans[j++]=result[i];\n\t\t}\n\t}\n\treturn ans;\t\n}", "title": "" }, { "docid": "61ed32263710f2e624b59256841ff62a", "score": "0.54933494", "text": "function someFunction() {\n arr.sort()\n}", "title": "" }, { "docid": "dbe414211e56954c33bdfaeb4b3175e3", "score": "0.54772574", "text": "sort() {\n const list = []\n\n // Traverse the tree\n this.traverse(this.root, (node) => list.push(node.value))\n\n return list\n }", "title": "" }, { "docid": "25c9fa94c26a3ea5fc4ea885c1db74ea", "score": "0.5476212", "text": "function QS(lista) {\n //console.log(\"original\")\n //console.log(lista)\n var pivote=lista[0].priorityCoeficient; \n var listaMenores=[];\n var listaMayores=[];\n var enMedio=[];\n \n\n for (var k=0; k<lista.length; k++){\n if (lista[k].priorityCoeficient<pivote){\n listaMenores.push(lista[k]);\n }\n else if (lista[k].priorityCoeficient>pivote){\n listaMayores.push(lista[k]);\n }\n else if (lista[k].priorityCoeficient==pivote){\n enMedio.push(lista[k]);\n }\n }\n \n /*\n console.log(contador);\n contador++;\n console.log(listaMenores);\n console.log(\"----------\");\n console.log(enMedio);\n console.log(\"----------\");\n console.log(listaMayores);\n console.log(\"----------\");\n */\n\n\n if (lista.length<=1){\n return (lista);\n }\n \n if (listaMenores.length>1){\n //console.log(\"menores\");\n //console.log(listaMenores);\n listaMenores=QS(listaMenores);\n //console.log(\"menores procesados\");\n //console.log(listaMenores);\n \n } \n if (listaMayores.length>1){\n //console.log(\"mayores\");\n //console.log(listaMayores);\n listaMayores=QS(listaMayores);\n //console.log(\"mayores procesados\");\n //console.log(listaMayores);\n \n }\n \n if (typeof(listaMenores)==='undefined'){\n var sorted=enMedio.concat(listaMayores); \n }\n else if (typeof(listaMayores)==='undefined'){\n var sorted=listaMenores.concat(enMedio); \n }\n else if (typeof(enMedio)==='undefined'){\n var sorted=listaMenores.concat(listaMayoresist); \n }\n else{\n sorted=listaMenores.concat(enMedio, listaMayores); \n/* console.log(\"ordenado\");\n console.log(sorted);*/\n return (sorted); \n }\n}", "title": "" }, { "docid": "a3be75a2730c7ad6e5b433c64e19060d", "score": "0.5473935", "text": "function familyAge(ages){\n let sortedAge = []\n sortedAge.push(Math.min(...ages), Math.max(...ages))\n sortedAge.push(sortedAge[1]-sortedAge[0])\n console.log(sortedAge)\n}", "title": "" }, { "docid": "bf98cf9af7b3865fa0b114ce2ba9a104", "score": "0.5473758", "text": "function sort(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "de268c82a9dc29740c819f7114fd2841", "score": "0.54712826", "text": "function task14_16_10(){\r\n var scores =[320,230,480,120];\r\n document.write(\"Scores of Students : \"+scores + \"<br>\");\r\n scores.sort();\r\n document.write(\"Ordered Score of Students : \"+scores);\r\n}", "title": "" }, { "docid": "6c9484743e11a1f9336b9c4d626b4942", "score": "0.5469627", "text": "function sort(array) {\n}", "title": "" }, { "docid": "e125d1b92f4702bf1c43a68fec258656", "score": "0.5465779", "text": "function __sortFilters(a,b) {\n if(a.sort === b.sort) {\n if(a.display < b.display) {\n return -1;\n }\n if(a.display > b.display) {\n return 1;\n }\n return 0;\n } else if(a.sort === null) {\n return 1;\n } else if(b.sort === null) {\n return -1;\n }\n return a.sort - b.sort;\n }", "title": "" }, { "docid": "a1c5a895afc87ae4e0688b07291b74c9", "score": "0.5463016", "text": "sort_by(field, reverse)\n {\n var primer = function(a){return new Date(a)};\n \n //eli tehdään compare functio ja varmistetaan että saa oikean mallisen parametrin\n var key = primer ? \n function(x) {return primer(x[field] + \"T\" + x[\"CLOCK\"])} : \n function(x) {return x[field]};\n \n //tarkistetaan onko asc vai desc\n reverse = !reverse ? 1 : -1;\n \n return function (a, b) \n {\n return a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }", "title": "" }, { "docid": "e58fc431d1fb29c08cbda09378f068ce", "score": "0.5447173", "text": "function sortData(input){ \n data = [];\n for (var key in input) {\n if (input.hasOwnProperty(key)) {\n data.push(input[key]);\n }\n\n }\n console.log(data);\n return data;\n}", "title": "" }, { "docid": "07867e4c64befba7523785ca363950cf", "score": "0.5446688", "text": "function sortedSquares2() {\n\n}", "title": "" }, { "docid": "dd0d7f9c09d6fe2ea5d8c56ce5ff53af", "score": "0.5445622", "text": "function sortDesc(a,b) {\n return b-a;\n}", "title": "" }, { "docid": "abeb65f0f3040873070a4f52f949e5a3", "score": "0.54414356", "text": "function sortPeople(list){\n\n// create two arrays, one for older people and one for younger people\n// this will be blank arrays, that we will populate our forEach loop\nvar older = [];\nvar younger =[];\n\n// loop through array\n list.forEach(function(d,i){\n\nif (d.age < 30){\nyounger.push(d);\n} else {\nolder.push(d);\n}\n\n })\n\n // this functon will return our arrays as an object\nvar buckets = {\n olderList: older,\n youngerList: younger\n};\n\nreturn buckets;\n\n}", "title": "" }, { "docid": "af98829b85970f1b51e53878f7ddca38", "score": "0.54376817", "text": "function solution(nums){\n return (nums || []).sort(function(a, b){\n return a - b \n });\n}", "title": "" }, { "docid": "7f94ffa2d4fad8475da95ea087bea728", "score": "0.5437073", "text": "sortBy(field, reverse, primer) {\n const key = primer\n ? function(x) {\n return primer(x[field]);\n }\n : function(x) {\n return x[field];\n };\n\n return function(a, b) {\n a = key(a);\n b = key(b);\n return reverse * ((a > b) - (b > a));\n };\n}", "title": "" }, { "docid": "b3180835bcaae23d932178a7db3a9ea4", "score": "0.5434781", "text": "function selectionsort() {\n console.log(\"selectionsort - implement me !\");\n let i, j;\n const len = csvData.length;\n\n for (i = 0; i < len - 1; i++) {\n let min = i;\n for (j = i + 1; j < len; j++) {\n if (isLess(j, min)) {\n min = j;\n }\n }\n swap(csvData, i, min);\n }\n}", "title": "" }, { "docid": "9f774dd27bdc1c86860d426a755c3dea", "score": "0.5427952", "text": "getSortedData(data) {\r\n if (!this.sort || !this.sort.active || this.sort.direction === '') {\r\n return data;\r\n }\r\n return data.sort((a, b) => {\r\n var _a, _b;\r\n const isAsc = ((_a = this.sort) === null || _a === void 0 ? void 0 : _a.direction) === 'asc';\r\n switch ((_b = this.sort) === null || _b === void 0 ? void 0 : _b.active) {\r\n case 'datum': return compare(a.datum, b.datum, isAsc);\r\n case 'dienststellennummer': return compare(+a.dienststellennummer, +b.dienststellennummer, isAsc);\r\n case 'abflugort': return compare(+a.abflugort, +b.abflugort, isAsc);\r\n case 'ankunftsort': return compare(+a.ankunftsort, +b.ankunftsort, isAsc);\r\n case 'befoerderungsklasse': return compare(+a.befoerderungsklasse, +b.befoerderungsklasse, isAsc);\r\n case 'personenAnzahl': return compare(+a.personenAnzahl, +b.personenAnzahl, isAsc);\r\n case 'emissionen': return compare(+a.emissionen, +b.emissionen, isAsc);\r\n default: return 0;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "9f774dd27bdc1c86860d426a755c3dea", "score": "0.5427952", "text": "getSortedData(data) {\r\n if (!this.sort || !this.sort.active || this.sort.direction === '') {\r\n return data;\r\n }\r\n return data.sort((a, b) => {\r\n var _a, _b;\r\n const isAsc = ((_a = this.sort) === null || _a === void 0 ? void 0 : _a.direction) === 'asc';\r\n switch ((_b = this.sort) === null || _b === void 0 ? void 0 : _b.active) {\r\n case 'datum': return compare(a.datum, b.datum, isAsc);\r\n case 'dienststellennummer': return compare(+a.dienststellennummer, +b.dienststellennummer, isAsc);\r\n case 'abflugort': return compare(+a.abflugort, +b.abflugort, isAsc);\r\n case 'ankunftsort': return compare(+a.ankunftsort, +b.ankunftsort, isAsc);\r\n case 'befoerderungsklasse': return compare(+a.befoerderungsklasse, +b.befoerderungsklasse, isAsc);\r\n case 'personenAnzahl': return compare(+a.personenAnzahl, +b.personenAnzahl, isAsc);\r\n case 'emissionen': return compare(+a.emissionen, +b.emissionen, isAsc);\r\n default: return 0;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "8478fe3faeec5aa0a2629dec89a99816", "score": "0.54266864", "text": "function generateSortFunc( compare ){\n return function( dict ) {\n var i, r = [];\n for( i in dict ) {\n if( dict.hasOwnProperty(i) ) {\n r.push( parseInt(i, 10) );\n }\n }\n return r.sort( compare ); \n };\n}", "title": "" }, { "docid": "55288f93fd8952c006e29d459254a90a", "score": "0.541533", "text": "function sortingArray(a, b) {\n return a - b;\n }", "title": "" }, { "docid": "0d412348cebe23463bf72ddb2e02d32d", "score": "0.54130685", "text": "function sortByValue() { \n\n\t\tthat.sorted = _.sortBy( that.sorted , function( card ) { \n\n\t\t\tswitch ( getValueCode( card.code ) ) { \n\n\t\t\t\tcase '2': \n\t\t\t\t\treturn 14;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\treturn 13;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\treturn 12;\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t\treturn 11;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '6':\n\t\t\t\t\treturn 10;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '7':\n\t\t\t\t\treturn 9;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t\treturn 8;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '9':\n\t\t\t\t\treturn 7;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '0': \n\t\t\t\t\treturn 6; \n\t\t\t\t\tbreak;\n\t\t\t\tcase 'J':\n\t\t\t\t\treturn 5;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Q': \n\t\t\t\t\treturn 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'K': \n\t\t\t\t\treturn 3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'A':\n\t\t\t\t\treturn 2;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: \n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "67aa7858ce484f7a2a010cae7df6b6d6", "score": "0.54125375", "text": "function SortNumbers(a,b) {\n return a - b;\n}", "title": "" }, { "docid": "819d20cbf8bc388b2edc1bd3c58f6985", "score": "0.54006326", "text": "function sortReserves(){\r\n\treserves433.sort().reverse();\r\n\treserves442.sort().reverse();\r\n\treserves343.sort().reverse();\r\n\treserves451.sort().reverse();\r\n\treserves532lib.sort().reverse();\r\n\treserves541.sort().reverse();\r\n\treserves352.sort().reverse();\r\n\treserves532vs.sort().reverse();\r\n}", "title": "" }, { "docid": "6bb08da6bc4deae67edbb3b5cba71ab7", "score": "0.53994846", "text": "function sortResultsArray(a,b){\n if (a.popularity > b.popularity)\n return -1;\n if (a.popularity < b.popularity)\n return 1;\n return 0;\n }", "title": "" }, { "docid": "53f1ccde3eb55f5f0637112d15b0b5f1", "score": "0.53975916", "text": "marketCapSort(a, b) {\n\n\n const marketCapA = a.market_cap\n const marketCapB = b.market_cap\n const filter = document.getElementsByClassName('Market Cap')[0]\n\n if (filter.value === 'ascending') {\n return marketCapA - marketCapB\n } else {\n return marketCapB - marketCapA\n }\n\n }", "title": "" }, { "docid": "6d30b6bb6c25180eabc642ef269187ba", "score": "0.53899986", "text": "function getSortAndFilterArray(filterObj, returnArray){\n\t// do filtering and sorting\n\t\n\tif(returnArray.length == 0){\n\t\treturn returnArray;\t\n\t}\t\t\n\tif(Object.keys(filterObj.sort).length == 0 && Object.keys(filterObj.filter).length == 0){\n\t\tconsole.log(\"no need to sort and filter.\");\t\n\t\treturn returnArray;\t\t\n\t}\t\t\n\t\t\t\t\n\tif(Object.keys(filterObj.sort).length > 0){\n\t\tfor(var col in filterObj.sort){\n\t\t\tif(filterObj.sort.hasOwnProperty(col)){\n\t\t\t\t// do sort\n\t\t\t\tvar sortMethod;\n\t\t\t\tif(filterObj.sort[col].sortComputed){\t\t\t\t\t\t\n\t\t\t\t\tsortMethod = eval(process(filterObj.sort[col].sortComputed, \"Main\"));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tsortMethod = filterObj.sort[col].sortMethod;\n\t\t\t\t}\n\n\t\t\t\tvar sortPara = 1;\n\t\t\t\tif(sortMethod == \"Descending\")\n\t\t\t\t\tsortPara = -1;\n\n\t\t\t\treturnArray.sort(function(a, b){\n\t\t\t\t\tif(cellConstraints[a].get() > cellConstraints[b].get())\n\t\t\t\t\t\treturn 1*sortPara;\n\t\t\t\t\telse if(cellConstraints[a].get() < cellConstraints[b].get())\n\t\t\t\t\t\treturn -1*sortPara;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn 0;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconsole.log(\"returnArray after sorting\", returnArray);\n\t\t\t\tconsole.log(\"sort done\");\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\tif(Object.keys(filterObj.filter).length > 0){\n\t\tfor(var col in filterObj.filter){\n\t\t\tif(filterObj.filter.hasOwnProperty(col)){\n\t\t\t\t// do filter\n\t\t\t\tvar filterMethod, filterArg;\n\t\t\t\tif(filterObj.filter[col].filterComputed){\t\t\t\t\t\t\n\t\t\t\t\tvar s = eval(process(filterObj.filter[col].filterComputed, \"Main\")).split(\",\");\n\t\t\t\t\tif(s.length >= 1)\n\t\t\t\t\t\tfilterMethod = s[0].trim();\n\t\t\t\t\tif(s.length == 2)\n\t\t\t\t\t\tfilterArg = s[1].trim();\n\t\t\t\t}\n\t\t\t\tif(filterMethod==\"Top\" || filterObj.filter[col].isFilterTop){\n\t\t\t\t\tconsole.log(\"do filter top\");\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(filterObj.filter[col].filterTopNum){\n\t\t\t\t\t\t\tfilterArg = filterObj.filter[col].filterTopNum;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturnArray.length = parseInt(filterArg);\t\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e){\n\t\t\t\t\t\tconsole.log(\"filerTop.num is not an interger. do nothing.\");\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(\"filter top done\");\n\t\t\t\t}\n\t\t\t\tif(filterObj.filter[col].isFilterValue){\n\t\t\t\t\tconsole.log(\"do filter value\");\t\t\t\t\n\t\t\t\t\tvar i = 0;\n\t\t\t\t\tif(filterObj.filter[col].filterValueMethod){\n\t\t\t\t\t\tvar method = filterObj.filter[col].filterValueMethod;\n\t\t\t\t\t\tif(method == \"=\")\n\t\t\t\t\t\t\tmethod += \"=\";\n\t\t\t\t\t\tvar value = parseInt(filterObj.filter[col].filterValueNum);\n\t\t\t\t\t\tif(isNaN(value))\n\t\t\t\t\t\t\tvalue = filterObj.filter[col].filterValueNum;\n\t\t\t\t\t\tfilterArg = method+value;\t\t\n\t\t\t\t\t}\n\t\t\t\t\twhile(returnArray[i]){\t\n\t\t\t\t\t\tif(eval(cellConstraints[returnArray[i]].get()+filterArg)){\t\t\n\t\t\t\t\t\t\ti++;\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tconsole.log(\"filter by value: find element to cut, obj=\"+cellConstraints[returnArray[i]].get()+\", index=\"+i+\", value=\"+value);\n\t\t\t\t\t\t\treturnArray.splice(i, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(\"filter value done\");\n\t\t\t\t}\n\t\t\t\tif(filterMethod==\"Duplicates\" || filterObj.filter[col].isRemoveDuplicates){\t\t\n\t\t\t\t\tconsole.log(\"filter duplicates\");\n\t\t\t\t\tvar uniqueValue = [];\t\t\t\t\t\t\t\n\t\t\t\t\treturnArray = returnArray.filter(function(elem, pos) {\n\t\t\t\t\t\tif($.inArray(cellConstraints[elem].get(), uniqueValue) == -1){\n\t\t\t\t\t\t\tuniqueValue.push(cellConstraints[elem].get());\n\t\t\t\t\t\t\treturn true;\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn false;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\t\n\t\t\t\t\tconsole.log(\"filter duplicates done\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnArray;\n\t\n}", "title": "" } ]
e015e92bcc660435cee9761c4f0dbb1d
New player has joined
[ { "docid": "429c8d7a99917d141a092b9a36e1445c", "score": "0.66951317", "text": "function onNewPlayer(data) {\n\tconsole.log(\"new player joined\");\n\tconsole.log(data.user);\n\tdata.id = this.id;\n\t// Add new player to the players array\n\tplayers[players.length] = data;\n\t\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.emit(\"new player\", players[players.length-1]);\n\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length-1; i++) {\n\t\t//existingPlayer = players[i];\n\t\tthis.emit(\"new player\", players[i]);\n\t\t//console.log(\"just sent \" + players[i].id);\n\t};\n}", "title": "" } ]
[ { "docid": "c94612c59bb9c91b690b00d3c2c1ecfc", "score": "0.7400906", "text": "function join (username, stats) {\n // tell the others\n this.broadcast.emit('player joined', this.id, username, stats);\n\n // keep a record of this player\n players[this.id] = {username, stats};\n\n console.log('\\n' + username, '(' + this.id + ')', 'joined the Oasis.');\n}", "title": "" }, { "docid": "ed5b1ac1f2b81061e78c481021851e81", "score": "0.729901", "text": "function joinGame({ username, oldID }) {\n game.addPlayer(this, username, oldID)\n}", "title": "" }, { "docid": "194c0e40859d45575ba415ec1687a281", "score": "0.72557384", "text": "function joinGame(username) {\n game.addPlayer(this, username);\n}", "title": "" }, { "docid": "721460c5f780612c0c89012682bfd189", "score": "0.72255766", "text": "function playerJoin(newPlayerID)\r\n{\r\n if(playerCount > MAX_PLAYER)\r\n {\r\n // if player number is over 20, refuse it\r\n return;\r\n }\r\n\r\n //wait server give its info\r\n var newCharacter = sentCharacters[newPlayerID];\r\n console.log(\"a new comer \" + newPlayerID);\r\n var newPlayerName = newCharacter.name;\r\n\r\n // setup new player\r\n characters[newPlayerID] = new character(newPlayerID, newPlayerName, lastPlatformX, newCharacter.y);\r\n\r\n //player.body.collideWorldBounds = true;\r\n\r\n localPlayerList[newPlayerID] = true;\r\n}", "title": "" }, { "docid": "ee8f977549ca70685e5332e63ec33faf", "score": "0.7180896", "text": "isJoinable() {\n return (this.players.length < 5 && !this.isStart)\n }", "title": "" }, { "docid": "c2c9fe595eab23636ce4e55ec34babb3", "score": "0.70974624", "text": "function joinedRoomListener () {\n displayChatMessage(\"Welcome to iLand!\");\n msgManager.sendUPC(UPC.SEND_MESSAGE_TO_ROOMS, \"CHAT_MESSAGE\", roomID, \"true\", \"\", username+\" has joined.\");\n}", "title": "" }, { "docid": "24a1fd7cbb1447583422cb943c453ed3", "score": "0.7094391", "text": "function onPlayerJoin(event) {\r\n\r\n var player = event.getPlayer();\r\n\r\n // Make sure entity is a player, for some reason\r\n // NPCs can also trigger onPlayerDeath\r\n if (!(player instanceof BkPlayer)) {\r\n return;\r\n }\r\n\r\n if (!dynamicBans) {\r\n player.kickPlayer('Respawn plugin failed, talk to an admin on destiny.gg');\r\n return;\r\n }\r\n\r\n var name = player.getName();\r\n var uuid = player.getUniqueId().toString();\r\n var banData = dynamicBans[uuid];\r\n\r\n if (name.toLowerCase().indexOf('mouton') >= 0) {\r\n player.chat('I\\'m Mr. Mouton, look at me!');\r\n }\r\n\r\n if (name.toLowerCase().indexOf('showmewhat') >= 0) {\r\n player.chat('Get Schwifty!');\r\n }\r\n\r\n if (!banData) {\r\n // player has no deaths allow join\r\n return;\r\n }\r\n\r\n if (banData.eliminated) {\r\n player.kickPlayer('You have already died ' + deathLimit + ' times, no respawns left. Get cucked.');\r\n }\r\n\r\n if (!banData.dateBanExpires) {\r\n // No ban expiry set, player is allowed to join\r\n return;\r\n }\r\n\r\n var diff = banData.dateBanExpires - new Date().getTime();\r\n if (diff > 0) {\r\n player.kickPlayer('You can respawn in ' + (diff / banDurationMillis) + ' ' + banDurationUnit);\r\n }\r\n // Ban has expired, allow player to join\r\n return;\r\n}", "title": "" }, { "docid": "cc45d8374609043221128ccf42d8bc1a", "score": "0.699923", "text": "function joinGame() {\n tc.gameId = prompt(\"Please enter the game ID to join.\");\n\n // Attach to game & initialize game variables, players, and game variables using saved var\n initializeGame(name1,image1,score1,name2,image2,score2);\n initializeBoard(); // call after game is initialized\n \n // Set the game board message to Game On to start playing\n tc.ttt.game.message = 'Game on';\n tc.ttt.$save(tc.ttt.game);\n\n tc.gameOver = false; // gameOver is only true if a winner is determined or the game is tied.\n tc.selfPlayer = 2;// joining player = player 2\n }", "title": "" }, { "docid": "aaac6003ba352e087bc695e021224227", "score": "0.6904151", "text": "opponentJoinedHandler(opponentName) {\n this.gameManager.handleGameReadyAndNotify();\n console.log(opponentName + ' joined.');\n }", "title": "" }, { "docid": "0c58e4679f74a264476b0bc28f02a7ed", "score": "0.6852854", "text": "function joinLoaded()\n{\n // Create the local player\n player = createPlayer(username, selectedCharacter, game.width / 2, game.height / 2, true);\n player.score = 0;\n\n // Notify the server of the user joining the game\n socket.emit('join', {username: username, character: selectedCharacter, x: player.player.x, y: player.player.y});\n\n // When a user has joined, create a new player\n socket.on('user joined', function(data){\n var userplayer = createPlayer(data.username, data.character, data.x, data.y, false);\n userplayer.socket = data;\n users[data.id] = userplayer;\n\n console.log(data.username + ' joined the game!');\n });\n\n // When a user as moved, update their coordinates\n socket.on('user moved', function(data){\n var userplayer = users[data.id];\n\n // If the user could not be found, return for now\n if(!userplayer)\n return;\n\n userplayer.player.x = data.x;\n userplayer.player.y = data.y;\n\n });\n\n // When a user disconnects, remove the user\n socket.on('user left', function(data){\n var user = users[data.id];\n\n if(!user)\n return;\n\n console.log(user.socket.username + ' left the game!');\n\n user.player.destroy();\n delete users[data.id];\n });\n\n // When a user sends a chat messege, set the player's messege\n socket.on('user messege', function(data){\n setPlayerMessege(users[data.id], data.messege);\n });\n\n // When the server allows us to pick up an item\n socket.on('pickup accept', function(data) {\n\n // Remove the touched component and add it to the player\n lastTouchedComponent = undefined;\n player.holding = components[data];\n\n // Update the GUI if it is new\n if(!foundComponents[components[data].name])\n $(\"#indicator-\" + components[data].name).removeClass(\"list-group-item-danger\").addClass(\"list-group-item-warning\");\n\n player.status.setText(\"Holding \" + components[data].name + \" (e to drop)\");\n\n // Remove the component from the ground\n components[data].component.destroy();\n delete components[data];\n });\n\n // When a user picks up a component, update their status text and remove the component\n // from the ground\n socket.on('component picked up', function(data) {\n users[data.player].status.setText(\"Holding \" + components[data.id].name);\n components[data.id].component.destroy();\n delete components[data.id];\n });\n\n // When a user drops a component on the ground, update their status text\n // and spawn the component\n socket.on('component dropped', function(data){\n users[data.player].status.setText(\"\");\n spawnComponent(data.component.id, data.component.x, data.component.y, data.component.component);\n });\n\n // Spawn a new component on the ground\n socket.on('spawn component', function(data){\n spawnComponent(data.id, data.x, data.y, data.component);\n });\n\n // Update a user's status text when they consume an item\n socket.on('component let go', function(data){\n users[data].status.setText(\"\");\n });\n\n // When the scores have been updated, refresh the scorebox\n socket.on('score updated', function(data){\n $(\"#user-scores\").empty();\n $.each(data, function(index, value){\n $(\"#user-scores\").append('<li class=\"list-group-item\">' + value.username +'<span class=\"badge\">' + value.score + '</span></li>');\n });\n });\n\n chatenabled = true;\n}", "title": "" }, { "docid": "5d33576da823ae97b1dcf855d237f872", "score": "0.68502146", "text": "onJoin (client/**Client*/) {\n console.log(\"A player joined\");\n }", "title": "" }, { "docid": "dc136650b7d7e6c7714337a4f0db1d18", "score": "0.68270683", "text": "onJoin(client, options, auth) {\n this.state.chatUsers.set(client.sessionId, new ChatUser(options.name));\n const name = this.state.chatUsers.get(client.sessionId).name;\n const value = 'Joined!';\n const messageBody = {name, value};\n this.broadcast(\"joined-or-left\", messageBody, {except: client});\n }", "title": "" }, { "docid": "24399a3ad0e3761f6577b6d239efddec", "score": "0.67936444", "text": "playerFinished() {\n this.playersFinished += 1;\n }", "title": "" }, { "docid": "0e44870ae36aebd63db16d90a6802c52", "score": "0.6723941", "text": "function userJoin(dataPlayer) {\n\ttry {\n\t\tif (users[dataPlayer.room]) {\n\t\t\tconst isNotExsits =\n\t\t\t\tusers[dataPlayer.room].users.findIndex(\n\t\t\t\t\tplayer => player.playerId === dataPlayer.playerId\n\t\t\t\t) === -1;\n\t\t\tif (isNotExsits) {\n\t\t\t\tusers[dataPlayer.room].users.push(dataPlayer);\n\t\t\t\tusers[dataPlayer.room].poker.addPlayer(dataPlayer.playerId);\n\t\t\t}\n\t\t} else {\n\t\t\tusers[dataPlayer.room] = {\n\t\t\t\tusers: [dataPlayer],\n\t\t\t\tpoker: new Poker(),\n\t\t\t};\n\t\t\tusers[dataPlayer.room].poker.addPlayer(dataPlayer.playerId);\n\t\t}\n\n\t\treturn dataPlayer;\n\t} catch (error) {\n\t\tconsole.log(error);\n\t}\n}", "title": "" }, { "docid": "a0c0a6fa9fa57db15108af0b199cb86c", "score": "0.6683347", "text": "joinsTheFight(player){\n // converting the object player to string in order to make possible objects comparison\n const playerAsJSON = JSON.stringify(player);\n if(playersAndScore.some(player=> JSON.stringify(player) == playerAsJSON)){\n console.log(`Player ${player.name} has already joined the fight`);\n } else {\n playersAndScore.push(player);\n console.log(`Player ${player.name} joins the fight`);\n }\n }", "title": "" }, { "docid": "5c51d2c4e85c56d524458fd12a7e4820", "score": "0.6671288", "text": "function joined() {\n if (user.uid === activity.hostId) {\n return;\n } else {\n return activityJoined ? <div>{username} has joined the lobby.</div> : \"\";\n }\n }", "title": "" }, { "docid": "251445e326a6d91525f416579ff553df", "score": "0.6667256", "text": "mucJoined () {\n if (largeVideo && !largeVideo.id) {\n this.updateLargeVideo(APP.conference.getMyUserId(), true);\n }\n }", "title": "" }, { "docid": "54fbcc22a639b94abc15d229a2f893df", "score": "0.66240793", "text": "function joinGame() {\r\n\t\t\t\t\t\tvar matchStarted = true;\r\n\t\t\t\t\t\t$\r\n\t\t\t\t\t\t\t\t.ajax({\r\n\t\t\t\t\t\t\t\t\ttype : \"POST\",\r\n\t\t\t\t\t\t\t\t\turl : \"./match/join\",\r\n\t\t\t\t\t\t\t\t\tdata : $(\"#nameForm\").serialize(),\r\n\t\t\t\t\t\t\t\t\tsuccess : function(result) {\r\n\t\t\t\t\t\t\t\t\t\tshowModalWindow(result.responseMessage);\r\n\t\t\t\t\t\t\t\t\t\tif (result.responseCode != -1) {\r\n\t\t\t\t\t\t\t\t\t\t\tmatchStarted = false;\r\n\t\t\t\t\t\t\t\t\t\t\tsource = new EventSource(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"./match/info\");\r\n\t\t\t\t\t\t\t\t\t\t\tsource.onmessage = function(evt) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar playersArray = JSON\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parse(evt.data).players;\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar isMapReady = JSON\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parse(evt.data).mapReady;\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar gameStarted = JSON\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parse(evt.data).gameStarted;\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (gameStarted) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsource.close();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlocation\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(JSON\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parse(evt.data).gamePage);\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (!warningAlreadyDisplayed\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& isEveryoneReady(playersArray)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& !isMapReady) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tshowModalWindow(\"Everyone is ready but the map hasn't been created yet\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningAlreadyDisplayed = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (!warningAlreadyDisplayed\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& isEveryoneReady(playersArray)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t&& !areThereTwoPlayers(playersArray)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tshowModalWindow(\"Waiting for another player to join...\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningAlreadyDisplayed = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\trefreshPlayersTable(playersArray);\r\n\t\t\t\t\t\t\t\t\t\t\t\tupdateMapStatus(JSON\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parse(evt.data).mapReady);\r\n\t\t\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (!matchStarted) {\r\n\t\t\t\t\t\t\t\t\t\t\t$(\"#joinButton\").attr(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"hidden\");\r\n\t\t\t\t\t\t\t\t\t\t\t$(\"#exitButton\").attr(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"shown\");\r\n\t\t\t\t\t\t\t\t\t\t\t$(\"#readyButton\").attr(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"shown\");\r\n\t\t\t\t\t\t\t\t\t\t\t$(\"#textName\").attr(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"hidden\");\r\n\t\t\t\t\t\t\t\t\t\t\t$(\"#playersTable\").attr(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"shown\");\r\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rightContentDiv\").attr(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"shown\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}", "title": "" }, { "docid": "b262c036cc175b830a761a18640d3aa9", "score": "0.6615858", "text": "join(player, passcode = \"\") {\n console.log(\"Join game \", this.id, \"with player id:\", player.id);\n\n if (this.passcode != \"\" && this.creator.id != player.id) {\n console.log(\"Send \", passcode);\n console.log(\"ORIGINAL \", this.passcode);\n if (passcode != this.passcode) {\n console.log(\"WRONG PASSWORD\");\n throw \"Wrong passcode\";\n }\n }\n console.log(\"Passcheck ok\");\n // Check if there is a spot left\n if (Object.keys(this.players).length == this.max_players) {\n console.log(\"ERROR: Maximum User reached for this game.\");\n throw \"Maximum users reached\";\n }\n // Check if the player was still in game.\n if (this.players[player.id] !== undefined) {\n console.log(\"Duplicate user found. Rejoin \", player.id);\n return;\n }\n\n player.game_id = this.id;\n this.initPlayer(player.id);\n }", "title": "" }, { "docid": "c31a5d945372465eab28147bf28b09dc", "score": "0.66104865", "text": "function user_join(data){\n AstroBot.data = data;\n AstroBot.Events.Welcome();\n }", "title": "" }, { "docid": "733aa3960ad863eed560e376734aae1f", "score": "0.6608172", "text": "function joinSelectedGame() {\n var gameToJoin = document.getElementById('open_games_list').value;\n if (gameToJoin) {\n socket.emit('addPlayerToGame', gameToJoin);\n } else {\n window.alert('You must choose a game name in order to join one.');\n }\n }", "title": "" }, { "docid": "9121193a41bba41b7ec59962f69b037d", "score": "0.6601875", "text": "function player1Win() {\n player1Wins++;\n player2Losses++;\n database.ref(\"Player1/\").update({\n player1Wins: player1Wins,\n gameOver: true\n });\n database.ref(\"Player2/\").update({\n player2Losses: player2Losses,\n gameOver: true\n });\n }", "title": "" }, { "docid": "8d2688bf45d62125b54465e72325e622", "score": "0.65851223", "text": "requestJoin (options/**any*/, isNew/**boolean*/) {\n //TODO: do something more complicated\n var dummyplayerobject = {};\n if(this.fightEngine.playerCanJoin(dummyplayerobject)) return true;\n return false;\n }", "title": "" }, { "docid": "941b2ab6e29f7d6f1ecb3029e097b070", "score": "0.6575949", "text": "function playerjoined(newplayer) {\n const blobs = [];\n const generatedXY = new GenerateX(players, foods);\n blobs.push(new Blob(newplayer.id, generatedXY.xx, generatedXY.yy, StartingSize, 0));\n players.push(new SmallPipi(newplayer.id,\n blobs,\n newplayer.c,\n newplayer.nickname));\n }", "title": "" }, { "docid": "da780ec5b7d0fb96d9390913fb694162", "score": "0.6574322", "text": "function PlayerSet() {\r\n //if lobby is filled then oh well\r\n if (json.player1.joined && json.player2.joined) {\r\n return console.log(\"Lobby Filled\");\r\n } else if (json.player1.joined == false) {\r\n //if player1 isnt selected then set everything to blank and assign this player player 1\r\n player = 1;\r\n origin.ref('player1/').set({\r\n //assign user player1 and reset wins/losses\r\n joined: true,\r\n wins: 0,\r\n losses: 0,\r\n })\r\n origin.ref('player1/').onDisconnect().set({\r\n //when closing window set joined to false and reset wins and losses\r\n joined: false,\r\n wins: 0,\r\n losses: 0,\r\n })\r\n } else if (json.player2.joined == false) {\r\n //if player one is taken and player2 isnt then assign to player2 and reset wins/losses\r\n player = 2;\r\n origin.ref('player2/').set({\r\n joined: true,\r\n wins: 0,\r\n losses: 0,\r\n })\r\n origin.ref('player1/').onDisconnect().set({\r\n //when closing window set joined to false and reset wins and losses\r\n joined: false,\r\n wins: 0,\r\n losses: 0,\r\n })\r\n }\r\n}", "title": "" }, { "docid": "88b713fd08be237bf63022be8ad111f5", "score": "0.65620095", "text": "joinPlayer(name, connection) {\n let player;\n let clientProxy = connection.clientProxy;\n\n // check if this player has already joined XXX check client-ip\n for (let p of this.players.iterator()) {\n p = p[ITEM];\n if (p.name === name) {\n p.init(name, clientProxy);\n this.emit('joinPlayer', p);\n return p;\n }\n }\n\n try {\n player = this.playersIterator.next().value[ITEM];\n } catch(e) {\n player = undefined;\n }\n\n if (player) {\n player.init(name, clientProxy);\n player.joined = true;\n this.joinedPlayers.push(player);\n this.playersId[connection.id] = player;\n this.emit('joinPlayer', player);\n return player;\n }\n return undefined;\n }", "title": "" }, { "docid": "6e844954a26960cc45fee60ced46ff18", "score": "0.65256786", "text": "userJoined(data) {\n console.log(data.username + ' joined');\n // Append to active users if not current user\n if(data.username !== this.Users.getUser().name) {\n // Add user to active users\n const joinedUser = new User(data.username);\n this.Users.addUser(joinedUser);\n // Create a channel for user\n const dmChannel = this.Channels.createDMChannelForUser(joinedUser);\n // Add channel\n this.Channels.addChannel(dmChannel);\n // Show notification\n var userJoinedMessage = data.username + ' joined'\n this.showNotification(userJoinedMessage);\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "099be7fb891c0c8a08656b02c2c44eb4", "score": "0.651758", "text": "onJoinGame (ws, data, playerId) {\n const lobby = this._getLobbyData(playerId);\n\n // intialize position\n Object.values(lobby.data.player).forEach((playerData) => {\n playerData.pos = {\n x: 0,\n y: 0,\n };\n });\n\n publish(lobby.topic, \"joinGame\", lobby.data);\n }", "title": "" }, { "docid": "3a5875bd4659bca4adfedd1ef36da546", "score": "0.6497583", "text": "function joinGame(event) {\n\n\n gameLoc = event.target.id\n //local reference to the /game location in the database\n console.log(gameLoc)\n\n //local reference to your displayName\n var yourPlayer = firebase.auth().currentUser\n\n //variable for the path to the game you just clicked on\n\n var gameRef = ref.child(gameLoc)\n console.log(gameRef)\n\n //transaction allows only one person to interact with a section of the database at a time and ensures that multiple people dont click on the same game\n gameRef.transaction(function (game) {\n console.log(gameRef)\n\n //if there is only a creator on the clicked game and no 2nd player, then we'll create one and set it equal to the information stored about us, the player.\n if (!game.joiner) {\n game.state = STATE.JOINED;\n game.joiner = { uid: yourPlayer.uid, displayName: yourPlayer.displayName }\n }\n //return game into the db\n return game;\n }).then(function () {\n //display \"GAME ACTIVE\"\n //playing opponent \"x\"\n console.log(gameRef)\n watchGame(gameLoc);\n })\n }", "title": "" }, { "docid": "2f9dd743d023e56dac032d9f41581901", "score": "0.64645594", "text": "notifyPlayerJoin(lobbyId, playerName) {\n if (typeof playerName !== \"string\") {\n throw new Error(\"Message is not a string\");\n }\n\n this.ws.to(lobbyId).emit(\"playerHasJoined\", playerName);\n }", "title": "" }, { "docid": "5bfcf34b8fc8d02cc329f031ae672cf0", "score": "0.6449006", "text": "function joinGame()\n{\n var pid = $('#players .controls select').val();\n if (pid <= 0) return;\n\n $.get('/players/' + pid, {}, function(player, text, xhr) {\n $.post('/games/' + gameId + '/add/player/' + pid, {}, function(data, text, xhr) {\n addActivePlayer(player);\n // Success! Remove from available list\n $('#player-available-' + pid).remove();\n });\n });\n}", "title": "" }, { "docid": "b82427c51e7358279498fb1fa884c630", "score": "0.64397943", "text": "function joinState()\n{\n\t// Hide all initially shown start buttons.\n\tdocument.getElementById(\"start-button-container\").style.display = \"none\";\n\n\t// Display that the client is waiting for someone to join.\n\tdocument.getElementById(\"message\").innerHTML\n\t\t= \"Waiting for an opponent to join.\";\n\n\t// Initialise all tiles in the grid and draw them.\n\tinitialiseTiles();\n\tdrawAllTiles();\n\n // Check if this client joined first.\n\tif (mySnakeID == 0)\n\t{\n\t\t// Create my new Snake instance and initialise it.\n\t\tsnakes.push(new Snake(startingSnakeLength, \"RIGHT\"));\n\t\tsnakes[mySnakeID].initialise();\n\t}\n\telse\n\t{\n\t\t// Create a new Snake instance for the opponent player.\n\t\tsnakes.push(new Snake(startingSnakeLength, \"RIGHT\"));\n\n\t\t// Create my new Snake instance and initialise it.\n\t\tsnakes.push(new Snake(startingSnakeLength, \"LEFT\"));\n\t\tsnakes[mySnakeID].initialise();\n\t}\n\n // Poll for players to join.\n\tjoinPolling = setInterval(() => {\n\t\tsend({\n\t\t\taction: \"request players\",\n\t\t\tmy_player_id: myPlayerID,\n\t\t});\n\t}, 200);\n}", "title": "" }, { "docid": "464d7e3a07755d111e3f1bd2de3c94ca", "score": "0.6438927", "text": "function userJoin(username, timestamp) {\n addMessage(username, \"joined\", timestamp, \"join\"); // put it in the stream\n // If we already know about this user, ignore it.\n for (var i = 0; i < online_users.length; i++) {\n if (online_users[i] == username) return;\n }\n online_users.push(username); // otherwise, add the user to the list\n updateUsers(); // update the UI\n}", "title": "" }, { "docid": "2ff0a2701f80699f96f1b9f25695d274", "score": "0.6420959", "text": "function onConnectedJoinGame() {\n connected = true;\n var word = document.getElementById(\"word\");\n var username = document.getElementById(\"username\");\n //Subscribe to the Public Topic\n //Ovdje stavimo key koji player ukuca da saznamo kojoj igri pripada\n stompClient.subscribe('/topic/player'+word.value, onPlayerJoined);\n\n // Tell your username to the server\n stompClient.send(\"/app/memory/findGame\",\n {},\n JSON.stringify({userCode:word.value, username: username.value})\n );\n logArea.classList.add('hidden');\n}", "title": "" }, { "docid": "3138db8f0a32acb3423b15ad8bef639b", "score": "0.64123136", "text": "onTimeIsUp() {\n this.firebase.savePlayer(this.playerName, this.score);\n }", "title": "" }, { "docid": "6bf06fcb59a4b131b88d29ea5899c3d8", "score": "0.6386155", "text": "function player2Win() {\n player2Wins++;\n player1Losses++;\n database.ref(\"Player1/\").update({\n player1Losses: player1Losses,\n gameOver: true\n });\n database.ref(\"Player2/\").update({\n player2Wins: player2Wins,\n gameOver: true\n });\n }", "title": "" }, { "docid": "d261b77e89f1c05fe321f4b78c8dc0c4", "score": "0.6380825", "text": "function joinGame (data) {\n let hostPlayerId = data.hostPlayerId;\n\n currentPlayerId = data.playerId;\n\n if (hostPlayerId && allOnlinePlayers[hostPlayerId] && allOnlinePlayers[hostPlayerId].rooms) {\n\n // get hostPlayerId's current room id\n currentRoomId = allOnlinePlayers[hostPlayerId].rooms[0];\n\n if (rooms[currentRoomId] && rooms[currentRoomId].getAllPlayers()) {\n\n rooms[currentRoomId].addPlayer(currentPlayerId);\n\n _updateAllPlayerList(currentPlayerId, currentRoomId);\n\n socket.emit(\"GAME_JOINED\", {\n msg: \"Game room joined with id \" + currentRoomId,\n allOnlinePlayers: allOnlinePlayers,\n room: rooms[currentRoomId],\n mapData: mapData\n });\n\n _joinSession();\n\n } else {\n socket.emit(\"SESSION_NOT_FOUND\", {\n msg: \"No non-empty session exists with id \" + currentRoomId\n });\n }\n\n } else {\n socket.emit(\"HOST_NOT_FOUND\", {\n msg: \"Could not find host player with id \" + hostPlayerId\n });\n }\n }", "title": "" }, { "docid": "10b73d21354951d0e9d74f21ed1aa5e3", "score": "0.6359526", "text": "function onGhostJoin() {\n newPlayer.color = colorPicker.value\n newPlayer.type = PLAYERTYPES.GHOST\n\n // hide lives counter\n livesContainer.style = 'visibility: hidden'\n onNewPlayer()\n}", "title": "" }, { "docid": "e5da96c363af2c340ab69fdb6ffb3ee1", "score": "0.6357543", "text": "function joinGame () {\n\t\tvar isError = false;\n\t\tvar username = $('#input_username1').val().trim();\n\t\tvar gameID = $('#input_GameID').val().trim();\n\n\t\t//Check if username is present\n\t\tif (username.length <= 0) {\n\t\t\tshowError('input_username1');\n\t\t\tisError = true;\n\t\t}\n\t\telse {\n\t\t\thideError('input_username1');\n\t\t\tglobal.username = username;\n\t\t}\n\n\n\t\t//Check if gameID is present\n\t\tif (gameID.length <= 0) {\n\t\t\tshowError('input_GameID');\n\t\t\tisError = true;\n\t\t}\n\t\telse {\n\t\t\thideError('input_GameID');\n\t\t\tglobal.gameID = gameID;\n\t\t}\n\n\t\t//If all is good, ask server to join\n\t\tif (!isError) {\n\t\t\tvar userInfo = {\n\t\t\t\t\"username\": global.username,\n\t\t\t\t\"gameID\": global.gameID,\n\t\t\t\t\"socketID\": global.socket.id\n\t\t\t};\n\n\t\t\tsendToServer(\"JOIN_GAME\", userInfo);\n\t\t}\n\t}", "title": "" }, { "docid": "630621e07519bb12c6be6933ddfbf08f", "score": "0.6355125", "text": "function playerJoinGame(data){\n console.log('Player ' + data.username + ' is attempting to join game #' + data.gameId);\n console.log(data.gameId);\n console.log(this.rooms);\n console.log(gameSocket.rooms);\n // console.log(data.gameId);\n //finds roomId in the Socket.io manager object\n var room = gameSocket.rooms[data.gameId];\n console.log(room);\n if (room !== undefined){\n //attaches socketId to the data object\n data.mySocketId = this.id;\n\n //join the room\n this.join(data.gameId);\n\n console.log(\"Player \" + data.username+ \" joined game \" + data.gameId);\n\n //emits message notifying a player entering lobby\n io.sockets.in(data.gameId.toString()).emit('playerJoinedRoom', data);\n } else {\n //Send error message to server\n console.log('error');\n }\n }", "title": "" }, { "docid": "eb80a48129bd9e1238d04c65877fed42", "score": "0.63385224", "text": "onJoinedGuild(guild) { }", "title": "" }, { "docid": "e89484a2130ea5f03a647e9590ab1c93", "score": "0.6325952", "text": "onJoin(client, options, auth) {\n if (!this.state.white) {\n this.app.name = options.name;\n this.setState({ ...this.state, white: client });\n client.send(\"gameState\", this.app.clientGameState());\n } else if (!this.state.black) {\n this.app.opponentName = options.name;\n this.setState({ ...this.state, black: client });\n client.send(\"gameState\", this.app.mirrorClientGameState());\n }\n\n if ((this.online && this.clients.length === 2) || !this.online) {\n this.lock();\n this.app.playersReady = true;\n this.sendGameState(\n this.app.clientGameState(),\n this.app.mirrorClientGameState()\n );\n }\n }", "title": "" }, { "docid": "5cf140ce8be152f52a10d8ef8dbd7caf", "score": "0.6324405", "text": "function playerReady()\n\t{\n\t\tvar moi = players_map[player_name_current];\n\t\tmoi.isReady = true;\n\t\tsocket.emit('ready',moi.name);\n\t\tdrawPlayerNames();\n\t}", "title": "" }, { "docid": "5891b88f9d76af38fbf14cdc3f330d48", "score": "0.6312374", "text": "function playerJoinGame(data) {\n // A reference to the player's Socket.IO socket object\n\n var sock = this;\n\n var room = gameSocket.manager.rooms[\"/\" + data.gameId];\n\n if(room != undefined){\n data.mySocketId = sock.id;\n\n // Join room\n sock.join(data.gameId);\n\n io.sockets.in(data.gameId).emit('playerJoinedRoom', data);\n\n } else {\n // Or not\n this.emit('error', {message: \"This room does not exist\"});\n }\n}", "title": "" }, { "docid": "b07a22f0d6a440b8e5d668cb6a6ed77b", "score": "0.63075536", "text": "@listener('player_join_team')\n on_player_join_team({ team }) {\n this._current_team = team\n }", "title": "" }, { "docid": "1737ce9954b001e00e96fb408095de67", "score": "0.62728363", "text": "function handleJoinGame(roomName) {\n // get all the game codes in the client rooms object\n const gameCodes = Object.values(clientRooms);\n\n // count how many clients have used the specific game code the player entered(the roomName) to see how many people are in the game we are trying to join\n let numClients = 0;\n for (let val of gameCodes) {\n // if there is a game code that matches the room name, then increment the number of clients in the room\n if (val === roomName) {\n numClients++;\n }\n }\n\n // if there are no clients and the client tried to join, then this game code isb't valid\n if (numClients === 0) {\n client.emit('unknownCode');\n return;\n } else if (numClients > 1) { // if there is more than 1 player in the game room then this player shouldn't be allowed to join\n client.emit('tooManyPlayers');\n return;\n }\n \n // add this users id to the room since they were able to join\n clientRooms[client.id] = roomName;\n\n // get the terrain so that the tank can be placed\n const terrain = state[roomName].terrain;\n \n // make the second player join the room and make the second tank\n client.join(roomName);\n client.number = 2;\n let startPoint = Math.floor(NUM_TERRAIN_POINTS * 4/5);\n let player2 = new Tank(terrain.terrainPoints[startPoint].x, terrain.terrainPoints[startPoint].y, 180, client.id);\n client.emit('init', \n {\n worldSize: WORLD_SIZE, \n player: player2,\n playerNumber: 2\n });\n\n // add the second player to the state for this room\n state[roomName].player2 = player2;\n\n // when the second player joins the game, set the this game's turn to the first player's id\n state[roomName].turn = state[roomName].player1.playerId;\n\n console.log(state[roomName]);\n\n // start the game for this room\n startGameInterval(roomName);\n }", "title": "" }, { "docid": "873162188625e4c6c2fa30b93c0d193a", "score": "0.6272789", "text": "function onPacmanJoin() {\n newPlayer.color = colorPicker.value\n newPlayer.type = PLAYERTYPES.PACMAN\n onNewPlayer()\n}", "title": "" }, { "docid": "259a0a111aec4f8ec6baf755eb2c9b52", "score": "0.6256721", "text": "function playerJoinGame(data) {\n //console.log('Player ' + data.playerName + 'attempting to join game: ' + data.gameId );\n\n // A reference to the player's Socket.IO socket object\n var sock = this;\n\n // Look up the room ID in the Socket.IO manager object.\n var room = gameSocket.manager.rooms[\"/\" + data.gameId];\n\n // If the room exists...\n if( room != undefined ){\n // attach the socket id to the data object.\n data.mySocketId = sock.id;\n\n // Join the room\n sock.join(data.gameId);\n\n //console.log('Player ' + data.playerName + ' joining game: ' + data.gameId );\n\n // Emit an event notifying the clients that the player has joined the room.\n io.sockets.in(data.gameId).emit('playerJoinedRoom', data);\n\n } else {\n // Otherwise, send an error message back to the player.\n this.emit('error',{message: \"This room does not exist.\"} );\n }\n}", "title": "" }, { "docid": "8d89d4e326a5de4202740393840dfec5", "score": "0.62526685", "text": "function playerJoinGame(data) {\n\n // A reference to the player's Socket.IO socket object\n var sock = this;\n\n // Look up the room ID in the Socket.IO manager object.\n // var room = gameSocket.manager.rooms[\"/\" + data.gameId];\n var room = gameSocket.adapter.rooms[data.gameId];\n\n // If the room exists...\n if (room !== undefined) {\n // attach the socket id to the data object.\n data.mySocketId = sock.id;\n\n // Join the room\n sock.join(data.gameId);\n\n // add username if unknown\n db.query('SELECT * FROM player WHERE player_name = ?', data.playerName, function (err, rows) {\n if (err) throw err;\n\n if (!rows.length) {\n var user = {player_name: data.playerName, player_win: 0};\n db.query('INSERT INTO player SET ?', user, function (err, res) {\n if (err) throw err;\n });\n }\n });\n\n // Emit an event notifying the clients that the player has joined the room.\n io.sockets.in(data.gameId).emit('playerJoinedRoom', data);\n\n } else {\n // Otherwise, send an error message back to the player.\n this.emit('gameError', {message: \"This room does not exist.\"});\n }\n}", "title": "" }, { "docid": "a89be16135c0526c2dd9671c410953d6", "score": "0.6247812", "text": "async joinGroup() {\n await this.group.addUser(RB.UserSession.instance.get('username'));\n this.set('joined', true);\n }", "title": "" }, { "docid": "2238de9f86d28d2bd75ad0f081b496aa", "score": "0.62380165", "text": "function onPlayerChanged(snapshot) {\n var numPlayers;\n if (!snapshot.exists()) {\n // This happens if the last player quits, since Firebase deletes the whole \"/players\" node\n numPlayers = 0;\n } else {\n numPlayers = Object.keys(snapshot.val()).length;\n }\n\n if (numPlayers == 0) {\n setMenuMessage(\"\");\n activatePanel(MENU_PANEL);\n } else if (numPlayers == 1) {\n setMenuMessage(\"Waiting on another player...\");\n activatePanel(MENU_PANEL);\n } else if (numPlayers == 2) {\n setMenuMessage(\"Start game!\");\n startGame();\n activatePanel(GAME_PANEL);\n } else {\n // This shouldn't happen\n console.log(\"More than 2 players joined?!\");\n debugger;\n }\n}", "title": "" }, { "docid": "e02acd0d40262815f46f8a3fc2045dd6", "score": "0.6236742", "text": "function onNewPlayer(data) {\n// Create a new player\n var newPlayer = new Player(this.id, data.nickname);\n\n// Broadcast new player to connected socket clients\n this.broadcast.emit(\"new player\", newPlayer);\n\n// Send existing players to the new player\n var roomKeys = Object.keys(socket.sockets.manager.rooms);\n for (var i = 0, ii = roomKeys.length; i < ii; i++) {\n if (roomKeys[i] != \"\") {\n var roomName = roomKeys[i].substring(1);\n var roster = socket.sockets.clients(roomName);\n for (i = 0, ii = roster.length; i < ii; i++) {\n var player = playerById(roster[i].id);\n this.emit(\"join room\", {roomName: roomName, player: player});\n }\n\n }\n }\n// Add new player to the players array\n util.log(\"New player has been created: \"+ this.id);\n players[newPlayer.nickname] = newPlayer;\n}", "title": "" }, { "docid": "3504deb918d6fa9ee5eda50d2685fd07", "score": "0.62343764", "text": "joinTeam() {\n let numInRoom = Object.keys(ROOM_LIST[this.room].players).length;\n if (numInRoom % 2 === 0) this.team = \"blue\";\n else this.team = \"red\";\n }", "title": "" }, { "docid": "3b07ce9649245952c8cdcecc81ca50fb", "score": "0.6224094", "text": "message(player) {\n const message =\n player.name === 'playerOne'\n ? 'Player 1 wins!'\n : 'Player 2 wins!';\n\n this.messageContainer.classList.add('game-won');\n this.messageContainer.querySelector(\n '.message'\n ).textContent = message;\n this.messageContainer\n .querySelector('#player')\n .classList.add(`${player.name}`);\n }", "title": "" }, { "docid": "10dc1451a282048eaf942752af50c630", "score": "0.6209547", "text": "function joinChat() {\n // Pass userId and name to pusher\n $.post('join-chat', {userId: localUser.id, username: localUser.name}, function() {\n const channel = pusher.subscribe('presence-groupChat');\n channel.bind('pusher:subscription_succeeded', (member) => {\n showUsers(channel)\n });\n \n // Begin listening for chat updates\n listen();\n });\n }", "title": "" }, { "docid": "aa86216f40f1d1fb71ef5715c7db758d", "score": "0.6205876", "text": "function playerLeft(data){\n\tconsole.log(\"Player left game: \" + data.user + \" ending game...\");\n endGame(data);\n}", "title": "" }, { "docid": "540caac751d6f8eff335e197ab56a59b", "score": "0.6201702", "text": "async joinGame(serverUUID, clientUUID){\n // send the channel notification\n dispatcher.dispatch({\n action: Constants.ActionTypes.ATTEMPT_JOIN,\n });\n\n lobbyChannel.send(Constants.ActionTypes.OFFER_JOIN, {\n serverUUID, clientUUID\n });\n }", "title": "" }, { "docid": "25e4ed056b8e6d763784c4d8265a45e1", "score": "0.6194756", "text": "declareWinner() {\n if (this.theEnd == true && this.player1.health <= 0) {\n console.log(this.player2.name + ' WINS!');\n } else if (this.theEnd == true && this.player2.health <= 0) {\n console.log(this.player1.name + ' WINS!');\n } else {\n console.log(\"Can't declare winner yet!\");\n }\n }", "title": "" }, { "docid": "1ff1934e02423c290ffad74b50437984", "score": "0.6192331", "text": "function playerWins() {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tresetPlayer();\n\t\t\t\t\t\tsetEnemy();\n\t\t\t\t\t\tcompInterval = setInterval(compdraw, 100);\n\t\t\t\t\t\tcompanimateCat('idle');\n\t\t\t\t\t}, 1500)\n\t\t\t\t}", "title": "" }, { "docid": "fcbff5d42bd5c130eccd943b09c95e2d", "score": "0.6184288", "text": "function joinGame () {\n // Tell the server that the entered player name is joining.\n var nickname = $('#nickname').val();\n socket.emit('join', { name: nickname });\n $('#signin').hide();\n}", "title": "" }, { "docid": "b262df1fe3814fd3de5242e93ab29e1b", "score": "0.6183705", "text": "function userJoin(username){\n socket.emit('user join', username);\n}", "title": "" }, { "docid": "51b9a0809c20534f81ae9cdda33cd5ef", "score": "0.61766356", "text": "function playerJoinGame(data) {\n //console.log('Player ' + data.playerName + 'attempting to join game: ' + data.gameId );\n // A reference to the player's Socket.IO socket object\n var sock = this;\n\n // Look up the room ID in the Socket.IO manager object.\n var room = gameSocket.adapter.rooms[data.gameId];\n\n // If the room exists...\n if (room != undefined) {\n\n data.mySocketId = sock.id;\n\n // attach the socket id to the data object.\n // Join the room\n sock.join(data.gameId);\n console.log('Player ' + data.playerName + ' joining game: ' + data.gameId);\n // Emit an event notifying the clients that the player has joined the room.\n io.sockets.in(data.gameId).emit('playerJoinedRoom', data)\n\n } else {\n // Otherwise, send an error message back to the player.\n io.sockets.in(data.gameId).emit('error', {message: \"This room does not exist.\"});\n }\n}", "title": "" }, { "docid": "905f923180e3bc5d531b5f57f1307561", "score": "0.6175242", "text": "function onConferenceJoined () {\n console.log('conference joined!')\n isJoined = true\n // for (let i = 0; i < localTracks.length; i++) {\n // room.addTrack(localTracks[i])\n // }\n}", "title": "" }, { "docid": "dde5726ff3a3551be6b00ef9f8d3d277", "score": "0.6174401", "text": "async playerJoin(playerId, gameId)\n {\n const resp = await this.sql.query(`\n select game_id as id\n from game_players\n where player_id = @playerId\n and game_id = @gameId\n `, {playerId, gameId});\n\n if (resp.firstOrNull()) {\n this.log.info('player %s already in game %s, not adding', playerId, gameId);\n return;\n }\n\n await this.sql.query(`\n insert into game_players (player_id, game_id)\n values (@playerId, @gameId)\n `, {playerId, gameId});\n }", "title": "" }, { "docid": "0ef0c5c5a5a12c96aab06e64c3653185", "score": "0.61696595", "text": "function playerJoin(id, username, room) {\n var player;\n const index = players.findIndex(player => player.id === id);\n\n if (index <0) {\n player = {\n socket_id: id,\n username: username,\n room: room,\n playing: false,\n character: '',\n ready: false,\n color: colors[0]\n };\n\n colors.push(colors.splice(0, 1)[0]);\n players.push(player);\n }\n else {\n player = players[index];\n }\n\n return player;\n}", "title": "" }, { "docid": "1879624dbd35c50e26a1ac42935f635e", "score": "0.61624557", "text": "join(room) {\n this._playerConnection.join(room);\n }", "title": "" }, { "docid": "be8ed3d3f41f046751a34dbb7bb8bf08", "score": "0.61563015", "text": "function joinChatRoom(username, roomname) {\n\n for(var i = 0; i < onlinePlayers.length; i++) {\n\n if(onlinePlayers[i].name === username) {\n\n var sessionID = onlinePlayers[i].session;\n\n var room = onlinePlayers[i].room;\n\n io.sockets.sockets[sessionID].join(room);\n\n console.log(getTime() + ' ' + username + \" ENTERED \" + room);\n\n }\n\n }\n\n}", "title": "" }, { "docid": "4b6743edbff20c1ab6c5066a1b055273", "score": "0.6139895", "text": "function _joinSession () {\n // join currentRoomId room\n socket.join(currentRoomId);\n\n // inform everyone in currentRoomId of new joinee\n io.sockets.in(currentRoomId).emit(\"JOINED_SESSION\", {\n playerId: currentPlayerId,\n players: rooms[currentRoomId].getAllPlayers(),\n room: rooms[currentRoomId],\n msg: currentPlayerId + \" joining \" + currentRoomId\n });\n }", "title": "" }, { "docid": "363d6422089e4bc98f0caac955e55c04", "score": "0.61395746", "text": "joinedRoomHandler(room) {\n if (room == '-1') {\n this.gameManager.setErrorMessage(\"Your friend's room doesn't exist!\");\n } else if (room == '-2') {\n this.gameManager.setErrorMessage(\"Your friend's room is full!\");\n } else {\n this.gameManager.setRoom(room);\n this.gameManager.setChess(2);\n this.gameManager.handleGameReady();\n console.log('You joined to room ' + room);\n }\n }", "title": "" }, { "docid": "fd30ae957bce20c0768836aa63d67922", "score": "0.6136896", "text": "function checkPlayerWin(player, exit) {\n if (mysticGemCount == 5) {\n // you win!\n this.exitLayer.visible = false;\n this.underExitLayer.visible = true;\n this.exitLayer.destroy();\n this.doorOpen.play();\n score += 500;\n this.scoreCounter.text = 'Score = ' + score;\n let victory = game.add.text(300, 250, 'YOU WIN!', {fill:'white', fontSize:'50px', boundsAlignH:'middle', boundsAlignV:'middle'});\n victory.fixedToCamera = true;\n game.time.events.add(5000, restart, this);\n }\n }", "title": "" }, { "docid": "703a24956fbc8fa51182e06ce2f3a097", "score": "0.6131497", "text": "function joinServer() {\n if (process.uptime() > 5) return; // to avoid running this function again when reloading\n var worker = new(require('./fake-process.js').FakeProcess)();\n Users.socketConnect(worker.server, undefined, '1', 'bot');\n\n for (var i in Users.users) {\n if (Users.users[i].connections[0].ip === 'bot') {\n\n var bot = Users.users[i];\n\n bot.name = config.name;\n bot.named = true;\n bot.renamePending = config.name;\n bot.authenticated = true;\n bot.userid = config.userid();\n bot.group = config.group;\n bot.avatar = config.customavatars;\n\n if (config.join === true) {\n Users.users[bot.userid] = bot;\n for (var room in Rooms.rooms) {\n if (room != 'global') {\n bot.roomCount[room] = 1;\n Rooms.rooms[room].users[Users.users[bot.userid]] = Users.users[bot.userid];\n }\n }\n } else {\n Users.users[bot.userid] = bot;\n for (var index in config.rooms) {\n bot.roomCount[config.rooms[index]] = 1;\n Rooms.rooms[config.rooms[index]].users[Users.users[bot.userid]] = Users.users[bot.userid];\n }\n }\n delete Users.users[i];\n }\n }\n}", "title": "" }, { "docid": "41e86b93d4c569cef21cd1cd7a8dc97d", "score": "0.61310333", "text": "function onJoinRoom(data) \n{\n\t\tif(roomMembersCount(data)){\n\t\tthis.join(data.roomName);\n\t\tthis.emit(\"OnJoinedRoom\" , {roomName: data.roomName});\n\t\t}\n\t\telse {\n\t\t\tthis.emit(\"OnJoinedRoomFailed\");\n\t\t}\n}", "title": "" }, { "docid": "092f49acba1cd9e5472fb521b06d293a", "score": "0.6118231", "text": "function joinGame(evt, player) {\n gameNum = evt.target.getAttribute('data-game')\n evt.preventDefault();\n $.post(\"/api/gameplayers\",\n {game_id: gameNum,\n username: player})\n .done(function(data) {\n console.log(data)\n console.log(\"success\")\n location.replace(window.location.href.replace(window.location.pathname, \"/web/game.html?gp=\"+gameNum))\n })\n .fail(function() {\n console.log(\"failure\")\n });\n }", "title": "" }, { "docid": "e7aa2858d4970f0f3b2f9756ad80614e", "score": "0.61128026", "text": "function addJoinButton() {\n\n // use template for team button\n $.setContent( team_elem.querySelector( '.button' ), $.html( self.html.button, {\n icon: self.icon.join,\n caption: self.text.join,\n onclick: async () => {\n\n /**\n * data of team that user must leave\n * @type {Object}\n */\n const leaving_team = user_team && dataset.teams[ user_team - 1 ];\n\n // is user already a member of another team? => user must leave that team\n if ( user_team ) {\n\n // remove user from member list\n delete leaving_team.members[ user ];\n\n // unlimited number of teams and leaved team is now empty? => remove leaved team\n if ( !self.max_teams && isEmptyTeam( leaving_team ) ) dataset.teams.splice( user_team - 1, 1 );\n\n }\n\n // add user to member list\n team.members[ user ] = true;\n\n // update team building dataset in datastore\n await self.data.store.set( dataset );\n\n /**\n * event data of 'join' event\n * @type {Object}\n */\n const event_data = { joined: team.key, leaved: leaving_team && leaving_team.key };\n\n // logging of 'join' event\n self.logger && self.logger.log( 'join', $.clone( event_data ) );\n\n // perform 'onchange' callback\n self.onchange && self.onchange( self, $.clone( event_data ) );\n\n // restart (updates own content)\n await self.start();\n\n }\n } ) );\n\n }", "title": "" }, { "docid": "0628a7e956185c5c5eb62e2a59e906b7", "score": "0.61114204", "text": "function update_connected_users(x) { //the object x is of the form : {event:join or leave,usr:johndoe}\n if(x.event == 'join'){\n players.push(x.usr);\n const p = document.createElement('p');\n p.innerHTML = '->' + x.usr ;\n p.setAttribute('class','users-connected');\n p.setAttribute('id','_' + x.usr + '_' ); //ids' are always like _saif_ so that theres no problem with other ids\n document.getElementById('users').append(p);\n }\n else{\n if(x.usr == leader+' (lobby leader)'){\n swal({\n title:'oops!',\n text:'Seems like the lobby leader has left the room...\\n The game can only be started by the lobby leader.\\nPlease return to the home page and create a new room or join one if you want to play',\n icon:'warning'\n });\n }\n\n var ps = document.getElementById('users').querySelectorAll('p');\n for(i=0;i<ps.length;i++){\n if(players[i] == x.usr){\n players.splice(i,1);\n }\n if(ps[i].id == '_' + x.usr + '_'){\n ps[i].remove();}\n }\n }\n }", "title": "" }, { "docid": "6b9c450fba46429bbb0cb9e857ce801e", "score": "0.60828626", "text": "joinGame(user, gameID) {\n\n let game = this.findGameById(gameID);\n\n if (!game) {\n\n user.socket.emit('failJoinGame', \"Unable to find a game with that ID\");\n\n } else if (game.gameData.gameOver) {\n\n user.socket.emit(\"failJoinGame\", \"Game has ended\");\n\n } else {\n\n user.activeGame = gameID;\n game.addPlayer(user);\n\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "4d57308857d8815b4d04567d18cbcf07", "score": "0.6082693", "text": "function checkPlayerWon(t_bamboo){\n \n if(score == t_bamboo.length){\n isWon = true;\n }\n \n}", "title": "" }, { "docid": "f931abb9c9644dc174020bb230d8c410", "score": "0.6079025", "text": "function joinGame(_gameId) {\n\n\tvar gameRef = db.ref('openGames').child(_gameId);\n\tvar _playerId;\n\n\tgameRef.child('playersReady').transaction(function(currPlayers) {\n\t\t// abort if there are already the max number of players\n\t\tif (!currPlayers) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tvar range = [];\n\t\t\tfor (var i=1; i<=maxPlayers; ++i) {\n\t\t\t\trange.push(i);\n\t\t\t}\n\t\t\tfor (var pid in currPlayers) {\n\t\t\t\tpid = parseInt(pid);\n\t\t\t\trange.splice(range.indexOf(pid), 1);\n\t\t\t}\n\t\t\tif (range.length > 0) {\n\t\t\t\t_playerId = range[0];\n\t\t\t\tcurrPlayers[_playerId] = false;\n\t\t\t\treturn currPlayers;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t}, function(error, committed, snapshot) {\n\t\tif (error) {\n\t\t\tconsole.log(\"Transaction failed abnormally.\");\n\t\t} else if (!committed) {\n\t\t\t// The room was actually full, so inform the user\n\t\t\talert(\"Sorry, this game is full.\");\n\t\t\tconsole.log(\"We aborted the transaction.\");\n\t\t} else {\n\t\t\t// Move the player into the lobby\n\t\t\tgoToLobby(_gameId, _playerId);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "34cd903a59031357f85fb5948b38b83c", "score": "0.6064523", "text": "function onConferenceJoined() {\n isJoined = true;\n console.log('Joined conf! localTracks.length: ', localTracks.length);\n\n if (localTracks.length == 0) {\n console.log(\"NO LOCAL TRACKS but UserId is: \", conference.myUserId());\n connectArena(conference.myUserId(), '');\n } else {\n for (let i = 0; i < localTracks.length; i++) {\n track = localTracks[i];\n conference.addTrack(track);\n // connect to ARENA; draw media button(s)\n connectArena(conference.myUserId(), track.getType()); // desktop only?\n }\n }\n}", "title": "" }, { "docid": "2d3debdbe686a34afff2952672d508a0", "score": "0.6054664", "text": "function youWon() {\n if (countWins === 3) {\n // win sound\n $(\"audio#youWonMp3\")[0].play();\n // hide battle button\n $(\"#doBattleButtonDiv\").addClass(\"hidden\");\n // hides choose opponet banner\n $(\"#chooseOpponetBanner\").addClass(\"hidden\");\n $(\".youWon\").removeClass(\"hidden\");\n // restarts the game over by reloading the page\n $(\".playAgain\").click(function () {\n location.reload();\n });\n };\n }", "title": "" }, { "docid": "b18dc317d6a93ea01696cb225578ac8c", "score": "0.60545677", "text": "hasPlayerWon() {\n return this._hasWon;\n }", "title": "" }, { "docid": "3c765289ba0c144d6df7c731b1f079c1", "score": "0.60487777", "text": "function userWon() {\r\n winnerOverlay.classList.add(\"show-overlay\");\r\n winnerOverlay.classList.remove(\"hidden-overlay\");\r\n winnerOverlay.addEventListener(\r\n \"click\",\r\n () => {\r\n resetGameInfo();\r\n },\r\n {\r\n once: true,\r\n }\r\n );\r\n}", "title": "" }, { "docid": "4dafb47f00c93fae8f1450c35b51cec1", "score": "0.6047638", "text": "playerWins(x, y) {\n if (document.getElementsByClassName(\"playerUpdates\")[0].innerHTML === \"Cleared Dungeon Level 1!\"){\n return;\n }else if (this.isTheExitAt(x, y) === true) {\n console.log(\"Level 1 Complete!\");\n document.getElementsByClassName(\"playerUpdates\")[0].innerHTML = \"Cleared Dungeon Level 1!\";\n const nextLevelElement = document.createElement('LINK');\n nextLevelElement.className = 'nxt-lvl-message';\n nextLevelElement.innerHTML = 'Proceed to Level 2';\n nextLevelElement.setAttribute(\"href\", \"#\" );\n document.querySelector('.hero').appendChild(nextLevelElement);\n }\n }", "title": "" }, { "docid": "b57cbc19d468667b0e6605fccec7ea47", "score": "0.604231", "text": "function playerWins() {\n\tsetTimeout(() => {\n\t\tresetPlayer();\n\t\tsetEnemy();\n\t\tcompInterval = setInterval(compdraw, 100);\n\t\tcompanimateCat('idle');\n\t}, 1500)\n}", "title": "" }, { "docid": "2844f9e87f81328966b5281833de4391", "score": "0.6025443", "text": "function on_party_invite(name) {\n\n if (get_player(name).owner != character.owner) return;\n accept_party_invite(name);\n}", "title": "" }, { "docid": "513e14e39b9397e839cd5968b749b840", "score": "0.6021767", "text": "function onNewPlayerToServer(data){\n\tconsole.log(this.id + \" has set the username \" + data.username);\n\n\tvar newPlayer = new Player(data.username, data.x, data.y);\n\tnewPlayer.setId (this.id);\n\n\t//send existing player to new client\n\tfor (var i = 0; i < players.length; i++){\n\t\tvar existingPlayer = players[i];\n\t\tthis.emit(\"newPlayerToClient\", {\n\t\t\tusername: existingPlayer.getUsername(),\n\t\t\tx: existingPlayer.getX(),\n\t\t\ty: existingPlayer.getY(),\n\t\t\tid: existingPlayer.getId()\n\t\t});\n\t}\n\t\n\t//send new player to all other clients\n\tthis.broadcast.emit(\"newPlayerToClient\",{\n\t\tusername: newPlayer.getUsername(),\n\t\tx: newPlayer.getX(),\n\t\ty: newPlayer.getY(),\n\t\tid: newPlayer.getId()\n\t});\n\n\t//add new player to server list\n\tplayers.push(newPlayer);\n}", "title": "" }, { "docid": "64a3f610f3c91fed322a3c0599cbc942", "score": "0.6018203", "text": "addJoinButton() {\n const joinButton = this.add.dom(this.camera.centerX + 85, this.camera.centerY + 40, 'button', 'font-size: 16px;', '방 들어가기');\n joinButton.setClassName('menu-button');\n joinButton.addListener('click');\n\n joinButton.on('click', () => {\n const playerName = document.querySelector('.name-input').value.toUpperCase();\n const roomCode = document.querySelector('.room-code-input').value.toLowerCase();\n\n if (playerName !== '' && roomCode !== '') {\n // Tell the server who we are and that we're joining an existing game.\n this.socket.name = playerName;\n this.socket.roomCode = roomCode;\n\n this.socket.emit('join request', roomCode);\n }\n else {\n this.showErrorMessage('NAME & ROOM CODE MUST NOT BE EMPTY');\n }\n });\n }", "title": "" }, { "docid": "f835a71648e73bd0457950c4453dd56e", "score": "0.6016384", "text": "check_game_finished() {\n const unfinishedPlayers = Object.keys(this.players).filter(pid => !this.players[pid].finished);\n if (unfinishedPlayers.length == 1) {\n this.finished_players.push(unfinishedPlayers[0]);\n // game is finished\n this.finished = true;\n }\n }", "title": "" }, { "docid": "6d2e0172fd095b51443d4f8ee23bd1f0", "score": "0.601289", "text": "function joinGame(data, callback) {\n // Validate input data\n if (!data.game_id || !isString(data.game_id)) {\n return callback(\"Parameter 'game_id' must be a string\");\n }\n \n if (!data.player_name || !isString(data.player_name)) {\n return callback(\"Parameter 'player_name' must be a string\");\n }\n \n if (!data.player_color || !isColor(data.player_color)) {\n return callback(\"Parameter 'player_color' must be a valid color\");\n }\n \n // Check that there exists a game with the given game id\n if (!hasID(\"games\", data.game_id)) {\n return callback(\"Invalid game ID '\" + data.game_id + \"'\");\n }\n \n // Load the game object\n let game = getByID(\"games\", data.game_id);\n \n if (game.player_colors.includes(data.player_color)) {\n return callback(\"Another player already has this color\")\n }\n \n // Check that the game isn't started\n if (game.started) {\n return callback(\"Unable to join - game has already started\");\n }\n \n // Generate a unique player ID\n let player_id = uniqueID(\"players\");\n \n let player = {\n \"id\": player_id,\n \"name\": data.player_name,\n \"number\": game.board.players,\n \"game_id\": game.id,\n \"last_request\": 0,\n \"new_messages\": []\n };\n \n // Update the game object (automatically updates the database's copy)\n game.player_ids.push(player_id);\n game.player_names.push(data.player_name);\n game.player_colors.push(data.player_color);\n if (game.player_ids.length === game.board.players) {\n game.started = true;\n }\n \n let msg = {\n \"type\": \"join\",\n \"text\": \"Player \" + player.name + \" has joined the game\"\n };\n \n // Add the message to each of the opponents' lists\n for (let id of game.player_ids) {\n if (id != player.id) {\n if (hasID(\"players\", id)) {\n getByID(\"players\", id).new_messages.push(msg);\n } else {\n console.error(\"Player with ID '\" + id + \"' no longer exists\");\n }\n }\n }\n \n // Store the player object\n db.get(\"players\").push(player).write();\n \n // Save changes and return\n callback(false, {\n \"player\": trimPlayerObject(player),\n \"game\": trimGameObject(game),\n });\n}", "title": "" }, { "docid": "139256239ec7b7a1335abfbfdc8323fd", "score": "0.6012575", "text": "playerIsConnected({playerId, connectedPlayers, pendingPlayers}) {\n //TODO\n }", "title": "" }, { "docid": "98454a62e252414af18c9edf55a3fddd", "score": "0.60107416", "text": "pendingToActive(pendingId, joiningId, joiningUsername) {\n // extract pending player's username\n const pendingUsername = this.pendingUsers[pendingId];\n delete this.pendingUsers[pendingId];\n \n // make pending player active\n this.activeUsers[pendingId] = {opp: {id: joiningId, username: joiningUsername}};\n // make joining player active\n this.activeUsers[joiningId] = {opp: {id: pendingId, username: pendingUsername}};\n }", "title": "" }, { "docid": "74ef37c9811f21513890a968ddcfe94e", "score": "0.6007159", "text": "function checkPlayersReady(connection){\n if(Object.keys(GAME.playerMap).length == 2){\n connection.emit('startGame');\n }\n}", "title": "" }, { "docid": "4ae3e082b0d8b82d574b0fd6d900ee2a", "score": "0.600276", "text": "function checkForWin() {\n\n \n\n if (player2Hits === 12) {\n document.getElementById('msgEl').textContent = 'Player 2 Wins!!!';\n \n console.log('Player 2 Wins!!!');\n } \n else if (player1Hits === 12) {\n document.getElementById('msgEl').textContent = 'Player 1 Wins!!!';\n \n console.log('Player 1 Wins!!!');\n} \n\n}", "title": "" }, { "docid": "1632cbb58f557f1a12ddfea7bdb07a2e", "score": "0.5997593", "text": "function playerJoinGame(data) {/* */\n //console.log('Player ' + data.playerName + 'attempting to join game: ' + data.gameId );\n\n // A reference to the player's Socket.IO socket object\n console.log(data.gameId);\n\n // Look up the room ID in the Socket.IO manager object.\n var room = io.sockets.adapter.rooms.get(data.gameId.toString());\n\n var playersJoined = numberOfUsersInRoom(data.gameId);\n\n if (playersJoined.length >= 4) {\n this.emit('error', { message: \"Room already full.\" });\n return;\n }\n\n // If the room exists...\n if (room != undefined) {\n // attach the socket id to the data object.\n data.mySocketId = this.id;\n\n // Join the room\n this.join(data.gameId.toString());\n\n players.push(createPlayer(data.playerName, data.gameId, playersJoined.length + 1, data.mySocketId, false));\n\n data.players = numberOfUsersInRoom(data.gameId);\n\n rooms.push({ roomId: data.gameId.toString(), rounds: 0, currentGameRang: 'clubs', currentRoundRang: null, playersTurn: 0, roundStartPlayer: null, previousRoundWinner: null, nextPlayerTurn: null, selectionOfRangStarted: null });\n // Emit an event notifying the clients that the player has joined the room.\n io.to(data.gameId).emit('playerJoinedRoom', data);\n io.to(data.mySocketId).emit('updatePlayerId', { playerId: data.players.length });\n\n //if room full emit event\n console.log(data.players.length);\n if (data.players.length == 4)\n io.to(data.gameId).emit('roomfull', data);\n\n } else {\n // Otherwise, send an error message back to the player.\n this.emit('error', { message: \"This room does not exist.\" });\n }\n}", "title": "" }, { "docid": "b662bf3df0fd15ae9a6e68004ca237a2", "score": "0.5996708", "text": "function onNewPlayer (data) {\n //console.log(data)\n // Create a new player\n var newPlayer = new Player(data.x, data.y, data.angle, data.pname, data.uid, data.skin_shot, data.skin_char)\n newPlayer.id = this.id\n\n // Broadcast new player to connected socket clients\n this.broadcast.emit('new player', {id: newPlayer.id, x: newPlayer.getX(), y: newPlayer.getY(), angle: newPlayer.getAngle(), pname: newPlayer.pname, \n uid: newPlayer.uid, skin_shot: newPlayer.skin_shot, skin_char: newPlayer.skin_char})\n\n // Send existing players to the new player\n var existingPlayer\n for (var i in players) {\n existingPlayer = players[i]\n this.emit('new player', {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY(), angle: existingPlayer.getAngle(), \n pname: existingPlayer.pname, skin_shot: existingPlayer.skin_shot, skin_char: existingPlayer.skin_char})\n }\n\n // Add new player to the players array\n players[newPlayer.id] = newPlayer\n}", "title": "" }, { "docid": "e096e3812e58b945b18780a0461b9b97", "score": "0.59955806", "text": "gameWon() {\r\n return (this._player1Score >=4 && this._player1Score >= this._player2Score + 2) ?\r\n this._player1 : (this._player2Score >=4 && this._player2Score >= this._player1Score + 2) ? this._player2 : undefined;\r\n }", "title": "" }, { "docid": "bd11f66cf2759b4e4f935aff58b9bd9a", "score": "0.59931165", "text": "userJoined({ data }) {\n usersInChat.push(data.user);\n updateUsersInChat();\n }", "title": "" }, { "docid": "5ab0700fbe5c0fd3fd35a1ed9ae3f81e", "score": "0.5990872", "text": "function userLeft()\n{\n\tgameStarted = false;\n\tstatusTF.text = \"\";\n\tvar message = \"\";\n\n\t// Show \"wait\" message\n\tif(iAmSpectator == false){\n\t\tmessage = \"Your opponent left the game\" + \"<br/><br/>\" + \"Waiting for a new player\";\n\t\tshowGamePopUp(\"wait\", message);\n\t}else{\n\t\tmessage = \"A player left the game\" + \"<br/><br/>\" + \"Press the Join button to play\"\n\t\tshowGamePopUp(\"waitSpec\", message);\n\t}\n}", "title": "" }, { "docid": "af4759982c0c1d48d983ed51c56d490b", "score": "0.59886724", "text": "function sendJoinRequest(name) {\n var data = {\n room: name,\n username: username\n };\n socket.emit('user joined', data);\n }", "title": "" }, { "docid": "8d72f3757cd58ae394737e879cb287ce", "score": "0.598439", "text": "function joinPlayers(client, placesWanted) {\n\n var currentGameIndex = lastGameIndex;\n\n // check games to find one that will fit us in\n while ( games[currentGameIndex] !== undefined && (games[currentGameIndex].state !== \"waiting\" || games[currentGameIndex].players.length >= 6-placesWanted) ) {\n\t currentGameIndex++;\n\n\t // also increment lastGameIndex if those games are full\n\t if ( games[lastGameIndex].players.length >= 6 || games[lastGameIndex].state !== \"waiting\") {\n\t\t lastGameIndex++;\n\t }\n }\n console.log(\"found game \" + currentGameIndex);\n if (games[currentGameIndex] === undefined) {\n\t initGame(currentGameIndex);\n }\n var game = games[currentGameIndex];\n game.clients.push(client);\n var playerIds = [];\n for (var i = 0 ; i < placesWanted ; i++) {\n var newPlayerId = game.players.length;\n playerIds[playerIds.length] = newPlayerId;\n game.players[newPlayerId] = {x:0,y:0};\n }\n\n return {playerIds:playerIds, game:game};\n}", "title": "" } ]
aaf0823752948546e01ae7ade44d59bc
Creates and returns a history object that uses HTML5's history API (pushState, replaceState, and the popstate event) to manage history. This is the recommended method of managing history in browsers because it provides the cleanest URLs. Note: In browsers that do not support the HTML5 history API full page reloads will be used to preserve URLs.
[ { "docid": "7adcc4b1f506e9df58255b4ee497c660", "score": "0.72759515", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? (undefined) !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" } ]
[ { "docid": "1424db9e9d779280c4efad95a7d2f9ec", "score": "0.7337522", "text": "function createBrowserHistory(props){if(props===void 0){props={};}!canUseDOM?invariant(false,'Browser history needs a DOM'):void 0;var globalHistory=window.history;var canUseHistory=supportsHistory();var needsHashChangeListener=!supportsPopStateOnHashChange();var _props=props,_props$forceRefresh=_props.forceRefresh,forceRefresh=_props$forceRefresh===void 0?false:_props$forceRefresh,_props$getUserConfirm=_props.getUserConfirmation,getUserConfirmation=_props$getUserConfirm===void 0?getConfirmation:_props$getUserConfirm,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var basename=props.basename?stripTrailingSlash(addLeadingSlash(props.basename)):'';function getDOMLocation(historyState){var _ref=historyState||{},key=_ref.key,state=_ref.state;var _window$location=window.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash;var path=pathname+search+hash;warning(!basename||hasBasename(path,basename),'You are attempting to use a basename on a page whose URL path does not begin '+'with the basename. Expected path \"'+path+'\" to begin with \"'+basename+'\".');if(basename)path=stripBasename(path,basename);return createLocation(path,state,key);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var transitionManager=createTransitionManager();function setState(nextState){_extends(history,nextState);history.length=globalHistory.length;transitionManager.notifyListeners(history.location,history.action);}function handlePopState(event){// Ignore extraneous popstate events in WebKit.\nif(isExtraneousPopstateEvent(event))return;handlePop(getDOMLocation(event.state));}function handleHashChange(){handlePop(getDOMLocation(getHistoryState()));}var forceNextPop=false;function handlePop(location){if(forceNextPop){forceNextPop=false;setState();}else{var action='POP';transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location});}else{revertPop(location);}});}}function revertPop(fromLocation){var toLocation=history.location;// TODO: We could probably make this more reliable by\n// keeping a list of keys we've seen in sessionStorage.\n// Instead, we just default to 0 for keys we don't know.\nvar toIndex=allKeys.indexOf(toLocation.key);if(toIndex===-1)toIndex=0;var fromIndex=allKeys.indexOf(fromLocation.key);if(fromIndex===-1)fromIndex=0;var delta=toIndex-fromIndex;if(delta){forceNextPop=true;go(delta);}}var initialLocation=getDOMLocation(getHistoryState());var allKeys=[initialLocation.key];// Public interface\nfunction createHref(location){return basename+createPath(location);}function push(path,state){warning(!(_typeof3(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to push when the 1st '+'argument is a location-like object that already has state; it is ignored');var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.pushState({key:key,state:state},null,href);if(forceRefresh){window.location.href=href;}else{var prevIndex=allKeys.indexOf(history.location.key);var nextKeys=allKeys.slice(0,prevIndex===-1?0:prevIndex+1);nextKeys.push(location.key);allKeys=nextKeys;setState({action:action,location:location});}}else{warning(state===undefined,'Browser history cannot push state in browsers that do not support HTML5 history');window.location.href=href;}});}function replace(path,state){warning(!(_typeof3(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to replace when the 1st '+'argument is a location-like object that already has state; it is ignored');var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.replaceState({key:key,state:state},null,href);if(forceRefresh){window.location.replace(href);}else{var prevIndex=allKeys.indexOf(history.location.key);if(prevIndex!==-1)allKeys[prevIndex]=location.key;setState({action:action,location:location});}}else{warning(state===undefined,'Browser history cannot replace state in browsers that do not support HTML5 history');window.location.replace(href);}});}function go(n){globalHistory.go(n);}function goBack(){go(-1);}function goForward(){go(1);}var listenerCount=0;function checkDOMListeners(delta){listenerCount+=delta;if(listenerCount===1&&delta===1){window.addEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.addEventListener(HashChangeEvent,handleHashChange);}else if(listenerCount===0){window.removeEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.removeEventListener(HashChangeEvent,handleHashChange);}}var isBlocked=false;function block(prompt){if(prompt===void 0){prompt=false;}var unblock=transitionManager.setPrompt(prompt);if(!isBlocked){checkDOMListeners(1);isBlocked=true;}return function(){if(isBlocked){isBlocked=false;checkDOMListeners(-1);}return unblock();};}function listen(listener){var unlisten=transitionManager.appendListener(listener);checkDOMListeners(1);return function(){checkDOMListeners(-1);unlisten();};}var history={length:globalHistory.length,action:'POP',location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history;}", "title": "" }, { "docid": "5c6df2c40d7569e1f7c59cda14d300a3", "score": "0.73203075", "text": "function createBrowserHistory(props){if(props===void 0){props={};}!canUseDOM?invariant(false):void 0;var globalHistory=window.history;var canUseHistory=supportsHistory();var needsHashChangeListener=!supportsPopStateOnHashChange();var _props=props,_props$forceRefresh=_props.forceRefresh,forceRefresh=_props$forceRefresh===void 0?false:_props$forceRefresh,_props$getUserConfirm=_props.getUserConfirmation,getUserConfirmation=_props$getUserConfirm===void 0?getConfirmation:_props$getUserConfirm,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var basename=props.basename?stripTrailingSlash(addLeadingSlash$1(props.basename)):'';function getDOMLocation(historyState){var _ref=historyState||{},key=_ref.key,state=_ref.state;var _window$location=window.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash;var path=pathname+search+hash;if(basename)path=stripBasename$1(path,basename);return createLocation(path,state,key);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var transitionManager=createTransitionManager();function setState(nextState){_extends$1(history,nextState);history.length=globalHistory.length;transitionManager.notifyListeners(history.location,history.action);}function handlePopState(event){// Ignore extraneous popstate events in WebKit.\nif(isExtraneousPopstateEvent(event))return;handlePop(getDOMLocation(event.state));}function handleHashChange(){handlePop(getDOMLocation(getHistoryState()));}var forceNextPop=false;function handlePop(location){if(forceNextPop){forceNextPop=false;setState();}else{var action='POP';transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location});}else{revertPop(location);}});}}function revertPop(fromLocation){var toLocation=history.location;// TODO: We could probably make this more reliable by\n// keeping a list of keys we've seen in sessionStorage.\n// Instead, we just default to 0 for keys we don't know.\nvar toIndex=allKeys.indexOf(toLocation.key);if(toIndex===-1)toIndex=0;var fromIndex=allKeys.indexOf(fromLocation.key);if(fromIndex===-1)fromIndex=0;var delta=toIndex-fromIndex;if(delta){forceNextPop=true;go(delta);}}var initialLocation=getDOMLocation(getHistoryState());var allKeys=[initialLocation.key];// Public interface\nfunction createHref(location){return basename+createPath(location);}function push(path,state){var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.pushState({key:key,state:state},null,href);if(forceRefresh){window.location.href=href;}else{var prevIndex=allKeys.indexOf(history.location.key);var nextKeys=allKeys.slice(0,prevIndex+1);nextKeys.push(location.key);allKeys=nextKeys;setState({action:action,location:location});}}else{window.location.href=href;}});}function replace(path,state){var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.replaceState({key:key,state:state},null,href);if(forceRefresh){window.location.replace(href);}else{var prevIndex=allKeys.indexOf(history.location.key);if(prevIndex!==-1)allKeys[prevIndex]=location.key;setState({action:action,location:location});}}else{window.location.replace(href);}});}function go(n){globalHistory.go(n);}function goBack(){go(-1);}function goForward(){go(1);}var listenerCount=0;function checkDOMListeners(delta){listenerCount+=delta;if(listenerCount===1&&delta===1){window.addEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.addEventListener(HashChangeEvent,handleHashChange);}else if(listenerCount===0){window.removeEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.removeEventListener(HashChangeEvent,handleHashChange);}}var isBlocked=false;function block(prompt){if(prompt===void 0){prompt=false;}var unblock=transitionManager.setPrompt(prompt);if(!isBlocked){checkDOMListeners(1);isBlocked=true;}return function(){if(isBlocked){isBlocked=false;checkDOMListeners(-1);}return unblock();};}function listen(listener){var unlisten=transitionManager.appendListener(listener);checkDOMListeners(1);return function(){checkDOMListeners(-1);unlisten();};}var history={length:globalHistory.length,action:'POP',location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history;}", "title": "" }, { "docid": "e29a0ae4ee7f145940e8cfafec68f8b0", "score": "0.73181766", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "e29a0ae4ee7f145940e8cfafec68f8b0", "score": "0.73181766", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "f901018b3c686cadbe1a49c846a4d17b", "score": "0.73043466", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _parsePath2['default'](path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "c7631e1db6c860b787db0c4494095bf8", "score": "0.73002416", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? ({\"ENV\":\"production\"}).NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1faf618943bc6c1fffaed4f4b867c664", "score": "0.72981244", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "eb7ee0b8c449889b235fe1f9bfd429c0", "score": "0.72847676", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _parsePath2['default'](path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "39673bb4ef0dd5e0c4d27b9d68b6212b", "score": "0.7278339", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? undefined !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "5b87bbc164bb1e8888c45787f2e01db3", "score": "0.7273173", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "5b87bbc164bb1e8888c45787f2e01db3", "score": "0.7273173", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "5b87bbc164bb1e8888c45787f2e01db3", "score": "0.7273173", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "5b87bbc164bb1e8888c45787f2e01db3", "score": "0.7273173", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "5b87bbc164bb1e8888c45787f2e01db3", "score": "0.7273173", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "5b87bbc164bb1e8888c45787f2e01db3", "score": "0.7273173", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "48886886b843297c173d14e8cc041cf1", "score": "0.7272615", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "d347a340ef80e19d6840e23dc1463066", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "bb74e3f70e661a8600422283f77d8c9b", "score": "0.7271127", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "1ca5e5549b7ea875284e0f326b83bc9d", "score": "0.72688055", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "73a064bd2f93283fab1d07505fc373f2", "score": "0.7264372", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "f0fae048788d381d1757ab25f17d9a0b", "score": "0.7261021", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "51d3626a18a16a80ce7f3ee85f7d6eb2", "score": "0.725427", "text": "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t return history.createLocation(path, state, undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "0aab8d1bb5b1d9773fed5aaacb9e62eb", "score": "0.72486407", "text": "function createBrowserHistory(){var options=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];!_ExecutionEnvironment.canUseDOM?process.env.NODE_ENV!=='production'?_invariant2['default'](false,'Browser history needs a DOM'):_invariant2['default'](false):undefined;var forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){try{historyState=historyState||window.history.state||{};}catch(e){historyState={};}var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else{state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return;// Ignore extraneous popstate events in WebKit.\n\ttransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return;// Nothing to do.\n\t_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false;// Prevent location update.\n\t}else{window.history.pushState(historyState,null,path);}}else{// REPLACE\n\tif(useRefresh){window.location.replace(path);return false;// Prevent location update.\n\t}else{window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}// deprecated\n\tfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);}// deprecated\n\tfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "9c0c784048be6631e8b22468c94e753e", "score": "0.7248018", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "6259892de2357d54249f52e9bdeaa2c2", "score": "0.72282565", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? invariant(false, 'Browser history needs a DOM') : Object(tiny_invariant_esm[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "9952d65c56b583f7695a1eb70c7629cc", "score": "0.72282565", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? invariant(false, 'Browser history needs a DOM') : Object(tiny_invariant_esm[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "9952d65c56b583f7695a1eb70c7629cc", "score": "0.72282565", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? invariant(false, 'Browser history needs a DOM') : Object(tiny_invariant_esm[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "98ea58b35c2f0484cff272ebea35065a", "score": "0.72122633", "text": "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n return history.createLocation(path, state, undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "title": "" }, { "docid": "acc2fd3de10c4951e418bcfccf514630", "score": "0.7176185", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "acc2fd3de10c4951e418bcfccf514630", "score": "0.7176185", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "78ddde2402ec71de5af9ee83b334925a", "score": "0.7169104", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant_esm[\"a\" /* default */])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "b04a7f47980899f657ca18784dbcc314", "score": "0.71445847", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2b43d706135c97cfb4bbf4dbb25fc7f1", "score": "0.71445847", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2b43d706135c97cfb4bbf4dbb25fc7f1", "score": "0.71445847", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "464ed77497ad8346164d4810b94ace3f", "score": "0.7140774", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "464ed77497ad8346164d4810b94ace3f", "score": "0.7140774", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "464ed77497ad8346164d4810b94ace3f", "score": "0.7140774", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2839ca8a69056ea89f60d94171a2fc2d", "score": "0.7122473", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"production\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"production\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"production\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"production\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"production\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"production\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "d4852b8ebbfa386874920908c09c20b6", "score": "0.709137", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n }", "title": "" }, { "docid": "e8b9b0719bfb14996706617b7330b390", "score": "0.708502", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "61fe4e974ebd1dc5db5807b9f7502c08", "score": "0.70337874", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "db5f5960285ef4367749c0e4d6589947", "score": "0.70074606", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "3318a9ecca67f0e14591ec4d3d6169d2", "score": "0.70074606", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "5ba5d57f5e20cdcc8611516179764a15", "score": "0.6992244", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "5f5ca66255a78958a91142393c5e150d", "score": "0.69915116", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[/* default */ \"a\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2316d31ce22c705d102e3ef29473c551", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2316d31ce22c705d102e3ef29473c551", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2316d31ce22c705d102e3ef29473c551", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "36019c1e3d47630443c402105fa00989", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2316d31ce22c705d102e3ef29473c551", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2316d31ce22c705d102e3ef29473c551", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "36019c1e3d47630443c402105fa00989", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "f8c41d2ca9554baad5ac4a11d7da40a6", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "2316d31ce22c705d102e3ef29473c551", "score": "0.6985108", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "9ee15ec818f4d983f92169171764370b", "score": "0.69833857", "text": "function createBrowserHistory(options) {\n\t _invariant2['default'](_ExecutionEnvironment.canUseDOM, 'Browser history needs a DOM');\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t return history.createLocation(path, state, undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (isSupported) {\n\t window.history.pushState(historyState, null, path);\n\t } else {\n\t // Use a full-page reload to preserve the URL.\n\t window.location.href = path;\n\t }\n\t } else {\n\t // REPLACE\n\t if (isSupported) {\n\t window.history.replaceState(historyState, null, path);\n\t } else {\n\t // Use a full-page reload to preserve the URL.\n\t window.location.replace(path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "title": "" }, { "docid": "ec7c027fd457ab02db9bab32c7d66cb9", "score": "0.6955175", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? (0,tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : 0 : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "ec7c027fd457ab02db9bab32c7d66cb9", "score": "0.6955175", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? (0,tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : 0 : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "ccbdb02f47982d9a95848a6fac2f0cda", "score": "0.6952516", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? (0,tiny_invariant__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(false, 'Browser history needs a DOM') : 0 : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "d59faad18df06e1e4ead78b3986f9792", "score": "0.6944255", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM\n ? true\n ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(\n false,\n \"Browser history needs a DOM\"\n )\n : undefined\n : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh =\n _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation =\n _props$getUserConfirm === void 0\n ? getConfirmation\n : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename\n ? stripTrailingSlash(addLeadingSlash(props.basename))\n : \"\";\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(\n !basename || hasBasename(path, basename),\n \"You are attempting to use a basename on a page whose URL path does not begin \" +\n 'with the basename. Expected path \"' +\n path +\n '\" to begin with \"' +\n basename +\n '\".'\n )\n : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(\n _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\n \"default\"\n ]\n )(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = \"POP\";\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n });\n } else {\n revertPop(location);\n }\n }\n );\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(\n !(\n typeof path === \"object\" &&\n path.state !== undefined &&\n state !== undefined\n ),\n \"You should avoid providing a 2nd state argument to push when the 1st \" +\n \"argument is a location-like object that already has state; it is ignored\"\n )\n : undefined;\n var action = \"PUSH\";\n var location = createLocation(\n path,\n state,\n createKey(),\n history.location\n );\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState(\n {\n key: key,\n state: state,\n },\n null,\n href\n );\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location,\n });\n }\n } else {\n true\n ? Object(\n tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n )(\n state === undefined,\n \"Browser history cannot push state in browsers that do not support HTML5 history\"\n )\n : undefined;\n window.location.href = href;\n }\n }\n );\n }\n\n function replace(path, state) {\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(\n !(\n typeof path === \"object\" &&\n path.state !== undefined &&\n state !== undefined\n ),\n \"You should avoid providing a 2nd state argument to replace when the 1st \" +\n \"argument is a location-like object that already has state; it is ignored\"\n )\n : undefined;\n var action = \"REPLACE\";\n var location = createLocation(\n path,\n state,\n createKey(),\n history.location\n );\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState(\n {\n key: key,\n state: state,\n },\n null,\n href\n );\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location,\n });\n }\n } else {\n true\n ? Object(\n tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n )(\n state === undefined,\n \"Browser history cannot replace state in browsers that do not support HTML5 history\"\n )\n : undefined;\n window.location.replace(href);\n }\n }\n );\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener)\n window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener)\n window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: \"POP\",\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen,\n };\n return history;\n }", "title": "" }, { "docid": "92020c7c25d157be4ff924885819343e", "score": "0.6941321", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? invariant(false, 'Browser history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" }, { "docid": "35ff93de029dd995b77adc44fa93ba6e", "score": "0.6930652", "text": "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__[\"a\" /* default */])(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "title": "" } ]
f09c663d4465de2feb7e559200218ae9
Popula o combo conforme os campos selects
[ { "docid": "9836124217ef0fc3c0303d03a7d022e9", "score": "0.0", "text": "function populateSelect(idObject,idObjectPopulate,url,parametro){\r\n\turl+=\"?\"+parametro+\"=\"\r\n\r\n\t\r\n\t// Instanciando o objeto XML\r\n\tvar objectXML = new Object()\r\n\tobjectXML = getObjectXML()\r\n\r\n\t// recebendo o valor do objeto select\r\n\tvar inputSelect \t\t= document.getElementById(idObject)\r\n\tvar inputSelectPopulate = document.getElementById(idObjectPopulate)\r\n\t\r\n\t// ao alterar o valor do inputSelect, chama esta fun??o\r\n\tinputSelect.onchange = function(){\r\n\t\t\t\r\n\t\t\tvar urlSend = url + this.value // concatena a url com o valor do campo atual\r\n\t\t\tvar nOptions = 0\r\n\t\t\tvar result \t = 1\r\n\t\t\tclearCombo(idObjectPopulate) // limpa o combo novamente\r\n\t\t\tobjectXML.open(\"GET\",urlSend,true)\r\n\r\n\t\t\tobjectXML.onreadystatechange=function() {\r\n\t\t\t\tif (objectXML.readyState==4){\r\n\t\t\t\t\tvar optionsSelect = objectXML.responseXML\r\n\t\t\t\t\tresult = optionsSelect.getElementsByTagName('option')\r\n\t\t\t\t\t// preenche o combo de acordo com o resultado\r\n\t\t\t\t\tfor(y=0;y<result.length;y++){\r\n\t\t\t\t\t\tvalor =result[y].getElementsByTagName('value')[0].firstChild.nodeValue\r\n\t\t\t\t\t\tresultado = result[y].getElementsByTagName('text')[0].firstChild.nodeValue\r\n\t\t\t\t\t\tinputSelectPopulate.options[nOptions++] = new Option(resultado,valor); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tobjectXML.send(null)\r\n\t\t\t\r\n\t\t\r\n\t} // fim do inputSelect\r\n\t\r\n\t\r\n} // fim do populateSelect", "title": "" } ]
[ { "docid": "22f65b6461be4e3584efbb6ac74c0487", "score": "0.67967385", "text": "function cmbNombreDelCampo__inicializar(){\n\t/* $(\"#cmbNombreDelCampo\").html(\"\"); */\n\t/* $(\"#cmbNombreDelCampo\").selectpicker(\"refresh\"); */\n}", "title": "" }, { "docid": "62c3c32415be82d23ff948e151c66a0d", "score": "0.65973485", "text": "function Combos($id,$value,$metodo,$auto,$capa){\n\n $('#'+$capa).find('select[name='+$id+']').html(new Option('..:: SSELECCIONE ::..','0'));\n // $('#'+$id).html(new Option('..:: SELECCIONE ::..','0'));\n var from=$('#from-autocombo');\n var url= from.attr('action').replace(':id_ID',$value);\n url=url.replace(':funcion_ID',$metodo);\n $.get(url,function(respuesta,estado){\n if(isEmptyJSON(respuesta)==false)\n {\n for(i=0; i < respuesta.length; i++){\n if($auto==respuesta[i].valor)\n {\n $('#'+$capa).find('select[name='+$id+']').append(new Option(respuesta[i].nombre,respuesta[i].valor,true,true));\n //$('#'+$id).append(new Option(respuesta[i].nombre,respuesta[i].valor,true,true));\n }else{\n //$('#'+$id).append(new Option(respuesta[i].nombre,respuesta[i].valor));\n $('#'+$capa).find('select[name='+$id+']').append(new Option(respuesta[i].nombre,respuesta[i].valor));\n }\n }\n }\n });\n}", "title": "" }, { "docid": "2eff8ed6d460c30ab10ba468b1b80474", "score": "0.6573571", "text": "function selectionList() {\n $cmbselect.empty();\n VIS.dataContext.getJSONData(VIS.Application.contextUrl + \"VA005/Attribute/LoadSelectAttribute\", \"\", SelectCallBack);\n\n //var sql = \"SELECT a.name,a.value FROM ad_ref_list a INNER JOIN ad_reference b ON a.ad_reference_id=b.ad_reference_id where b.name='M_Attribute Value Type' and a.isactive='Y'\";\n // var ds = VIS.DB.executeReader(sql.toString(), null);\n //if (ds != null) {\n // var key, value = null;\n // while (ds.read()) {\n // value = ds.getString(0);\n // key = ds.getString(1);\n // $cmbselect.append($(\"<Option value=\" + key + \">\" + value + \"</option>\"));\n // }\n // ds.close();\n //}\n }", "title": "" }, { "docid": "40368e244933e12b711a155e10d1ef3d", "score": "0.6549682", "text": "function core_comboPranchas(onde,id,marcar,funcao,id_atlas)\n{\n\tvar sUrl = \"../php/atlas.php?funcao=pegaPranchas&id_atlas=\"+id_atlas;\n\tvar callback =\n\t{\n\t\t\tsuccess:function(o)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar valores = YAHOO.lang.JSON.parse(o.responseText);\n\t\t\t\tif(arguments.length == 3)\n\t\t\t\t{funcao = \"\";}\n\t\t\t\tif (funcao != \"\")\n\t\t\t\t{funcao = \"onchange='\"+funcao+\"'\";}\n\t\t\t\tins = \"<div class='styled-select150'><select id='\"+id+\"' \"+funcao+\" >\";\n\t\t\t\tins += core_comboObjeto(valores,\"id_prancha\",\"titulo_prancha\",marcar);\n\t\t\t\tins += \"</select></div>\";\n\t\t\t\t$i(onde).innerHTML = ins;\n\t\t\t\t}\n\t\t\t\tcatch(e){core_handleFailure(e,o.responseText);}\n\t\t\t},\n\t\t\tfailure:core_handleFailure,\n\t\t\targument: { foo:\"foo\", bar:\"bar\" }\n\t};\n\tcore_makeRequest(sUrl,callback);\n}", "title": "" }, { "docid": "34efb108c80292ca42f82b430dea7180", "score": "0.6527228", "text": "function fillSelect(){\n\n // Se guarda el objeto en una nueva variable\n var array = bundle;\n // Variable para identificar la primera vuelta\n var firstRun = true;\n // Primer input para forzar al usaurio a selecionar una opcion\n var blankOption = '<option disabled selected value>' + '-- select an option --' + '</option>';\n // Se lee las primeras llaves del objecto bundle que en este caso son los idiomas\n $('#selectLang').html($.map(array, function (val, key) {\n // Se hace un if para agregar el input disable solo en la primera vuelta\n if(firstRun){\n firstRun = false;\n return blankOption + '<option value=\"' + key + '\">' + key + '</option>';\n }\n return '<option value=\"' + key + '\">' + key + '</option>';\n \n }).join(''));\n\n}", "title": "" }, { "docid": "badfd40459356d7399e6f5739202dd79", "score": "0.6521046", "text": "function fillComboBox(){\n\t$.getJSON('/api/highscore/types', function(data){\n\t\tvar option = \"<option >?</option>\";\n\t\tvar i;\n\t\tvar t = '';\n\t\tfor(i = 0; i < data.length; i++){\n\t\t\tt += option.replace('?', data[i].Bezeichnung);\n\t\t}\n\t\t$('#selectType').append(t)\n\t});\n}", "title": "" }, { "docid": "b327afa868585548f7088076f2f65887", "score": "0.6516522", "text": "function comboListado() {\n listarInteres(1, cantidad.value, '', '')\n}", "title": "" }, { "docid": "c48c8d3331e451befffb61b78d6d80d6", "score": "0.6491064", "text": "function core_comboObjeto(obj,valor,texto,marcar,texto2,texto3)\n{\n\tvar ins = \"<option value='' \";\n\tvar v;\n\tvar t;\n\tif(!marcar && marcar != \"\"){\n\t\tmarcar = 0;\n\t}\n\tins += \">---</option>\";\n\tfor (var k=0;k<obj.length;k++){\n\t\tif(valor != \"\"){\n\t\t\tv = obj[k][valor];\n\t\t}\n\t\telse{\n\t\t\tv = obj[k];\n\t\t}\n\t\tif(texto != \"\"){\n\t\t\tt = obj[k][texto];\n\t\t}\n\t\telse{\n\t\t\tt = obj[k];\n\t\t}\n\t\tif(texto2){\n\t\t\tt += \" (\"+eval(\"obj[k].\"+texto2)+\")\";\n\t\t}\n\t\tif(texto3){\n\t\t\tt += \" (\"+eval(\"obj[k].\"+texto3)+\")\";\n\t\t}\n\t\tins += \"<option value='\"+v+\"' \";\n\t\tif (marcar == v){\n\t\t\tins += \"selected\";\n\t\t}\n\t\tins += \" title='\"+t+\"' >\"+t+\"</option>\";\n\t}\n\treturn(ins);\n}", "title": "" }, { "docid": "1b886949c8ec953fc1267999ddb42cc1", "score": "0.6481571", "text": "function getDataComboBox() {\n\t\tvar url = baseUrl + \"api/productlistscombos\";\n\t\t$.get(url, function(users){\n\t\t\t$.each(users, function(index, user){\n\t\t\t\tvar option = $('<option />');\n\t\t\t option.attr('value', this.value).text(user.categories_NAME);\n\t\t\t $('#cboSName').append(option);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "33e1350f30d6ab6d0e6232deae1fc098", "score": "0.64442766", "text": "function carregaCombo()\n{\n try\n {\n var retrievedObject = localStorage.getItem('cadastro');\n cadastro = ('retrievedObject: ', JSON.parse(retrievedObject));\n //limpa os combos\n document.getElementById(\"cbbEscola\").innerHTML = \"\";\n var cbbEscola = document.getElementById(\"cbbEscola\");\n //opção de busca vazia\n var opVazia = document.createElement('option');\n opVazia.innerHTML = \"-\";\n opVazia.value = -1;\n\n cbbEscola.appendChild(opVazia);\n //preenche combos\n for (var i = 0; i < cadastro.length; i++)\n {\n var opE = document.createElement('option');\n opE.innerHTML = cadastro[i].escola;\n opE.value = i;\n cbbEscola.appendChild(opE);\n }\n }\n catch (e)\n {\n alert(e);\n }\n}", "title": "" }, { "docid": "876f807795d31c12ee66327a6d65ec5d", "score": "0.6441104", "text": "function loadComboAcceso(combo){\n limpiarCombo(combo);\n activarCombos(combo);\n \n var canal = document.getElementById(\"cbCanal\");\n var optioncalnal = canal.options ;\n var cboAcc = document.getElementById(\"cbAcc\");\n var cboAcceso = document.getElementById(\"cbAcceso\");\n \n //--busca la primera coincidencia con acceso\n for(var i=0;i<cboAcc.length;i++){\n if(cboAcc.item(i).value == optioncalnal.value && optioncalnal.value !=\"\" ){\n \n var oOption = document.createElement(\"OPTION\");\n cboAcceso.options.add(oOption);\n oOption.innerText = cboAcc.item(i).innerText;\n oOption.value = cboAcc.item(i).value;\n break;\n }\n }\n\n //--busca si existen otras-\n for(var i=0;i<cboAcc.length;i++){\n \n if(cboAcc.item(i).value != optioncalnal.value && optioncalnal.value !=\"\"){\n \n var oOption = document.createElement(\"OPTION\");\n \n cboAcceso.options.add(oOption);\n oOption.innerText = cboAcc.item(i).innerText;\n oOption.value = cboAcc.item(i).innerText;\n \n }\n }\n \n set('frmGenerarFichero.statusAcceso',\"1\");\n }", "title": "" }, { "docid": "c52e012085c287039f40baa64b7d06c1", "score": "0.643384", "text": "function populateCargosSelect(cargos) {\n // Clean the field\n clearCargo();\n\n for (var i = 0; i < cargos.length; i++) {\n $j('#id_cargo').append(\n '<option value=\"'+cargos[i].id+'\">' +\n cargos[i].nombre_cargo +\n '</option>'\n );\n }\n\n}", "title": "" }, { "docid": "6b684bd2f04d1cb8044beaa9fe23a1c6", "score": "0.6425545", "text": "function ComboLinha(campo, actpos, div){\n\tif(empty(actpos)){\n\t\treturn;\n\t}\n\n\tif(!Verifica_Alteracao(div) && !$(div + \" tr[posicao=\"+actpos+\"]\").hasClass('active')){\n\t\treturn;\n\t}\n\n\tvar Ovalor = $(campo).attr(\"name\");\n\tvar comboMor = div + \" tr[posicao=\"+actpos+\"] select[name='\"+Ovalor+\"']\";\n\tvar inputMor = div + \" tr[posicao=\"+actpos+\"] input[name='\"+Ovalor+\"']\";\n\n\tvar OptionsOriginais;\n\n\tif(empty($.trim($(comboMor).html()))){\n\t\tswitch (Ovalor) {\n\t\t\tcase \"cd_id\":\n\t\t\t\t$.each(objComboComodo, function (key, comodo){\n\t\t\t\t\t$(comboMor).append($('<option>', {value: comodo.cd_id, text : comodo.cd_nome }));\n\t\t\t\t});\n\t\t\tbreak;\n\t\t\tcase \"cd_tipo\":\n\t\t\t\t$(comboMor).append('<option value=\"SALA\">SALA</option>'+\n\t\t\t\t\t\t\t\t '<option value=\"COZINHA\">COZINHA</option>'+\n\t\t\t\t\t\t\t\t '<option value=\"QUARTO\">QUARTO</option>'+\n\t\t\t\t\t\t\t\t '<option value=\"BANHEIRO\">BANHEIRO</option>'+\n\t\t\t\t\t\t\t\t '<option value=\"GARAGEM\">GARAGEM</option>');\t\n\t\t\tbreak;\n\t\t\tcase \"tp_status\":\n\t\t\t\t$(comboMor).append('<option value=\"A\">ATIVADO</option>'+\n\t\t\t\t\t\t\t\t '<option value=\"D\">DESATIVADO</option>');\t\n\t\t\tbreak;\n\t\t\tcase \"ac_libera\":\n\t\t\t\t$(comboMor).append('<option value=\"A\">ATIVADO</option>'+\n\t\t\t\t\t\t\t\t '<option value=\"B\">BLOQUEADO</option>');\t\n\t\t\tbreak;\n\t\t\tcase \"lp_nome\":\n\t\t\t\t$.each(objComboLampada, function (key, lampada){\n\t\t\t\t\t$(comboMor).append($('<option>', {value: lampada.lp_id, text : lampada.lp_nome }));\n\t\t\t\t});\n\t\t\tbreak;\n\t\n\t\t}\n\t}\n\n\t$(comboMor + \" option[value='\"+$(inputMor).val()+\"']\").attr('selected', 'selected');\n\tif(Ovalor == 'lp_nome'){\n\t\t$(comboMor + \" option[value='\"+$(inputMor).attr('lp_id')+\"']\").attr('selected', 'selected');\n\t}\t\t\t\n\t\t\n\t//ESCONDE INPUT\n\t$(inputMor).hide();\n\n\t//MOSTRA COMBO\n\t$(comboMor).show();\n\n\t//DEIXA COMBO FOCADO\n\t$(comboMor).focus();\n}", "title": "" }, { "docid": "da496f85e3e283d2c5b4030c6b19d676", "score": "0.6423225", "text": "function CrearCombo(lista, clave, dato, primer)\n{\n\n var select = \"\";\n\n if (primer !== undefined)\n {\n select += \"<option value='-1' disabled selected hidden>\" + primer + \"</option>\";\n }\n\n for (var i = 0; i < lista.length; i++) {\n select += \"<option value='\" + lista[i][clave] + \"'>\" + lista[i][dato] + \"</option>\";\n }\n return select;\n}", "title": "" }, { "docid": "9b8f88eb3da08a44eb7d10e3aec85399", "score": "0.63785565", "text": "function agregarOpciones(data, idCombo){\n\tvar opciones = '<option value=\"-1\" selected=\"selected\">------</option>';\n\tdata.forEach(function(item){\n\t\topciones += '<option value=\"' + item['pk'] + '\">' + item['fields']['nombre'] + '</option>';\n\t});\n\t//$(\"#\"+idCombo).empty();\n $(\"#\"+idCombo).html(opciones);\n $(\"#\"+idCombo).trigger('chosen:updated');\n}", "title": "" }, { "docid": "4bee4ac726bf6f568fbe42117fbb5e6e", "score": "0.6338753", "text": "function comboInit()\n{\n var theinput = document.getElementById(\"seleccion_cat\"); \n var idx = theinput.selectedIndex;\n mostrar_cat(theinput.options[idx].value);\t\n}", "title": "" }, { "docid": "68294aaf29e123e8aeec7b5bba2839a2", "score": "0.6338709", "text": "function agregarOpciones2(data, idCombo){\n // var opciones = '<option value=\"-1\" selected=\"selected\">------</option>';\n var opciones = '';\n data.forEach(function(item){\n opciones += '<option value=\"' + item['pk'] + '\">' + item['nombre'] + '</option>';\n });\n //$(\"#\"+idCombo).empty();\n $(\"#\"+idCombo).html(opciones);\n $(\"#\"+idCombo).trigger('chosen:updated');\n}", "title": "" }, { "docid": "f991977c9e2c457f192b00de708ecd56", "score": "0.62894064", "text": "function generateSelect (selectId, campos, selecionado)\r\n{\r\n var tmpCampoSel = false;\r\n var indiceStart = 0;\r\n\r\n while (selectId.options.length > 0) {\r\n selectId.options[0] = null;\r\n }\r\n\r\n if (campos != \"\") {\r\n for (var i=indiceStart; i < campos.length; i++) {\r\n tmpCampos = unescape( campos[i] );\r\n aTmpCampos = tmpCampos.split(\";\");\r\n tmpCampoId = aTmpCampos[0];\r\n tmpCampoValue = aTmpCampos[1];\r\n tmpCampoSel = false;\r\n\r\n if ( tmpCampoId == selecionado) {\r\n tmpCampoSel = true;\r\n }\r\n\r\n selectId.options[i] = new Option(tmpCampoValue, tmpCampoId, tmpCampoSel);\r\n\r\n if ( tmpCampoId == selecionado) {\r\n selectId.options[i].selected = true;\r\n }\r\n }\r\n } else {\r\n selectId.options[0] = new Option(\"------------\", 0);\r\n }\r\n}", "title": "" }, { "docid": "7386c4cdfbf10bc6f19cca8fd9c3b7a6", "score": "0.628087", "text": "fillSelect()\r\n {\r\n this.sections = this.selMain.reader.getSections();\r\n for(var i=0; i<this.sections.length; i++)\r\n {\r\n $(\"#sel1\").append('<option value=\"'+this.sections[i]+'\">'+this.sections[i]+\"</option>\");\r\n }\r\n }", "title": "" }, { "docid": "ec1e8bab8992d3c7b2312433e3e6e657", "score": "0.62774086", "text": "function CargarCombo(atrCombo) {\r\n\ttry {\r\n\t\tvar select = $('#' + atrCombo.nombreCombo);\r\n\t\tselect.append($('<option/>', {\r\n\t\t\tvalue : '',\r\n\t\t\ttext : atrCombo.mensaje\r\n\t\t}));\r\n\t\t$.getJSON(atrCombo.url, function(json) {\r\n\t\t\tjson.forEach(function(item, num) {\r\n\t\t\t\tselect.append($('<option/>', {\r\n\t\t\t\t\tvalue : eval('item.' + atrCombo.campo),\r\n\t\t\t\t\ttext : eval('item.' + atrCombo.valor)\r\n\t\t\t\t}));\r\n\t\t\t});\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.log('error-> ' + e);\r\n\t}\r\n}", "title": "" }, { "docid": "8f4f72c620bf613892ed3f0dc73f336e", "score": "0.62617743", "text": "function popolaDocenti()\r\n{\r\n //Ricevuta risposta dal SERVER!!\r\n if (xhrObj.readyState == 4) {\r\n var risp = xhrObj.responseText;\r\n \r\n var arrDocenti = JSON.parse(risp);\r\n var cmbDocenti = document.getElementById(\"selDocente\");\r\n var titolo = document.getElementById(\"titolo\");\r\n \r\n document.getElementById(\"divOrari\").innerHTML = \"\";\r\n \r\n titolo.innerHTML = \"\";\r\n titolo.innerHTML += \"PRENOTA LA TUA RIPETIZIONE DI \" + arrDocenti[0].corso.toString().toUpperCase();\r\n \r\n cmbDocenti.innerHTML = \"\";\r\n \r\n //Non è stato trovato alcun docente che insegna il corso selezionato\r\n if(arrDocenti[0].corso == \"none\")\r\n {\r\n document.getElementById(\"selDocente\").disabled = true;\r\n document.getElementById(\"dataPren\").disabled = true;\r\n alert(\"Nessun docente insegna \" + document.getElementById(\"selCorso\").value);\r\n }\r\n else\r\n {\r\n for(var i=0; i<arrDocenti.length; i++)\r\n {\r\n cmbDocenti.innerHTML += \r\n \"<option value='\" + arrDocenti[i].idDoc + \"'>\"\r\n + arrDocenti[i].nome + \"</option>\";\r\n }\r\n \r\n orderselect(document.getElementById(\"selDocente\"));\r\n document.getElementById(\"selDocente\").selectedIndex = 0;\r\n document.getElementById(\"selDocente\").disabled = false;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8107024802bb8d677f99f5dee4c7b84d", "score": "0.6258275", "text": "function pgdoc_cmbstipo_documento_codigo__init(){\n $(\"#pgdoc_cmbstipo_documento_codigo\").html('');\n \n $.post(\"../../controller/servicio.php?op=ctrl_apr_web_tipo_documento_select\", function(data, status){\n $(\"#pgdoc_cmbstipo_documento_codigo\").html(data);\n $(\"#pgdoc_cmbstipo_documento_codigo\").selectpicker('refresh');\n });\n}", "title": "" }, { "docid": "da935aaa1b6a0b1c0e6170c127335d89", "score": "0.62519616", "text": "function creatCombobox(createComboxs, isrequired, ismultiple){\r\n\t\tcreateComboxs.combobox({ \r\n\t\t required : isrequired, \r\n\t\t multiple : ismultiple,\r\n\t\t panelHeight:'auto',\r\n\t\t editable: false\r\n\t\t}); \r\n\t}", "title": "" }, { "docid": "8d30f690bcf515dafa014dcadd9b10ee", "score": "0.6237536", "text": "function fillPaidByAndPaidForDropDown(){\n $('#paidBySelect').empty();\n $('#paidForSelect').empty();\n $('#paidBySelect').append('<option value=\"0\">Select Paid By</option>');\n $('#paidForSelect').append('<option>Select Paid For</option>');\n $('#paidForSelect').append('<option value=\"group\">Group</option>');\n createQueryOnUserExpenseTable(\"getUserIDs\");\n }", "title": "" }, { "docid": "3296e37179a768c0023dfc3bb6c72865", "score": "0.6236651", "text": "function atribuirCidades(jsonCid,combo){ \n\t \n\tfor(var i=0;i<jsonCid.length;i++){ \n\t\tcombo.options[combo.length] = new Option(jsonCid[i].nomeCidade,jsonCid[i].idCidade);\n\t}\n\n}", "title": "" }, { "docid": "5b6b23abedc837732c1da5be7b084943", "score": "0.6232453", "text": "function setValorCombo (){\n $(\"#comboSemana\").val(semanaActual); //CARGA SEMANA\n getSucDetalle(genSucActual); //CARGA GENERAL/DETALLE\n}", "title": "" }, { "docid": "22d5ca738aa72ce4d20ad40b21588442", "score": "0.62285215", "text": "function llenaComboPPL(data, obj, sele, isSelec, isChosen) {\n obj.html(\"\");\n $.each(data, function(index, el) {\n if (isSelec) {\n if (sele instanceof Array) {\n var opt = \"\";\n opt = \"<option value='\" + el.ID + \"'>\" + el.DESCRIPCION.toUpperCase() + \"</option> \";\n for (var i = 0; i < sele.length; i++) {\n if (sele[i] == el.ID) {\n opt = \"<option value='\" + el.ID + \"' selected>\" + el.DESCRIPCION.toUpperCase() + \"</option> \";\n break;\n }\n }\n obj.append(opt);\n } else {\n if (el.ID == sele) {\n obj.append(\"<option value='\" + el.ID + \"' selected>\" + el.DESCRIPCION.toUpperCase() + \"</option> \");\n } else {\n obj.append(\"<option value='\" + el.ID + \"'>\" + el.DESCRIPCION.toUpperCase() + \"</option> \");\n }\n }\n } else {\n obj.append(\"<option value='\" + el.ID + \"'>\" + el.DESCRIPCION.toUpperCase() + \"</option> \");\n }\n\n });\n\n if (isChosen) {\n obj.chosen({ no_results_text: 'Oops!, no existe informacion con: ', width: \"100%\" });\n } else {\n obj.prepend(\"<option value=''>Seleccione una opcion</option> \");\n }\n}", "title": "" }, { "docid": "84610c25e3c961f7e2f44e56e4aaace1", "score": "0.62150675", "text": "function combo_carreras_horarioalumno_admin() {\n $.ajax({\n type: \"get\",\n url: base_url + 'Administrativos/HacerHorarioProfesor/obtenercarreras',\n dataType: \"json\",\n success: function (data) {\n console.log(data);\n $.each(data, function (key, registro) {\n $(\"#elcombo_carreras_horarioalumno_admin\").append('<option value=' + registro.id_carrera + '>' + registro.carrera_descripcion + '</option>');\n });\n },\n });\n}", "title": "" }, { "docid": "71dfef2d09e9287cd191e2940503269e", "score": "0.6212413", "text": "function showBoatList(boatList, boatSelectedCodeList){\n\t\tvar cmbOptionBoat = $(\"#cmbOptionBoat\");\t\t\n\t\tvar options = [];\n\t\t$.each(boatList, function(i, item){\t\t\t\n\t\t\toptions.push('<option value=\"'+item.boatCode+'\">'+item.boatShortName+'</option>');\t\t\t\n\t\t});\n\t\t//show dialog\n\t\tcmbOptionBoat.html(options);\n\t\tif (boatSelectedCodeList!==null){\n\t\t\tcmbOptionBoat.val(boatSelectedCodeList.split(\",\"));\n\t\t}\n\t\tcmbOptionBoat.selectpicker(\"refresh\");\n\t}", "title": "" }, { "docid": "13f56a08af8544cb33950137a23d344d", "score": "0.61813194", "text": "function selectedComboData() {\n var check = \"selectedCountryData\";\n var response = ipcRenderer.sendSync('selectedComboData', check);\n for (var i = 0; i < response.recordset.length; i++) {\n $(\"#countryCombo\").val(response.recordset[i].COUNTRY_NAME).change();\n }\n }", "title": "" }, { "docid": "c87bf523d049802e6d11b4ea0b64b64e", "score": "0.61801004", "text": "function renderOptions( ciudades ) {\r\n\r\n $sel_city.html('<option value=\"\" disabled selected>Seleccionar...</option>');\r\n\r\n ciudades.forEach(ciudad => {\r\n \r\n $sel_city.append('<option value=\"'+ ciudad +'\">'+ ciudad +'</option>');\r\n\r\n });\r\n\r\n }", "title": "" }, { "docid": "40f73f67f4e116dab51ae9eebdd76bf1", "score": "0.61798924", "text": "fillCuisinesSelect ( cuisines ) {\r\n cuisines = cuisines ? cuisines : Controller.getCuisines()\r\n\r\n cuisines.forEach(cuisine => {\r\n const option = document.createElement('option');\r\n option.innerHTML = cuisine;\r\n option.value = cuisine;\r\n View.cuisinesSelect.append(option);\r\n });\r\n }", "title": "" }, { "docid": "47e9b5bf16c54b60df121c0e8a4014bd", "score": "0.61756825", "text": "function addOptions(elem, field,d){\n arr=field.choices;\n value=SetValue(d[field.name],field.valuetype);\n arr.forEach(function(obj){\n elem.append('<option value=\"'+obj.sel+'\" '+(value==obj.sel?'selected':'')+'>'+obj.label+'</option>'); \n });\n }", "title": "" }, { "docid": "e343d2486f69e950e6554825494ce501", "score": "0.61565787", "text": "function agregarCiudad(valor, texto) {\r\n var miCombo = document.getElementById(\"id_ciudad\");\r\n var miOption = document.createElement(\"option\");\r\n miOption.text = texto;\r\n miOption.value = valor;\r\n miCombo.add(miOption);\r\n}", "title": "" }, { "docid": "4780889e48afa563b87e973bf89784c5", "score": "0.61485267", "text": "function lotDataDropdown() {\n\n $cmbSerialDropdown.empty();\n\n VIS.dataContext.getJSONData(VIS.Application.contextUrl + \"VA005/AttributeListing/GetLotData\", \"\", LotDataCallBack);\n\n // var sql = \"SELECT M_LotCtl_id,Name FROM M_LotCtl WHERE isActive='Y'\";\n\n //sql = VIS.MRole.addAccessSQL(sql, \"M_LotCtl\", true, true);\n\n //var ds = VIS.DB.executeReader(sql.toString(), null);\n //if (ds != null) {\n // var key, value = null;\n // $cmbSerialDropdown.append($(\"<Option value=''> </option>\"));\n // while (ds.read()) {\n // value = ds.getString(1);\n // key = VIS.Utility.Util.getValueOfInt(ds.getString(0));\n // $cmbSerialDropdown.append($(\"<Option value=\" + key + \">\" + VIS.Utility.encodeText(value) + \"</option>\"));\n // }\n // ds.close();\n //}\n }", "title": "" }, { "docid": "e325f702d7b5d42d4c7aaf17c76ceb18", "score": "0.6148307", "text": "function mostrarCombo() {\n let parametros = {\n 'func': 'editar_combobox'\n }\n $.ajax({\n url: 'paso.php',\n method: 'post',\n data: parametros,\n success: function (data) {\n data = $.parseJSON(data);\n //muestra la opcion 0\n let resultado = '<option value=\"0\">Elige una opcion</option>';\n data.forEach(function (element) {\n resultado += '<option value=' + element.id + '>' + element.nombre + '</option>';\n });\n $('#lista_reproduccion').html(resultado);\n },\n error: function (xhr, status) {\n alert('Disculpe, existio un problema');\n }\n });\n}", "title": "" }, { "docid": "6afbf35f5fb715a60024b80424f60bf7", "score": "0.6140865", "text": "function core_comboGrupos(onde,id,marcar,funcao)\n{\n\tvar sUrl = \"../php/menutemas.php?funcao=pegaGrupos\";\n\tvar callback =\n\t{\n\t\t\tsuccess:function(o)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar valores = YAHOO.lang.JSON.parse(o.responseText);\n\t\t\t\tif(arguments.length == 3)\n\t\t\t\t{funcao = \"\";}\n\t\t\t\tif (funcao != \"\")\n\t\t\t\t{funcao = \"onchange='\"+funcao+\"'\";}\n\t\t\t\tins = \"<select size=6 style='width:370px;font-size:12px; margin: 0px;' id='\"+id+\"' \"+funcao+\" >\";\n\t\t\t\tins += core_comboObjeto(valores,\"id_grupo\",\"nome_grupo\",marcar);\n\t\t\t\tins += \"</select>\";\n\t\t\t\t$i(onde).innerHTML = ins;\n\t\t\t\t}\n\t\t\t\tcatch(e){core_handleFailure(e,o.responseText);}\n\t\t\t},\n\t\t\tfailure:core_handleFailure,\n\t\t\targument: { foo:\"foo\", bar:\"bar\" }\n\t};\n\tcore_makeRequest(sUrl,callback);\n}", "title": "" }, { "docid": "77c39b6d243e369545c1ec53508d7b80", "score": "0.6134616", "text": "function fillSelectAutori(){\n\t$('#select-autore-annotazione').empty();\n\t$('#select-autore-annotazione').append($(\"<option></option>\").attr(\"value\", \"default\").text(\"Nessun filtro autore\"));\n\t//Per ogni autore compongo <option> con coppia chiave-valore\n\tfor(var i = 0; i < listaAutoriAnnotazioni.length; i++){\n\t\t$('#select-autore-annotazione').append($(\"<option></option>\").attr(\"value\", i).text(listaAutoriAnnotazioni[i]));\n\t}\n}", "title": "" }, { "docid": "ae5ad28320a4472c175d9cc77f490fc1", "score": "0.61201334", "text": "function limpiarCombo(combo){\t\r\n\tif(combo.options != null){\r\n\t\tcombo.options.length = 0;\r\n\t}\r\n}", "title": "" }, { "docid": "7d3993b62dcfa3f9f0c5966559b1abfb", "score": "0.61146533", "text": "function cargarSelect(){\n llenarCiudadReporte();\n llenarTipoReporte();\n}", "title": "" }, { "docid": "e71a338b15f4ff046d0b45be5cba4a73", "score": "0.61090285", "text": "function core_comboPerfis(onde,id,marcar,funcao)\n{\n\tif(arguments.length == 3)\n\t{funcao = \"\";}\n\tif($perfis == \"\")\n\t{\n\t\tcore_pegaPerfis(\"core_comboPerfis('\"+onde+\"','\"+id+\"','\"+marcar+\"','\"+funcao+\"')\");\n\t}\n\telse\n\t{\n\t\tif (funcao != \"\")\n\t\t{funcao = \"onchange='\"+funcao+\"'\";}\n\t\tins = \"<div class='styled-select150'><select id='\"+id+\"' \"+funcao+\" >\";\n\t\tins += core_comboObjeto($perfis,\"perfil\",\"perfil\",marcar);\n\t\tins += \"</select></div>\";\n\t\t$i(onde).innerHTML = ins;\n\t}\n}", "title": "" }, { "docid": "c63bbfb788b3f2e471f9ddef8fa5a5a1", "score": "0.61046886", "text": "createSelectItems() {\n let items = [];\n \n for (let item of this.countries) {\n items.push(<option key={item} value={item}>{item}</option>)\n }\n\n return items;\n }", "title": "" }, { "docid": "6bc89c39f1ce51b8c561e917ed69a920", "score": "0.6092261", "text": "function fillSelect() {\n const select = document.querySelector('.whoPaid-form').querySelectorAll('select');\n\n for (let i = 0; i < select.length; i++) {\n if (persons.length >= (select[i].childElementCount - 1)) {\n select[i].innerHTML = '<option selected disabled value=\"Seleccione\">Seleccione</option>';\n \n for (let j = 0; j < persons.length; j++) {\n select[i].innerHTML += `<option value=\"${persons[j].name}\">${persons[j].name}</option>`; \n }\n }\n }\n}", "title": "" }, { "docid": "33cc90ed7ac750a65d9b51ce495b015d", "score": "0.6082416", "text": "function DropdownCtl(colName) {\r\n // Simple\r\n if((this.Obj = $(\"select[Title='\" + colName + \"']\")).length === 1) {\r\n this.Type = \"S\";\r\n // Compound\r\n } else if((this.Obj = $(\"input[Title='\" + colName + \"']\")).length === 1) {\r\n this.Type = \"C\";\r\n // Multi-select: This will find the multi-select column control in English and most other languages sites where the Title looks like 'Column Name possible values'\r\n } else if((this.Obj = $(\"select[ID$='SelectCandidate'][Title^='\" + colName + \" ']\")).length === 1) {\r\n this.Type = \"M\";\r\n // Multi-select: This will find the multi-select column control on a Russian site (and perhaps others) where the Title looks like 'Выбранных значений: Column Name'\r\n } else if((this.Obj = $(\"select[ID$='SelectCandidate'][Title$=': \" + colName + \"']\")).length === 1) {\r\n this.Type = \"M\";\r\n // Multi-select: This will find the multi-select column control on a German site (and perhaps others) where the Title looks like 'Mögliche Werte für &quot;Column name&quot;.'\r\n } else if((this.Obj = $(\"select[ID$='SelectCandidate'][Title$='\\\"\" + colName + \"\\\".']\")).length === 1) {\r\n this.Type = \"M\";\r\n // Multi-select: This will find the multi-select column control on a Italian site (and perhaps others) where the Title looks like \"Valori possibili Column name\"\r\n } else if((this.Obj = $(\"select[ID$='SelectCandidate'][Title$=' \" + colName + \"']\")).length === 1) {\r\n this.Type = \"M\";\r\n } else {\r\n this.Type = null;\r\n }\r\n } // End of function DropdownCtl", "title": "" }, { "docid": "19e28ef5576f0ace4a35c3fc1afcdf78", "score": "0.6080717", "text": "construirSelect(){\r\n cotizador.obtenerMonedasAPI()\r\n .then(monedas =>{\r\n \r\n //Crear un select de opciones\r\n const select = document.getElementById(\"criptomoneda\");\r\n\r\n //Iterar por los resultados de la api\r\n for( const [key, value] of Object.entries(monedas.monedas.Data) ){\r\n //Añadir el symbol y el nombre como opciones al select\r\n const opcion = document.createElement(\"option\");\r\n //value.Symbol es el valor dentro del objeto\r\n opcion.value = value.Symbol;\r\n opcion.appendChild(document.createTextNode(value.CoinName));\r\n select.appendChild(opcion);\r\n\r\n }\r\n })\r\n }", "title": "" }, { "docid": "30c6a209473d5c936deb23000a3793e6", "score": "0.60788876", "text": "function monta_combo(){\n\tvar funcao = 'funcao=monta_combo';\n\tAJAX(SERVLET_ADMIN,funcao, function(retorno){\n\t\tretorno = JSon(retorno);\n\t\n\t\t//CASO OCORRA ALGUM ERRO\n\t\tif(!retorno){\n\t\t\talert(\"Ocorreu um erro interno ao servidor\");\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\t\tif (!empty(retorno.error)) {\n\t\t\talert(\"Ocorreu um erro ao buscar usuarios\\n\"+\n\t\t\t\t \"Erro: \" + retorno.error);\n\t\t return; //IMPEDE QUE CONTINUE EXECUTANDO O CODIGO EM CASO DE ERRO\n\t\t}\n\n\t\t//COMBO DE COMODOS\n\t\t//[0] - COMODOS\n\t\t//[1] - LAMPADAS\n\t\tobjComboComodo = retorno[0].lista;\n\t\tobjComboLampada = retorno[1].lista;\n\t\t\n\t\tbuscaComodo = false;\n\t});\t\n}", "title": "" }, { "docid": "d567d800c406c9080fbf72429c66e0d2", "score": "0.607851", "text": "function renderListComboBox() {\n\t\tvar url = baseUrl + \"api/currencylistscombos\";\n\t\t$.get(url, function(users){\n\t\t\t$.each(users, function(index, user){\n\t\t\t\tvar option = $('<option />');\n\t\t\t option.attr('value', this.value).text(user.cur_NAME);\n\t\t\t $('#cboCurrencyName').append(option);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "1619fe56920f9d480bf66a1ef85aa314", "score": "0.60689956", "text": "function iniciarCamposCMB() {\n $(\"#cmbdenominacion\").val(Denominacion);\n}", "title": "" }, { "docid": "fda071d60e07505bc00d43926eb61a9d", "score": "0.6061028", "text": "function seleccionarCuenta(cta){\n\n consultaAjax({ opcion : 2,cta },(subCuentas)=>{ \n let opcionesSelect =\"<option value='0'>Seleccione una Gasto</option>\";\n for (var i = 0; i < subCuentas.length; ++i){\n opcionesSelect +=`<option value='${subCuentas[i].id}'>${subCuentas[i].descripcion}</option>`;\n } \n document.getElementById('sltSct').innerHTML = opcionesSelect;\n var elemsselect = document.getElementById('sltSct');\n M.FormSelect.init(elemsselect, {});\n \n \n },'gastos');\n}", "title": "" }, { "docid": "0974e76dbf04e30479d67b50b4881ed0", "score": "0.6056458", "text": "function SetBaseToControls() {\r\n selectedColumn = {};\r\n $('#dialogName').val('');\r\n $('#dialogDescription').val('');\r\n $('#dialogSQL').val('');\r\n if(dropdown_type != '') dropdown_type.SetIndex(-1);\r\n if (dropdown_subtype != '') dropdown_subtype.SetIndex(-1);\r\n if (dropdown_dialogtable != '') dropdown_dialogtable.SetIndex(-1);\r\n if (dropdown_dialogcolumn != '') dropdown_dialogcolumn.SetIndex(-1);\r\n if (dropdown_sql != '') dropdown_sql.SetIndex(-1);\r\n $('#builderSQLName').val('');\r\n $('#builderSQL').val('');\r\n $('#warning').html('');\r\n}", "title": "" }, { "docid": "91fab8510028b711a88918d3a9ba28c4", "score": "0.60412717", "text": "function atribuirEstados(json,combo){ \n\tfor(var i=0;i<json.length;i++){\n\t\tcombo.options[combo.length] = new Option( json[i].siglaEstado,json[i].idEstado );\n\t}\n}", "title": "" }, { "docid": "0658024ca1811c4366b9054f61437084", "score": "0.6037027", "text": "function TiraComboLinha(campo, actpos, div){\n\tif(empty(actpos)){\n\t\treturn;\n\t}\n\n\tvar Ovalor = $(campo).attr(\"name\");\n\n\t\n\t//COMBO DESEJADO\n\tvar comboMor = div + \" tr[posicao=\"+actpos+\"] select[name='\"+Ovalor+\"']\";\n\n\t//INPUT SELECIONADO\n\tvar inputMor = div + \" tr[posicao=\"+actpos+\"] input[name='\"+Ovalor+\"']\";\n\n\t$(inputMor).val($(comboMor).val());\n\tif(Ovalor == 'lp_nome'){\n\t\t$(inputMor).val($(comboMor + \" option:selected\").html()).attr('lp_id', $(comboMor).val());\n\t}\n\t\n\t//MOSTRA INPUT\n\t$(inputMor).show();\n\n\t//ESCONDE COMBO\n\t$(comboMor).hide();\n}", "title": "" }, { "docid": "89ea68795dac5a95d781264daf56b3f6", "score": "0.60264003", "text": "function initSelect() {\n $('.city').selectpicker({noneSelectedText: 'Ville'});\n $('.locker').selectpicker({noneSelectedText: 'Casier'});\n $('.garage').selectpicker({noneSelectedText: 'Garage'});\n $('.department').selectpicker({noneSelectedText: 'Département'});\n}", "title": "" }, { "docid": "3da72f2a0726086622e0ca9ac65ee505", "score": "0.6017585", "text": "function set_combo_state_cls(select){\n $('.city').html('<option value=\"\">Selecione o estado</option>');\n $.ajax({\n type: \"POST\",\n data: \"\",\n dataType: \"json\",\n cache: false,\n url: '/ajax/states/get',\n timeout: 2000,\n error: function() {\n console.log(\"Failed to submit\");\n },\n success: function(data) {\n $(\"select.state option\").remove();\n\n var row = '<option value=\"\"></option>';\n $.each(data, function(i, j){\n var selected = \"\";\n if(select == j.id){\n selected = \"selected\";\n }\n row += \"<option acronym=\\\"\" + j.acronym + \"\\\" value=\\\"\" + j.id + \"\\\" \"+selected+\" >\" + j.name + \"</option>\";\n });\n\n $('.state').html(row);\n }\n });\n }", "title": "" }, { "docid": "23993265cf8a040ab3bd176af1f92936", "score": "0.60144216", "text": "function populateDisciplineSelect() {\n var fields = []; \n\n // clears list\n fieldCats.html(\"\");\n //alert(\"3\");\n\n // add each discipline, storing its id with the field shown\n $.each(disciplines, function (i, field) {\n if (!fields.includes(field.Field)) {\n fields.push(field.Field);\n var myOption = $(\"<option></option>\");\n myOption.attr(\"id\", \"disc_\" + field.DisciplineId);\n myOption.html(field.Field);\n fieldCats.append(myOption);\n }\n\n });\n \n }", "title": "" }, { "docid": "b6024871b6c7e4d0b2eed0bdad6b6195", "score": "0.6007741", "text": "function llenaComboRel(data, obj, sele, isSelec, isChosen) {\n obj.html(\"\");\n $.each(data, function(index, el) {\n if (isSelec) {\n if (sele instanceof Array) {\n var opt = \"\";\n opt = \"<option value='\" + el.ID + \"' data-extra='\" + el.TYPE_EXTRA + \"'>\" + el.DESCRIPCION.toUpperCase() + \"</option> \";\n for (var i = 0; i < sele.length; i++) {\n if (sele[i] == el.ID) {\n opt = \"<option value='\" + el.ID + \"' data-extra='\" + el.TYPE_EXTRA + \"' selected>\" + el.DESCRIPCION.toUpperCase() + \"</option> \";\n break;\n }\n }\n obj.append(opt);\n } else {\n if (el.ID == sele) {\n obj.append(\"<option value='\" + el.ID + \"' data-extra='\" + el.TYPE_EXTRA + \"' selected>\" + el.DESCRIPCION.toUpperCase() + \"</option> \");\n } else {\n obj.append(\"<option value='\" + el.ID + \"' data-extra='\" + el.TYPE_EXTRA + \"'>\" + el.DESCRIPCION.toUpperCase() + \"</option> \");\n }\n }\n } else {\n obj.append(\"<option value='\" + el.ID + \"' data-extra='\" + el.TYPE_EXTRA + \"'>\" + el.DESCRIPCION.toUpperCase() + \"</option> \");\n }\n\n });\n\n if (isChosen) {\n obj.chosen({ no_results_text: 'Oops!, no existe informacion con: ', width: \"100%\" });\n } else {\n obj.prepend(\"<option value=''>Seleccione una opcion</option> \");\n }\n}", "title": "" }, { "docid": "b864fd63062d307c0cc782a51490d7d1", "score": "0.6005488", "text": "display_drop_down_menus(){\n // textAlign(CENTER);\n background(200);\n // this.sel = createSelect();\n this.sel.position(500, 10);\n this.sel.option('line');\n this.sel.option('dot');\n // this.sel.option('another_one');\n // this.sel.changed( this.change_design_type );\n }", "title": "" }, { "docid": "7f6f6aa85699cc3083776ce352b78b4e", "score": "0.6003136", "text": "function core_comboTemas(onde,id,marcar,funcao)\n{\n\tvar sUrl = \"../php/menutemas.php?funcao=pegaTemas2\";\n\tvar callback =\n\t{\n\t\t\tsuccess:function(o)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar valores = YAHOO.lang.JSON.parse(o.responseText);\n\t\t\t\tif(arguments.length == 3)\n\t\t\t\t{funcao = \"\";}\n\t\t\t\tif (funcao != \"\")\n\t\t\t\t{funcao = \"onchange='\"+funcao+\"'\";}\n\t\t\t\tins = \"<select size=6 style='width:355px;font-size:12px; margin: 0px;' id='\"+id+\"' \"+funcao+\" >\";\n\t\t\t\tins += core_comboObjeto(valores,\"id_tema\",\"nome_tema\",marcar,\"codigo_tema\");\n\t\t\t\tins += \"</select>\";\n\t\t\t\t$i(onde).innerHTML = ins;\n\t\t\t\t}\n\t\t\t\tcatch(e){core_handleFailure(e,o.responseText);}\n\t\t\t},\n\t\t\tfailure:core_handleFailure,\n\t\t\targument: { foo:\"foo\", bar:\"bar\" }\n\t};\n\tcore_makeRequest(sUrl,callback);\n}", "title": "" }, { "docid": "0c74849384a0595500403be7f7a15fc4", "score": "0.599324", "text": "function loadMerc() {\n\tvar choices = \"<option>­ ­ ­ ­ Mercenary</option>\";\n\tfor (let m = 1; m < mercenaries.length; m++) { choices += \"<option>\" + mercenaries[m].name + \"</option>\" }\n\tdocument.getElementById(\"dropdown_mercenary\").innerHTML = choices\n}", "title": "" }, { "docid": "bdca3c9f844d0a7b7e728645ed45b244", "score": "0.5991623", "text": "function CargarDistrito() {\n //se selecciona la tabla\n var db = database.ref(\"distrito\");\n db.once(\"value\", function (snapshot) {\n if (snapshot.exists()) {\n snapshot.forEach(function (data) {\n //capturamos la informacion\n var cod = data.key;\n var nom = data.val().nombre;\n //creamos un elemento\n var options = document.createElement(\"option\");\n //agreganos el nombre y el codigo al option\n options.text = nom;\n options.value = cod;\n //agregamos los options al combo\n cboDistrito.add(options);\n });\n }\n });\n}", "title": "" }, { "docid": "398761a64d2a11ae7a4146f1d6e0188f", "score": "0.59850836", "text": "function selectComuni() {\n\t$.ajax({\n\t\t\"type\": \"GET\",\n\t\t\"url\": \"https://comuni-ita.herokuapp.com/api/comuni/provincia/\"+$('#provinciaIndirizzo').val()+\"?onlyname=true\",\n\t\tdataType: \"json\",\n\t\t\"success\": function(data) {\n\t\t\tdata.sort(function (a, b) {\n \t\t\t\treturn a.localeCompare(b);\n\t\t\t});\n\t\t\tvar html=\"\";\n\t\t\tfor(var i=0; i<data.length;i++){\n\t\t\t\thtml+=\"<option value=\\\"\"+data[i]+\"\\\">\"+data[i]+\"</option>\"\n\t\t\t}\n\t\t\t$(\"#cittaIndirizzo\").html(html);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "435ecccb9ff04bfbf136992fef8e012f", "score": "0.5980949", "text": "function fill_drop_down(container, data_json, id_parameter, name_parameter, caption) {\n var tbody_obj = container;\n tbody_obj.html(\"\");\n tbody_obj.append('<option value=\"\" disabled selected> Choose a ' + caption + ' </option>');\n $.each(data_json, function(index, data) {\n var li_item = '<option value=' + data[id_parameter] + '>' + data[name_parameter] + '</option>';\n tbody_obj.append(li_item);\n });\n $('select').material_select();\n}", "title": "" }, { "docid": "3d58aecd637ecf3bef7627e390a4de3d", "score": "0.5977528", "text": "function getDataToComboBox() {\n fetch('/getAllPatients', {\n }).then(function(res) {\n return res.json();\n }).then(function(data) {\n var arrayOfPatients = JSON.parse(data);\n\n var table = document.getElementById('dataTable'); // getting the table element\n var patientsComboBox = document.getElementById('category'); // getting the combo-box element\n\n // inserting the rows into the table with patients data\n var i;\n for (i = 0; i < arrayOfPatients.length; i++) {\n // creating the option to add it to the combo-box\n var patientInComboBox = document.createElement('option');\n patientInComboBox.text = arrayOfPatients[i].id;\n patientInComboBox.value = arrayOfPatients[i].id;\n patientsComboBox.add(patientInComboBox);\n }\n })\n}", "title": "" }, { "docid": "e5d799c9f4e17446b9386e2909097cb0", "score": "0.5976264", "text": "function LoadLoaiDuLieu() {\n $(\"#cbxSearch_LoaiDuLieu\").empty(); // Clear before fill\n $(\"#cbxSearch_LoaiDuLieu_TimKiem\").empty();\n var strItem = [\n \"<option value='-1'>-Chọn loại dữ liệu-</option>\",\n //\"<option value='DiaDanh'>Tất cả</option>\",\n \"<option value='DiaDanh'>Dữ liệu địa danh</option>\"\n ];\n $(\"#cbxSearch_LoaiDuLieu\").append(strItem);\n $(\"#cbxSearch_LoaiDuLieu_TimKiem\").append(strItem);\n}", "title": "" }, { "docid": "941b5c537134d3ba303797a6ed862566", "score": "0.59747124", "text": "function fill_crop_drop_down() {\n var tbody_obj = $('#crop_max_min_avg');\n tbody_obj.html(\"\");\n tbody_obj.append('<option value=\"\" disabled selected> Choose a Crop </option>');\n $.each(crops_for_filter, function(index, data) {\n var li_item = '<option value=' + data.id + '>' + data.crop_name + '</option>';\n tbody_obj.append(li_item);\n });\n $('select').material_select();\n}", "title": "" }, { "docid": "82b17376f9e3cfae20a332f36f3b8abb", "score": "0.59736264", "text": "function buildSelect(estados){\n\testados.forEach(function(es){\n\t\tvar opt = $('<option>');\n\t\topt.val(es.ordinal);\n\t\topt.text(es.sigla);\n\t\t$('#inputState').append(opt);\n\t});\n}", "title": "" }, { "docid": "aa72a525e3b3f2fa07159982c14520f7", "score": "0.5973286", "text": "function setSelect_jenis(){\n\tvar arrStatus = [\n\t\t{value: \"\", text: \"-- Pilih Jenis Kendaraan --\"},\n\t\t{value: \"C\", text: \"COLT DIESEL\"},\n\t\t{value: \"F\", text: \"FUSSO\"},\n\t];\n\n\t$.each(arrStatus, function(index, item){\n\t\tvar option = new Option(item.text, item.value);\n\t\t$(\"#jenis\").append(option);\n\t});\n}", "title": "" }, { "docid": "7c2cbef2b27ecb2183135b4c0165b22a", "score": "0.5954966", "text": "get selectOptions () {\n return this._selectOptions\n }", "title": "" }, { "docid": "a732e0dd8a2aa6d09baa4f42aa2ee9f6", "score": "0.5953703", "text": "function carga_combo_horas_modif(variable){\n var ruta = document.getElementById(\"ruta_principal\").value;\n //var fullname = $('#fullname').val();\n var $cmb = $(\"#cmb_horas\");\n //$tabla.find(\"tr:gt(0)\").remove();\n $.ajax({\n type: 'POST',\n dataType: 'json',\n data: {id_cmb: 'horas'},\n url: ruta + '/F_Muestra_programas',\n success: function (result) {\n $cmb.find('option').remove();\n $.each(result.items, function (index, article) {\n if (variable == article.descripcion){\n $cmb.append(\"<option selected value=\\\"\" + article.valor + \"\\\">\\n\" + article.descripcion +\n \"</option>\");\n }else{\n $cmb.append(\"<option value=\\\"\" + article.valor + \"\\\">\\n\" + article.descripcion +\n \"</option>\");\n }\n });\n console.log(\"Se cargo exitosamente el combo hora\");\n }\n });\n}", "title": "" }, { "docid": "1b89701af6db15ff1dde3e23646c5a8e", "score": "0.5952852", "text": "function setValueToSelect(val) {\n setSelectTipo(val);\n }", "title": "" }, { "docid": "e7ab9f8a47ced52445de30861730597f", "score": "0.5951197", "text": "function populateForm() {\n\n //TODO: Add an <option> tag inside the form's select for each product\n var selectElement = document.getElementById('items');\n for (var i in Product.allProducts) {\n var dropdownItem = document.createElement('option');\n dropdownItem.textContent = Product.allProducts[i].name;\n dropdownItem.setAttribute('value', Product.allProducts[i].name);\n selectElement.appendChild(dropdownItem); \n }\n}", "title": "" }, { "docid": "0fd20f6afce21f3c2b540838b3cf7b52", "score": "0.5949653", "text": "function cargaComboIndicadorAgrup(){\n\n\t var todos = GestionarMensaje('2641', null, null, null);\n\t var porLoMenosUno = GestionarMensaje('2636', null, null, null);\n\n\t var carga = new Array(3);\n\t carga[0] = ['', ''];\n\t carga[1] = ['T', todos];\n\t carga[2] = ['U', porLoMenosUno];\n\n\t set_combo('formulario.cbIndAgrup', carga);\n}", "title": "" }, { "docid": "0fbb7582d8060e6ff4fc644b3ebd308c", "score": "0.5948751", "text": "function populateForm() {\n\n //TODO: Add an <option> tag inside the form's select for each product\n var selectElement = document.getElementById('items');\n for (var i in Product.allProducts) {\n var dropdownItem = document.createElement('option');\n dropdownItem.textContent = Product.allProducts[i].name;\n dropdownItem.setAttribute('value', Product.allProducts[i].name);\n selectElement.appendChild(dropdownItem);\n }\n}", "title": "" }, { "docid": "859298c977ffef47a848efc9b04ad701", "score": "0.59481066", "text": "function usuariosCadastro_cmbSexo(data) {\n document.getElementById(\"cmbsexo\").innerHTML = data;\n}", "title": "" }, { "docid": "3259fdfd977ed8d4de1fed825788d351", "score": "0.5947775", "text": "initializeMultiSelect() {\n // extrae de la bd los datos ROLE\n this.cnx.get_data('role').subscribe(myRoles => {\n this.role = myRoles;\n // prepara los datos para ser leidos en el combo\n this.roleMain = myRoles.filter(LOC => LOC.roleId);\n });\n // extrae de la bd los datos LOCATION\n this.cnx.get_data('location').subscribe(myLocations => {\n this.location = myLocations;\n console.log(this.location);\n // prepara los datos para ser leidos en el combo\n this.locationMain = myLocations.filter(LOC => LOC.locationId);\n console.log(this.locationMain);\n });\n this.listClonLanguages[0] = { id: 'EN', itemName: 'English' };\n this.listClonLanguages[1] = { id: 'SP', itemName: 'Spanish' };\n }", "title": "" }, { "docid": "de74f9ec3ca82003234104030d8338a5", "score": "0.5945047", "text": "function GetAveryTemplates() {\n var averyTypes = { identifier: 'id', items: [] };\n for (var i = 0; i < averyTemplates.length; i++) {\n averyTypes.items[i] = { id: averyTemplates[i].value, name: averyTemplates[i].name };\n }\n var store = new dojo.data.ItemFileReadStore({ data: averyTypes });\n\n var filteringSelect = new dijit.form.ComboBox({\n autocomplete: false,\n hasdownarrow: true,\n id: 'selectAvery',\n store: store,\n searchAttr: \"name\",\n style: \"width: 130px;color: #FFF !important;background-color:#303030 !important\",\n onChange: function () {\n ValidateAveryFormat();\n }\n }, dojo.byId(\"cmbAveryLabels\"));\n dijit.byId(\"selectAvery\").textbox.readOnly = true;\n}", "title": "" }, { "docid": "ecfb92b1d8f24fbc9816ee0add4e34fe", "score": "0.5942107", "text": "function populateVoices() {\n // console.log(voices);\n // loop over offered voices, set them as selectable <option>s\n voices = this.getVoices();\n const voiceOptions = voices\n .filter(voice => voice.lang.includes('en'))\n .map(voice => `<option value=\"${voice.name}\">${voice.name} (${voice.lang})</option>`)\n .join('');\n voicesDropdown.innerHTML = voiceOptions;\n}", "title": "" }, { "docid": "98051b59cd30af1fa042aeb354bfcce4", "score": "0.593889", "text": "function getComboBoxSupplierInvoice() {\n\t\tvar url = baseUrl + \"api/comboinvoice\";\n\t\t$.get(url, function(users){\n\t\t\t$.each(users, function(index, user){\n\t\t\t\tvar option = $('<option />');\n\t\t\t option.attr('value', this.value).text(user.invoice_NO);\n\t\t\t $('#cboInvoice').append(option);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "ba51c3ae588246ce4977777f47a2a41f", "score": "0.5936117", "text": "static set_combo_box_options(combo_box_div_elt, array_of_strings){\n let select_elt = combo_box_div_elt.children[1]\n select_elt.innerHTML = \"\"\n for(let item of array_of_strings){\n let option_elt = document.createElement(\"OPTION\")\n option_elt.innerHTML = item\n select_elt.appendChild(option_elt)\n }\n}", "title": "" }, { "docid": "18e3f22e342a9d4978513d7466f4d6d1", "score": "0.5929274", "text": "function set_combo_city_cls(select, state_id){\n $('.city').html('<option value=\"\">Selecione o estado</option>');\n if(state_id!=''){\n $.ajax({\n type: \"POST\",\n data: \"state_id=\" + state_id,\n dataType: \"json\",\n cache: false,\n url: '/ajax/states/get',\n timeout: 2000,\n error: function() {\n console.log(\"Failed to submit\");\n },\n success: function(data) {\n $(\"select.city option\").remove();\n\n var row = '';\n $.each(data, function(i, j){\n var selected = \"\";\n if(select!= \"\" && (select == j.id || select.toUpperCase() == j.name) ){\n selected = \"selected\";\n }\n row += \"<option value=\\\"\" + j.id + \"\\\" \"+selected+\" >\" + j.name + \"</option>\";\n });\n\n $('.city').html(row);\n }\n });\n }\n }", "title": "" }, { "docid": "dbf5f02a41f77498605f67f414801aef", "score": "0.5923816", "text": "function loadCars(){\r\n\tlet selector1 = document.getElementById(\"selectCar1\");\r\n\tlet selector2 = document.getElementById(\"selectCar2\");\r\n\tlet selector3 = document.getElementById(\"selectCar3\");\r\n\tlet option;\r\n\tlet optGroup;\r\n\tlet tipoActual = \"\";\r\n\tfor(let i = 0; i<obj_cars.length; i++){\r\n\t\toption = document.createElement(\"option\");\r\n\t\toption.text = obj_cars[i].getName();\r\n\t\tselector1.add(option);\r\n\t\toption = document.createElement(\"option\");\r\n\t\toption.text = obj_cars[i].getName();\r\n\t\tselector2.add(option);\r\n\t\toption = document.createElement(\"option\");\r\n\t\toption.text = obj_cars[i].getName();\r\n\t\tselector3.add(option);\r\n\t}\r\n}", "title": "" }, { "docid": "b2684a6ca027e54b4331d56a360b46ac", "score": "0.59220773", "text": "function getComboReturn() {\n\t\tvar url = baseUrl + \"api/returntohengpheacomboinvoice\";\n\t\t$.get(url, function(users){\n\t\t\t$.each(users, function(index, user){\n\t\t\t\tvar option = $('<option />');\n\t\t\t option.attr('value', this.value).text(user.invoiceNo);\n\t\t\t $('#cboInvoice').append(option);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "3cf5ce2d3ec8fccea496c799036f3fba", "score": "0.5921205", "text": "function fillCombo(updateId, value, accion) {\n $.getJSON(accion\n + \"/\" + value,\n function (data) {\n cleanCombo(updateId);\n $.each(data, function (i, item) {\n $(\"#\" + updateId).append(\"<option value='\"\n + item.Value + \"'>\" + item.Text\n + \"</option>\");\n });\n });\n}", "title": "" }, { "docid": "e685153872a106edd421ecbfa6f9bdfa", "score": "0.5920213", "text": "function fillForm()\n{\n let selector;\n let outStr;\n\n // Populates the county selector\n if(counties !== null)\n {\n selector = document.getElementById('counties');\n outStr = \"<option value=\\\"\\\" selected disabled hidden>Select</option>\";\n $.each(counties, function (index, county)\n {\n outStr += \"<option value='\" + county + \"'>\" + county + \"</option>\";\n });\n selector.innerHTML = outStr;\n }\n\n // Populates the crime selector\n if(crimes !== null)\n {\n selector = document.getElementById('crimes');\n outStr = \"<option value=\\\"\\\" selected disabled hidden>Select</option>\";\n $.each(crimes, function (index, crime)\n {\n outStr += \"<option value='\" + crime + \"'>\" + crime + \"</option>\";\n });\n selector.innerHTML = outStr;\n }\n}", "title": "" }, { "docid": "4328b666ec61732f8c183986ec15fb91", "score": "0.59200764", "text": "function Reposicionar (objeto, codigo){\r\n\tobjeto.selectedIndex = -1;\r\n\tfor (i=0;i<objeto.length;i++){\r\n\t\tif (codigo.indexOf(\",\"+objeto[i].value+\",\") != -1){\r\n\t\t\tobjeto[i].selected = true;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "0f130f5b5452d5cf86004e2a328539cc", "score": "0.59117824", "text": "function setSelectOptions(){\n\t\n\t\t// Initialize the options array for each type of selection\n\t\tfor ( var field in context.filterTypes )\n\t\t\tif ( context.filterTypes[ field ].populate ) context.filterTypes[ field ].options = [];\n\n\t\t// Scrape the cards in the list for the data to populate with\n\t\tfor ( var cardName in context.cards ){\n\t\t\tvar card = context.cards[ cardName ];\n\n\t\t\t// Check each possible filter field for each card in the list\n\t\t\tfor ( var field in context.filterTypes ){\n\t\t\t\tvar type = context.filterTypes[ field ];\n\t\t\t\tif ( type.populate && card[ field ] ){\n\n\t\t\t\t\t// Harvest each listed value for each card with the data type\n\t\t\t\t\tfor ( var entry = 0; entry < card[ field ].length; entry++ ){\n\n\t\t\t\t\t\t// But record each possible field value only once\n\t\t\t\t\t\tif ( type.options.indexOf( card[ field ][ entry ] ) < 0 )\n\t\t\t\t\t\t type.options.push( card[ field ][ entry ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the option entries to each of the selects\n\t\tfor ( var field in context.filterTypes ){\n\t\t\tif ( context.filterTypes[ field ].options && context.filterTypes[ field ].element ){\n\t\t\t\tvar options = context.filterTypes[ field ].options;\n\t\t\t\tvar content = \"\";\n\t\t\t\t\n\t\t\t\t// Sort them alphabetically for ease of use\n\t\t\t\toptions.sort();\n\t\t\t\t\n\t\t\t\t// Include a blank entry at the top of the list\n\t\t\t\toptions.unshift( \"\" );\n\t\t\t\t\n\t\t\t\t// Create a set of option elements and insert them\n\t\t\t\tvar value = context.filterTypes[ field ].element.value;\n\t\t\t\tfor ( var i = 0; i < options.length; i++ ){\n\t\t\t\t\tvar selected = options[ i ] == value ? \" selected\" : \"\";\n\t\t\t\t\tcontent += '<option value=\"' + options[ i ] + '\"' + selected + '>' + options[ i ] + '</option>';\t\n\t\t\t\t}\n\t\t\t\tcontext.filterTypes[ field ].element.innerHTML = content;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "50d608abfffdfc7b52a923bf1c862bf9", "score": "0.5906012", "text": "function drawItems() {\r\n let form = document.forms['itemFrom'],\r\n select = form.item;\r\n\r\n ITEMS.forEach((item) => {\r\n select.innerHTML += `<option value=\"${item.id}\">${item.name}</option>`;\r\n });\r\n}", "title": "" }, { "docid": "f58512c646d11ddc9ba62757a99d7871", "score": "0.5901535", "text": "function limpiar_campos(id_combo){\n\tif($('#'+id_combo).length >0){ // si existe si lo borra\n\t\t$('#'+id_combo).val('');\n\t\t$this = $('#'+id_combo);\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "b64b5b7cd92cb5c9bf24977dea8a943e", "score": "0.59014565", "text": "function atualizaComboEmpresaCadastro(){\n\tvar oPagina = new XMLHttpRequest();\n\n\twith(oPagina){\n\n\t\topen('GET', './src/CrudCadastro.php?funcao=comboCadastro');\n\n\t\tsend();\n\n\t\tonload = function(){\n\n\t\t\tvar oDados = JSON.parse(responseText);\n\n\n\t\t\tvar r = document.getElementById(\"cmbEmpresaSelecao\");\n\t\t\tvar optionr = document.createElement(\"option\");\n\t\t\toptionr.text = \"Todas...\";\n\t\t\tr.add(optionr);\n\n\t\t\tvar contador2 = document.getElementById(\"cmbEmpresaSelecao\").length;\n\n\t\t\tfor (i = 0; i <=contador2; i++) {\n\t\t\t\tvar combinho2 = document.getElementById(\"cmbEmpresaSelecao\");\t\n\t\t\t\tcombinho2.remove(combinho2.i);\n\t\t\t}\n\n\t\t\toptionr.text = \"Todas\";\n\t\t\toptionr.value = 0;\n\n\t\t\tr.add(optionr);\n\n\t\t\tfor (var i = 0; i<oDados.length; i++){\n\t\t\t\tvar r = document.getElementById(\"cmbEmpresaSelecao\");\n\t\t\t\tvar optionr = document.createElement(\"option\");\n\t\t\t\toptionr.text = oDados[i]['EMP_NOME_EMPRESA'];\n\t\t\t\toptionr.value = oDados[i]['EMP_COD'];\n\t\t\t\tr.add(optionr);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5be21d9c8eda36d36f5d0c1a222f98cf", "score": "0.5897979", "text": "typeSelect(itemTypes) {\n return (\n <div className=\"input-group mb-3\">\n <select\n id=\"selectItemTypes\"\n className=\"form-control\"\n onChange={(e) => this.handleTypeChange(e)}\n >\n <option value=\"\">Choose type</option>\n {\n itemTypes.map((name,index) => {\n return (\n <option key={index} value={name}>\n {name}\n </option>\n );\n })\n }\n </select>\n </div>\n );\n }", "title": "" }, { "docid": "5b0db40dfb9105da6f9fadfe7aa6f941", "score": "0.589521", "text": "cargartagselect(){\n\t\tapi.monedasAPI()\n\t\t.then(dato =>{ \n\n\t\t\tconst selector = document.querySelector(\"#criptomoneda\");\n\n\t\t\tfor (let [k, v] of Object.entries(dato.datos.Data)){\n\t\t\t\tlet opciones = document.createElement(\"option\");\n\t\t\t\topciones.value = v.Symbol;\n\t\t\t\topciones.appendChild(document.createTextNode(v.CoinName));\n\t\t\t\tselector.appendChild(opciones);\n\t\t}\n\n\t\t})\n\t}", "title": "" }, { "docid": "55ba06fe5f6b9e515d21e0b072e106d4", "score": "0.58904123", "text": "function init_form() {\n var selection = $('#planet_selection');\n for (var planet of planets) {\n $(\"<option>\" + planet.name + \"</option>\").appendTo(selection);\n }\n}", "title": "" }, { "docid": "03fc29db9e2afbd996d3d37627aa55d1", "score": "0.5889519", "text": "function GenerateInputSelectForShops(shopsIte,nameInput,labeltext)\n/*Genera un select con las las tiendas como opcion*/\n{\n\n var divFormGroup = document.createElement(\"div\");\n divFormGroup.className = \"form-group\";\n\n var labelInput = document.createElement(\"label\");\n labelInput.className = \"col-sm-3 control-label\";\n labelInput.setAttribute(\"for\",nameInput);\n labelInput.appendChild(document.createTextNode(labeltext));\n divFormGroup.appendChild(labelInput);\n\n var div = document.createElement(\"div\");\n div.className = \"col-sm-9\";\n divFormGroup.appendChild(div);\n\n var inputSelect = document.createElement(\"select\");\n inputSelect.className = \"form-control\";\n inputSelect.setAttribute(\"name\",nameInput);\n div.appendChild(inputSelect);\n\n var initOption = document.createElement(\"option\");\n initOption.setAttribute(\"value\",\"\");\n initOption.appendChild(document.createTextNode(\"\"));\n inputSelect.appendChild(initOption);\n \n var optStore = document.createElement(\"option\");\n optStore.setAttribute(\"value\",\"store\");\n optStore.appendChild(document.createTextNode(Store.nombre));\n inputSelect.appendChild(optStore);\n\n var item = shopsIte.next();\n while(!item.done){\n var opt = document.createElement(\"option\");\n opt.setAttribute(\"value\",item.value.cif);\n opt.appendChild(document.createTextNode(item.value.nombre));\n inputSelect.appendChild(opt);\n item = shopsIte.next();\n }\n\n return divFormGroup;\n}", "title": "" }, { "docid": "a34259808e75219dd97d987649c983ea", "score": "0.5887287", "text": "function Fill(puni,jedinica){\n let option=new Array();\n \n \n for(var i=0; i< jedinica.length; i++) {\n option[i]=document.createElement('option');\n option[i].text=jedinica[i];\n puni.add(option[i]);\n }\n}", "title": "" }, { "docid": "9045ab637c35578005889df29dc45ee6", "score": "0.58864886", "text": "function cambioCampo(campo){\n\tvar especie_rendimiento;\n\tvar especies = [];\n\t$.each(CUARTEL, function(k,v){\n\t\tif(v.campo == campo){\n\t\t\t$.each(SESION.variedad, function(ka,va){\n\t\t\t\tif(va.codigo == v.variedad){\n\t\t\t\t\t$.each(SESION.especie, function(kb,vb){\n\t\t\t\t\t\tif(va.especie == vb.codigo && especies.indexOf(vb.codigo) == -1){\n\t\t\t\t\t\t\tespecies.push(vb.codigo);\n\t\t\t\t\t\t\tespecie_rendimiento += \"<option value=\"+vb.codigo+\">\"+vb.especie+\"</option>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\t//$('#BoxEspecie').html(especie_rendimiento);\n\t})\n\tgetEspecie();\n}", "title": "" }, { "docid": "0d69c0041aeef05a630e409cc9fb6575", "score": "0.5886399", "text": "function populateForm() {\n\n //TODO: Add an <option> tag inside the form's select for each product]\n var selectElement = document.getElementById('items');\n for (var i in Product.allProducts) {\n var dropdownItem = document.createElement('option')\n dropdownItem.textContent = Product.allProducts[i].name;\n selectElement.appendChild(dropdownItem);\n document.getElementsByTagName('option')[i].setAttribute('value', Product.allProducts[i].name)\n }\n\n}", "title": "" }, { "docid": "b52d366c0d3e211593f2259ed14decec", "score": "0.5882061", "text": "function _updateSelectFields(){\n $(\"#buildingSelect\")[0].value = activeBuilding;\n _buildingChanged();\n $(\"#floorSelect\")[0].value = activeFloor;\n _floorChanged();\n $(\"#roomSelect\")[0].value = activeRoom;\n _roomChanged();\n }", "title": "" }, { "docid": "36f3681e41153998e15861dae0a86bba", "score": "0.5879899", "text": "function carregarCombo(comboId, data, text, value) {\r\n\r\n if (!verificaValor(text) || !verificaValor(value)) {\r\n alert(\"function carregarCombo: text e/ou value não foi definido.\");\r\n return;\r\n }\r\n\r\n for (var i in data) {\r\n var item = data[i];\r\n adicionaComboItem(comboId, item[text].trim(), item[value]);\r\n }\r\n}", "title": "" }, { "docid": "3b29897e44605cc048b2023e7dce3921", "score": "0.587748", "text": "function fillProducts(){\n var productSelectList = document.getElementById(\"description\");\n var option;\n for (var i=0; i < products.length; i++) {\n option = document.createElement(\"option\");\n option.text = products[i].descripcion;\n console.log(products[i].descripcion);\n productSelectList.add( option, option[i]);\n }\n //Asignamos un evento\n productSelectList.onchange = eventSelect;\n\n //Seleccionamos el primer elemento\n sel =\n document.getElementById(\"price\").value = products[productSelectList.selectedIndex].price;\n}", "title": "" }, { "docid": "a8a0cdbc34f9340bb5256af7c1f37a86", "score": "0.5870595", "text": "function seleccionarOid(){\n \n var cboMarcaAux = document.getElementById(\"cbMarcaAux\");\n var cboCanalAux = document.getElementById(\"cbCanalAux\");\n var cboMarca = document.getElementById(\"cbMarca\");\n var cboCanal = document.getElementById(\"cbCanal\");\n var optionMarca = document.createElement(\"OPTION\");\n var optionCanal = document.createElement(\"OPTION\");\n \n for(var i=0;i<cboMarcaAux.length;i++){\n if(i==0){\n optionCanal.value = i; \n }else{\n \n if(cboMarcaAux.item(i-1).value != cboMarcaAux.item(i).value){\n var optionMarca = document.createElement(\"OPTION\");\n cboMarca.options.add(optionMarca);\n optionMarca.innerText = cboMarcaAux.item(i).innerText;\n optionMarca.value = cboMarcaAux.item(i).value; \n }\n \n if(cboCanalAux.item(i-1).value != cboCanalAux.item(i).value){\n var optionCanal = document.createElement(\"OPTION\");\n cboCanal.options.add(optionCanal);\n optionCanal.innerText = cboCanalAux.item(i).innerText; \n optionCanal.value = cboCanalAux.item(i).value; \n } \n }\n }\n }", "title": "" }, { "docid": "c7ab9ecd07f3de222d678734d38f1b20", "score": "0.586829", "text": "function populateModal(){\n\t\tvar i;\n\t\t$(\"#month-dropdown\").empty();\n\t\tfor (i = 0; i < monthName.length; i++) {\n\t\t\t\t$(\"#month-dropdown\").append(\"<option value='\" + i + \"'>\" + monthName[i] + \"</option>\");\n\t\t}\n\t\t$(\"#month-dropdown\").val(g_Month(g_Switch));\n\t}", "title": "" } ]
4fd9afb3d6545e980657201b953f6eef
refreshes to myHubs page after deleting a hub
[ { "docid": "c1e2010bae6a359733423b66fd738a6a", "score": "0.80119354", "text": "function refreshAfterDelete(){\n window.location.href = '/myHubs/'\n}", "title": "" } ]
[ { "docid": "97c41d864baf90e489b535f871294135", "score": "0.73568356", "text": "function confirmDeleteHub(hub, owner){\n if(confirm(`Are you sure you want to delete ${hub}`)) {\n $.ajax(`/${owner}/${hub}/`, {\n type: 'DELETE',\n timeout: 60000,\n // setTimeout required because when attempting to refresh immediately this results in a key error\n success: setTimeout(refreshAfterDelete, 1000)\n });\n }\n\n\n}", "title": "" }, { "docid": "4307f1e8e4b29dbae4df3c5ec0099810", "score": "0.6277328", "text": "function deleteButton() {\n $('#js-delete-beachclean').on('click', function (event) {\n event.preventDefault();\n\n var uuid = window.location.pathname.split('/')[2];\n\n database.get(uuid)\n .then(function (beachclean) {\n return database.remove(beachclean);\n })\n // .then(function (result) {\n // return database.compact();\n // })\n .then(function () {\n document.location.href = '/';\n })\n .catch(console.log);\n });\n}", "title": "" }, { "docid": "c9e368c38b528185c35f8ea072760857", "score": "0.6194073", "text": "deleteHubConfirm(name){\n confirmAlert({\n title: 'Confirm to delete hub',\n message: 'Are you sure deleting this hub: ' + name,\n buttons: [\n {\n label: 'Yes',\n onClick: () => this.deleteHub(name)\n },\n {\n label: 'No',\n onClick: () => alert('delete hub canceled')\n }\n ]\n })\n }", "title": "" }, { "docid": "ecf486e06e49789a33174bf1f75a369d", "score": "0.614429", "text": "del() {\n\n\t\t\taxios.get(\"script.php?remove=\" + this.deleteNr).then((response) => {\n\t\t\t\n\t\t\t\tthis.objects = response.data.objects;\n\t\t\t});\n\n\t\t\tthis.displayConfirm = false;\n\t\t}", "title": "" }, { "docid": "00494d81febc997e4fe569fcc847eb54", "score": "0.6062251", "text": "deleteHub(name){\n console.log(\"working\")\n var hub = this.state.Hubs\n var file = this.state.file\n for(var i = 0;i < hub.length; i++){\n console.log(file)\n if(hub[i] === name){\n hub.splice(i,1)\n \n this.setState({Hubs: hub})\n console.log(this.state.Hubs)\n \n }\n if(file[i].includes(\"Hub :\"+name)){\n file.splice(i,1)\n this.setState({file: file})\n }\n };\n this.setState({log:this.state.log.concat([\"Hub :\"+name +\"was deleted\"])}) \n }", "title": "" }, { "docid": "05215fe3782f0fe4831745efa822d181", "score": "0.5896981", "text": "function removeList() {\n postData(base_url + \"/removeclient\", {\n number: document.getElementById(\"dropdown\").value,\n })\n .then((data) => {\n if (data.succcess === true) {\n location.reload();\n }\n })\n .catch((err) => {\n console.log(err);\n });\n}", "title": "" }, { "docid": "f4029fa7826c571d8b92019bf6739dbc", "score": "0.5896867", "text": "removeTrackday() {\n\t\t\tif (confirm('Är du säker på att du vill ta bort bandagen?')) {\n\t\t\t\tfetch('/api/removeTrackday', {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify({trackdayID: this.removeTrackdayID})\n\t\t\t\t})\n\t\t\t\t.then(res => res.status())\n\t\t\t\tthis.getAllData();\n\t\t\t\tthis.removeTrackdayID = 0;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "26da3795caae731b0b371751b300e88f", "score": "0.5896056", "text": "deleteMessage(event, message_id) {\n console.log(message_id);\n axios.delete(`http://localhost:3000/contact/${message_id}`)\n .then((result) => {\n alert('Successfully deleted the message');\n window.location.reload();\n }).catch((err) => {\n alert(err)\n });\n }", "title": "" }, { "docid": "b73eea4b626464c5be8ebb95b6bd3a12", "score": "0.58523077", "text": "function deleteClue (identifier) {\n\n //delete on the server\n $.ajax({\n \"url\": \"/edit/clues\",\n \"type\": \"delete\",\n \"data\": {\n\t\t\t\t\"huntName\": urlHuntName,\n\t\t\t\t\"adminKey\": urlUserKey,\n \"identifier\": identifier\n },\n \"success\": function (data) {\n\t\t\t\tif (data.success) {\n\t\t\t\t\t// check if the update clue button is still up\n\t\t\t\t\tif (editingClueNum !== undefined) {\n\t\t\t\t\t\t// if so, make it back to adding clues\n\t\t\t\t\t\t$(\"#add-clue-button\").css({\"display\": \"inline-block\"});\n\t\t\t\t\t\t$(\"#update-clue-button\").css({\"display\": \"none\"});\n\t\t\t\t\t\t$(\"#cancel-edit-button\").css({\"display\": \"none\"});\n\t\t\t\t\t\t$(\"#write-clue-desc\").val(\"\");\n\t\t\t\t\t\t$(\"#write-clue-ans\").val(\"\");\n\t\t\t\t\t\teditingClueNum = undefined;\n\t\t\t\t\t}\n\t\t\t\t\t// propagate changes to local\n\t\t\t\t\thuntData = data.huntData;\n loadPageInfo();\n\t\t\t\t\tloadClues();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"Error deleting clue!\");\n } \n }\n });\n }", "title": "" }, { "docid": "70ba4e1d4a6cee2e215da792b54cb472", "score": "0.58289427", "text": "delete() {\n // Query API to delete repo, this will trigger sadness in the dashboard too\n }", "title": "" }, { "docid": "7f52b4c4248e21e24e6cb44053851830", "score": "0.58263826", "text": "function delete_hunt(parentdiv){\n\n //presenceEntity Link of the user\n var user_div_id = $(parentdiv.parentElement).attr('id');\n var hunt_link = $(\"#\"+user_div_id+\" .hidden_plink\").val();\n\n $.ajax({\n type: 'DELETE',\n contentType: 'text/uri-list',\n crossDomain: true,\n beforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", \"Bearer \" + token);\n },\n url:hunt_link,\n\n success: function (response) {\n console.log(\"Huntgroup Deleted: \"+hunt_link);\n remove_hunt(parentdiv);\n },\n error: function(response) {\n console.log (\"Huntgroup delete unsuccessful :\"+response);\n $('#app-token-error').css(\"display\",\"block\");\n }\n });\n\n}", "title": "" }, { "docid": "9a59b4a99307992319844cf343bfbd5b", "score": "0.5798848", "text": "delete() {\n axios.get('/events/delete/'+this.props.obj._id)\n .then(console.log('Deleted'))\n .catch(error => console.log(error));\n window.location.reload();\n }", "title": "" }, { "docid": "765481a6e95613f082441745340d5406", "score": "0.5787521", "text": "function deleteSong() {\n // debugger\n let songId = parseInt(event.target.dataset.id)\n // console.log(songId)\n event.target.parentElement.remove()\n configObject = {\n method: 'DELETE'\n }\n fetch(`${BASE_URL}/songs/${songId}`, configObject)\n .then(resp => resp.json())\n .then(song => alert(song.message))\n // make it so a user does not have to refresh page, auto-refresh\n // this.location.reload()\n}", "title": "" }, { "docid": "0f503cf347adfa263a150c01f449be8f", "score": "0.5779879", "text": "function deleteStock(){\n // remove a stock from the graph\n $('.remove').on(\"click\", function(){\n \n // get the name of the symbol\n var symbol = $(this).parent().text().slice(0, -1);\n\n // send a delete query to the server\n socket.send(JSON.stringify({\n query : 'delete',\n body : symbol,\n date : new Date\n }))\n \n });\n }// end deleteStock", "title": "" }, { "docid": "f8b1c770dabb76f9f1ce014810208c33", "score": "0.5749408", "text": "handleDelete() {\n axios.delete('http://localhost:8080/movieTracker/delete/' + this.props.match.params.id)\n this.props.history.push(\"/\")\n alert('Account has been deleted')\n\n }", "title": "" }, { "docid": "b22b83234e3c72dff226e3ad722c3bf2", "score": "0.5746151", "text": "onDelete() {\n let meetupId = this.state.details.id;\n axios.delete(`http://localhost:3000/api/meetups/${meetupId}`)\n .then(response => {\n this.props.history.push('/');\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "19ea0c1335ab676ad87eb6595087fe3f", "score": "0.5734253", "text": "function personDeleteAll() {\n $.ajax({\n url: '/people',\n type: 'DELETE',\n success: function(result) {\n // Refresh site\n window.location.href = \"/people\";\n }\n });\n}", "title": "" }, { "docid": "a4c87a2d34d7728a58ef8025ddb88269", "score": "0.5697815", "text": "function deleteSaved() {\n console.log(\"Unsave Clicked!\")\n var savedArticle = $(this).data(\"id\");\n console.log(savedArticle);\n $(this)\n .parents(\".newsArticle\")\n .remove();\n $.ajax({\n method: \"PUT\",\n url: \"/api/unsave/\" + savedArticle,\n }).then(function (data) {\n if (!data.saved) {\n console.log(\"unsaved\")\n }\n });\n }", "title": "" }, { "docid": "7763d206bdf5b1a619b4be39dc45561d", "score": "0.56940097", "text": "delete() {\n personService.deletePerson(\n this.props.match.params.person_id,\n this.fornavn,\n this.etternavn,\n this.tlf,\n this.epost,\n () => {\n history.push('/persons');\n }\n );\n this.props.history.replace('/');\n }", "title": "" }, { "docid": "37d8391a9fd681afb06765fa8cd9924f", "score": "0.5679534", "text": "deattachHub(emitter) {\n this.emitters = this.emitters.splice(this.emitters.indexOf(emitter), 1);\n }", "title": "" }, { "docid": "eff8bda13ea8375423a32c1f605e6385", "score": "0.56762683", "text": "function remover() {\n var url = BASE_URL + '/surveys/' + item.id;\n deleteFromAPI(url, function() {\n // If successful, refresh the list\n self.refresh();\n });\n }", "title": "" }, { "docid": "861c7ce2dee17bb269ad66cad7545d74", "score": "0.5650545", "text": "function deleteData(){\n localStorage.removeItem(\"todoTasks\");\n message =\"Task removed from local storage.\" ;\n showMessage(message);\n setTimeout(function(){ location.reload(); }, 1000);\n}", "title": "" }, { "docid": "647af882e50d980745f80096f965bdb2", "score": "0.5648024", "text": "handleDelete(id){\n const request = new Request();\n const url = '/api/articles/' + id;\n request.delete(url).then(() => {\n window.location = '/articles'\n })\n }", "title": "" }, { "docid": "39b39f9818a576612155ca0e6a867368", "score": "0.56464505", "text": "async removeInfoFromStorage() {\n await browser.storage.sync.remove(this.articleId);\n this.articleGroup = null;\n this.articleMaxBid = null;\n this.articleAutoBid = false;\n console.debug(\"Biet-O-Matic: removeInfoFromStorage(%s) Browser sync storage cleared\", this.articleId);\n }", "title": "" }, { "docid": "14cccaf18227b7579a13ded31713e9b3", "score": "0.5646251", "text": "handleDelete() {\n var reportedStoriesRef = firebase.database().ref('reportedStories/');\n reportedStoriesRef.child(this.props.reportKey).remove();\n var storyRef = firebase.database().ref('/stories');\n storyRef.child(this.props.storyKey).remove();\n }", "title": "" }, { "docid": "7476bb11d26f4f3210c87286256883a9", "score": "0.56426924", "text": "goDeleteVehicle(vehicle) {\n PubSub.publish('openDialogDelete', vehicle.node);\n}", "title": "" }, { "docid": "ef58a2aba2c3d264762e53c46de4e5a9", "score": "0.56412077", "text": "handleDelete (studentId) {\n axios.delete(`/api/students/${studentId}`)\n .then(() => window.location.reload())\n }", "title": "" }, { "docid": "5562ac793da56c158e7dfdab2165ce3d", "score": "0.5635316", "text": "function removeTrack(button) {\n\tlet track_id = $(button).parent().find(\"input\").val();\n\t\n\t$.ajax({\n\t\t\"type\":\"GET\",\n\t\t\"url\" :encodeSessionId(\"/heaplay/removeTrack\")+\"?track_id=\"+track_id,\n\t\t\"success\": () => {\n\t\t\t$(button).parent().parent().remove();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "292cc039f0e13c553950800991b2a9b6", "score": "0.56318426", "text": "handleDelete(e) {\n fetch('/delete', {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n itemName: e.target.value\n })\n }).then(() => '', err => console.log(err));\n alert(`${e.target.value} has been DELETED!`)\n window.location.reload();\n }", "title": "" }, { "docid": "3256b3a01c77877779243d3a4b770827", "score": "0.56270534", "text": "function handleArticleDelete() {\n\n var articleToDelete = $(this).parents('.article-holder').data();\n\n $.ajax({\n method:'DELETE',\n url:'/api/headlines/' + articleToDelete._id\n }).then(function(data) {\n\n if(data.ok){\n\n initPage();\n\n }\n\n });\n }", "title": "" }, { "docid": "ee38b19ab7ade741424ae9707a302eaf", "score": "0.56214327", "text": "handleDelete (id) {\n $.ajax({\n url: `/api/v1/items/${id}`,\n type: 'DELETE',\n success: () => {\n this.removeItemClient(id);\n alert('your sin may be erased, but it will not be forgotten');\n }\n\n })\n}", "title": "" }, { "docid": "156e975fd15f64e2849a08c544279aaf", "score": "0.5604672", "text": "function deleteGraph(protograph,This){\n\t\tvar GraphView=This.module.view;\n\t\tvar graph=This.graph;\n\t\tvar data='data='+encodeURIComponent(JSON.stringify(protograph));\n\t\tjquery.ajax(This.master.database+'db_delete.php',{data:data,type:'POST',async:true,success:function(backpack){\n\t\t\tconsole.log(backpack);\n\t\t\t\n\t\t\tvar partialGraph={nodes:[],links:[]};\n\t\t\t\n\t\t\tfor(var i=0,len=backpack.nodes.length;i<len;i++){\n\t\t\t\tconsole.log(backpack.nodes[i]);\n\t\t\t\tif(graph.nodes[backpack.nodes[i].uuid]){\n\t\t\t\t\tgraph.nodes[backpack.nodes[i].uuid].remove();\n\t\t\t\t\tpartialGraph.nodes.push(backpack.nodes[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(var i=0,len=backpack.links.length;i<len;i++){\n\t\t\t\tconsole.log(graph.links);\n\t\t\t\tif(graph.links[backpack.links[i].uuid]){\n\t\t\t\t\tgraph.links[backpack.links[i].uuid].remove();\n\t\t\t\t}\n\t\t\t\tpartialGraph.links.push(backpack.links[i]);\n\t\t\t}\n\t\t\tGraphView.listen(\"remove\",partialGraph);\n\t\t}});\n\t}", "title": "" }, { "docid": "9b88df400304102b42c39bda7287836a", "score": "0.5599655", "text": "async function delSong() {\n setSpin(true);\n await model.deleteSong(artist, song);\n refresh(); // reload the page\n setSpin(false);\n }", "title": "" }, { "docid": "22cf93077fe2b5329b57cebee394f000", "score": "0.559873", "text": "function handleDelete(id)\n {\n if(deleteAxios === false)\n {\n history.push(\"/main/NoPermission\")\n }\n else\n {\n console.log(deleteAxios)\n //delete the member\n axios.delete(\"http://localhost:8000/routingToCinemaWS/deleteMember/\"+id)\n .then(resp=> console.log(resp))\n\n //delete the member's subscriptions\n axios.delete('http://localhost:8000/routingToCinemaWS/deleteSubscriptions/'+id)\n .then(resp=> console.log(resp))\n\n //reload the page because of the changes\n window.location.reload(false);\n }\n }", "title": "" }, { "docid": "c9e19b153e5cfeca1b5cbf3ead632980", "score": "0.558615", "text": "_handleButtonDelete()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOWBUILDER_REMOVE_OUTPUTPORT, {outputport: this.model, workflow: this._workflow, workflowjob: this._workflowJob});\n }", "title": "" }, { "docid": "1e2e61a09f9d5fcba433167ec9b58a3c", "score": "0.55858845", "text": "function clearTracks() {\n $.ajax({\n type: \"DELETE\",\n url: \"/clear_tracks/\" + songId,\n });\n}", "title": "" }, { "docid": "c4c736e9ff178381735b8142f0993f9d", "score": "0.55854297", "text": "function deleteSurvey() {\n // If we haven't saved the survey\n // just go back to the surveys views\n if (!$scope.survey.id) {\n $location.url('/settings/surveys');\n return;\n }\n\n Notify.confirmDelete('notify.form.delete_form_confirm').then(function () {\n FormEndpoint.delete({\n id: $scope.survey.id\n }).$promise.then(function () {\n Notify.notify('notify.form.destroy_form_success', { name: $scope.survey.name });\n $location.url('/settings/surveys');\n }, handleResponseErrors);\n });\n }", "title": "" }, { "docid": "b63f6806706eb28b62dfbdd71e8aef84", "score": "0.5572604", "text": "function handleDeleteSong(){\n $('.songs-page').on('click','button[name=\"delete\"]', function(){\n const id = $(this).prop(\"value\");\n deleteSong(id);\n location.reload();\n });\n}", "title": "" }, { "docid": "c4f75a1fe571ff335df081683272c551", "score": "0.556694", "text": "function personDelete(personId) {\n $.ajax({\n url: '/people/' + personId,\n type: 'DELETE',\n success: function(result) {\n // Refresh site\n window.location.href = \"/people\";\n }\n });\n}", "title": "" }, { "docid": "818355a61fb6584486584011fa3c633d", "score": "0.5561773", "text": "function deleteSkiAreasEvents(said,eid){\n $.ajax({\n url: '/ski-areas-events/' + said + '/' + eid,\n type: 'DELETE',\n success: function(result){\n window.location.reload(true);\n }\n })\n}", "title": "" }, { "docid": "c76eba2fef02d97c18ebe241dcd1abc7", "score": "0.55563605", "text": "function noteToBeDeleted(idForNote) {\n $.ajax({\n url: \"/notes/\" + idForNote,\n type: 'DELETE',\n }).then(function (data) {\n window.location.reload();\n })\n }", "title": "" }, { "docid": "6360508f6a78b699f0150577041da336", "score": "0.55512965", "text": "async function deleteNews(newsCode) {\n await firebase.database().ref('covid19Platform/news/' + newsCode + '/').remove()\n .then(() => {\n alert('Noticia eliminada exitosamente');\n window.location.reload();\n });\n}", "title": "" }, { "docid": "3dc7e5038966f908db9a6f959bb645a2", "score": "0.5535613", "text": "function delete_repo(button){\n\n let info_json = JSON.stringify({url: button.id.toString().substring(7)});\n\n let a = window.location.pathname+'/';\n\n $.ajax({\n url: a+'delete_repo',\n type: 'POST',\n data: info_json,\n cache: false,\n async: false,\n processData: false,\n contentType: false,\n success: function(msg){\n\n if (msg.status){\n alert(\"Delete Success\");\n }\n window.location.reload();\n }\n });\n}", "title": "" }, { "docid": "07f29f2a2db426f72358f0dcea4cd3ad", "score": "0.5533693", "text": "function fncDeleteStorage(sid){\n\n let answer = confirm(\"Silmek istediğinize emin misiniz?\")\n if(answer){\n $.ajax({\n url:\"./storage/delete/\"+sid,\n type:\"delete\",\n dataType: 'text',\n success: function (data){\n console.log(typeof data)\n if( data != \"0\" ){\n alert(\"Silme İşlemi Başarılı!\")\n formReset()\n window.location.reload();\n }else {\n alert(\"Silme sırasında bir hata oluştu.\")\n }\n },\n error: function (err){\n console.log(err)\n }\n })\n }\n\n}", "title": "" }, { "docid": "6e74e77475f49464e0b43767342f228e", "score": "0.5530742", "text": "destroy (req, res) {\n Checklists.remove(`$_id: {req.params.id}`, (err) => {\n if (err) throw err;\n console.log('checklist deleted')\n });\n }", "title": "" }, { "docid": "e33a3f86db8dfe99a02a3f13fb58b1a3", "score": "0.55239654", "text": "function DeleteSensor(){\n\n if(!window.confirm(document.getElementById(\"hidMsgConfirmDelete\").value))\n return;\n \n //Prepare call url\n var idComboProcess = parseInt($(\"#cmbWorkflows\").val());\n var sUrl = _sensorEdit_AjaxGatewayUrl \n + \"?action=\" + _sensorEdit_AjaxActionCode \n + \"&idWorkflow=\" + idComboProcess\n + \"&op=delete\";\n\n //All sensor object members are atached to the url\n var oSensorToDelete = GetSelectedSensorCopy();\n jQuery.each(oSensorToDelete, function(keyName, keyValue) {\n sUrl += \"&\" + keyName + \"=\" + keyValue;\n });\n \n callAjaxMethod(sUrl, DeleteSensor_CallBack);\n}", "title": "" }, { "docid": "ed19d4552941278e85814c5575eb2b9c", "score": "0.5522447", "text": "confirmDeleteSubstance () {\n const removeBtn = browser.element(`#removeBtn`);\n waitForNav(function () {\n removeBtn.click();\n });\n }", "title": "" }, { "docid": "6ec9ea88dc8cda8071d4fe1f6c9cde33", "score": "0.5522356", "text": "function handleClear() {\n $.get(\"api/article/clear\").then(function () {\n location.reload();\n });\n }", "title": "" }, { "docid": "d0fdc9c0f5b01bbe77f112bd59609875", "score": "0.5518088", "text": "function deleteSavedArticle(objectToDelete) {\n console.log(objectToDelete);\n $.ajax({\n url: \"/savedArticle\",\n data: JSON.stringify(objectToDelete),\n type: \"DELETE\",\n dataType: \"json\",\n contentType: \"application/json\"\n }).then(function (data) {\n console.log(data)\n window.location.reload();\n }).fail(function (err) {\n if (err) throw err;\n console.log(err);\n res.send(err);\n });;\n }", "title": "" }, { "docid": "3a7de0abb9653f63036842e566afc1eb", "score": "0.5516648", "text": "function handleDelete() {\n \"use strict\";\n id = localStorage.getItem(\"datetime\"); \n if (confirm(\"Are you sure you want to delete these match stats?\")) {\n if (id != null) {\n firebase.database().ref('/Games/' + id).set(null).then(function (res) {\n window.location = \"/teamstats.html\";\n });\n } else {\n alert('invalid id');\n }\n }\n}", "title": "" }, { "docid": "76eea29285109cc8b8cd4a158d6e57d7", "score": "0.5513101", "text": "function deleteShelter(){\n\n $http.delete(\"webapi/shelter/delete/\" + site)\n .then(function(response){\n //Handle the response\n if(response.status === 200){\n //hide everything\n hideAllOptions();\n //show the success message\n $scope.successMessage = true;\n }else{\n hideAllOptions();\n $scope.nonSuccessMessage = true;\n }\n });\n }", "title": "" }, { "docid": "91661df38a32effa7bc749f7992be5dd", "score": "0.55103374", "text": "async function Removetrack(id,trackurl,turi)\r\n {\r\n console.log(id,trackurl,turi)\r\n\r\n try{\r\n var result = await fetch(trackurl, {\r\n method: 'DELETE',\r\n headers: {\"Content-Type\" :\"json\",\r\n 'Authorization' : 'Bearer ' + token},\r\n body:JSON.stringify({\r\n \"tracks\": [\r\n {\r\n \"uri\": turi,\r\n },\r\n ]\r\n })\r\n \r\n });\r\n var data = await result.json();\r\n document.getElementById(id).parentElement.remove()\r\n }\r\n catch(err)\r\n {\r\n console.log(err);\r\n }\r\n }", "title": "" }, { "docid": "f0f348fa636828d11fdc0585302f3353", "score": "0.54951894", "text": "handleLogout() {\n document.title = \"Online Chat Room\";\n location.reload();\n }", "title": "" }, { "docid": "060ad826376d5e82c696ff5ca7d17992", "score": "0.5486847", "text": "function disconnectHandler() {\n statusText.textContent += '\\nHub disconnected.';\n $('#reconnectButton').prop(\"disabled\",false);\n}", "title": "" }, { "docid": "6e1696d6941569c46b3bcf54ceef598c", "score": "0.54857254", "text": "function deleteBP(bId, pId, router) {\n Swal.fire({\n title: 'Estas Seguro?',\n text: \"Deseas eliminar los Parametros de Bodega!\",\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n cancelButtonText: 'Cancelar',\n confirmButtonText: 'Si, Eliminar!'\n }).then((result) => {\n if (result.isConfirmed) {\n $.ajax({\n type: \"POST\",\n url: router,\n data: { 'bId': bId, 'pId': pId },\n success: function (data) {\n if (data) {\n location.reload();\n Swal.fire(\n 'Eliminado!',\n 'Se han eliminado los Parametros de Bodegas.',\n 'success'\n )\n } else {\n Swal.fire({\n icon: 'error',\n title: 'No se puede Eliminar',\n text: 'Este Parametro de Bodega tiene Movimientos!',\n })\n }\n }\n })\n }\n })\n}", "title": "" }, { "docid": "21ee09155ca1b3c692f2fcded14da31c", "score": "0.54838896", "text": "'click #delete'(event, instance) {\n Meteor.call('deletePrimary', this._id, function(err, response){\n if(err){\n sweetAlert('404 error.')\n }\n console.log('response', response)\n\n })\n \t\n }", "title": "" }, { "docid": "b516767ee86ea79439840ec3372a59fa", "score": "0.5483259", "text": "function deleteSensor(id) {\n\t$.ajax({\n\t\ttype : 'DELETE',\n\t\turl : PROJECT_NAME + '/rest/sensor/' + $('#groupId').val() + '/' + id,\n\t\theaders : {\n\t\t\t'X-Token' : $.cookie('EnoToken')\n\t\t},\n\t\tstatusCode : {\n\t\t\t401 : function() {\n\t\t\t\twindow.location = \"index.html\";\n\t\t\t},\n\t\t\t500 : function() {\n\t\t\t\twindow.location = \"index.html\";\n\t\t\t},\n\t\t},\n\t\tsuccess : function(data, status, response) {\n\t\t\tshowAlert('#alertSensorSuccess');\n\t\t\tgetSensorsFromId(); // reload the group's sensors\n\t\t},\n\t\terror : function(response, status, error) {\n\t\t\tshowAlert('#alertSensorError');\n\t\t},\n\t});\n}", "title": "" }, { "docid": "129c8463c76d302e521a98834ebcce65", "score": "0.5477343", "text": "function deleteDatabase() {\n // delete the db.\n indexedDB.deleteDatabase(\"tododb\");\n renderFeeds(\"tododb is deleted.\",1)\n // console.log(\"'todos' database Deleted.\");\n location.reload(true);\n}", "title": "" }, { "docid": "d52e49be7f6404d5df5a9c555df5b331", "score": "0.5475397", "text": "async handleDelete() {\n const postId = this.props.match.params.postId;\n await this.props.sendDeleteToAPI(postId);\n\n this.props.history.push('/');\n }", "title": "" }, { "docid": "331750779fdda234d5c8deb366ddf383", "score": "0.5468014", "text": "deleteEmail(e) {\n e.preventDefault()\n fetch(`http://localhost:3000/sent_emails/${this.id}`, {\n method: 'DELETE'\n }).then(res => res.json())\n .then(data => {\n document.querySelector(`#sent-email-${this.id}`).remove()\n })\n }", "title": "" }, { "docid": "c14b558eff125e05dd942640bba1d38f", "score": "0.54674107", "text": "destroy() {\n localStorage.removeItem('simpleAdminApp');\n }", "title": "" }, { "docid": "120fac9052b77621b5e50cda114c1a61", "score": "0.54668564", "text": "async function handleDelete() {\n try {\n await axios.delete(`/api/users/${userId}`, {\n headers: { Authorization: `Bearer ${token}` }\n })\n localStorage.clear()\n history.push('/')\n location.reload()\n } catch (err) {\n console.log(err.response.data)\n }\n }", "title": "" }, { "docid": "e1f7c220d8d6b51c0360033d136ec823", "score": "0.54607713", "text": "async onUnload() {\n if (new RegExp(getApp().globalData.cardHostName + '/(list|add|detail)').test(this.data.src)) {\n await getApp().getPatients({ reload: true })\n }\n }", "title": "" }, { "docid": "fd0dcc587650f89b713d0b66eab6eed2", "score": "0.5454668", "text": "function unSelectHubs() {\n const hubs = getHubs();\n Object.values(hubs).forEach(hub => {\n store.dispatch(hubsState.actions.unSelectHub({\n hubId: hub.id\n }));\n stopPollingById(hub.id);\n });\n}", "title": "" }, { "docid": "cd25e21ca13c7e3bea1398dcd2545e50", "score": "0.5445211", "text": "function deletePushDevice(registrationId, signOut) {\n $.ajax({\n url: API + '/push_devices',\n type: 'DELETE',\n dataType: 'json',\n data: {token: registrationId}\n })\n .always(function(resp) {\n if (signOut) $.auth.signOut();\n });\n}", "title": "" }, { "docid": "24df07a39fe79658a5d6f7010b6fbcab", "score": "0.5444189", "text": "function _deleteSubmission() {\r\n \r\n if (vm.currentSubmissionID != undefined) {\r\n restApi.deleteSubmission(vm.currentSubmissionID)\r\n .success(function (data, status, headers, config) {\r\n _getUserSubmissions(currentUserID);\r\n \r\n /*vm.submissionlist.forEach(function (submission, index) {\r\n if (submission.submissionID == vm.currentSubmissionID) {\r\n vm.submissionlist.splice(index, 1);\r\n }\r\n });\r\n if(data != null || data != undefined || data != \"\")\r\n vm.submissionlist.push(data);*/\r\n })\r\n .error(function (data, status, headers, config) {\r\n vm.toggleModal(\"error\");\r\n \r\n });\r\n }\r\n }", "title": "" }, { "docid": "ddaecff8adc31f21c8b1a88bdbbf811a", "score": "0.5442428", "text": "function deletewidget(id) {\n idDelete = {\n id: id\n }\n $.ajax({ // Jquery request\n url: \"http://localhost:8080/deleteWidget\",\n data: idDelete,\n type: \"POST\",\n dataType: \"json\",\n sucess: function() {\n return;\n }\n })\n refresh();\n}", "title": "" }, { "docid": "7cd47d5baf4881702cdbf4f13055e9a4", "score": "0.5436972", "text": "'click #delete'(event, instance) {\n \tPrimary.remove(this._id)\n }", "title": "" }, { "docid": "736f930af4fe9ec64dc426bc5233b512", "score": "0.5435599", "text": "function del() {\n if ($$('datos_pro').isVisible()) {\n if (!$$(\"datos_pro\").getSelectedId()) {\n webix.message(\"Producto no seleccionado\");\n return;\n }\n webix.confirm(\"Eliminar producto seleccionado?\", \"confirm-warning\").then(function () {\n ipcRenderer.on('delete_products_reply', (event, arg) => {\n });\n var var_delete = {\n cod_pro: $$(\"datos_pro\").getSelectedItem().cod_pro\n }\n $$(\"datos_producto\").remove($$(\"datos_pro\").getSelectedId());\n ipcRenderer.send('delete_products', var_delete)\n });\n }\n else {\n if ($$('datos_cli').isVisible()) {\n if (!$$(\"datos_cli\").getSelectedId()) {\n webix.message(\"Cliente no seleccionado\");\n return;\n }\n webix.confirm(\"Eliminar cliente seleccionado?\", \"confirm-warning\").then(function () {\n ipcRenderer.on('delete_clients_reply', (event, arg) => {\n });\n var var_delete = {\n id: $$(\"datos_cli\").getSelectedItem().id\n }\n $$(\"datos_cliente\").remove($$(\"datos_cli\").getSelectedId());\n ipcRenderer.send('delete_clients', var_delete)\n });\n }\n }\n}", "title": "" }, { "docid": "d914770f7af7b52d90426b09a5b52982", "score": "0.54340625", "text": "handleDeleteViewsite(event) {\r\n // Prepare HTTP API request data\r\n let requestData = {};\r\n requestData.viewsiteId = event._id;\r\n // Send request to delete Viewsite\r\n this.manageViewsiteService.deleteViewsite(requestData)\r\n .then((results) => {\r\n // Afterwards, update Global Viewsite state to reflect changes\r\n this.handleSetGlobalState(results.data, \"viewsites\");\r\n },\r\n (error) => {\r\n // Handle errors\r\n this.setState({\r\n viewsiteError: error.response.data\r\n });\r\n });\r\n }", "title": "" }, { "docid": "d181a00ceede897226e049fba25b5bc8", "score": "0.5430909", "text": "function deleteData() {\n localStorage.clear();\n location.reload();\n}", "title": "" }, { "docid": "9e13974eb6505dd8710b2a6d09f712eb", "score": "0.54264367", "text": "function deleteFriend(handle) {\n // use axios to send a DELETE request to the server\n axios.delete(`/api/friends/${handle}`)\n // then once the server responds\n .finally(res => {\n // use the update friends function to refresh the page with latest data\n updateFriends();\n })\n }", "title": "" }, { "docid": "1733a83593d35dfba950e4fb96619add", "score": "0.5422003", "text": "_popQueue() {\n fetch('http://kevinpi.ddns.net/clinics/' + this.props.clinic_id + '/patients', {\n method: 'DELETE',\n })\n .then((response) => {\n if (response.error) {\n console.warn('Error!', response.error);\n } else {\n this.props.onRefresh();\n }\n })\n .catch((error) => {\n console.warn('Error: ', error);\n });\n }", "title": "" }, { "docid": "61893441c20a76406c8b414b70869328", "score": "0.541889", "text": "deleteList(){\n fetch(`http://localhost:3000/lists/${this.id}`, {\n method: 'DELETE'\n })\n .then(() => {\n document.getElementById(`${this.id}`).parentNode.removeChild(document.getElementById(`${this.id}`))\n })\n }", "title": "" }, { "docid": "ab83cfa9f43b6be004eb3f3071456ab2", "score": "0.5416896", "text": "function path() {\n return \"/admin/notifications/removeChannel\";\n}", "title": "" }, { "docid": "eb35bccafbb52820ed1182da7ef0d438", "score": "0.541623", "text": "async delete() {\n await this._send(\"delete\");\n }", "title": "" }, { "docid": "1d7d55e43947bc13f5e25b2fde6d07ca", "score": "0.54096526", "text": "remove() {\n this.splits.forEach(split => {\n split.remove();\n });\n\n if (this.transfer && !this.transfer._data._deleted) {\n this.transfer._data._deleted = true;\n\n this.transfer._emitChange();\n }\n\n if (!this._data._deleted) {\n this._data._deleted = true;\n\n this._emitChange();\n }\n }", "title": "" }, { "docid": "b62f5a165522640b06732b408d433600", "score": "0.54088736", "text": "profileDeleteClick() {\n\t\tlocalStorage.removeItem(this.state.currentSelectedProfile);\n\t\tthis.profilesHaveChanged();\n\t}", "title": "" }, { "docid": "d853bebe7062e75cab1fc35030d15ba2", "score": "0.54078645", "text": "_deleted() {\n this.trigger('messages:delete');\n }", "title": "" }, { "docid": "d45eb8674bae975ff784d311b0327879", "score": "0.5406101", "text": "function deleteGist() {\n function onRemove(gist) {\n doReset();\n clearGist();\n updateGists();\n }\n selectedGist.remove({\n success: onRemove,\n error: onDeleteGistError\n });\n}", "title": "" }, { "docid": "1969a78bfeec01964629eaccf0275af1", "score": "0.54055005", "text": "function _deleteContributor() {\n contributorRestService.remove(_contributorToDelete.id, function() {\n vm.contributors.splice(_contributorToDelete.index,1); // Remove the element from the array.\n messageService.showSuccessMessage('application.contributor.register.message.successDeletion');\n });\n }", "title": "" }, { "docid": "7574aaca58911a3ee834c624b8fd7feb", "score": "0.5404134", "text": "signOut() {\n mgr.signoutRedirect().then(function(resp) {\n console.log('signed out', resp)\n // reset visited views and cached views\n // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485\n store.dispatch('tagsView/delAllViews', null, { root: true })\n }).catch(function(err) {\n console.log(err)\n })\n }", "title": "" }, { "docid": "e6ce835bc802def5258002e63bbbc5da", "score": "0.5399262", "text": "function deleteHistory() {\n if (confirm('Are you sure you want to delete calculation history?')) {\n $.ajax({\n type: 'DELETE',\n url: '/problems'\n }).then(function (response) {\n console.log(response);\n getEquations();\n }).catch(function (err) {\n alert(err, 'deleteAll');\n })\n }\n}", "title": "" }, { "docid": "48c0af02a4cb439bdd17c04d9e5ebbe6", "score": "0.5398253", "text": "removeCategory(category) {\n this.id = category.cat_id;\n $('#category-modal').modal('hide');\n axios.delete(sglabUrl.category + this.id)\n .then((response) => {\n alert('Deleted successfully');\n window.location.href = 'category.html'\n })\n }", "title": "" }, { "docid": "4f87e8d2e87eeb19ff84c50e483114b7", "score": "0.5394312", "text": "function removeEdge() {\n try {\n edges.remove({ id: document.getElementById(\"edge-id\").value });\n console.log(\"Arista de id \" + document.getElementById(\"edge-id\").value + \" eliminada\");\n } catch (err) {\n alert(err);\n }\n}", "title": "" }, { "docid": "48bfe6f9eb79bad20ea984a5e31e7eea", "score": "0.53929734", "text": "eliminarFactura(codigo_factura){\n\n axios.delete('http://localhost:3000/Factura/'+codigo_factura).then( resultado => {\n alert(resultado.data);\n this.listarFacturas();\n });\n\n }", "title": "" }, { "docid": "a54fbebd93210e2ec21bcbf4a8b97601", "score": "0.5392679", "text": "async deleteDrive({view,request,session,response}){\n if (request.ajax()){\n const id = request.input('id')\n const driverinfo = await Driverinfo.find(id);\n await driverinfo.delete();\n\n response.send({\n status: 'success'\n })\n }else{\n return 'Bad request Type...';\n }\n\n }", "title": "" }, { "docid": "a5da19a07a06b1160c45e8adcdbd2cea", "score": "0.53878796", "text": "function borrarPublicacion(e){\n e.preventDefault();\n if (e.target.parentNode.classList.contains(\"borrar\")){\n const id = e.target.parentNode.dataset.id;\n if(confirm(\"Esta seguro?\")){\n http.delete(`http://localhost:3000/posts/${id}`)\n .then(datos => {\n ui.mostrarAlerta(\"Publicación borrada\", \"alert alert-primary\");\n traerPublicaciones();\n })\n .catch(err => console.log(err));\n }\n }\n}", "title": "" }, { "docid": "8154666c69b287912d64f0432d7d9cd4", "score": "0.53851795", "text": "function handleDeleteGist() {\n if (selectedGist != null) {\n w2confirm(\"Do you really want to delete this Gist?\")\n .yes(function() {\n deleteGist();\n });\n }\n}", "title": "" }, { "docid": "9fbdf4a29d4efcb87cb1e570a14947ec", "score": "0.5385079", "text": "deleteToken () {\n this.commit('removeToken')\n this.commit('unsetAuthUser')\n router.push({ name: 'home' })\n }", "title": "" }, { "docid": "02a178bf3eafc9387ce76dd082cc47ce", "score": "0.5383402", "text": "function goToDelete(id){\n displayChange('deleteDiv', 'contactSearchDiv');\n doDelete(id);\n }", "title": "" }, { "docid": "d5a96248ba33edff7d83560aaa4967f1", "score": "0.53813916", "text": "function deleteLastItem(){\n\t$.ajax(\"http://localhost:3000/items\", {\n\t\tmethod: \"DELETE\",\n success: refresh,\n error: handleResponseError\n });\t\t\n}", "title": "" }, { "docid": "9eb4b4fc91a5334862eb15efe6b38f35", "score": "0.5377443", "text": "function del_state_2 () {\n\tvar bangkey = dom_sub_actions.querySelector(\"input\").value ;\n\tstable = false ;\n\tstorage_get_key(\"bangs\").then(bangs => {\n\t\tvar ind = bangs.findIndex(bang => bang[BANG] == bangkey) ;\n\t\tif (ind == -1) {\n\t\t\tdom_err_msgs.textContent = \"bang not found\" ;\n\t\t\treturn ;\n\t\t}\n\t\tvar del_bangs = bangs.filter(bang => bang[BANG] != bangkey) ;\n\t\tstorage.set({ bangs: del_bangs, modified: true })\n\t\t.then(() => {\n\t\t\tdom_modified.textContent = \"yes\" ;\n\t\t\tdom_sub_actions.textContent = \"success delete bang\" ;\n\t\t\tdom_err_msgs.textContent = \"\" ;\n\t\t\tredraw_bangs(del_bangs);\n\t\t});\n\t})\n\t.finally(() => stable = true);\n}", "title": "" }, { "docid": "02da1d5b18b9d6ce2f3c1f283418d552", "score": "0.53745097", "text": "deletePlugin() {\n const { item } = this.state;\n const { dialog } = remote;\n const mainWindow = remote.getCurrentWindow();\n\n const choice = dialog.showMessageBox(mainWindow, {\n type: \"question\",\n buttons: [\"Yes\", \"No\"],\n title: \"Plugin would be deleted\",\n message: \"Are you sure you want to delete this plugin ?\"\n });\n\n if (choice === 0) {\n if (fs.existsSync(item.path)) {\n fs.removeSync(item.path);\n\n dialog.showMessageBox(\n mainWindow,\n {\n type: \"info\",\n message:\n \"Plugin successfully deleted, Press OK to reload Schemator!\",\n buttons: [\"OK\"]\n },\n response => {\n if (response === 0) {\n mainWindow.reload();\n }\n }\n );\n } else {\n dialog.showMessageBox(mainWindow, {\n type: \"info\",\n message: \"Plugin doesn't exists !\",\n buttons: [\"OK\"]\n });\n }\n }\n }", "title": "" }, { "docid": "2b7871006f77069c77c452b9d8da6f39", "score": "0.5372565", "text": "DeleteAlert(){\n if(this.articleNew.length > 0){\n this.alert.remove();\n }\n }", "title": "" }, { "docid": "c8fc9fa9a980054f5ecc4328f6f8fc75", "score": "0.53707314", "text": "function gt_network_config_button_delete() {\n var connection = get_value('w-connections');\n\n // Raise an 'are you sure?' question\n if (confirm('Are you sure you wish to delete ' + connection[0])) {\n send_gt('nm/connection/' + connection[0],\n function(results) {\n if ('error' in results) {\n alert(results['error']);\n } else {\n if ('alert' in results) {\n alert(results.alert);\n }\n gt_config_button_done();\n }\n },\n null,\n 'delete');\n }\n}", "title": "" }, { "docid": "35996e72223771548b9dee3d7aef1eb9", "score": "0.5369492", "text": "static async deleteMyStory(evt){\n const storyToDelete = evt.target.closest('li')\n let token = currentUser.loginToken\n await axios({\n url: `${BASE_URL}/stories/${storyToDelete.id}`,\n method: \"DELETE\",\n params: { token },\n });\n //follows the same process as remove from favorites to remove story from currentUser\n let idx;\n for (idx = 0; idx < currentUser.ownStories.length; idx++){\n if(currentUser.ownStories[idx].storyId === storyToDelete.id){\n break;\n }\n }\n currentUser.ownStories.splice(idx, 1)\n currentUser.favorites = currentUser.favorites.filter((story)=>{\n return story.storyId !== storyToDelete.id;\n })\n storyToDelete.remove(); //removes the actual story from the DOM\n //Below logs in again to reset the whole page\n currentUser = await User.loginViaStoredCredentials(token, currentUser.username);\n }", "title": "" }, { "docid": "fbc70e20b14f76e48cbf88097b17e1b9", "score": "0.5366397", "text": "removeResearchPaper(event){\n event.preventDefault()\n ResearchPaperService.removeResearchPaper(this.state.subID)\n .then(res => {\n if(res.status === 200){\n toast.error(\"Research Paper Submission Removed\",options)\n setTimeout(()=>{this.props.history.push(\"/researchView\")},3000)\n }else{\n toast.warning(\"Something went wrong!!,Try again.\",options)\n }\n })\n }", "title": "" }, { "docid": "45877cd20afc21733975e4a706f11817", "score": "0.5365536", "text": "@boundMethod\n async onDismiss() {\n this.setState({'dismissing': true});\n\n try {\n await this.context.request({\n path: `/group/${this.state.groupUuid}`,\n method: \"delete\",\n });\n } catch (error) {}\n\n // Route to GroupList\n this.setState({\n 'redirect': '/',\n 'push': false,\n });\n }", "title": "" }, { "docid": "083a8da019162aae7e13ab91d21b0f10", "score": "0.53600854", "text": "function deleteProfile(username)\n{\n var formData = {}; //Init formData\n\n formData['username'] = sessionStorage.getItem('username');\n formData['pass'] = sessionStorage.getItem('pass');\n //AJAX API call to delete the desired connection.\n $.ajax({\n url:'/user/delete/connection',\n type: 'DELETE',\n data: {\"username\" : formData['username'], \"pass\" : formData['pass'], \"connect_user\": username},\n success: function() {\n location.reload();\n }\n });\n\n}", "title": "" } ]
44a252be45eb4cc0e028dfef3c039ca7
ajax retrives data based off of the userinput. User input can be either a string or a number
[ { "docid": "88dab1a69df9b57e11dcb5203adc062d", "score": "0.64574105", "text": "function getPokemonData(userInput, callback){\n\tlet userSelection = `${POKEMON_URL}/pokemon/${userInput}`;\n\tlet typeA;\n\tlet typeB;\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: userSelection,\n\t\tdataType: \"JSON\",\n\t\tsuccess: function(result) {\n\t\t\tdisplayPokemonData(result);\n\t\t},\n\t\t// success: displayPokemonData(result),\n\t\terror: function(XMLHttpRequest, textStatus, errorThrown) {\n \t\talert(\"Sorry that's an invalid search or the search has timed out.\");\n \t}\n \t})\n}", "title": "" } ]
[ { "docid": "4b4fdb81862a655aa1321c37504c8b42", "score": "0.6309134", "text": "function getData () {\n\t// console.log(\"function: getData\");\n\t// cleaar out display section\n\tfact.style.display = \"none\";\n\tfactText.innerHTML = \"\";\n\t// get the integer\n\tconst myInteger = parseInt(integer.value);\n\t// WRITE FUNCTION TO CHECK FOR NaN\n\t// FIRST TEST CASE: User enters NaN\n\t// SECOND TEST CASE: User backspaces out entire number\n\t// (second test case: error is invisible to user)\n\t// console.log(\"myInteger is: \" + myInteger);\n\tif (myInteger != \"\") {\n\t\t//make a request via AJAX with myInteger\n\t\tlet url = \"http://numbersapi.com/\" + myInteger;\n\t\t// console.log(\"url is: \" + url);\n\t\t// create AJAX object\n\t\tlet xhr = new XMLHttpRequest();\n\t\t// set up a response handler\n\t\txhr.addEventListener(\"load\", responseReceivedHandler);\n\t\t// open the connection\n\t\txhr.open('GET', url);\n\t\t// send the data\n\t\txhr.send();\n\t}//end if\n}//end getData", "title": "" }, { "docid": "715995e04827adbf6c02e0206fcfe30c", "score": "0.6167239", "text": "function ajaxPanNumbers(){\r\n\t\r\n\t\tvar custName = $(\"#customerName01\").val();\t\r\n\t\t\r\n\t\tif(custName != \"walk_in\")\r\n\t\t{\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype:'GET',\r\n\t\t\t\turl:'tin_Number.htm',\r\n\t\t\t\tdata:{num:custName},\r\n\t\t\t\tsuccess:function(data){\t\t\t\t\t\r\n\t\t\t\t\t$(\"#fpan_Number\").val(data);\r\n\t\t\t\t\t\r\n\t\t\t\t},\r\n\t\t\t\terror:function(xmlHttpRequest, textStatus, errorThrown){\r\n\t\t\t\t\tif(xmlHttpRequest.readyState=0 || xmlHttpRequest.status == 0)\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}else\r\n\t\t\t{\r\n\t\t\t$(\"#fpan_Number\").val('');\r\n\t\t\t}\r\n\t}", "title": "" }, { "docid": "d4d45b434aab2bc9ff2a6ec2cd1cdcdc", "score": "0.61415017", "text": "function makeRequest(){\n\n city = userinput.value();\n url = api+city+units+apikey;\n//loads url(api), city, units(temp) and apikey;\n loadJSON(url, getData);\n\n}", "title": "" }, { "docid": "75f0c6e162e72c8f5a5586d210401293", "score": "0.61343247", "text": "function handleUserInput(code, date) {\n if (code >= 0 && date !== undefined) {\n //use function that uses ajax both parameters\n getCrimeDataDateAndCode(date, code);\n }\n //one or the other is valid. if date is valid do ajax with date\n else if (date !== undefined) {\n getCrimeDataDate(date);\n }\n //if crime code is valid, do ajax with crime code\n else if (code > 0) {\n getCrimeDataCrime(code);\n }\n //else alert error\n else {\n alert(\"Error\");\n }\n}", "title": "" }, { "docid": "143cd4257231a10ec4fcbabb974f80fa", "score": "0.6123097", "text": "function getQuestions (category, difficulty){\n $.ajax({\n url: `https://opentdb.com/api.php?/search`,\n data:{amount:1, category: category, difficulty: difficulty},\n type: 'GET',\n datatype: 'json',\n success: function(data){\n output(data.results[0]);\n }\n });\n}", "title": "" }, { "docid": "eb033f58c37b661169aedc1f408ba089", "score": "0.611248", "text": "function Get(input)\n{\n\tjQuery.extend({\n\t\tGetUser: function(type) \n\t\t{\t\n\t\t\tvar result = null;\n\t\t\t$.ajax({\n\t\t\tmethod: \"POST\",\n\t\t\turl: \"online.php\",\n\t\t\tasync : false,\n\t\t\tdata: { user_type: type },\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(data) {\n\t\t result = data;\n\t\t }\n\t\t\t});\n\t\t\t return result;\n\t\t}\n\t});\n\tvar tem= $.GetUser(input);\n\treturn tem;\n}", "title": "" }, { "docid": "64db3413ceb19682a2a347c231559674", "score": "0.59626526", "text": "function getJsonData(){\n let url = \"cp7.php\"; \n // let type = $(\"languague\").value;\n // $(\"response\").innerHTML = responseJSON.html;\n \n //making a fetch call.\n fetch(url, {credentials: \"include\"})\n .then(checkStatus)\n .then(JSON.parse)\n .then(function(response){\n //making the user input case-insensitive.\n let type = $(\"languague\").value;\n type = type.toLowerCase();\n if (type == \"css\"){\n $(\"response\").innerHTML = response.css;\n }else if (type == \"html\"){\n $(\"response\").innerHTML = response.html;\n }else if (type == \"javascript\"){\n $(\"response\").innerHTML = response.javascript;\n }else if (type == \"php\"){\n $(\"response\").innerHTML = response.php;\n }else{\n $(\"response\").innerHTML = \"try again please!\";\n }\n })\n .catch(function(error) {\n alert(error);\n });\n }", "title": "" }, { "docid": "e8cfdc4a4ae9fded0a609026d7aa3ea1", "score": "0.5931473", "text": "function getInput(v1) {\n\nif (typeof v1 === \"string\") {\n console.log(\"DATA_RECEIVED: \" + v1)\n return \"DATA_RECEIVED: \" + v1\n}else if (typeof v1 === \"number\") {\n console.log(\"Please provide a string input, NOT a number\")\n return \"Please provide a string input, NOT a number\"\n}else\nconsole.log(\"Please provide string input.\")\nreturn \"Please provide string input.\"\n}", "title": "" }, { "docid": "12a3f866121c9dd4516cdd682035829c", "score": "0.5929097", "text": "function getPrice() {\r\n var payload = {\r\n \"origin\": $('#sel_origin').val(),\r\n \"dest\": $('#sel_dest').val()\r\n };\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: \"/getPrice/\",\r\n contentType: 'application/json;charset=UTF-8',\r\n data: JSON.stringify({ \"data\": payload }),\r\n success: function(data) {\r\n $('#priceOutput').text(data[0])\r\n $('#bon_voyage').text(\" ...enjoy your trip!\")\r\n }\r\n });\r\n}", "title": "" }, { "docid": "fa3bf83ab6be09980564fcff174c3189", "score": "0.5897052", "text": "function patNum(){\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"data/patient-handler.php\",\n\t\tdata: \"get_all_patient=true\",\n\t\tcache:false,\n\t\tsuccess: function(data) {\n\t\t\t$(\"#pat-num\").val(data);\n\t\t\t$(\"#pat-num-h\").html(\"<strong>\"+data+\"</strong>\");\n\t\t}\n\t})\n}", "title": "" }, { "docid": "fa3bf83ab6be09980564fcff174c3189", "score": "0.5897052", "text": "function patNum(){\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"data/patient-handler.php\",\n\t\tdata: \"get_all_patient=true\",\n\t\tcache:false,\n\t\tsuccess: function(data) {\n\t\t\t$(\"#pat-num\").val(data);\n\t\t\t$(\"#pat-num-h\").html(\"<strong>\"+data+\"</strong>\");\n\t\t}\n\t})\n}", "title": "" }, { "docid": "92aff5bf48ea1c82ea09c172d2d4866c", "score": "0.5870519", "text": "function ajax_request() {\n // Send name and city via ajax request. Replace any spaces with underscores\n input_name_val = document.getElementById('park_name').value.split(\" \").join(\"_\");\n input_city_val = document.getElementById('park_city').value.split(\" \").join(\"_\");\n // load_val = '/parks/refresh?input_name=' + input_val\n load_val = '/parks/refresh?input_name=' + input_name_val + '&input_city=' + input_city_val;\n $('.dynamic').load(load_val);\n}", "title": "" }, { "docid": "8b19b3380d3df154cd84e5cda42acd37", "score": "0.58686286", "text": "function getValue()\n{\n //console.log(searchField.value);\n //return $(\"#searchField\").val();\n\n var x = document.getElementById(\"searchField\").value;\n\n // call server\n\n $.getJSON(\"http://avivshay.milab.idc.ac.il/json.php?cmd=GPPN\",\n {\n 'searchField': x\n });\n}", "title": "" }, { "docid": "899662ceb43a19042e16617966e5175c", "score": "0.5845565", "text": "function getData(floor) {\n\tvar xhttp,data;\n\tif (window.XMLHttpRequest){\n\t\txhttp = new XMLHttpRequest();\n\t}\n\telse{\n\t\txhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\txhttp.onreadystatechange = function ()\n\t{\n\t\tif(xhttp.readyState==4 && xhttp.status==200)\n\t\t{\n\t\t\tdata = xhttp.responseText;\n\t\t\tif(!data.includes(\"Unsuccessful\")){\n\t\t\t\tdataRecieved = data;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconsole.error(\"Unsuccessful retrieval\")\n\t\t\t}\n\t\t}\n\t};\n\txhttp.open(\"GET\",\"http://192.175.5.204/konehack/elevator-simulation/query.php?floor=\"+floor,false);\n\txhttp.send();\n}", "title": "" }, { "docid": "b6fe802c68087a029e5560a7d443b94e", "score": "0.5819377", "text": "function getUserInput(event){\n var userInput = document.getElementById(\"user-input-field\").value;\n console.log(\"User typed in: \" + userInput);\n makeRequest(userInput); \n}", "title": "" }, { "docid": "3066228c918a0c386daf484e18b65513", "score": "0.5795492", "text": "function getData(input){\n\n\t\tif(input !== \"\"){\n\n\t\t\t//Prepare URL\n\t\t\tvar url = \"http://en.wikipedia.org/w/api.php?action=opensearch&format=json&origin=*&search=\" + input + \"&namespace=0&limit=10\";\n\n\t\t\t//Get Data\n\t\t\tvar req = new XMLHttpRequest();\n\t\t\treq.onreadystatechange = function(){\n\t\t\t\t\n\t\t\t\tif(req.readyState == 4 && req.status == 200){\n\n\t\t\t\t\tvar input = req.responseText;\n\t\t\t\t\tvar parsedInput = JSON.parse(input);\n\t\t\t\t\tuseData(parsedInput);\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\treq.open(\"GET\",url,true);\n\t\t\treq.send();\n\t\t}\n\t\telse{\n\t\t\tcleanSuggestions();\n\t\t}\n\n\t}", "title": "" }, { "docid": "a0816e71ea0e866b105acee03409c954", "score": "0.5784908", "text": "function weatherReq(){\n var url = api+input.value()+appid+unit\n loadJSON (url, gotData);\n}", "title": "" }, { "docid": "341136f1b29a749d5782af019fe5dd7c", "score": "0.5782153", "text": "function webData(){\n if(roundNum == 1){\n var url = 'https://jhu-se-api-container.azurewebsites.net/get_qas/round/1'\n }\n else if(roundNum == 2){\n var url = 'https://jhu-se-api-container.azurewebsites.net/get_qas/round/2'\n }\n $.ajax({\n type: \"GET\",\n url: url,\n success: output,\n dataType: 'json'\n });\n }", "title": "" }, { "docid": "51dfe31f42600dd8add04ef5c23bc4d5", "score": "0.57627046", "text": "function getBand(evt) {\n evt.preventDefault();\n \n userInput = $input.val();\n $input.val(''); // this will clear the search menu after the user searches for a band\n\n $.ajax({\n url: 'https://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=' + userInput +'&api_key=32f924ae8e17d58763e024385d61626d&format=json'\n }).then(function(data) {\n bandData = data; // assign data to a global variable for access in the render function\n render();\n }, function(error) {\n console.log(error);\n })\n}", "title": "" }, { "docid": "7b24995d94384359eef56b4fbc28a7b2", "score": "0.5757563", "text": "function get_user_data() {\n ajax_req(\n php_redir,\n \"\", \n get_succ, \n get_err\n );\n}", "title": "" }, { "docid": "1a18591b436139c1afc375bd8da38d54", "score": "0.57413244", "text": "function getSpecifics(type) {\n if (type != 0) {\n $.ajax({\n url: \"/Event/GetEventSpecific/\",\n type: 'GET',\n data: { type: type },\n dataType: 'html',\n success: function (result) {\n $('#event_specifics').html(result);\n }\n });\n }\n else {\n numberOfFields = 0;\n $('#event_specifics').html(\"\");\n setState();\n validateInput('SelectedEventType', 'Type', true, true);\n }\n}", "title": "" }, { "docid": "15014343f97ac9b1b55d8d92493e8a36", "score": "0.5738195", "text": "get_data_by_ajax_call(){\n\n // Building up the params to be passed to the API url\n let ajax_query_param=''\n\n // If there is some search text, pass it via skills_list param\n if(this.props.search_text!=''){\n ajax_query_param+='&skills_list=' + this.props.search_text\n }\n\n if(this.props.deadline!=''){\n ajax_query_param+='&deadline_date=' + this.props.deadline.format('YYYY-MM')\n }\n\n if(this.props.start_date!=''){\n ajax_query_param+='&start_date=' + this.props.start_date.format('YYYY-MM')\n }\n request_scholarship_data(this.state.req_url + ajax_query_param, store.dispatch)\n }", "title": "" }, { "docid": "66d1ae43d1a2523e49ab628a12fc2364", "score": "0.57205504", "text": "function findMovie() {\n \n var query = input.value; \n console.log(query);\n // send off the query\n $.ajax({\n url: moviesSearchUrl + '&q=' + encodeURI(query),\n //is it better to use json or jsonp datatype?\n dataType: \"jsonp\",\n success: homeSearch\n });\n}", "title": "" }, { "docid": "f86bce6244f93d2e54f8e9dd39ee2b13", "score": "0.5716356", "text": "function getInputFromUser() {\n makeListAgain() // rendering all data again\n var x = document.getElementById(\"userInputFilterCost\").value\n x = parseInt(x)\n return filterByCost(x)\n}", "title": "" }, { "docid": "d0a4bc9d72fc583c424fbab15c1221ac", "score": "0.5707377", "text": "function fetchResult() {\n // Generating random request types\n API_REQUEST_TYPE = getRequestType();\n\n // Checking if the value is empty\n if(inputElement.value === \"\") {\n outputElement.textContent = \"Enter a number to find secret.\";\n return;\n }\n\n // Checking if input is valid.\n if(validateInput()) {\n // Getting the input\n var inputNumber = inputElement.value;\n\n // Creating Url fro api request\n var API_URL = `${API_BASE_URL}/${inputNumber}/${API_REQUEST_TYPE}`;\n\n // Creating differnt XMLHttpRequest objects according to the browsers\n if (window.XMLHttpRequest) {\n // For modern browsers\n http = new XMLHttpRequest();\n } else {\n // For old IE browsers\n http = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n // making http request to numbersapi.com\n http.open('GET', API_URL);\n // Changing input of output element with api's response\n http.onload = function() {\n outputElement.textContent = this.response;\n }\n http.send();\n }\n}", "title": "" }, { "docid": "f835de19c331f88f14603505bf5dbbae", "score": "0.57025474", "text": "function get_courses_in_program() {\n\tvar input = prompt(\"programCode;year;lp\");\n\t\n\tvar data = input.split(\";\");\n\t\n\tif(data.length == 3) {\n\t\n\t\t$.ajax({\n\t\t\turl : 'getCoursesInProgram',\n\t\t\tdata : {\n\t\t\t\tcode : data[0],\n\t\t\t\tyear : data[1],\n\t\t\t\tlp : data[2]\n\t\t\t},\n\t\t\tsuccess : function(response) {\n\t\t\t\talert(\"Courses :\\n\" + response);\n\t\t\t}\n\n\t\t});\n\t\t\n\t} else {\n\t\talert(\"invalid input \" + input);\n\t}\n\t\n}", "title": "" }, { "docid": "a612bc297271796ad66281aadc02dddd", "score": "0.5672558", "text": "function user(reqType){\r\n var xhr = new XMLHttpRequest();\r\n\r\n var user = document.getElementById(\"uuser\").value;\r\n\r\n xhr.onreadystatechange = function(){\r\n if (xhr.readyState == 4 && xhr.status == 200 ) {\r\n document.getElementById(\"userreq\").innerHTML = xhr.responseText;\r\n }\r\n }\r\n xhr.open(\"POST\", \"Ajaxreq.php\", true);\r\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n xhr.send(\"reqType=\"+reqType+\"&user=\"+user); \r\n }", "title": "" }, { "docid": "1b6feb13ec428c9b876eee61aea91a54", "score": "0.5671925", "text": "function incorrect(){\n console.log(\"type=incorrect&state=\"+state+\"clicked=\"+this.id+\"&question=\"+questions[state]);\n $.ajax({\n url: \"scorereport\", // goes to https://user.tjhsst.edu/pckosek/kitchen\n type: \"get\", // use a 'get' type request\n data: \"type=incorrect&state=\"+state+\"&clicked=\"+this.id, //serialize form and pass to server\n success: function(response) {\n console.log(\"worked!\")\n },\n error: function (stat, err) {\n console.log(\"broken\")\n } \n });\n}", "title": "" }, { "docid": "9a24598bcbd41d6acea91e70bb726792", "score": "0.56654924", "text": "function getAnswer(){\n $.ajax({\n type: 'GET',\n url: '/calculate',\n success: function(data){\n appendAnswer(data);\n },\n error: function(error){\n console.log('There was an error retrieving your data from the server.', error);\n }\n });\n}", "title": "" }, { "docid": "ab8467cce3f1deb3caecbfb7cea32ca6", "score": "0.5661527", "text": "function sendReq(command, data)\n\t{\n\t\t$.ajax({\n \t\t\turl:'/api',\n \t\t\ttype:'GET',\n \t\t\tdata:{'command':command, 'data':data},\n \t\t\tsuccess: function(res){\n\n\t\t\t$('#programInput').val(res);\n\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "f78ba190c413f1bbc19507c30bc5215e", "score": "0.5648407", "text": "function getUserData(displayFunction,osInput){ //here displayFunction parameter is a function\n var result=null; //var result is declared null\n var xhr=new XMLHttpRequest(); //new constructor xhr object is created\n xhr.open('GET','http://localhost:8080/codenames/'+osInput); //using get method to get data from URL. input from our end is also\n //given to get the data we neeed. \n xhr.send(); //this will send the request to the server\n xhr.onload = function () { // this fn is invoked after info is retrieved\n if (xhr.status == 200){\n result = JSON.parse(xhr.response); //if we get an OK response from server. .we get this xhr.response as data from server\n displayFunction(result);\n }\n else{\n console.log(\"Error code is :\"+xhr.status)// else we can check the exact type of error with xhr.status\n }\n }\n}", "title": "" }, { "docid": "6139e0a7f04702351267ca28a6aaa08b", "score": "0.5638464", "text": "function Get_clb_user_sugg(str)\n{\n\t\nif (str==\"\") {\n document.getElementById(\"txtHint\").innerHTML=\"\";\n return;\n } \n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n } else { // code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function() {\n if (this.readyState==4 && this.status==200) {\n document.getElementById(\"txtHint\").innerHTML=this.responseText;\n }\n }\nxmlhttp.open(\"GET\",\"club_user_sugg.php?q=\"+str,true);\nxmlhttp.send();\n}", "title": "" }, { "docid": "aae40aca7aab0e31aceb71d9d7e690fd", "score": "0.5637878", "text": "function renderShoppingData(){\n $.ajax({\n url: database + shopping_gender,\n type: 'get',\n dataType: 'jsonp',\n success: function(data){\n shop_female = data.rows[0].value[0];\n shop_male = data.rows[1].value[0];\n female_sentiment = data.rows[0].value[1];\n male_sentiment = data.rows[1].value[1]; \n processShoppingData(shop_female,shop_male,female_sentiment,male_sentiment);\n }\n });\n}", "title": "" }, { "docid": "18c4fe7321b515e1defd02a77446e558", "score": "0.5620286", "text": "function getinputdata() {\n guestname = document.forms[\"guestinfo\"][\"guestname\"];\n guestid = document.forms[\"guestinfo\"][\"guestid\"];\n guestdob = document.forms[\"guestinfo\"][\"guestdob\"];\n guestemail = document.forms[\"guestinfo\"][\"guestemail\"]\n address = document.forms[\"guestinfo\"][\"address\"];\n guestclass = document.forms[\"guestinfo\"][\"guestclass\"];\n numOfGuest = document.forms[\"guestinfo\"][\"numOfGuest\"];\n rentdays = document.forms[\"guestinfo\"][\"rentdays\"];\n services = document.forms[\"guestinfo\"][\"services\"];\n roomtype = document.forms[\"guestinfo\"][\"roomtype\"];\n}", "title": "" }, { "docid": "055eb920bd4fed791fabdbd6dbd4f416", "score": "0.5610961", "text": "function kd_prodxNum_read()\r\n\t\t{\r\n\t\t\t/*vars*/\r\n\t\t\tnumSeri=document.getElementById('kd_numSeri').value;\r\n\t\t\tajax=\"kd_prodxNum_read\";\r\n\r\n\t\t\t/*param*/\r\n\r\n\t\t\t/*peticion ajax*/\r\n\t\t\tvar request = $.ajax({\r\n\t\t\turl: \"ajax/kd_ajax.php\",\r\n\t\t\ttype: \"POST\",\r\n\t\t\tdata: {ajax:ajax,numSeri:numSeri},\r\n\t\t\tdataType: \"html\"\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trequest.done(function(msg) {\r\n\t\t\t//document.getElementById('scInventario').value='';\r\n\t\t\t//var acontenidoAjax = a('#loading').html('');\r\n\t\t\t$(\"#kd_prodSeri_tab\").html( msg );\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trequest.fail(function(jqXHR, textStatus) {\r\n\t\t\talert( \"Request failed: \" + textStatus );\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "8d050f5ea3eb06aac179cb32afc1df36", "score": "0.5605955", "text": "function ajaxF() {\n\tconsole.log(\"click\");\n\tlet digit = $('#digit');\n\t$.ajax({\n\t\turl: \"ajaxcode/ajax.php\",\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t\t\"a\": +digit.val(),\n\t\t},\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(data);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "c000e3c872ab2f8b2b01aa8c92f8e4b4", "score": "0.5595037", "text": "function searchPeople() {\n var text = $(\"#myInput\").val();\n $.ajax({\n url: \"/search_component\",\n type: \"get\",\n data: {\n jsdata: text\n },\n success: function (response) {\n $(\"#myUL\").show();\n $(\"#myUL\").html(response);\n },\n error: function (xhr) { }\n });\n}", "title": "" }, { "docid": "aaf2fb858c70a21aff372f7129ab6b4d", "score": "0.5576859", "text": "function getData(query, callback){\n\t\tquery = query ? $.param(query) : \"\";\n\t\t$.ajax({\n\t\t\t// just put 'ajax' if on the web\n\t\t \turl: \"http://loldata-spateoffire.rhcloud.com/ajax?\" + query,\n\t\t \tcontext: document.body\n\t\t}).done(function(jsonStr) {\n\t\t \tvar data = JSON.parse(jsonStr)\n\t\t \tcallback(data);\n\t\t});\n\t}", "title": "" }, { "docid": "82875cf0fcf18342d192fc8744be32cf", "score": "0.55758184", "text": "function getAppointments() {\t\n minDate();\n var parameter = $('#param').val();\n $.ajax({\n url: \"http://localhost/cgi-bin/appointments_backend.cgi\",\n type: \"get\", \n async: true, \n data: { \n action: \"retrieve\",\n param: parameter\n },\n success: function(data) {\n retrieveData(data)\n },\n error: function(xhr) {\n }\n });\n}", "title": "" }, { "docid": "4b6d27c49e5779c3f0fe3beb6b69cfc0", "score": "0.55727696", "text": "function getData(e){\n e.preventDefault();\n let newCity = document.getElementById('city').value;\n let newCountry = document.getElementById('country').value;\n let feelings = document.getElementById(\"feelings\").value;\n let name = document.getElementById(\"name\").value;\n\n if (newCity == \"\" && newCountry == \"\") {\n alert(\"please insert name of a city and the corresponding country\");\n } else if (newCity == \"\"){\n alert(\"please insert name of a city\");\n } else if(newCountry == \"\"){\n alert(\"please insert name of a country\");\n }\n getWeather(newCity+','+newCountry)\n .then(function (data) {\n postData('/addData', {\n userName: name,\n temperature: data.main.temp,\n date: newDate,\n userFeel: feelings\n\n })\n }).then(renderUI);\n}", "title": "" }, { "docid": "6005c18db94ef505060ee62c8ac3e5e9", "score": "0.55645823", "text": "function getQuestions() {\n const questionsQuantity = document.getElementById('questions-number').value;\n const categorySelect = document.getElementById('category-type').value;\n const difficulty = document.getElementById('difficulty').value;\n const type = document.getElementById('type').value;\n fetch(`https://opentdb.com/api.php?amount=${questionsQuantity}&category=${categorySelect}&difficulty=${difficulty}&type=${type}`)\n .then(response => response.json())\n .then(data => {\n // The value selected in every option, pass as a parameter to printCards\n printCards(data.results)\n });\n}", "title": "" }, { "docid": "e28aba087e2a7896429c012e2f16431f", "score": "0.55640256", "text": "function visitorIdentificationUpdated() {\n\n // get the value entered by the user in FirstName field\n var firstNameSearch = $('#firstNameInput').val();\n var lastNameSearch = $('#lastNameInput').val();\n var identificationNumberSearch = $('#identificationNumberInput').val();\n\n // get visitor data to be displayed in list\n $.get(\"/SignIn?handler=Visitors&FirstName=\" + firstNameSearch +\n \"&LastName=\" + lastNameSearch +\n \"&IdentificationNumber=\" + identificationNumberSearch, function (response) {\n displayExistingVisitorList(response) \n });\n}", "title": "" }, { "docid": "6b161e29d62e2f7a1d3768cfd364079e", "score": "0.55513996", "text": "function getData() {\n var req = {};\n var type = $(this).data('type');\n req['type'] = type;\n // alert(req['type']);\n\n //ERROR CHECKING FOR THE DATERANGEPICKER IS CHOSEN OR NOT\n if (type == \"sales\") {\n try {\n var t1 = JSON.parse($('#datepicker1').val());\n }\n catch(e) {\n var r1 = e instanceof SyntaxError;\n }\n\n if (r1) {\n alert(\"請先選取一個時段\");\n return ;\n }\n var start_time = t1.start + ' 00:00:00';\n var end_time = t1.end + ' 23:59:59';\n req['time'] = [start_time, end_time];\n }\n else if (type == \"orders\") {\n try {\n var t2 = JSON.parse($('#datepicker2').val());\n }\n catch(e) {\n var r2 = e instanceof SyntaxError;\n }\n\n if (r2) {\n alert(\"請先選取一個時段\");\n return ;\n }\n var start_time = t2.start + ' 00:00:00';\n var end_time = t2.end + ' 23:59:59';\n req['time'] = [start_time, end_time];\n }\n else if (type == \"menu\") {\n try {\n var t3 = JSON.parse($('#datepicker3').val());\n }\n catch(e) {\n var r3 = e instanceof SyntaxError;\n }\n\n if (r3) {\n alert(\"請先選取一個時段\");\n return ;\n }\n var start_time = t3.start + ' 00:00:00';\n var end_time = t3.end + ' 23:59:59';\n req['time'] = [start_time, end_time];\n }\n else {\n alert(\"ERROR for types of ajax\");\n return ;\n }\n\n $.ajax({\n url: \"report_process.php\",\n method: \"POST\",\n dataType:\"json\",\n data:{request:req}\n }).done(function(ret){\n // for (i = 0; i < ret.length; i++)\n // alert(ret[i]);\n\n if (type == \"sales\") {\n getSalesReport(ret, t1);\n }\n else if (type == \"orders\") {\n getOrdersReport(ret, t2);\n getMenuReport(ret[ret.length-1], t2);\n }\n else if (type == \"menu\") {\n getMenuReport(ret, t3);\n }\n else alert(\"ERROR for types of ajax\");\n\n }).fail(function(jqXHR, textStatus, errorThrown){\n console.log(textStatus, errorThrown);\n alert(\"fail\");\n }).always(function(){\n // alert(\"always\");\n });\n}", "title": "" }, { "docid": "3b87d6ee74d02f3b3307d91736d56234", "score": "0.554415", "text": "function fetchData() {\n titleDiv.innerHTML = ''; \n var itemLookUp = document.getElementById('getItem').value;\n // create XMLHttpRequest object\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n // readyState 4 means the request is complete\n // status 200 means was successful\n if (this.readyState == 4 && this.status == 200) {\n // construct object\n responseData = JSON.parse(this.responseText);\n processData();\n }\n };\n xhttp.open(\"GET\", \"https://www.googleapis.com/books/v1/volumes?q=\" + itemLookUp, true);\n itemLookUp = ''; \n xhttp.send();\n // reset input\n document.getElementById('getItem').value = '';\n}", "title": "" }, { "docid": "c9077054c1023c882113aa3afbcb1a15", "score": "0.5540267", "text": "function getData(input){\n var url = 'http://api.giphy.com/v1/gifs/search?q=' + input + '&api_key=dc6zaTOxFJmzC'; \n\n //Ajax Request\n var GiphyAJAXCall = new XMLHttpRequest();\n GiphyAJAXCall.open ('GET', url );\n GiphyAJAXCall.send();\n\n GiphyAJAXCall.addEventListener('load', function(e){\n\n var data = e.target.response;\n pushToDOM(data);\n });\n}", "title": "" }, { "docid": "3f629e557528ad29e94ee8614f24cfe1", "score": "0.5530305", "text": "function getData(string, api_key, url, type, container) {\r\n\r\n $.ajax({\r\n url: url,\r\n method:'GET',\r\n data:{\r\n api_key: api_key,\r\n query: string,\r\n language: 'it-IT'\r\n },\r\n success: function(data) {\r\n//se si ha riscontro con la ricerca quindi il total result è > 0 si stampano i risultati richiamando la funzione printResults\r\n if (data.total_results > 0) {\r\n var results = data.results;\r\n printResults(type, results);\r\n//se non si ha riscontro con la ricerca quindi il total result è uguale a 0 si manda un messaggio all'utente\r\n }else{\r\n sendMessageNoResult($(container));\r\n }\r\n },\r\n error:function(request, state, errors) {\r\n console.log(errors);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "535ffb13348b2e8f6015700bbcfbd025", "score": "0.5529966", "text": "function getSearchedData() {\n let term = document.querySelector(\"#searchterm\").value;\n displayTerm = term;\n term = term.trim();\n\n term = encodeURIComponent(term);\n\n if (term.length < 1) return;\n\n let searchFor = document.getElementById(\"searchtype\");\n let searchForText = searchFor.options[searchFor.selectedIndex].text.toLowerCase();\n\n let url = \"https://rickandmortyapi.com/api/\" + searchForText + \"/?name=\" + term;\n\n document.querySelector(\"#content\").innerHTML = \"<b>Searching for \" + displayTerm + \"</b>\";\n try {\n if (searchFor.options[searchFor.selectedIndex].value === \"name\") {\n ajax(url, jsonShowSearchCharacters);\n }\n else if (searchFor.options[searchFor.selectedIndex].value === \"episode\") {\n ajax(url, jsonShowSearchEpisodes);\n }\n else if (searchFor.options[searchFor.selectedIndex].value === \"location\") {\n ajax(url, jsonShowSearchLocations);\n }\n }\n catch {\n errorOut();\n }\n\n}", "title": "" }, { "docid": "6c7fc0a58084b9f0ffaafc22ec59c207", "score": "0.55249476", "text": "function getTask(value)\n{ \n $.ajax({\n type: 'get',\n url: '/api/getTask/'+ value,\n dataType: 'text'\n })\n .done(function(data){\n createEditForm(JSON.parse(data));\n })\n}", "title": "" }, { "docid": "d1ac5eb240f6016a0914071dd2a53a48", "score": "0.5520627", "text": "function ajaxHandler(value, userAmount)\n{\n $.ajax({\n url: \"php/sendDataToDB.php\",\n type: 'POST',\n data: {\n value: value,\n userAmount: userAmount,\n happiness: value / userAmount\n },\n success: function(data) {\n console.log(\"The average mood of todays visitors is \" + data.happiness);\n },\n error: function()\n {\n drawError();\n }\n });\n}", "title": "" }, { "docid": "b099abf2110e5f7d9f22f2104909c63e", "score": "0.55187", "text": "function formSubmitted(event) {\n event.preventDefault();\n var url = \"http://omdbapi.com/?s=\" + $(\"#query\").val();\n $.get(url, resultsReceived);\n}", "title": "" }, { "docid": "b099abf2110e5f7d9f22f2104909c63e", "score": "0.55187", "text": "function formSubmitted(event) {\n event.preventDefault();\n var url = \"http://omdbapi.com/?s=\" + $(\"#query\").val();\n $.get(url, resultsReceived);\n}", "title": "" }, { "docid": "c8c54b13b433a795074136ed8c9b2d2b", "score": "0.5517964", "text": "function ajaxSage(input, buildAnswerDiv, index) {\n\t\tvar server = \"/submit\";\n\t\tvar data = { data : input, index: index };\n\t\tvar ajax = new XMLHttpRequest();\n\t\tajax.open(\"POST\", server, true);\n\t\tajax.setRequestHeader(\"Content-type\", \"application/JSON\");\n\t\tajax.onload = function() { \n\t\t\t displayAns(this.responseText, buildAnswerDiv); \n\t\t\t };\n\t\tajax.send(JSON.stringify(data));\n\t}", "title": "" }, { "docid": "aff6f4aebf35fa200f1a93b34799210a", "score": "0.5511788", "text": "function send(op, num1, num2) {\n let url = \"/calculate/op/\" + op + \"/num1/\" + num1 + \"/num2/\" + num2;\n console.log(url);\n $.get(url, success);\n}", "title": "" }, { "docid": "c968460700e4330f0634fa8222cc5da0", "score": "0.55116403", "text": "function haePaivanJunat(){\n xh = new XMLHttpRequest();\n xh.onreadystatechange=readystagechangetoka;\n xh.open(\"GET\", \"https://rata.digitraffic.fi/api/v1/trains/\"+input);\n xh.send();\n}", "title": "" }, { "docid": "079476fba04d98bd7c019ce34cbe715f", "score": "0.55113804", "text": "function searchHandler(args){\n\tvar xhr = new XMLHttpRequest()\n\tvar cuisine = args[0].getSelected()\n\tvar dresscode = args[1].getSelected()\n\tvar payment = args[2].getSelected()\n\tvar price = args[3].getSelected()\n\txhr.open(\"POST\", \"http://student04.cse.nd.edu:51067/recommendations/\", true);\n\tvar dict = {\"Cuisine\": cuisine, \"Dress Code\": dresscode, \"Payment Accepted\": payment, \"Price\": price} \n\txhr.onload = function(e){\n\t\tgetRecommendation();\n\t}\n\txhr.onerror = function(e){\n\t\tconsole.error(xhr.statusText)\n\t}\n\txhr.send(JSON.stringify(dict))\n}", "title": "" }, { "docid": "85f79e15b51e8bb3bd20cd730786ecc5", "score": "0.55104667", "text": "function make_request(arg1, arg2, op) {\n // convert +, -, *, / to add, sub, mul and div\n // func in func_lib.js \n var url_op = replace_operation(op);\n if (!validate_input(arg1, arg2, url_op)) {\n // illegal input will fail to submit\n return;\n }\n\n var xmlHttp = get_xml_http(); /* func defined in func_lib.js */\n var url = \"basic_calculator.php\";\n url += \"?arg1=\" + arg1 + \"&op=\" + url_op + \"&arg2=\" + arg2;\n // url += \"&sid=\" + Math.random();\n\n // response handler\n xmlHttp.onreadystatechange = function() {\n if(xmlHttp.readyState == 4 || xmlHttp.readyState == \"complete\") {\n handle_response(xmlHttp.responseText);\n }\n }\n\n // synchronous ajax request!\n xmlHttp.open(\"GET\", url, false); \n xmlHttp.send(null);\n}", "title": "" }, { "docid": "1e1f38d50d6a40cc429b97a1871cb042", "score": "0.5509038", "text": "function showUser(str) {\n if (str==\"\") {\n document.getElementById(\"txtHint\").innerHTML=\"\";\n return;\n } \n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n } else { // code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function() {\n if (this.readyState==4 && this.status==200) {\n document.getElementById(\"txtHint\").innerHTML=this.responseText;\n }\n }\n xmlhttp.open(\"GET\",\"tiltmaximo2.php?q=\"+str,true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "d10669508a785dbb3d159fe8048c2091", "score": "0.5506247", "text": "function validateUsername(){\n var username = $(\"username\").value;\n new Ajax.Request( \"avail.php\", \n { \n method: \"get\", \n parameters: {name:username},\n onSuccess: displayResult\n } );\n}", "title": "" }, { "docid": "3af4fbe2388416176bd5de032576edcb", "score": "0.5502933", "text": "function getInputFromUserByRange() {\n makeListAgain() // rendering all data again\n var one = document.getElementById(\"userInputFilterCostOne\").value\n one = parseInt(one)\n\tvar two = document.getElementById(\"userInputFilterCostTwo\").value\n\ttwo = parseInt(two)\n\t//var testOne = 10\n\t//var testTwo = 12\n return filterByCostByRange(one, two)\n}", "title": "" }, { "docid": "76d18c56cf24b0de50126038b740971d", "score": "0.54977167", "text": "function getValue(id,option,output,methodid){\n\tvar idvalue=$(\"#\"+id).val();\n\t$.ajax({\n\t\ttype:'get',\n\t\turl: \"/getValue2\",\n\t\tdataType: \"html\",\n\t\tdata: {'idvalue':idvalue,'option':option,'methodid':methodid},\n\t\tsuccess: function( result ) {\n\t\t\t$(output).empty().append(result);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0fe38a2d5b8f748711fbcd3353d9e333", "score": "0.5492663", "text": "function sendRequest(numObject){\n$.ajax({\n type:'POST',\n url:'/calculator/' + numObject.operator,\n data:numObject,\n success: function(data){\n console.log(\"post request successful\");\n console.log(data);\n appendDom(data);\n console.log(data);\n },\n error: function(){\n console.log(\"post failed\");\n }\n});\n}", "title": "" }, { "docid": "d4482fc919982e7091e52148d522f50b", "score": "0.54810774", "text": "function getPrograms(){\n var age = $age.innerText;\n var county = $county.innerText;\n var duration = $duration.innerText;\n var cost = $cost.innerText;\n\n if(age === \"Any\"){age = false;} else { age = parseInt(age);}\n if(county ===\"Any\"){ county = false;}\n if(duration ===\"Any\"){duration = false;} else { duration = parseInt(duration.split(\" \")[0]);}\n if(cost === \"Any\"){cost = false;} else { cost = parseInt(cost.substring(1));}\n\n\n var options = {\n method: \"GET\",\n url: \"/api/programs\",\n dataType: \"json\"\n };\n\n $.ajax(options)\n .done(function(data){\n // now this will fetch <path/to/templates/content.hbs>\n //Filter the data based on options from the list\n var response = filterPrograms(data,county,cost,duration,age);\n\n $('#viewpage').render('viewpage', {\n\n programs: response\n\n });\n })\n .error(function(err){\n console.log(err);\n });\n }", "title": "" }, { "docid": "b5956099e51457c062b63bfcab5b24e0", "score": "0.5478534", "text": "function getResult(){\n var fileName = '/' + numberObject.type;\n $.ajax({\n type: 'GET',\n url: fileName,\n success: function(data){\n $('#view').text(data.result);\n }\n });\n }", "title": "" }, { "docid": "41105b6e3c5fb6fcb552f775270d15e8", "score": "0.54784226", "text": "function Request()\r\n{\r\n var pkmToSearch = String(searchBox.value.toLowerCase()); // txt from search, need to be lower if not error\r\n \r\n //Show loading while fetching data.\r\n popup.showModal();\r\n \r\n let xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = Response;\r\n xmlHttp.open (\"GET\", \"https://pokeapi.co/api/v2/pokemon/\"+pkmToSearch+\"/\");\r\n xmlHttp.send(); \r\n\r\n}", "title": "" }, { "docid": "0bb673213e0c3a6d56e9439e863eb5b6", "score": "0.5476461", "text": "function ajax(type) {\n console.log(\"ajax\")\n var _url\n var _data;\n var _typeId;\n var _elementId;\n var _idValue;\n var _request;\n\n // SWITCH STATEMENTS TO MAKE AJAX FLEXIBLE\n switch (type) {\n\n case 'building':\n _url = \"/intervention/getBatteries\";\n _typeId = '#battery';\n _elementId = $('#' + type);\n _idValue = _elementId.val();\n _data = { id: _idValue }\n\n $(\"#battery, #column, #elevator\").empty();\n $(\"#batteryField\").show();\n $(\"#columnField, #elevatorField\").hide();\n break;\n\n case 'battery':\n _url = \"/intervention/getColumns\";\n _typeId = '#column';\n _elementId = $('#' + type);\n _idValue = _elementId.val();\n _data = { id: _idValue }\n\n $(\"#column, #elevator\").empty();\n $(\"#columnField\").show();\n $(\"#elevatorField\").hide();\n break;\n\n case 'column':\n _url = \"/intervention/getElevators\";\n _typeId = '#elevator';\n _elementId = $('#' + type);\n _idValue = _elementId.val();\n _data = { id: _idValue }\n\n $(\"#elevator\").empty();\n $(\"#elevatorField\").show();\n break;\n }\n $.ajax({\n url: _url,\n method: \"GET\",\n dataType: \"json\",\n data: _data,\n error: function (xhr, status, error) {\n console.error('AJAX Error: ' + status + error);\n },\n success: function (response) {\n console.log(\"Response: \", response);\n\n update(_typeId, response);\n }\n });\n}", "title": "" }, { "docid": "6c37904706e29e4a6176beaba3a1233d", "score": "0.5473294", "text": "function retrieveInput(entData) {\n\t\treturn $http.get(serverURL+'/entryRouter/functions', entData);\n\t}", "title": "" }, { "docid": "99c0427cd75b03625bc58240662fa11a", "score": "0.5469977", "text": "function pageData() {\n\tif (this.value != \"\") { \n\t\tif (NUM_CALLS == 2) {\t\t\t\t\t// If there is data from two names up, clear the graph\n\t\t\t$(\"graph\").innerHTML = \"\";\n\t\t\tNUM_CALLS = 0;\n\t\t}\n\t\tnew Ajax.Request(\"https://webster.cs.washington.edu/cse190m/babynames.php\", {\n\t\t\t\tmethod: \"get\",\n\t\t\t\tparameters: {\"type\" : \"rank\", \"name\" : this.value},\n\t\t\t\tonSuccess: graphData,\n\t\t\t\tonFailure: ajaxFailure,\n\t\t\t\tonException: ajaxFailure\n\t\t});\n\t\t$(\"meaning\").innerHTML =\"\";\n\t\tnew Ajax.Updater({ success : \"meaning\" }, \"https://webster.cs.washington.edu/cse190m/babynames.php\", {\n\t\t\tmethod: \"get\",\n\t\t\tparameters: {\"type\" : \"meaning\", \"name\" : this.value}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "abc76f4884718a693ef7c95a2c7d894a", "score": "0.5467056", "text": "function GetId(input)\n{\n\tjQuery.extend({\n\t\tGetUser: function(type) \n\t\t{\t\n\t\t\tvar result = null;\n\t\t\t$.ajax({\n\t\t\tmethod: \"POST\",\n\t\t\turl: \"onlineId.php\",\n\t\t\tasync : false,\n\t\t\tdata: { user_type: type },\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(data) {\n\t\t result = data;\n\t\t }\n\t\t\t});\n\t\t\t return result;\n\t\t}\n\t});\n\tvar tem= $.GetUser(input);\n\treturn tem;\n}", "title": "" }, { "docid": "10540eb6e74099a4d50327a6304b8618", "score": "0.54667306", "text": "function getWeather(input,type) {\r\n\r\n var APIstring;\r\n var APIforecast;\r\n var resp;\r\n \r\n if (type == \"code\") {\r\n APIstring = \"http://api.openweathermap.org/data/2.5/weather?zip=\" + input +\",us&units=imperial&APPID=\" + APIkey;\r\n APIforecast = \"http://api.openweathermap.org/data/2.5/forecast?zip=\" + input +\",us&units=imperial&APPID=\" + APIkey;\r\n }\r\n else {\r\n APIstring = \"http://api.openweathermap.org/data/2.5/weather?\" + input +\"&units=imperial&APPID=\" + APIkey;\r\n APIforecast = \"http://api.openweathermap.org/data/2.5/forecast?\" + input +\"&units=imperial&APPID=\" + APIkey;\r\n }\r\n \r\n // Get the current weather\r\n $.ajax({\r\n type : \"GET\",\r\n url : APIstring,\r\n dataType : \"jsonp\",\r\n \r\n success : function(responseData1, status1) {\r\n $(\"#submit\").html(\"Submit\");\r\n writeData(responseData1);\r\n },\r\n // Handle errors\r\n error: function(msg1) {\r\n $(\"#submit\").html(\"Invalid zip code.\");\r\n }\r\n });\r\n \r\n // Get the forecast\r\n $.ajax({\r\n type : \"GET\",\r\n url : APIforecast,\r\n dataType : \"jsonp\",\r\n \r\n success : function(responseData2, status2) {\r\n forecast = responseData2;\r\n writeForecast();\r\n \r\n },\r\n // Handle errors\r\n error: function(msg2) {\r\n $(\"#submit\").html(\"Invalid zip code.\");\r\n }\r\n });\r\n \r\n}", "title": "" }, { "docid": "44fdcf610f36510ab846ae54b452264d", "score": "0.5459643", "text": "function ajaxHandler(value, userAmount)\n{\n $.ajax({\n url: \"php/sendDataToDB.php\", // current page\n type: 'POST',\n data: {\n value: value, // of if writing a JS variable remove the quotes.\n userAmount: userAmount,\n happiness: value / userAmount\n },\n success: function(data) {\n //console.log(data.happiness);\n immersiveBackground(data.happiness);\n //if(x == false)\n //{\n // //deleteSoundcloudWidget\n // //createSoundcloudWidget(data.happiness);\n //}\n },\n error: function()\n {\n drawError();\n }\n });\n}", "title": "" }, { "docid": "7790840b8fd8656bae2632e4f8c6ba30", "score": "0.54506373", "text": "function sendValues(toCalculate){\n $.ajax({\n type: 'POST',\n url: '/calculate/' + toCalculate.type,\n data: toCalculate,\n success: function(data){\n getAnswer();\n },\n error: function(error){\n alert('There was an error when sending your data to the server.', error);\n }\n });\n}", "title": "" }, { "docid": "e4d8f895a3ea4e3dcc4c85d72412c19b", "score": "0.5443701", "text": "function loadCustomer(query = ''){\n $.ajax({\n url: \"/loadCustomer\",\n type: 'GET',\n data: {query:query},\n dataType: 'json',\n success: function(data){\n // console.log(data);\n $('#showdata').html(data.result);\n $('#showcount').html(data.count);\n }, error: function(data){\n console.log('Error: '+data);\n }\n });\n }", "title": "" }, { "docid": "2cc0bb1ff342e2a65d6cc66d57bd0448", "score": "0.54370666", "text": "function getTaxPercentages(rowid){\n\tvar taxCode = document.getElementById(\"taxStatus\"+rowid).value;\n\t$.ajax({\n url: '/cedugenie/getTaxPercentageAgainstTaxCode.html',\n data: \"taxCode=\"+(taxCode),\n dataType: 'json',\n success: function(data) {\n\t\t\tif(data != \"\"){\n\t\t\t\tdocument.getElementById(\"tax\"+rowid).value = data;\n\t\t\t\tcalculate(rowid);\n\t\t\t}\n }\n\t});\n\t\n}", "title": "" }, { "docid": "a32971a1ccfa707eb674f6c95c525927", "score": "0.543416", "text": "function petData(str) {\n if (str==\"\") {\n document.querySelector(\".record-details\").innerHTML=\"\";\n return;\n }\n // Create XHR Object\n let xhr = new XMLHttpRequest();\n \n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.querySelector(\".record-details\").innerHTML=this.responseText;\n \n }\n };\n //OPEN - type, url/file, async\n xhr.open('GET', \"petData.php?q=\"+str, true);\n xhr.send();\n }", "title": "" }, { "docid": "5d3b16b256d8093880629c37fd8d7d36", "score": "0.5433563", "text": "function readStock(data){\nfoodS=data.val();\n}", "title": "" }, { "docid": "bb16621cc6e27e8deb7013ba38123b52", "score": "0.5426785", "text": "function readStock(data){\n foodS = data.val(); \n}", "title": "" }, { "docid": "572349c6f35be9ab9e947242e3757bbd", "score": "0.5424941", "text": "function getData() {\n const xhttp = new XMLHttpRequest();\n response.style.transform = null;\n response.innerHTML = \"Please wait....\"; \n const rawQuery = document.getElementById(\"query\");\n let query = formQuery(rawQuery);\n \n\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n display(this.responseText);\n }\n };\n\n xhttp.open(\"GET\", query, true);\n xhttp.send();\n}", "title": "" }, { "docid": "6ff3cbf33477c229ede4bee78e93639e", "score": "0.5423494", "text": "function performSearch(event) {\n\n // Variable to hold request\n var request;\n\n // Prevent default posting of form - put here to work in case of errors\n event.preventDefault();\n\n // Abort any pending request\n if (request) {\n request.abort();\n }\n // setup some local variables\n var $form = $(this);\n\n // disable the inputs and buttons for the duration of the request.\n setFormDisabledProps(true);\n\n $(\"#search-results-heading\").text(\"Searching ...\");\n $(\"#results\").text(\"\");\n\n // Send the request\n\n request = $.ajax({\n url:\"https://api.covid19api.com/summary\",\n type: \"GET\",\n // data: { i: , q: $(\"#contains\").val()}\n });\n\npat=$(\"#ingredients\").val();\n\n // Callback handler for success\n\n request.done(function (response,textStatus, jqXHR){\n formatSearchResults(response);\n console.log(pat)\n });\n\n // Callback handler for failure\n\n request.fail(function (jqXHR, textStatus, errorThrown){\n $(\"#search-results-heading\").text(\"Sorry We Unable to fetch Covid Data.Try again.\");\n $(\"#results\").text(\"\");\n });\n\n // Callback handler that will be called in any case\n\n request.always(function () {\n // Reenable the inputs\n setFormDisabledProps(false);\n });\n\n}", "title": "" }, { "docid": "ac0b0902f05203408b8932f96b59a125", "score": "0.5423385", "text": "function searchData(input){\t\t\n\t\tcheckEmail(input);\n\t\tcheckPhone(input);\n\t\tcheckPlaces(input);\n}", "title": "" }, { "docid": "4340477a2905cede30e9f1879e0d68d2", "score": "0.5422898", "text": "function jsonData(jsonLink, source) {\n $.ajax({\n url: jsonLink,\n data: {\n // q: \"select title,abstract,url from search.news where query=\\\"cat\\\"\",\n format: \"json\"\n },\n // Work with the response\n success: function( response ) {\n popUpToggle(\"off\");\n if(source === \"Mashable\"){\n mashableAssignments(response);\n }\n else if(source === \"BBC\"){\n bbcAssignments(response);\n }\n else if(source === \"weather\"){\n weatherAssignments(response);\n }\n },\n error: function() {\n alert('Error: Cannot load page');\n }\n });\n}", "title": "" }, { "docid": "eff7d0f7fa4877ff81f2e65f412b5f65", "score": "0.5418826", "text": "function makeAPICall( value ) {\n $( \"#results\" ).html( \"<p>Loading</p>\" );\n $( \".output\").show();\n $.ajax({\n url: \"http://127.0.0.1/api.php\",\n data: { \"type\": \"getPrimeNumbers\", \"value\": value },\n error: function() {\n $( \"#results\" ).html( \"<p>An error has occurred</p>\" );\n },\n dataType: 'json',\n success: function( results ) {\n $( \"#results\").html( results.join( \", \" ) );\n },\n failure: function( data ) {\n $( \"#results\" ).html( \"<p>An error has occurred</p>\" );\n },\n type: 'POST'\n });\n}", "title": "" }, { "docid": "3284f17c510ae83bfa3a967f320262e3", "score": "0.5417047", "text": "function getAnswer() {\n $.ajax({\n method: 'GET',\n url: '/calc',\n }).then(function(response) {\n console.log('GET calc info: ', response);\n render(response);\n }).catch(function(error) {\n console.log('Something went wrong');\n alert('Something went wrong')\n })\n}//getAnswer END", "title": "" }, { "docid": "e8de66000f3370f426a1a7966dd1f4a3", "score": "0.5415628", "text": "function getData(parameter)\n{\n return document.getElementById(parameter).value;\n}", "title": "" }, { "docid": "ed563001740f54b052581ab9db23b52e", "score": "0.54154754", "text": "function getRecordByPhoneNum(phonenum, callback) {\r\n\r\n\t$.ajax({\r\n\t\t\turl: 'http://98.217.116.98/retrieve_user_details.php',\r\n\t\t\ttype: \"POST\", \r\n\t\t\tdata: {phonenum: phonenum},\t// use phone numer as the key to query\r\n\t\t\tdataType: \"json\",\r\n\t\t\tsuccess: function(response){\r\n\r\n\t\t\t// send the response (JSON) to the callback\r\n\t\t\t\tcallback(response);\r\n\t\t\t\t},\r\n\t\t\terror: function () {\r\n\r\n\t\t\t\tdocument.getElementById(\"error\").innerHTML = \"Patient not found\";\r\n\t\t\t\t\r\n\t\t\t\t// clear the previous display\r\n\t\t\t\tdocument.getElementById(\"pname\").innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById(\"pmail\").innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById(\"pphone\").innerHTML = \"\";\r\n\r\n\t\t\t}\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "bf9ad7c97c4755625e0912dfe6203681", "score": "0.541538", "text": "function connToServ() {\r\n let num = document.getElementById(\"input_container\").value; //getting rooms number here from the html form\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n var ur = new URL('http://mycon/notAblender/databaseBackend.php');\r\n\r\n xhr.open(\"POST\", ur, true);\r\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\"); //encoding the request\r\n\r\n let RequestToPhp = \"num=\" + num;\r\n\r\n xhr.addEventListener(\"readystatechange\", () => {\r\n\r\n if (xhr.readyState === 4 && xhr.status === 200) {\r\n ParseTheResponse(xhr.response);\r\n }\r\n \r\n })\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n xhr.send(RequestToPhp);\r\n\r\n }", "title": "" }, { "docid": "adfe4c7ab13a53104439b45c280f3b18", "score": "0.54151404", "text": "function synchronizeInput() {\n $.ajax({\n type: 'GET',\n url: 'http://192.168.0.100/~sigueject/phonegap/ata.php',\n crossDomain: true,\n cache: false,\n data : 'getInput=' + window.name,\n success: function (data) {\n var data = $.parseJSON(data);\n if (data != null) {\n document.getElementById(\"inputWorkload\").innerHTML = data.ATA_ENTRADA;\n toggle(\"setInWorkload\");\n } else {\n toggle(\"setOutWorkload\");\n }\n }\n });\n}", "title": "" }, { "docid": "f707ec693c32016de2b18dc024424036", "score": "0.54041266", "text": "function readStock (data){\nfoodS=data.val();\n}", "title": "" }, { "docid": "2d40635af7701f16dc29679f66086d0d", "score": "0.5403053", "text": "function retrieveFromInput() {\r\n\r\n}", "title": "" }, { "docid": "2678e1f63adbef525abae82c47b4d1dc", "score": "0.5401207", "text": "function GetMyId(input)\n{\n\tjQuery.extend({\n\t\tGetUser: function(type) \n\t\t{\t\n\t\t\tvar result = null;\n\t\t\t$.ajax({\n\t\t\tmethod: \"POST\",\n\t\t\turl: \"onlineMyId.php\",\n\t\t\tasync : false,\n\t\t\tdata: { user_type: type },\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(data) {\n\t\t result = data;\n\t\t }\n\t\t\t});\n\t\t\t return result;\n\t\t}\n\t});\n\tvar tem= $.GetUser(input);\n\treturn tem;\n}", "title": "" }, { "docid": "ee0b49ce8de717751e66581e5703079c", "score": "0.5400982", "text": "async function fetchApi(input) {\n\n // check options are selected\n if (searchSelect.selectedIndex === 0 || searchSelect.selectedIndex === 1) {\n let url = `${baseUrl}&apiKey=${api_key}&query=${input}&number=10&offset=0&minFat=0&minCarbs=0&minCalories=0`;\n await fetch(url)\n .then(\n (response) => response.json()\n )\n .then(function (response) {\n console.log(response.results);\n createDiv(response.results);\n })\n } else {\n let url = `${baserUrlIngr}&apiKey=${api_key}&ingredients=${input}&number=10`;\n await fetch(url)\n .then(\n (response) => response.json()\n )\n .then(function (response) {\n console.log(response);\n createDivIngredients(response);\n })\n }\n\n}", "title": "" }, { "docid": "81ef58dc46a7da0d157ca0f513cac805", "score": "0.5400747", "text": "function foodDisplay() {\nvar userFood = $(\"#food-input\").val();\t\t// had to include user's response in search\n$.ajax({\n url: \"https://api.giphy.com/v1/gifs/search?q=\" + userFood + \"&api_key=Hoj2gICqMvbl7IYI8j8nNdHz8Or5bbde&limit=10&rating=g\",\n method: \"GET\"\n }).done(function(response) {\n console.log(response);\n\n\n\n \t}); // end of ajax call\n} // end of foodDisplay", "title": "" }, { "docid": "fa2d4a05d8ae185e03faedfe97a27c44", "score": "0.5400273", "text": "function getTypeFee(val){\n\tif(val != ''){\n\t\t$.get(\"../ajax/gettypefee.php?fid=\" + val , function(data, status){\n\t\t\t$(\"#txtStAmount\").val(data);\n\t\t});\n\t}\n\telse{\n\t\talert('Please select any type');\n\t}\n}", "title": "" }, { "docid": "def2699adcfaa8710889612a475fbafd", "score": "0.5398929", "text": "function submitQuery() {\n\n // Grab the query from the page\n var query = $('#query').val();\n var idField = $('#id').val();\n\n // Launch an AJAX request to query the system\n var searchUrl = \"/search\";\n var ajaxRequest = $.getJSON(searchUrl, {\n 'query' : query,\n 'idField' : idField\n }, function(data) {\n handleResponse(data, query);\n });\n}", "title": "" }, { "docid": "7845d790811393080a4651325abe792f", "score": "0.539841", "text": "function getData()\r\n{\r\n const BREW_URL = \"https://api.openbrewerydb.org/breweries?\";\r\n \r\n let url = BREW_URL;\r\n \r\n let city = document.querySelector(\"#searchTerm\").value;\r\n displayTerm = city;\r\n \r\n city = city.trim();\r\n city = encodeURIComponent(city);\r\n \r\n let state = document.querySelector(\"#stateSelector\").value;\r\n \r\n let type = document.getElementsByName(\"type\");\r\n \r\n if(city.length > 0)\r\n {\r\n url = url + \"by_city=\" + city;\r\n if(state != \"\")\r\n {\r\n url = url + \"&by_state=\" + state;\r\n }\r\n for(let i = 0; i < type.length; i++)\r\n {\r\n if(type[i].checked)\r\n url = url + \"&by_type=\" + type[i].value;\r\n }\r\n }\r\n else if(state != \"\")\r\n {\r\n url = url + \"by_state=\" + state;\r\n for(let i = 0; i < type.length; i++)\r\n {\r\n if(type[i].checked)\r\n url = url + \"&by_type=\" + type[i].value;\r\n }\r\n }\r\n else\r\n {\r\n for(let i = 0; i < type.length; i++)\r\n {\r\n if(type[i].checked && type[i].value != \"\")\r\n url = url + \"by_type=\" + type[i].value;\r\n }\r\n if(url == BREW_URL)\r\n return;\r\n }\r\n url = url + \"&per_page=50\";\r\n \r\n document.querySelector(\"#results\").innerHTML = \"<b>Searching for \" + displayTerm + \".</b>\";\r\n \r\n $.ajax({\r\n dataType: \"json\",\r\n url: url,\r\n data: null,\r\n success: jsonLoaded\r\n });\r\n}", "title": "" }, { "docid": "e570c255fbb30d822c94c666c8482043", "score": "0.53970045", "text": "function request_search(form)\n{\n var url = './task.php';\n var title_val = form.taskInput.value;\n \n //call ready state changed and set is value to response\n ajax.onreadystatechange = request_response;\n ajax.open('POST', url, true);\n \n ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n ajax.send('taskInput='+ title_val);\n}", "title": "" }, { "docid": "aa5f0fd5a118e09b587b7f6c389f3f20", "score": "0.53934723", "text": "function addInfo() {\n let firstNumber = $('#first-number').val();\n let secondNumber = $('#second-number').val();\n let symbol = activeSymbol;\n\n if (firstNumber === '' || secondNumber === '') {\n return alert('Please fill in all fields')\n }\n\n $.ajax({\n method: 'POST',\n url: '/calc',\n data: {\n firstNumber: firstNumber,\n secondNumber: secondNumber,\n symbol: symbol,\n }\n }).then(function(response) {\n $('#first-number').val('');\n $('#second-number').val('');\n getAnswer();\n }).catch(function(error) {\n console.log('Something went wrong');\n alert('Something went wrong');\n })\n}//addInfo END", "title": "" }, { "docid": "eaa952142fde3d993bc7b77f674d7c1c", "score": "0.5390907", "text": "function readStock(data){\n\n foodS = data.val();\n}", "title": "" }, { "docid": "a1d4637fedacce4ba8f1ef5e8fd5b5d7", "score": "0.5385945", "text": "function getInput() {\n var url = el.value;\n inputRet(url);\n}", "title": "" }, { "docid": "37950df88f48a124d1c2e0b9bf10a181", "score": "0.53843564", "text": "function request( data ) {\n\t\t$( '.loading' ).show();\n\t\t$.post( ajaxurl, data, function( r ) {\n\t\t\t$( '.loading' ).hide();\n\t\t\tshowResult( r );\n\t\t}, 'json' );\n\t}", "title": "" }, { "docid": "51a1ccd09ebfc2f948612b8f817b512f", "score": "0.5378757", "text": "function returnData(input){ \n if (input>=10) {\n return input\n } else {\n return \"0\" + input\n }\n}", "title": "" } ]
2d8c5da65621d9121ce5a38413a41247
Start up function to load tabspaces from chrome.storage and display them as Buttons on the home page. Invokes setButtonClick function afterwards to set OnClick attributes for the generated buttons
[ { "docid": "639c6bd457e49043a288351f21c54256", "score": "0.7231265", "text": "function displayButtons(){\n chrome.storage.sync.get(null, function(result){\n $('#generateTabs').empty();\n\n console.log(\"in display button:\", result); \n for(objects in result){\n var tabObject = result[objects];\n console.log(\"tabObject: \" , tabObject);\n var name = tabObject.name;\n var html = buildButton(name);\n $('#generateTabs').append(html); \n }\n \n });\n setTimeout(setButtonClick, 1000);\n}", "title": "" } ]
[ { "docid": "4de523b36d82998802fc4752ffcea6a6", "score": "0.7240251", "text": "function grabTabs_Callback(openTabs){ \n var tempblacklist = [\"myspace.com\"];\n\n //var name = prompt(\"Enter a Name for the Tabspace:\", \"my tabspace\");\n var name = document.getElementById(\"textbox-name\").value; \n if (name == \"\"){\n name = \"tabspace\" + count;\n }\n\n var createdTabspace = new Tabspace(name);\n createdTabspace.linksArray = openTabs;\n createdTabspace.blocksArray = tempblacklist;\n\n\n var html = buildButton(name);\n $('#generateTabs').append(html); \n var save = {};\n save[name] = createdTabspace;\n\n chrome.storage.sync.set(save); \n setButtonClick(); \n}", "title": "" }, { "docid": "d07d9834866a8443f864b5fc90da385c", "score": "0.7027375", "text": "initTabs() {\n for(let tab_name of this.tab_names) {\n let tab_id = \"\" + tab_name + \"-tab\";\n let button = document.getElementById(tab_id);\n\n button.onmousedown = (event) => {\n /* Update the list currently viewed */\n this.appModel.loadTab(tab_name);\n ResourceManager.stopTime = false;\n }\n }\n }", "title": "" }, { "docid": "4ca1db3448b465f315a0ec8bc556a92c", "score": "0.67761517", "text": "function saveTS(){\n var substring = \"https://\";\n var name = document.getElementById(\"textbox-name\").value;\n tabspace = new Tabspace(name);\n $(\"#list-add li\").each(function() { \n var fullSiteName = \"\";\n var sitename = $(this).text();\n \n if(sitename.includes(substring) !== true){ \n fullSiteName = substring.concat(sitename); \n }else{\n fullSiteName = sitename; \n }\n tabspace.linksArray.push(fullSiteName); \n });\n $(\"#list-block li\").each(function() { tabspace.blocksArray.push($(this).text()) });\n\n // chrome.storage.local.get(null, function(result){ //result always undefined, not used \n // var totalObjects = {};\n // totalObjects[tabspace.name] = tabspace;\n // chrome.storage.sync.set(totalObjects); \n // });\n\n var totalObjects = {};\n totalObjects[tabspace.name] = tabspace;\n chrome.storage.sync.set(totalObjects); \n //Append button to DOM\n var html = buildButton(name);\n \n $('#generateTabs').append(html); \n //Set On Click attribute\n setButtonClick();\n}", "title": "" }, { "docid": "62f4919f0e1cdd9cf3c4e14a114084a5", "score": "0.6499134", "text": "function initTabs() {\n for (let n of document.getElementsByClassName('ed-tab')) {\n n.onclick = () => {\n switchTab(n.id)\n }\n }\n\n for (let n of document.getElementsByClassName('ed-tab-in')) {\n tab_ins[n.id] = n\n }\n\n console.info('tabs initialized')\n}", "title": "" }, { "docid": "b78e8fb6e894f70886ae35737288fba1", "score": "0.6419441", "text": "function initialPage() {\n $('#mainContainer').empty();\n var button = $('<button>');\n button.attr('id', \"start\");\n $('#mainContainer').append(button)\n button.addClass(\"button\")\n button.text('Start')\n $('#start').on(\"click\", function(e) {\n console.log(\"Start Button - Clicked\");\n restartGame();\n restartQuestions();\n playing();\n });\n\n}", "title": "" }, { "docid": "8ad2d6e4e0b90489ae364865c4a59e1c", "score": "0.6409471", "text": "function btnGoTab0() {\n updateData();\n goTab0();\n console.log(\"to Project Setup\");\n}", "title": "" }, { "docid": "1404b07f35d33b57c0c1aa9a132ce1b5", "score": "0.6356905", "text": "function MEX_BtnTabClicked(btn) {\n console.log( \"===== MEX_BtnTabClicked ========= \", btn);\n console.log( \"mod_MEX_dict.partex_dict\", mod_MEX_dict.partex_dict);\n\n if(btn){\n const data_btn = get_attr_from_el(btn,\"data-btn\");\n mod_MEX_dict.sel_tab = (data_btn) ? data_btn : \"tab_start\";\n }\n console.log( \"mod_MEX_dict.sel_tab\", mod_MEX_dict.sel_tab);\n\n// --- highlight selected button\n if(el_MEX_btn_tab_container){\n b_highlight_BtnSelect(el_MEX_btn_tab_container, mod_MEX_dict.sel_tab)\n }\n// --- show only the elements that are used in this option\n let tab_show = (mod_MEX_dict.is_permit_same_school) ? \"tab_answers\" : mod_MEX_dict.sel_tab;\n\n mod_MEX_dict.is_keys_mode = (mod_MEX_dict.sel_tab === \"tab_keys\");\n\n b_show_hide_selected_elements_byClass(\"tab_show\", tab_show, el_MEXQ_questions);\n\n MEXQ_show_btnpage();\n\n if ([\"tab_assign\", \"tab_answers\", \"tab_keys\", \"tab_minscore\"].includes(tab_show)) {\n MEX_BtnPageClicked()\n };\n\n //console.log( \"mod_MEX_dict.partex_dict\", mod_MEX_dict.partex_dict);\n } // MEX_BtnTabClicked", "title": "" }, { "docid": "0d7e896fc7af19861723dd342e4a3f20", "score": "0.6225951", "text": "function displaySettingsBackgroundTabs() {\r\n var $tabButton = $(\".settings-background-tab-button[data-settings-tabid=\" + getSettingsBackgroundTabId() + \"]\");\r\n $tabButton.tab('show');\r\n addSelectedTxt();\r\n blinkActiveSortType();\r\n}", "title": "" }, { "docid": "1a56af502a3f4222f4c32707241e0f8a", "score": "0.6121722", "text": "_setTabButtonAttributes () {\n this.tabs.forEach(tab => {\n Component.setAttributeIfNotSpecified(tab, 'type', 'button')\n })\n }", "title": "" }, { "docid": "81edd3f85c86c627d4ec7032b33db96a", "score": "0.6121562", "text": "function startPage (){\n myButtons();\n}", "title": "" }, { "docid": "5ab8eff795390df972a427e6de009aaf", "score": "0.6121187", "text": "function btnClickEventListener(){\n var btn=tabsgroups[s].querySelectorAll(\"button.link\");\n for(let i=0;i<btn.length;i++){\n let text=btn[i].innerHTML.split(\" \")[0].toLowerCase();\n let tab=document.getElementById(text);\n btn[i].addEventListener('click',()=>activateTab(tab))\n }\n }", "title": "" }, { "docid": "200fca192bef56bb9ec89c69dde1de54", "score": "0.6107632", "text": "function setUpButtonFunctions() {\n element(\"button-delete\").onclick = removeLetterEntry;\n element(\"button-shuffle\").onclick = shuffleScreenKeys;\n element(\"button-enter\").onclick = enterWord;\n}", "title": "" }, { "docid": "6ec933b6af6d5fd20108a2940558b7ae", "score": "0.6079499", "text": "function initTabs()\n{\n //Local variables\n var i, tablinks;\n //Get elements by class name\n tabLinks = byClass(LINKS_CLASS_NAME);\n //Loop to add onclick listeners \n for (i = 0; i < tabLinks.length; i++)\n tabLinks[i].onclick = function(){ openTab(this); };\n //Add listeners to open a link by chrome\n //Get the list of links\n var tabALinks = byClass(ABOUT_CLASS_NAME);\n for (i = 0; i < tabALinks.length; i++)\n tabALinks[i].onclick = function(){ openLink(this.href); };\n}", "title": "" }, { "docid": "cc4b3ed45846eb3430fae524d27c717a", "score": "0.6039573", "text": "function addTab() {\n var workspaceTab = createTabElement();\n var newContainer = createContainerElement();\n \n}", "title": "" }, { "docid": "d2b27d9694d9f9d8ce79ef352b4c046e", "score": "0.60210294", "text": "function onCreateWorkflowyTab(tab) {\n createUIelems()\n}", "title": "" }, { "docid": "55910bed467a952d12c44b070acea2e8", "score": "0.60116494", "text": "function buttonManager() {\n \t\tvar bar = document.getElementById('bookmark_bar');\n \t\tvar button = document.getElementById(\"toggle\");\n\t\t$(button).click(function() {\n\t\t\tif (window.getComputedStyle(bar).opacity === '0') {\n\t\t\t\t$(bar).css(\"opacity\",\"1\");\n\t\t\t\t$(bar).css(\"pointer-events\",\"auto\");\n\t\t\t\tchrome.cookies.set({\n\t\t\t\t\tname: \"bookmark_toggle\",\n\t\t\t\t\tvalue: \"1\",\n\t\t\t\t\turl:\"http://localhost:8080\",\n\t\t\t\t\texpirationDate: Date.now() + 126227808000 //4 years\n\t\t\t\t});\n\t\t\t\tdocument.getElementById(\"button_back\").style.opacity = 0.9;\n\t\t\t\tbutton.title = \"hide bookmark bar\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(bar).css(\"opacity\",\"0\");\n\t\t\t\t$(bar).css(\"pointer-events\",\"none\");\n\t\t\t\tchrome.cookies.set({\n\t\t\t\t\tname: \"bookmark_toggle\",\n\t\t\t\t\tvalue: \"0\",\n\t\t\t\t\turl:\"http://localhost:8080\",\n\t\t\t\t\texpirationDate: Date.now() + 126227808000 //4 years\n\t\t\t\t});\n\t\t\t\tdocument.getElementById(\"button_back\").style.opacity = 0;\n\t\t\t\tbutton.title = \"show bookmark bar\";\n\t\t\t}\n\t\t});\n \t}", "title": "" }, { "docid": "0be09dd15bd5a6a4db8eb0e3a15102b7", "score": "0.60057896", "text": "function dl_buttons() {\r\n\t// button for each story\r\n\tfor (var set of set_list.sets) {\r\n\t\tvar set_i = set_list.sets.indexOf(set);\r\n\t\tvar set_ele = gcl(\"set\")[set_i];\r\n\t\tfor (var story of set) {\r\n\t\t\tvar story_i = set.indexOf(story);\r\n\t\t\t// story text button\r\n\t\t\tvar button = document.createElement(\"button\");\r\n\t\t\tbutton.className = \"story_catcher\";\r\n\t\t\tif (!(story.illustrationUrls.active.substr(39,40) in icons)){\r\n\t\t\t\tbutton.className = \"story_catcher not\";\r\n\t\t\t}\r\n\t\t\tbutton.setAttribute(\"ref\", story.id);\r\n\t\t\tbutton.addEventListener(\"click\", function(){request_story(this)});\r\n\t\t\tset_ele.insertBefore(button, set_ele.getElementsByClassName(\"story\")[story_i + 1]);\r\n\t\t}\r\n\t}\r\n\t//add_all_button(\"all_stories\", \"Get all stories for the forum\", () => all_forum());\r\n\t//add_all_button(\"all_sheets\", \"Get all stories for Google sheets\", () => all_sheets());\r\n\t//add_all_button(\"all_overview\", \"Get all stories for forum overview\", () => all_overview());\r\n}", "title": "" }, { "docid": "9f090881129c72a6c136fef1ee683809", "score": "0.5992695", "text": "function openPage(pageName, button){\n\n //get all the tab buttons\n let tablinks = document.getElementsByClassName('tablink');\n\n //get tabs\n let tabcontents = document.getElementsByClassName('tabcontent');\n\n\n //foreach buttons\n for (let i = 0; i < tablinks.length; i++){\n //\n //remove the 'selected' class if it's \n // not the caller with innerHTML\n //\n if(tablinks[i].innerHTML == button.innerHTML)\n tablinks[i].classList.add('tablink-selected');\n else\n tablinks[i].classList.remove('tablink-selected')\n }\n\n\n //foreach tabs\n for (let i = 0; i < tabcontents.length; i++) {\n //\n //hide unselected tabs with id\n //\n if(tabcontents[i].id != pageName)\n tabcontents[i].style.display = 'none';\n else\n tabcontents[i].style.display = 'block';\n }\n}", "title": "" }, { "docid": "008907d2bc3f6f1e0a2fd19f99e4b3aa", "score": "0.59679914", "text": "function init()\n {\n buildRandomTab();\n\n }", "title": "" }, { "docid": "195734d9fe4aeb552d3ee710d42a47b0", "score": "0.5958889", "text": "function initButtons() {\n\t\t\t\t\t$(\".show-first-resources\").click(function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tinstance.manager.changeStart(0);\n\t\t\t\t\t});\n\t\t\t\t\t$(\".show-last-resources\").click(function(event) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tinstance.manager.showLastPage();\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "4b723e847f93008f9ff719781bbbdd61", "score": "0.59565234", "text": "function addXButtons (tabHTML) {\n var button = $(tabHTML).find(\".geoLingTabButton\")[0];\n $(button).css(\"visibility\", \"visible\");\n}", "title": "" }, { "docid": "3c2e1d34d0faaa22e64424302793d114", "score": "0.5947305", "text": "function firstRun(extensions) {\n let extension = extensions.get('jid0-lUPopEcEr3ZFpGFCiUHsCV3lDOw@jetpack');\n if (extension.firstRun) {\n\n // add button here.\n // Force toolbarbutton to be on nav-bar\n var navbar = document.getElementById(\"nav-bar\");\n var newset = navbar.currentSet;\n if (newset.indexOf(\"tapiture-button\") == -1) {\n if (newset.indexOf(\"reload-button,stop-button,\") > -1) {\n newset = newset.replace(\"reload-button,stop-button,\", \"reload-button,stop-button,tapiture-button,\");\n } else {\n newset = newset + \",tapiture-button\";\n }\n navbar.currentSet = newset;\n navbar.setAttribute(\"currentset\", newset);\n // document.persist(\"nav-bar\", \"currentset\");\n }\n\n }\n}", "title": "" }, { "docid": "fd59d65b7db13de2ce6b5d9de4e20478", "score": "0.5944193", "text": "function displayCatalogue() {\n var buttons = document.createElement(\"DIV\");\n buttons.id = \"buttons\";\n document.body.appendChild(buttons);\n var hideCatalogue = document.createElement(\"BUTTON\");\n hideCatalogue.innerHTML = \"Hide Catalogue\";\n document.body.appendChild(hideCatalogue);\n hideCatalogue.onclick = function () {\n hideCatalogue.parentNode.removeChild(hideCatalogue);\n buttons.parentNode.removeChild(buttons);\n for (var i = 0; i < isVisible.length; i++) {\n isVisible[i] = \"no\";\n }\n }\n // catalogueVals is arranged as: [name, description, price]\n chrome.storage.local.get({catalogueVals: [[]]}, function(result) {\n var catalogueVals = result.catalogueVals;\n for(var i = 0; i < catalogueVals.length; i++) {\n if (isVisible[i] != \"yes\" && catalogueVals[i] != undefined) {\n isVisible[i] = \"yes\";\n createCatButton(catalogueVals[i], catalogueVals[i][2], i);\n }\n }\n });\n}", "title": "" }, { "docid": "ceef68bf60672f98355f5ffd4dd42f38", "score": "0.5930885", "text": "function initOptions(){\r\n console.log(\"Initiating Options\");\r\n buttons.options.side = localStorage.getItem('btnSide'); //true - Right, false - Left\r\n buttons.options.combatLock = localStorage.getItem('isCombatLocked'); //true - Yes, false - No\r\n if (buttons.options.side == null) {\r\n buttons.options.side=true;\r\n localStorage.setItem('btnSide', true);\r\n }\r\n if (buttons.options.combatLock == null) {\r\n buttons.options.combatLock=true;\r\n localStorage.setItem('isCombatLocked', true);\r\n }\r\n\tvar application = qx.core.Init.getApplication();\r\n\tvar bas = application.getUIItem(ClientLib.Data.Missions.PATH.BAR_ATTACKSETUP);\r\n var bs = stob(localStorage.getItem('btnSide'));\r\n var opBtn = new qx.ui.form.Button(\"O\");\r\n if (bs) opBtn.set({ width: 30, \r\n height: 30,\r\n toolTipText: \"Addons Options\"\r\n });\r\n else opBtn.set({ width: 76, \r\n height: 30,\r\n toolTipText: \"Addons Options\"\r\n });\r\n boxes.options = new qx.ui.window.Window(\"Optons\");\r\n opBtn.addListener(\"click\", function(){\r\n boxes.options.setPadding(1);\r\n boxes.options.setLayout(new qx.ui.layout.VBox(1));\r\n boxes.options.setShowMaximize(false);\r\n boxes.options.setShowMinimize(false);\r\n boxes.options.moveTo(125, 525);\r\n boxes.options.setHeight(100);\r\n boxes.options.setWidth(200);\r\n if (boxes.options.isVisible()) {\r\n boxes.options.close();\r\n return;\r\n }\r\n else boxes.options.open();\r\n },this);\r\n if (bs) bas.add(opBtn, { left: null, right: 66, bottom: 80 });\r\n else bas.add(opBtn, { right: null, left: 6, bottom: 80 });\r\n \r\n var tabView = new qx.ui.tabview.TabView();\r\n tabView.setPadding(5);\r\n boxes.options.add(tabView);\r\n ////////////////// Buttons ////////////////////\r\n var btnTab = new qx.ui.tabview.Page(\"Buttons\");\r\n btnTab.setLayout(new qx.ui.layout.VBox(5));\r\n btnTab.setPadding(1);\r\n ////////////////// Buttons Side ////////////////////\r\n var eHBox = new qx.ui.container.Composite()\r\n eHBox.setLayout(new qx.ui.layout.HBox(5));\r\n eHBox.setThemedFont(\"bold\");\r\n eHBox.setThemedPadding(2);\r\n eHBox.setThemedBackgroundColor(\"#eef\");\r\n eHBox.add(new qx.ui.basic.Label(\"Side: \"));\r\n var leftBtn = new qx.ui.form.Button(\"L\");\r\n var rightBtn = new qx.ui.form.Button(\"R\"); \r\n leftBtn.set({ width: 20, \r\n appearance: \"button-text-small\",\r\n toolTipText: \"Moves Buttons To The Left\"\r\n \r\n });\r\n rightBtn.set({ width: 20, \r\n appearance: \"button-text-small\",\r\n toolTipText: \"Moves Buttons To The Right\"\r\n \r\n });\r\n leftBtn.addListener(\"click\",function(){\r\n /////Options Button//////\r\n bas.remove(opBtn);\r\n opBtn.set({width:76});\r\n bas.add(opBtn, { right: null, left: 6, bottom: 80 });\r\n /////Tools Button//////\r\n bas.remove(buttons.interface.tools);\r\n buttons.interface.tools.set({width:76});\r\n bas.add(buttons.interface.tools, { right: null, left: 6, bottom: 42 });\r\n /////Simulate Button//////\r\n bas.remove(buttons.interface.simulate);\r\n buttons.interface.simulate.set({width:76});\r\n bas.add(buttons.interface.simulate, { right: null, left: 6, bottom: 4 });\r\n /////Shift Button//////\r\n bas.remove(buttons.interface.formation);\r\n buttons.interface.formation.set({width:76});\r\n bas.add(buttons.interface.formation, { right: null, left: 6, bottom: 118 });\r\n \r\n \r\n leftBtn.setOpacity(1);\r\n rightBtn.setOpacity(0.5);\r\n localStorage.setItem('btnSide', false);\r\n },this);\r\n \r\n rightBtn.addListener(\"click\",function(){\r\n /////Options Button//////\r\n bas.remove(opBtn);\r\n opBtn.set({width:30});\r\n bas.add(opBtn, { right: 66, left: null, bottom: 80 });\r\n /////Tools Button//////\r\n bas.remove(buttons.interface.tools);\r\n buttons.interface.tools.set({width:30});\r\n bas.add(buttons.interface.tools, { right: 66, left: null, bottom: 42 });\r\n /////Simulate Button//////\r\n bas.remove(buttons.interface.simulate);\r\n buttons.interface.simulate.set({width:30});\r\n bas.add(buttons.interface.simulate, { right: 66, left: null, bottom: 4 });\r\n /////Shift Button//////\r\n bas.remove(buttons.interface.formation);\r\n buttons.interface.formation.set({width:30});\r\n bas.add(buttons.interface.formation, { right: 66, left: null, bottom: 118 }); \r\n \r\n rightBtn.setOpacity(1); \r\n leftBtn.setOpacity(0.5);\r\n localStorage.setItem('btnSide', true);\r\n },this);\r\n \r\n eHBox.add(leftBtn);\r\n eHBox.add(rightBtn); \r\n btnTab.add(eHBox);\r\n if (bs) {\r\n leftBtn.setOpacity(0.5);\r\n }\r\n else {\r\n rightBtn.setOpacity(0.5);\r\n }\r\n \r\n \r\n ////////////////// Unlock Combat //////////////////// \r\n var clHBox = new qx.ui.container.Composite()\r\n clHBox.setLayout(new qx.ui.layout.HBox(5));\r\n clHBox.setThemedFont(\"bold\");\r\n clHBox.setThemedPadding(2);\r\n clHBox.setThemedBackgroundColor(\"#eef\");\r\n clHBox.add(new qx.ui.basic.Label(\"Unlock: \"));\r\n var cl = stob(localStorage.getItem('isCombatLocked'));\r\n var onBtn = new qx.ui.form.Button(\"On\");\r\n var offBtn = new qx.ui.form.Button(\"Off\"); \r\n onBtn.set({ width: 35, \r\n appearance: \"button-text-small\",\r\n toolTipText: \"Enables Combat Unlock Button\"\r\n });\r\n offBtn.set({ width: 35, \r\n appearance: \"button-text-small\",\r\n toolTipText: \"Disables Combat Unlock Button\"\r\n \r\n });\r\n onBtn.addListener(\"click\",function(){\r\n localStorage.setItem('isCombatLocked', true);\r\n onBtn.setOpacity(1);\r\n offBtn.setOpacity(0.5);\r\n alert(\"This action will only take place after restarting the game\"); \r\n },this);\r\n \r\n offBtn.addListener(\"click\",function(){\r\n localStorage.setItem('isCombatLocked', false);\r\n onBtn.setOpacity(0.5);\r\n offBtn.setOpacity(1);\r\n alert(\"This action will only take place after restarting the game\");\r\n },this);\r\n \r\n clHBox.add(onBtn);\r\n clHBox.add(offBtn); \r\n btnTab.add(clHBox);\r\n tabView.add(btnTab);\r\n if (cl) {\r\n offBtn.setOpacity(0.5);\r\n }\r\n else {\r\n onBtn.setOpacity(0.5);\r\n } \r\n console.log(\"Options Initiation Completed\");\r\n}", "title": "" }, { "docid": "95deb83e5e6a2e5918e2c92ce1a90cec", "score": "0.58760643", "text": "function createButtons () {\n while (pastSearchArea.firstChild){\n pastSearchArea.removeChild(pastSearchArea.firstChild);\n }\n if(localStorage.getItem(\"PreviousCities\")!== null) {\n let recentCitiesList = JSON.parse(localStorage.getItem(\"PreviousCities\"));\n for (let i = 0; i < recentCitiesList.items.length; i++){\n let newButton = document.createElement(\"BUTTON\");\n newButton.innerHTML = recentCitiesList.items[i].City;\n newButton.setAttribute(\"type\", \"button\");\n newButton.setAttribute(\"class\", \"btn btn-primary recentBtn\");\n pastSearchArea.appendChild(newButton);\n }\n }\n}", "title": "" }, { "docid": "b01eb1315d6bf73392c16641367c2ed2", "score": "0.5863559", "text": "function ConfigTabs() {\n // solution set tabs \n $(\"#step_4 .ro-sol-tabs\").tabs(\"#ROSolutionTabs .ro-sol-tabpanes .ro-sol-tabpane\", {\n initialIndex: 0,\n onBeforeClick: function (e, index) {\n var title;\n // hide breadcrumb\n $(\".ro-breadcrumb\").show();\n // show back button\n $(\".ro-solution-back\").hide();\n //$(\".ro-recproducts\").hide();\n switch (index) {\n\n case 0:\n RecOfficeConfig.paneReady[0] = false;\n $('.ro-solution-set .ro-saveconfirm').html('<p><strong>This Solution Set has been Saved!</strong> Would you like to go back to Step 2 to choose an additional Business Need?&nbsp;&nbsp;&nbsp;<a class=\"selectbtn\" href=\"#go2Yes\" style=\"\"><span>Yes</span></a><a class=\"selectbtn\" href=\"#go2No\" style=\"\"><span>No</span></a></p>');\n $('.ro-solution-set .selectbtn.graybtn').css({\n 'opacity': '1'\n })\n $('.ro-solution-set .ro-saveconfirm').hide();\n title = \"Your Recommended Solution Set\";\n\n\n updateSavedSolList($(\".ro-solution-set .ro-myrecoffice-list ul\"), \"SavedSolutions\");\n\n break;\n case 1:\n // show breadcrumb\n $(\".ro-breadcrumb\").hide();\n // hide back button\n $(\".ro-solution-back\").show();\n\n title = \"Email Your Recommended Office\";\n\n updateSavedSolList($(\".ro-emailpane .ro-myrecoffice-list ul\"), \"SavedSolutions2\");\n break;\n case 2:\n SetSelectedMenuItem(4);\n title = \"My Recommended Office\";\n if (MyRecOffice.SolutionSets.length > 0) {\n RecOfficeConfig.buildAndSeekPane[\"MyRecOffice\"]();\n RecOfficeConfig.paneReady[\"MyRecOffice\"] = false;\n updateSavedSolList($(\".ro-myrecofficepane .ro-myrecoffice-list ul\"), \"SavedSolutions3\");\n\n } else {\n $(\"#step_4 .ro-myrecofficepane .ro-myrecoffice\").html(\"<h2>No Solution Sets Saved!</h2>\");\n }\n break;\n case 3:\n // show breadcrumb\n $(\".ro-breadcrumb\").hide();\n // hide back button\n $(\".ro-solution-back\").show();\n title = \"Potential Products\";\n break;\n case 4:\n SetSelectedMenuItem(5);\n title = \"Submit Your Recommended Office to a Vertafore Sales Consultant\";\n updateSavedSolList($(\".ro-contactpane .ro-myrecoffice-list ul\"), \"SavedSolutions2\");\n\n break;\n }\n\n $(\".ro-save-confirm\").hide();\n $(\".ro-save-cur-sol\").hide();\n $(\".ro-solution-set .selectbtn\").show();\n\n changeTitle(title);\n return true;\n },\n onClick: function (e, index) {\n ROCloseDialog();\n\n var paneId;\n switch (index) {\n // hide breadcrumb\n // show back button\n case 0:\n // show breadcrumb\n // hide back button\n paneId = \"SolutionSet\";\n\n break;\n case 1:\n paneId = \"EmailShare\";\n break;\n case 2:\n paneId = \"MyRecOffice\";\n\n break;\n case 3:\n paneId = \"ViewProducts\";\n break;\n case 4:\n paneId = \"ContactVertafore\"\n break;\n }\n\n if (RecOfficeConfig.paneReady[paneId] != true) {\n RecOfficeConfig.initPane[paneId]();\n RecOfficeConfig.setupUserSel[paneId]();\n }\n }\n });\n\n RecOfficeConfig.solutionTabApi = $(\"#step_4 .ro-sol-tabs\").data('tabs');\n\n $(\".ro-solution-back\").click(function (e) {\n e.preventDefault();\n RecOfficeConfig.solutionTabApi.click(0);\n\n });\n }", "title": "" }, { "docid": "c4419204c2f2f0c8507a8905e9709a1e", "score": "0.5844468", "text": "function renderUiTabs (onThis) { \r\n var tabsG = onThis.add(\"Group {orientation: 'stack'}\");\r\n var btnsG = tabsG.add(this.res); \r\n // clicked is a panel containing an empty statictext (initially invisible) which will be modified (position, bounds, st.text) by the btnsG buttons after 'click' event;\r\n tabsG.clicked = tabsG.add(\"Panel{visible: false, margins: [0,0,0,0], st:StaticText {justify: 'center'}}\");\r\n for (pr in this.buttons) {\r\n btnsG[pr] = renderUiElement.call(this.buttons[pr], btnsG);\r\n }\r\n }", "title": "" }, { "docid": "bc79e16e9091292e2e4b0ea5d4f26f01", "score": "0.5842254", "text": "function onLoad() {\n if (localStorage.getItem(\"charactername\") != \"\") {\n var characterStore = JSON.parse(localStorage.getItem(\"charactername\"));\n if (characterStore != null) {\n for (var i = 0; i < characterStore.length; i++) {\n var btn = $(\"<button>\");\n var lineBreak = $(\"li\");\n btn.addClass(\"searchAgain\");\n btn.text(characterStore[i]);\n searchHistory.append(btn);\n searchHistory.append(lineBreak);\n // btn.on(\"click\", function (event) {\n // characterName = event.target.textContent;\n // //youTubeVideo();\n // getAPI(characterName, renderCharacter);\n\n // });\n }\n }\n }\n}", "title": "" }, { "docid": "60f5660269b93605b79467d04d5cd8c9", "score": "0.58422214", "text": "function generateButtons() {\n for (let i = 0; i < Object.keys(dat.charts[0].data).length; i++) {\n let button = document.createElement(\"button\");\n button.setAttribute(\"id\", \"c-button_\"+i);\n button.classList.add(\"chart-button\", \"btn-sm\", \"btn-selector\");\n button.innerHTML = Object.keys(dat.charts[0].data)[i];\n // setting up first button as active\n if (i === 0) {\n button.classList.add(\"active\");\n }\n // setting up button actions\n button.addEventListener(\"click\", function() {\n analyzeState(); // checking current visible state\n myChart.data.datasets = generateDataSet(Object.keys(dat.charts[0].data)[i]); // generate datasets\n myChart.update(); // update chart\n clearState(); // clear buttons states\n this.classList.add(\"active\"); // set active to current\n })\n document.getElementById(\"myChartNav\").appendChild(button);\n }\n }", "title": "" }, { "docid": "0c4d4e4771c12611e211c9cfb9df4a59", "score": "0.58283716", "text": "function populateAoiTabs(activeFirst, aois, tabElementID) {\n\n // get element the tab will be appended to\n var tabElement = document.getElementById(tabElementID);\n\n var area;\n var type;\n var year;\n var aoiList;\n\n var index = 0;\n var tab;\n var button;\n var text;\n\n // for each area of interest\n for (aoi in aois) {\n\n // get aoi name\n area = aois[aoi][\"name\"] ;\n type = aois[aoi][\"type\"];\n year = aois[aoi][\"year\"];\n\n // create tab using bootstrap stuff\n tab = document.createElement(\"li\");\n tab.className = \"nav-item\";\n\n button = document.createElement(\"button\");\n button.setAttribute(\"id\", \"tab-\" + aois[aoi][\"id\"]);\n button.setAttribute(\"data-toggle\", \"tab\");\n button.setAttribute(\"role\", \"tab\");\n button.setAttribute(\"aria-controls\", \"dashboard\");\n button.setAttribute(\"style\", \"font-size:16px;\");\n button.setAttribute(\"onclick\", \"switchRequirements(aocs, doubles, slashes, '\" + area + \"', '\" + type + \"', 'summary')\");\n\n // if the tab is the first one made, make it active by default\n if (index == 0 && activeFirst) {\n button.className = \"nav-link active\";\n button.setAttribute(\"aria-selected\", \"true\");\n // if the tab is not the first one, do not make active\n } else {\n button.className = \"nav-link\";\n button.setAttribute(\"aria-selected\", \"false\");\n }\n\n // append elements together to create tab\n switch (type) {\n case \"divisional\":\n text = document.createTextNode(area + \" AOC \" + year);\n break;\n case \"double\":\n text = document.createTextNode(area + \" Double \" + year);\n break;\n case \"slash\":\n text = document.createTextNode(area + \" Slash \" + year);\n break;\n }\n\n button.appendChild(text);\n\n tab.appendChild(button);\n tabElement.appendChild(tab);\n\n // increment\n index++;\n }\n}", "title": "" }, { "docid": "367c79c67318999abf2f1e1fb9e4926b", "score": "0.5822386", "text": "function createButtons() {\n var storedCityNames = JSON.parse(localStorage.getItem('store-cities'));\n // TODO: try-catch block \n if (!storedCityNames) {\n // if there is no city name then exit the function \n return;\n\n }\n // loop through local storage \n // assign each city name to the button\n // clears button scope and populates it \n displayButtons.innerHTML = \"\";\n for (var i = 0; i < storedCityNames.length; i++) {\n var city_button = document.createElement('button');\n // display button name \n city_button.textContent = storedCityNames[i].cityName;\n city_button.setAttribute('data-index', storedCityNames[i].cityName);\n // update city name with the city name button that user just clicked on \n selectedCity = storedCityNames[i].cityName;\n console.log('Selected city: ', selectedCity);\n city_button.addEventListener(\"click\", buttonClicked);\n displayButtons.appendChild(city_button);\n // if the button is click, then display the information associated with it \n\n }\n}", "title": "" }, { "docid": "8d9014d7656a9bc1b28b9fcdd70b422e", "score": "0.58123684", "text": "function printStoreButtons(){\r\n\r\n var savedCities = localStorage.getItem(\"city list\");\r\n \r\n if(savedCities){\r\n \r\n savedCities = JSON.parse(savedCities);\r\n \r\n for(i=0; i<savedCities.length; i++){\r\n \r\n var newButton = document.createElement('button');\r\n newButton.innerHTML = savedCities[i];\r\n newButton.setAttribute(\"class\", \"stored-buttons\");\r\n \r\n newButton.addEventListener(\"click\", function(e){\r\n \r\n nameSearch = this.innerHTML;\r\n searchWeather(nameSearch);\r\n getUVIndex(coordinate);\r\n // futureForcasts(searchedCity);\r\n storeButtons(nameSearch);\r\n \r\n })\r\n \r\n savedCity.appendChild(newButton);\r\n \r\n }\r\n \r\n }\r\n }", "title": "" }, { "docid": "1b11d59e346b957c0cb036c7ce07df4f", "score": "0.579259", "text": "function putclickable(){\n // counter = window.localStorage.getItem('key');\n var nameforsplit = faces[counter].title;\n namesplitter = nameforsplit.split(\"\");\n for (var t = 0; t < namesplitter.length; t++){\n var btn = document.createElement(\"BUTTON\");\n var texts = document.createTextNode(namesplitter[t]);\n // btn.appendChild(texts);\n document.body.appendChild(btn);\n document.getElementById(\"clickable\").appendChild(btn);\n $('#clickable button').addClass(\"inputx\");\n //$('#clickable button').attr(\"onclick\", revclick());\n }\n}", "title": "" }, { "docid": "bd181dfa02d3112fb678686a789850c6", "score": "0.5788194", "text": "function getTab(in_file){\n var tab_ref = in_file.path +\"/\"+ in_file.filename;\n var cur_tab = getTabByRef(tab_ref);\n // Check if tab already exists.\n if (cur_tab){\n cur_tab.activate();\n return cur_tab;\n }\n // otherwise create new one\n var NEW_TAB = {\n id : TAB_ID++,\n file : in_file,\n type : in_file.type,\n active : false,\n tab_ref : tab_ref,\n tab_but_el : document.createElement(\"button\"),\n tab_content_el : document.createElement(\"div\"),\n tab_svg_el : document.createElement(\"div\"),\n scroll : 0,\n async refresh ( in_force ) {\n this.setContentEl( getLoadingImg(30) );\n switch (this.type.toLowerCase()){\n case \"puml\": \n this.setContentHtml( await retrievePuml( this.file, in_force || false ) );\n break;\n case \"md\" :\n this.setContentEl( await retrieveMd( this.file ) );\n break;\n }\n this.scroll = 0;\n },\n deactivate () { \n this.tab_but_el.classList.remove(\"active\");\n this.tab_content_el.style.display = \"none\";\n this.active = false;\n },\n activate() {\n Object.keys(LOADED_TABS).forEach((id) => {LOADED_TABS[id].deactivate();});\n this.tab_content_el.style.display = \"block\";\n this.tab_but_el.classList.add(\"active\");\n G_CURRENT_TAB = this;\n this.active = true;\n },\n delete () {\n this.tab_but_el.remove();\n this.tab_content_el.remove();\n delete LOADED_TABS[this.id]; \n window.location=\"#\";\n },\n setContentHtml (new_content) {\n console.log(\"Start rendering SVG\");\n this.tab_svg_el.innerHTML=new_content; // clean\n },\n setContentEl (new_content_el) {\n this.tab_svg_el.innerHTML=\"\"; // clean\n this.tab_svg_el.appendChild(new_content_el);\n }\n };\n NEW_TAB.tab_but_el.classList.add(\"tablinks\");\n NEW_TAB.tab_but_el.classList.add(\"active\"); // active by default\n NEW_TAB.tab_but_el.innerText = in_file.filename;\n NEW_TAB.tab_but_el.ref = tab_ref;\n NEW_TAB.tab_but_el.title = in_file.path;\n document.getElementById(\"tab_root_el\").appendChild(NEW_TAB.tab_but_el);\n\n // Create tab Content\n NEW_TAB.tab_content_el.classList.add(\"tabcontent\");\n document.getElementById(\"content_root_el\").appendChild(NEW_TAB.tab_content_el);\n\n // Header to force reload\n var content_refresh_el = document.createElement(\"span\");\n content_refresh_el.innerHTML = \"<b>(Force Refresh)</b>\";\n content_refresh_el.style.cursor = \"pointer\";\n content_refresh_el.addEventListener(\"click\", () => {\n NEW_TAB.refresh(true); \n });\n NEW_TAB.tab_content_el.appendChild(content_refresh_el);\n\n var content_dlpng_el = document.createElement(\"span\");\n content_dlpng_el.innerHTML = \" - <b>(Download as PNG)</b>\";\n content_dlpng_el.style.cursor = \"pointer\";\n content_dlpng_el.addEventListener(\"click\", () => {\n let xhr = new XMLHttpRequest();\n let qparams = formatParams({ file : in_file.filename, dir : in_file.path});\n xhr.open('GET', 'api/getpngfromfile'+qparams);\n //set the reponse type to blob since that's what we're expecting back\n xhr.responseType = 'blob';\n xhr.send(); \n xhr.onload = function(e) {\n if (this.status == 200) {\n // Create a new Blob object using the response data of the onload object\n var blob = new Blob([this.response], {type: 'image/png'});\n //Create a link element, hide it, direct it towards the blob, and then 'click' it programatically\n let a = document.createElement(\"a\");\n a.style = \"display: none\";\n document.body.appendChild(a);\n //Create a DOMString representing the blob and point the link element towards it\n let url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = in_file.filename+ '.png';\n //programatically click the link to trigger the download\n a.click();\n //release the reference to the file by revoking the Object URL\n window.URL.revokeObjectURL(url);\n }else{\n //deal with your error state here\n }\n };\n/*\n var url = location.origin + \"/api/getpngfromfile?file=\" + decodeURIComponent(in_file.filename) + \"&dir=\" + decodeURIComponent(in_file.path);\n var win = window.open(url, '_blank');\n win.focus();*/\n });\n \n NEW_TAB.tab_content_el.appendChild(content_dlpng_el);\n\n // Will hold svg image\n NEW_TAB.tab_svg_el.style.textAlign=\"center\";\n NEW_TAB.setContentEl( getLoadingImg(30) );\n NEW_TAB.tab_content_el.appendChild(NEW_TAB.tab_svg_el);\n\n // when click on the tab button\n NEW_TAB.tab_but_el.addEventListener(\"click\", function(e){ \n window.location = \"#view?\" + tab_ref;\n //NEW_TAB.activate();\n });\n // when Dblclick on the tab button --> Remove it\n NEW_TAB.tab_but_el.addEventListener(\"dblclick\", function(e){ \n NEW_TAB.delete();\n });\n LOADED_TABS[ NEW_TAB.id ] = NEW_TAB;\n NEW_TAB.activate();\n NEW_TAB.refresh();\n return NEW_TAB;\n}", "title": "" }, { "docid": "904bc7ae5a5ef263fddd9589a9ca9b9a", "score": "0.57856226", "text": "function initButtons () {\n\n // reset button\n $(analytics.csts.css.reset).click(function() {\n display.filterAll();\n display.redraw();\n }\n );\n\n // resize button\n var paddingTopInit = $('body').css('padding-top');\n var headerInitHeight = $(analytics.csts.css.header).height();\n var interfaceInitTop = $(analytics.csts.css.columns).cssUnit('top'); // ex : [100, 'px']\n\n $(analytics.csts.css.resize).click(function() {\n $(analytics.csts.css.header).toggle();\n\n if ($(analytics.csts.css.header).is(':hidden')) {\n $(analytics.csts.css.columns).css('top', interfaceInitTop[0] - headerInitHeight + interfaceInitTop[1]);\n $('body').css('padding-top', '0');\n }\n else {\n $(analytics.csts.css.columns).css('top', interfaceInitTop.join(''));\n $('body').css('padding-top', paddingTopInit);\n }\n\n resize();\n });\n\n // add a chart button\n $(analytics.csts.css.addchart).click(function () {\n addChart();\n });\n }", "title": "" }, { "docid": "f064b06e173b8f4f33a9f697f745b40e", "score": "0.5778392", "text": "function insertButtons() {\n // rtTopicList is a variable that represents the realtime topic image list within\n // the running GifTastic app\n var rtTopicList = JSON.parse(localStorage.getItem(\"gifTasticTopics\")),\n clearBtn = $(\"<button>\"),\n clearImgs = $(\"<button>\"),\n tBtn;\n\n // clear prior topics list\n $(\".topic-list\").empty();\n\n // if no elements are present in rtImageList, it means that the localStorage object\n // gifTasticTopics is empty, so an empty array will be declared\n if (!Array.isArray(rtTopicList)) {\n rtTopicList = [];\n }\n\n console.log(\"in insertButtons()\");\n clearBtn.addClass(\"clear-button\");\n clearImgs.addClass(\"clear-images\");\n clearBtn.text(\"Clear All Topics\");\n clearImgs.text(\"Clear Images\");\n clearBtn.addClass(\"ml-3 mb-2\");\n clearImgs.addClass(\"ml-3 mb-2\");\n // make the gif buttons\n for (const gifTopic of rtTopicList) {\n console.log(\"current value: \" + gifTopic);\n // Dynamically create button for each topic\n tBtn = $(\"<button>\");\n\n // Adding an id attribute\n tBtn.attr(\"id\", \"btn-\" + gifTopic);\n\n // Adding a class of topic to button\n tBtn.addClass(\"topic topic-button ml-3 mb-2\");\n\n // Adding a data-attribute\n tBtn.attr(\"data-name\", gifTopic);\n\n // set click count for gifTopic to 0 if it is undefined\n if (!topicsClickCounts[gifTopic]) {\n topicsClickCounts[gifTopic] = 0;\n }\n tBtn.attr(\"click-count\", topicsClickCounts[gifTopic]);\n\n // Providing the button text\n tBtn.text(gifTopic);\n // Adding the button to topic-list section\n $(\".topic-list\").append(tBtn);\n $(\".topic-list\").append(clearImgs);\n $(\".topic-list\").append(clearBtn);\n }\n}", "title": "" }, { "docid": "47d9716a74fa02a54c0049479764ccb9", "score": "0.57711256", "text": "function btnGoTab3() {\n updateData();\n goTab3();\n console.log(\"to Risk Assessment\");\n}", "title": "" }, { "docid": "67b811c7bc56f88c3d1988a3741f5a5a", "score": "0.57486707", "text": "function WMEAutoUR_Create_TabbedUI() {\n\tWMEAutoUR_TabbedUI = {};\n\t/**\n\t *@since version 0.11.0\n\t */\n\tWMEAutoUR_TabbedUI.init = function() {\n // See if the div is already created //\n\t\tvar urParentDIV = null;\n\t\tif ($(\"#WME_AutoUR_TAB_main\").length===0) {\n urParentDIV = WMEAutoUR_TabbedUI.ParentDIV();\n $(urParentDIV).append(WMEAutoUR_TabbedUI.Title());\n //$(ParentDIV).append($('<span>').attr(\"id\",\"WME_AutoUR_Info\")\n //\t\t\t\t\t\t\t\t.click(function(){$(this).html('');})\n //\t\t\t\t\t\t\t\t.css(\"color\",\"#000000\"));\n\n $(urParentDIV).append(WMEAutoUR_TabbedUI.TabsHead());\n\n var TabBody = WMEAutoUR_TabbedUI.TabsBody();\n\n $(TabBody).append(WMEAutoUR_TabbedUI.EditorTAB);\n //$(TabBody).append(WMEAutoUR_TabbedUI.MessagesTAB);\n $(TabBody).append(WMEAutoUR_TabbedUI.SettingsTAB);\n\n $(urParentDIV).append(TabBody);\n\n\t\t// See if the div is already created //\n\t\t//if ($(\"#WME_AutoUR_TAB_main\").length===0) {\n\n\t\t\tconsole.info(\"WME-WMEAutoUR_TabbedUI: Loaded Pannel\");\n\t\t\t//ScriptKit.GUI.addImage(1,icon,WMEAutoUR_TabbedUI.hideWindow);\n }\n\n\t\t$(\"div.tips\").after(urParentDIV);\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\t/**\n\t *@since version 0.11.0\n\t */\n\t// ---------- MAIN DIV TOGGLE --------- //\n\tWMEAutoUR_TabbedUI.hideWindow = function() {\n\n\t\tswitch($(\"#WME_AutoUR_TAB_main\").css(\"height\")) {\n\t\t\tcase '30px': \t$(\"#WME_AutoUR_TAB_main\").css(\"height\",\"auto\");\n\t\t\t\t\t\t\t$(\"#WMEAutoUR_TabbedUI_toggle\").html(\"-\");\n\t\t\t\t\t\t\tWMEAutoUR.on();\t\tbreak;\n\t\t\tdefault:\t\t$(\"#WME_AutoUR_TAB_main\").css(\"height\",\"30px\");\n\t\t\t\t\t\t\t$(\"#WMEAutoUR_TabbedUI_toggle\").html(\"+\");\n\t\t\t\t\t\t\tWMEAutoUR.off();\tbreak;\n\t\t}\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\t/**\n\t *@since version 0.11.0\n\t */\n\t// ---------- MAIN DIV --------- //\n\tWMEAutoUR_TabbedUI.ParentDIV = function() {\n\n\t\tvar MainTAB = $('<div>').attr(\"id\",\"WME_AutoUR_TAB_main\")\n\t\t\t\t\t\t\t\t.css(\"color\",\"#FFFFFF\")\n\t\t\t\t\t\t\t\t.css(\"border-bottom\",\"2px solid #E9E9E9\")\n\t\t\t\t\t\t\t\t.css(\"margin\",\"21px 0\")\n\t\t\t\t\t\t\t\t.css(\"padding-bottom\",\"10px\")\n\t\t\t\t\t\t\t\t.css(\"max-width\",\"275px\")\n\t\t\t\t\t\t\t\t.css(\"height\",\"30px\")\n\t\t\t\t\t\t\t\t.css(\"overflow\",\"hidden\")\n\t\t\t\t\t\t\t\t.css(\"display\",\"block\");\n\n\t\treturn MainTAB;\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\t/**\n\t *@since version 0.11.0\n\t */\n\t// ---------- MAIN DIV --------- //\n\tWMEAutoUR_TabbedUI.Title = function() {\n\t\tconsole.info(\"WME-WMEAutoUR_TabbedUI: create main div \");\n\n\t\t// ------- TITLE ------- //\n\t\tvar mainTitle = $(\"<div>\")\n\t\t\t\t\t\t.attr(\"id\",\"WME_AutoUR_TAB_title\")\n\t\t\t\t\t\t.css(\"width\",\"100%\")\n\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t.css(\"background-color\",\"rgb(93, 133, 161)\")\n\t\t\t\t\t\t.css(\"border-radius\",\"5px\")\n\t\t\t\t\t\t.css(\"padding\",\"3px\")\n\t\t\t\t\t\t.css(\"margin-bottom\",\"3px\")\n\t\t\t\t\t\t.html(\"WME-AutoUR \" + WMEAutoUR.version)\n\t\t\t\t\t\t.dblclick(WMEAutoUR.showDevInfo)\n\t\t\t\t\t\t.attr(\"title\",\"Click for Development Info\");\n\n\t\t$(mainTitle).append($('<div>').attr(\"id\",\"WMEAutoUR_TabbedUI_toggle\")\n\t\t\t\t\t\t\t\t\t .html(\"+\")\n\t\t\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t .css(\"color\",\"#ffffff\")\n\t\t\t\t\t\t\t\t\t .css(\"right\",\"3px\")\n\t\t\t\t\t\t\t\t\t .css(\"top\",\"0\")\n\t\t\t\t\t\t\t\t\t .css(\"background\",\"#000000\")\n\t\t\t\t\t\t\t\t\t .css(\"height\",\"16px\")\n\t\t\t\t\t\t\t\t\t .css(\"width\",\"16px\")\n\t\t\t\t\t\t\t\t\t .css(\"display\",\"block\")\n\t\t\t\t\t\t\t\t\t .css(\"line-height\",\"14px\")\n\t\t\t\t\t\t\t\t\t .css(\"border-radius\",\"5px\")\n\t\t\t\t\t\t\t\t\t .click(WMEAutoUR_TabbedUI.hideWindow));\n\n\t\treturn mainTitle;\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\t/**\n\t *@since version 0.11.0\n\t */\n\t// ---------- MAIN DIV --------- //\n\tWMEAutoUR_TabbedUI.TabsHead = function() {\n\n\t\t// ------- TABS ------- //\n\t\tvar mainTabs = $(\"<div>\")\n\t\t\t\t\t\t.attr(\"id\",\"WME_AutoUR_TAB_head\")\n\t\t\t\t\t\t.css(\"padding\",\"3px\")\n\t\t\t\t\t\t.css(\"margin-bottom\",\"3px\")\n\t\t\t\t\t\t.attr(\"title\",\"Click for Development Info\");\n\t\tvar tabs = $(\"<ul>\").addClass(\"nav\")\n\t\t\t\t\t\t\t.addClass(\"nav-tabs\");\n\n\t\t$(tabs).append($(\"<li>\").append($(\"<a>\").attr(\"data-toggle\",\"tab\")\n\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"href\",\"#WMEAutoUR_EDIT_TAB\")\n\t\t\t\t\t\t\t\t\t\t\t\t.html(\"Editor\")\n\t\t\t\t\t\t\t\t\t ).addClass(\"active\")\n\t\t\t\t\t );\n\n\t\t//$(tabs).append($(\"<li>\").append($(\"<a>\").attr(\"data-toggle\",\"tab\")\n\t\t//\t\t\t\t\t\t\t\t\t\t.attr(\"href\",\"#WMEAutoUR_MSG_TAB\")\n\t\t//\t\t\t\t\t\t\t\t\t\t.html(\"Messages\")\n\t\t//\t\t\t\t\t\t\t )\n\t\t//\t\t\t );\n\n\t\t$(tabs).append($(\"<li>\").append($(\"<a>\").attr(\"data-toggle\",\"tab\")\n\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"href\",\"#WMEAutoUR_SET_TAB\")\n\t\t\t\t\t\t\t\t\t\t\t\t.html(\"Settings\")\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t );\n\n\t\t$(mainTabs).append(tabs);\n\n\t\treturn mainTabs;\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\t/**\n\t *@since version 0.11.0\n\t */\n\t// ---------- MAIN DIV --------- //\n\tWMEAutoUR_TabbedUI.TabsBody = function() {\n\n\t\t// ------- TABS ------- //\n\t\tvar TabsBodyContainer = $(\"<div>\")\n\t\t\t\t\t\t\t .attr(\"id\",\"WME_AutoUR_TAB_tabs\")\n\t\t\t\t\t\t\t .attr(\"style\",\"padding: 0 !important;\")\n\t\t\t\t\t\t\t .addClass(\"tab-content\");\n\n\t\treturn TabsBodyContainer;\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t *@since version 0.8.1\n\t */\n\tWMEAutoUR_TabbedUI.EditorTAB = function() {\n\n\t\tvar editTAB = $('<div>').attr(\"id\",'WMEAutoUR_EDIT_TAB')\n\t\t\t\t\t\t\t\t.addClass(\"tab-pane\")\n\t\t\t\t\t\t\t\t.addClass(\"active\");\n\n\t\t$(editTAB).append($(\"<span id='WME_AutoUR_Info'>\")\n\t\t\t\t\t\t\t//.css(\"float\",\"right\")\n\t\t\t\t\t\t\t.css(\"text-align\",\"left\")\n\t\t\t\t\t\t\t.css(\"display\",\"block\")\n\t\t\t\t\t\t\t.css(\"max-width\",\"275px\")\n\t\t\t\t\t\t\t//.css(\"height\",\"150px\")\n\t\t\t\t\t\t\t.css(\"color\",\"#000000\")\n\t\t\t\t\t\t\t.css(\"clear\",\"both\"));\n\n\t\tvar autoBar = $('<div>').css(\"width\",\"100%\")\n\t\t\t\t\t\t\t\t.css(\"clear\",\"both\")\n\t\t\t\t\t\t\t\t.css(\"padding-top\",\"10px\");\n\t\t$(editTAB).append($(autoBar));\n\n\t\t$(autoBar).append($(\"<button>Prev</button>\")\n\t\t\t\t\t\t\t.click(WMEAutoUR.Auto.Prev)\n\t\t\t\t\t\t\t.css(\"position\",\"relative\")\n\t\t\t\t\t\t\t.css(\"float\",\"left\")\n\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t.attr(\"title\",\"Previous UR\"));\n\n\t\t$(autoBar).append($(\"<button>Next</button>\")\n\t\t\t\t\t\t\t.click(WMEAutoUR.Auto.Next)\n\t\t\t\t\t\t\t.css(\"position\",\"relative\")\n\t\t\t\t\t\t\t.css(\"float\",\"right\")\n\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t.attr(\"title\",\"Next UR\"));\n\n\t\t$(autoBar).append($(\"<span id='WME_AutoUR_Count'>\")\n\t\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t.css(\"display\",\"block\")\n\t\t\t\t\t\t\t.css(\"width\",\"60px\")\n\t\t\t\t\t\t\t.css(\"margin\",\"0 auto\")\n\t\t\t\t\t\t\t.css(\"padding\",\"3px\")\n\t\t\t\t\t\t\t.css(\"background-color\",\"#000000\")\n\t\t\t\t\t\t\t.css(\"border-radius\",\"3px\")\n\t\t\t\t\t\t\t.html(\"Auto Off\")\n\t\t\t\t\t\t\t.dblclick(WMEAutoUR.Auto.getIDs)\n\t\t\t\t\t\t\t.attr(\"title\",\"Double click to load/reload list of URs\"));\n\n\n\t\tvar actsBar = $('<div>').css(\"width\",\"100%\")\n\t\t\t\t\t\t\t\t.css(\"clear\",\"both\")\n\t\t\t\t\t\t\t\t.css(\"font-size\",\"12px\")\n\t\t\t\t\t\t\t\t.css(\"padding-top\",\"2px\");\n\t\t$(editTAB).append($(actsBar));\n\n\t\t$(actsBar).append($(\"<button>None</button>\")\n\t\t\t\t\t\t\t .attr(\"id\",\"WME_AutoUR_Filter_button\")\n\t\t\t\t\t\t\t .click(WMEAutoUR.Auto.filterButton)\n\t\t\t\t\t\t\t .val(2)\n\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t .css(\"background-color\",\"White\")\n\t\t\t\t\t\t\t .css(\"color\",\"Black\")\n\t\t\t\t\t\t\t .css(\"border-radius\",\"5px\")\n\t\t\t\t\t\t\t .css(\"width\",\"55px\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Change filter between Initial-Stale-Dead.\"));\n\n\t\t$(actsBar).append($(\"<button>Send</button>\")\n\t\t\t\t\t\t\t .click(WMEAutoUR.Messages.Send)\n\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t .css(\"width\",\"55px\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Insert message. \"));\n\n\t\t$(actsBar).append($(\"<button>Solve</button>\")\n\t\t\t\t\t\t\t .click(WMEAutoUR.Messages.changeStatus)\n\t\t\t\t\t\t\t .attr(\"data-state\",\"0\")\n\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t .css(\"width\",\"55px\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Mark Solved.\"));\n\n\t\t$(actsBar).append($(\"<button>Not ID</button>\")\n\t\t\t\t\t\t\t .click(WMEAutoUR.Messages.changeStatus)\n\t\t\t\t\t\t\t .attr(\"data-state\",\"1\")\n\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t .css(\"width\",\"55px\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Mark Not Identified.\"));\n\n\n\t\tvar setsBar = $('<div>').css(\"width\",\"275px\")\n\t\t\t\t\t\t\t\t.css(\"margin-top\",\"2px\")\n\t\t\t\t\t\t\t\t.css(\"clear\",\"both\");\n\t\t$(editTAB).append($(setsBar));\n\n\t\tvar setsBarSub1 = $('<div>').css(\"width\",\"55px\")\n\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\");\n\t\t//$(setsBar).append($(setsBarSub1));\n\n\n\t\tvar setsBarSub2 = $('<div>').css(\"width\",\"55px\")\n\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\");\n\t\t$(setsBar).append($(setsBarSub2));\n\t\t$(setsBarSub2).append($(\"<label>\")\n\t\t\t\t\t\t\t .html(\"Adv.\")\n\t\t\t\t\t\t\t .attr(\"for\",\"WMEAutoUR_AutoAdvance_CB\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Enable auto advance with Send/Solve/NI buttons.\")\n\t\t\t\t\t\t\t .css(\"color\",\"black\")\n\t\t\t\t\t\t\t .css(\"float\",\"left\"));\n\n\t\t$(setsBarSub2).append($(\"<input>\")\n\t\t\t\t\t\t\t .attr(\"id\",\"WMEAutoUR_AutoAdvance_CB\")\n\t\t\t\t\t\t\t .attr(\"type\",\"checkbox\")\n\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t .css(\"margin-left\",\"5px\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Enable auto advance with Send/Solve/NI buttons.\"));\n\n\n\t\tvar setsBarSub3 = $('<div>').css(\"width\",\"55px\")\n\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\");\n\t\t$(setsBar).append($(setsBarSub3));\n\t\t$(setsBarSub3).append($(\"<label>\")\n\t\t\t\t\t\t\t .html(\"Send\")\n\t\t\t\t\t\t\t .attr(\"for\",\"WMEAutoUR_SendMessage_CB\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Send message with Solve/NI buttons.\")\n\t\t\t\t\t\t\t .css(\"color\",\"black\")\n\t\t\t\t\t\t\t .css(\"float\",\"left\"));\n\n\t\t$(setsBarSub3).append($(\"<input>\")\n\t\t\t\t\t\t\t .attr(\"id\",\"WMEAutoUR_SendMessage_CB\")\n\t\t\t\t\t\t\t .attr(\"type\",\"checkbox\")\n\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t .css(\"margin-left\",\"5px\")\n\t\t\t\t\t\t\t .attr(\"title\",\"Send message with Solve/NI buttons.\"));\n\n\n\n\n\t\tvar edit_select = $(\"<select>\").attr(\"id\",\"WMEAutoUR_Insert_Select\")\n\t\t\t\t\t\t\t\t\t .attr(\"title\",\"Select message to be inserted\")\n\t\t\t\t\t\t\t\t\t .css(\"width\",\"100%\")\n\t\t\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t .change(WMEAutoUR.Messages.insertFromSelect)\n\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\");\n\n\t\tWMEAutoUR_TabbedUI.createSelect(edit_select);\n\n\t\t$(editTAB).append(edit_select);\n\n\t\t$(editTAB).append($(\"<span id='WME_AutoUR_MSG_Display'>\")\n\t\t\t\t\t\t\t.css(\"text-align\",\"left\")\n\t\t\t\t\t\t\t.css(\"display\",\"block\")\n\t\t\t\t\t\t\t.css(\"width\",\"275px\")\n\t\t\t\t\t\t\t.css(\"padding\",\"10px 0\")\n\t\t\t\t\t\t\t.css(\"color\",\"#000000\")\n\t\t\t\t\t\t\t.css(\"clear\",\"both\"));\n\n\n\t\t$(editTAB).append($(\"<div>\").css(\"clear\",\"both\"));\n\n\n\t\treturn editTAB;\n\t};\n\n\t//--------------------------------------------------------------------------------------------------------------------------------------------\n\t/**\n\t *@since version 0.8.1\n\t */\n\t// ------- SETTINGS TAB ------- //\n\tWMEAutoUR_TabbedUI.SettingsTAB = function() {\n\n\t\tvar setTAB = $('<div>').attr(\"id\",'WMEAutoUR_SET_TAB')\n\t\t\t\t\t\t\t\t//.css(\"padding\",\"10px\")\n\t\t\t\t\t\t\t\t.css(\"max-width\",\"275px\")\n\t\t\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t.html(\"coming soon\")\n\t\t\t\t\t\t\t\t.addClass(\"tab-pane\");\n\n\t\tvar select = $(\"<select>\").attr(\"id\",\"WMEAutoUR_Settings_Select\")\n\t\t\t\t\t\t\t\t.attr(\"title\",\"Select Message\")\n\t\t\t\t\t\t\t\t.css(\"width\",\"225px\")\n\t\t\t\t\t\t\t\t.css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t.change(WMEAutoUR.Messages.ChangeSettingSelect)\n\t\t\t\t\t\t\t\t.focus(WMEAutoUR.Messages.SaveSettingSelect)\n\t\t\t\t\t\t\t\t.css(\"padding-top\",\"5px\");\n\n\t\tWMEAutoUR_TabbedUI.createSelect(select);\n\n\n\t\t// --- MESSAGES --- //\n\t\t$(setTAB).append($(\"<div>\").css(\"clear\",\"both\")\n\t\t\t\t\t\t\t\t\t.css(\"margin-bottom\",\"10px\")\n\t\t\t\t\t\t\t\t\t.append($(\"<h3>\").html(\"Messages\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"left\")\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t.append($(\"<textarea>\").attr(\"id\",\"WMEAutoUR_Settings_Comment\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .val(WMEAutoUR.Options.messages[6])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"height\",\"125px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"margin-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"100%\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"clear\",\"both\")\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t.append(select)\n\t\t\t\t\t\t\t\t\t.append($(\"<button>\").html(\"Save\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",'50px')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",'left')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .click(WMEAutoUR.Messages.SaveSettingSelect)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.append($(\"<button>\").html(\"Custom Msg\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",'35%')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",'left')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .click(WMEAutoUR.Messages.addCustom)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.append($(\"<input>\").attr('type','text')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"id\",'WMEAutoUR_Settings_customName')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",'65%')\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.append($(\"<div>\").css(\"clear\",\"both\"))\n\t\t\t\t\t\t);\n\n\t\t// --- FILTERS --- //\n\t\t$(setTAB).append($(\"<div>\").css(\"clear\",\"both\")\n\t\t\t\t\t\t\t\t\t.css(\"margin-bottom\",\"10px\")\n\t\t\t\t\t\t\t\t\t.append($(\"<h3>\").html(\"Filters\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"left\")\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t.append($(\"<div>\").attr(\"id\",\"UR_Stale_Dead\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"135px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<span>\").html('Stale Days')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"title\",\"Days since first editor comment.\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"width\",\"99px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<input>\").attr(\"type\",\"text\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"id\",\"UR_Stale_Days\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"value\",WMEAutoUR.Options.settings.staleDays)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"36px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<span>\").html('Dead Days')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"title\",\"Days since second editor comment.\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"width\",\"99px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<input>\").attr(\"type\",\"text\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"id\",\"UR_Dead_Days\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"value\",WMEAutoUR.Options.settings.deadDays)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"36px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.append($(\"<div>\").css(\"clear\",\"both\"))\n\t\t\t\t\t\t );\n\n\t\t// --- Advanced --- //\n\t\t//console.info(WMEAutoUR.Options.settings.staleDays);\n\t\t//console.info(WMEAutoUR.Options.settings.deadDays);\n\t\t//console.info(WMEAutoUR.Options.settings.firstURTextareaTime);\n\t\t//console.info(WMEAutoUR.Options.settings.nextURTextareaTime);\n\n\t\t$(setTAB).append($(\"<div>\").css(\"clear\",\"both\")\n\t\t\t\t\t\t\t\t\t.css(\"margin-bottom\",\"10px\")\n\t\t\t\t\t\t\t\t\t.append($(\"<h3>\").html(\"Advanced\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"left\")\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t.append($(\"<div>\").attr(\"id\",\"UR_TA_Timers\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"135px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<span>\").html('1st UR TA')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"title\",\"Offset before attempting to insert into UR comment textarea for first loaded UR.\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"width\",\"99px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<input>\").attr(\"type\",\"text\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"id\",\"UR_First_TA_Time\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"value\",WMEAutoUR.Options.settings.firstURTextareaTime)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"36px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<span>\").html('Next UR TA')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\"title\",\"Offset before attempting to insert into UR comment textarea for consecutive URs.\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"float\",\"left\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"width\",\"99px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.css(\"color\",\"black\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .append($(\"<input>\").attr(\"type\",\"text\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"id\",\"UR_Next_TA_Time\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .attr(\"value\",WMEAutoUR.Options.settings.nextURTextareaTime)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"height\",\"24px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"width\",\"36px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"text-align\",\"center\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"position\",\"relative\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .css(\"padding-top\",\"5px\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.append($(\"<div>\").css(\"clear\",\"both\"))\n\t\t\t\t\t\t );\n\n\n\n\t\t$(setTAB).append($(\"<button>Save</button>\")\n\t\t\t\t .click(WMEAutoUR.Settings.Save)\n\t\t\t\t .css(\"float\",\"left\")\n\t\t\t\t .attr(\"title\",\"Save Current Comment\"));\n\n\n\n\n\t\t$(setTAB).append($(\"<button>Reset</button>\")\n\t\t\t\t .click(WMEAutoUR.Settings.Reset)\n\t\t\t\t .css(\"float\",\"right\")\n\t\t\t\t .attr(\"title\",\"Reset settings to defaults.\"));\n\n\n\t\t$(setTAB).append($(\"<div>\").css(\"clear\",\"both\"));\n\n\n\t\treturn setTAB;\n\t};\n\n\t/**\n\t*@since version 0.6.1\n\t*/\n\tWMEAutoUR_TabbedUI.createSelect = function(select) {\n\n\t\tvar g1 = $(\"<optgroup>\").attr('label','Default');\n\t\tvar g2 = $(\"<optgroup>\").attr('label','Stale/Dead');\n\t\tvar g3 = $(\"<optgroup>\").attr('label','Custom');\n\n\t\t$.each(WMEAutoUR.Options.names,function(i,v) {\n\t\t\tif(v) {\n\t\t\t\tvar opt = $('<option>');\n\t\t\t\t$(opt).attr('value',i);\n\t\t\t\t$(opt).html(v);\n\t\t\t\tif(i<40) {\n\t\t\t\t\t$(g1).append(opt);\n\t\t\t\t} else if(i<60) {\n\t\t\t\t\t$(g2).append(opt);\n\t\t\t\t} else if(i>59) {\n\t\t\t\t\t$(g3).append(opt);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t$(select).append(g1).append(g2).append(g3);\n\t};\n\n\n\n\tWMEAutoUR_TabbedUI.init();\n}", "title": "" }, { "docid": "a02f42079ef4c5a8a8173770918ee69f", "score": "0.5747835", "text": "function initialLoad() {\n\tloadScreen = \"<p class='text-center main-button-container'><a class='btn btn-primary btn-lg btn-block start-button' href='#' role='button'>Start Quiz</a></p>\";\n\t$(\".mainArea\").html(loadScreen);\n}", "title": "" }, { "docid": "8031029027cdca1d44013f44ccea6743", "score": "0.57449424", "text": "function users_browtab_ui_document_ready_handler(){\n add_users_browtab_ui_buttons();\n set_users_browtab_ui_buttons_listeners();\n}", "title": "" }, { "docid": "a4003dce5e4a3361a956f6b0a120516a", "score": "0.574385", "text": "function initPickButton(tab) {\n let pickEnabled = true;\n let message = ''\n\n // special chrome pages\n if (tab.url === undefined || tab.url.indexOf('chrome') == 0) {\n message = \"Chrome doesn't allow <i>extensions</i> to play with special Chrome pages like this one. <pre>chrome://...</pre>\";\n pickEnabled = false;\n }\n // chrome gallery\n else if (tab.url.indexOf('https://chrome.google.com/webstore') == 0) {\n message = \"Chrome doesn't allow its <i>extensions</i> to play on Web Store.\";\n pickEnabled = false;\n }\n // local pages\n else if (tab.url.indexOf('file') == 0) {\n message = \"Chrome doesn't allow its <i>extensions</i> to play with your local pages.\";\n pickEnabled = false;\n }\n\n let pick_el = document.getElementById('pick')\n if (pickEnabled) {\n pick_el.onclick = () => {\n bgPage.bg.useTab(tab)\n bgPage.bg.activate()\n window.close()\n }\n } else {\n let message_el = document.getElementById('pick-message')\n message_el.innerHTML = `<h3 class=\"normal\">&#128542; Whoops. Can't pick from this page</h3><p>${message}</p>`\n message_el.style.display = 'block'\n pick_el.style.display = 'none'\n }\n}", "title": "" }, { "docid": "72b1a8340912af6fe3d60f9afd583f25", "score": "0.5741205", "text": "function generateSavedButtons() {\n if(storedSearches.length !== 0) {\n for (i=0; i<storedSearches.length; i++) { \n var cityButton = document.createElement('button');\n cityButton.setAttribute('type', 'button');\n cityButton.setAttribute('class', 'list-group-item list-group-item-action');\n var buttonId = storedSearches[i];\n cityButton.setAttribute('id', buttonId);\n cityButton.textContent = storedSearches[i];\n\n buttonEl.appendChild(cityButton);\n }\n }\n}", "title": "" }, { "docid": "2d0b5ba1f1ea0ce6f7a4eeff65bb874f", "score": "0.5739018", "text": "_changeTab() {\n /** @type NodeListOf<HTMLButtonElement> */\n const tabs = this.querySelectorAll('.web-tabs__tab');\n /** @type NodeListOf<HTMLDivElement> */\n const panels = this.querySelectorAll('.web-tabs__panel');\n const activeTab = tabs[this.activeTab];\n const activePanel = panels[this.activeTab];\n\n if (activeTab) {\n for (const tab of tabs) {\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n }\n\n activeTab.setAttribute('aria-selected', 'true');\n activeTab.removeAttribute('tabindex');\n }\n\n if (activePanel) {\n for (const panel of panels) {\n panel.hidden = true;\n }\n\n activePanel.hidden = false;\n }\n }", "title": "" }, { "docid": "d859b3bf3eb3e09906e6e59dc3988485", "score": "0.57365865", "text": "function setQuizGenerator() {\n $('#quizGenerator .btn')\n .click(\n function() {\n $(\"#quizGenerator .btn\").removeClass('active');\n $(\"#quizGenerator .btn\").removeClass('btn-primary');\n $(\"#quizGenerator .btn\").addClass('btn-default');\n\n var quizType = $(this).attr('id');\n console.log(quizType);\n var quizTypeShortForm = \"\";\n if (quizType.indexOf('semantic') >= 0) { \n quizTypeShortForm = 'semantic';\n $(\"#quizGenerator #semanticSimilarWords\").addClass(\n 'active btn-primary');\n } else if (quizType.indexOf('recent') >= 0) {\n quizTypeShortForm = 'recent';\n $(\"#quizGenerator #recentWords\")\n .addClass('active btn-primary');\n } \n reload();\n chrome.runtime.sendMessage(\n { type: \"change_quiz\", tab_id: currentTabID, quizType: quizTypeShortForm },\n function(response) {\n //console.log(\"New tab message sent.\");\n }\n ); \n });\n}", "title": "" }, { "docid": "778f4e6e57aefb994868167199fbbbbe", "score": "0.5718801", "text": "function initial_screen() {\n\tvar center_button = $(\"<div class='column-md-4 text-center'>\");\n\tvar button_start = $(\"<button id='center' type='button' class='btn btn-primary pad_id' onclick='start_game()''>\").text(\"Start Game.\");\n\tcenter_button.append(button_start);\n\t$(\"#game_div\").empty();\n\t$(\"#game_div\").append(center_button);\n}", "title": "" }, { "docid": "61efbe9b7f3dbddc1942b93b4d8364ee", "score": "0.5717693", "text": "async function listenForClicks() {\r\n document.addEventListener(\"click\", (e) => {\r\n /**\r\n * Given the name of a beast, get the URL to the corresponding image.\r\n */\r\n\r\n async function actionToScript(id) {\r\n switch (id) {\r\n case \"remove-courses\":\r\n browser.tabs.executeScript({file: '/content_scripts/courseRemover.js'}).catch(reportError)\r\n sendMessageToTabs(\"CourseRemoverStatus\", {val: !window.courseRemoverStatus}).catch(reportError)\r\n return\r\n case \"dark-mode\":\r\n sendMessageToTabs(\"DarkMode\", {val: !window.darkMode}).catch(reportError)\r\n return\r\n case \"enhance-page\":\r\n location.href = \"./enahnceMenu.html\"\r\n return\r\n case \"reset\":\r\n await handleReset().catch(reportError)\r\n return\r\n case \"monochrome\":\r\n sendMessageToTabs(\"MonoChrome\", {val: !window.monochrome}).catch(reportError)\r\n return\r\n case \"cursor\":\r\n const val = window.cursor === \"big\" ? \"normal\" : \"big\"\r\n sendMessageToTabs(\"EnhancePage\", {cursor: val}).catch(reportError)\r\n return\r\n case \"back\":\r\n location.href = './index.html'\r\n return\r\n }\r\n }\r\n\r\n if (e.target.classList.contains(\"btn\")) {\r\n actionToScript(e.target.id)\r\n }\r\n })\r\n}", "title": "" }, { "docid": "b8a5ef7aa82adcdfffa08c7c46bb3ba6", "score": "0.57119316", "text": "function btnGoTab1() {\n updateData();\n goTab1();\n console.log(\"to Risk Characteristics\");\n}", "title": "" }, { "docid": "5ce8c88f4ac2f01855de86cd66e2756f", "score": "0.57084185", "text": "function init(){\n \n active_tabs();\n}", "title": "" }, { "docid": "d3e952bb5f0af8c8ab3ffd0b81a910d6", "score": "0.57019705", "text": "function add_users_browtab_ui_buttons(){\n $( \"#button-activate-all\" ).button({\n icons: {\n primary: \"ui-icon-unlocked\",\n secondary: \"ui-icon-folder-collapsed\"\n }\n });\n $( \"#button-set-member-all\" ).button({\n icons: {\n primary: \"ui-icon-person\",\n secondary: \"ui-icon-folder-collapsed\"\n }\n });\n $( \"#button-recognize-account\" ).button({\n icons: {\n primary: \"ui-icon-check\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deny-account\" ).button({\n icons: {\n primary: \"ui-icon-cancel\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-activate-account\" ).button({\n icons: {\n primary: \"ui-icon-unlocked\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deactivate-account\" ).button({\n icons: {\n primary: \"ui-icon-locked\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-set-member-account\" ).button({\n icons: {\n primary: \"ui-icon-person\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-deny-member-account\" ).button({\n icons: {\n primary: \"ui-icon-cancel\",\n secondary: \"ui-icon-tag\"\n }\n });\n $( \"#button-delete-account\" ).button({\n icons: {\n primary: \"ui-icon-trash\",\n secondary: \"ui-icon-tag\"\n }\n });\n}", "title": "" }, { "docid": "7ff973a5d400e96f38ddc7333fab9818", "score": "0.56990194", "text": "function setupManifest() {\n manifest = [\n\n {\n src: \"images/tabs/willowTab.png\",\n id: \"willowTab\"\n }, {\n src: \"images/tabs/whiteTab.png\",\n id: \"whiteTab\"\n }, {\n src: \"images/tabs/westernTab.png\",\n id: \"westernTab\"\n }, {\n src: \"images/tabs/blackTab.png\",\n id: \"blackTab\"\n }, {\n src: \"images/tabs/cascaraTab.png\",\n id: \"cascaraTab\"\n }, {\n src: \"images/tabs/tremblingTab.png\",\n id: \"tremblingTab\"\n },\n {\n src: \"images/icons/willowIcon.png\",\n id: \"willowIcon\"\n },\n {\n src: \"images/hover/willowIconHover.png\",\n id: \"willowIconHover\"\n },\n {\n src: \"images/icons/whiteIcon.png\",\n id: \"whiteIcon\"\n },\n {\n src: \"images/hover/whiteIconHover.png\",\n id: \"whiteIconHover\"\n },\n {\n src: \"images/icons/westernIcon.png\",\n id: \"westernIcon\"\n },\n {\n src: \"images/hover/westernIconHover.png\",\n id: \"westernIconHover\"\n },\n {\n src: \"images/icons/cascaraIcon.png\",\n id: \"cascaraIcon\"\n }, {\n src: \"images/hover/cascaraIconHover.png\",\n id: \"cascaraIconHover\"\n },\n {\n src: \"images/icons/tremplingIcon.png\",\n id: \"tremplingIcon\"\n }, {\n src: \"images/hover/tremplingIconHover.png\",\n id: \"tremplingIconHover\"\n }, {\n src: \"images/icons/blackIcon.png\",\n id: \"blackIcon\"\n },\n {\n src: \"images/hover/blackIconHover.png\",\n id: \"blackIconHover\"\n },\n {\n src: \"images/newPages/willow.png\",\n id: \"willow\"\n },\n {\n src: \"images/newPages/white.png\",\n id: \"white\"\n },\n {\n src: \"images/newPages/western.png\",\n id: \"western\"\n },\n {\n src: \"images/newPages/trembling.png\",\n id: \"trembling\"\n },\n {\n src: \"images/newPages/cascara.png\",\n id: \"cascara\"\n },\n {\n src: \"images/newPages/black.png\",\n id: \"black\"\n },\n {\n src: \"images/newPages/warning.png\",\n id: \"warning\"\n },\n {\n src: \"images/ok.png\",\n id: \"okButton\"\n },\n {\n src: \"images/okPressed.png\",\n id: \"okButtonPressed\"\n },\n {\n src: \"images/mute.png\",\n id: \"mute\"\n },\n {\n src: \"images/unmute.png\",\n id: \"unmute\"\n }\n \t];\n}", "title": "" }, { "docid": "f1c8112e407785a444256aa433e33e22", "score": "0.5693548", "text": "function loadPage() {\n\n var getHistory = JSON.parse(localStorage.getItem(\"search-history\"));\n\n // if no prior search data exists in local storage\n if (!getHistory) {\n var getHistory = [];\n localStorage.setItem(\"search-history\", JSON.stringify(getHistory));\n console.log(\"there is no history\");\n }\n else {\n for (var i = 0; i < getHistory.length; i++) {\n // create buttons to display search history\n var addButtonEl = document.createElement(\"button\");\n addButtonEl.classList = \"button expanded\";\n addButtonEl.textContent = getHistory[i].city;\n addButtonEl.setAttribute(\"id\", i);\n searchHistoryButtonsEl.appendChild(addButtonEl);\n }\n }\n}", "title": "" }, { "docid": "49c8ea4d7e111cbb63609934ec66d40d", "score": "0.5683536", "text": "function init(){\n chrome.runtime.onMessage.addListener(handle_comm_message);\n //open settings page in new tab on browser button click\n chrome.browserAction.onClicked.addListener(function(tab) {\n chrome.tabs.create({ 'url': 'chrome://extensions/?options=' + chrome.runtime.id });\n });\n}", "title": "" }, { "docid": "88706992edfe9106665b901bb654fbc9", "score": "0.567837", "text": "function initializeOptionsScreenElements() {\r\n buttons = new Array();\r\n buttons.push(new Button(740,10,50,50,\"gray\", buttonName.exit));\r\n buttons.push(new Button(200,200,50,50,\"gray\", buttonName.easy));\r\n buttons.push(new Button(200,300,50,50,\"gray\", buttonName.normal));\r\n buttons.push(new Button(200,400,50,50,\"gray\", buttonName.hard));\r\n}", "title": "" }, { "docid": "88dfa59739366513b71b6d49585f2e56", "score": "0.5674427", "text": "function populateButtons() {\r\n // ----- Your code goes here -----\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n // ----- End of your code area -----\r\n}", "title": "" }, { "docid": "483d8f4702480f0b33cfa7c0b0f6db0c", "score": "0.56733847", "text": "function setButtons () {\n\n $(\"#nineButton\").on(\"click\",function(){ \n var nine = $.trim($(\"#nineText\").val()); \n localStorage.setItem ('nine', nine); \n })\n $(\"#tenButton\").on(\"click\",function(){ \n var ten = $.trim($(\"#tenText\").val()); \n localStorage.setItem ('ten', ten); \n })\n $(\"#elevenButton\").on(\"click\",function(){ \n var eleven = $.trim($(\"#elevenText\").val()); \n localStorage.setItem ('eleven', eleven); \n })\n $(\"#noonButton\").on(\"click\",function(){ \n var noon = $.trim($(\"#noonText\").val()); \n localStorage.setItem ('noon', noon); \n })\n $(\"#oneButton\").on(\"click\",function(){ \n var one = $.trim($(\"#oneText\").val()); \n localStorage.setItem ('one', one); \n })\n $(\"#twoButton\").on(\"click\",function(){ \n var two = $.trim($(\"#twoText\").val()); \n localStorage.setItem ('two', two); \n })\n $(\"#threeButton\").on(\"click\",function(){ \n var three = $.trim($(\"#threeText\").val()); \n localStorage.setItem ('three', three); \n })\n $(\"#fourButton\").on(\"click\",function(){ \n var four = $.trim($(\"#fourText\").val()); \n localStorage.setItem ('four', four); \n })\n $(\"#fiveButton\").on(\"click\",function(){ \n var five = $.trim($(\"#fiveText\").val()); \n localStorage.setItem ('five', five); \n })\n }", "title": "" }, { "docid": "af3cda591df0b7dd23c8d47a379483b8", "score": "0.56689", "text": "function page_setup(){\n officeViewRef = database.collection('Office').doc('officeView');\n itemListTabButtonContainer = document.getElementById('ItemListTabContainer');\n itemListTabContainer = document.getElementById('ItemListTabContents');\n itemAddTabButtonContainer = document.getElementById('ItemAddTabContainer');\n itemAddTabContainer = document.getElementById('ItemAddTabContents');\n console.log(\"02.1 Page setup done...\")\n get_user_section();\n}", "title": "" }, { "docid": "cd04de6ad7a604dd06e8819e98e6f472", "score": "0.5666037", "text": "function addSettingsBackgroundViewButtonHandler() {\r\n $(document).on(\"click\", \".av-content-view\", function (e) {\r\n e.preventDefault();\r\n if (getRandomThemesDisplay()) setDisplayCurrentBackgroundFile();\r\n openUrlInNewTab(extensionGetUrl(\"/pages/newtab/newtab.html\"));\r\n });\r\n}", "title": "" }, { "docid": "f6d8f3e2a5e7945c27fb2f7a1409561f", "score": "0.5661743", "text": "function initializePage() {\n\t$(\".edit-button\").click(clickEdit);\n\t$(\".complete-goal-button\").click(clickComplete);\n}", "title": "" }, { "docid": "367e8bca5c06cde106fdca5a5c7b2c48", "score": "0.5657143", "text": "function openPage(pageName,button) {\r\n // Hide all elements with class=\"tabcontent\" by default */\r\n var i, tabcontent, tablinks;\r\n stopMusic();\r\n tabcontent = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n\r\n // Remove the background color of all tablinks/buttons\r\n tablinks = document.getElementsByClassName(\"tablink\");\r\n for (i = 0; i < tablinks.length; i++) {\r\n tablinks[i].classList.remove(\"active\");\r\n }\r\n\r\n // Show the specific tab content\r\n var tab = document.getElementById(pageName);\r\n tab.style.display = \"block\";\r\n button.classList.add(\"active\");\r\n if(pageName === 'Login' || pageName === 'Register' || pageName === 'Game'){\r\n if(button.id !== pageName+\"Header\"){\r\n $(\"#\"+pageName+\"Header\").addClass(\"active\");\r\n \r\n }\r\n }\r\n}", "title": "" }, { "docid": "0cde515b6a38f52f86e0c50ba8d428a8", "score": "0.5656052", "text": "function domElementsSetup() {\n // Redirect to github repo\n $(\"#help-icon\").click(function () {\n chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {\n var repoURL = \"https://github.com/RahulReady/Food-Pulse\";\n chrome.tabs.update(tabs.id, { url: repoURL });\n });\n });\n $(\"#restaurantName\").removeClass(\"hidden\");\n $(\"#waiting-content\").hide();\n $(\"#results-anchor\").hide();\n $(\"#sw-time\").hide();\n $(\".loader-wrapper\").hide();\n // On main button press\n $(\"#reviews\").click(function () {\n $(\"#show-me-what-you-got\").addClass(\"hidden\");\n $(\"#reviews\").hide();\n $(\"#sw-time\").fadeIn();\n $(\"#waiting-content\").fadeIn();\n $(\".loader-wrapper\").fadeIn();\n // Cloud magic starts here\n callLambdaFunction();\n });\n}", "title": "" }, { "docid": "a66208cb7734ce258462d1412b974f64", "score": "0.56552637", "text": "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 }", "title": "" }, { "docid": "5104eb6d2add8aa932149482a6ab7473", "score": "0.5650125", "text": "function startUp() {\n home();\n let homeButton = document.getElementById(\"back\");\n homeButton.onclick = home;\n }", "title": "" }, { "docid": "8f2eb7614889b40fe71cdaff19f208b2", "score": "0.56488323", "text": "function init(){\n deleteButton();\n checkIfComplete();\n enterButton();\n addButton();\n}", "title": "" }, { "docid": "a37c6a3f2fc224fba9cac01f74214ec9", "score": "0.5644248", "text": "function recreate_button_ui() {\r\n\tvar contextualExt = document.getElementById(':rr').getElementsByClassName('contextual_extension')[0];\r\n\tvar len = contextualExt.childNodes.length -1;\r\n\tif (contextualExt.childNodes[len].id !=='lazytruth-button') {\r\n\t\tcreate_button_ui(contextualExt);\t\r\n\t} \r\n}", "title": "" }, { "docid": "04cf9e4309d981dad72e1727fbd94ab8", "score": "0.5635334", "text": "function listenForClicks() {\n document.addEventListener(\"click\", (e) => {\n console.log(`[menu_actions.js] Clicked! Id: ${e.target.id}`);\n hideError();\n var activeTab = browser.tabs.query({\n currentWindow: true,\n active: true\n });\n\n // figure out which button was clicked and take appropriate action\n switch (e.target.id) {\n\n case \"analyze-webpage-button\":\n console.log(\"[menu_actions.js] Analyze Webpage button was clicked.\");\n activeTab\n .then(sendAnalyzeCommandToContentScript)\n .catch(logError);\n break;\n\n case \"fetch-webpage-button\":\n console.log(\"[menu_actions.js] Fetch Webpage data button was clicked.\");\n activeTab\n .then(sendFetchCommandToContentScript)\n .catch(logError);\n break;\n\n case \"analyze-text-button\":\n console.log(\"[menu_actions.js] Analyze Custom Text button was clicked.\");\n activeTab\n .then(analyzeCustomText)\n .catch(logError);\n break;\n\n case \"analyze-selected-button\":\n console.log(\"[menu_actions.js] Analyze Selected Text button was clicked.\");\n activeTab\n .then(sendAnalyzeSelectedCommandToContentScript)\n .catch(logError);\n break;\n\n case \"explain-selected-button\":\n console.log(\"[menu_actions.js] Explain Selected Text button was clicked.\");\n activeTab\n .then(sendExplainSelectedCommandToContentScript)\n .catch(logError);\n break;\n\n case \"back-button\":\n console.log(\"[menu_actions.js] Back button was clicked.\");\n showDefaultMenu();\n break;\n\n case \"login\":\n console.log(\"[menu_actions.js] Login was clicked.\");\n activeTab\n .then(sendLoginCommandToContentScript)\n .catch(logError);\n // TODO: How to handle if the login fails?\n break;\n\n case \"logout\":\n console.log(\"[menu_actions.js] Logout was clicked.\");\n activeTab\n .then(sendLogoutCommandToContentScript)\n .catch(logError);\n // TODO: How to handle if the logout fails?\n break;\n\n default:\n console.log(`[menu_actions.js] Unhandled button was clicked with id ${e.target.id}`);\n break;\n }\n });\n return;\n}", "title": "" }, { "docid": "0cbe52835a8097226e39e9c8bf6d9f3a", "score": "0.5634967", "text": "function setup_all_buttons() {\r\n\r\n\t\t\r\n\t\t/* end buttons */\r\n\t\t\r\n\t\t/* theme switcher */\r\n\t\t\r\n\t\t$('#theme-switcher ul#theme-links-js li a').bind('click',\r\n\t\t\tfunction(e) {\r\n\t\t\t\t$(\"#switch-theme-js\").attr(\"href\", \"css/themes/\"+$(this).data('rel')+\".css\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t\t/* end theme switcher */\r\n\t\t\r\n\t\t/* stop inbox tool bar dropdown from closing when clicked on a link */\r\n\t\t\r\n\t\t$('#theme-switcher ul.mailbox li a').bind('click',\r\n\t\t\tfunction(e) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "ee7cd00c984471bb7c520f39ea1212d9", "score": "0.5629946", "text": "function initUI()\n{\n console.debug('initUI');\n // handle the situation where Tab Sugar isn't ready: the background page didn't do its work\n if (localStorage.background_page_ready != 'true') {\n $('#loading').refreshLoading(0, 'Loading...').show();\n console.warn('Couldn\\'t initialize the dashboard because groups aren\\'t loaded yet in the background page');\n return;\n }\n // update the groups\n var groups = back.groups;\n for (var g in groups) {\n var group = groups[g];\n var group_ui = group.ui_create();\n $('#dashboard').append(group_ui);\n group_ui = $('#group-' + group.id);\n for (var t in group.tabs) {\n var tab = group.tabs[t];\n group_ui.addTab(tab.ui_create());\n //chrome.extension.sendRequest({action: 'gimme the tab preview', tab: tab});\n }\n group_ui.autoFitTabs();\n }\n}", "title": "" }, { "docid": "4fc6a460885f8e86ccf7dea326e7b49a", "score": "0.56286216", "text": "function homeScreen () {\n$('#start_button').html('<button type=\"button\" class=\"btn btn-primary btn-lg btn-block\">Click here to start game.</button>');\n}", "title": "" }, { "docid": "4ee9087d9ea16d1512fa0767bfda3160", "score": "0.5623522", "text": "function init() {\n activateButtons();\n}", "title": "" }, { "docid": "b5dfce805874618ce717d5e9e747ee51", "score": "0.56169194", "text": "function layout_apps() {\n\n // Empties the websites list displayed in the pop up\n $(\"#ga-grid\").empty();\n\n // Get the websites list from the storage\n browser.storage.local.get('appList')\n .then(results => {\n\n // Get the websites list\n const appListToLoad = Object.keys(results.appList)\n\n const wholeList = results.appList\n\n // Goes through the whole websites list\n for (let i = 0; i < appListToLoad.length; i++) {\n \n //Get current website\n const curKey = appListToLoad[i]\n\n // Add the website to the list to be displayed\n $(\"#ga-grid\").append(\n $('<div>')\n .append($('<li>').attr('class', 'ui-state-default').data('ga-name', curKey).append(\n $('<a>').attr('href', wholeList[curKey]['url'])\n .attr('class', 'ga-lnk')\n .attr('id', 'div-' + curKey).append(\n\n $('<div>').attr('class', 'nein-wrapper').append(\n $('<div>').attr('class', 'ga-ico-nein gi-' + curKey).attr('style', 'display: none')\n .attr('id', 'xbtn-' + curKey)\n )\n ).append(\n $('<span>').attr('class', 'ga-ico gi-' + curKey)\n .append(\n $('<img>')\n .attr('height', '32')\n .attr('width', '32')\n .attr('src', wholeList[curKey]['faviconurl'] ? wholeList[curKey]['faviconurl'] : `gapps-icons.png`)\n )\n .css('background-position', wholeList[curKey]['iconpos'])\n ).append(\n $('<span>').attr('class', 'ga-ico-desc').text(wholeList[curKey]['desc'])\n )\n ))\n );\n }\n\n // Add event listeners for the x buttons on each website\n for (let i = 0, l = appListToLoad.length; i < l; i++) {\n const curKey = appListToLoad[i]\n\n // Adds event listener to delete website from websites list\n document.getElementById('xbtn-' + curKey).addEventListener('click', (e) => {\n \n delete wholeList[curKey]\n \n // Updates the list on storage and loads the panel\n browser.storage.local.set({\n 'appList': wholeList\n });\n \n load_panel()\n\n e.stopImmediatePropagation();\n e.stopPropagation();\n e.preventDefault();\n })\n document.getElementById('div-' + curKey).addEventListener('mouseover', () => {\n document.getElementById('xbtn-' + curKey).style.display = 'block'\n })\n document.getElementById('div-' + curKey).addEventListener('mouseout', () => {\n document.getElementById('xbtn-' + curKey).style.display = 'none'\n })\n }\n\n })\n\n .catch(err => {\n console.error(err)\n })\n}", "title": "" }, { "docid": "7ad9954915dc16b8eecf4e723f57f418", "score": "0.56163365", "text": "function setButtons(){\n // Set button function\n $(\"#continue\").click(function() {\n // data saving\n var trial_data = {\n 'alphaNews': alphaNewsClicks,\n 'premierNews': premierNewsClicks,\n 'firstNews': firstNewsClicks,\n 'firstForAgainst': firstForAgainst\n }\n // goto next trial in block\n display_element.html('');\n jsPsych.finishTrial(trial_data);\n });\n\n // Set 1st button functionality\n // ALPHA NEWS\n // This news generator will always agree with the user\n $('#alpha_news').click(function() {\n var position = 'for';\n if (!trial.responseFavour){\n position = 'against';\n }\n\n $('#alpha_disp').text(getHeadline(position));\n\n updateProgress();\n\n alphaNewsClicks.push((new Date()).getTime());\n });\n\n // Set 2nd button functionality\n // PREMIER NEWS\n // This news generator will always disagree with the user\n $('#premier_news').click(function() {\n var position = 'for'\n if (trial.responseFavour){\n position = 'against'\n }\n $('#premi_disp').text(getHeadline(position));\n\n updateProgress();\n\n premierNewsClicks.push((new Date()).getTime());\n })\n\n // Set 3rd button functionality\n // FIRST NEWS\n $('#first_news').click(function() {\n var position = 'for';\n if (Math.random() > 0.5){\n position = 'against';\n }\n $('#first_disp').text(getHeadline(position));\n\n updateProgress();\n\n firstNewsClicks.push((new Date()).getTime());\n firstForAgainst.push(position);\n })\n }", "title": "" }, { "docid": "2fcfe3e111bc74e38ef3b3cf98a3000c", "score": "0.5615391", "text": "function page_init() {\n\n\t\t// initialize buttons\n\t\tvar eeg_source_bttn\t= \"#eeg-source-load-bttn\";\n\t\tvar eeg_target_bttn\t= \"#eeg-target-load-bttn\";\n\t\tvar eeg_compute_bttn\t= \"#eeg-compute-bttn\";\n\t\tvar eeg_json_bttn\t= \"#eeg-exportjson-bttn\";\n\t\tvar eeg_matlab_bttn\t= \"#eeg-export-matlab-bttn\";\n\t\tvar source_chart_bttn\t= \"#source-self-bttn\";\n\t\tvar target_chart_bttn\t= \"#target-self-bttn\";\n\t\tvar cross_chart_bttn\t= \"#eeg-cross-bttn\";\n\n\t\t// ? grab preloaded json files ?\n\t\t// $.ajax({url: \"/json\"}).done(refresh_listing);\n\n\t\t// $(\"#band-filters input[type=radio]\").each(function(i,e){ $(e).click(switch_chart_band); });\n\t\t$(eeg_compute_bttn).click(compute_eeg);\n\t\t$(eeg_json_bttn).click(compute_eeg);\n\t\t$(eeg_matlab_bttn).click(compute_eeg);\n\t\t$(eeg_source_bttn).click(load_eeg_set);\n\t\t$(eeg_target_bttn).click(load_eeg_set);\n\t\t//\n\t\t// $(source_chart_bttn).click(view_chart);\n\t\t// $(target_chart_bttn).click(view_chart);\n\t\t// $(cross_chart_bttn).click(view_chart);\n\n\t}", "title": "" }, { "docid": "0b9c7f3b43a8b7665f39a62673a5cc34", "score": "0.5615235", "text": "function populateTabs(tabs) {\n var tabEntryTemplate = $('tabEntryTemplate');\n\n var openTabsList = document.querySelector('#openTabsSection .tabList');\n var openTabs = backgroundPage.openTabs.slice().sort(function(a, b) {\n return indexOfTab(a.tab.id, tabs) - indexOfTab(b.tab.id, tabs);\n });\n openTabs.forEach(function(tabInfo) {\n if (indexOfTab(tabInfo.tab.id, tabs) == -1)\n return;\n\n var openTab = tabEntryTemplate.cloneNode(true);\n openTab.id = tabInfo.tab.id;\n openTab.onclick = openTabClicked;\n openTab.style.backgroundImage =\n 'url(chrome://favicon/' + tabInfo.tab.url + ')';\n\n openTab.querySelector('.tabTitle').textContent = tabInfo.tab.title;\n\n var displayText = tabInfo.tab.selected ? 'In use' :\n tabInfo.tab.pinned ? 'Pinned' :\n 'Last used ' + minutesText(tabInfo.ticks);\n openTab.querySelector('.tabStatus').textContent = displayText;\n if (tabInfo.tab.selected)\n openTab.classList.add('selected');\n\n openTabsList.appendChild(openTab);\n openTab.hidden = false;\n });\n\n var closedTabsList = document.querySelector('#closedTabsSection .tabList');\n var lastClosedTab = null;\n backgroundPage.closedTabs.forEach(function(tabInfo) {\n if (tabInfo.tab.windowId != tabs[0].windowId)\n return;\n\n var closedTab = tabEntryTemplate.cloneNode(true);\n closedTab.id = tabInfo.tab.id;\n closedTab.onclick = closedTabClicked;\n closedTab.style.backgroundImage =\n 'url(chrome://favicon/' + tabInfo.tab.url + ')';\n\n closedTab.querySelector('.tabTitle').textContent = tabInfo.tab.title;\n closedTab.querySelector('.tabStatus').textContent =\n 'Removed ' + minutesText(tabInfo.ticks);\n\n // Reverse the order (most recently closed first).\n closedTabsList.insertBefore(closedTab, lastClosedTab);\n closedTab.hidden = false;\n lastClosedTab = closedTab;\n });\n}", "title": "" }, { "docid": "321ff44017717a4d5c7f58f37f338160", "score": "0.5611083", "text": "function toggleNavTabs(evt) {\n if ($(this).attr('id') === 'discover-tab-button' || evt === 'discover') {\n $('.workspace-content').hide();\n $('#workspace-tab-button').css('background-color', '#D3D3D3');\n $('#workspace-tab-button').css('border-bottom', '1px solid gray');\n $('#workspace-tab-button').css('border-left', '1px solid gray');\n $('#discover-tab-button').css('border-bottom', '1px solid white');\n $('#discover-tab-button').css('border-right', 'none');\n $('.discover-content').show(); \n $('#discover-tab-button').css('background-color', '#FFFFFF');\n if (!($.isEmptyObject(selectedLayer))) {\n selectedLayer = {};\n $('#ts-plot').addClass('disabled-tab');\n updateLayerSymbology(true);\n };\n activeLayer = null;\n activeResource = null;\n activeFeature = null;\n updateDataViewer();\n buildDiscoverTable();\n };\n if ($(this).attr('id') === 'workspace-tab-button' || evt === 'workspace') {\n $('.workspace-content').show();\n $('#workspace-tab-button').css('background-color', '#FFFFFF');\n $('#workspace-tab-button').css('border-bottom', '1px solid white');\n $('#workspace-tab-button').css('border-left', 'none');\n $('#discover-tab-button').css('border-bottom', '1px solid gray');\n $('#discover-tab-button').css('border-right', '1px solid gray');\n $('.discover-content').hide();\n $('#discover-tab-button').css('background-color', '#D3D3D3');\n if (!($.isEmptyObject(selectedLayer))) {\n selectedLayer = {};\n $('#ts-plot').addClass('disabled-tab');\n updateLayerSymbology(true);\n };\n activeLayer = null;\n activeResource = null;\n activeFeature = null;\n updateDataViewer();\n try {\n workspaceTable.rows().deselect();\n } catch {};\n };\n }", "title": "" }, { "docid": "a84a38c66ee816bd16fd2c49dd225adf", "score": "0.56068206", "text": "function setupTabs() {\n\t$('.tab').each(function(i) {\n\t\tvar link = this.getAttribute(\"href\");\n\t\tthis.removeAttribute(\"href\");\n\n\t\tif (isPath(link)) {\n\t\t\t$(this).css(\"background-color\", \"black\").css(\"color\", \"orange\");\t\t\t\n\t\t\t$(this).click(toggleBanner);\n\t\t} else {\n\t\t\t$(this).click(function() {\n\t\t\t\tanimateLink(link, false);\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "8e76be6f827af6e84ca8f2e8b9f95466", "score": "0.55966973", "text": "function init(){\n \n showTab(currentTab); // Display the current tab\n //alert(\"Loaded\");\n //nextPrev(currentTab);\n}", "title": "" }, { "docid": "dd366464ed1e5e300007bc778d3a981f", "score": "0.55926925", "text": "function createButtons() {\n startButton.remove();\n buttons.forEach((btn) => {\n const button = document.createElement('Button');\n button.setAttribute('type', 'button');\n button.classList.add('btn', 'btn-lg', 'btn-secondary');\n button.style.marginRight = '20px';\n button.innerHTML = `${btn}`;\n buttonWrapper.append(button);\n\n if (button.innerHTML === 'Shuffle') {\n button.addEventListener('click', shuffleAction);\n } else if (button.innerHTML === 'Show/Hide') {\n button.addEventListener('click', showAndHide);\n } else {\n button.addEventListener('click', magicMove);\n }\n });\n\n\n// shuffleButton.setAttribute('type', 'button');\n // shuffleButton.innerHTML = 'Shuffle';\n // shuffleButton.classList.add('btn', 'btn-lg', 'btn-secondary');\n // shuffleButton.style.marginRight = '20px';\n // buttonWrapper.append(shuffleButton);\n // shuffleButton.addEventListener('click', shuffleAction);\n //\n // showHideButton.setAttribute('type', 'button');\n // showHideButton.innerHTML = 'Show/Hide';\n // showHideButton.classList.add('btn', 'btn-lg', 'btn-secondary');\n // showHideButton.style.marginRight = '20px';\n // buttonWrapper.append(showHideButton);\n // showHideButton.addEventListener('click', showAndHide);\n //\n // magicButton.setAttribute('type', 'button');\n // magicButton.innerHTML = 'Magic';\n // magicButton.classList.add('btn', 'btn-lg', 'btn-secondary');\n // buttonWrapper.append(magicButton);\n // magicButton.addEventListener('click', magicMove);\n}", "title": "" }, { "docid": "00b80272a7fbb9777f8d990351da50f9", "score": "0.5590179", "text": "function setLinks() {\n \n $('#learn-seen-btn').click(function() {\n window.open(hostUrl + '/show_user_words?user_id=' + userId + '&lang=' + learnLanguage + '&is_learning=1');\n });\n \n $('#learn-learnt-btn').click(function() {\n window.open(hostUrl + '/show_user_words?user_id=' + userId + '&lang=' + learnLanguage + '&is_learning=0');\n });\n\n $('#setting').click(function() {\n window.open(hostUrl + '/settings?user_id=' + userId);\n });\n // http://testnaijia.herokuapp.com/howtouse\n $('#learn-tutorial').click(function() {\n window.open(hostUrl + '/how-to-learn');\n });\n\n $('#annotate-tutorial').click(function() {\n window.open(hostUrl + '/how-to-annotate');\n });\n\n $('#sign-up').click(function() {\n window.open(hostUrl + '/sign_up?user_id=' + userId);\n });\n\n $('#login').click(function() {\n window.open(hostUrl + '/login');\n });\n\n $('#fb-recommend').click(function() {\n chrome.runtime.sendMessage(\n { type: \"send_fb_recommend\", tab_id: currentTabID },\n function(response) { }\n );\n });\n\n setAnnotationLinks();\n}", "title": "" }, { "docid": "7da69f6ddd84abf042a67c130ff59952", "score": "0.5589151", "text": "function maptab_click() {\n\t//get secondary img path from data attribute\n\tvar data = $(\".inner_container\").find(\"img\").attr(\"data-id\");\n\t//get primary (UK) img from src\n\tvar src = $(\".inner_container\").find(\"img\").attr(\"data\");\n\t//map tab event listener\n\t//Test which button was pressed\n\tif($(this).text() === \"UK\") {\n\t\t//set correct src attriube for map\n\t\t$(\".election_map\").attr(\"src\", src);\n\t\t//add and remove active id as required\n\t\t$(\".map_tabs tr:eq(0)\").attr(\"id\", \"active_tab\");\n\t\t$(\".map_tabs tr:eq(1)\").attr(\"id\", \"\");\n\t} else {\n\t\t$(\".election_map\").attr(\"src\", data);\n\t\t$(\".map_tabs tr:eq(1)\").attr(\"id\", \"active_tab\");\n\t\t$(\".map_tabs tr:eq(0)\").attr(\"id\", \"\");\n\t}\n}", "title": "" }, { "docid": "a3b5c90a51641f00096b693f65965b3f", "score": "0.5587989", "text": "function PlaceButtons() {\n // Load the sidebar HTML template and fill in the values\n var sidebar = GM_getResourceText('Box_HTML');\n for (var key in HTML_TEMPLATE) {\n sidebar = sidebar.replaceAll('{' + key + '}', HTML_TEMPLATE[key]);\n }\n $('body').append(sidebar);\n\n // Load the special sidebar CSS\n GM_addStyle(GM_getResourceText('Box_CSS'));\n\n // Enable the Mail helper\n MailHelperMain();\n\n // Install the Market Helper button listener\n $('#MarketButton').click(function () {\n // Reset the view of the associated boxes\n $('#MarketHelperBox').show();\n });\n\n // Install the top-level Market helper listener(s)\n $('#RefreshResourceFinder').click(MarketHelperMain);\n $('#MarketHelperBox').find('input[name=MarketFilter]').click(MarketHelperFilterHandler);\n}", "title": "" }, { "docid": "6b31d79b47a833dcbe4c495502b8f029", "score": "0.558755", "text": "updateNavigationTab() {\n\n // Add navigation tab container\n let navTabContainer = $(`#${this.id} ul`);\n\n // Empty tab containers\n navTabContainer.empty();\n\n // Sort appertures to make our life easier\n this.aperturesId.sort();\n\n // Create buttons and add them to the navigation tab\n for (let i = 0; i < this.aperturesId.length; i++) {\n navTabContainer.append(`\n <li><a href=\"#${this.prefix}aperture${this.aperturesId[i]}\"> Aperture ${i + 1}\n </a></li>`);\n }\n\n // Save active tab index to recover after\n let activeTabIndex = $(`#${this.id}`).tabs('option', 'active');\n\n /// Refresh tabs to update them\n $(`#${this.id}`).tabs('refresh');\n\n // Activate first tab if none is active\n activeTabIndex = activeTabIndex ? activeTabIndex:0;\n $(`#${this.id}`).tabs('option', 'active', activeTabIndex);\n\n}", "title": "" }, { "docid": "6fb0ec608f526a27c0a19f104932b55f", "score": "0.558707", "text": "function createButtons(){\n\n for (i=0; i < moduleNames.length; i++){\n bttns[i] = new Button(moduleNames[i],moduleLinks[i], picFilenames[i], moduleDescriptions[i]);\n bttns[i].createButton();\n }\n\n for (i=0; i < moduleNames.length; i++){\n\n if(experimental[i]){\n setExperimental(i);\n }\n }\n\n createClearFloat();\n}", "title": "" }, { "docid": "76f480a9bc5044b99e8d4b267423abfb", "score": "0.5585013", "text": "function gamblingObjects() // Writes the gambling buttons to the Gambling tab <div>\n{\n var abc = '';\n {\n for (var i in structure)\n {\n abc += '<button href=\"#\" class=\"button\" onclick=\"structure['+i+'].gambleStructure()\">Gamble '+structure[i].typePlural+'</button><p><span id=\"'+structure[i].type+'Gamble\">gamble '+structure[i].gamblingCost+' '+structure[i].typePlural+' with a '+structure[i].gamblingChance+'% chance</span></p>';\n }\n }\n document.getElementById(\"gamblingTab\").innerHTML += abc;\n}", "title": "" }, { "docid": "26eaced5784ec81e978e2dea9c7edb9c", "score": "0.55726534", "text": "'SET_TABS' (state, tabsData) {\n state.tabs = tabsData;\n }", "title": "" }, { "docid": "c0213cd1b580245d75db1b7f10483f92", "score": "0.5571526", "text": "function _onStartButton() {\n if(DOM.$generateButton.data(\"state\") == \"start\") {\n generateMemory();\n setCheckButton();\n }\n else {\n showResult();\n }\n }", "title": "" }, { "docid": "33c604c385c6c9093d64c75f53247241", "score": "0.55699605", "text": "constructUI() {\n // Injects the UI HTML & CSS into the DOM and binds the needed event listeners\n\n // CSS First\n const css = `\n #mjxgui_editor_window {\n display: none;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n \n background-color: rgb(240, 240, 240);\n border: 2px solid black;\n border-radius: 6px;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);\n \n padding: 20px;\n min-width: 280px;\n max-width: 600px;\n }\n \n #_mjxgui_tab_container_container {\n display: flex;\n flex-flow: row wrap;\n }\n \n .mjxgui_tab_container {\n padding: 5px;\n font-family: monospace;\n font-size: 1.1rem;\n border-radius: 6px;\n background-color: rgb(240, 240, 240);\n transition: background-color ease 0.25s;\n cursor: pointer;\n user-select: none;\n margin: 0 10px;\n }\n \n .mjxgui_tab_container:hover {\n background-color: rgb(220, 220, 220);\n }\n \n #mjxgui_editor_controls {\n display: flex;\n flex-flow: row wrap;\n justify-content: space-between;\n }\n \n #_mjxgui_editor_display {\n padding: 10px;\n margin: 10px;\n border: 1px solid black;\n border-radius: 6px;\n }\n \n .mjxgui_tab {\n padding: 10px;\n margin-top: 10px;\n display: none;\n align-items: stretch;\n flex-flow: row wrap;\n }\n \n .mjxgui_tab .mjxgui-btn {\n background-color: rgb(240, 240, 240);\n transition: background-color ease 0.25s;\n cursor: pointer;\n margin: 2px;\n min-width: 25px;\n text-align: center;\n }\n \n .mjxgui-btn:hover {\n background-color: rgb(220, 220, 220);\n }\n \n .mjxgui_clear_save_buttons, .mjxgui_button_container {\n display: flex;\n flex-flow: row wrap;\n font-family: monospace;\n font-size: 1.1rem;\n align-items: center;\n justify-content: center;\n }\n \n .mjxgui_button_container {\n margin: 0 5px;\n background-color: rgb(240, 240, 240);\n border-radius: 6px;\n transition: background-color ease 0.25s;\n cursor: pointer;\n padding: 5px;\n }\n \n .mjxgui_button_container:hover {\n background-color: rgb(220, 220, 220);\n }\n `;\n const style = document.createElement('style');\n document.head.appendChild(style);\n style.appendChild(document.createTextNode(css));\n\n // HTML\n const editorDiv = document.createElement('div');\n editorDiv.id = 'mjxgui_editor_window';\n editorDiv.dataset.visible = 'false';\n editorDiv.innerHTML = `\n <div id=\"mjxgui_editor_controls\">\n <div style=\"cursor: pointer;\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"mjxgui_close_button_svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#000000\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </div>\n <div class=\"mjxgui_clear_save_buttons\">\n <span class=\"mjxgui_button_container\" id=\"mjxgui_clear_equation\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-trash\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#000000\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <line x1=\"4\" y1=\"7\" x2=\"20\" y2=\"7\" />\n <line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\" />\n <line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\" />\n <path d=\"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12\" />\n <path d=\"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3\" />\n </svg>\n <span>Clear Eqn</span>\n </span>\n <span class=\"mjxgui_button_container\" id=\"mjxgui_save_equation\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"icon icon-tabler icon-tabler-check\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"#000000\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\"/>\n <path d=\"M5 12l5 5l10 -10\" />\n </svg>\n <span>Done</span>\n </span>\n </div>\n </div>\n <div id=\"_mjxgui_tab_container_container\">\n <div class=\"mjxgui_tab_container\" data-tab=\"1\">Greek Letters</div>\n <div class=\"mjxgui_tab_container\" data-tab=\"2\">Operators & Symbols</div>\n <div class=\"mjxgui_tab_container\" data-tab=\"3\">Functions</div>\n </div>\n <div class=\"mjxgui_tab\" style=\"display: flex;\" data-tab=\"1\">\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Alpha\">&Alpha;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Beta\">&Beta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Gamma\">&Gamma;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Delta\">&Delta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Epsilon\">&Epsilon;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Zeta\">&Zeta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Eta\">&Eta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Theta\">&Theta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Iota\">&Iota;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Kappa\">&Kappa;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Lambda\">&Lambda;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Mu\">&Mu;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Nu\">&Nu;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Xi\">&Xi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Omicron\">&Omicron;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Pi\">&Pi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Rho\">&Rho;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Sigma\">&Sigma;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Tau\">&Tau;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Upsilon\">&Upsilon;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Phi\">&Phi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Chi\">&Chi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Psi\">&Psi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"Omega\">&Omega;</span>\n \n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"alpha\">&alpha;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"beta\">&beta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"gamma\">&gamma;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"delta\">&delta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"epsilon\">&epsilon;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"zeta\">&zeta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"eta\">&eta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"theta\">&theta;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"iota\">&iota;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"kappa\">&kappa;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"lambda\">&lambda;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"mu\">&mu;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"nu\">&nu;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"xi\">&xi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"omicron\">&omicron;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"pi\">&pi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"rho\">&rho;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"sigma\">&sigma;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"tau\">&tau;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"upsilon\">&upsilon;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"phi\">&phi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"chi\">&chi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"psi\">&psi;</span>\n <span class=\"mjxgui-btn mjxgui-greek-letter\" data-latex-data=\"omega\">&omega;</span>\n </div>\n <div class=\"mjxgui_tab\" data-tab=\"2\">\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"times\">&times;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"div\">&div;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"centerdot\">&centerdot;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"plusmn\">&plusmn;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"lt\">&lt;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"gt\">&gt;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"leq\">&leq;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"GreaterEqual\">&GreaterEqual;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"equals\">&equals;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"approx\">&approx;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"NotEqual\">&NotEqual;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"mnplus\">&mnplus;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"starf\">&starf;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"bigcup\">&bigcup;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"bigcap\">&bigcap;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"cup\">&cup;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"cap\">&cap;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"sub\">&sub;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"sup\">&sup;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"sube\">&sube;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"supe\">&supe;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"nsub\">&nsub;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"nsup\">&nsup;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"nsube\">&nsube;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"nsupe\">&nsupe;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"propto\">&propto;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"parallel\">&parallel;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"npar\">&npar;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"asympeq\">&asympeq;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"isin\">&isin;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"notin\">&notin;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"exist\">&exist;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"nexist\">&nexist;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"perp\">&perp;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"Leftarrow\">&Leftarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"Rightarrow\">&Rightarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"Leftrightarrow\">&Leftrightarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"angle\">&angle;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"angmsd\">&angmsd;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"rightarrow\">&rightarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"leftarrow\">&leftarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"leftrightarrow\">&leftrightarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"longrightarrow\">&longrightarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"longleftarrow\">&longleftarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"longleftrightarrow\">&longleftrightarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"uparrow\">&uparrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"downarrow\">&downarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"updownarrow\">&updownarrow;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"PartialD\">&PartialD;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"hbar\">&hbar;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"real\">&real;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"nabla\">&nabla;</span>\n <span class=\"mjxgui-btn mjxgui-operator\" data-latex-data=\"infin\">&infin;</span>\n </div>\n <div class=\"mjxgui_tab\" data-tab=\"3\">\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"sum\">&Sigma;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"int\">&int;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"iint\">&#8748</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"iiint\">&iiint;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"oint\">&oint;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"prod\">&Pi;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"coprod\">&coprod;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"bigcup\">&bigcup;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"bigcap\">&bigcap;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"bigvee\">&bigvee;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"three\" data-latex-data=\"bigwedge\">&bigwedge;</span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"lim\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"500\" font-weight=\"500\" text-anchor=\"middle\" transform=\"matrix(.75 0 0 .75 279.5 326.267)\"><tspan x=\"0\">lim</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"sqrt\"><svg viewBox=\"0 0 567 567\"><defs><style>.cls-1,.cls-2{stroke:#000;fill-rule:evenodd}.cls-1{stroke-width:4.667px}.cls-2{stroke-width:7.417px}</style></defs><path id=\"Line_1\" d=\"M3.707 306.883l-1.73-2.643 41.9-27.427 1.73 2.642z\" class=\"cls-1\" data-name=\"Line 1\"/><path id=\"Line_2\" d=\"M47.233 275.65l1.831-1.045 80.1 140.4-1.831 1.044z\" class=\"cls-1\" data-name=\"Line 2\"/><path id=\"Line_3\" d=\"M129.569 410.274l-3.113-1.374 111.707-252.923 3.113 1.375z\" class=\"cls-2\" data-name=\"Line 3\"/><path id=\"Line_4\" d=\"M241.471 154.67v-1.746h322.563v1.746H241.471z\" class=\"cls-2\" data-name=\"Line 4\"/><path fill=\"none\" fill-rule=\"evenodd\" stroke=\"#000\" stroke-width=\"10.125\" d=\"M288.978 190.824H495.53v206.552H288.978V190.824z\"/></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"nsqrt\"><svg viewBox=\"0 0 567 567\"><defs><style>.cls-1,.cls-2,.cls-3{stroke:#000;fill-rule:evenodd}.cls-1{stroke-width:4.667px}.cls-2{stroke-width:7.417px}.cls-3{fill:none;stroke-width:10.125px}</style></defs><path id=\"Line_1\" d=\"M3.707 306.883l-1.73-2.643 41.9-27.427 1.73 2.642z\" class=\"cls-1\" data-name=\"Line 1\"/><path id=\"Line_2\" d=\"M47.233 275.65l1.831-1.045 80.1 140.4-1.831 1.044z\" class=\"cls-1\" data-name=\"Line 2\"/><path id=\"Line_3\" d=\"M129.569 410.274l-3.113-1.374 111.707-252.923 3.113 1.375z\" class=\"cls-2\" data-name=\"Line 3\"/><path id=\"Line_4\" d=\"M241.471 154.67v-1.746h322.563v1.746H241.471z\" class=\"cls-2\" data-name=\"Line 4\"/><path d=\"M288.978 190.824H495.53v206.552H288.978V190.824z\" class=\"cls-3\"/><path id=\"Rectangle_1_copy\" d=\"M69.42 178.744h90.512v90.512H69.42v-90.512z\" class=\"cls-3\" data-name=\"Rectangle 1 copy\"/></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"sub\"><svg viewBox=\"0 0 567 567\"><defs><style>.cls-1{fill:none;stroke:#000;stroke-width:12.875px;fill-rule:evenodd}</style></defs><path d=\"M27.09 82.836h285.083v285.083H27.09V82.836z\" class=\"cls-1\"/><path id=\"Rectangle_1_copy\" d=\"M362.8 295.421h169.985V465.41H362.8V295.421z\" class=\"cls-1\" data-name=\"Rectangle 1 copy\"/></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"sup\"><svg viewBox=\"0 0 567 567\"><defs><style>.cls-1{fill:none;stroke:#000;stroke-width:12.875px;fill-rule:evenodd}</style></defs><path d=\"M27.09 468.164h285.083V183.081H27.09v285.083z\" class=\"cls-1\"/><path id=\"Rectangle_1_copy\" d=\"M362.8 255.579h169.985V85.59H362.8v169.989z\" class=\"cls-1\" data-name=\"Rectangle 1 copy\"/></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"subsup\"><svg viewBox=\"0 0 567 567\"><defs><style>.cls-1{fill:none;stroke:#000;stroke-width:12.875px;fill-rule:evenodd}</style></defs><path d=\"M34.7 413.554h267.862V145.693H34.7v267.861z\" class=\"cls-1\"/><path id=\"Rectangle_1_copy\" d=\"M362.8 243.579h169.985V73.59H362.8v169.989z\" class=\"cls-1\" data-name=\"Rectangle 1 copy\"/><path id=\"Rectangle_1_copy_2\" d=\"M533.2 487.579H363.215V317.59H533.2v169.989z\" class=\"cls-1\" data-name=\"Rectangle 1 copy 2\"/></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"null\" data-function-id=\"frac\"><svg viewBox=\"0 0 567 567\"><defs><style>.cls-1{fill:none;stroke:#000;fill-rule:evenodd;stroke-width:12.875px}</style></defs><path id=\"Rectangle_1_copy\" d=\"M193.8 225.579h169.985V55.59H193.8v169.989z\" class=\"cls-1\" data-name=\"Rectangle 1 copy\"/><path id=\"Line_1\" fill=\"none\" fill-rule=\"evenodd\" stroke=\"#000\" stroke-width=\"10.125\" d=\"M124 284v-1h295v1H124z\" data-name=\"Line 1\"/><path id=\"Rectangle_1_copy_2\" d=\"M364.2 528.579H194.215V358.59H364.2v169.989z\" class=\"cls-1\" data-name=\"Rectangle 1 copy 2\"/></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"sin\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"310.5\" text-anchor=\"middle\" transform=\"translate(286.022 367.216) scale(1.235)\"><tspan x=\"0\">sin</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"cos\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"310.5\" text-anchor=\"middle\" transform=\"translate(286.022 367.216) scale(1.235)\"><tspan x=\"0\">cos</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"tan\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"310.5\" text-anchor=\"middle\" transform=\"translate(286.022 367.216) scale(1.235)\"><tspan x=\"0\">tan</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"csc\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"310.5\" text-anchor=\"middle\" transform=\"translate(286.022 367.216) scale(1.235)\"><tspan x=\"0\">csc</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"sec\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"310.5\" text-anchor=\"middle\" transform=\"translate(286.022 367.216) scale(1.235)\"><tspan x=\"0\">sec</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"cot\"><svg viewBox=\"0 0 567 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"310.5\" text-anchor=\"middle\" transform=\"translate(286.022 367.216) scale(1.235)\"><tspan x=\"0\">cot</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"arcsin\"><svg width=\"45\" height=\"20\" viewBox=\"0 0 2000 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"500\" text-anchor=\"middle\" transform=\"matrix(1.5 0 0 1.5 973.5 496)\"><tspan x=\"0\">arcsin</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"arccos\"><svg width=\"45\" height=\"20\" viewBox=\"0 0 2000 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"500\" text-anchor=\"middle\" transform=\"matrix(1.5 0 0 1.5 973.5 496)\"><tspan x=\"0\">arccos</tspan></text></svg></span>\n <span class=\"mjxgui-btn mjxgui-function\" data-template-type=\"trigonometric\" data-latex-data=\"arctan\"><svg width=\"45\" height=\"20\" viewBox=\"0 0 2000 567\"><text fill=\"#242424\" font-family=\"Cambria\" font-size=\"500\" text-anchor=\"middle\" transform=\"matrix(1.5 0 0 1.5 973.5 496)\"><tspan x=\"0\">arctan</tspan></text></svg></span>\n </div>\n <div id=\"_mjxgui_editor_display\">${this.mathDelimiter} | ${this.mathDelimiter}</div>\n `;\n\n this.editorWindow = editorDiv;\n this.eqnDisplay = editorDiv.querySelector('#_mjxgui_editor_display');\n const mjxguiTabButtons = editorDiv.querySelectorAll('.mjxgui_tab_container');\n const mjxguiTabs = editorDiv.querySelectorAll('.mjxgui_tab');\n\n mjxguiTabButtons.forEach(btn => {\n btn.addEventListener('click', function() {\n mjxguiTabs.forEach(tab => {\n if (tab.dataset.tab === btn.dataset.tab) {\n tab.style.display = 'flex';\n }\n else {\n tab.removeAttribute('style');\n }\n })\n })\n });\n\n const closeEditor = editorDiv.querySelector('.mjxgui_close_button_svg');\n closeEditor.addEventListener('click', function() {\n editorDiv.removeAttribute('style');\n editorDiv.dataset.visible = 'false';\n })\n\n const clearEquationButton = editorDiv.querySelector('#mjxgui_clear_equation');\n clearEquationButton.addEventListener('click', () => {\n this.clearEquation();\n });\n\n const saveEquationButton = editorDiv.querySelector('#mjxgui_save_equation');\n saveEquationButton.addEventListener('click', () => {\n const latex = this.cursor.toLatex();\n if (latex) {\n this.successCallback();\n }\n editorDiv.removeAttribute('style');\n editorDiv.dataset.visible = 'false';\n this.clearEquation();\n });\n\n document.body.appendChild(editorDiv);\n }", "title": "" }, { "docid": "73a1fc6c3063518947fc65473ee3e459", "score": "0.55686", "text": "activateTabs() {\n\n let that = this;\n \n let tabsArray = document.querySelectorAll(\"ul.nav-tabs li\");\n\n for (let i = 0, tabsLength = tabsArray.length; i < tabsLength; i++) {\n\n tabsArray[i].addEventListener(\"click\", function () {\n\n let navLiArray = document.querySelectorAll(\"nav li\");\n\n for (let i = 0, navLiArrayLength = navLiArray.length; i < navLiArrayLength; i++) {\n navLiArray[i].classList.remove(\"active\");\n }\n\n this.classList.add(\"active\");\n\n let page = this.dataset.page;\n\n let defDiv = document.getElementById(\"default\");\n\n if (page != undefined) {\n defDiv.style.display = \"none\";\n that.loadPage(page);\n }\n else {\n document.getElementById(\"main_content\").innerHTML = \"\";\n defDiv.style.display = \"block\";\n }\n })\n }\n }", "title": "" }, { "docid": "a0b30ea569bb142eea8d431bc28398a4", "score": "0.55659556", "text": "add_tab() {\n let n = this.i;\n var robot = this.robot_name[n];\n\n console.log(\"Tab: \" + robot);\n\n // Create an empty transform for the robot\n global_tabManager.transforms[robot] = new ROSLIB.Message({\n child_frame_id : robot,\n transform : {\n translation : {\n x : 0,\n y : 0,\n z : 0\n },\n rotation : {\n x : 0,\n y : 0,\n z : 0,\n w : 0\n }\n }\n });\n\n // This function (found below) gets up all the listeners for this robot\n this.listen_to_robot_topics(n, robot)\n\n global_tabManager.Tab_BatterySub[n].subscribe(function (msg) {\n global_tabManager.battery[n] = msg.data;\n });\n\n global_tabManager.Tab_TaskSub[n].subscribe(function (msg) {\n global_tabManager.tasks[n] = msg.data;\n });\n\n global_tabManager.Tab_TaskNameSub[n].subscribe(function (msg) {\n global_tabManager.task_names[n] = msg.data;\n });\n\n // Add highlighting to buttons when we get updated info from the multi-agent base\n global_tabManager.Tab_TaskValueSub[n].subscribe(function (msg) {\n let robot = global_tabManager.robot_name[n];\n let task = msg.data.toLowerCase();\n if ((task == 'true') || (task == 'false')) {\n switch (global_tabManager.task_names[n]) {\n case 'estop_cmd':\n task = 'estop_toggle';\n break;\n case 'radio_reset_cmd':\n task = 'radio';\n break;\n }\n }\n global_tabManager.task_values[n] = task;\n\n // Set highlighting for the currently pressed button\n let btns = document.querySelectorAll([`button[id^=\"${robot}_btn_\"]`]);\n btns.forEach((btn) => {\n if (btn.id == `${robot}_btn_${task}`) {\n if (!btn.classList.contains('highlight')) {\n btn.classList.add('highlight');\n btn.blur();\n }\n } else if (btn.classList.contains('highlight')) {\n btn.classList.remove('highlight');\n }\n });\n });\n\n global_tabManager.Tab_CommSub[n].subscribe(function (msg) {\n // Save our current time to update connection status\n // The service call isn't reliable!\n global_tabManager.incomm[n] = msg.data;\n });\n\n global_tabManager.joy[robot] = new ROSLIB.Topic({\n ros: ros,\n name: `${comms_prefix}${robot}/joy_base`,\n messageType: \"sensor_msgs/Joy\"\n })\n\n global_tabManager.tf_publisher[robot] = new ROSLIB.Topic({\n ros: ros,\n name: `${comms_prefix}${robot}/origin_from_base`,\n messageType: \"geometry_msgs/TransformStamped\"\n });\n\n // Creating tab at top of screen for selecting robot view\n $('#Robot_Tabs').append(robotTab(robot, n));\n\n\n $('#controls_bar_inner').append(controlCard(robot))\n\n // Creating information stored within the tab\n tabContent(robot);\n\n // Build the artifacts section for this robot\n robotArtifactSection(robot, n);\n\n // Buttons have to be added here or jquery doesn't see it in the DOM\n\n // Sets up all objects for vehicle artifact manager\n this.global_vehicleArtifactsList[n] = new Artifact(this.robot_name[n], n);\n updateRobotOptions();\n\n // Subscribes to artifact messages\n this.Tab_ArtifactSub[n].subscribe(function (msg) {\n global_tabManager.global_vehicleArtifactsList[n].set_artifacts(msg.artifacts);\n });\n this.Tab_ArtifactImgSub[n].subscribe(function (msg) {\n global_tabManager.global_vehicleArtifactsList[n].save_image(msg);\n });\n this.Tab_RobotLocation[n].subscribe(function (msg) {\n global_tabManager.global_vehicleArtifactsList[n].update_location(msg);\n });\n\n // Add to the Transform Transport dropdown\n var modal_options = document.getElementById(\"select_robot_transform\");\n var option = document.createElement(\"option\");\n option.text = robot;\n option.value = robot;\n modal_options.add(option);\n\n // Build the reset section for this robot\n robotReset(robot);\n\n document.getElementsByName(\"end_minutes_\" + robot)[0].addEventListener(\"change\", function() {\n var end_seconds = $(this).val() * 60;\n // Current time in seconds -- Note that when using sim time the times won't work!\n var now = new Date();\n var now_time = Math.floor(now.getTime() / 1000);\n // New time in seconds\n var new_time = now_time + end_seconds;\n // Get a readable time\n var date = new Date(new_time * 1000);\n var hours = date.getHours();\n var minutes = \"0\" + date.getMinutes();\n\n var end_time = document.getElementById(\"end_time_\" + robot);\n end_time.dataset.time = new_time.toString();\n end_time.innerHTML = hours + \":\" + minutes.substr(-2);\n });\n }", "title": "" }, { "docid": "2a549a7880a9a9a842d3e84be6f1a90c", "score": "0.5565545", "text": "function addSettingsBackgroundTabsButtonHandler() {\r\n // Depricated for new settings\r\n /*\r\n $(document).on(\"click\", \".settings-background-tab-button\", function (e) {\r\n var $el = $(this);\r\n\r\n BRW_sendMessage({\r\n command: \"changeSettingsBackgroundCurrentTab\",\r\n tabid: $el.attr(\"data-settings-tabid\")\r\n });\r\n\r\n });\r\n */\r\n}", "title": "" }, { "docid": "55c6cabe6c053149edd9a5a5e4214b45", "score": "0.5563982", "text": "function addButtonActions() {\r\n // Render coaches, players and emblems again when changing language to English \r\n $(\"#english-names-input\").unbind(\"click\").click(function () {\r\n renderCoaches(coaches, \"English\");\r\n renderPlayers(players, \"English\");\r\n renderEmblems(emblems, \"English\");\r\n });\r\n\r\n // Render coaches, players and emblems again when changing language to Japanese\r\n $(\"#japanese-names-input\").unbind(\"click\").click(function () {\r\n renderCoaches(coaches, \"Japanese\");\r\n renderPlayers(players, \"Japanese\");\r\n renderEmblems(emblems, \"Japanese\");\r\n });\r\n\r\n $(\"#reset-button\").unbind(\"click\").click(function () {\r\n clearTeam();\r\n });\r\n\r\n $(\"#save-button\").unbind(\"click\").click(function () {\r\n saveTeam($(window).width());\r\n });\r\n\r\n $('#add-button').unbind('click').click(function () {\r\n addCustomPlayer();\r\n });\r\n}", "title": "" }, { "docid": "509eb5be15839c5d8c256253b32b0ccb", "score": "0.555981", "text": "function initializeUI() {\n var behObj;\n\n NAVBAR_ELEM_DATA = new NavBarElem('document','group1');\n \n behObj = dw.getBehaviorElement();\n if (!behObj && dw.getBehaviorTag())\n behObj = dw.getDocumentDOM().getSelectedNode();\n if (behObj && (behObj.tagName == \"IMG\" || \n behObj.tagName == \"A\" || \n behObj.tagName == \"AREA\")) {\n if (behObj.tagName == \"IMG\" && behObj.parentNode.tagName == \"A\")\n behObj = behObj.parentNode;\n \n NAVBAR_ELEM_DATA.parseObjectTag(behObj);\n\n if (!dw.isReapplyingBehaviors()) { // only setup UI if not re-applying\n\n NAVBAR_ELEM_VIEW = new NavBarElemView(document, NAVBAR_ELEM_DATA);\n\n var tab0 = findObject(\"Tab0\");\n var tab1 = findObject(\"Tab1\");\n \n //Use appropriate background & tabs for Mac OS X.\n if (dw.isOSX()) {\n findObject(\"tabBgWin\").src = \"../../Shared/MM/Images/tabBgOSX505x410.gif\";\n var oldMulti = RegExp.multiline;\n RegExp.multiline = true;\n var pat1 = /tabBg\\.gif/;\n tab0.innerHTML = tab0.innerHTML.replace(pat1, \"tabBgOSX.gif\");\n\t tab1.innerHTML = tab1.innerHTML.replace(pat1, \"tabBgOSX.gif\");\n var pat2 = /tabBgSel\\.gif/;\n tab0.innerHTML = tab0.innerHTML.replace(pat2, \"tabBgSelOSX.gif\");\n\t tab1.innerHTML = tab1.innerHTML.replace(pat2, \"tabBgSelOSX.gif\");\n\t RegExp.multiline = oldMulti;\n \t var bgImage = findObject(\"tabBgWin\");\n\t bgImage.height = 330;\n\t window.resizeToContents();\n // Use appropriate background & tabs for WinXP with themes \n } else if (dw.isXPThemed()) {\t\n findObject(\"tabBgWin\").src = \"../../Shared/MM/Images/tabBgWinXP.gif\";\n var tab0 = findObject(\"Tab0\");\n var tab1 = findObject(\"Tab1\");\n \n var oldMulti = RegExp.multiline;\n RegExp.multiline = true;\n var pat1 = /tabBg\\.gif/;\n tab0.innerHTML = tab0.innerHTML.replace(pat1, \"tabBgXP.gif\");\n\t tab1.innerHTML = tab1.innerHTML.replace(pat1, \"tabBgXP.gif\");\n var pat2 = /tabBgSel\\.gif/;\n tab0.innerHTML = tab0.innerHTML.replace(pat2, \"tabBgSelXP.gif\");\n\t tab1.innerHTML = tab1.innerHTML.replace(pat2, \"tabBgSelXP.gif\");\n\t RegExp.multiline = oldMulti;\n // Use standard background \n } else {\t\n findObject(\"tabBgWin\").src = \"../../Shared/MM/Images/tabBgWin.gif\";\n }\n\n // Initialize the TabControl. (Pass in the prefix used for the tab layers)\n T = new TabControl('Tab');\n\n // Add tab pages.\n T.addPage('page1', new ElemControl(LABEL_Basic));\n T.addPage('page2', new AdvControl(LABEL_Advanced));\n\n // Initialize and display the tabs.\n T.start();\n\n } }\n}", "title": "" }, { "docid": "e6d9dccfbc02669fe461804d012f78ff", "score": "0.55537033", "text": "clickNavTab(tabButton) {\n World.driver.findElement(By.linkText(tabButton)).click();\n }", "title": "" }, { "docid": "bc2d899ac30b57c95b749bc21c071d39", "score": "0.55512214", "text": "function bindFooterButton()\n{\n\t$('.footer_in button').off('click').on('click', function(e) {\n\t\te.preventDefault();\n\t\tvar htmlFileName = '';\n\t\tvar buttonName = $.trim($(this).attr('class').toLowerCase());\n\t\tvar tabIndex = $('.footer_in button').index($(this));\n\t\tsetSessionStorageItem('currentTabIndex', tabIndex);\n\t\t$('.footer_in button').removeClass('active');\n\t\t$(this).addClass('active');\n\t\tvar cacheFreeValue = getTimeInMs();\n\t\tswitch(true)\n\t\t{\n\t\t\tcase (buttonName.indexOf('review') > -1):\n\t\t\t\t//$('#wrapperFrame').attr('src','App/book_review.html?_=' + cacheFreeValue);\n\t\t\t\topenPage({});\n\t\t\t\tsetSessionStorageItem(\"currentTab\", getSessionStorageItem(\"currentTab\")); \n\t\t\t\t//setSessionStorageItem(\"verbID\", \"S-LBTO\"); // to log data\n\t\t\t\tbreak;\n\t\t\tcase (buttonName.indexOf('library') > -1):\n\t\t\t\t$('#wrapperFrame').attr('src','App/library.html?_=' + cacheFreeValue);\n\t\t\t\tsetSessionStorageItem(\"currentTab\", \"library\"); \n\t\t\t\t//setSessionStorageItem(\"verbID\", \"S-LBTO\"); // to log data\n\t\t\t\tbreak;\n\t\t\tcase (buttonName.indexOf('assignments') > -1):\n\t\t\t\tsetSessionStorageItem(\"currentTab\", \"assignments\");\n\t\t\t\tsetSessionStorageItem(\"verbID\", \"S-ATO\"); //to log data\n\t\t\t\t$('#wrapperFrame').attr('src','App/assignment.html?_=' + cacheFreeValue);\n\t\t\t\tbreak;\n\t\t\tcase (buttonName.indexOf('notebooks') > -1):\n\t\t\t\t$('#wrapperFrame').attr('src','App/notebook.html?_=' + cacheFreeValue);\n\t\t\t\tsetSessionStorageItem(\"currentTab\", \"notebooks\");\n\t\t\t\tsetSessionStorageItem(\"verbID\", \"S-NTO\"); //to log data\n\t\t\t\twindow.top.sendGoogleEvents('Student - Notebook (tab)','Viewed Notebook','UserID:'+getSessionStorageItem(\"UserID\"));\n\t\t\t\tbreak;\n\t\t\tcase (buttonName.indexOf('connect') > -1):\n\t\t\t\t$('#wrapperFrame').attr('src','App/student-connect.html?_=' + cacheFreeValue);\n\t\t\t\tsetSessionStorageItem(\"currentTab\", \"connect\");\n\t\t\t\t/* setSessionStorageItem(\"verbID\", \"S-NTO\"); //to log data\n\t\t\t\twindow.top.sendGoogleEvents('Student - Notebook (tab)','Viewed Notebook','UserID:'+getSessionStorageItem(\"UserID\")); */\n\t\t\t\tbreak;\n\t\t\tcase (buttonName.indexOf('dashboard') > -1):\n\t\t\t\tsetSessionStorageItem(\"currentTab\", \"dashboard\");\n\t\t\t\tsetSessionStorageItem(\"verbID\", \"S-ATO\"); //to log data\n\t\t\t\t$('#wrapperFrame').attr('src','App/student_dashboard.html?_=' + cacheFreeValue);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\talert('No Method Found!');\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tcurrEventTimeStamp = getCurrentTimestamp();\n\t\tsetSessionStorageItem(\"eventStartTime\", getTimeInMs());\n\t\tsetSessionStorageItem(\"eventTimeStamp\", currEventTimeStamp);\n\t});\n\t\n\t$('.footer_inner button.logout_setting').unbind('click').bind('click', function(e) {\n\t\t$('#infoToolTip').fadeToggle(100);\n\t\tif($(this).hasClass('active')) {\n\t\t\t$(this).removeClass('active');\n\t\t} else {\n\t\t\t$(this).addClass('active');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ea6c01e75cd517ac96f72c5235c3e50c", "score": "0.55494916", "text": "function init_buttons() {\n\n\t// cluster button\n\t$( \"#run-button\" ).click( function () {\n\t\tgraph();\n\t} );\n\n\t// reset button\n\t$( \"#reset-button\" ).click( function () {\n\t\treset();\n\t} );\n\n\t// download button\n\t$( \"#download-button\" ).click( function () {\n\t\tdownload();\n\t} );\n\n\t// button for showing downloading screen\n\t$( '#modal-button' ).click( function () {\n\t\tif( vis == null ) {\n\t\t\tshow_message( \"There is no network being shown\" )\n\t\t} else {\n\t\t\t$( '#download-div' ).modal( 'show' );\n\t\t}\n\n\t} );\n\t$( '#modal-close-button' ).click( function () {\n\t\t$( '#download-div' ).modal( 'hide' );\n\t} );\n\n\t// we hide the output div first\n\t$( '#output-div' ).hide();\n\n\t// initialize the download div here\n\t$( '#download-div' ).modal();\n\t$( '#download-div' ).modal( 'hide' );\n\n\t// show a message first.\n\tshow_message( \"Please enter a query gene and select a species\" );\n}", "title": "" }, { "docid": "ac43d4d42ddaba1366a56177e289408c", "score": "0.55447334", "text": "function setupUI(){\n\t\t/* clear button */ \n\t\t\n\t\t// The below event handlers are pointing at anonymous functions\n\t\t\n\t\t/* save button */\n\t\tdocument.querySelector(\"#newGameButton\").onclick = function(e){\n\t\t\t//Reset the array that controls the game.\n\t\t\tconsole.log(\"pressed new game\");\n\t\t\tinit();\n\t\t};\n\n\t\n\t\t/* board */\n\t\tdrawBoard(boardPos.x ,boardPos.y);\n\t\t/* other UI elements */\n\n\n\t\t \n\t} // end function setupUI", "title": "" }, { "docid": "0fb5eacc7cbda9fbe914f2733d9fe995", "score": "0.5539172", "text": "buildTabToolbar(tab) {\r\n\r\n // test for 'entry, 'exit' or 'danbredtagging'\r\n if ( tab.name == 'entry' || tab.name == 'exit' || tab.name == 'danbredtagging' || tab.name == 'remark' || tab.name == 'keyfigures' ) {\r\n\r\n // skip creating toolbar components for these tabs\r\n return;\r\n }\r\n\r\n var buttons = [];\r\n\r\n // labels\r\n var vLittersT = session.get( 'sp_lang', 'SP_SowcardViewLitters') || Language.sowcard.viewLitters[this.lang];\r\n var addRowT = session.get( 'sp_lang', 'SP_ButtonAddRow') || Language.button.addRow[this.lang];\r\n\r\n // thead\r\n if ( tab.name == 'thead' ) {\r\n\r\n // create toolbar view\r\n buttons.push({\r\n class: 'btn-default',\r\n title: vLittersT,\r\n icon: 'glyphicon-th-list',\r\n visible: true,\r\n event: 'view-litters'\r\n });\r\n } else {\r\n\r\n // create toolbar view\r\n buttons.push({\r\n class: 'btn-primary',\r\n title: addRowT,\r\n icon: 'glyphicon-plus',\r\n visible: true,\r\n event: 'add-row'\r\n });\r\n }\r\n\r\n // define toolbar collection\r\n // var toolbarCollection = new ButtonsCollection({ model: ButtonModel });\r\n var toolbarCollection = new ButtonsCollection( buttons );\r\n\r\n // create toolbar view\r\n var toolbarView = new Toolbar({ collection: toolbarCollection });\r\n\r\n // listen for custom events\r\n toolbarView.on( 'add-row', this.onAddRow.bind(this) );\r\n toolbarView.on( 'view-litters', this.switchLittersView.bind(this) );\r\n\r\n // return toolbar view\r\n return toolbarView;\r\n }", "title": "" }, { "docid": "c02d1c1267aa419d9d3932b3c675425f", "score": "0.55383265", "text": "function openMyPage() {\n\n onCreated = (tab) => {\n console.log(`Created new tab: ${tab.id}`)\n browser.bookmarks.getTree().then(t=>{\n postBookmarks(t)\n })\n }\n\n onError = (error) => {\n console.log(`Error: ${error}`)\n }\n \n \n var creating = browser.tabs.create({\n \"url\": HOST\n })\n .then(onCreated, onError)\n \n }", "title": "" }, { "docid": "7a0b52627e750604bf960cad42ac7682", "score": "0.5532395", "text": "function createTabs() {\n\t// load the xml file\n\tvar xmlhttp;\n\tif (window.XMLHttpRequest)\n\t\txmlhttp = new XMLHttpRequest();\n\telse\n\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\txmlhttp.open(\"GET\", \"tabs.xml\", false);\n\txmlhttp.send();\n\tvar xmlDoc = xmlhttp.responseXML;\n\t\n\txmove = 0;\n\tymove = new Array();\n\tzmove = new Array();\n\ttablengths = new Array();\n\t\n\tvar yhtml = new Array();\n\tvar x = xmlDoc.getElementsByTagName(\"LEVEL0\");\n\tvar xhtml = '<div id=\"toplevel\" class=\"sub initsub\" style=\"width:'+width+'\">\\n';\n\txhtml += '<div id=\"control\" class=\"controlgroup\" data-role=\"controlgroup\" data-type=\"horizontal\">\\n';\n\t\n\t// top level elements\n\tfor (var i = 0; i < x.length; i++) {\n\t\tvar y = x[i].getElementsByTagName(\"LEVEL1\");\n\t\tymove[i] = 0;\n\t\tzmove[i] = new Array();\n\t\ttablengths[i] = new Array();\n\t\t\n\t\txhtml += '<a id=\"btn'+i+'\" class=\"opt';\n\t\tif (i == 0)\n\t\t\txhtml += ' initbtn';\n\t\txhtml += '\" data-role=\"button\" data-theme=\"a\"';\n\t\t// add a left arrow icon if there are more buttons left of this one\n\t\tif (i != 0 && i%numtabs == 0)\n\t\t\txhtml += ' data-icon=\"arrow-l\"';\n\t\t// add a right arrow icon if there are more buttons right of this one\n\t\telse if (i%numtabs == 3 && i != x.length-1)\n\t\t\txhtml += ' data-icon=\"arrow-r\" data-iconpos=\"right\"';\n\t\txhtml += '>' + x[i].getElementsByTagName('TAG')[0].childNodes[0].nodeValue + '</a>\\n';\n\t\tvar zhtml = new Array();\n\t\tyhtml[i] = '<div id=\"subtab'+i+'\" class=\"subtab sub';\n\t\tif (i == 0)\n\t\t\tyhtml[i] += ' initsub';\n\t\tyhtml[i] += '\" >\\n';\n\t\tyhtml[i] += '<div id=\"control'+i+'\" class=\"control controlgroup\" data-role=\"controlgroup\" data-type=\"horizontal\">\\n';\n\t\t\n\t\t// second level elements\n\t\tfor (var j = 0; j < y.length; j++) {\n\t\t\tvar z = y[j].getElementsByTagName(\"LEVEL2\");\n\t\t\tzmove[i][j] = 0;\n\t\t\ttablengths[i][j] = z.length;\n\t\t\t\n\t\t\tyhtml[i] += '<a id=\"btn'+i+'-'+j+'\" class=\"opt';\n\t\t\tif (j == 0)\n\t\t\t\tyhtml[i] += ' initbtn';\n\t\t\tyhtml[i] +='\" data-role=\"button\" data-theme=\"a\"';\n\t\t\tif (j != 0 && j%numtabs == 0)\n\t\t\t\tyhtml[i] += ' data-icon=\"arrow-l\"';\n\t\t\telse if (j%numtabs == 3 && j != y.length-1)\n\t\t\t\tyhtml[i] += ' data-icon=\"arrow-r\" data-iconpos=\"right\"';\n\t\t\tyhtml[i] += '>' + y[j].getElementsByTagName('TAG')[0].childNodes[0].nodeValue + '</a>\\n';\n\t\t\t\n\t\t\tzhtml[j] = '<div id=\"subtab'+i+'-'+j+'\" class=\"subtab'+i+' sub';\n\t\t\tif (j == 0)\n\t\t\t\tzhtml[j] += ' initsub';\n\t\t\tzhtml[j] += '\" >\\n';\n\t\t\tzhtml[j] += '<div id=\"control'+i+'-'+j+'\" class=\"control'+i+' controlgroup\" data-role=\"controlgroup\" data-type=\"horizontal\">\\n';\n\t\t\t\n\t\t\t// third level elements\n\t\t\tfor (var k = 0; k < z.length; k++) {\n\t\t\t\tzhtml[j] += '<a id=\"btn'+i+'-'+j+'-'+k+'\" class=\"opt\" data-role=\"button\" data-theme=\"a\"';\n\t\t\t\tif (k != 0 && k%numtabs == 0)\n\t\t\t\t\tzhtml[j] += ' data-icon=\"arrow-l\"';\n\t\t\t\telse if (k%numtabs == 3 && k != z.length-1)\n\t\t\t\t\tzhtml[j] += ' data-icon=\"arrow-r\" data-iconpos=\"right\"';\n\t\t\t\tzhtml[j] +='>' + z[k].childNodes[0].nodeValue + '</a>\\n';\n\t\t\t}\n\t\t\tzhtml[j] += '</div>\\n';\n\t\t}\n\t\tyhtml[i] += '</div>\\n';\n\t\t// add the third level elements after all second level elements have been created\n\t\tfor (var z = 0; z < zhtml.length; z++)\n\t\t\tyhtml[i] += zhtml[z] + '</div>';\n\t\t//yhtml[i] += '</div>\\n';\n\t}\n\txhtml += '</div>\\n';\n\t\t// add the second level elements after all top level elements have been created\n\tfor (var y = 0; y < yhtml.length; y++)\n\t\txhtml += yhtml[y] + '</div>';\n\txhtml += '</div>\\n';\n\t// add the tabs to the page\n\t$('#tabs').html($(xhtml)).trigger('create');\n}", "title": "" }, { "docid": "7b2191ddd2bff5ed436e4da3830f6cde", "score": "0.5530875", "text": "function basicSetup(){\n console.log(\"in basicsetup\");\n /*Div to hold the grid option title, 7x7\n and 13x13 buttons*/\n var gridOptionDiv = document.createElement(\"div\");\n gridOptionDiv.setAttribute(\"id\", \"gridOptionDiv\");\n \n //Title for grid options\n var gridOptionHeader = document.createElement(\"h2\");\n gridOptionHeader.setAttribute(\"id\", \"gridOptionHeader\");\n gridOptionHeader.textContent = \"Play with 7x7 or 13x13 grid?\"\n\n //Create button and add onclick event for 7x7 option\n optionBtn7 = document.createElement(\"button\");\n optionBtn7.setAttribute(\"id\",\"btn7\");\n optionBtn7.addEventListener(\"click\", clickedBtn7);\n optionBtn7.textContent = \"7x7\";\n\n //Create button and add onclick event for 13x13 option\n optionBtn13 = document.createElement(\"button\");\n optionBtn13.setAttribute(\"id\",\"btn13\");\n optionBtn13.addEventListener(\"click\", clickedBtn13);\n optionBtn13.textContent = \"13x13\";\n\n //Append buttons and option title\n gridOptionDiv.appendChild(gridOptionHeader);\n gridOptionDiv.appendChild(optionBtn7);\n gridOptionDiv.appendChild(optionBtn13);\n\n //Append option div\n document.getElementById(\"gameTitle\").appendChild(gridOptionDiv);\n\n //Hide mode buttons\n document.getElementById(\"modeDiv\").style.display = \"none\";\n}", "title": "" }, { "docid": "b79d9bbeff8915bbd57bdb0000324c8d", "score": "0.55299795", "text": "_setupContainer()\n {\n let partialID = 'chartcollection' + this._chartCollectionId;\n let chartID = this._chartMain.name + this._chartCollectionId;\n var navbar_list;\n \n if(this._newCollectionStart){\n navbar_list = this._setupContainerMenu(partialID, chartID); \n }else{\n // tabmenu buttons\n navbar_list = this._main.modules.domElementCreator.create(\n 'li', // Element type\n chartID + '-li', // ID\n ['chart-li', 'nav-item'] // Classes , 'w3-bar-item' ,'w3-button', 'tablink'\n );\n var navUl = document.getElementById(partialID + '-list');\n navUl.append(navbar_list);\n this._navbarli = $('#' + chartID + '-li');\n }\n\n let navbarbtn = this._main.modules.domElementCreator.create(\n 'a', // Element type\n chartID + '-tab', // ID\n ['chart-a', 'nav-link'], // Classes , 'w3-bar-item' ,'w3-button', 'tablink'\n );\n navbar_list.append(navbarbtn);\n this._navbarbtn = $('#' + chartID + '-tab');\n\n // add link to navigation bar\n navbarbtn.setAttribute(\"href\", \"#\" + chartID + '-wrapper');\n navbarbtn.setAttribute(\"data-toggle\", \"pill\");\n navbarbtn.setAttribute(\"title\", this._chartName.replace(\"-\", \" \"));\n var disImgID= \"distribution-chart\" + this._chartCollectionId +\"-img\";\n var disListID= \"distribution-chart\" + this._chartCollectionId +\"-li\";\n\n switch(this._chartMain.name){\n case 'climate-chart':{\n navbarbtn.innerHTML = '<i class=\"fas fa-chart-area\" aria-hidden=\"true\" align=\"center\"></i>';\n\n // switch image in distribution chart when switching charts\n $(\"#\" + chartID + '-li').on(\"click\", () =>{\n if(!$('#' + chartID + '-li').hasClass('active')){\n $('#'+disImgID).attr('src', 'data/img/noun_BoxPlot_normal.png');\n $('#'+disListID).removeClass('active');\n }\n });\n break;\n }\n case 'distribution-chart':{\n navbarbtn.innerHTML = '<img id=\"'+chartID+'-img\"' + 'class=\"distbar\" src=\"data/img/noun_BoxPlot_normal.png\"></img>';\n // switch image\n $(\"#\" + chartID + '-li>a').on(\"click\", () =>{\n if(!$('#' + chartID + '-li').hasClass('active')){\n $('#'+disImgID).attr('src', 'data/img/noun_BoxPlot_highlight.png');\n }\n });\n\n break;\n }\n case 'availability-chart':{\n navbarbtn.innerHTML = '<i class=\"fab fa-buromobelexperte\" aria-hidden=\"true\" align=\"center\"></i>';\n $(\"#\" + chartID + '-li').on(\"click\", () =>{\n if(!$('#' + chartID + '-li').hasClass('active')){\n $('#'+disImgID).attr('src', 'data/img/noun_BoxPlot_normal.png');\n $('#'+disListID).removeClass('active');\n }\n });\n break;\n }\n default:{\n navbarbtn.text = this._chartMain.name;\n }\n }\n\n // Chart Wrapper for all chart elements\n let chartWrapper = this._main.modules.domElementCreator.create(\n 'div', // Element type\n chartID + '-wrapper', // ID\n ['chart-wrapper', 'box', 'tab-pane', 'fade'] // Classes 'w3-container'\n );\n \n if(this._newCollectionStart){\n chartWrapper.classList.add(\"in\");\n chartWrapper.classList.add(\"active\");\n }\n var tabCon = document.getElementById(partialID + '-tabContent');\n tabCon.append(chartWrapper);\n this._chartWrapper = $('#' + chartID + '-wrapper');\n\n \n // Adjust \"height\" of wrapper\n if(this._chartName != 'map-chart'){\n this._chartWrapper.css('padding-bottom', \n 100*(this._chartHeight/this._chartWidth) + '%'\n );\n }\n\n }", "title": "" } ]
f6bf6d1042cf1a22c7696070789a91df
Function called if an error occurs on the Web PKI component.
[ { "docid": "d13f807c7d85cabf82e5463c0580273e", "score": "0.6409401", "text": "function onWebPkiError(message, error, origin) {\r\n\t\t// Unblock the UI.\r\n\t\t$.unblockUI();\r\n\t\t// Log the error to the browser console (for debugging purposes).\r\n\t\tif (console) {\r\n\t\t\tconsole.log('An error has occurred on the signature browser component: ' + message, error);\r\n\t\t}\r\n\t\t// Show the message to the user. You might want to substitute the alert below with a more\r\n\t\t// user-friendly UI component to show the error.\r\n\t\talert(message);\r\n\t}", "title": "" } ]
[ { "docid": "5fd89e9c3dfe6cde2961f7aa83338d88", "score": "0.65599114", "text": "function onWebPkiError(message, error, origin) {\n\n\t\t// Unblock the UI.\n\t\t$.unblockUI();\n\n\t\t// Log the error to the browser console (for debugging purposes).\n\t\tif (console) {\n\t\t\tconsole.log('An error has occurred on the signature browser component: ' + message, error);\n\t\t}\n\n\t\t// Show the message to the user. You might want to substitute the alert below with a more\n\t\t// user-friendly UI component to show the error.\n\t\talert(message);\n\n\t\t// Render the \"Try again\" button.\n\t\tformElements.tryAgainButton.show();\n\t}", "title": "" }, { "docid": "78169c47d98c1640b9d0ea25847c6e19", "score": "0.63624936", "text": "onLoadError(error) {}", "title": "" }, { "docid": "abc2cee58acdf07c495ba31b81fd7efe", "score": "0.63026625", "text": "_handleError() {\r\n this.$.fail.open();\r\n }", "title": "" }, { "docid": "2f102d1d373f41be6367e0d1cddd5bec", "score": "0.6098646", "text": "function internalError() {\n error(\"Sorry there was a problem completing your request, please try later.\")\n}", "title": "" }, { "docid": "2c806e4b30b6626c373a8385032b2e53", "score": "0.60713613", "text": "errored () {\n throw new Error('errored API')\n }", "title": "" }, { "docid": "712226043b21d445a6acbce49f731142", "score": "0.59851044", "text": "function dloadspk_OnError()\n{\n\tapp.ShowPopup( \"Download failed!\" );\n}", "title": "" }, { "docid": "204d161eab50c112fe624695237572e9", "score": "0.59630835", "text": "function OnFailed(error, executeFieldName) {\n RunningExpCount--;\n\n if (error.get_statusCode() != 0) {\n // Display the error. \n var rsltElem = \"Service Error: \" + error.get_message();\n alert(rsltElem);\n DoSubmit();\n }\n\n return true;\n}", "title": "" }, { "docid": "f1351614200fa2f268ff40aa936238d6", "score": "0.5943588", "text": "function signing_failed_dom_content_loaded(){\n load_operation_result();\n wire_up_ok();\n}", "title": "" }, { "docid": "7e73f71c7c1bf938873b55688699be66", "score": "0.5922508", "text": "function cargarError(){\n\talert(\"Error requesting information from the server\");\n}", "title": "" }, { "docid": "8381d1b893bd45ae32b3bfa38f86d692", "score": "0.5888782", "text": "function APIError(){\n alert(\"An error occurred.\")\n}", "title": "" }, { "docid": "ae5a1b6ae7ec8c9200e3cbc5057ad84f", "score": "0.58742166", "text": "onConnectionBroken() {}", "title": "" }, { "docid": "3efcb7f855a45b86d0706e9677fea9ac", "score": "0.5870163", "text": "function onerror(error) {\n self.emit(\"error\", error);\n }", "title": "" }, { "docid": "6fd642c911bfc967301a0c4922c8adc5", "score": "0.5869113", "text": "onErrorOccurred_() {\n this.finishLoading_({netError: NetError.ERR_FAILED});\n }", "title": "" }, { "docid": "3570531bd36869f0ec0924c14b883f3f", "score": "0.58688766", "text": "function alertWebReadError(){\n /*Change file reading code and this message appropriately for online environment.*/\n alert(\"Web server file reading error.\" + BUGALERT_POST);\n return;\n}", "title": "" }, { "docid": "34678d2e2a3d1a5705e170b49cc6d048", "score": "0.5857229", "text": "function error(err) {\n alert(\"Submit Failed!\")\n }", "title": "" }, { "docid": "7d7eebcdb6ec8e39b50b1bc5be48eae6", "score": "0.5856776", "text": "function productError() {\n let contentDiv = document.querySelector(\"#product-template\");\n contentDiv.innerText = \"This product is unavailable. Please check the URL and try again.\";\n }", "title": "" }, { "docid": "fdca2ced287c5408fa8d51afc81ca376", "score": "0.58501995", "text": "function CommError(){\n alert(\"Communication error!! check hardware or FreeMaster\");\n\t return;\n}", "title": "" }, { "docid": "8e3ed796e5eb4eb31e62d0f3c03db8be", "score": "0.5848036", "text": "function onPageError(err, serviceProxy, xmlHttpRequest) {\n //$(\"#errblock\").text(err.detail);\n //alert(\"bar\");\n}", "title": "" }, { "docid": "5e215cc31d2a19105dd7f31f0c333c11", "score": "0.5841494", "text": "function issue_error(error_msg) {\n\talert(error_msg);\n\tthrow new Error(error_msg);\n\t//return;\n}", "title": "" }, { "docid": "6165202401c6b63f1a149e4db37e23b9", "score": "0.58354473", "text": "function onerrorCB(error) {\n //console.log(\"Error name:\"+error.name + \", message: \"+error.message);\n}", "title": "" }, { "docid": "0ae1322f9844da8b235e430c95f50f74", "score": "0.5835404", "text": "function handleError(){\n if( secure ){\n reconnect();\n }\n }", "title": "" }, { "docid": "fdbde03bdbc7bb619517b724bc60efc7", "score": "0.5829695", "text": "function Error() {\n ISML.renderTemplate('hipay/order/error');\n}", "title": "" }, { "docid": "03a4ecb7c0daa204be1b165c072ff924", "score": "0.5824548", "text": "function onConnectionFailure(error) {\n\t\n\t logger.error(\"onConnectionFailure:\" + error);\n\t\n }", "title": "" }, { "docid": "4cb7934217002f3338642f1688396114", "score": "0.58240205", "text": "function onConnectionFailed() {\n console.error('Connection Failed!');\n }", "title": "" }, { "docid": "5c4eedec94cace246ac18bdc46476632", "score": "0.58094573", "text": "function onUploadFail(error) {\n\t\t\t \t \tnavigator.notification.alert('Si \\xE8 verificato un problema interno durante il caricamento di una delle immagini.', \"Kit Agenti - Insem\", \"Ok\");\n\t\t\t \t}", "title": "" }, { "docid": "38043df9e861928a2e061cb592d4bc39", "score": "0.5803707", "text": "isError(){\n\t\treturn false;\n\t}", "title": "" }, { "docid": "54a51694f2627e10ec3a993810f1664d", "score": "0.5782336", "text": "function errorCallback() {\n alert('Error - Failed to retrieve data.');\n }", "title": "" }, { "docid": "0b983f0ce3a391eef92d19a8cfe9c411", "score": "0.57752675", "text": "function requestMBServiceFail() {}", "title": "" }, { "docid": "2c2efc91070663f6293dff9e1d796bb8", "score": "0.57749003", "text": "function error() {\r\n\talert(\"Something went wrong. Please check the data.\");\r\n}", "title": "" }, { "docid": "a186cf99c0fe6f0d618d7decc7bbbc7d", "score": "0.576471", "text": "function onError(error) {\n alert('code: ' + error.code + '\\n' +\n 'message: ' + error.message + '\\n');\n }", "title": "" }, { "docid": "2a8bc11586e68cd3823125535b0cc25d", "score": "0.5757371", "text": "function OnFailedBySubmit(error, executeFieldName) {\n isSubmitted4Exp = false;\n return OnFailed(error, executeFieldName);\n}", "title": "" }, { "docid": "e4a5cba110cf10d74f57d84f4066a4d6", "score": "0.575016", "text": "function FailedCallback(error, userContext, methodName) {\n if (error !== null) {\n var RsltElem = document.getElementById(\"Results\");\n\n RsltElem.innerHTML = \"An error occurred: \" +\n error.get_message();\n }\n}", "title": "" }, { "docid": "dc2cb4c0815979c80a169fd2496aaaed", "score": "0.5748445", "text": "function requestFailed(error){\n $(\"#vol\").html(\"<p class='bg-danger'>Error: \" + error + \" happened while retrieving the volume</p>\");\n }", "title": "" }, { "docid": "70ff16874dfdbdaa0887d7e26b44bcbd", "score": "0.57435113", "text": "_handleError() {\n this.message = \"Wrong Credentials\";\n this.$.toast.open();\n }", "title": "" }, { "docid": "f2b0f00e63aef1a31264639fcec4ccd4", "score": "0.57418764", "text": "function authError(){\r\n sap.m.MessageBox.alert(i18nModel.getResourceBundle().getText(\"AuthError\"));\r\n performLogoff();\r\n}", "title": "" }, { "docid": "f5aece320556ab1d4920a3bbcc71bd66", "score": "0.5740705", "text": "function volRequestFailed(error){\n $(\"#status\").html(\"<p class='bg-danger'>Error: \" + error + \" happened while retrieving the volume</p>\");\n }", "title": "" }, { "docid": "5c24e7eb1fbf6d3026bcf1145963cfcc", "score": "0.57404035", "text": "function GCM_Fail(e)\r\n{\r\n}", "title": "" }, { "docid": "483c8ed5b87dcca3e21d3db4e010164b", "score": "0.5736434", "text": "function whenError(error) {\n alert(error);\n }", "title": "" }, { "docid": "b832a3179c8947da11e7ae6b278a46a6", "score": "0.5736298", "text": "function publicdataupdate_js::OnScriptError(strFile, nLine, nChar, strText, sCode, strSource, strDescription)\r\n{\r\n return CommonOnScriptError(\"publicdataupdate_js\", strFile, nLine, nChar, strText, sCode, strSource, strDescription);\r\n}", "title": "" }, { "docid": "9e421d88c1753f2e0aa1d57cecb7d122", "score": "0.5728791", "text": "function error() {\n var err = that._setError(that.options.lang.errorMessage);\n // attach element to dom\n that.loadingBay.append(err);\n // set element dimensions\n that._load(err);\n }", "title": "" }, { "docid": "eb0357d62ce8873ffdaa61f1125eadb0", "score": "0.5725556", "text": "function reportError() {\n var errorText = document.getElementById(\"extendedShareErrorMessage\").value;\n shareOperation.reportError(errorText);\n }", "title": "" }, { "docid": "047f9191f18c42613216ac8b8bf52cef", "score": "0.57223153", "text": "function errorStartApp(){\t\t\n\t\t_jApp.error();\n\t}", "title": "" }, { "docid": "cab3bbc63eff3a02eaeec579e6b99411", "score": "0.5714322", "text": "function OnFailedToConnectToMasterServer(info: NetworkConnectionError)\n{\n\tDebug.Log(info);\n}", "title": "" }, { "docid": "9b81e0d1e9dacaf1a86744489bdf29c5", "score": "0.57115114", "text": "function onSessionError(error) {\n console.error(\"API request failed (\" + error.statusText + \"): \");\n throw Error(error.statusText);\n}", "title": "" }, { "docid": "7e223b27275698123bbe1561ccee38ed", "score": "0.57071286", "text": "function jilXmlErrorHandler(error)\r\n{//intenta hacer algo coherente con los errores de la librería mimic o del uso inadecuado de los objetos de red\r\n\r\nif (error==\"Error: NetworkError: DOM Exception 19\")\r\n\t{\r\n\tthis.messageAdd(\"Cannot connect to host...\")\r\n\t}\r\nelse\r\n\t{\r\n\talert(error);//ni idea de que error puede ser...\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "039119836575aee3831e4b9fda8c07b7", "score": "0.5702673", "text": "function _authError() {\n next('Invalid User ID/Password');\n }", "title": "" }, { "docid": "039119836575aee3831e4b9fda8c07b7", "score": "0.5702673", "text": "function _authError() {\n next('Invalid User ID/Password');\n }", "title": "" }, { "docid": "644487b1b8d0b982fa19cfe43391da58", "score": "0.570198", "text": "function failure(){\n\t$.post('/server_error');\n\talert(\"Modelr is experiencing technical difficulties. Please check back soon.\");\n\t\n }", "title": "" }, { "docid": "887cb2d06249f45d02802bc64aded5c3", "score": "0.5701351", "text": "function OnApiCallError(jqxhr, textStatus, error) {\n var err = textStatus + \", \" + error;\n console.log(\"Request Failed: \" + err);\n }", "title": "" }, { "docid": "dc969faaf4eb78979829191f4201e7fd", "score": "0.56991774", "text": "function on_error(e) {\n\tconsole.log('problem with request: ' + e.message);\n\tvar response = new anchor._response_handler(null);\n\tresponse.okay(false);\n\tresponse.message(e.message);\n\tresponse.message_type('error');\n\tanchor.apply_callbacks('error', [response, anchor]);\n }", "title": "" }, { "docid": "dc969faaf4eb78979829191f4201e7fd", "score": "0.56991774", "text": "function on_error(e) {\n\tconsole.log('problem with request: ' + e.message);\n\tvar response = new anchor._response_handler(null);\n\tresponse.okay(false);\n\tresponse.message(e.message);\n\tresponse.message_type('error');\n\tanchor.apply_callbacks('error', [response, anchor]);\n }", "title": "" }, { "docid": "26e53cf6c9ec2e8ceb1c58057178e728", "score": "0.56928146", "text": "function authError(message){\n console.log('error: ' + message);\n mainWindow.webContents.send('message', user.message);\n}", "title": "" }, { "docid": "2e611c7fc76b2992ab07bfac6c3302c7", "score": "0.5691571", "text": "function OnFailed(error, userContext, methodName) \r\n{ \r\n if(error !== null) \r\n {\r\n window.showModalDialog(\"dialog.aspx?type=err\",\"\",\r\n \"dialogWidth:800px;center:yes;edge:sunken;help:no;status:no;\"); \r\n }\r\n}", "title": "" }, { "docid": "527dd38dafa4410e6b940fe5d2772bcf", "score": "0.56900144", "text": "function onLaunchError() {\n appendMessage(\"launch error\");\n}", "title": "" }, { "docid": "3e939897bed2fc6950b8a8fb5a20eb06", "score": "0.5675438", "text": "error() {\n\n\t\t_debug('- Fetch = error');\n\n\t}", "title": "" }, { "docid": "4fc14074fa6e0b44d464f63cf1b2c266", "score": "0.5674437", "text": "function onError(e, componentStack) {}", "title": "" }, { "docid": "f3ae284e6f4c365ec4c61a2e225c4532", "score": "0.56671196", "text": "function handleError(){\n connection = -1;\n enableIOControls(false);\n }", "title": "" }, { "docid": "6490a2062920c24f722c6d5b601add93", "score": "0.5655689", "text": "function onError(){}", "title": "" }, { "docid": "6490a2062920c24f722c6d5b601add93", "score": "0.5655689", "text": "function onError(){}", "title": "" }, { "docid": "fc8f656991379663a6f30cd357b62417", "score": "0.5647594", "text": "function onSessionError(error) {\n var text = (error.statusText ||\n error.error.message ||\n error.xhr.responseText);\n console.error(\"API request failed (\" + error.xhr.status + \"): \" + text);\n throw Error(text);\n }", "title": "" }, { "docid": "de7721be410dae863e4dc6f1e3e70394", "score": "0.56393874", "text": "function operationFailure(res){ \n kony.application.dismissLoadingScreen();\n\n alert('failure in call');\n\n }", "title": "" }, { "docid": "b499825cbad6585aa3c4022581c8b85b", "score": "0.5638461", "text": "function portError(err) {\n alert(\"Serial port error: \" + err);\n}", "title": "" }, { "docid": "371ecb00560521175693b844bb887a1d", "score": "0.5634648", "text": "function e_error(code) {\n pj_ctx_set_errno(code);\n fatal();\n}", "title": "" }, { "docid": "d1a969b9bbd0c6b47a7b5fb7b37f0a4e", "score": "0.5628499", "text": "_handleError() {\n\n\n }", "title": "" }, { "docid": "2352260f152ab5eefa83ff7125f7e8b0", "score": "0.5625784", "text": "function VF_SY120_SCRIPT_ERROR_HANDLER(objError)\n{\n var objScriptInstance = VF_SY121_GET_CURRENTSCRIPTINSTANCE(); \n\n objGlobalError.strLastErrorDescription = objError.description; \n\n if (objScriptInstance != null)\n {\n objScriptInstance.flagFatalError = true;\n objScriptInstance.strLastErrorDescription = objError.description; \n }\n \n VF_SY120_ADDMESSAGE(GLOBAL_strFatalMsgType,objError.description);\n\n if (GLOBAL_flagTraceModeOn) TRACE(objError.description); \n\n return; \n}", "title": "" }, { "docid": "dd4aff9af6cca491ec975b64934963a2", "score": "0.56252986", "text": "function handleError(event) {\n // We can't use common.naclModule yet because the module has not been\n // loaded.\n var moduleEl = document.getElementById('nacl_module');\n root.updateStatus('ERROR [' + moduleEl.lastError + ']');\n //APPLICATION.pexe=\"Error encountered\";\n// change_app_status();\n }", "title": "" }, { "docid": "ead1c808cfb3116447975b253ec56f7e", "score": "0.5619859", "text": "_error(err) {\n this._loading(false);\n if (!err.message) return;\n this.refs['popup'].getWrappedInstance().show(err.message);\n }", "title": "" }, { "docid": "91b6472f4314115bc04e553a461ff059", "score": "0.561442", "text": "onTransportError() {\n if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n this.status = _UAStatus.STATUS_NOT_READY;\n }", "title": "" }, { "docid": "55bbbc893c2c4523a1fc1bb8a388e61f", "score": "0.5606788", "text": "function onAPIError(error) {\n console.error(\"Request failed\", error);\n}", "title": "" }, { "docid": "26fc73c35bbedd7c6d01280a15494e09", "score": "0.56036466", "text": "_onAuthErr( error ) {\n\t\tthis.event.emit( 'authError', error );\n\t}", "title": "" }, { "docid": "8f04f3c81d132006a4de4f551e57108f", "score": "0.56033236", "text": "function handleError() {\n connection = -1;\n enableIOControls(false);\n}", "title": "" }, { "docid": "c074f7d2b3ba031ae49c54af9bea58d4", "score": "0.55966055", "text": "function onConnectionFailed() {\n console.error('Connection Failed!');\n}", "title": "" }, { "docid": "f874e815945ea063c51224e728c75c0e", "score": "0.5595533", "text": "function errorCallback(e) {\n//result.innerHTML='Error during registration: '+e.error;\n }", "title": "" }, { "docid": "1abdab1cb74fa66fed76d80e896148f4", "score": "0.55920047", "text": "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "title": "" }, { "docid": "b63aee2356d691efb21f40aafd333320", "score": "0.5588425", "text": "function error(response) {\n alert(comprobar(\"server\"));\n}", "title": "" }, { "docid": "ca3b435e7470f82ed64c630d32b04c4b", "score": "0.5581858", "text": "function errorCallback(err) {\n console.error(err);\n module.errorView.initErrorPage(err);\n }", "title": "" }, { "docid": "4719e4fd3b4def862e9dc8a1afb34791", "score": "0.5575387", "text": "function FailureResponse(error) {\n kony.application.dismissLoadingScreen();\n alert(\"Failed to initialize the app. Please try again after some time\");\n}", "title": "" }, { "docid": "f51fa587478a20d217630ae4f5351e5d", "score": "0.55747074", "text": "function reportNetUIError(msg)\r\n{\r\n var url = netUI.webAppName + \"/netuiError\" + NetUI.prototype.xmlHttpRequestMapping +\r\n\t\"?error=\" + msg;\r\n netUI.raiseCommand(url,null);\r\n window.status = msg;\r\n return false;\r\n}", "title": "" }, { "docid": "aea490b02fd8ea76c943eee2f730fb00", "score": "0.55710995", "text": "function errorLoading(error) {\n throw new Error(`Dynamic page loading failed: ${error}`);\n}", "title": "" }, { "docid": "395dee83303e3002dc91d5acd7ac8a32", "score": "0.5569524", "text": "function onConnectionFailed () {\n console.error('Connection Failed!')\n}", "title": "" }, { "docid": "7d8579ec1003b1bf9f19471b6fc965b3", "score": "0.5561137", "text": "onerror(event) {}", "title": "" }, { "docid": "55829410e82d0ff5f94491ee8cba153b", "score": "0.553961", "text": "function failedLogin() {}", "title": "" }, { "docid": "0444c72d382c46ab1a2d57c0d2819eaf", "score": "0.5539099", "text": "function handleError() {\n console.log('se ha presentado un error');\n }", "title": "" }, { "docid": "4af69ac1c0f51756bc522a50164f24f4", "score": "0.55387163", "text": "function OnError( msg ) \n{ \n app.Alert( \"Error: \" + msg ); \n console.log( \"Error: \" + msg ); \n}", "title": "" }, { "docid": "06239c4511803645d6af2e5739e3885d", "score": "0.552589", "text": "function handleError () {\n app.data.error = true;\n }", "title": "" }, { "docid": "2af2bcb98c5c7653924369e3d97cf951", "score": "0.5524382", "text": "function onError(error) {\n alert('code: ' + error.code + '\\n' +\n 'message: ' + error.message + '\\n');\n}", "title": "" }, { "docid": "a842cf7d974cdfa3f62eaef7f32a500a", "score": "0.55219996", "text": "function ex(error){\n\tglobal.ex(error);\n}", "title": "" }, { "docid": "8e452277c8e2876ed502b7c53bd27bca", "score": "0.5521075", "text": "function onError(error) {\n\n alert(\"code: \" + error.code +\n \"message:\" + error.message);\n\n}", "title": "" }, { "docid": "86ea6e406d934566e4119a8c092bb5c5", "score": "0.55182797", "text": "serverInternalError () {\n const serverErrors = this.root.querySelector('.avatar-errors');\n serverErrors.innerText = 'Упс! Сервер устал, подождите и попробуйте заново!';\n }", "title": "" }, { "docid": "86ea6e406d934566e4119a8c092bb5c5", "score": "0.55182797", "text": "serverInternalError () {\n const serverErrors = this.root.querySelector('.avatar-errors');\n serverErrors.innerText = 'Упс! Сервер устал, подождите и попробуйте заново!';\n }", "title": "" }, { "docid": "cb1f4fa06395c491546eee645948399a", "score": "0.55153733", "text": "function errorCallback(err) {\n console.err(err);\n module.errorView.initErrorPage(err);\n }", "title": "" }, { "docid": "66af196cabad9f0938de8261c5ec1579", "score": "0.5510998", "text": "function errorCallback(error) {\n alert('ERROR(' + error.code + '): ' + error.message);\n}", "title": "" }, { "docid": "5343f6d6d59e479dae71e72c72c4b43e", "score": "0.5505946", "text": "function googleError(){\n\tviewModel.model().errorMessage('Failed to connect to Google Maps API');\n}", "title": "" }, { "docid": "e0d6c4cdfea5a7aa19ee1c8e0c4feb8c", "score": "0.5505145", "text": "function failure() {\n console.log(\"failed\");\n }", "title": "" }, { "docid": "36b1156abe20365d2abad8e748cbb147", "score": "0.5502967", "text": "function onRequestFail(sender, args) {\n alert('request failed' + args.get_message() + '\\n' + args.get_stackTrace());\n}", "title": "" }, { "docid": "7298610d4823123b5f1b8087378bb3b1", "score": "0.5500159", "text": "function processAuthenticatedUserError(key, title, msg) {\n // Need to save state before resetAuth\n var isAuthenticated = app.api.isAuthenticated();\n backToLogin(true);\n // Show alert only for authorized user\n if (isAuthenticated) {\n // Login can fail for many reasons such as lock out, bad credentials, etc.\n // Server message to provide details.\n alertUser(key , title, msg);\n }\n }", "title": "" }, { "docid": "8c158ebffff2ff9a2c6cc21bda9b45a7", "score": "0.549931", "text": "onError(error) {\n throw error;\n }", "title": "" }, { "docid": "88c58682a6f78ec0c5a4460576af2cf5", "score": "0.5496521", "text": "function errorCallback() {\n show_loading(false);\n alert(\"There was an error making the request.\");\n}", "title": "" }, { "docid": "be48416d73c8fe1349308cfcff16ef2d", "score": "0.54888904", "text": "onContextError(error) {\n let statusCode = 480;\n if (error instanceof Exception) { // There might be interest in catching these Exceptions.\n if (error instanceof SessionDescriptionHandlerError) {\n this.logger.error(error.message);\n }\n else if (error instanceof SessionTerminatedError) {\n // PRACK never arrived, so we timed out waiting for it.\n this.logger.warn(\"Incoming session terminated while waiting for PRACK.\");\n }\n else if (error instanceof ContentTypeUnsupportedError) {\n statusCode = 415;\n }\n else if (error instanceof Exception) {\n this.logger.error(error.message);\n }\n }\n else if (error instanceof Error) { // Other Errors hould go uncaught.\n this.logger.error(error.message);\n }\n else {\n // We don't actually know what a session description handler implementation might throw\n // our way, so as a last resort, just assume we are getting an \"any\" and log it.\n this.logger.error(\"An error occurred in the session description handler.\");\n this.logger.error(error);\n }\n try {\n this.incomingInviteRequest.reject({ statusCode }); // \"Temporarily Unavailable\"\n this.stateTransition(SessionState$1.Terminated);\n }\n catch (error) {\n return;\n }\n }", "title": "" }, { "docid": "c841b9764c9726fde3c3910e0108adde", "score": "0.5488329", "text": "function error(err) {\n //add your code here to display \"err\" in a web element whose ID is \"message\".\n document.getElementById('message').innerHTML = err;\n}", "title": "" } ]
f4ff901e0f7af862e7319a44418cb102
Get the path to the AWS credentials file
[ { "docid": "aa6464ea3490a3e2e2b70e00306c25c3", "score": "0.8781514", "text": "getAwsCredentialsFile() {\n if (process.env.AWS_SHARED_CREDENTIALS_FILE) {\n return process.env.AWS_SHARED_CREDENTIALS_FILE;\n }\n\n let configDir = this.getConfigDir();\n return path.join(configDir, 'credentials');\n }", "title": "" } ]
[ { "docid": "6afd2e9db5f0e921b3ae7aad7c6ec2dd", "score": "0.7249888", "text": "getAwsConfigFile() {\n if (process.env.AWS_CONFIG_FILE) {\n return process.env.AWS_CONFIG_FILE;\n }\n\n let configDir = this.getConfigDir();\n return path.join(configDir, 'config');\n }", "title": "" }, { "docid": "a89403db1d8d93a005c56463b98423e8", "score": "0.6209997", "text": "getConfigDir() {\n let env = process.env;\n let home = env.HOME ||\n env.USERPROFILE ||\n (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null);\n\n if (!home) {\n throw new SError('Cant find homedir', SError.errorCodes.MISSING_HOMEDIR);\n }\n\n return path.join(home, '.aws');\n }", "title": "" }, { "docid": "5dd1cb1f653bcd48a56d6d1be9a10329", "score": "0.604283", "text": "getCredentials(stage, region) {\n let credentials = {region: region};\n\n stage = stage ? stage.toUpperCase() : null;\n\n // implicitly already in the config...\n\n this.addConfigurationCredentials(credentials, S.config); // use the given configuration credentials if they are the only available credentials.\n // first from environment\n this.addEnvironmentCredentials(credentials, 'AWS'); // allow for Amazon standard credential environment variable prefix.\n this.addEnvironmentCredentials(credentials, 'SERVERLESS_ADMIN_AWS'); // but override with more specific credentials if these are also provided.\n this.addEnvironmentCredentials(credentials, 'AWS_' + stage); // and also override these with the Amazon standard *stage specific* credential environment variable prefix.\n this.addEnvironmentCredentials(credentials, 'SERVERLESS_ADMIN_AWS_' + stage); // finally override all prior with Serverless prefixed *stage specific* credentials if these are also provided.\n\n return BbPromise.resolve(credentials)\n\n // next from profile\n .then(() => this.addProfileCredentials(credentials, 'AWS')) // allow for generic Amazon standard prefix based profile declaration\n .then(() => this.addProfileCredentials(credentials, 'SERVERLESS_ADMIN_AWS')) // allow for generic Serverless standard prefix based profile declaration\n .then(() => this.addProfileCredentials(credentials, 'AWS_' + stage)) // allow for *stage specific* Amazon standard prefix based profile declaration\n .then(() => this.addProfileCredentials(credentials, 'SERVERLESS_ADMIN_AWS_' + stage)) // allow for *stage specific* Serverless standard prefix based profile declaration\n .then(() => {\n\n // if they aren't loaded now, the credentials weren't provided by a valid means\n if (!credentials.accessKeyId || !credentials.secretAccessKey) {\n throw new SError(\"Cant find AWS credentials\", SError.errorCodes.MISSING_AWS_CREDS);\n }\n return credentials;\n });\n }", "title": "" }, { "docid": "92a2a97e0f920eccd57ea2f8f7241e69", "score": "0.5959165", "text": "static get s3config() {\n return {\n Bucket: process.env.SERVICE_CONFIG_S3_BUCKET,\n Key: process.env.SERVICE_CONFIG_S3_KEY,\n };\n }", "title": "" }, { "docid": "d2c2cfb2f81b7aa03a8fae6cc3fccb4d", "score": "0.5887289", "text": "async _tryGetApplicationCredentialsFromWellKnownFile(options) {\n // First, figure out the location of the file, depending upon the OS type.\n let location = null;\n if (this._isWindows()) {\n // Windows\n location = process.env['APPDATA'];\n }\n else {\n // Linux or Mac\n const home = process.env['HOME'];\n if (home) {\n location = path.join(home, '.config');\n }\n }\n // If we found the root path, expand it.\n if (location) {\n location = path.join(location, 'gcloud', 'application_default_credentials.json');\n if (!fs.existsSync(location)) {\n location = null;\n }\n }\n // The file does not exist.\n if (!location) {\n return null;\n }\n // The file seems to exist. Try to use it.\n const client = await this._getApplicationCredentialsFromFilePath(location, options);\n return client;\n }", "title": "" }, { "docid": "d2c2cfb2f81b7aa03a8fae6cc3fccb4d", "score": "0.5887289", "text": "async _tryGetApplicationCredentialsFromWellKnownFile(options) {\n // First, figure out the location of the file, depending upon the OS type.\n let location = null;\n if (this._isWindows()) {\n // Windows\n location = process.env['APPDATA'];\n }\n else {\n // Linux or Mac\n const home = process.env['HOME'];\n if (home) {\n location = path.join(home, '.config');\n }\n }\n // If we found the root path, expand it.\n if (location) {\n location = path.join(location, 'gcloud', 'application_default_credentials.json');\n if (!fs.existsSync(location)) {\n location = null;\n }\n }\n // The file does not exist.\n if (!location) {\n return null;\n }\n // The file seems to exist. Try to use it.\n const client = await this._getApplicationCredentialsFromFilePath(location, options);\n return client;\n }", "title": "" }, { "docid": "147f060773f5cae73fb0f8374ee58783", "score": "0.5884333", "text": "async _tryGetApplicationCredentialsFromWellKnownFile(options) {\n // First, figure out the location of the file, depending upon the OS type.\n let location = null;\n if (this._isWindows()) {\n // Windows\n location = process.env['APPDATA'];\n }\n else {\n // Linux or Mac\n const home = process.env['HOME'];\n if (home) {\n location = path.join(home, '.config');\n }\n }\n // If we found the root path, expand it.\n if (location) {\n location = path.join(location, 'gcloud', 'application_default_credentials.json');\n if (!fs.existsSync(location)) {\n location = null;\n }\n }\n // The file does not exist.\n if (!location) {\n return null;\n }\n // The file seems to exist. Try to use it.\n const client = await this._getApplicationCredentialsFromFilePath(location, options);\n return client;\n }", "title": "" }, { "docid": "e2632cfdb7c59460f5b1fee6e1eb50f3", "score": "0.5873005", "text": "function getCredentials(credentialsPath) {\n console.log(chalk(`read credentials from ${credentialsPath}`))\n return new Promise((resolve, reject) => {\n fs.readFile(credentialsPath, (error, content) => {\n if (error) {\n reject(`Error loading credentials: ${error}`);\n }\n // Authorize a client with credentials, then call the Google Sheets API.\n resolve(JSON.parse(content))\n });\n })\n}", "title": "" }, { "docid": "77621e605952cf10e0049ad3ad007654", "score": "0.57817876", "text": "_getCredentials (token = null) {\n /* Don't fetch credentials if we already have them */\n //if (token == null && this._AWS.config.credentials !== null) return Promise.resolve()\n\n this._AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n IdentityPoolId: this._manifest.IdentityPool,\n Logins: {\n [`cognito-idp.${this._manifest.Region}.amazonaws.com/${this._manifest.UserPool}`]: token\n }\n })\n \n /* Clear previously cached ID if token is absent */\n if (!token) this._AWS.config.credentials.clearCachedId()\n\n return this._AWS.config.credentials.getPromise()\n }", "title": "" }, { "docid": "4f501fd12b02e16edcbc87567500e711", "score": "0.5749201", "text": "getRoleCredentials(profile, profiles) {\n const sourceProfile = profiles[profile].source_profile;\n const roleArn = profiles[profile].role_arn;\n let sourceProfileCredentials = profiles[sourceProfile];\n if (!sourceProfileCredentials) {\n throw new SError(`Cant find source profile ${sourceProfile} in AWS credential file and/or AWS config file`, sourceProfile);\n }\n\n sourceProfileCredentials = this.canonicalizeProfileCredentials(sourceProfileCredentials);\n\n const sourceAccessKeyId = sourceProfileCredentials.accessKeyId;\n const sourceSecretAccessKey = sourceProfileCredentials.secretAccessKey;\n const sourceSessionToken = sourceProfileCredentials.sessionToken;\n\n if (!(sourceAccessKeyId && sourceSecretAccessKey)) {\n throw new SError(`Cant find credentials for source profile ${sourceProfile} in AWS credential file and/or AWS config file`, sourceProfile);\n }\n\n const stsCredentials = {\n accessKeyId: sourceAccessKeyId,\n secretAccessKey: sourceSecretAccessKey,\n };\n if (sourceSessionToken) {\n stsCredentials[sessionToken] = sourceSessionToken;\n }\n\n const stsConfig = _.assign(AWS.config, stsCredentials);\n\n const STS = BbPromise.promisifyAll(new AWS.STS(stsConfig));\n\n const assumeRoleParams = {\n RoleArn: roleArn,\n RoleSessionName: profile+\"-\"+guid(),\n };\n\n return STS.assumeRoleAsync(assumeRoleParams)\n .then((res) => {\n return {\n aws_access_key_id: res.Credentials.AccessKeyId,\n aws_secret_access_key: res.Credentials.SecretAccessKey,\n aws_session_token: res.Credentials.SessionToken\n };\n })\n .catch((e) => {\n throw new SError(`Failed to assume role ${roleArn}: ${e}`, roleArn, e);\n });\n }", "title": "" }, { "docid": "382200504e8c3af7d0d4dab050643f39", "score": "0.5711186", "text": "async getCredentials() {\n if (this.key) {\n return { private_key: this.key, client_email: this.email };\n }\n else if (this.keyFile) {\n const gtoken = this.createGToken();\n const creds = await gtoken.getCredentials(this.keyFile);\n return { private_key: creds.privateKey, client_email: creds.clientEmail };\n }\n throw new Error('A key or a keyFile must be provided to getCredentials.');\n }", "title": "" }, { "docid": "382200504e8c3af7d0d4dab050643f39", "score": "0.5711186", "text": "async getCredentials() {\n if (this.key) {\n return { private_key: this.key, client_email: this.email };\n }\n else if (this.keyFile) {\n const gtoken = this.createGToken();\n const creds = await gtoken.getCredentials(this.keyFile);\n return { private_key: creds.privateKey, client_email: creds.clientEmail };\n }\n throw new Error('A key or a keyFile must be provided to getCredentials.');\n }", "title": "" }, { "docid": "382200504e8c3af7d0d4dab050643f39", "score": "0.5711186", "text": "async getCredentials() {\n if (this.key) {\n return { private_key: this.key, client_email: this.email };\n }\n else if (this.keyFile) {\n const gtoken = this.createGToken();\n const creds = await gtoken.getCredentials(this.keyFile);\n return { private_key: creds.privateKey, client_email: creds.clientEmail };\n }\n throw new Error('A key or a keyFile must be provided to getCredentials.');\n }", "title": "" }, { "docid": "df8d1c51a2c7bf75c8b5d79d66d39be6", "score": "0.5676903", "text": "get credentials() {\n return credentials;\n }", "title": "" }, { "docid": "55210f0acea21442c2c0f738eae4fd40", "score": "0.56576663", "text": "saveCredentials(accessKeyId, secretKey, profileName, stage) {\n\n let configDir = this.getConfigDir();\n\n // Create ~/.aws folder if does not exist\n if (!S.utils.dirExistsSync(configDir)) {\n fse.mkdirsSync(configDir);\n }\n\n let profileEnvVar = (stage ? 'AWS_' + stage + '_PROFILE' : 'AWS_PROFILE').toUpperCase();\n\n S.utils.sDebug('Setting new AWS profile:', profileName);\n\n // Write to AWS credentials file.\n fs.appendFileSync(\n this.getAwsCredentialsFile(),\n os.EOL + '[' + profileName + ']' + os.EOL +\n 'aws_access_key_id=' + accessKeyId + os.EOL +\n 'aws_secret_access_key=' + secretKey + os.EOL);\n }", "title": "" }, { "docid": "22d0bc35f30231261ab0a289967e6c95", "score": "0.5623127", "text": "function makeCredentialsFile() {\n var credentials = JSON.stringify({\n MAPBOX_ACCESS_TOKEN: constants.mapboxAccessToken\n }, null, 2);\n\n common.writeFile(constants.pathToCredentials, credentials);\n logger('make build/credentials.json');\n}", "title": "" }, { "docid": "523e5c602469f7c347dea9d96639de79", "score": "0.5611235", "text": "getProfile(awsProfile, optional) {\n let profiles = this.getAllProfiles();\n let profileConfig = profiles[awsProfile];\n\n if (!profileConfig) {\n if (optional) {\n return BbPromise.resolve(null);\n } else {\n throw new SError(`Cant find profile ${awsProfile} in AWS credential file and/or AWS config file`, awsProfile);\n }\n }\n\n var isRoleProfile = (\n profileConfig.source_profile &&\n profileConfig.role_arn\n );\n\n var getCredentials =\n isRoleProfile ? this.getRoleCredentials(awsProfile, profiles)\n : BbPromise.resolve(profileConfig);\n\n return getCredentials\n .then(this.canonicalizeProfileCredentials);\n }", "title": "" }, { "docid": "e1afd6cabe8777f9f8966197c8864e80", "score": "0.55907387", "text": "_setCredentials() {\n\n // Set Admin API Keys\n var profiles = awsMisc.profilesMap();\n\n if (process.env.SERVERLESS_ADMIN_AWS_PROFILE && profiles[process.env.SERVERLESS_ADMIN_AWS_PROFILE]) {\n this.config.awsAdminKeyId = profiles[process.env.SERVERLESS_ADMIN_AWS_PROFILE]['aws_access_key_id'];\n this.config.awsAdminSecretKey = profiles[process.env.SERVERLESS_ADMIN_AWS_PROFILE]['aws_secret_access_key'];\n } else {\n // Set Admin API Keys\n this.config.awsAdminKeyId = process.env.SERVERLESS_ADMIN_AWS_ACCESS_KEY_ID || this.config.awsAdminKeyId;\n this.config.awsAdminSecretKey = process.env.SERVERLESS_ADMIN_AWS_SECRET_ACCESS_KEY || this.config.awsAdminSecretKey;\n }\n }", "title": "" }, { "docid": "8050265ae398a9771a2eb462fc606f48", "score": "0.5589109", "text": "function getSettingsFilePath() {\n var dir = getSettingsDirPath();\n return path_1.default.join(dir, config.fileName);\n}", "title": "" }, { "docid": "96e165b2ad1d0b8792e9c9c4e4df4331", "score": "0.5561161", "text": "getCredentials (token = null) {\n\t\tthis.spinner.text = token ? 'Preparing Final Form' : 'Switching sides'\n\t\t\n\t\tthis.AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n\t\t\tIdentityPoolId: this.manifest.IdentityPool,\n\t\t\tLogins: {\n\t\t\t\t[`cognito-idp.${this.manifest.Region}.amazonaws.com/${this.manifest.UserPool}`]: token\n\t\t\t}\n\t\t})\n\n\t\t/* Clear previously cached ID if token is absent */\n\t\tif (!token) this.AWS.config.credentials.clearCachedId()\n\n\t\treturn this.AWS.config.credentials.getPromise()\n\t}", "title": "" }, { "docid": "b6ac7c123cd24b3c491e81be39d80ed3", "score": "0.55530363", "text": "get credentials() {\n return this._credentials;\n }", "title": "" }, { "docid": "301417c3afcbd909d34c6e0a007cec07", "score": "0.5543989", "text": "getAwsConfig(){\n\t\treturn LarryEnvironmentIndex.aws.AwsConfigSingleton.getLoadedConfig();\n\t}", "title": "" }, { "docid": "b538bdc6477422122ffe63b1d83da2d5", "score": "0.55011636", "text": "async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {\n const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||\n process.env['google_application_credentials'];\n if (!credentialsPath || credentialsPath.length === 0) {\n return null;\n }\n try {\n return this._getApplicationCredentialsFromFilePath(credentialsPath, options);\n }\n catch (e) {\n e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`;\n throw e;\n }\n }", "title": "" }, { "docid": "648a45c9b4100313d9a2647d3f66a376", "score": "0.5466966", "text": "function file() {\n return getSettingsFilePath();\n}", "title": "" }, { "docid": "5e612210104829aaa7b91689ab354665", "score": "0.5466109", "text": "getCredentials(callback){\n\t\tconst that = this;\n\n\t var cognitoUser = this.userPool.getCurrentUser();\n\n\t if (cognitoUser != null) {\n\t cognitoUser.getSession(function(err, result) {\n\t if (result) {\t \n\n\t let jwtToken = result.getIdToken().getJwtToken();\n\t that.setCredentials(jwtToken); \t\t \n\t\t\t InMemorySession.setItem(InMemorySession.COGNITO_JWT, jwtToken);\t \n\t }\n\t });\n\t }\n\t //call refresh method in order to authenticate user and get new temp credentials\n\t AWS.config.credentials.refresh((error) => {\n\t if (error) {\t \n\t callback(error, null);\n\t } else {\t \n\t callback(null, true);\n\n\t }\n\t });\t\t\n\t}", "title": "" }, { "docid": "7126f7ff2d8296ec2924597bb26d8e3e", "score": "0.5464463", "text": "async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {\n const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||\n process.env['google_application_credentials'];\n if (!credentialsPath || credentialsPath.length === 0) {\n return null;\n }\n try {\n return this._getApplicationCredentialsFromFilePath(credentialsPath, options);\n }\n catch (e) {\n e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`;\n throw e;\n }\n }", "title": "" }, { "docid": "7126f7ff2d8296ec2924597bb26d8e3e", "score": "0.5464463", "text": "async _tryGetApplicationCredentialsFromEnvironmentVariable(options) {\n const credentialsPath = process.env['GOOGLE_APPLICATION_CREDENTIALS'] ||\n process.env['google_application_credentials'];\n if (!credentialsPath || credentialsPath.length === 0) {\n return null;\n }\n try {\n return this._getApplicationCredentialsFromFilePath(credentialsPath, options);\n }\n catch (e) {\n e.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e.message}`;\n throw e;\n }\n }", "title": "" }, { "docid": "0e3c7b9b07a3ce1347a9bc9bc114b2ce", "score": "0.54484", "text": "get credentialsArnInput() {\n return this._credentialsArn;\n }", "title": "" }, { "docid": "167a0a4eae6fc5a6f329986c1ac69887", "score": "0.54375196", "text": "get awsAuth() {\n if (!this.kubectlEnabled) {\n throw new Error(`Cannot define aws-auth mappings if kubectl is disabled`);\n }\n if (!this._awsAuth) {\n this._awsAuth = new aws_auth_1.AwsAuth(this, 'AwsAuth', { cluster: this });\n }\n return this._awsAuth;\n }", "title": "" }, { "docid": "7a54bdd9c2926892bb5d20f82ff8fb6d", "score": "0.5410408", "text": "get awsAuth() {\n if (!this.kubectlEnabled) {\n throw new Error('Cannot define aws-auth mappings if kubectl is disabled');\n }\n if (!this._awsAuth) {\n this._awsAuth = new aws_auth_1.AwsAuth(this, 'AwsAuth', { cluster: this });\n }\n return this._awsAuth;\n }", "title": "" }, { "docid": "1b9e27ec70e4d6d6a6d07901c8df2a7d", "score": "0.5390538", "text": "function GetS3Host() {\n\t\tvar s3host\t\t\t\t= \"https://s3.amazonaws.com/\"\n\t\t\n\t\tvar region\t\t\t\t= process.env['AWS_REGION']\n\t\tif (region != 'us-east-1') {\n\t\t\ts3host\t\t\t\t= \"https://s3-\" + region + \".amazonaws.com/\"\n\t\t}\n\t\treturn s3host;\n\t}", "title": "" }, { "docid": "f789e66fbe69018ffccafc8dcc594883", "score": "0.5359919", "text": "function getCredentials () {\n return {\n accessToken: window.localStorage.access_token,\n refreshToken: window.localStorage.refresh_token\n }\n}", "title": "" }, { "docid": "c8b9cb961e051d03959b47563cfc2782", "score": "0.53148806", "text": "addEnvironmentCredentials(credentials, prefix) { // separate credential environment variable prefix from obtaining the credentials from the environment.\n let environmentCredentials = new AWS.EnvironmentCredentials(prefix);\n if (environmentCredentials) {\n if (environmentCredentials.accessKeyId) {\n credentials.accessKeyId = environmentCredentials.accessKeyId;\n }\n if (environmentCredentials.secretAccessKey) {\n credentials.secretAccessKey = environmentCredentials.secretAccessKey;\n }\n if (environmentCredentials.sessionToken) {\n credentials.sessionToken = environmentCredentials.sessionToken;\n }\n }\n }", "title": "" }, { "docid": "4e3ffff1994c9bb4eb5ad201bfa7d696", "score": "0.5314143", "text": "getKeyFilePath() {\n return keyDir + \"/\" + keyFile;\n }", "title": "" }, { "docid": "e320777946771f1e657158c060fca548", "score": "0.5295164", "text": "function _ICLogin2_oauthFileName(nodeId) {\n return './' + nodeId + '_cred.json';\n }", "title": "" }, { "docid": "5f77305fcc19407d930fc673216de27e", "score": "0.5276348", "text": "async _getApplicationCredentialsFromFilePath(filePath, options = {}) {\n // Make sure the path looks like a string.\n if (!filePath || filePath.length === 0) {\n throw new Error('The file path is invalid.');\n }\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n filePath = fs.realpathSync(filePath);\n if (!fs.lstatSync(filePath).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;\n throw err;\n }\n // Now open a read stream on the file, and parse it.\n const readStream = fs.createReadStream(filePath);\n return this.fromStream(readStream, options);\n }", "title": "" }, { "docid": "5f77305fcc19407d930fc673216de27e", "score": "0.5276348", "text": "async _getApplicationCredentialsFromFilePath(filePath, options = {}) {\n // Make sure the path looks like a string.\n if (!filePath || filePath.length === 0) {\n throw new Error('The file path is invalid.');\n }\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n filePath = fs.realpathSync(filePath);\n if (!fs.lstatSync(filePath).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;\n throw err;\n }\n // Now open a read stream on the file, and parse it.\n const readStream = fs.createReadStream(filePath);\n return this.fromStream(readStream, options);\n }", "title": "" }, { "docid": "045a54523d563f2316094bb17ee3d7ee", "score": "0.5220042", "text": "async _getApplicationCredentialsFromFilePath(filePath, options = {}) {\n // Make sure the path looks like a string.\n if (!filePath || filePath.length === 0) {\n throw new Error('The file path is invalid.');\n }\n // Make sure there is a file at the path. lstatSync will throw if there is\n // nothing there.\n try {\n // Resolve path to actual file in case of symlink. Expect a thrown error\n // if not resolvable.\n filePath = fs.realpathSync(filePath);\n if (!fs.lstatSync(filePath).isFile()) {\n throw new Error();\n }\n }\n catch (err) {\n err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;\n throw err;\n }\n // Now open a read stream on the file, and parse it.\n const readStream = fs.createReadStream(filePath);\n return this.fromStream(readStream, options);\n }", "title": "" }, { "docid": "3b6c38d8bfec080f58f3b0da85ec1802", "score": "0.5205309", "text": "async getCredentials(keyFile) {\n const mimeType = mime.getType(keyFile);\n switch (mimeType) {\n case 'application/json': {\n // *.json file\n const key = await readFile(keyFile, 'utf8');\n const body = JSON.parse(key);\n const privateKey = body.private_key;\n const clientEmail = body.client_email;\n if (!privateKey || !clientEmail) {\n throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS');\n }\n return { privateKey, clientEmail };\n }\n case 'application/x-x509-ca-cert': {\n // *.pem file\n const privateKey = await readFile(keyFile, 'utf8');\n return { privateKey };\n }\n case 'application/x-pkcs12': {\n // *.p12 file\n // NOTE: The loading of `google-p12-pem` is deferred for performance\n // reasons. The `node-forge` npm module in `google-p12-pem` adds a fair\n // bit time to overall module loading, and is likely not frequently\n // used. In a future release, p12 support will be entirely removed.\n if (!getPem) {\n getPem = (await Promise.resolve().then(() => __webpack_require__(7799))).getPem;\n }\n const privateKey = await getPem(keyFile);\n return { privateKey };\n }\n default:\n throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' +\n 'Current supported extensions are *.json, *.pem, and *.p12.', 'UNKNOWN_CERTIFICATE_TYPE');\n }\n }", "title": "" }, { "docid": "a086d2033a65761602fab55713d14c2a", "score": "0.5178983", "text": "async getCredentials(keyFile) {\n const mimeType = mime.getType(keyFile);\n switch (mimeType) {\n case 'application/json': {\n // *.json file\n const key = await readFile(keyFile, 'utf8');\n const body = JSON.parse(key);\n const privateKey = body.private_key;\n const clientEmail = body.client_email;\n if (!privateKey || !clientEmail) {\n throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS');\n }\n return { privateKey, clientEmail };\n }\n case 'application/x-x509-ca-cert': {\n // *.pem file\n const privateKey = await readFile(keyFile, 'utf8');\n return { privateKey };\n }\n case 'application/x-pkcs12': {\n // *.p12 file\n // NOTE: The loading of `google-p12-pem` is deferred for performance\n // reasons. The `node-forge` npm module in `google-p12-pem` adds a fair\n // bit time to overall module loading, and is likely not frequently\n // used. In a future release, p12 support will be entirely removed.\n if (!getPem) {\n getPem = (await Promise.resolve().then(() => require('google-p12-pem'))).getPem;\n }\n const privateKey = await getPem(keyFile);\n return { privateKey };\n }\n default:\n throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' +\n 'Current supported extensions are *.json, *.pem, and *.p12.', 'UNKNOWN_CERTIFICATE_TYPE');\n }\n }", "title": "" }, { "docid": "fb15860841692b14852da6bea523593f", "score": "0.51704264", "text": "async getCredentials(keyFile) {\n const mimeType = mime.getType(keyFile);\n switch (mimeType) {\n case 'application/json': {\n // *.json file\n const key = await readFile(keyFile, 'utf8');\n const body = JSON.parse(key);\n const privateKey = body.private_key;\n const clientEmail = body.client_email;\n if (!privateKey || !clientEmail) {\n throw new ErrorWithCode('private_key and client_email are required.', 'MISSING_CREDENTIALS');\n }\n return { privateKey, clientEmail };\n }\n case 'application/x-x509-ca-cert': {\n // *.pem file\n const privateKey = await readFile(keyFile, 'utf8');\n return { privateKey };\n }\n case 'application/x-pkcs12': {\n // *.p12 file\n // NOTE: The loading of `google-p12-pem` is deferred for performance\n // reasons. The `node-forge` npm module in `google-p12-pem` adds a fair\n // bit time to overall module loading, and is likely not frequently\n // used. In a future release, p12 support will be entirely removed.\n if (!getPem) {\n getPem = (await Promise.resolve().then(() => __webpack_require__(/*! google-p12-pem */ \"./node_modules/google-p12-pem/build/src/index.js\"))).getPem;\n }\n const privateKey = await getPem(keyFile);\n return { privateKey };\n }\n default:\n throw new ErrorWithCode('Unknown certificate type. Type is determined based on file extension. ' +\n 'Current supported extensions are *.json, *.pem, and *.p12.', 'UNKNOWN_CERTIFICATE_TYPE');\n }\n }", "title": "" }, { "docid": "2693382a7d8e5d2e1e2a5ed001a2d3aa", "score": "0.5135526", "text": "function getStorageCredentials(){\n return msRestAzure.loginWithAppServiceMSI({resource: 'https://storage.azure.com/'});\n}", "title": "" }, { "docid": "13401664a1ae71f086af274e9770d936", "score": "0.5133612", "text": "function getSettingsDirPath() {\n var _a;\n return (_a = config.dir) !== null && _a !== void 0 ? _a : getElectronApp().getPath('userData');\n}", "title": "" }, { "docid": "752e6ae7f507a81bce64e568f98e326b", "score": "0.5131483", "text": "async get() {\n const response = await this.client.getObject(this.constructor.s3config).promise();\n const body = String(response.Body);\n\n if (!body) {\n // Empty strings are not valid configurations\n throw new Error('Configuration file is empty');\n }\n\n try {\n return JSON.parse(body);\n } catch {\n throw new Error('Invalid configuration file');\n }\n }", "title": "" }, { "docid": "af91372736f065b236a68d7203bc7647", "score": "0.5102824", "text": "addConfigurationCredentials(credentials, config) { // just transfer the credentials\n if (config) {\n if (config.awsAdminKeyId) {\n credentials.accessKeyId = config.awsAdminKeyId;\n }\n if (config.awsAdminSecretKey) {\n credentials.secretAccessKey = config.awsAdminSecretKey;\n }\n if (config.awsAdminSessionToken) {\n credentials.sessionToken = config.awsAdminSessionToken;\n }\n }\n }", "title": "" }, { "docid": "a1c53732515c6fb67a2b7e014565998b", "score": "0.50977933", "text": "get awsAccountId() {\n return this.getStringAttribute('aws_account_id');\n }", "title": "" }, { "docid": "b8d241ab54e2c5648fdb6537135c3c82", "score": "0.50854003", "text": "function getPathToParsedConfigFile() {\n return path.join(getPathToParsedConfigFolder(), 'config');\n}", "title": "" }, { "docid": "3a3256caca1269d44e83bee8da16c9b4", "score": "0.50460654", "text": "function getDestinationServiceCredentials() {\n return util_1.first(getDestinationServiceCredentialsList());\n}", "title": "" }, { "docid": "820eddb920a0fa904155a5ff1dcd5f26", "score": "0.5018436", "text": "get s3Bucket() {\n return this.getStringAttribute('s3_bucket');\n }", "title": "" }, { "docid": "5dbe351fe0000e9124f556ff5ad02208", "score": "0.50146556", "text": "function generateSecretConfig() {\n const NODE_ENV = env('NODE_ENV', 'development');\n const ENV_FILE = path.join(__dirname, '.env');\n let configsPath = path.join(__dirname, `${srcPath}/scripts/configs.${NODE_ENV}.js`);\n if (!fs.existsSync(ENV_FILE)) {\n console.info('Please initialize .env (copy .env.example) before perform build.')\n process.exit()\n }\n if (!fs.existsSync(configsPath)) {\n let configs = dotenv.parse(fs.readFileSync(ENV_FILE, { encoding: 'utf-8' }));\n let content = {}\n _.forEach(configs, function(v, k) {\n content[_.camelCase(k)] = v;\n });\n content = JSON.stringify(content, undefined, 2);\n content = `export default ${content};`;\n fs.writeFileSync(configsPath, content);\n }\n return {\n configs: configsPath\n }\n}", "title": "" }, { "docid": "9d484278b10cf2575b321794f6ad893c", "score": "0.5000677", "text": "get ownerPhotoUrl() {\n return credentials['ownerPhotoUrl'];\n }", "title": "" }, { "docid": "de5a0c6cf0f6fd75d9c480928f0ad255", "score": "0.49918374", "text": "getUserId() {\n let userId = AWS.config.credentials.params.IdentityId;\n if(!userId){\n console.log(\"In AWSConnector.getUserId \",userId);\n AWS.config.credentials.refresh(function(){\n AWS.config.credentials.params.IdentityId = AWS.config.credentials.identityId;\n console.log(\"Login refreshed \",AWS.config.credentials.params.IdentityId);\n });\n }\n return userId;\n }", "title": "" }, { "docid": "cda452a917676edc27ee23d9bff0cbde", "score": "0.49865603", "text": "get credentialsInput() {\n return this._credentials;\n }", "title": "" }, { "docid": "120929479e53f9cec6d15e5615685883", "score": "0.491375", "text": "function downloadConfig() {\n return getObject({\n Bucket: bucket,\n Key: 'simple-goals/config.json',\n }).then(body => JSON.parse(body.Body));\n}", "title": "" }, { "docid": "ee8f6e734aab69c693fbe9313f50c0f1", "score": "0.4907846", "text": "function getKeyPath (bucketPath, file) {\n const basePath = devCheckout\n ? file.replace(devCheckout, '')\n : file.replace(path.dirname(__dirname), '')\n return path.join(bucketPath, basePath)\n}", "title": "" }, { "docid": "a6474bd6bb36f029718fd8b1cda2d92a", "score": "0.49065304", "text": "function getKeyPath (bucketPath, file) {\n const basePath = file.replace(path.dirname(__dirname), '')\n return path.join(bucketPath, basePath)\n}", "title": "" }, { "docid": "ca7f7db2a7c729c7c8e338c75039f210", "score": "0.49019045", "text": "function updCredentials() {\n fs.writeFileSync(fileCredentials, JSON.stringify(credentials, null, 3));\n}", "title": "" }, { "docid": "56836fc155b13baa0cd4c446f0a84a9e", "score": "0.48939544", "text": "static get pathToStorage() {\n return path.join(config_1.StaticConfig.homePath, this.storageFileName);\n }", "title": "" }, { "docid": "6bc78b55362a647c536b8f3c303dfdea", "score": "0.4890494", "text": "get customerAwsId() {\n return this.getStringAttribute('customer_aws_id');\n }", "title": "" }, { "docid": "48edeb924fe4e974d71aee2da8c08f09", "score": "0.48839805", "text": "function getAwsSecret(secretName) {\n return client.getSecretValue({ SecretId: secretName }).promise();\n}", "title": "" }, { "docid": "0ecf390c1c577bab52660730f55226a7", "score": "0.4863716", "text": "constructor(credentials, bucketName) {\n this.AWS = AWS;\n this.bucketName = bucketName;\n \n // load config\n if (typeof credentials === 'string') {\n this.AWS.config.loadFromPath(credentials);\n }\n else if (credentials) {\n this.AWS.config.update(credentials);\n }\n }", "title": "" }, { "docid": "7bfdbfd9ad2b80c6f93f08e2e173b11b", "score": "0.48487306", "text": "settingsPath() {\n return path.join(pwd(), '.blueprintrc');\n }", "title": "" }, { "docid": "b04aa173203e9771d4ac832b2a4402b0", "score": "0.48399523", "text": "function retrieveCredentials(context) {\n return new Promise(resolve => {\n // To create a new access token, we first have to retrieve the credentials\n // of the service account that will make the generateTokenRequest().\n // To do that, we will use the App Engine Default Service Account.\n const options = {\n host: 'metadata.google.internal',\n path: '/computeMetadata/v1/instance/service-accounts/default/token',\n method: 'GET',\n headers: {'Metadata-Flavor': 'Google'},\n };\n\n const get_req = http.get(options, res => {\n let body = '';\n\n res.on('data', chunk => {\n body += chunk;\n });\n\n res.on('end', () => {\n const response = JSON.parse(body);\n return generateAccessToken(\n context,\n response.access_token,\n response.token_type\n ).then(result => {\n return resolve(result);\n });\n });\n });\n get_req.on('error', e => {\n //console.log('Error retrieving credentials', e.message);\n return 'Error retrieving token' + e.message;\n });\n get_req.end();\n });\n}", "title": "" }, { "docid": "cb07b4a6dca89ba7163f8d7c74c45446", "score": "0.48373705", "text": "function addProfileToCredentials(credentials, profileName, AccessKeyId, SecretAcessKey, SessionToken) {\n credentials += \"[\" + profileName + \"]\" + LF +\n \"aws_access_key_id=\" + AccessKeyId + LF +\n \"aws_secret_access_key=\" + SecretAcessKey + LF +\n \"aws_session_token=\" + SessionToken + LF +\n LF;\n return credentials;\n}", "title": "" }, { "docid": "0d8f69e45670ba45af1e98dff3f2a756", "score": "0.48283997", "text": "function base64credentials () {\n var id = this.client.client_id\n var secret = this.client.client_secret\n var credentials = id + ':' + secret\n\n return Buffer.from(credentials).toString('base64')\n}", "title": "" }, { "docid": "f35ea3d5787c88e950ae77a106e3a4d2", "score": "0.48206452", "text": "function getConfigFile() {\n try {\n let raw_data = fs.readFileSync(configPath);\n let parsed_data = JSON.parse(raw_data);\n return parsed_data;\n } catch(e) {\n logger.error('Failed to get config file');\n return null;\n }\n}", "title": "" }, { "docid": "eb6ac2b8c6a49251393f20b0d8dc0d42", "score": "0.48187575", "text": "function readCredentials(cb) {\n fs.readFile(path.join(__dirname, 'credentials.json'), function(err, json) {\n if (err)\n console.warn(\"Missing backoffice credentials -> You won't be able to authenticate!\");\n\n var creds = JSON.parse(json || '{}');\n if (creds.user && creds.password)\n console.log(\"Credentials loaded\");\n else\n console.log(\"One or more blank credential -> You won't be able to authenticate!\");\n\n cb(creds.user, creds.password);\n });\n}", "title": "" }, { "docid": "a18a7534f0ecaef62a1a5a543bc964cc", "score": "0.48099744", "text": "function appSettingsPath(dir) {\n return path.join(dir, 'settings.json');\n}", "title": "" }, { "docid": "a254000f58e0956f81c2d4529907faf5", "score": "0.47909224", "text": "function readSecrets() {\n return new Promise(function(resolve, reject) {\n fs.readFile('client_secret.json', function (err, content) {\n if (err) {\n reject(Error(\"Could not read client_secret.json file.\"))\n }\n else {\n resolve(JSON.parse(content))\n }\n })\n })\n}", "title": "" }, { "docid": "41e65bdadca2d655e5f5f2099a27bfe4", "score": "0.4781792", "text": "function getDestinationBasicCredentials() {\n var destinationCredentials = getDestinationServiceCredentials();\n var basicCredentials = {\n clientid: destinationCredentials.clientid\n ? destinationCredentials.clientid\n : null,\n clientsecret: destinationCredentials.clientsecret\n ? destinationCredentials.clientsecret\n : null\n };\n return basicCredentials;\n}", "title": "" }, { "docid": "afce5c9ada78abfd32b94f5db0e57b52", "score": "0.47811505", "text": "get cookies() {\n return credentials['cookies'];\n }", "title": "" }, { "docid": "dd4d6ad73663a224f93270e1e8db07ae", "score": "0.47792113", "text": "async function getSettingsPath() {\n const settings = {\n global: {\n path: expandHomeDir( \"~/.mangareader-dl.json\" ),\n get exists() { return fileExists.sync( this.path ); },\n },\n local: {\n path: path.resolve( __dirname, \"..\", \"mangareader-dl.json\" ),\n get exists() { return fileExists.sync( this.path ); },\n },\n };\n\n // Create config file if missing\n if ( !settings.global.exists && !settings.local.exists ) {\n const response = await inquirer.prompt( [\n {\n type : \"confirm\",\n name : \"createGlobalConfig\",\n message: \"Do you want to create the global config at ~/.mangareader-dl.json?\",\n default: true,\n },\n ] );\n\n const createConfig = name => fs.writeFile( settings[name].path, JSON.stringify( defaultSettings, null, 2 ) );\n\n if ( response.createGlobalConfig )\n await createConfig( \"global\" );\n else\n await createConfig( \"local\" );\n }\n\n return settings.global.exists ?\n settings.global.path :\n settings.local.path;\n}", "title": "" }, { "docid": "2dcfd61afdb0301c93d1bede7feb0246", "score": "0.47730824", "text": "async function getDecryptedClientSecret() {\n const kms = new AWS.KMS();\n const result = await kms.decrypt({\n CiphertextBlob: Buffer.from(process.env.ENCRYPTED_CLIENT_SECRET, 'base64')\n }).promise();\n return result.Plaintext.toString().trim();\n}", "title": "" }, { "docid": "79c3f17fe0c7ab7eae55acce91e74165", "score": "0.47524506", "text": "get s3KeyInput() {\n return this._s3Key;\n }", "title": "" }, { "docid": "7b8702ae29f504bdaf1eab12081eed63", "score": "0.47366527", "text": "getGlobalConfigPath() {\n return path.resolve(path.join(this.getGlobalHome(), CONFIG_NAME));\n }", "title": "" }, { "docid": "f0bffa3948155ba347ab2064b0ca579f", "score": "0.4735356", "text": "get() {\n const ktp_image = this.getDataValue(\"ktp_image\");\n\n if (!ktp_image) {\n return ktp_image;\n }\n\n return `${process.env.S3_URL}/${ktp_image}`;\n }", "title": "" }, { "docid": "96050c8bf0ec8942fcac6f47014fe834", "score": "0.4723482", "text": "getEndpointFile (endpoint) {\n return cubic.nodes.auth.api.server.ws.endpoints.endpoints\n .find(e => e.name === endpoint).file\n }", "title": "" }, { "docid": "f6358e1d59b80a65a3e18b0b24b76d9a", "score": "0.4696067", "text": "function getObjectFromS3(fileKey) {\n return s3.getSignedUrl('getObject', {\n Bucket: bucket,\n Key: fileKey,\n Expires: 3600\n });\n}", "title": "" }, { "docid": "5d6d4f5bca2690acb92d59dbe0e0fc8f", "score": "0.46922454", "text": "function envPath(container, key) {\n return util.format(\n '/etc/user-data/containers/%s/env/%s.txt',\n container.name,\n key\n );\n}", "title": "" }, { "docid": "8909f7438d8c112adcc30f5497138731", "score": "0.46905655", "text": "getCredentials() {\n const errors = require('@feathersjs/errors');\n const Ajv = require('../../../../node_modules/ajv/dist/ajv.min');\n const ajv = new Ajv({allErrors: true});\n const userSchema = require('../../../../validations/user-schema.json');\n const getFormatErrors = require('../../../../validations/ajv-errors').getFormatErrors;\n const validate = ajv.compile(userSchema);\n //----------------------------------------------------------\n const user = {\n email: document.querySelector('[type=\"email\"]').value,\n password: document.querySelector('[type=\"password\"]').value\n };\n\n const valid = validate(user);\n if (!valid) {\n debug('Errors user credentials:', validate.errors);\n throw new errors.BadRequest('User data error', {errors: getFormatErrors(validate.errors)});\n }\n\n return user;\n }", "title": "" }, { "docid": "8544ccc7e11ca9e931dfead43a8c3bd5", "score": "0.467599", "text": "function getUploadPath() {\n if (typeof uploadDir === \"undefined\") {\n var userHome = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];\n return pathHelper.join(userHome, DATA_UPLOAD_PATH);\n } else {\n return uploadDir;\n }\n}", "title": "" }, { "docid": "cc04a0a976f0deea08e18517a7da75cf", "score": "0.46611562", "text": "canonicalizeProfileCredentials(credentials) {\n let result = {};\n\n result.accessKeyId = credentials.accessKeyId\n || credentials.aws_access_key_id;\n\n result.secretAccessKey = credentials.secretAccessKey\n || credentials.aws_secret_access_key;\n\n result.sessionToken = credentials.sessionToken\n || credentials.aws_session_token\n || credentials.aws_security_token; // python boto standard\n\n return _.omitBy(result, _.isNil);\n }", "title": "" }, { "docid": "98cdec17276c028b527dc36420017893", "score": "0.4647481", "text": "function storeCredentials(client) {\n var userCredentials = {\n email: client.email,\n password: client.password,\n pactID: client.pactID\n };\n \n var filepath = generateCredentialsFilePath(client.email);\n \n // Make sure file does not already exist (email not registered already)\n fs.stat(filepath, function(err, stats) {\n if (err.code === 'ENOENT') {\n // Write object to file\n fs.writeFile(filepath, JSON.stringify(userCredentials), function(err) {\n if (err) {\n console.log(\"Could not write file: \" + filepath + \". Error: \" + err);\n }\n });\n } else {\n console.log(\"Email already exists.\");\n }\n });\n \n}", "title": "" }, { "docid": "b5da1d90e73fd8f01a3d74ff5b1782e9", "score": "0.46365634", "text": "getSessionSecret(dataPath) {\n const tokenPath = path.join(dataPath, soft.WEB_SESSION_TOKEN);\n const secretSize = 64;\n let secret;\n // read secret from file\n if (fs.existsSync(tokenPath)) {\n try {\n secret = fs.readFileSync(tokenPath, 'utf8');\n } catch (e) {\n // nothing to do here - probably file is a folder or something\n }\n }\n\n if (!secret) {\n // generate a new secret\n const buf = Buffer.alloc(secretSize);\n secret = crypto.randomFillSync(buf).toString('hex');\n try {\n // write secret to file\n fs.writeFileSync(tokenPath, secret);\n } catch (e) {\n // nothing to do here - maybe missing perms?\n }\n }\n\n return secret;\n }", "title": "" }, { "docid": "b6518992cd2f8d5097dfabd4c0def15f", "score": "0.46355197", "text": "getAllProfiles() {\n let credsPath = this.getAwsCredentialsFile();\n let configPath = this.getAwsConfigFile();\n\n let creds;\n try {\n creds = AWS.util.ini.parse(AWS.util.readFileSync(credsPath));\n }\n catch (e) {\n creds = {};\n }\n\n let configs;\n try {\n configs = AWS.util.ini.parse(AWS.util.readFileSync(configPath));\n }\n catch (e) {\n configs = {};\n }\n\n // First, load up all profile from config file.\n var profiles = Object.keys(configs).reduce((obj, key) => {\n const match = key.match(/^profile (.+)/);\n if (match) {\n obj[match[1]] = configs[key];\n }\n return obj;\n }, {});\n\n // Now, load profiles from credentials file (overriding any values found in config file)\n Object.keys(creds).forEach((name) => {\n profiles[name] = Object.assign(profiles[name] || {}, creds[name]);\n });\n\n return profiles;\n }", "title": "" }, { "docid": "fd7f799b75afa31f6235a7a702ec89c2", "score": "0.46168637", "text": "get artifactS3LocationInput() {\n return this._artifactS3Location;\n }", "title": "" }, { "docid": "4da0c80bfa50f710aeaacc4db31f3393", "score": "0.461612", "text": "function getPIcredentials() {\n var pi_url = \"\";\n var pi_username = \"\";\n var pi_password = \"\";\n var pi_creds = \"\";\n var services = \"\";\n \n var vcapservices = parseVcapServices();\n \n if (vcapservices) {\n\t // console.log(\"vcap services: \" +process.env.VCAP_SERVICES);\n\t services = JSON.parse(process.env.VCAP_SERVICES);\n } else {\n\t // console.log(\"services defined to testenv: \" + testEnvironment);\n\t services = testEnvironment;\n }\n// console.log(\"services: \" + JSON.stringify(services[\"personality_insights\"]));\n pi_creds = services[\"personality_insights\"][0].credentials; \n pi_endpoint.url = pi_creds.url;\n pi_endpoint.username = pi_creds.username;\n pi_endpoint.password = pi_creds.password;\n \n return pi_creds;\n}", "title": "" }, { "docid": "0fdb7e785642ce27b47d0dc68ea6255f", "score": "0.46124998", "text": "async function getCredentialsFromStorage() {\n const values = await AsyncStorage.getItem('api/credentials');\n const jsonValues = JSON.parse(values);\n\n // Return credentials from storage, or an empty object\n if (jsonValues.email || jsonValues.password) return jsonValues;\n return {};\n}", "title": "" }, { "docid": "70bc9835582199f4321f1651236f3ea8", "score": "0.46100488", "text": "function readKeys() {\n var content = fs.readFileSync(\"credentials.json\");\n var json = JSON.parse(content);\n process.env.PARTNER_TOKEN = json['partnerKey'];\n process.env.APP_KEY = json['appKey'];\n}", "title": "" }, { "docid": "5f2e9b286c982e1f05005ed32f0dbc0b", "score": "0.460851", "text": "async function getTokenFromAws(domain, accountId) {\n const command = `aws codeartifact get-authorization-token --domain ${domain} --domain-owner ${accountId} --query authorizationToken --output text`;\n try {\n const { stdout, stderr } = await exec(command);\n if (stdout) {\n return stdout.replace(/\\n*$/, \"\");\n }\n if (stderr) {\n console.log('stderr:', stderr);\n }\n } catch (e) {\n console.error(e); // should contain code (exit code) and signal (that caused the termination).\n process.exit(1);\n }\n}", "title": "" }, { "docid": "41ed8f3459616232521db230a1718a65", "score": "0.46057943", "text": "function promptCredentials() {\n\tconst credentialsFilename = 'credentials.json';\n\tconst credentials = util.loadJSON(credentialsFilename);\n\n\treturn util.prompt([{\n\t\ttype: 'input',\n\t\tname: 'username',\n\t\tmessage: 'Enter FIWARE username:',\n\t\tdefault: credentials.username\n\t}, {\n\t\ttype: 'password',\n\t\tname: 'password',\n\t\tmessage: 'Enter FIWARE password:',\n\t\tdefault: credentials.password\n\t}]).then((answers) => {\n\t\tconst { username, password } = answers;\n\n\t\tutil.storeJSON(credentialsFilename, {\n\t\t\tusername,\n\t\t\tpassword\n\t\t});\n\n\t\treturn answers;\n\t});\n}", "title": "" }, { "docid": "3c5e8f45f334a44a7a1c4e14b3cc6c5d", "score": "0.46046895", "text": "function stsGetCallerIdentity(creds) {\n var stsParams = {credentials: creds };\n // Create STS service object\n var sts = new AWS.STS(stsParams);\n \n sts.getCallerIdentity({}, function(err, data) {\n if (err) {\n console.log(err, err.stack);\n }\n else {\n console.log(data.Arn);\n }\n }); \n}", "title": "" }, { "docid": "ba00d0df1af1f74881f060e3d2bae855", "score": "0.45945802", "text": "async function getSecrets(userId) {\n\tvar params = {\n\t Bucket: bucket,\n\t Key: getKey(userId),\n\t};\n\treturn s3.getObject(params).promise().then(response => JSON.parse(response.Body));\n}", "title": "" }, { "docid": "8a664ddd110634fea64658fd5a55e8b7", "score": "0.4593056", "text": "function credentials( options ) {\n\t// backwards compatibility\n\treturn ( tls.createSecureContext ) ? tls.createSecureContext(options).context :\tcrypto.createCredentials(options).context;\n}", "title": "" }, { "docid": "d96003906b99846b6827676f06cd682c", "score": "0.45894775", "text": "function getKeyFromFile(filename){\n let destinyPath = path.join(KEY_DIR, filename);\n return fs.readFileSync(destinyPath);\n}", "title": "" }, { "docid": "f6b31d5909ffc64a470106711180ad4d", "score": "0.45872363", "text": "function readHttpsCreds (config, key, relName) {\n let baseName = '.'\n if (config.fileName) baseName = path.dirname(config.fileName)\n\n Logger.debug(`readHttpsCreds(config, '${key}', '${relName}'), baseName: '${baseName}'`)\n const fileName = path.resolve(baseName, relName)\n Logger.debug(`readHttpsCreds() reading '${fileName}'`)\n\n const contents = util.loadFile(fileName)\n if (contents == null) {\n Logger.error(`error reading file '${fileName}', specified in config key ${key}`)\n return null\n }\n\n return contents\n}", "title": "" }, { "docid": "e7899c338c8d74e58c234b0b43ab9c18", "score": "0.4549497", "text": "function YNetwork_get_callbackCredentials()\n { var json_val = this._getAttr('callbackCredentials');\n return (json_val == null ? Y_CALLBACKCREDENTIALS_INVALID : json_val);\n }", "title": "" }, { "docid": "aea326824d988a6e6883b0e65879b747", "score": "0.45441768", "text": "async getFileProjectId() {\n if (this.cachedCredential) {\n // Try to read the project ID from the cached credentials file\n return this.cachedCredential.projectId;\n }\n // Ensure the projectId is loaded from the keyFile if available.\n if (this.keyFilename) {\n const creds = await this.getClient();\n if (creds && creds.projectId) {\n return creds.projectId;\n }\n }\n // Try to load a credentials file and read its project ID\n const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable();\n if (r) {\n return r.projectId;\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "518adc23d96b08511ba6591c26514740", "score": "0.45409617", "text": "function getS3Key( file, user_id ){\n\n if(file !== null){\n\n // Trying to prevent naming collisions by appending the unique user_id to file name\n // -- remove and save the extension - should be the last part\n // -- want to make sure we allow . in the filename outside of extension\n var pieces = file.name.split(\".\");\n var extension = pieces.pop();\n var file_name = user_id + \"-\" + pieces.join(\".\") + \".\" + extension;\n\n return $http({\n\n method: 'GET',\n url: \"/sign_s3?file_name=\"+file_name+\"&file_type=\"+file.type\n\n });\n }\n }", "title": "" }, { "docid": "7653238484c5d179a67a04030f5cb45a", "score": "0.4535321", "text": "async getFileProjectId() {\n if (this.cachedCredential) {\n // Try to read the project ID from the cached credentials file\n return this.cachedCredential.projectId;\n }\n // Ensure the projectId is loaded from the keyFile if available.\n if (this.keyFilename) {\n const creds = await this.getClient();\n if (creds && creds.projectId) {\n return creds.projectId;\n }\n }\n // Try to load a credentials file and read its project ID\n const r = await this._tryGetApplicationCredentialsFromEnvironmentVariable();\n if (r) {\n return r.projectId;\n }\n else {\n return null;\n }\n }", "title": "" } ]
51e23fe11027ae22773bfcdd3cac2785
Purpose: calls the constructor of the parent class and initializes the fields. 'state' contains the toggle field which is a boolean that determines the visibility of the modal , sender which is the user the that sent the object, and deleted which is boolean that shows if the offer has been deleted or not.
[ { "docid": "a46d1d9128c6543a0e92cdf97e1f83c2", "score": "0.63221973", "text": "constructor(props) {\n super(props);\n\n this.state = {\n token: '',\n deleted: false,\n offerDialog: false,\n }\n }", "title": "" } ]
[ { "docid": "060b163a9d4ca42dc1538688ffc183b5", "score": "0.6948725", "text": "constructor(props) {\n super(props);\n\n this.state = {\n modal: false,\n name: \"\",\n product: {\n id: \"\",\n name: \"\",\n description: \"\",\n price: \"\"\n }\n };\n\n this.toggle = this.toggle.bind(this);\n }", "title": "" }, { "docid": "93ee999794e1bf5ae30e042ce1f62fb6", "score": "0.678596", "text": "constructor(props){\r\n super(props);\r\n this.state = {deps:[], addModalShow:false, editModalShow:false}\r\n \r\n }", "title": "" }, { "docid": "b88a0d1760c4ed170edf5de237cf7683", "score": "0.6440544", "text": "constructor(props){\n //Call the constructor of Super class i.e The Component\n super(props);\n //maintain the state required for this component\n this.state = {\n restaurant_ID: props.match.params.restaurant_ID,\n customer_ID: cookie.load('customer'),\n restaurant_name: \"\",\n short_address: \"\",\n cover_image: \"\",\n about: \"\",\n full_adress: \"\",\n fetchedDishes: [],\n selectedDishes: [],\n order_info: {},\n showModal: false,\n showConfirmationModal: false,\n new_dish: {},\n isFavourite: false\n }\n //Bind the handlers to this class\n this.updateQuantityHandler = this.updateQuantityHandler.bind(this);\n this.fetchRestaurantDetails = this.fetchRestaurantDetails.bind(this);\n this.fetchDishes = this.fetchDishes.bind(this);\n this.fetchCurrentOrder = this.fetchCurrentOrder.bind(this);\n this.viewOrder = this.viewOrder.bind(this);\n this.closeModal = this.closeModal.bind(this);\n this.checkoutOrder = this.checkoutOrder.bind(this);\n }", "title": "" }, { "docid": "27e959f4979c8beb891f2010d825c436", "score": "0.63731354", "text": "resetDialogState() {\n \tvar newstate = Object.assign(this.state);\n \t\n \tnewstate.showDelete = false;\n \tnewstate.show = false;\n\t\t\n \tthis.setState(newstate);\n\t }", "title": "" }, { "docid": "e025e8ebcc10d889e6cc8e7ed59c7cd8", "score": "0.6362914", "text": "constructor(props) {\n super(props);\n this.state = {modalStatus: ''}\n \n this.showOrHideEvent = this.showOrHideEvent.bind(this);\n this.submitNewLabel = this.submitNewLabel.bind(this);\n }", "title": "" }, { "docid": "1edae270b672861bc88a394e8ba755ba", "score": "0.63426626", "text": "constructor(){\n super();\n this.state = {\n showContactInfo : false\n };\n // funciton binding\n this.onDeleteClick = this.onDeleteClick.bind(this);\n }", "title": "" }, { "docid": "868c1f611e2a5a1bbbd03996fcf73019", "score": "0.63271064", "text": "constructor() {\n super();\n this.state = {\n selectedIndex: -1,\n snackbar: {\n open: false,\n msg: ''\n },\n modals: {\n about: false,\n help: false,\n contact: false\n },\n contact: {\n email: '',\n msg: '',\n err: ''\n }\n };\n\n // Bind modal actions\n this.closeModal = this.closeModal.bind(this);\n this.openModal = this.openModal.bind(this);\n this.setModal = this.setModal.bind(this);\n\n // Bind snackbar actions\n this.showSnackbar = this.showSnackbar.bind(this);\n this.hideSnackbar = this.hideSnackbar.bind(this);\n this.handleContactSend = this.handleContactSend.bind(this);\n }", "title": "" }, { "docid": "88a5b0e4bfbe5ecf846f25d018e4e785", "score": "0.6324015", "text": "constructor(props) {\n super(props);\n\n this.state = {\n isConfirmationModalOpen: false,\n selectedOrders: [],\n confirmationTitle: '',\n confirmationDescription: [],\n confirmFor: '',\n isSelectedMulti: false\n };\n\n this.onCheckboxChange = this.onCheckboxChange.bind(this);\n this.showConfirmationModal = this.showConfirmationModal.bind(this);\n this.hideConfirmationModal = this.hideConfirmationModal.bind(this);\n }", "title": "" }, { "docid": "93e131a100e81d21976370f512f9b813", "score": "0.6230635", "text": "deleteToggle() {\n this.setState(state => ({ DeleteModal: !state.DeleteModal }));\n }", "title": "" }, { "docid": "95e562ac6d0e50bac256fdc8444dcf67", "score": "0.6226898", "text": "constructor (props) {\n super(props);\n this.state = {\n open: true,\n cpModal: false\n }\n this.togglePanel = this.togglePanel.bind(this);\n this.toggleCPModal = this.toggleCPModal.bind(this);\n }", "title": "" }, { "docid": "be5ccd5524fd8e541cb498f28b75d9a7", "score": "0.6221913", "text": "constructor(props) {\n super(props);\n this.state = {\n isHidden: props.card.collapsed,\n card: props.card\n };\n this.toggleBody = this.toggleBody.bind(this);\n }", "title": "" }, { "docid": "ce351d5de2a28c11647329d38310b33e", "score": "0.620789", "text": "constructor() {\n\t super();\n\t this.state = {gamePostSuccess: false,\n\t \t\t\t\ttype: new ToggleList(),\n\t \t\t\t\ttutorial: new ToggleList(),\n\t \t\t\t\tinstruction: new ToggleList(),\n\t \t\t\t\tnumPlayers: new ToggleList(),\n\t \t\t\t\titemsNeeded: new ToggleList()\n\t \t\t\t\t}\n\t}", "title": "" }, { "docid": "64aba1d1d88777bdfbce5e64d2144f1c", "score": "0.61489004", "text": "constructor() {\n super();\n this.state = {\n showModal: true,\n authorised: false\n };\n\n this.clickHandler = this.clickHandler.bind(this);\n }", "title": "" }, { "docid": "2157804577843f285724997f671bf7bd", "score": "0.61338216", "text": "constructor(props) {\n super(props);\n this.state = {showModal: false};\n this.fetchStore = this.fetchStore.bind(this);\n }", "title": "" }, { "docid": "a039a32934dc5a34949ebc7e2379b545", "score": "0.6130284", "text": "handleShowDelete(event){\n \tvar projectId = event.target.dataset.id;\n \tvar newstate = Object.assign(this.state);\n \t\n \tnewstate.showDelete = true;\n \tnewstate.projectId = projectId;\n\t\t\n \tthis.setState(newstate);\n }", "title": "" }, { "docid": "00f49fe834d8cdeec55ce17f93aefcb6", "score": "0.6105814", "text": "constructor(props) {\n super(props);\n this.toggle = this.toggle.bind(this);\n\t\tthis.state = {\n collapse: false,\n\t\t\tstatus: '',\n\t\t\t_id: this.props.post._id,\n\t\t\ttitle: this.props.post.title,\n\t\t\tdescription: this.props.post.description,\n\t\t\ttype: this.props.post.type,\n\t\t\tevtstatus: this.props.post.evtstatus,\n\t\t\tpreviousDetails: {\n\t\t\t\t_id: this.props.post._id,\n\t\t\t\ttitle: this.props.post.title,\n\t\t\t\tdescription: this.props.post.description,\n\t\t\t\ttype: this.props.post.type,\n\t\t\t\tevtstatus: this.props.post.evtstatus\n\t\t\t}\n\t\t}\n }", "title": "" }, { "docid": "efad75416074281c9a52b2928222acdf", "score": "0.6099944", "text": "constructor(sender, state) {\n this.sender = sender;\n this.state = state;\n }", "title": "" }, { "docid": "1d7ecbf57c2ab7b1bbb475cbd30347df", "score": "0.6090881", "text": "constructor(props) {\n super(props);\n this.state = {\n isVisibleModal: false\n }\n }", "title": "" }, { "docid": "6912827abaa70933100a284aa1589763", "score": "0.60881346", "text": "constructor(props) {\n super(props);\n // No modal shown initially\n this.state = {modal: null};\n }", "title": "" }, { "docid": "d304e2be2b18755c103c96d30bdfcc8a", "score": "0.6072234", "text": "constructor(props) {\n super(props);\n this.state = {\n open: false\n }\n this.toggleModal = this.toggleModal.bind(this);\n this.verify = this.verify.bind(this); \n }", "title": "" }, { "docid": "16cce8f51c248ac5c5d8eebea9d6d138", "score": "0.6037054", "text": "constructor(props) {\n super(props);\n\n this.state = {\n isEditing: false //usually doesn't set state in (not best practice) set state inside components. better to have top lever component that does all this stuff and we're not using redux which has that philosophy\n };\n }", "title": "" }, { "docid": "ddc635d117e67666a38fc2a8b237c06c", "score": "0.6029067", "text": "constructor(props){\r\n super(props)\r\n this.state = {\r\n displayMenu1: false,\r\n displayMenu2: false,\r\n displayMenu3: false,\r\n displayAll: false,\r\n bid: false,\r\n bidlistElement:null\r\n }\r\n\r\n\r\n \r\n }", "title": "" }, { "docid": "b930be0b8847336375419fa47adbfe2a", "score": "0.59966254", "text": "constructor(props) {\n super(props);\n this.state = {elm: \"sand\", sandwiches: [], selectedOption: null,\n paymentMethod: null, submitSuccess: null, orderId: null, update: false, msg: \"placed\"\n }\n }", "title": "" }, { "docid": "5c9dc428e80dc54ac2aee4d217a4ee57", "score": "0.5977184", "text": "constructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state={isEditing: false};\n\t}", "title": "" }, { "docid": "749b40b7b56844cbd39845bb12edf043", "score": "0.59758395", "text": "constructor(props) {\n super(props); // This is important to do.\n this.toggleBtn = this.toggleBtn.bind(this); // This refers to the props.\n this.title = 'Visibility';\n this.state = {\n show: false,\n }\n }", "title": "" }, { "docid": "7fd926f4fd614035612201cb65c92518", "score": "0.59695506", "text": "constructor(){\n\t\tsuper()\n\t\tthis.state ={\n\t\t\taddingNote:false,\n\t\t\ttitle :null,\n\t\t}\n\t}", "title": "" }, { "docid": "1e1e1f70651fa954e36f7f681d50c69d", "score": "0.59650826", "text": "constructor(props) {\n\n super(props);\n this.state = {\n \tloggedIn : false,\n \tlockstatus:'locked-closed',\n \ttransparency:false,\n \ttoggleValue:false\n };\n this.toggleButtonPressed = this.toggleButtonPressed.bind(this);\n \n }", "title": "" }, { "docid": "02ef8ad2047f2568a6f3c28a206bd573", "score": "0.5945315", "text": "constructor(props) {\n super(props);\n this.state = {\n editMode: false\n };\n this.toggleEdit = this.toggleEdit.bind(this);\n }", "title": "" }, { "docid": "02ef8ad2047f2568a6f3c28a206bd573", "score": "0.5945315", "text": "constructor(props) {\n super(props);\n this.state = {\n editMode: false\n };\n this.toggleEdit = this.toggleEdit.bind(this);\n }", "title": "" }, { "docid": "21b316d9475c6f7f0189a642ef811fd5", "score": "0.5929838", "text": "toggle() {\n this.fetchReminder(this.props.id)\n this.setState(prevState => ({\n modal: !prevState.modal,\n }));\n console.log(\"MODAL STATE\",this.state);\n }", "title": "" }, { "docid": "091f2c5ec26e74a7782323f2f57ce2bf", "score": "0.5914449", "text": "constructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\thasUpvoted: false,\n\t\t\thasDownvoted: true,\n\t\t\tshowModal: false,\n\t\t};\n\n\t\t// This binding is necessary to make `this` work in the callback\n\t\tthis.handleDownvote = this.handleDownvote.bind(this);\n\t\tthis.handleUpvote = this.handleUpvote.bind(this);\n\t\tthis.handleCloseModal = this.handleCloseModal.bind(this);\n\t\tthis.handleShowModal = this.handleShowModal.bind(this);\n\t}", "title": "" }, { "docid": "c3bb013216e19953d6728fba633ee0de", "score": "0.59053546", "text": "constructor() {\n super();\n // Set the state as editing to false.\n this.state = {\n isEditing: false\n };\n }", "title": "" }, { "docid": "7313b0bde5fda1ef4cbca99cc6c65fdf", "score": "0.59024304", "text": "toggle(){\r\n this.setState({modal: !this.state.modal});\r\n console.log(this.state.modal);\r\n this.setState({\r\n custName : '',\r\n country: '',\r\n businessType: '',\r\n addone : '',\r\n addtwo: '',\r\n addthree: '',\r\n postcode: ''\r\n });\r\n }", "title": "" }, { "docid": "9e25cce4cf88f3fc07394c670d3b5693", "score": "0.5897743", "text": "constructor(props) {\n super(props);\n this.state = { showModal: false };\n this.handleClick = this.handleClick.bind(this);\n }", "title": "" }, { "docid": "41ac1c4067e082d2f51a2597645788a3", "score": "0.58917314", "text": "constructor(props) {\n super(props);\n this.state = {\n taikhoans: [],\n pbs: [],\n hds: [],\n nvs: [],\n chonPB: '',\n chonRadio: \"adminNS\",\n // addModalShow: false,\n // editModalShow: false,\n // showModalShow: false\n InModalShow: false\n }\n this.handleChange = this.handleChange.bind(this)\n this.handleChangeCheck = this.handleChangeCheck.bind(this)\n }", "title": "" }, { "docid": "798a77c4af75a2e29b2ab5ab7dcee716", "score": "0.58902633", "text": "constructor() {\n super(); \n this.state = {\n modalOpen : false\n }\n this.newBook = {}; \n bookStore.fetchBooks();\n }", "title": "" }, { "docid": "9f2ae2cb9895ce38fddd5cfe5c48b93f", "score": "0.58898455", "text": "constructor(props){\n //Call the constrictor of Super class i.e The Component\n super(props);\n this.hideModal = this.hideModal.bind(this);\n this.changeHandler = this.changeHandler.bind(this);\n this.scrollToBottom = this.scrollToBottom.bind(this);\n this.clearMessage = this.clearMessage.bind(this);\n\n //maintain the state required for this component\n this.state = {\n message: \"\"\n }\n }", "title": "" }, { "docid": "19a44d9a1021e12d0c5977100a7c9c61", "score": "0.588831", "text": "constructor(props) {\n super(props);\n\n this.state = {\n isUserModalOpen: false\n };\n\n this.onClickNew = this.onClickNew.bind(this);\n this.onModalClose = this.onModalClose.bind(this);\n }", "title": "" }, { "docid": "949c7ec08c8751ab5d9930d0c0446bee", "score": "0.5883393", "text": "createClicked() {\n this.state = {\n addActive : true,\n adding : true,\n editing : false,\n };\n this.showAddForm();\n }", "title": "" }, { "docid": "7c74daeee57f6f53ef7131ca801b8217", "score": "0.5868814", "text": "constructor() {\n super();\n this.state = {\n currentRestaurantIndex: 0,\n likedSpots: [],\n showLikes: false,\n showRestaurantsModal: false,\n restaurantIndex: 0,\n spots: [],\n sendEmail: false,\n enterEmail: '',\n };\n }", "title": "" }, { "docid": "6f15517a502784a7c9bb95455393dea9", "score": "0.5847706", "text": "constructor(){\n super();\n this.state = {\n comments:[],\n others:[],\n headerObj:\"\",\n modalButtonObj:\"\",\n modalObj:\"\",\n headerAndDescription:\"\",\n centerPanel:\"\",\n tableObj:\"\",\n linksPanelObj:\"\",\n centerPanelWithRowsObj:\"\",\n collapsePanelObj:\"\",\n navBarObj:\"\"\n }\n }", "title": "" }, { "docid": "cd6bec3caeaf89cf4a9db9d86b67a3dc", "score": "0.5844747", "text": "toggleAddTenantVehicle() {\n this.setState(state => ({\n showAddTenantModal: !state.showAddTenantModal,\n requestStatus: \"NO_MSG\",\n responseMessage: \"\"\n }));\n }", "title": "" }, { "docid": "a46ad14187234b936672a56924c2c957", "score": "0.58271146", "text": "constructor(props ){\n super (props);\n this.state = {\n isEditing : false\n };\n }", "title": "" }, { "docid": "faf04e1ab5848ed0707b8c9ccb748853", "score": "0.5822034", "text": "openModal(type) {\n var obj = {};\n obj.modalIsOpen=true;\n if(type==\"edit\"){\n obj.edit=true;\n }\n this.setState(obj);\n }", "title": "" }, { "docid": "cc13d636e0a65ec7554b031c0eaada2c", "score": "0.5802095", "text": "constructor(props) {\n super(props);\n this.initialState = {\n inputs: {\n title: this.props.title || \"\",\n description: this.props.description || \"\",\n ageLevel: this.props.ageLevel || \"\"\n },\n showModal: false\n }\n this.state = this.initialState;\n this.handleChange = this.handleChange.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleClickClose = this.handleClickClose.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "title": "" }, { "docid": "d6fc36ab58a7d76b5760a28db8fad5b7", "score": "0.5791288", "text": "constructor(props) {\n super(props); \n\n this.state = {\n code:\" \", visibleModal: null, textmodal:\"Modal\"\n }\n }", "title": "" }, { "docid": "6a8c1d9bb87d9b4e65b2106ada284c93", "score": "0.57908666", "text": "toggle(){\n this.setState(prevState => ({ //Actualiza el estado del componente cuando es procesado y renderizado\n modal: !prevState.modal\n })); \n }", "title": "" }, { "docid": "b7e16d1e68a8e728e04d3a70e5e969ad", "score": "0.5764212", "text": "constructor() {\n super()\n this.state = {\n toggle: false\n }\n }", "title": "" }, { "docid": "4c5d65f05424699f124a9839bcebf5e8", "score": "0.5750691", "text": "constructor(props) {\n super(props);\n this.errorAlert = new ErrorAlert();\n this.state = {\n formValues: {\n /*address: '',*/\n description: '',\n tag: ''\n },\n btnMeStyle: highlightStyle,\n anonymousStyle: transparentStyle,\n reportedUser: this.props.global.currentUser.objectId,\n trueSwitchIsOn: false\n };\n this._showUploadGallery = this._showUploadGallery.bind(this);\n this._setUserStyle = this._setUserStyle.bind(this);\n }", "title": "" }, { "docid": "31d3f1713c5929a43be5a253282db60e", "score": "0.5745018", "text": "constructor(props)\n {\n super(props);\n this.state = {\n openModal: false, \n modalName: \"\",\n listItems: [],\n listSettings: {}\n };\n this.handleCloseModal = this.handleCloseModal.bind(this);\n this.handleOpenModal = this.handleOpenModal.bind(this);\n this.retrieveList = this.retrieveList.bind(this);\n this.retrieveListSettings = this.retrieveListSettings.bind(this);\n \n // Get all items in list from database through backend REST API.\n this.retrieveList();\n\n // Get list settings from database through backend REST API.\n this.retrieveListSettings();\n }", "title": "" }, { "docid": "4b50912d2f0af3fbadc8b013bdf1b078", "score": "0.57393855", "text": "updateState(state){\n if(state === 'HIDDEN')\n $(`.${this.unique}`).hide();\n else\n $(`.${this.unique}`).show();\n \n this.state = state;\n return this;\n }", "title": "" }, { "docid": "57616fb8956ccde0688bf2b8628a75e7", "score": "0.57147366", "text": "constructor(props){\n\t\tsuper(props);\n console.log(\"Main Component Constructor is invoked\");\n /*state stores properties related to this component that we can make us of*/\n\t\tthis.state = {\n\t\t\tdishes: DISHES,\n /*selectedDish: null*///DishDetail disabled\n comments: COMMENTS,\n promotions: PROMOTIONS,\n leaders: LEADERS\n };\n }", "title": "" }, { "docid": "20139f1cf57df83c4b724b905cf9a3a1", "score": "0.5711129", "text": "constructor(){\n super();\n this.state = {\n books:[],\n newBookData:{\n title:'',\n rating:''\n },\n editBookData:{\n id: '',\n title:'',\n rating:''\n },\n newBookModal: false,\n editBookModal: false,\n }\n }", "title": "" }, { "docid": "bfcbe8cf43b39516e69d21fb4f0799a4", "score": "0.57075137", "text": "showModalCreate() {\n\n\t\tthis.setState({\n\t\t\tshowModalCreate: true,\n\t\t\tcustomer: {\n\t\t\t\t// id: '',\n\t\t\t\tname: '',\n\t\t\t\taddress: '',\n\t\t\t\tphone: ''\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "b001a4900d35e49c11018e96dc58c0c2", "score": "0.56987834", "text": "constructor(props) {\n super(props);\n this.state = {\n deletedUser: {\n userId: this.props.params.userId\n },\n open: true,\n };\n this.onUserSave = this.onUserSave.bind(this);\n this.handleClose = this.handleClose.bind(this);\n }", "title": "" }, { "docid": "824ac837eba9c808e78c3daf9857bd19", "score": "0.5694073", "text": "constructor(state) {\n super();\n this.state = state;\n this.initialized = false;\n this.attrs = {};\n }", "title": "" }, { "docid": "a7c9beff07fd4753fffcead16dd3913c", "score": "0.56929433", "text": "constructor(props) {\n super(props)\n this.state = { flag: false };\n }", "title": "" }, { "docid": "046e2540052dd90f0e67a2231e307b8c", "score": "0.5690403", "text": "constructor(props){\n\t\tsuper(props)\n\t\tthis.state = {button: false}\n\t}", "title": "" }, { "docid": "b6a373352f4fd6510b4bd747de72ce6c", "score": "0.5687608", "text": "constructor(props) {\n super(props);\n this.state = {\n type: {},\n type_pk: -1,\n name: null,\n normal_rate: '0',\n trays_per_box: '1',\n loading: true,\n err_msg: '',\n visible: true,\n };\n }", "title": "" }, { "docid": "b22d7a0a4fd731fb59453d36c287cfdf", "score": "0.5684313", "text": "vaciarLimpiezaVehiculo(state) {\n state.limpieza_vehiculo= new LimpiezaVehiculo(0, '', '', false, false, false, false, 0,0) // Modelo lote\n }", "title": "" }, { "docid": "597f26e5cc7f1d52cfb55126dd65479a", "score": "0.5683044", "text": "constructor(props) {\n super(props);\n this.state = {\n isToggleOn: false, \n color : 'white',\n backgroundColor: 'green',\n donne : []\n };\n \n // This binding is necessary to make `this` work in the callback\n this.handleClick = this.handleClick.bind(this);\n }", "title": "" }, { "docid": "a822922f666c51d7a8f9318f3e6cf68b", "score": "0.56811124", "text": "constructor(props) {\n super(props);\n this.state = {\n newsList: [],\n isLoading: true,\n errors: null,\n show: false\n };\n\n this.handleNewsActivate = this.handleNewsActivate.bind(this);\n this.handleNewsDeactivate = this.handleNewsDeactivate.bind(this);\n this.handleNewsDeleteProcess = this.handleNewsDeleteProcess.bind(this);\n this.submitDelete = this.submitDelete.bind(this);\n }", "title": "" }, { "docid": "cf58d3d2ee2f408000235b1472e111d5", "score": "0.5678839", "text": "constructor(props) {\n super(props); \n\n this.state = {\n username:\" \", password:\" \", visibleModal: null, textmodal:\"Modal\"\n }\n }", "title": "" }, { "docid": "fa75a82a197751b95a36c7dd3b39ccce", "score": "0.5677221", "text": "constructor() {\n super()\n this.state = {\n expenses: [ ]\n }\n this.handleDelete = this.handleDelete.bind(this);\n }", "title": "" }, { "docid": "855cf6cf01acbab0b75d7244d9e04e33", "score": "0.5656985", "text": "constructor (props) {\n // llamamos a la funcion super pasandole las props\n super(props);\n\n // creo el estado con una propiedad isToggleOn para saber si tengo que mostrar on o off en el texto del boton\n this.state = {\n isToggleOn: true\n };\n\n // es importante agregar esta línea cuando pasamos funciones por atributos\n // esto es para que si dentro de la funcion utilizamos la palabra reservada `this`, funcione bien y sin problemas\n // si nos olvidamos esta linea, `this` dentro de la funcion seria `undefined`\n this.handleClick = this.handleClick.bind(this);\n }", "title": "" }, { "docid": "94f6fc2b8563ec23d23d0398a91b0a81", "score": "0.56511796", "text": "constructor(props) { \n super(props)\n this.state = {\n id: props.row.id,\n status: props.row.status,\n date: props.row.date,\n company: props.row.company,\n position: props.row.position,\n type: props.row.type,\n \n // Sets the intial isOpen state of the form\n // that pops up to false\n isOpen: false,\n }\n\n // \n this.handleStatusChange = this.handleStatusChange.bind(this);\n this.handleDateChange = this.handleDateChange.bind(this);\n this.handleCompanyChange = this.handleCompanyChange.bind(this);\n this.handlePositionChange = this.handlePositionChange.bind(this);\n this.handleTypeChange = this.handleTypeChange.bind(this);\n this.handleClickOpen = this.handleClickOpen.bind(this);\n this.handleClose = this.handleClose.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n }", "title": "" }, { "docid": "4915f6aa73ff1ba066d663bc12f7b203", "score": "0.56508857", "text": "constructor(props) {\n super(props);\n this.state = {\n isModalOpen: false,\n value: null,\n selectedFile: null,\n loaded: 0,\n validationIssues: [],\n errorMsg: null,\n };\n\n this.onToggle = this.onToggle.bind(this);\n this.handleUpload = this.handleUpload.bind(this);\n this.handleSelectedFile = this.handleSelectedFile.bind(this);\n this.api = new Client();\n }", "title": "" }, { "docid": "d6a7d354b4756d141577c136df7b8892", "score": "0.5645345", "text": "toggleDeleteSaleModal() {\n\t\tthis.setState({ isDeleteSaleModal: !this.state.isDeleteSaleModal });\n\t}", "title": "" }, { "docid": "48ccfc3ff21c1e4fcb95885663f39a57", "score": "0.5643464", "text": "TOGGLE_DEL_MODAL(state) {\n state.isDelModalOn = !state.isDelModalOn\n }", "title": "" }, { "docid": "156779a14779fb602edb25173895ae0a", "score": "0.56414217", "text": "constructor(props) {\n super(props);\n this.state = {\n data: this.props.data,\n redrecit: false,\n };\n\n // bind functions\n this.CreatList = this.CreatList.bind(this);\n this.getColorByStatus = this.getColorByStatus.bind(this);\n this.confirmToDelete = this.confirmToDelete.bind(this);\n }", "title": "" }, { "docid": "265542acf2cc2a61e4b4c941fe58a89a", "score": "0.5640568", "text": "constructor(props) {\n super(props);\n this.state = {\n api_output: '',\n showModal: false,\n avatarSrc: null,\n avatarPreviewSrc: null,\n fullName: null\n };\n this.renderEditButtonIfLogged = this.renderEditButtonIfLogged.bind(this);\n this._open = this._open.bind(this);\n this._close = this._close.bind(this);\n this._revert = this._revert.bind(this);\n this._handleSubmit = this._handleSubmit.bind(this);\n this._avatarPreview = this._avatarPreview.bind(this);\n this._avatarUrlPreview = this._avatarUrlPreview.bind(this);\n }", "title": "" }, { "docid": "7d35d62eacdff5c341d979e607166def", "score": "0.56251556", "text": "showDeleteModal() {\n this.setState({\n isDeleteModalVisible: true,\n });\n }", "title": "" }, { "docid": "58e82375d166cae84f89083fec531a72", "score": "0.56166816", "text": "init() {\n $('#inventory-delete-item').on('click', function deleteItem(e) {\n e.preventDefault();\n $('.confirm-delete-item').data('id', $(this).data('id'));\n });\n\n $('.deletebatch').on('click', function deleteBatch(e) {\n e.preventDefault();\n $('.confirm-delete-batch').data('id', $(this).data('id'));\n });\n\n $('.confirm-delete-item').on('click', function confirmDeleteItem() {\n const url = `/dashboard/inventory/item/${$(this).data('id')}/delete/`;\n postDeleteForm(url);\n });\n\n $('.confirm-delete-batch').on('click', function confirmDeleteBatch() {\n const itemId = $('#item_id').val();\n const url = `/dashboard/inventory/item/${itemId}/batch/${$(this).data('id')}/delete/`;\n postDeleteForm(url);\n });\n\n $('#inventory-add-batch').on('click', (e) => {\n e.preventDefault();\n $('#inventory-add-batch-form').slideToggle(200);\n });\n }", "title": "" }, { "docid": "9275068a7f298490adaf6ea698e2f021", "score": "0.56111115", "text": "constructor(props){\n super(props);\n this.state = {\n smallCard: true\n }\n }", "title": "" }, { "docid": "7103c2201831e29be643ca136f5274ce", "score": "0.56094444", "text": "constructor(props) {\n /* props: <id> from Create/Join */\n super(props);\n this.enqueue = this.enqueue.bind(this);\n this.state = {\n songAdded: '',\n partyCode: '',\n size: '',\n queue: [],\n goHome: false,\n partyID:'',\n }\n }", "title": "" }, { "docid": "63adcad17619c170784824060d7af527", "score": "0.56060314", "text": "toggle() {\n this.setState(prevState => ({\n modal: !prevState.modal\n }));\n }", "title": "" }, { "docid": "b5d891c39a8d7d9e89c91dc4f32b9112", "score": "0.55949104", "text": "prepareDeleteLead(lead){\r\n this.setState({\r\n lead : lead,\r\n showDeleteModal : true\r\n });\r\n }", "title": "" }, { "docid": "0df441ef5742548689d94ce697fa7eeb", "score": "0.5594706", "text": "constructor() {\n super();\n this.state = {\n open: false\n };\n }", "title": "" }, { "docid": "9e68e466078f9583e1bfad5a861a32dd", "score": "0.5586456", "text": "changeDeleteState(e){\n\t\tthis.setState({deletePopup: !this.state.deletePopup});\n\t}", "title": "" }, { "docid": "5bded45839304acae5a46f1c748a7835", "score": "0.55861497", "text": "constructor(props){\n //super props access to parents props\n super(props);\n this.state = {\n saved: false,\n deleted:false,\n books: []\n }\n //This part is important, the .bind(this) sirve para poder subir en el 'tree' y cachar las props, sino = undefined! :)\n this.saveClick = this.saveClick.bind(this);\n this.deleteClick = this.deleteClick.bind(this);\n\n }", "title": "" }, { "docid": "1603b569ebe515c2c38f2fee28c73146", "score": "0.5585705", "text": "constructor(props) {\r\n super(props);\r\n this.state = {\r\n form: [],\r\n alert: false,\r\n alertData: {}\r\n };\r\n }", "title": "" }, { "docid": "585123f6b31416b2f0161d7d35da4ef5", "score": "0.5585326", "text": "make_edit_options_modal() {\n this.setState({\n editModalVisible: !this.state.editModalVisible,\n })\n }", "title": "" }, { "docid": "006d13bd5eeb6305d0f989fdf931bed6", "score": "0.55824345", "text": "constructor(props) {\n super(props);\n\n this.onDeleteMultiClick = this.onDeleteMultiClick.bind(this);\n this.onCompleteDeliveryClick = this.onCompleteDeliveryClick.bind(this);\n }", "title": "" }, { "docid": "4104716a7725cf1f314a93a9caae4921", "score": "0.5579442", "text": "constructor(props) {\n\t super(props);\n\t\t //definim state-ul care va fi la inceputul aplicatiei initializat astfel ca \n\t\t this.state = {\n\t\t loading: true, // datele se incarca \n\t\t dataSource:[], // si sursa de date inca nu este populata\n\t\t favorites: [], //pentru lucrul cu favorite\n\t\t addedToFavorites : false,//pentru conditioned rendering in cazul stelutelor\n\t\t selectedLocation : '', //variabila pentru memorarea locatiei curente selectate pentru detalii\n\t\t };\n\t}", "title": "" }, { "docid": "411d99d1c5531ea7812d2e8094ffee33", "score": "0.5567099", "text": "constructor(props) {\n super(props);\n this.state = ({ show: false });\n }", "title": "" }, { "docid": "10aef411cdb10a153e08a65be0996c22", "score": "0.5566005", "text": "constructor(props) {\r\n\t super(props)\r\n\r\n\t this.state = {\r\n\t\t\tselectedOption: ''\r\n\t\t}\r\n\t\tthis.handleDelete.bind(this)\r\n\t}", "title": "" }, { "docid": "399d88ac4677d66ffba7c3b740b0f0fa", "score": "0.55636823", "text": "constructor(props) {\n super(props);\n this.state = {\n activeOwner: {\n id: 0,\n dni: \"\",\n name: \"\"\n },\n showModal: false,\n sendingAjaxRequest: false,\n };\n this.API_URL = \"http://localhost:8080\";\n }", "title": "" }, { "docid": "bf4a38f0fb1a62ca86bd91783281e0d7", "score": "0.5561455", "text": "constructor(props) {\n\t\t super(props);\n\t\t this.state = {\n\t\t\t setupUserName: 'deltapeng',\n\t\t\t setupRoomName: '',\n\t\t\t setupNumActivs: '15',\n\t\t\t chkNameDisplay: 1\n\t\t }\n\t }", "title": "" }, { "docid": "2c21552dafbb6b90c13428f8d1a78f1f", "score": "0.55533725", "text": "constructor(props){\r\n\t\t\tsuper(props);\r\n\t\t\tthis.state={\r\n\t\t\t\tVENDORname: \"\",\r\n\t\t\t\tVENDORemail: \"\",\r\n\t\t\t\tVENDORPhone: \"\",\r\n\t\t\t\tVENDORabout: \"\",\r\n\t\t\t\tVOLUNTEERname: \"\",\r\n\t\t\t\tVOLUNTEEREmail: \"\",\r\n\t\t\t\tVOLUNTEERPhone: \"\",\r\n\t\t\t\tVOLUNTEERAbout: \"\",\r\n\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "bfec9edc428b7fb740c8e7d35afdb521", "score": "0.5552169", "text": "constructor() {\n super();\n\n this.state = {\n value: '',\n sending:false,\n sent:false,\n };\n\n this.addItem = this.addItem.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }", "title": "" }, { "docid": "a3f4d172356095195bdf0eebd8244249", "score": "0.555127", "text": "constructor(props) {\n super(props)\n this.state = {\n ideas: [],\n editingIdeaId: null,\n notification: '',\n transitionIn: false,\n }\n }", "title": "" }, { "docid": "ddf76f46648139a8658282c5411f6961", "score": "0.55498713", "text": "constructor(props) {\n super(props);\n\n this.handlePopoverOpen = this.handlePopoverOpen.bind(this);\n this.handlePopoverClose = this.handlePopoverClose.bind(this);\n this.handleLabelTextChange = this.handleLabelTextChange.bind(this);\n this._onRowSelection = this._onRowSelection.bind(this);\n this.handleDialogOpen = this.handleDialogOpen.bind(this);\n this.handleDialogClose = this.handleDialogClose.bind(this);\n\n this.state = {\n dialogOpen: false,\n\n /** Table component state */\n wrapperStyle: {\n height: '600px',\n 'overflowX': 'auto',\n },\n deselectOnClickaway: false,\n fixedFooter: true,\n fixedHeader: true,\n showRowHover: true,\n selectable: true,\n multiSelectable: true,\n\n /** Popover component state */\n popoverOpen: false,\n anchorOrigin: {\n horizontal: 'left',\n vertical: 'bottom',\n },\n targetOrigin: {\n horizontal: 'left',\n vertical: 'top',\n },\n labelText: '',\n };\n }", "title": "" }, { "docid": "5736b4cdc08bb194d405cc4d560cfd0d", "score": "0.55473435", "text": "constructor() {\n\n this.objUri = {};\n this.itemId = 'null';\n this.targetTr = null;\n this.domIds = {\n page_table : '#ads-table',\n del_modal : '#deleteModal',\n del_btn : ':button.del_btn',\n confirm_del: '#confirm_delete'\n }\n\n this.delModal = jQuery(this.domIds.del_modal);\n\n this.loadTables();\n this.deleteModal();\n this.confirmDeletion();\n\n }", "title": "" }, { "docid": "0ea75110b087096114c1a19a0445811e", "score": "0.55470955", "text": "constructor(props) {\n super(props);\n this.state = {\n data : {},\n project_popup: false,\n checkpoint_popup: false\n };\n\n //API call variables\n this.waiting_for_save = false;\n this.updates_to_data = false;\n this.fetching_config = true;\n\n //temp storage for checkpoint add handling\n this.checkpoint_temp = {proj:\"\", pos:0, operation : \"\"} //position\n }", "title": "" }, { "docid": "cdb36b804a6e5bda0fc4b65a1e368047", "score": "0.55389196", "text": "init() {\n this.autoOpenCocktailModal = this.inputs.getProp('autoOpen');\n\n this.onUnlock = this.inputs.getEvent('unlock');\n\n if (this.autoOpenCocktailModal) {\n this.openCocktailsModal = true;\n }\n }", "title": "" }, { "docid": "e14e5c6aaf7bdc3b05f5268b7ee37e5f", "score": "0.55373603", "text": "constructor(props){\n //Call the constrictor of Super class i.e The Component\n super(props);\n this.hideModal = this.hideModal.bind(this);\n this.changeHandler = this.changeHandler.bind(this);\n this.searchUser = this.searchUser.bind(this);\n this.addConversation = this.addConversation.bind(this);\n this.state = {\n message:\"\",\n searchMessage:\"\",\n username:\"\",\n users: []\n }\n }", "title": "" }, { "docid": "7ac4e0a77f33fd5a5ffe02cf870ad7e6", "score": "0.5536942", "text": "toggle() {\n this.setState(prevState => ({\n modal: !prevState.modal,\n groups:this.props.groups,\n\n }));\n }", "title": "" }, { "docid": "a41416225e80c7693892eb0a6d178b2d", "score": "0.5530818", "text": "constructor(props, context) {\n super(props, context);\n\n this.state = {\n show: false\n };\n }", "title": "" }, { "docid": "44a18becdab46ed25526097d8de155ca", "score": "0.5529956", "text": "applyToggle() {\n this.setState({\n showError:0,\n isAdminChecked: false,\n isManagementChecked: false,\n dateHired:'',\n name:'',\n email:'',\n mobile:'',\n department:'',\n password:'',\n password2:''\n\n });\n this.setState(prevState => ({\n modal: !prevState.modal\n }));\n this.validator.hideMessages();\n }", "title": "" }, { "docid": "e1c0f0e3cf38f529d0664c9dd90ffaf5", "score": "0.5527129", "text": "constructor() {\n super()\n this.state = {\n showQuestionPicker: false,\n showBreakComposer: false,\n }\n\n this.handleQuestionAdd = this.handleQuestionAdd.bind(this)\n }", "title": "" } ]
e17c7f3e023fe98e3390fb95c813e617
Create a DOMbinding that controls DOM nodes presence Covers e.g. 1. DOM Nodes contents ... an optional "if" 2. Virtual elements 3. Else binding
[ { "docid": "50ec8176f1e561a236c842540a9767fb", "score": "0.59145445", "text": "function makeWithIfBinding(isWith, isNot, isElse, makeContextCallback) {\n return {\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n\n var didDisplayOnLastUpdate,\n hasElse = detectElse(element),\n completesElseChain = observable(),\n ifElseNodes,\n precedingConditional;\n\n domData.set(element, \"conditional\", {\n elseChainSatisfied: completesElseChain,\n });\n\n if (isElse) {\n precedingConditional = getPrecedingConditional(element);\n }\n\n computed(function() {\n var rawValue = valueAccessor(),\n dataValue = unwrap(rawValue),\n shouldDisplayIf = !isNot !== !dataValue || (isElse && rawValue === undefined), // equivalent to (isNot ? !dataValue : !!dataValue) || isElse && rawValue === undefined\n isFirstRender = !ifElseNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplayIf !== didDisplayOnLastUpdate);\n\n if (precedingConditional && precedingConditional.elseChainSatisfied()) {\n shouldDisplayIf = false;\n needsRefresh = isFirstRender || didDisplayOnLastUpdate;\n completesElseChain(true);\n } else {\n completesElseChain(shouldDisplayIf);\n }\n\n if (!needsRefresh) { return; }\n\n if (isFirstRender && (dependencyDetection.getDependenciesCount() || hasElse)) {\n ifElseNodes = cloneIfElseNodes(element, hasElse);\n }\n\n if (shouldDisplayIf) {\n if (!isFirstRender || hasElse) {\n virtualElements.setDomNodeChildren(element, cloneNodes(ifElseNodes.ifNodes));\n }\n } else if (ifElseNodes) {\n virtualElements.setDomNodeChildren(element, cloneNodes(ifElseNodes.elseNodes));\n } else {\n virtualElements.emptyNode(element);\n }\n\n applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n\n didDisplayOnLastUpdate = shouldDisplayIf;\n }, null, { disposeWhenNodeIsRemoved: element });\n\n return { 'controlsDescendantBindings': true };\n },\n allowVirtualElements: true,\n bindingRewriteValidator: false\n };\n}", "title": "" } ]
[ { "docid": "dac2aa5f2925973f6ecc5b65c2b98c7b", "score": "0.5922576", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "dac2aa5f2925973f6ecc5b65c2b98c7b", "score": "0.5922576", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "c831fadd68d5e664a27218bd7ff58db6", "score": "0.5899682", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "c831fadd68d5e664a27218bd7ff58db6", "score": "0.5899682", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "c831fadd68d5e664a27218bd7ff58db6", "score": "0.5899682", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "c831fadd68d5e664a27218bd7ff58db6", "score": "0.5899682", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element) {\n ko.utils.domData.set(element, withIfDomDataKey, {});\n return { 'controlsDescendantBindings': true };\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var withIfData = ko.utils.domData.get(element, withIfDomDataKey),\n dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !withIfData.savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== withIfData.didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n if (isFirstRender) {\n withIfData.savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(withIfData.savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n withIfData.didDisplayOnLastUpdate = shouldDisplay;\n }\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "6a92a5ed93aa3246b0bd6605fac2f051", "score": "0.5793609", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "6a92a5ed93aa3246b0bd6605fac2f051", "score": "0.5793609", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "6a92a5ed93aa3246b0bd6605fac2f051", "score": "0.5793609", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, dataValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "00194eeeb559f3f32d4552c42f168b75", "score": "0.5791456", "text": "function makeWithIfBinding(bindingKey, isWith, isNot, makeContextCallback) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n ko.computed(function() {\n var rawValue = valueAccessor(),\n dataValue = ko.utils.unwrapObservable(rawValue),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "c14c0bed17e781fd1bee9da3f803b89c", "score": "0.56434697", "text": "function makeWithIfBinding(bindingKey, isWith, isNot) {\n ko.bindingHandlers[bindingKey] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate, savedNodes, contextOptions = {}, completeOnRender, needAsyncContext, renderOnEveryChange;\n\n if (isWith) {\n var as = allBindings.get('as'), noChildContext = allBindings.get('noChildContext');\n renderOnEveryChange = !(as && noChildContext);\n contextOptions = { 'as': as, 'noChildContext': noChildContext, 'exportDependencies': renderOnEveryChange };\n }\n\n completeOnRender = allBindings.get(\"completeOn\") == \"render\";\n needAsyncContext = completeOnRender || allBindings['has'](ko.bindingEvent.descendantsComplete);\n\n ko.computed(function() {\n var value = ko.utils.unwrapObservable(valueAccessor()),\n shouldDisplay = !isNot !== !value, // equivalent to isNot ? !value : !!value,\n isInitial = !savedNodes,\n childContext;\n\n if (!renderOnEveryChange && shouldDisplay === didDisplayOnLastUpdate) {\n return;\n }\n\n if (needAsyncContext) {\n bindingContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext);\n }\n\n if (shouldDisplay) {\n if (!isWith || renderOnEveryChange) {\n contextOptions['dataDependency'] = ko.computedContext.computed();\n }\n\n if (isWith) {\n childContext = bindingContext['createChildContext'](typeof value == \"function\" ? value : valueAccessor, contextOptions);\n } else if (ko.computedContext.getDependenciesCount()) {\n childContext = bindingContext['extend'](null, contextOptions);\n } else {\n childContext = bindingContext;\n }\n }\n\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isInitial && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isInitial) {\n ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n }\n\n ko.applyBindingsToDescendants(childContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n\n if (!completeOnRender) {\n ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete);\n }\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n\n }, null, { disposeWhenNodeIsRemoved: element });\n\n return { 'controlsDescendantBindings': true };\n }\n };\n ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n ko.virtualElements.allowedBindings[bindingKey] = true;\n}", "title": "" }, { "docid": "3d0aebcaf62212190249a30f85d68efc", "score": "0.5489303", "text": "function __create_binding_from_infos(d_b){\n //renvoie le 'bon' type de binding\n\t//probleme, si 2way pour un input...\n\n if(d_b[\"presenter\"] != null){\n d_b.to = \"innerHTML\";\n //determine si le contexte de données est une liste ou un objet simple....\n\n return new __model_binding(d_b);\n }\n if(d_b[\"item_presenter\"] != null){\n //affichage pour un array!\n\n d_b.to = \"innerHTML\";\n return new __array_binding(d_b);\n }\n if(d_b[\"command\"] != null){\n\n return new __command_binding(d_b);\n }\n\tif (d_b[\"mode\"] == '2way'){// && d_b._element.localName == 'input'){\n\t\t//consider input oblig�?\n\t\treturn new __input_binding(d_b);\n\t}\n\tif(d_b.to == 'innerHTML') return new __textContent_binding(d_b);\n if(d_b.forceAttr == null && d_b.to in d_b._element) return new __prop_binding(d_b);\n else{\n\n\t\treturn new __attr_binding(d_b);\n }\n\n}", "title": "" }, { "docid": "96b3b79c1e62fb95f826f46bb7c0039a", "score": "0.5433003", "text": "function makeWithIfBinding(isWith, isNot, makeContextCallback) {\n return {\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes;\n computed(function() {\n var rawValue = valueAccessor(),\n dataValue = unwrap(rawValue),\n shouldDisplay = !isNot !== !dataValue, // equivalent to isNot ? !dataValue : !!dataValue\n isFirstRender = !savedNodes,\n needsRefresh = isFirstRender || isWith || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && dependencyDetection.getDependenciesCount()) {\n savedNodes = cloneNodes(virtualElements.childNodes(element), true /* shouldCleanNodes */);\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n virtualElements.setDomNodeChildren(element, cloneNodes(savedNodes));\n }\n applyBindingsToDescendants(makeContextCallback ? makeContextCallback(bindingContext, rawValue) : bindingContext, element);\n } else {\n virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, { disposeWhenNodeIsRemoved: element });\n return { 'controlsDescendantBindings': true };\n },\n allowVirtualElements: true,\n bindingRewriteValidator: false\n };\n}", "title": "" }, { "docid": "47db7c37c17f4aaef89632132b98313e", "score": "0.5273462", "text": "function applyIfBehaviorToVirtualDOM(payload, selector, expandedBlueprint, data) {\n // Add elements to expandedBlueprint\n if (payload) {\n var parentUID;\n // Cycle through all parents whose children have $if behavior applied to them\n for (parentUID in data.parentUIDs) {\n // Cycle through all nodes that should be added to parent port\n for (var i = 0; i < data.parentUIDs[parentUID].length; i++) {\n ControlFlowUtils.attachNewNode(\n data.parentUIDs[parentUID][i], expandedBlueprint, parentUID\n );\n }\n }\n }\n // Remove elements from expandedBlueprint\n else {\n addDeleteMessages(expandedBlueprint, selector);\n }\n}", "title": "" }, { "docid": "7d4c7b1d20ab914d9318230c40a39381", "score": "0.526217", "text": "function cloneNodeAsHTML(node, boundElt) {\n\t\t\t\tvar i, j, k, x, y, z;\n\t\t\t\tswitch (node.nodeType) {\n\t\t\t\tcase 1: //Element\n\t\t\t\t\tvar newNode = document.createElement(node.nodeName.replace(/^[^:]*:/, \"\").toLowerCase()==\"content\" && node.namespaceURI==XBL_NS ? \"div\" : node.tagName.replace(/^\\w+:/i, \"\")); //recreate element, removing prefix; make xbl:content element into div so IE5 behaves\n\t\t\t\t\tfor(i=0; (x = node.attributes[i]); i++) { //attributes\n\t\t\t\t\t\tif(x.name.match(/^on/)) { //event attributes (have to set as methods rather than attrs):\n\t\t\t\t\t\t\tnewNode[x.name] = new Function(x.value);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch(x.name) {\n\t\t\t\t\t\tcase \"xmlns\": break;\n\t\t\t\t\t\tcase \"style\": newNode.style.cssText = x.value; break;\n\t\t\t\t\t\tcase \"class\": newNode.className = x.value; break;\n\t\t\t\t\t\tcase \"xbl:inherits\": //attribute forwarding; generated element inherits attribute from bound element:\n\t\t\t\t\t\t\tvar attrs = x.value.split(\",\");\n\t\t\t\t\t\t\tfor(j=0; (y=attrs[j]); j++) {\n\t\t\t\t\t\t\t\tvar v=\"\", p=y.split(\"=\"); //attribute renaming\n\t\t\t\t\t\t\t\tif(p[1] && p[1]==\"xbl:text\") { //value is coalesced child text nodes\n\t\t\t\t\t\t\t\t\tz = boundElt.childNodes;\n\t\t\t\t\t\t\t\t\tfor(k=0; k<z.length; k++) if(z[k].nodeType==3) v+=z[k].nodeValue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse v = boundElt.getAttribute(p[1] || p[0]); //value is attribute\n\t\t\t\t\t\t\t\tif(p[0]==\"xbl:text\") newNode.appendChild(document.createTextNode(v)); //value forwarded into text content\n\t\t\t\t\t\t\t\telse newNode.setAttribute(p[0], v); //value forwarded into attribute\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault: newNode.setAttribute(x.name, x.value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor(i=0; (x = node.childNodes[i]); i++) if(k=cloneNodeAsHTML(x, boundElt)) newNode.appendChild(k); //children\n\t\t\t\t\tnewNode.bindingOwner = boundElt; //set bindingOwner property (ElementXBL interface)\n\t\t\t\t\treturn newNode;\n\t\t\t\tcase 3: //Text\n\t\t\t\t\treturn document.createTextNode(node.nodeValue);\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d84697f3daa739920c946497f16b3dd9", "score": "0.5158415", "text": "function bind(node, scope) {\r\n var nodeType = node.nodeType;\r\n if (nodeType == 1 || nodeType == 9) { // Element or Document\r\n console.log(\"<\"+node.nodeName+\">\");\r\n // iterate over attributes and apply bindings.\r\n var attrs = node.attributes;\r\n for (var i=0,n=attrs&&attrs.length; i<n; i++) {\r\n var attr = attrs[i];\r\n if (attr.specified) {\r\n var name = attr.name;\r\n if (hasPrefix.test(name)) {\r\n var handler = bindings[name.slice(prefix.length)];\r\n if (handler) {\r\n //console.log(attr.name, '=', attr.value);\r\n handler(node, attr.value, scope, bind);\r\n } else {\r\n console.log(\"no handler for attribute:\", name);\r\n }\r\n }\r\n }\r\n }\r\n // iterate over child nodes.\r\n var child = node.firstChild;\r\n while (child) {\r\n // note that bindings can remove the node from the document,\r\n // so advance to the next child before applying bindings.\r\n var c = child;\r\n child = child.nextSibling;\r\n bind(c, scope);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "25203e26f8f09af90f03abfd873023b6", "score": "0.5121285", "text": "function insertDom(ele, binding, bindStatus) {\n const el = binding.modifiers.body ? document.body : ele\n console.log('in loading directive')\n console.log(ele.instance)\n const originPosition = el.style.position\n const originOverflow = el.style.overflow\n if (binding.value) {\n const loadingEle = document.createElement('div')\n loadingEle.className = 'orange-loading-customer'\n loadingEle.innerHTML = '加载中'\n console.log('....', el.style.position)\n el.style.position ? '' : el.style.position = 'relative'\n el.style.overflow = 'hidden'\n loadingEle.style.cssText = 'position: absolute; top: 0; bottom: 0; left: 0; right: 0; text-align: center; line-height: 100%; z-index: 9999999; background: rgba(200, 200, 200, 0.3)'\n el.appendChild(loadingEle)\n } else if (!bindStatus) {\n el.style.position = originPosition\n el.style.overflow = originOverflow\n console.log('dddddd')\n const loadingTemp = el.querySelector('.orange-loading-customer')\n console.log(loadingTemp && loadingTemp.length, 'ppp')\n loadingTemp ? el.removeChild(loadingTemp) : ''\n }\n}", "title": "" }, { "docid": "de722a071995fccf021799b4a993ee0d", "score": "0.5097253", "text": "bindElements() { }", "title": "" }, { "docid": "cbafc261b1902c7e44effc5008d81cc5", "score": "0.5092116", "text": "bindNode () {}", "title": "" }, { "docid": "d9b4f4fc3d66b92ae7fe308bf0628a33", "score": "0.5088284", "text": "function createVirtualDomNode(el,attr){var ns=el.namespaceURI!==HTML_NAMESPACE?el.namespaceURI:null;var key=attr&&el.getAttribute(attr)?el.getAttribute(attr):null;return new VNode(el.tagName,createProperties(el),createChildren(el,attr),key,ns);}", "title": "" }, { "docid": "62bc032e28f659f524d4275d4708de2b", "score": "0.5062339", "text": "function createNode(el,attr){ // html comment is not currently supported by virtual-dom\nif(el.nodeType===3){return createVirtualTextNode(el); // cdata or doctype is not currently supported by virtual-dom\n}else if(el.nodeType===1||el.nodeType===9){return createVirtualDomNode(el,attr);} // default to empty text node\nreturn new VText('');}", "title": "" }, { "docid": "610a1045ef77d7ea8982d49de8ba52f1", "score": "0.50481683", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n \n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n \n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n \n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n \n return branch0\n }\n }\n }", "title": "" }, { "docid": "3f19fc578e2bd42cc5b8b3284cbf8401", "score": "0.50447196", "text": "function create_else_block(ctx) {\n \tvar div;\n\n \treturn {\n \t\tc: function c() {\n \t\t\tdiv = element(\"div\");\n \t\t},\n \t\tm: function m(target, anchor) {\n \t\t\tinsert(target, div, anchor);\n \t\t\t/*div_binding_1*/ ctx[8](div);\n \t\t},\n \t\tp: noop$1,\n \t\td: function d(detaching) {\n \t\t\tif (detaching) { detach(div); }\n \t\t\t/*div_binding_1*/ ctx[8](null);\n \t\t}\n \t};\n }", "title": "" }, { "docid": "ee4f9e200bab4845b75a8a1805ed4ff2", "score": "0.50375926", "text": "registerBoundInput(input) {\n // [attr.style] or [attr.class] are skipped in the code below,\n // they should not be treated as styling-based bindings since\n // they are intended to be written directly to the attr and\n // will therefore skip all style/class resolution that is present\n // with style=\"\", [style]=\"\" and [style.prop]=\"\", class=\"\",\n // [class.prop]=\"\". [class]=\"\" assignments\n let binding = null;\n let name = input.name;\n switch (input.type) {\n case 0 /* Property */:\n binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);\n break;\n case 3 /* Style */:\n binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);\n break;\n case 2 /* Class */:\n binding = this.registerClassInput(name, false, input.value, input.sourceSpan);\n break;\n }\n return binding ? true : false;\n }", "title": "" }, { "docid": "ee4f9e200bab4845b75a8a1805ed4ff2", "score": "0.50375926", "text": "registerBoundInput(input) {\n // [attr.style] or [attr.class] are skipped in the code below,\n // they should not be treated as styling-based bindings since\n // they are intended to be written directly to the attr and\n // will therefore skip all style/class resolution that is present\n // with style=\"\", [style]=\"\" and [style.prop]=\"\", class=\"\",\n // [class.prop]=\"\". [class]=\"\" assignments\n let binding = null;\n let name = input.name;\n switch (input.type) {\n case 0 /* Property */:\n binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);\n break;\n case 3 /* Style */:\n binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);\n break;\n case 2 /* Class */:\n binding = this.registerClassInput(name, false, input.value, input.sourceSpan);\n break;\n }\n return binding ? true : false;\n }", "title": "" }, { "docid": "566e431677eb696009e6da9d64d55303", "score": "0.50367117", "text": "function preTransformNode (el, options) {\r\n if (el.tag === 'input') {\r\n var map = el.attrsMap;\r\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\r\n var typeBinding = getBindingAttr(el, 'type');\r\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\r\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\r\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\r\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\r\n // 1. checkbox\r\n var branch0 = cloneASTElement(el);\r\n // process for on the main node\r\n processFor(branch0);\r\n addRawAttr(branch0, 'type', 'checkbox');\r\n processElement(branch0, options);\r\n branch0.processed = true; // prevent it from double-processed\r\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\r\n addIfCondition(branch0, {\r\n exp: branch0.if,\r\n block: branch0\r\n });\r\n // 2. add radio else-if condition\r\n var branch1 = cloneASTElement(el);\r\n getAndRemoveAttr(branch1, 'v-for', true);\r\n addRawAttr(branch1, 'type', 'radio');\r\n processElement(branch1, options);\r\n addIfCondition(branch0, {\r\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\r\n block: branch1\r\n });\r\n // 3. other\r\n var branch2 = cloneASTElement(el);\r\n getAndRemoveAttr(branch2, 'v-for', true);\r\n addRawAttr(branch2, ':type', typeBinding);\r\n processElement(branch2, options);\r\n addIfCondition(branch0, {\r\n exp: ifCondition,\r\n block: branch2\r\n });\r\n\r\n if (hasElse) {\r\n branch0.else = true;\r\n } else if (elseIfCondition) {\r\n branch0.elseif = elseIfCondition;\r\n }\r\n\r\n return branch0\r\n }\r\n }\r\n}", "title": "" }, { "docid": "130d9c3f7f762937dfca304ac997156c", "score": "0.5032337", "text": "bind () {\n\t\tthis.bindChildren();\n\t\tthis.bindNode();\n\t}", "title": "" }, { "docid": "2c0bc31160859f5acc46cbd4b09cb7c5", "score": "0.5024169", "text": "if(fn, render) {\n const boolFn = value => !!fn(value);\n return this._addReplaceNodeBinding(boolFn, (prevNode) => {\n if (prevNode && prevNode.nodeType !== Node.COMMENT_NODE) {\n const templateIdx = this._subTemplates.findIndex(t => t.root() === prevNode);\n const [template] = this._subTemplates.splice(templateIdx, 1);\n template.dispose();\n }\n if (boolFn(this._value)) {\n const template = new Template(this._value, render);\n this._addSubTemplate(template);\n return template.root();\n } else {\n return document.createComment(\"if placeholder\");\n }\n });\n }", "title": "" }, { "docid": "ab6a4ad2e9cd28bf97d9183d5eb78fb4", "score": "0.5006408", "text": "function createElement(comp,condition,tag,props,directives,children,html,forScope){\n if(!condition)return;\n\n var rs = new VNode(tag,props,directives);\n var fsq = null;\n if(forScope)\n fsq = rs._forScopeQ = [forScope];\n if (COMP_MAP[tag]) {\n rs._comp = true;\n var slotData = children[0];\n rs._slots = slotData[0];\n rs._slotMap = slotData[1];\n return rs;\n }\n if(html != null){\n //这里需要更新children\n var pair = parseHTML(html);\n var fn = compileVDOM('<'+tag+'>'+html+'</'+tag+'>',comp);\n var root;\n try{\n root = fn.call(comp,comp.state,createElement,createTemplate,createText,createElementList,doFilter);\n }catch(e){\n error('[x-html] compile error on '+e.message);\n return;\n }\n children = root.children || [];\n }\n \n if(children.length>0){\n rs.children = [];\n children.forEach(function(node){\n if(node){\n if(node instanceof Array){\n node.forEach(function(c){\n c.parent = rs;\n rs.children.push(c);\n if(fsq){\n var cfsq = c._forScopeQ;\n if(cfsq){\n c._forScopeQ = fsq.concat(cfsq);\n }else{\n c._forScopeQ = fsq;\n }\n }\n });\n }else{\n node.parent = rs;\n rs.children.push(node);\n if(fsq){\n var cfsq = node._forScopeQ;\n if(cfsq){\n node._forScopeQ = fsq.concat(cfsq);\n }else{\n node._forScopeQ = fsq;\n }\n }\n }//end if\n }//end if\n });\n }\n \n return rs;\n}", "title": "" }, { "docid": "71b55847b4c7596d3e4e790a42af6fac", "score": "0.49984625", "text": "function vdom(h) {\n return h && h('div').type === 'VirtualNode'\n}", "title": "" }, { "docid": "6be6892a749422b9b7894294d60d5519", "score": "0.49948448", "text": "function preTransformNode (el, options) {\n\t if (el.tag === 'input') {\n\t var map = el.attrsMap;\n\t if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n\t var typeBinding = getBindingAttr(el, 'type');\n\t var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n\t var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n\t var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n\t var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n\t // 1. checkbox\n\t var branch0 = cloneASTElement(el);\n\t // process for on the main node\n\t processFor(branch0);\n\t addRawAttr(branch0, 'type', 'checkbox');\n\t processElement(branch0, options);\n\t branch0.processed = true; // prevent it from double-processed\n\t branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n\t addIfCondition(branch0, {\n\t exp: branch0.if,\n\t block: branch0\n\t });\n\t // 2. add radio else-if condition\n\t var branch1 = cloneASTElement(el);\n\t getAndRemoveAttr(branch1, 'v-for', true);\n\t addRawAttr(branch1, 'type', 'radio');\n\t processElement(branch1, options);\n\t addIfCondition(branch0, {\n\t exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n\t block: branch1\n\t });\n\t // 3. other\n\t var branch2 = cloneASTElement(el);\n\t getAndRemoveAttr(branch2, 'v-for', true);\n\t addRawAttr(branch2, ':type', typeBinding);\n\t processElement(branch2, options);\n\t addIfCondition(branch0, {\n\t exp: ifCondition,\n\t block: branch2\n\t });\n\n\t if (hasElse) {\n\t branch0.else = true;\n\t } else if (elseIfCondition) {\n\t branch0.elseif = elseIfCondition;\n\t }\n\n\t return branch0\n\t }\n\t }\n\t}", "title": "" }, { "docid": "6be6892a749422b9b7894294d60d5519", "score": "0.49948448", "text": "function preTransformNode (el, options) {\n\t if (el.tag === 'input') {\n\t var map = el.attrsMap;\n\t if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n\t var typeBinding = getBindingAttr(el, 'type');\n\t var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n\t var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n\t var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n\t var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n\t // 1. checkbox\n\t var branch0 = cloneASTElement(el);\n\t // process for on the main node\n\t processFor(branch0);\n\t addRawAttr(branch0, 'type', 'checkbox');\n\t processElement(branch0, options);\n\t branch0.processed = true; // prevent it from double-processed\n\t branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n\t addIfCondition(branch0, {\n\t exp: branch0.if,\n\t block: branch0\n\t });\n\t // 2. add radio else-if condition\n\t var branch1 = cloneASTElement(el);\n\t getAndRemoveAttr(branch1, 'v-for', true);\n\t addRawAttr(branch1, 'type', 'radio');\n\t processElement(branch1, options);\n\t addIfCondition(branch0, {\n\t exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n\t block: branch1\n\t });\n\t // 3. other\n\t var branch2 = cloneASTElement(el);\n\t getAndRemoveAttr(branch2, 'v-for', true);\n\t addRawAttr(branch2, ':type', typeBinding);\n\t processElement(branch2, options);\n\t addIfCondition(branch0, {\n\t exp: ifCondition,\n\t block: branch2\n\t });\n\n\t if (hasElse) {\n\t branch0.else = true;\n\t } else if (elseIfCondition) {\n\t branch0.elseif = elseIfCondition;\n\t }\n\n\t return branch0\n\t }\n\t }\n\t}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b7372d282cda2fedc9816d1cdae3855d", "score": "0.49694893", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "0500f5ea2e4502452fe288d84371b99d", "score": "0.4959585", "text": "function preTransformNode(el,options){if(el.tag === 'input'){var map=el.attrsMap;if(map['v-model'] && (map['v-bind:type'] || map[':type'])){var typeBinding=getBindingAttr(el,'type');var ifCondition=getAndRemoveAttr(el,'v-if',true);var ifConditionExtra=ifCondition?\"&&(\" + ifCondition + \")\":\"\";var hasElse=getAndRemoveAttr(el,'v-else',true) != null;var elseIfCondition=getAndRemoveAttr(el,'v-else-if',true); // 1. checkbox\n\tvar branch0=cloneASTElement(el); // process for on the main node\n\tprocessFor(branch0);addRawAttr(branch0,'type','checkbox');processElement(branch0,options);branch0.processed = true; // prevent it from double-processed\n\tbranch0['if'] = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;addIfCondition(branch0,{exp:branch0['if'],block:branch0}); // 2. add radio else-if condition\n\tvar branch1=cloneASTElement(el);getAndRemoveAttr(branch1,'v-for',true);addRawAttr(branch1,'type','radio');processElement(branch1,options);addIfCondition(branch0,{exp:\"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,block:branch1}); // 3. other\n\tvar branch2=cloneASTElement(el);getAndRemoveAttr(branch2,'v-for',true);addRawAttr(branch2,':type',typeBinding);processElement(branch2,options);addIfCondition(branch0,{exp:ifCondition,block:branch2});if(hasElse){branch0['else'] = true;}else if(elseIfCondition){branch0.elseif = elseIfCondition;}return branch0;}}}", "title": "" }, { "docid": "653c8942dd77621b576bbba50d05f760", "score": "0.49594", "text": "function preTransformNode(el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return;\n }\n var typeBinding = void 0;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\".concat(map['v-bind'], \").type\");\n }\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? \"&&(\".concat(ifCondition, \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\".concat(typeBinding, \")==='checkbox'\") + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\".concat(typeBinding, \")==='radio'\") + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n if (hasElse) {\n branch0.else = true;\n }\n else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n return branch0;\n }\n }\n}", "title": "" }, { "docid": "f79b49e0672dff9595f862eb457bde0b", "score": "0.49325508", "text": "function preTransformNode (el, options) {\nif (el.tag === 'input') {\nvar map = el.attrsMap;\nif (!map['v-model']) {\nreturn\n}\nvar typeBinding;\nif (map[':type'] || map['v-bind:type']) {\ntypeBinding = getBindingAttr(el, 'type');\n}\nif (!map.type && !typeBinding && map['v-bind']) {\ntypeBinding = \"(\" + (map['v-bind']) + \").type\";\n}\nif (typeBinding) {\nvar ifCondition = getAndRemoveAttr(el, 'v-if', true);\nvar ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\nvar hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\nvar elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n// 1. checkbox\nvar branch0 = cloneASTElement(el);\n// process for on the main node\nprocessFor(branch0);\naddRawAttr(branch0, 'type', 'checkbox');\nprocessElement(branch0, options);\nbranch0.processed = true; // prevent it from double-processed\nbranch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\naddIfCondition(branch0, {\nexp: branch0.if,\nblock: branch0\n});\n// 2. add radio else-if condition\nvar branch1 = cloneASTElement(el);\ngetAndRemoveAttr(branch1, 'v-for', true);\naddRawAttr(branch1, 'type', 'radio');\nprocessElement(branch1, options);\naddIfCondition(branch0, {\nexp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\nblock: branch1\n});\n// 3. other\nvar branch2 = cloneASTElement(el);\ngetAndRemoveAttr(branch2, 'v-for', true);\naddRawAttr(branch2, ':type', typeBinding);\nprocessElement(branch2, options);\naddIfCondition(branch0, {\nexp: ifCondition,\nblock: branch2\n});\nif (hasElse) {\nbranch0.else = true;\n} else if (elseIfCondition) {\nbranch0.elseif = elseIfCondition;\n}\nreturn branch0\n}\n}\n}", "title": "" }, { "docid": "2f1e8198d2772d3d1957cc4afe395e3d", "score": "0.48991334", "text": "function preTransformNode(el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n }", "title": "" }, { "docid": "f960b8426cc3712b4b89ee65ac2f1ab1", "score": "0.48884863", "text": "function preTransformNode(el, options) {\n if (el.tag === \"input\") {\n var map = el.attrsMap;\n if (!map[\"v-model\"]) {\n return;\n }\n\n var typeBinding;\n if (map[\":type\"] || map[\"v-bind:type\"]) {\n typeBinding = getBindingAttr(el, \"type\");\n }\n if (!map.type && !typeBinding && map[\"v-bind\"]) {\n typeBinding = \"(\" + map[\"v-bind\"] + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(\n el,\n \"v-if\",\n true\n );\n var ifConditionExtra = ifCondition\n ? \"&&(\" + ifCondition + \")\"\n : \"\";\n var hasElse =\n getAndRemoveAttr(el, \"v-else\", true) != null;\n var elseIfCondition = getAndRemoveAttr(\n el,\n \"v-else-if\",\n true\n );\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, \"type\", \"checkbox\");\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if =\n \"(\" +\n typeBinding +\n \")==='checkbox'\" +\n ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, \"v-for\", true);\n addRawAttr(branch1, \"type\", \"radio\");\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp:\n \"(\" +\n typeBinding +\n \")==='radio'\" +\n ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, \"v-for\", true);\n addRawAttr(branch2, \":type\", typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0;\n }\n }\n }", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "b0e107b9df3a57f12a15753a38640a29", "score": "0.48811725", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + (map['v-bind']) + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0\n }\n }\n}", "title": "" }, { "docid": "006a0555f1924ae9fc1f39655700f504", "score": "0.48632815", "text": "constructor(element, definition) {\n super(element);\n this.boundObservables = null;\n this.behaviors = null;\n /**\n * The view associated with the custom element.\n * @remarks\n * If `null` then the element is managing its own rendering.\n */\n\n this.view = null;\n /**\n * Indicates whether or not the custom element has been\n * connected to the document.\n */\n\n this.isConnected = false;\n this.element = element;\n this.definition = definition;\n const template = definition.template;\n const styles = definition.styles;\n const shadowRoot = definition.shadowOptions === void 0 ? void 0 : element.attachShadow(definition.shadowOptions);\n\n if (template !== void 0) {\n const view = this.view = template.create(this.element);\n\n if (shadowRoot === void 0) {\n view.appendTo(element);\n } else {\n view.appendTo(shadowRoot);\n }\n }\n\n if (styles !== void 0) {\n this.addStyles(styles, shadowRoot);\n } // Capture any observable values that were set by the binding engine before\n // the browser upgraded the element. Then delete the property since it will\n // shadow the getter/setter that is required to make the observable operate.\n // Later, in the connect callback, we'll re-apply the values.\n\n\n const accessors = Observable.getAccessors(element);\n\n if (accessors.length > 0) {\n const boundObservables = this.boundObservables = Object.create(null);\n\n for (let i = 0, ii = accessors.length; i < ii; ++i) {\n const propertyName = accessors[i].name;\n const value = element[propertyName];\n\n if (value !== void 0) {\n delete element[propertyName];\n boundObservables[propertyName] = value;\n }\n }\n }\n }", "title": "" }, { "docid": "a4884227d6673655c9d89cc88a11200d", "score": "0.4852594", "text": "function preTransformNode(el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return;\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + map['v-bind'] + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? \"&&(\" + ifCondition + \")\" : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0;\n }\n }\n}", "title": "" }, { "docid": "a4884227d6673655c9d89cc88a11200d", "score": "0.4852594", "text": "function preTransformNode(el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (!map['v-model']) {\n return;\n }\n\n var typeBinding;\n if (map[':type'] || map['v-bind:type']) {\n typeBinding = getBindingAttr(el, 'type');\n }\n if (!map.type && !typeBinding && map['v-bind']) {\n typeBinding = \"(\" + map['v-bind'] + \").type\";\n }\n\n if (typeBinding) {\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? \"&&(\" + ifCondition + \")\" : \"\";\n var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;\n var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n\n if (hasElse) {\n branch0.else = true;\n } else if (elseIfCondition) {\n branch0.elseif = elseIfCondition;\n }\n\n return branch0;\n }\n }\n}", "title": "" }, { "docid": "52784e60092eb826fc7790b65bd9bfa6", "score": "0.4839769", "text": "function DOMImplementation() {}", "title": "" }, { "docid": "52784e60092eb826fc7790b65bd9bfa6", "score": "0.4839769", "text": "function DOMImplementation() {}", "title": "" }, { "docid": "9441dd52ce9b1299b4faff14b8f9feb7", "score": "0.4829575", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n return branch0\n }\n }\n}", "title": "" }, { "docid": "9441dd52ce9b1299b4faff14b8f9feb7", "score": "0.4829575", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n return branch0\n }\n }\n}", "title": "" }, { "docid": "9441dd52ce9b1299b4faff14b8f9feb7", "score": "0.4829575", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n return branch0\n }\n }\n}", "title": "" }, { "docid": "9441dd52ce9b1299b4faff14b8f9feb7", "score": "0.4829575", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n return branch0\n }\n }\n}", "title": "" }, { "docid": "9441dd52ce9b1299b4faff14b8f9feb7", "score": "0.4829575", "text": "function preTransformNode (el, options) {\n if (el.tag === 'input') {\n var map = el.attrsMap;\n if (map['v-model'] && (map['v-bind:type'] || map[':type'])) {\n var typeBinding = getBindingAttr(el, 'type');\n var ifCondition = getAndRemoveAttr(el, 'v-if', true);\n var ifConditionExtra = ifCondition ? (\"&&(\" + ifCondition + \")\") : \"\";\n // 1. checkbox\n var branch0 = cloneASTElement(el);\n // process for on the main node\n processFor(branch0);\n addRawAttr(branch0, 'type', 'checkbox');\n processElement(branch0, options);\n branch0.processed = true; // prevent it from double-processed\n branch0.if = \"(\" + typeBinding + \")==='checkbox'\" + ifConditionExtra;\n addIfCondition(branch0, {\n exp: branch0.if,\n block: branch0\n });\n // 2. add radio else-if condition\n var branch1 = cloneASTElement(el);\n getAndRemoveAttr(branch1, 'v-for', true);\n addRawAttr(branch1, 'type', 'radio');\n processElement(branch1, options);\n addIfCondition(branch0, {\n exp: \"(\" + typeBinding + \")==='radio'\" + ifConditionExtra,\n block: branch1\n });\n // 3. other\n var branch2 = cloneASTElement(el);\n getAndRemoveAttr(branch2, 'v-for', true);\n addRawAttr(branch2, ':type', typeBinding);\n processElement(branch2, options);\n addIfCondition(branch0, {\n exp: ifCondition,\n block: branch2\n });\n return branch0\n }\n }\n}", "title": "" }, { "docid": "eef4d15e926a566412d8233702f482ba", "score": "0.4829014", "text": "function RenderableDOMElement() {}", "title": "" }, { "docid": "f94db79b591617b5694585ac3acbc262", "score": "0.48200947", "text": "function hasValueBinding(el) {\n return '_value' in el;\n}", "title": "" }, { "docid": "1b7c35abbb1e1cc1880771fdc92448cc", "score": "0.48139957", "text": "constructor(element, definition) {\n super(element);\n this.boundObservables = null;\n this.behaviors = null;\n this.needsInitialization = true;\n this._template = null;\n this._styles = null;\n this._isConnected = false;\n /**\n * The view associated with the custom element.\n * @remarks\n * If `null` then the element is managing its own rendering.\n */\n\n this.view = null;\n this.element = element;\n this.definition = definition;\n const shadowOptions = definition.shadowOptions;\n\n if (shadowOptions !== void 0) {\n const shadowRoot = element.attachShadow(shadowOptions);\n\n if (shadowOptions.mode === \"closed\") {\n shadowRoots.set(element, shadowRoot);\n }\n } // Capture any observable values that were set by the binding engine before\n // the browser upgraded the element. Then delete the property since it will\n // shadow the getter/setter that is required to make the observable operate.\n // Later, in the connect callback, we'll re-apply the values.\n\n\n const accessors = Observable.getAccessors(element);\n\n if (accessors.length > 0) {\n const boundObservables = this.boundObservables = Object.create(null);\n\n for (let i = 0, ii = accessors.length; i < ii; ++i) {\n const propertyName = accessors[i].name;\n const value = element[propertyName];\n\n if (value !== void 0) {\n delete element[propertyName];\n boundObservables[propertyName] = value;\n }\n }\n }\n }", "title": "" }, { "docid": "7fa49261b81a85149c0230d4bfc726f5", "score": "0.48117083", "text": "function Conditional(vars, cb) {\n _classCallCheck(this, Conditional);\n\n _defineProperty(this, \"_parentElement\", void 0);\n\n _defineProperty(this, \"_childrenElements\", new Set());\n\n _defineProperty(this, \"$parent\", void 0);\n\n _defineProperty(this, \"$children\", new Set());\n\n _defineProperty(this, \"_anchor\", void 0);\n\n _defineProperty(this, \"_conditional\", void 0);\n\n _defineProperty(this, \"_activeElements\", new Set());\n\n _defineProperty(this, \"_vars\", []);\n\n _defineProperty(this, \"_reactiveVars\", []);\n\n _defineProperty(this, \"_updateListeners\", []);\n\n //Create anchor point\n this._anchor = document.createTextNode('');\n this._conditional = cb;\n this._reactiveVars = vars;\n }", "title": "" }, { "docid": "7b7038126163c36b942ce3b275ecd03b", "score": "0.4810496", "text": "function bind(el, mdef, item, index, insert) {\n\t // create svg element, bind item data for D3 compatibility\n\t var node = DOM.child(el, index, mdef.tag, ns, null, insert);\n\t node.__data__ = item;\n\t node.__values__ = {fill: 'default'};\n\t\n\t // create background rect\n\t if (mdef.tag === 'g') {\n\t var bg = DOM.child(node, 0, 'rect', ns, 'background');\n\t bg.__data__ = item;\n\t }\n\t\n\t // add pointer from scenegraph item to svg element\n\t return (item._svg = node);\n\t}", "title": "" }, { "docid": "090d344b132f4278c0e04ee6d586a2ef", "score": "0.47960365", "text": "function bind(item, el, sibling, tag, svg) {\n let node = item._svg,\n doc; // create a new dom node if needed\n\n if (!node) {\n doc = el.ownerDocument;\n node = domCreate(doc, tag, ns);\n item._svg = node;\n\n if (item.mark) {\n node.__data__ = item;\n node.__values__ = {\n fill: 'default'\n }; // if group, create background, content, and foreground elements\n\n if (tag === 'g') {\n const bg = domCreate(doc, 'path', ns);\n node.appendChild(bg);\n bg.__data__ = item;\n const cg = domCreate(doc, 'g', ns);\n node.appendChild(cg);\n cg.__data__ = item;\n const fg = domCreate(doc, 'path', ns);\n node.appendChild(fg);\n fg.__data__ = item;\n fg.__values__ = {\n fill: 'default'\n };\n }\n }\n } // (re-)insert if (a) not contained in SVG or (b) sibling order has changed\n\n\n if (node.ownerSVGElement !== svg || siblingCheck(node, sibling)) {\n el.insertBefore(node, sibling ? sibling.nextSibling : el.firstChild);\n }\n\n return node;\n } // check if two nodes are ordered siblings", "title": "" }, { "docid": "285bde9b640a4f9b390fc03ea609990e", "score": "0.478418", "text": "function bind(el, mdef, item, index, insert) {\n // create svg element, bind item data for D3 compatibility\n var node = DOM.child(el, index, mdef.tag, ns, null, insert);\n node.__data__ = item;\n node.__values__ = {fill: 'default'};\n\n // create background rect\n if (mdef.tag === 'g') {\n var bg = DOM.child(node, 0, 'rect', ns, 'background');\n bg.__data__ = item;\n }\n\n // add pointer from scenegraph item to svg element\n return (item._svg = node);\n}", "title": "" }, { "docid": "285bde9b640a4f9b390fc03ea609990e", "score": "0.478418", "text": "function bind(el, mdef, item, index, insert) {\n // create svg element, bind item data for D3 compatibility\n var node = DOM.child(el, index, mdef.tag, ns, null, insert);\n node.__data__ = item;\n node.__values__ = {fill: 'default'};\n\n // create background rect\n if (mdef.tag === 'g') {\n var bg = DOM.child(node, 0, 'rect', ns, 'background');\n bg.__data__ = item;\n }\n\n // add pointer from scenegraph item to svg element\n return (item._svg = node);\n}", "title": "" }, { "docid": "788a3763d130a13dc876e2d1b2702298", "score": "0.47839847", "text": "function SpecialElHandlers() {}", "title": "" }, { "docid": "fd5caf46ff2a49e18f940d3d2a632bcb", "score": "0.47788283", "text": "function local_SIMPL__DOM__()\n{\n}", "title": "" }, { "docid": "b7778f05fc81db6d34f93cda797a9460", "score": "0.4752666", "text": "function isBareVirtualElement(value) {\n return {}.toString.call(value) === '[object Object]' && !value.addEventListener;\n}", "title": "" }, { "docid": "cac775a2a7cfe6a7ed57d51e8e9e07a3", "score": "0.4746824", "text": "function createNode(node, parentNode, parentDom, values, index, insertAtIndex, listeners, component) {\n var i = 0,\n l = 0,\n ii = 0,\n subNode = null,\n val = null,\n textNode = null,\n hasDynamicAttrs = false,\n wasChildDynamic = false,\n rootListeners = null,\n endValue = null;\n\n //we need to get the actual values and the templatekey\n if (index != null) {\n endValue = values[index][values[index].length - 1];\n if (endValue.templateKey) {\n node.templateKey = endValue.templateKey;\n }\n values = values[index];\n } else {\n endValue = values[values.length - 1];\n if (endValue.templateKey) {\n node.templateKey = endValue.templateKey;\n }\n }\n\n if (node.component) {\n //if its a component, we make a new instance\n if (typeof node.component === \"function\") {\n node.component = new node.component(node.props);\n rootListeners = addRootDomEventListerners(parentDom);\n node.component.forceUpdate = Inferno.render.bind(null, node.component.render.bind(node.component), parentDom, rootListeners, node.component);\n node.component.forceUpdate();\n node.isDynamic = true;\n }\n //if this is a component\n if (node.component instanceof Component) {\n node.component.forceUpdate();\n }\n return true;\n }\n\n if (node.tag != null) {\n if (cachedNodes !== null && cachedNodes[node.tag]) {\n node.dom = cachedNodes[node.tag].cloneNode(false);\n } else {\n node.dom = document.createElement(node.tag);\n }\n if (!insertAtIndex) {\n parentDom.appendChild(node.dom);\n } else {\n parentDom.insertBefore(node.dom, parentDom.childNodes[insertAtIndex]);\n }\n }\n\n if (node.attrs != null) {\n for (i = 0; i < node.attrs.length; i = i + 1 | 0) {\n //check if the name matches an event type\n if (events[node.attrs[i].name] != null) {\n node.attrs[i].value.lastValue = values[node.attrs[i].value.valueKey];\n listeners[events[node.attrs[i].name]].push({\n target: node.dom,\n callback: node.attrs[i].value.value,\n component: component\n });\n node.hasDynamicAttrs = true;\n node.isDynamic = true;\n } else {\n //check if this is a dynamic attribute\n if (node.attrs[i].value instanceof ValueNode) {\n node.hasDynamicAttrs = true;\n node.isDynamic = true;\n //assign the last value\n node.attrs[i].value.lastValue = values[node.attrs[i].value.valueKey];\n handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, node.attrs[i].value.value);\n } else {\n handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, node.attrs[i].value);\n }\n }\n }\n }\n\n if (node.children != null) {\n if (node.children instanceof Array) {\n for (i = 0; i < node.children.length; i = i + 1 | 0) {\n if (typeof node.children[i] === \"string\" || typeof node.children[i] === \"number\" || typeof node.children[i] === \"undefined\") {\n textNode = document.createTextNode(node.children[i]);\n node.dom.appendChild(textNode);\n } else if (node.children[i] instanceof ValueNode) {\n node.children[i].lastValue = values[node.children[i].valueKey];\n if (node.children[i].lastValue != null && node.children[i].lastValue.templateKey != null) {\n node.children[i].templateKey = node.children[i].lastValue.templateKey;\n node.children[i].lastValue = node.children[i].lastValue.values;\n }\n node.isDynamic = true;\n node.children[i].isDynamic = true;\n //check if we're dealing with a root node\n if (node.children[i].isRoot === true) {\n node.children[i].isDynamic = true;\n if (node.children[i].value instanceof Array) {\n if (node.children[i].templateKey != null) {\n for (ii = 0; ii < node.children[i].value.length; ii = ii + 1 | 0) {\n createNode(node.children[i].value[ii], node.children[i], node.dom, values[node.children[i].valueKey].values, ii, null, listeners, component);\n }\n } else {\n for (ii = 0; ii < node.children[i].value.length; ii = ii + 1 | 0) {\n createNode(node.children[i].value[ii], node.children[i], node.dom, values[node.children[i].valueKey], ii, null, listeners, component);\n }\n }\n } else {\n createNode(node.children[i].value, node.children[i], node.dom, values[node.children[i].valueKey], null, null, listeners, component);\n }\n } else if (node.children[i] instanceof ValueNode) {\n node.children[i].lastValue = values[node.children[i].valueKey];\n textNode = document.createTextNode(node.children[i].lastValue);\n node.dom.appendChild(textNode);\n } else {\n textNode = document.createTextNode(node.children[i].value);\n node.dom.appendChild(textNode);\n }\n } else {\n wasChildDynamic = createNode(node.children[i], node, node.dom, values, null, null, listeners, component);\n if (wasChildDynamic === true) {\n node.children[i].isDynamic = true;\n node.isDynamic = true;\n }\n }\n }\n } else if (typeof node.children === \"string\") {\n textNode = document.createTextNode(node.children);\n node.dom.appendChild(textNode);\n } else if (node.children instanceof ValueNode && node.children.isRoot === true) {\n //we are on a new root node, so we'll need to go through its children and apply the values\n //based off the valueKey index\n if (node.children.value instanceof Array) {\n for (i = 0; i < node.children.value.length; i = i + 1 | 0) {\n createNode(node.children.value[i], node, node.dom, values[node.children.valueKey], i, null, listeners, component);\n }\n } else {\n createNode(node.children.value, node, node.dom, values[node.children.valueKey], null, null, listeners, component);\n }\n node.children.isDynamic = true;\n node.children.lastValue = values[node.children.valueKey];\n return true;\n } else if (node.children instanceof ValueNode) {\n //if it has a valueKey then it means that its dynamic\n node.children.lastValue = values[node.children.valueKey];\n if (typeof node.children.lastValue === \"string\" || typeof node.children.lastValue === \"number\") {\n textNode = document.createTextNode(node.children.lastValue);\n node.dom.appendChild(textNode);\n }\n node.isDynamic = true;\n }\n }\n\n if (!node.isDynamic) {\n return false;\n }\n return true;\n}", "title": "" } ]
e85397d03d9485e8977f6da5caa09586
fname = document.getElementById("f_name").value; lname = document.getElementById("L_name").value; age = document.getElementById("age").value; email = document.getElementById("email").value; tel_no = document.getElementById("tel").value; courses = document.getElementById("courses").value; year = document.getElementById("A_period").value; document.getElementById("dislpayVal1").innerHTML = fname; document.getElementById("dislpayVal2").innerHTML = lname; document.getElementById("dislpayyear").innerHTML = year; document.getElementById("dislpayCourses").innerHTML = courses;
[ { "docid": "8b3352028605d3212d4a1bd8ac222de5", "score": "0.8431858", "text": "function DispalyValue(){\n\n\tlet fname, lname, year;\n\t\t\t\t\t\t\n\t\tfname = document.getElementById(\"f_name\").value;\n\t\tlname = document.getElementById(\"L_name\").value;\n\t\tear = document.getElementById(\"A_period\").value;\n\t\t\t\t\t\t\n\t\tdocument.getElementById(\"val1\").innerHTML = \"Welcome \"+fname +\" \" + lname;\n\t\t//document.getElementById(\"val2\").innerHTML = lname;\n\n\t\t//document.getElementById(\"dislpayyear\").innerHTML = \"You are in \"+year;\n\t\t//document.getElementById(\"dislpayCourses\").innerHTML = courses;\n\t\t\t\n\t\t\t\n}", "title": "" } ]
[ { "docid": "446b859631d2d676c00d56044c9ebb85", "score": "0.6665313", "text": "function annulla() {\n document.getElementById(\"km\").value = \"\"\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"age\").value = \"\";\n document.getElementById(\"offerta\").innerHTML = \"\";\n document.getElementById(\"pass_name\").innerHTML = \"\";\n document.getElementById(\"carrozza\").innerHTML = \"\";\n document.getElementById(\"code_cp\").innerHTML = \"\"\n document.getElementById(\"price\").innerHTML = \"\"\n}", "title": "" }, { "docid": "eed1650425626f67819081650879f31d", "score": "0.65921265", "text": "function getInfo() {\r\n var data = document.getElementById(\"legal_name\").value + \"!@#\" + document.getElementById(\"tax_id\").value + \"!@#\" + document.getElementById(\"bus_desc\").value + \"!@#\" + document.getElementById(\"bus_type\").value + \"!@#\" +\r\n\t\tdocument.getElementById(\"fir_sign\").value + \"!@#\" +\r\n\t document.getElementById(\"sec_sign\").value + \"!@#\" + \r\n\t\tdocument.getElementById(\"thi_sign\").value + \"!@#\" + document.getElementById(\"tot_annu_rev\").value + \"!@#\" + document.getElementById(\"as_of_dat\").value + \"!@#\";\r\n if (document.getElementById(\"gender_m\").checked)\r\n data = data + \"Public\";\r\n else\r\n data = data + \"Private\";\r\n data = data + \"!@#\" + document.getElementById(\"address\").value + \"!@#\" + document.getElementById(\"phone_1\").value + \"!@#\" + document.getElementById(\"phone_2\").value + \"!@#\" + document.getElementById(\"email\").value + \"!@#\" + document.getElementById(\"country_res\").value + \"!@#\";\r\n\r\n return data;\r\n}", "title": "" }, { "docid": "66d35777f8f8d27e124cc62edf4682a5", "score": "0.6520815", "text": "function ShowInfo() {\n let getName = document.getElementById('name').value;\n let getCMND = document.getElementById('cmnd').value;\n let getBirthday = document.getElementById('birthday').value;\n let getEmail = document.getElementById('email').value;\n let getAddress = document.getElementById('address').value;\n let getCustomer = document.getElementById('customer').value;\n let getSale = document.getElementById('sale').value;\n let getAmount = document.getElementById('amount').value;\n let getStaytime = document.getElementById('staytime').value;\n let getService = document.getElementById('service').value;\n let getKindofroom = document.getElementById('kindofroom').value;\n\n\n\n\n console.log(getName);\n // alert('Name' + getName);\n alert('CMND' + getCMND);\n alert('birthday' + getBirthday);\n alert('Email' + getEmail);\n alert('Address' + getAddress);\n alert('Customer' + getCustomer);\n alert('sale' + getSale);\n alert('Amount' + getAmount);\n alert('Staytime'+ getStaytime);\n alert('Service' + getService);\n alert('Kindofroom' + getKindofroom);\n\n\n\n}", "title": "" }, { "docid": "bfa6297a62fbfd7e813832de16f813e1", "score": "0.6449764", "text": "function displayBC() { \n var employee = {};\n employee.fname = document.getElementById(\"fName\").value;\n employee.lname = document.getElementById(\"lName\").value;\n employee.phNo = document.getElementById(\"phNo\").value;\n employee.email = document.getElementById(\"email\").value;\n employee.desig = document.getElementById(\"desig\").value;\n employee.phone = document.getElementById(\"phNo\").value;\n employee.company = document.getElementById(\"company\").value;\n \n var cardHTML=\"<div class='card'> <div class='container'> <p><h4><b><label>\" + employee.fname + \"</label><label>&nbsp;\"+employee.lname+\"</label></b></h4>\"+employee.desig+\"</p><p> \"+employee.company+\"</br> Email:\"+employee.email+\"</br> Ph: \"+employee.phNo+\"</p> </div> </div>\"\n document.getElementById(\"demo\").innerHTML = cardHTML; \n hideControlsForBC();\n}", "title": "" }, { "docid": "66b6169acd445bfd415f1fa9345c45eb", "score": "0.644515", "text": "function takevalue()\n {\n var fname=document.getElementById(\"fname\").value;\n var lname=document.getElementById(\"lname\").value;\n var email=document.getElementById(\"email\").value;\n document.write(\"Your Info is succesfully Recevied : <BR><BR>\"+\"Name : \"+fname+\" \"+lname+\"<br>\");\n \n document.write(\" Email : \"+email+\"<br>\");\n }", "title": "" }, { "docid": "99241b01bb31d3a0b9b6f8cb2879acf3", "score": "0.64207363", "text": "function createBusiness() {\n var u = document.getElementById(\"inBusinessID\").value;\n document.getElementById(\"businessID\").innerHTML = u;\n var v = document.getElementById(\"inName\").value;\n document.getElementById(\"name\").innerHTML = v;\n var w = document.getElementById(\"inService\").value;\n document.getElementById(\"service\").innerHTML = w;\n var x = document.getElementById(\"inPrice\").value;\n document.getElementById(\"price\").innerHTML = x;\n var y = document.getElementById(\"inRating\").value;\n document.getElementById(\"rating\").innerHTML = y;\n var z = document.getElementById(\"inURL\").value;\n document.getElementById(\"url\").innerHTML = z;\n}", "title": "" }, { "docid": "e29f5aad9593f9dfbc97ac51e3a20229", "score": "0.64132535", "text": "function showDet(){\r\n var name = document.getElementById('name').value;\r\n var email = document.getElementById('email').value;\r\n var address = document.getElementById('address').value;\r\n\r\n document.write('<br>Name: ', name)\r\n document.write('<br>Email: ', email)\r\n document.write('<br>Address: ', address)\r\n\r\n}", "title": "" }, { "docid": "67819d3e13425802caa39bf9c151e081", "score": "0.6394876", "text": "function netejarConsultaFactures(){\n document.getElementById(\"subjecteId\").value = \"\"; \n document.getElementById(\"nomCercador\").value = \"\"; \n document.getElementById(\"tipusFactura\").value = \"\";\n document.getElementById(\"facDataInici\").value = \"\";\n document.getElementById(\"facDataFi\").value = \"\";\n}", "title": "" }, { "docid": "53d680c100dc1e7fbdb682c17f0f2f87", "score": "0.63902247", "text": "function lambuthFill()\n{\ndocument.getElementById(\"Address\").value=\"Lambuth University Library\";\ndocument.getElementById(\"Address2\").value=\"705 Lambuth Blvd\";\ndocument.getElementById(\"City\").value=\"Jackson\";\ndocument.getElementById(\"State\").value=\"TN\";\ndocument.getElementById(\"Zip\").value=\"38301\";\n}", "title": "" }, { "docid": "9986e9f260a99fd9bc948a9a2d6f3bf5", "score": "0.6370863", "text": "function confiramBookBtn(){\n \n const formCity= document.getElementById(\"formCityId\").value;\n document.getElementById(\"showFormCityID\").innerText=formCity;\n\n const date= document.getElementById(\"toCityId\").value;\n document.getElementById(\"showToCity\").innerText=date;\n\n\n const issueDate=document.getElementById(\"issueDateID\").value;\n const newIssueDate=parseInt(issueDate.value);\n document.getElementById(\"showIssueDateID\").value=newIssueDate;\n\n const returnDate=document.getElementById(\"returnDateID\").value;\n const newReturnDate=parseInt(returnDate.value);\n document.getElementById(\"showReturnDateID\").value=newReturnDate;\n\n\n\n\n}", "title": "" }, { "docid": "af005dd4729025df6f010db25319f079", "score": "0.63376486", "text": "function netejarConsultaTrameses(){\n document.getElementById(\"traTitol\").value = \"\";\n document.getElementById(\"subjecteId\").value = \"\"; \n document.getElementById(\"nomCercador\").value = \"\"; \n document.getElementById(\"traDataInici\").value = \"\";\n document.getElementById(\"traDataFi\").value = \"\";\n}", "title": "" }, { "docid": "709778e4dc5e3fdae49a15f6ef9bdda7", "score": "0.6301019", "text": "function payoutinfoinit(){\n\t\t\tdocument.getElementById('paypalemail').value=myinfo.paypalemail;\t\t\t\n\t\t\tdocument.getElementById(\"temp\").style.display=\"block\";\t \n\t\t\t}", "title": "" }, { "docid": "817d067bfb69605107435b3aa07de7ce", "score": "0.6300105", "text": "function fillDetailsToForm(jobOffer){\n document.getElementById('jobTitle').value = jobOffer.jobtitle;\n document.getElementById('jobType').value = jobOffer.jobtype;\n document.getElementById('description').value = jobOffer.description;\n document.getElementById('skills').value = jobOffer.skills;\n document.getElementById('minYears').value = jobOffer.minyears;\n document.getElementById('maxYears').value = jobOffer.maxyears;\n document.getElementById('minSalary').value = jobOffer.minsalary;\n document.getElementById('maxSalary').value = jobOffer.maxsalary;\n document.getElementById('location').value = jobOffer.location;\n document.getElementById('noOfVacancy').value = jobOffer.vacancy;\n document.getElementById('qualification').value = jobOffer.qualification;\n document.getElementById('endDate').value = jobOffer.end_date;\n setMinDate();\n}", "title": "" }, { "docid": "3e354ee2f6bf9e889fbd9423dceb4bee", "score": "0.6291426", "text": "function showData() {\n var name = document.getElementById('name').value;\n var age = document.getElementById('age').value;\n var data = \"My Name is \" + name + \" My Age is \" + age;\n document.getElementById('show').innerHTML = data;\n}", "title": "" }, { "docid": "50ba5f25db28d943ba149818dc0aae36", "score": "0.62776744", "text": "function putValues(x,y,z){\n document.getElementById(\"buDget-Amt\").innerHTML = x;\n document.getElementById(\"exPense-Amt\").innerHTML = y;\n document.getElementById(\"baLance-Amt\").innerHTML = z;\n}", "title": "" }, { "docid": "d70052a7518f9d4cc8031b27f2a76eea", "score": "0.62363386", "text": "function fillValues() {\n const superTest = medications[pos];\n console.log(superTest);\n document.getElementById(\"medication\").value = medications[pos].medName;\n document.getElementById(\"dosage\").value = medications[pos].dosage;\n document.getElementById(\"startDate\").value = medications[pos].startDate;\n document.getElementById(\"endDate\").value = medications[pos].endDate;\n document.getElementById(\"docName\").value = medications[pos].docName;\n document.getElementById(\"docSpecialty\").value = medications[pos].docSpecialty;\n document.getElementById(\"docAddress1\").value = medications[pos].docAddress1;\n document.getElementById(\"docAddress2\").value = medications[pos].docAddress2;\n document.getElementById(\"docCity\").value = medications[pos].docCity;\n document.getElementById(\"docState\").value = medications[pos].docState;\n document.getElementById(\"docZip\").value = medications[pos].docZip;\n document.getElementById(\"docPhone\").value = medications[pos].docPhone;\n document.getElementById(\"medUsage\").value = medications[pos].medUsage;\n}", "title": "" }, { "docid": "da1a84376dda14a03c7733279918450d", "score": "0.62324166", "text": "function getBasicInfo(){\n gender = document.getElementById(\"info\")[0].value;\n time = document.getElementById(\"info\")[1].value;\n daysAWeek = document.getElementById(\"info\")[2].value;\n weight = document.getElementById(\"info\")[3].value;\n height = document.getElementById(\"info\")[4].value;\n age = document.getElementById(\"info\")[5].value;\n goal = document.getElementById(\"info\")[7].value;\n experience = document.getElementById(\"info\")[6].value;\n name = document.getElementById(\"info\")[8].value;\n }", "title": "" }, { "docid": "af12bc6fd84094bfc766e9cba345bb39", "score": "0.62280965", "text": "function writeDataBack(){\r\n\t document.getElementById(\"userName_text\").value = userName.value;\r\n\t document.getElementById(\"password_text\").value = password2;\r\n\t document.getElementById(\"name_text\").value = name1;\r\n\t document.getElementById(\"lastname_text\").value = name2;\r\n\t document.getElementById(\"email_text\").value = email1;\r\n\t document.getElementById(\"day_text\").value = date;\r\n\t document.getElementById(\"month_text\").value = month;\r\n\t document.getElementById(\"year_text\").value = year;\r\n\t document.getElementById(\"select_gender\").value = gender;\r\n\t document.getElementById(\"house_text\").value = houseNo;\r\n\t document.getElementById(\"addr1_text\").value = address1;\r\n\t document.getElementById(\"addr2_text\").value = address2;\r\n\t document.getElementById(\"city_text\").value = city;\r\n\t document.getElementById(\"zip_text\").value = zip;\r\n }", "title": "" }, { "docid": "89fb07a0355fe696e2632196f0cb2508", "score": "0.62004423", "text": "function initDisplayOrder() {\n document.getElementById(\"startdate\").innerHTML =\"\";\n document.getElementById(\"qty\").innerHTML = \"\";\n document.getElementById(\"machine\").innerHTML = \"\";\n document.getElementById(\"columnlocation\").innerHTML = \"\";\n document.getElementById(\"grade\").innerHTML =\"\";\n}", "title": "" }, { "docid": "9ecb34f9ffc0e3bd7b990f4169fc79e4", "score": "0.6178129", "text": "function display_values(city, date, time, sportType) {\n document.getElementById(\"city\").innerHTML = city;\n console.log(document.getElementById(\"city\"));\n document.getElementById(\"sportType\").innerHTML = sportType;\n console.log(document.getElementById(\"sportType\"));\n document.getElementById(\"date\").innerHTML = date;\n console.log(document.getElementById(\"date\"));\n document.getElementById(\"time\").innerHTML = time;\n console.log(document.getElementById(\"time\"));\n}", "title": "" }, { "docid": "05f23b99912f92f397534ef5d72915de", "score": "0.61701185", "text": "function contactinfoinit(){\n\t\t\tdocument.getElementById('email').value=myinfo.email;\n\t\t\tif(myinfo.phone!=null){\n\t\t\t\tparts = [myinfo.phone.slice(0,3),myinfo.phone.slice(3,6),myinfo.phone.slice(6,10)];\n\t\t\t\tdocument.getElementById('phone').value = parts[0]+\"-\"+parts[1]+\"-\"+parts[2];\t\n\t\t\t\t}\n\t\t\tdocument.getElementById('name').value=myinfo.fname+\" \"+myinfo.lname;\t\t\t\n\t\t\t}", "title": "" }, { "docid": "21e6553e8a44cabc83c7dd7e1c5db9ba", "score": "0.61666554", "text": "function empDetails(eid) { // fn to display emp details corresponding to emp id\n let empobj = employeeServices.empObject(eid);\n document.getElementById(\"emp-details\").style.visibility = \"visible\";\n document.getElementById(\"abc\").style.visibility = 'hidden';\n document.getElementById(\"update-name\").innerHTML = \"Hi \" + empobj.name;\n document.getElementById(\"emp-id\").value = empobj.id;\n document.getElementById(\"emp-name\").value = empobj.name;\n document.getElementById(\"emp-age\").value = empobj.age;\n document.getElementById(\"emp-state\").value = empobj.state;\n document.getElementById(\"emp-pincode\").value = empobj.pincode;\n}", "title": "" }, { "docid": "8675e7958885249354dc0b1d2b3c4399", "score": "0.61297214", "text": "function updateFieldPrince2(){\r\n\tf_prince = document.getElementById('fieldPrince').value;\r\n\tvar fieldprince2doc = document.getElementById('fieldPrince2');\r\n\tfieldprince2doc.textContent = f_prince;\r\n}", "title": "" }, { "docid": "0c093f8de25a2a5c22b8f2dcbaa80fa6", "score": "0.61130345", "text": "function addInfo(){\r\n var title = document.getElementById(\"title\").value;\r\n var article = document.getElementById(\"article\").value;\r\n var image = document.getElementById(\"image\").value;\r\n console.log(clientName)\r\n console.log(projectName);\r\n console.log(budget);\r\n document.getElementById(\"title\").innerHTML=title;\r\n document.getElementById(\"article\").innerHTML=article;\r\n document.getElementById(\"image\").innerHTML= image;\r\n}", "title": "" }, { "docid": "13be8e1ab109f7a41f7b1d59a581e2ea", "score": "0.6054819", "text": "function getUserInfo() {\r\n document.getElementById(\"name\").innerHTML = localStorage.getItem(\"name\");\r\n document.getElementById(\"capacity\").innerHTML = localStorage.getItem(\"capacity\");\r\n document.getElementById(\"price\").innerHTML = localStorage.getItem(\"price\");\r\n document.getElementById(\"time\").innerHTML = localStorage.getItem(\"time\");\r\n document.getElementById(\"date2\").innerHTML = localStorage.getItem(\"date2\");\r\n document.getElementById(\"Month\").innerHTML = localStorage.getItem(\"Month\");\r\n document.getElementById(\"Year\").innerHTML = localStorage.getItem(\"Year\");\r\n document.getElementById(\"RadioResult\").innerHTML = localStorage.getItem(\"RadioResult\");\r\n document.getElementById(\"check\").innerHTML = localStorage.getItem(\"check\");\r\n document.getElementById(\"describtion\").innerHTML = localStorage.getItem(\"describtion\");\r\n \r\n }", "title": "" }, { "docid": "f9ecae2c4e6341dfda076c749df04b1a", "score": "0.6033433", "text": "function toogleToReview() {\n\n var fname = document.getElementById('fname').value;\n var lname = document.getElementById('lname').value;\n var email = document.getElementById('email').value;\n var phone = document.getElementById('phone').value;\n var cardname = document.getElementById('cname').value;\n var cnumber = document.getElementById('cnumber').value;\n\n document.getElementById('fname-span').innerHTML = fname;\n document.getElementById('lname-span').innerHTML = lname;\n document.getElementById('email-span').innerHTML = email;\n document.getElementById('phone-span').innerHTML = phone;\n document.getElementById('cname-span').innerHTML = cardname;\n var cardnum = cnumber.split(\"\");\n var lastFour = \"\";\n for (var i =cardnum.length-1 ; i>(cardnum.length -1)-4; i--) {\n lastFour = cardnum[i] +lastFour;\n }\n\n document.getElementById('cnumber-span').innerHTML = \"***\" +lastFour;\n\n document.getElementById('purchase-form-block').style.display = 'none';\n document.getElementById('purchase-review-block').style.display = 'block';\n}", "title": "" }, { "docid": "970a97cbaaca84847d2bd043c48b18e4", "score": "0.602925", "text": "function birth(){\n\n var year = document.getElementById(\"registry-year\").value;\n var month = document.getElementById(\"registry-month\").value;\n var day = document.getElementById(\"registry-day\").value;\n\n $(\"#birth\").val(year+\"-\"+month+\"-\"+day);\n}", "title": "" }, { "docid": "7d661a3d03120a65d714fb0ac897f745", "score": "0.6027879", "text": "function getPersona(persona){\n\t\n\tdocument.getElementById(\"nombre\").value = persona.nombre;\n\tdocument.getElementById(\"apellido\").value = persona.apellido;\n\tdocument.getElementById(\"edad\").value = persona.edad;\n}", "title": "" }, { "docid": "4671ece8737fcf6fdbde0db3c6f3e0d5", "score": "0.6024667", "text": "function limpiar() {\n for (let i = 0; i < numeroAct; i++) {\n document.getElementById(\"casos\" + i).value = \" \";\n document.getElementById(\"funcion\" + i).value = \" \";\n document.getElementById(\"calidad\" + i).value = \" \";\n document.getElementById(\"disenno\" + i).value = \" \";\n }\n}", "title": "" }, { "docid": "151f14ea607a7fa738bae55b0f83dbbe", "score": "0.6003129", "text": "function submit1() {\n\tv1 = document.getElementById(\"input_1\").value;\n\tdocument.getElementById(\"p_1\").innerHTML = v1;\n\tc1 = document.getElementById(\"p_3\").innerHTML;\n\t//alert(v1);\n\t//alert(c1);\n}", "title": "" }, { "docid": "0d7d6ffa2b42595194271335f3134508", "score": "0.59853035", "text": "function setData(){\r\n document.getElementById(\"cabType\").innerText = cabDetails.cabType;\r\n document.getElementById(\"pickupField\").innerText = cabDetails.pickUpPlace;\r\n document.getElementById(\"dropField\").innerText = cabDetails.dropPlace;\r\n document.getElementById(\"journeyDate\").innerText = cabDetails.journeyDate;\r\n document.getElementById(\"journeyTime\").innerText = cabDetails.journeyTime;\r\n document.getElementById(\"kmsField\").innerText = cabDetails.noOfKms;\r\n if(cabDetails.seniorCitizen){\r\n document.getElementById(\"seniorField\").innerText = \"Yes\";\r\n }else{\r\n document.getElementById(\"seniorField\").innerText = \"No\"\r\n } \r\n document.getElementById(\"gstPrice\").innerText = cabDetails.gstPrice;\r\n // let charges = 1.25;\r\n peakHour = cabDetails.peakHour;\r\n if(peakHour == true){\r\n document.getElementById(\"peakHour\").innerText = \"Yes\" + peakHourInfo;\r\n }else{\r\n document.getElementById(\"peakHour\").innerText = \"No\";\r\n }\r\n document.getElementById(\"priceField\").innerText = cabDetails.finalPrice;\r\n}", "title": "" }, { "docid": "0681d227e7c6c662f3ab161bef663b98", "score": "0.5980216", "text": "function formSub() {\n var first = document.getElementById(\"first\");\n var last = document.getElementById(\"last\");\n var mail = document.getElementById(\"mail\");\n var dob = document.getElementById(\"dob\");\n var gen = document.getElementsByName(\"gender\");\n var fn = document.getElementById(\"fullName\");\n var eAdd = document.getElementById(\"e-Add\");\n var dBirth = document.getElementById(\"dateBirth\");\n var gd = document.getElementById(\"ge\");\n fn.innerHTML = first.value + \" \" + last.value;\n eAdd.innerHTML = mail.value;\n dBirth.innerHTML = dob.value;\n var getGender;\n for (var i = 0; i < gen.length; i++) {\n if (gen[i].checked) {\n getGender = gen[i].value;\n }\n }\n gd.innerHTML = getGender;\n var form2 = document.getElementsByClassName(\"form2\");\n form2[0].style.visibility = \"visible\";\n first.value = \"\";\n last.value = \"\";\n mail.value = \"\";\n dob.value = \"\";\n \n}", "title": "" }, { "docid": "539ac57b48d6e0379b20e954350b8fe0", "score": "0.5952377", "text": "function getFormEmployer (){\n\tlet numEmployer = document.getElementById(\"numEmployer\");\n\tlet nomEmployer = document.getElementById(\"nomEmployer\");\n\tlet adresse = document.getElementById(\"adessEmployer\");\n\tlet poste = document.getElementById(\"posteEmployer\");\n\tlet salaire = document.getElementById(\"salaireEmployer\");\n\tlet resultatAction= document.getElementById(\"resultatAction\");\n\n /* */\n\tvar getFormEmployerId= [numEmployer.id,nomEmployer.id,adresse.id,poste.id,salaire.id];\n\tvar getFormEmployer =[numEmployer.value, nomEmployer.value,adresse.value,poste.value,salaire.value];\n\tfor (let i=0; i < getFormEmployer.length ; i++) {\n\n\t\tlet affichage = document.createTextNode(getFormEmployer[i]);\n\t\tlet affichage1 = document.createTextNode(getFormEmployerId[i]);\n\t\tlet espace =document.createTextNode(\" \");\n\t\tlet p = document.createElement(\"p\");\n\t\tp.appendChild(affichage1);\n\t\talert(affichage);\n\t\tp.appendChild(espace);\n\t\tp.appendChild(affichage);\n\t\tresultatAction.appendChild(p);\n\t}\n\n}", "title": "" }, { "docid": "59a4156374cc18cb94ca075b59e4a3c0", "score": "0.59478956", "text": "function populateStaffFCC() {\r\n if (salaryLevelFCC == \"BLS\") {\r\n salaryOfProvider =\r\n parseInt($(\"#noOfProvider\").val()) *\r\n dataF[stateSelected].bls_lead_teacher_salary;\r\n\r\n $(\"#salaryOfProvider\").val(\r\n accounting\r\n .formatMoney(dataF[stateSelected].bls_lead_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n\r\n wageOfProvider = dataF[stateSelected].bls_lead_teacher_salary / 2080;\r\n $(\"#wageOfProvider\").val(accounting.formatMoney(wageOfProvider));\r\n\r\n if (parseInt($(\"#noOfAssistantTeachersFCC\").val()) != 0) {\r\n salaryOfAssistantTeachersFCC =\r\n parseInt($(\"#noOfAssistantTeachersFCC\").val()) *\r\n dataF[stateSelected].bls_assistant_teacher_salary;\r\n\r\n $(\"#salaryOfAssistantTeachersFCC\").val(\r\n accounting\r\n .formatMoney(dataF[stateSelected].bls_assistant_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n\r\n wageOfAssistantTeachersFCC =\r\n dataF[stateSelected].bls_assistant_teacher_salary / 2080;\r\n $(\"#wageOfAssistantTeachersFCC\").val(\r\n accounting.formatMoney(wageOfAssistantTeachersFCC)\r\n );\r\n }else{\r\n\r\n $(\"#salaryOfAssistantTeachersFCC\").val(\r\n accounting\r\n .formatMoney(dataF[stateSelected].bls_assistant_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n\r\n $(\"#wageOfAssistantTeachersFCC\").val(\r\n accounting.formatMoney(dataF[stateSelected].bls_assistant_teacher_salary/2080)\r\n );\r\n\r\n }\r\n\r\n wageFloaterFCC = dataC[stateSelected].bls_floater_salary / 2080;\r\n }\r\n\r\n if (salaryLevelFCC == \"Kindergarten\") {\r\n salaryOfProvider =\r\n parseInt($(\"#noOfProvider\").val()) *\r\n dataF[stateSelected].kg_lead_teacher_salary;\r\n\r\n $(\"#salaryOfProvider\").val(\r\n accounting.formatMoney(salaryOfProvider).slice(0, -3)\r\n );\r\n\r\n wageOfProvider = salaryOfProvider / 2080;\r\n $(\"#wageOfProvider\").val(accounting.formatMoney(wageOfProvider));\r\n\r\n if (parseInt($(\"#noOfAssistantTeachersFCC\").val()) != 0) {\r\n salaryOfAssistantTeachersFCC =\r\n parseInt($(\"#noOfAssistantTeachersFCC\").val()) *\r\n dataF[stateSelected].kg_assistant_teacher_salary;\r\n\r\n $(\"#salaryOfAssistantTeachersFCC\").val(\r\n accounting.formatMoney(salaryOfAssistantTeachersFCC).slice(0, -3)\r\n );\r\n\r\n wageOfAssistantTeachersFCC = salaryOfAssistantTeachersFCC / 2080;\r\n $(\"#wageOfAssistantTeachersFCC\").val(\r\n accounting.formatMoney(wageOfAssistantTeachersFCC)\r\n );\r\n }else{\r\n\r\n $(\"#salaryOfAssistantTeachersFCC\").val(\r\n accounting.formatMoney(dataF[stateSelected].kg_assistant_teacher_salary).slice(0, -3)\r\n );\r\n\r\n \r\n $(\"#wageOfAssistantTeachersFCC\").val(\r\n accounting.formatMoney(dataF[stateSelected].kg_assistant_teacher_salary/2080)\r\n );\r\n\r\n\r\n }\r\n\r\n wageFloaterFCC = dataC[stateSelected].Kg_floater_salary / 2080;\r\n }\r\n}", "title": "" }, { "docid": "257d9dfdd97245ab3c09ff6fc51d62aa", "score": "0.5946221", "text": "function showDetails(){\n //induvidual input feild\n var changepassword = document.getElementById(\"newpassword\");\n var changeemail = document.getElementById(\"newemail\");\n\n //Input feilds that are hidden\n var name = document.getElementById(\"changeName\").style;\n var pass = document.getElementById(\"changePassword\").style;\n var email = document.getElementById(\"changeEmail\").style;\n var address = document.getElementById(\"changeAddress\").style;\n var postcode = document.getElementById(\"changePostcode\").style;\n var mobile = document.getElementById(\"changeMobile\").style;\n var hobbie = document.getElementById(\"changeHobbie\").style;\n var society = document.getElementById(\"changeSociety\").style;\n var year = document.getElementById(\"changeYear\").style;\n var course = document.getElementById(\"changeCourse\").style;\n var accom = document.getElementById(\"changeAccom\").style;\n var smoke = document.getElementById(\"changeSmoke\").style;\n\n //Radio buttons to show each input\n var namebtn = document.getElementById(\"supportName\").checked\n var passbtn = document.getElementById(\"supportPassword\").checked;\n var emailbtn = document.getElementById(\"supportEmail\").checked;\n var addressbtn = document.getElementById(\"supportAddress\").checked;\n var postcodebtn = document.getElementById(\"supportPostcode\").checked;\n var mobilebtn = document.getElementById(\"supportMobile\").checked;\n var hobbiebtn = document.getElementById(\"supportHobbie\").checked;\n var societybtn = document.getElementById(\"supportSociety\").checked;\n var yearbtn = document.getElementById(\"supportYear\").checked;\n var coursebtn = document.getElementById(\"supportCourse\").checked;\n var accombtn = document.getElementById(\"supportAccom\").checked;\n var smokebtn = document.getElementById(\"supportSmoke\").checked;\n\n //Feilds for verify if needed\n var verifyemail = document.getElementById(\"verifyemail\");\n var verifypassword = document.getElementById(\"verifypassword\");\n var verifyemailfield = document.getElementById(\"secondnewemail\");\n var verifypasswordfield = document.getElementById(\"secondnewpassword\");\n\n //Patterns for Input\n var emailPatt = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var passwordPatt = /^[A-Za-z0-9!@#$%^&*()_]{6,20}$/;\n\n if(namebtn == true) {\n name.display = \"block\";\n } else {\n name.display = \"none\";\n }\n\n if(passbtn == true){\n pass.display = \"block\";\n verifypassword.style.display = \"none\";\n } else {\n pass.display = \"none\";\n verifypassword.style.display = \"none\";\n }\n\n if(emailbtn == true){\n email.display = \"block\";\n verifyemail.style.display = \"none\";\n } else {\n email.display = \"none\";\n verifyemail.style.display = \"none\";\n }\n\n if (changepassword.value != \"\"){\n verifypassword.style.display = \"block\";\n } else {\n verifypassword.style.display = \"none\";\n }\n\n if (changeemail.value != \"\"){\n verifyemail.style.display = \"block\";\n } else {\n verifyemail.style.display = \"none\";\n }\n\n if(verifyemailfield.value != changeemail.value || emailPatt.test(verifyemailfield.value)){\n verifyemailfield.style.background = \"red\";\n } else {\n verifyemailfield.style.background = \"white\";\n }\n if(verifypasswordfield.value != changepassword.value){\n verifypasswordfield.style.background = \"red\";\n } else {\n verifypasswordfield.style.background = \"white\";\n }\n\n if(addressbtn == true){\n address.display = \"block\";\n } else {\n address.display = \"none\";\n }\n\n if(postcodebtn == true) {\n postcode.display = \"block\";\n } else {\n postcode.display = \"none\";\n }\n\n if(mobilebtn == true){\n mobile.display = \"block\";\n } else {\n mobile.display = \"none\";\n }\n\n if(hobbiebtn == true){\n hobbie.display = \"block\";\n } else {\n hobbie.display = \"none\";\n }\n\n if(societybtn == true){\n society.display = \"block\";\n } else {\n society.display = \"none\";\n }\n\n if(yearbtn == true){\n year.display = \"block\";\n } else {\n year.display = \"none\";\n }\n\n if(coursebtn == true){\n course.display = \"block\";\n } else {\n course.display = \"none\";\n }\n\n if(accombtn == true){\n accom.display = \"block\";\n } else {\n accom.display = \"none\";\n }\n\n if(smokebtn == true) {\n smoke.display = \"block\";\n } else {\n smoke.display = \"none\"\n }\n}", "title": "" }, { "docid": "b7767c3ccb3641ee07c7520555163c8c", "score": "0.59460753", "text": "function writeuserEducation(theDoc) \r\n{\r\n var theForm = document.getElementById(\"form\");\r\n\r\n var high = theForm.highschool.value;\r\n var year1 = theForm.year1.value;\r\n var college = theForm.college.value;\r\n var year2 = theForm.year2.value;\r\n var degree = theForm.degree.value;\r\n theDoc.write(\"<h3>\"+'Education' + \"</h3>\" );\r\n theDoc.write(\"<p>\" + \"<b>\" + high + \"</b>\" + ' - ' + \"<i>\" + year1 + \"</i></p>\");\r\n theDoc.write(\"<p>\" + \"<b>\" + college + \"</b>\" + ' - ' + \"<i>\" + year2 + \"</i>\" + ' - ' + degree + \"</p>\");\r\n}", "title": "" }, { "docid": "7af905f48b546aa08213611be6c9b3be", "score": "0.5940986", "text": "function allertFunction() {\n alert(\"You have enterd the following details:\");\n alert(\"Name :\".getElementById(name));\n alert(\"email: \".getElementById(email));\n alert(\"country: \".getElementById(country));\n alert(\"message: \".getElementById(message));\n}", "title": "" }, { "docid": "44b26b2e7b186cf21991030993153d18", "score": "0.59391695", "text": "function loadUserData(){\n\tdocument.getElementById(\"name-field\").value = profiledata.name;\n\tdocument.getElementById(\"title-field\").value = profiledata.title;\n\tdocument.getElementById(\"place-field\").value = profiledata.place;\n\tdocument.getElementById(\"signature-field\").value = profiledata.signature;\n}", "title": "" }, { "docid": "12398f30e1c3d1785a2f0732306cb08e", "score": "0.5937873", "text": "function showOnlyData() {\n document.getElementById(\"form\").style.display = 'none';\n\n var firstName = document.getElementById(\"firstName\").value;\n var lastName = document.getElementById(\"lastName\").value;\n var phoneNumber = document.getElementById(\"phoneNumber\").value;\n var email = document.getElementById(\"email\").value;\n var password = document.getElementById(\"password\").value;\n var repeatPassword = document.getElementById(\"repeatPass\").value;\n\n document.write(\"<h4>You Entered:-</h4>\");\n document.write(\"Full Name: \" + firstName + \" \" + lastName + \"<br>\");\n document.write(\"Phone Number: \" + phoneNumber + \"<br>\");\n document.write(\"Email: \" + email + \"<br>\");\n document.write(\"Password: \" + password + \"<br>\");\n document.write(\"Repeated Password: \" + repeatPassword + \"<br>\");\n}", "title": "" }, { "docid": "9671f9f33578711b742aa88aff7a247b", "score": "0.59356844", "text": "function showFilminfo(nameFilm = \"\", dayFilm = \"\", timeFilm = \"\", idFilm = \"\") {\n if (!document.getElementById('booking').classList.contains(\"show\")) {\n document.getElementById('booking').classList.add(\"show\");\n }\n document.getElementById('formTitle').innerHTML = nameFilm;\n document.getElementById('movie-name').value = nameFilm; // set value for movie-day \n\n document.getElementById('space').innerHTML = \"-\";\n\n document.getElementById('formDay').innerHTML = dayFilm;\n document.getElementById('movie-day').value = dayFilm; // set value for movie-day \n document.getElementById('space1').innerHTML = \"-\";\n\n document.getElementById('formTime').innerHTML = timeFilm;\n document.getElementById('movie-hour').value = timeFilm; // set value for movie-hour \n document.getElementById('formID').innerHTML = idFilm;\n document.getElementById('movie-id').value = idFilm; // set value for movie-id \n}", "title": "" }, { "docid": "8852d1b9c8c041046efedd11005b27f6", "score": "0.5925829", "text": "function valid_personal_level2(){\n \n \n var summary =\"\";\n\n var selectper = document.getElementById(\"title\").value;\n var lname = document.getElementById(\"Lname\").value;\n var fname = document.getElementById(\"Fname\").value;\n var appre = document.getElementById(\"Abb\").value;\n \n var flname=document.getElementById(\"FLname\").value;\n var ffname=document.getElementById(\"FFname\").value;\n var date=document.getElementById(\"date2\").value;\n \n if(lname === '')\n {\n \n var f=document.getElementById(\"Lname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"Lname\")),f,\"1\");\n }\n \n if(appre === '')\n {\n \n var f=document.getElementById(\"Abb\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"Abb\")),f,\"1\");\n } \n \n if(date === '')\n {\n \n var f=document.getElementById(\"date2\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"date2\")),f,\"1\");\n } \n \n if(selectper == ''){\n \n summary+=valid_select(this,'Title type',\"1\");\n \n }\n else\n {\n \n if((selectper == \"SHRI\") || (selectper == \"SMT\") || (selectper == \"KUMARI\"))\n {\n \n if(fname === '')\n {\n var f=document.getElementById(\"Fname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"Fname\")),f,\"1\");\n } \n\n if(flname === '')\n {\n var f=document.getElementById(\"FLname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"FLname\")),f,\"1\");\n } \n \n if(ffname === '')\n {\n var f=document.getElementById(\"FFname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"FFname\")),f,\"1\");\n }\n }\n } \n \n if(summary!=\"\")\n {\n \n alert(summary);\n \n \n var personal1 = document.forms[\"personal\"].querySelectorAll(\"input\");\n \n for(var i=0; i< personal1.length; i++)\n { \n \n if(personal1[i].type === \"text\" && personal1[i].value === \"\")\n {\n $(\".Mname2\").css(\"border-color\",\"white\");\n $(\".FMname2\").css(\"border-color\",\"white\");\n \n personal1[i].style.borderColor = \"red\";\n \n }else{\n personal1[i].style.borderColor=\"white\";\n }\n }\n \n $(function(){\n \n \n if($(\".title2\").val()!==\"\") \n {\n \n $(\".title2\").css('border-color','white');\n }else{\n $(\".title2\").css('border-color','red'); \n }\n \n });\n return false;\n }\n else \n \n return true; \n }", "title": "" }, { "docid": "6bd8d8dcada03726541c0914c0a84755", "score": "0.5921122", "text": "function editDisplay() {\n var x = document.getElementById(\"appt-edit\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"save-details\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"appt-details\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"detail-saving\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"editAppDetails-Patient\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.forms[\"update-details\"][\"edit_patient_insurance\"].value;\n if (x == \"\") {\n $(insure).hide();\n }else\n $(insure).show();\n }", "title": "" }, { "docid": "88f404c43049fc7ad957cb7d4c44dca9", "score": "0.5907636", "text": "function getContact() {\n\t// The following statement retrieves the user's input from the name and e-mail values\n\tfirstName = document.getElementById(\"firstname\").value;\n\tlastName = document.getElementById(\"lastname\").value;\n\temailAddress = document.getElementById(\"email\").value;\n\t\n\t// the following if statements replace a blank entry with \"blank\"\n\tif (firstName === \"\") {\n\t\tfirstName = \"blank\";\n\t}\n\tif (lastName === \"\") {\n\t\tlastName = \"blank\";\n\t}\n\tif (emailAddress === \"\") {\n\t\temailAddress = \"blank\";\n\t}\n}", "title": "" }, { "docid": "91ba7538233cfa7cf71241be9dc0243e", "score": "0.5903599", "text": "function initialize() {\n document.getElementById(\"principal\").value = \"\";\n document.getElementById(\"apy\").value = \"\";\n document.getElementById(\"loanTerm\").value = \"\";\n}", "title": "" }, { "docid": "bf07a5d2800f224ade45c18230f0c81b", "score": "0.588925", "text": "function putInfo (){\n\n document.getElementsByClassName('name_')[0].innerHTML = storedName\n document.getElementsByClassName('fone_')[0].innerHTML = storedPhone\n document.getElementsByClassName('email_')[0].innerHTML = storedEmail\n document.getElementsByClassName('city_')[0].innerHTML = storedCity\n document.getElementsByClassName('uf_')[0].innerHTML = storedUF\n document.getElementsByClassName('adress_')[0].innerHTML = storedAdd\n document.getElementsByClassName('number_')[0].innerHTML = storedNumber\n}", "title": "" }, { "docid": "81ece1df15acc015acdc9637d5b7a31b", "score": "0.58744943", "text": "function myFrmShow(item){ \n document.getElementById(\"i1\").value = item.id\n document.getElementById(\"i2\").value = item.description\n document.getElementById(\"i3\").value = item.price\n}", "title": "" }, { "docid": "1e992cd65922df74c049f0f5316452d0", "score": "0.5873981", "text": "function populateStaff() {\r\n noOfProgramDirectors = parseInt($(\"#noOfProgramDirectors\").val());\r\n noOfAssistantDirectors = parseInt($(\"#noOfAssistantDirectors\").val());\r\n noOfAdministrativeAssistants = parseInt(\r\n $(\"#noOfAdministrativeAssistants\").val()\r\n );\r\n noOfLeadTeachers = parseInt($(\"#noOfLeadTeachers\").val());\r\n noOfAssistantTeachers = parseInt($(\"#noOfAssistantTeachers\").val());\r\n\r\n if (salaryLevelCC == \"bls\") {\r\n //Program Director\r\n salaryProgramDirectors =\r\n noOfProgramDirectors * dataC[stateSelected].bls_director_salary;\r\n $(\"#salaryProgramDirectors\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].bls_director_salary)\r\n .slice(0, -3)\r\n );\r\n wageProgramDirectors = dataC[stateSelected].bls_director_salary / 2080;\r\n $(\"#wageProgramDirectors\").val(\r\n accounting.formatMoney(wageProgramDirectors)\r\n );\r\n\r\n //Assistant Director\r\n salaryAssistantDirectors =\r\n noOfAssistantDirectors *\r\n dataC[stateSelected].bls_assistant_director_salary;\r\n $(\"#salaryAssistantDirectors\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].bls_assistant_director_salary)\r\n .slice(0, -3)\r\n );\r\n wageAssistantDirectors =\r\n dataC[stateSelected].bls_assistant_director_salary / 2080;\r\n $(\"#wageAssistantDirectors\").val(\r\n accounting.formatMoney(wageAssistantDirectors)\r\n );\r\n\r\n //Administrative Assistant\r\n salaryAdministrativeAssistants =\r\n noOfAdministrativeAssistants *\r\n dataC[stateSelected].bls_administrative_assistant_salary;\r\n $(\"#salaryAdministrativeAssistants\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].bls_administrative_assistant_salary)\r\n .slice(0, -3)\r\n );\r\n wageAdministrativeAssistants =\r\n dataC[stateSelected].bls_administrative_assistant_salary / 2080;\r\n $(\"#wageAdministrativeAssistants\").val(\r\n accounting.formatMoney(wageAdministrativeAssistants)\r\n );\r\n\r\n //Lead Teacher\r\n salaryLeadTeachers =\r\n noOfLeadTeachers * dataC[stateSelected].bls_lead_teacher_salary;\r\n $(\"#salaryLeadTeachers\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].bls_lead_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n wageLeadTeachers = dataC[stateSelected].bls_lead_teacher_salary / 2080;\r\n $(\"#wageLeadTeachers\").val(accounting.formatMoney(wageLeadTeachers));\r\n\r\n //Assistant Teacher\r\n salaryAssistantTeachers =\r\n noOfAssistantTeachers * dataC[stateSelected].bls_assistant_teacher_salary;\r\n $(\"#salaryAssistantTeachers\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].bls_assistant_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n wageAssistantTeachers =\r\n dataC[stateSelected].bls_assistant_teacher_salary / 2080;\r\n $(\"#wageAssistantTeachers\").val(\r\n accounting.formatMoney(wageAssistantTeachers)\r\n );\r\n\r\n //Substitute Teacher\r\n totalTeachers = noOfLeadTeachers + noOfAssistantTeachers;\r\n\r\n //TO calc total no of floaters\r\n noOfSubstituteTeachers = parseFloat($(\"#noOfSubstituteTeachers\").val());\r\n\r\n salarySubsTeachers =\r\n noOfSubstituteTeachers * dataC[stateSelected].bls_floater_salary;\r\n $(\"#salarySubsTeachers\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].bls_floater_salary)\r\n .slice(0, -3)\r\n );\r\n\r\n wageSubsTeachers = dataC[stateSelected].bls_floater_salary / 2080;\r\n $(\"#wageSubsTeachers\").val(accounting.formatMoney(wageSubsTeachers));\r\n }\r\n\r\n if (salaryLevelCC == \"kg\") {\r\n //Program Director\r\n salaryProgramDirectors =\r\n noOfProgramDirectors * dataC[stateSelected].Kg_director_salary;\r\n $(\"#salaryProgramDirectors\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].Kg_director_salary)\r\n .slice(0, -3)\r\n );\r\n wageProgramDirectors = dataC[stateSelected].Kg_director_salary / 2080;\r\n $(\"#wageProgramDirectors\").val(\r\n accounting.formatMoney(wageProgramDirectors)\r\n );\r\n\r\n //Assistant Director\r\n salaryAssistantDirectors =\r\n noOfAssistantDirectors *\r\n dataC[stateSelected].Kg_assistant_director_salary;\r\n $(\"#salaryAssistantDirectors\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].Kg_assistant_director_salary)\r\n .slice(0, -3)\r\n );\r\n wageAssistantDirectors =\r\n dataC[stateSelected].Kg_assistant_director_salary / 2080;\r\n $(\"#wageAssistantDirectors\").val(\r\n accounting.formatMoney(wageAssistantDirectors)\r\n );\r\n\r\n //Administrative Assistant\r\n salaryAdministrativeAssistants =\r\n noOfAdministrativeAssistants *\r\n dataC[stateSelected].Kg_administrative_assistant_salary;\r\n $(\"#salaryAdministrativeAssistants\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].Kg_administrative_assistant_salary)\r\n .slice(0, -3)\r\n );\r\n wageAdministrativeAssistants =\r\n dataC[stateSelected].Kg_administrative_assistant_salary / 2080;\r\n $(\"#wageAdministrativeAssistants\").val(\r\n accounting.formatMoney(wageAdministrativeAssistants)\r\n );\r\n\r\n //Lead Teacher\r\n salaryLeadTeachers =\r\n noOfLeadTeachers * dataC[stateSelected].Kg_lead_teacher_salary;\r\n $(\"#salaryLeadTeachers\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].Kg_lead_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n wageLeadTeachers = dataC[stateSelected].Kg_lead_teacher_salary / 2080;\r\n $(\"#wageLeadTeachers\").val(accounting.formatMoney(wageLeadTeachers));\r\n\r\n //Assistant Teacher\r\n salaryAssistantTeachers =\r\n noOfAssistantTeachers * dataC[stateSelected].Kg_assistant_teacher_salary;\r\n $(\"#salaryAssistantTeachers\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].Kg_assistant_teacher_salary)\r\n .slice(0, -3)\r\n );\r\n wageAssistantTeachers =\r\n dataC[stateSelected].Kg_assistant_teacher_salary / 2080;\r\n $(\"#wageAssistantTeachers\").val(\r\n accounting.formatMoney(wageAssistantTeachers)\r\n );\r\n\r\n //Substitute Teacher\r\n totalTeachers = noOfLeadTeachers + noOfAssistantTeachers;\r\n\r\n //TO calc total no of floaters\r\n noOfSubstituteTeachers = parseFloat($(\"#noOfSubstituteTeachers\").val());\r\n\r\n salarySubsTeachers =\r\n noOfSubstituteTeachers * dataC[stateSelected].Kg_floater_salary;\r\n $(\"#salarySubsTeachers\").val(\r\n accounting\r\n .formatMoney(dataC[stateSelected].Kg_floater_salary)\r\n .slice(0, -3)\r\n );\r\n\r\n wageSubsTeachers = dataC[stateSelected].Kg_floater_salary / 2080;\r\n $(\"#wageSubsTeachers\").val(accounting.formatMoney(wageSubsTeachers));\r\n }\r\n}", "title": "" }, { "docid": "7d67d22378e9bd599176c416a38bca6d", "score": "0.5869235", "text": "function displayPatient(pt) {\n document.getElementById('patient_name').innerHTML = getPatientName(pt);\n document.getElementById('gender').innerHTML = pt.gender;\n document.getElementById('dob').innerHTML = pt.birthDate;\n}", "title": "" }, { "docid": "291fff00a99f93fd049ae061c2bd711b", "score": "0.5863045", "text": "function set_client_details() {\n let selected_client = document.getElementById(\"client\").value\n if (selected_client != \"Select\") {\n var client_detail_toput = client_dict[selected_client]\n document.getElementById(\"User_id\").innerHTML = client_detail_toput[\"User_id\"]\n document.getElementById(\"Password\").innerHTML = client_detail_toput[\"Password\"]\n document.getElementById(\"GSTIN\").innerHTML = client_detail_toput[\"GSTIN\"]\n document.getElementById(\"Organization_Type\").innerHTML = client_detail_toput[\"Organization_Type\"]\n document.getElementById(\"Contact_Person\").innerHTML = client_detail_toput[\"Contact_Person\"]\n document.getElementById(\"Contact_Number\").innerHTML = client_detail_toput[\"Contact_Number\"]\n document.getElementById(\"Email_ID\").innerHTML = client_detail_toput[\"Email_ID\"]\n document.getElementById(\"Client_Status\").innerHTML = client_detail_toput[\"Client_Status\"]\n document.getElementById(\"Registration_Type\").innerHTML = client_detail_toput[\"Registration_Type\"]\n } else {\n set_default_values()\n }\n}", "title": "" }, { "docid": "e218f81b8ddbd803f81a0dfc7f9bac3f", "score": "0.5861247", "text": "function insertIntoFields(QuesName,QuesDesc,opt1,opt2,opt3,opt4,ans,marks)\n{\n var name=document.getElementById(\"QuesName\");\n var desc=document.getElementById(\"QuesDesc\");\n var option1=document.getElementById(\"opt1\");\n var option2=document.getElementById(\"opt2\");\n var option3=document.getElementById(\"opt3\");\n var option4=document.getElementById(\"opt4\");\n var Marks=document.getElementById(\"marks\");\n var Answer=document.getElementById(\"ans\");\n\n name.value=QuesName;\n desc.value=QuesDesc;\n option1.value=opt1;\n option2.value=opt2;\n option3.value=opt3;\n option4.value=opt4;\n Answer.value=ans;\n Marks.value=marks;\n}", "title": "" }, { "docid": "205dad153b75a4a12cc63379e71d8566", "score": "0.58466756", "text": "function retrieveStudentRecordToFields(mySem, myMonth, myid) {\n var date = document.getElementById(\"date\");\n\n var totalhrs = document.getElementById(\"totalhrs\");\n var studname = document.getElementById(\"studname\");\n var studno = document.getElementById(\"studno\");\n var course = document.getElementById(\"course\");\n var scholarship = document.getElementById(\"scholarship\");\n var year = document.getElementById(\"year\");\n var assigneddept = document.getElementById(\"assigneddept\");\n var assignedFaculty = document.getElementById(\"assignedFaculty\");\n var dutydescription = document.getElementById(\"dutydescription\");\n\n db.collection('scholar_list').where('IdNumber', '==' , myid).get().then((snapshot) => {\n\n if (snapshot.empty) {\n //window.alert('No Student Scholar on the list');\n //searchRecord.value = '';\n console.log('snapshot is empty');\n date.value = '';\n \n totalhrs.value = '';\n studname.value = '';\n \n course.value = '';\n scholarship.value = '';\n year.value = '';\n assigneddept.value = '';\n assignedFaculty.value = '';\n dutydescription.value = '';\n return;\n }\n snapshot.forEach(function(docu) {\n var objectData = docu.data();\n var fullname = objectData['Name'];\n var coursee = objectData['Course'];\n var yearr = objectData['Year'];\n var id = objectData['IdNumber'];\n var scholarr = objectData['Scholarship'];\n var department = objectData['Department'];\n var faculty = objectData['Faculty'];\n \n studname.value = fullname;\n studno.value = id;\n course.value = coursee;\n scholarship.value = scholarr;\n year.value = yearr;\n assigneddept.value = department;\n assignedFaculty.value = faculty;\n // dutydescription.value = description;\n\n });\n });\n}", "title": "" }, { "docid": "bc20dcd93cd897044b0635d60ed2b789", "score": "0.5846521", "text": "function func_userDetailOnSubmit() {\n var textDtl = {\n id_emailAddress_input: \"\",\n id_firstName_input: \"\",\n id_lastName_input: \"\"\n }\n // Loop through inputs and gather values into an array\n for (var idx in func_getInputFieldArray()) {\n textDtl[func_getInputFieldArray()[idx]] = document.getElementById(func_getInputFieldArray()[idx]).value;\n }\n // Create formatted message to display with simple confirm dialog\n var message = \"User: \" + textDtl.id_firstName_input + \" \" + textDtl.id_lastName_input + \"\\nEmail: \" + textDtl.id_emailAddress_input;\n if (window.confirm(message)) document.getElementById('id_userDetailForm_form').submit();\n}", "title": "" }, { "docid": "bc78ef9bdf9ece46f367b0e9f15e2158", "score": "0.5842444", "text": "function GetValues()\n{\t\n\thw=document.getElementById(\"HW\").value;\n\taw=document.getElementById(\"AW\").value*0.001;\n\tfrc=document.getElementById(\"FRC\").value*0.001;\n\tend=document.getElementById(\"END\").value;\n\thb=document.getElementById(\"HB\").value;\n\tabVal=document.getElementById(\"AB\").value;\n\tab=end*0.05;\n\t\n\t\n}", "title": "" }, { "docid": "f2884098ac9569f581729910041827ab", "score": "0.5839308", "text": "function get()\n{\n\tvar name=document.getElementById('name').value;\n\tvar mob=document.getElementById('mob').value;\n\tvar s=document.getElementById('school').value;\n\tstudent.read(name,mob);\n\tstudent.input(s);\n}", "title": "" }, { "docid": "043a956f14a57b298eb37b88896d3904", "score": "0.58355707", "text": "function disableInputFields() {\n//--- pa_pernr\n var lf_pa_pernr = document.getElementById('pa_pernr');\n if (lf_pa_pernr==null || typeof(lf_pa_pernr)=='undefined' ) {\n } else { lf_pa_pernr.disabled = 'disabled'; }\n//--- pa_date\n var lf_pa_date = document.getElementById('pa_date');\n if (lf_pa_date==null || typeof(lf_pa_date)=='undefined' ) {\n } else { lf_pa_date.disabled = 'disabled'; }\n//--- pa_massg\n var lf_pa_massg = document.getElementById('pa_massg');\n if (lf_pa_massg==null || typeof(lf_pa_massg)=='undefined' ) {\n } else { lf_pa_massg.disabled = 'disabled'; }\n//--- pa_bukrs_new\n var lf_pa_bukrs_new = document.getElementById('pa_bukrs_new');\n if (lf_pa_bukrs_new==null || typeof(lf_pa_bukrs_new)=='undefined' ) {\n } else { lf_pa_bukrs_new.disabled = 'disabled'; }\n//--- pa_werks_new\n var lf_pa_werks_new = document.getElementById('pa_werks_new');\n if (lf_pa_werks_new==null || typeof(lf_pa_werks_new)=='undefined' ) {\n } else { lf_pa_werks_new.disabled = 'disabled'; }\n//--- pa_btrtl_new\n var lf_pa_btrtl_new = document.getElementById('pa_btrtl_new');\n if (lf_pa_btrtl_new==null || typeof(lf_pa_btrtl_new)=='undefined' ) {\n } else { lf_pa_btrtl_new.disabled = 'disabled'; }\n//--- pa_orgeh_new\n var lf_pa_orgeh_new = document.getElementById('pa_orgeh_new');\n if (lf_pa_orgeh_new==null || typeof(lf_pa_orgeh_new)=='undefined' ) {\n } else { lf_pa_orgeh_new.disabled = 'disabled'; }\n//--- pa_plans_new\n var lf_pa_plans_new = document.getElementById('pa_plans_new');\n if (lf_pa_plans_new==null || typeof(lf_pa_plans_new)=='undefined' ) {\n } else { lf_pa_plans_new.disabled = 'disabled'; }\n//--- pa_sachp_new\n var lf_pa_sachp_new = document.getElementById('pa_sachp_new');\n if (lf_pa_sachp_new==null || typeof(lf_pa_sachp_new)=='undefined' ) {\n } else { lf_pa_sachp_new.disabled = 'disabled'; }\n//--- pa_stell_new\n var lf_pa_stell_new = document.getElementById('pa_stell_new');\n if (lf_pa_stell_new==null || typeof(lf_pa_stell_new)=='undefined' ) {\n } else { lf_pa_stell_new.disabled = 'disabled'; }\n//--- pa_kostl_new\n var lf_pa_kostl_new = document.getElementById('pa_kostl_new');\n if (lf_pa_kostl_new==null || typeof(lf_pa_kostl_new)=='undefined' ) {\n } else { lf_pa_kostl_new.disabled = 'disabled'; }\n}", "title": "" }, { "docid": "0e0fa5d8e21c7c2458ba204526cd4bce", "score": "0.5831224", "text": "function showFillData(data){\n\t\t$(\"#university\").val(data.university);\n\t\t$(\"#masdegreetype\").val(data.masdegreetypeId);\n\t\t$(\"#faculty\").val(data.faculty);\n\t\t$(\"#major\").val(data.major);\n\t\t$(\"#startDate\").val(data.start_date);\n\t\t$(\"#graduate\").val(data.graduated_date);\n\t\t$(\"#gpa\").val(data.gpa);\n\t}", "title": "" }, { "docid": "f4059b63e6024a8f53f5a3078ad64705", "score": "0.5829061", "text": "function emptyFieldCheck() {\n const fName = document.getElementById('firstName').value;\n const lName = document.getElementById('lastName').value;\n const userName = document.getElementById('userName').value;\n const email = document.getElementById('emailAddress').value;\n const passCreated = document.getElementById('passInit').value;\n const passVerify = document.getElementById('passVerify').value;\n}", "title": "" }, { "docid": "e0e15cb2e529051f7fdf4e34b93c450c", "score": "0.5828711", "text": "function summit(){\n\n errorDialog = document.getElementById(\"error-message\");\n var FN = document.getElementById(\"create_firstName\").value;\n var LN = document.getElementById(\"create_lastName\").value;\n var MJ = document.getElementById(\"create_major\").value;\n var GYR = document.getElementById(\"create_graduationYear\").value;\n var SH = document.getElementById(\"school_select\").value;\n var DG = document.getElementById(\"degree_select\").value;\n var CL = document.getElementById(\"classLevel_select\").value;\n var GPA = parseFloat(document.getElementById('create_gpa').value).toFixed(2);\n var Eth = document.getElementById('ethnicity_select').value;\n var USC = document.getElementById('us_citizenship_select').value\n\n //checking the input of first name and last name\n if (FN.length == 0) {\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please enter your first name\";\n document.getElementById(\"create_firstName\").classList.add(\"error\");\n } else if (LN.length == 0) {\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please enter your last name\";\n document.getElementById(\"create_lastName\").classList.add(\"error\");\n } else if (MJ.length == 0) {\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please enter your major\";\n document.getElementById(\"create_major\").classList.add(\"error\");\n } else if (GYR.length != 4 || isNaN(GYR)) {\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please enter a valid year\";\n document.getElementById(\"create_graduationYear\").classList.add(\"error\");\n } else if (GPA.length == 0 || isNaN(GPA) || parseFloat(GPA).toFixed(2) < 0 || parseFloat(GPA).toFixed(2) > 4) {\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please enter a valid GPA (0-4)\";\n document.getElementById(\"create_gpa\").classList.add(\"error\");\n }else if(SH==\"School\"){\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please Select your School\";\n document.getElementById(\"school_select\").classList.add(\"error\");\n }else if(DG==\"Degree\"){\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please Select your Degree\";\n document.getElementById(\"degree_select\").classList.add(\"error\");\n }else if(CL==\"Class Level\"){\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please Select your Class Level\";\n document.getElementById(\"classLevel_select\").classList.add(\"error\");\n }else if(Eth==\"Ethnicity\"){\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please Select your Ethnicity\";\n document.getElementById(\"ethnicity_select\").classList.add(\"error\");\n }else if(USC==\"US Citizenship\"){\n document.getElementById(\"error-message-container\").style.display = \"inline-block\";\n errorDialog.textContent = \"Please Select your US Citizenship status\";\n document.getElementById(\"us_citizenship_select\").classList.add(\"error\");\n }else{\n writeFirestore_profile(User_id, FN, LN, SH, MJ, DG, GYR, CL,GPA,Eth,USC);\n setTimeout(function(){\n window.location.href ='../main_page.html'+'?uID='+uID; //jump to main page, pass uID via URL\n },1000); //the timer is for uploading the profile to firestore\n }\n \n \n}", "title": "" }, { "docid": "9aeb3f4155e5ddc079e8f45e5c724c69", "score": "0.5826555", "text": "function showEditProfileForm() {\n document.getElementById(\"profileSection\").style.display = \"none\"\n document.getElementById(\"editProfileForm\").style.display = \"block\"\n var userPfFullName = document.getElementById(\"userPfFullName\").innerHTML;\n var userPfSurname = document.getElementById(\"userPfSurname\").innerHTML;\n var userPfFb = document.getElementById(\"userPfFb\").getAttribute(\"href\");\n var userPfTw = document.getElementById(\"userPfTw\").getAttribute(\"href\");\n var userPfGp = document.getElementById(\"userPfGp\").getAttribute(\"href\");\n var userPfBio = document.getElementById(\"userPfBio\").innerHTML;\n document.getElementById(\"userFullName\").value = userPfFullName;\n document.getElementById(\"userSurname\").value = userPfSurname;\n document.getElementById(\"userFacebook\").value = userPfFb;\n document.getElementById(\"userTwitter\").value = userPfTw;\n document.getElementById(\"userGooglePlus\").value = userPfGp;\n document.getElementById(\"userBio\").value = userPfBio;\n}", "title": "" }, { "docid": "ab6665012f5e82110756c589e7fa7940", "score": "0.5822982", "text": "function student_record(student_id,student_name)\n{\n \ndocument.getElementById(\"showiframepaymentsystem\").innerHTML=\"\";\ndocument.getElementById(\"student_record_fetch\").innerHTML=\"\";\ndocument.getElementById(\"student_record_fetch\").innerHTML='<div class=\"no_record\">Record No Found !!</div>';\n\ndocument.getElementById(\"studentperiviousdetails\").innerHTML=\"\";\ndocument.getElementById(\"studentperiviousdetails\").innerHTML='<div class=\"no_record\">Record No Found !!</div>';\n\ndocument.getElementById(\"manuallycollectfeedetails\").style.display=\"none\";\ndocument.getElementById(\"auotomaticallycollectfeedetails\").style.display=\"none\";\ndocument.getElementById(\"manuallyfeegroup\").innerHTML=\"<option id='manually_select_fee_group' value='0'>-- Select fee group --</option>\"; \ndocument.getElementById(\"zero_select_automatically\").selected=true;\n \ndocument.getElementById(\"collectfeeautomatic\").checked=false; \ndocument.getElementById(\"collectfeemanually\").checked=false; \n\nif(student_id==0 && student_name==0)\n{\nalert(\"Please select student\");\nreturn false;\n}else\n{\ndocument.getElementById(\"advance_student_id\").value=student_id;\ndocument.getElementById(\"student_search\").value=student_name;\ndocument.getElementById(\"all_list\").innerHTML=\"\";\n document.getElementById(\"all_list\").style.display=\"none\";\nstatic_student();\n} \n}", "title": "" }, { "docid": "c9438a4d2d1b1433d7e089b578df570b", "score": "0.5822529", "text": "function save_location() {\n var city = document.getElementById(\"city\").value;\n var street = document.getElementById(\"street\").value;\n var number = document.getElementById(\"number\").value;\n user_location_str = street + \" \" + number + \", \" + city;\n}", "title": "" }, { "docid": "90c89d78cf8599f07723fc4d944e4f48", "score": "0.5810375", "text": "function addperson() {\n let name = document.getElementById('name').value;\n let phone = document.getElementById('phone').value;\n // console.log(name, phone);\n \n\n classContact.getcontent(name, phone);\n\n // document.getElementById('name').value = '';\n // document.getElementById('phone').value = '';\n\n}", "title": "" }, { "docid": "7d7b3536f9708384d96cab6db8dca10a", "score": "0.57971025", "text": "function infoContinuee() {\r\n\tvar sellDate = document.forms[\"sellInfo\"][\"sellDate\"].value;\r\n\tvar list = document.forms[\"sellInfo\"][\"list\"].value;\r\n\tvar sellPrice = document.forms[\"sellInfo\"][\"sellPrice\"].value;\r\n\tvar sellProfit = document.forms[\"sellInfo\"][\"sellProfit\"].value;\r\n\tvar buyPrice = document.forms[\"sellInfo\"][\"buyPrice\"].value;\r\n\tvar sellProvince = document.forms[\"sellInfo\"][\"sellProvince\"].value;\r\n\tvar sellSource = document.forms[\"sellInfo\"][\"sellSource\"].value;\r\n\tvar deliveryCost = document.forms[\"sellInfo\"][\"deliveryCost\"].value;\r\n\r\n\tif (sellDate.trim() == \"\" || list.trim() == \"\" || sellPrice.trim() == \"\" || sellProvince.trim() == \"\" || sellSource.trim() == \"\") {\r\n\t\talert(enterCompleteInfo);\r\n\t} else {\r\n\t\tvar sellProfit = document.forms[\"sellInfo\"][\"sellProfit\"].value = eval(sellPrice - buyPrice);\r\n\t\tif (deliveryCost.trim() == \"\") {\r\n\t\t\tdocument.forms[\"sellInfo\"][\"deliveryCost\"].value = 0;\r\n\t\t}\r\n\t\tshowwarne();\r\n\t}\r\n}", "title": "" }, { "docid": "0e200995a029761c1068b8fdf2effee1", "score": "0.5792349", "text": "function populateNameFields(fname, lname){\n \"use strict\";\n var headerFill = false;\n if (fname === \"\" || fname === \"null\" || fname === null){\n jQuery(\"input[name=firstname]\").val(\"\");\n jQuery(\"#personal-header\").html(\"RSVP for Your Plus One<hr>\");\n headerFill = true;\n }\n else {\n jQuery(\"input[name=firstname]\").val(fname);\n }\n if (lname === \"\" || lname === \"null\" || lname === null){\n jQuery(\"input[name=lastname]\").val(\"\");\n if(headerFill === false){\n jQuery(\"#personal-header\").html(\"RSVP for \" + fname + \"<hr>\");\n headerFill = true;\n }\n }\n else {\n jQuery(\"input[name=lastname]\").val(lname);\n }\n if (headerFill === false) {\n jQuery(\"#personal-header\").html(\"RSVP for \" + fname + \" \" + lname + \"<hr>\");\n }\n}", "title": "" }, { "docid": "9ca1afdeea63cb3d9f98160681654c4e", "score": "0.57917124", "text": "function clearAddStudentFormInputs(){\n let studentName= document.getElementById(\"studentName\").value=\"\";\n let course =document.getElementById(\"course\").value=\"\";\n let studentGrade=document.getElementById(\"studentGrade\").value=\"\";\n}", "title": "" }, { "docid": "1e110ed4c74cbef5525638979d8fc777", "score": "0.57912225", "text": "function datatrans() {\n var box1 = document.getElementById(\"F_Name\").value;\n sessionStorage.setItem(\"FirstName\", box1);\n\n var box2 = document.getElementById(\"L_Name\").value;\n sessionStorage.setItem(\"LastName\", box2);\n\n var box3 = document.getElementById(\"email\").value;\n sessionStorage.setItem(\"Email\", box3);\n\n var box4 = document.getElementById(\"Street_A\").value;\n sessionStorage.setItem(\"Street\", box4);\n \n var box5 = document.getElementById(\"S_T\").value;\n sessionStorage.setItem(\"Sub_Tow\", box5);\n\n var box6 = document.getElementById(\"State\").value;\n sessionStorage.setItem(\"State\", box6);\n\n var box7 = document.getElementById(\"Postcode\").value;\n sessionStorage.setItem(\"Zip\", box7);\n \n var box8 = document.getElementById(\"cost1\").value;\n sessionStorage.setItem(\"Cost\", box8);\n\n var box9 = document.getElementById(\"cat\").value;\n sessionStorage.setItem(\"Category\", box9);\n \n var box10 = document.getElementById(\"model1\").value;\n sessionStorage.setItem(\"Model\", box10);\n }", "title": "" }, { "docid": "176fded85db7deb0298ebaaf169f5d97", "score": "0.578188", "text": "function getFormvalue() {\n const formDetail = document.getElementById(\"form1\")\n const fName = formDetail.elements['fname']\n const lName = formDetail.elements['lname']\n\n let firstName = fName.value\n let lastName = lName.value\n \n console.log(`${firstName} ${lastName}`)\n}", "title": "" }, { "docid": "9544693260602aad6a3c27f60d132b7d", "score": "0.57729113", "text": "function setDepartment()\n{\n//If the patron is a UM Faculty Member and wants delivery to the department office,\n//The department name is entered in the address with an indication it is the main campus.\nif (patronStatus==\"fac\" && campus==\"Mem\" && document.getElementById(\"mail\").selected){\ndocument.getElementById(\"Address\").value=department;\ndocument.getElementById(\"Address2\").value=\"Departmental Admin Office\";\ndocument.getElementById(\"City\").value=\"Memphis\";\ndocument.getElementById(\"State\").value=\"TN\";\ndocument.getElementById(\"Zip\").value=\"38152\";\n}\nelse{\n\n}\n}", "title": "" }, { "docid": "97a281085226b11b0fe1814f662488bd", "score": "0.57728976", "text": "function Bday()\n { event.preventDefault();\n let yr =new Date().getFullYear(); \n var na = document.querySelector(\"#bname\").value;\n var year =document.querySelector(\"#sel\").value;\n\n if(na.length <1)\n {\n alert(\"please Enter name\");\n return\n }\n else if(na.length <3)\n {\n alert(\"Please Enter Correct or Full name \");\n return\n }\n\n document.getElementById('Bday1').style.visibility=\"hidden\";\n document.getElementById('Bday1').style.height=\"0px\";\n document.getElementById('Bday1').style.width=\"0px\";\n\n yr = yr-year;\n var end =\"\";\n if(yr==1)\n {\n end=\"st\";\n }\n else if(yr==2)\n {\n end=\"nd\";\n }\n else if(yr==3)\n {\n end=\"rd\";\n }\n else\n {\n end=\"th\";\n }\n document.getElementById('bt1').style.visibility=\"visible\";\n \n document.getElementById('Bday2').style.visibility=\"visible\";\n document.getElementById(\"wish\").innerHTML=\"Happy Birthday \" +na;\n document.getElementById(\"year\").innerHTML= yr +end;\n \n\n }", "title": "" }, { "docid": "b9ef1cb01dea7df4b28991b8f4bc7de7", "score": "0.57676625", "text": "function ecampusFill()\n{\ndocument.getElementById(\"Address\").value=\"\";\ndocument.getElementById(\"Address2\").value=\"\";\ndocument.getElementById(\"City\").value=\"\";\ndocument.getElementById(\"State\").value=\"\";\ndocument.getElementById(\"Zip\").value=\"\";\n}", "title": "" }, { "docid": "320d6769b602fcc222fbf7bfa3788be8", "score": "0.5766703", "text": "function updateallinputsvalues() {\r\n nameinput.setAttribute(\"value\", \"\");\r\n phoneinput.setAttribute(\"value\", \"\");\r\n addressinput.setAttribute(\"value\", \"\");\r\n emailinput.setAttribute(\"value\", \"\");\r\n descriptioninput.setAttribute(\"value\", \"\");\r\n}", "title": "" }, { "docid": "994d0d5a8d74895f45e75e6bcb9c6c7f", "score": "0.57664883", "text": "function init_fields() {\n $(\"#first_name\").val(\"Val\");\n $(\"#last_name\").val(\"Kilmer\");\n $(\"#email\").val(\"[email protected]\");\n $(\"#webaddr\").val(\"https://wwwvalkilmercom\");\n}", "title": "" }, { "docid": "a4e9cd5543d5e26a527d13a8981b8d40", "score": "0.5765391", "text": "function clearFields(){\r\n\tdocument.getElementById(\"accountnumber\").value = \"\";\r\n\tdocument.getElementById(\"cvc\").value = \"\";\r\n\tdocument.getElementById(\"expMonth\").value = \"\";\r\n\tdocument.getElementById(\"expYear\").value = \"\";\r\n}", "title": "" }, { "docid": "8fe3454dcfb730d3e2eb0af9d5d57149", "score": "0.57644117", "text": "function submitAll(){\n let q1 = document.getElementById(\"hello1\").value\n let q2 = document.getElementById(\"hello2\").value\n let q3 = document.getElementById(\"hello3\").value\n\n}", "title": "" }, { "docid": "a1447465a859b0c4722e0f6c963c1040", "score": "0.57625353", "text": "function obrisi() {\n\n document.getElementById('naziv').value = '';\n document.getElementById('autor').value = '';\n document.getElementById('cena').value = '';\n document.getElementById('datum').value = '';\n document.getElementById('kolicina').value = '1';\n // document.getElementById('vrstaDogadjaja').value = '';\n\n}", "title": "" }, { "docid": "60289ef856d23c75e313a85979e138e4", "score": "0.57605445", "text": "function saveMaOnload(){\n\tmaKhoaTmp = document.getElementById(prefix_component + \"DM_KHOA_MA\").value;\n\tmaBanKhamTmp = document.getElementById(prefix_component + \"DT_DM_BAN_KHAM_MA_2\").value;\n}", "title": "" }, { "docid": "822e8691bc608f441d78cd18879ce33d", "score": "0.5758241", "text": "function loadFirstName() {\n firstName = document.getElementById('form-first-name').value\n}", "title": "" }, { "docid": "70ba57ac7ed7d46f3d20fccf405fe241", "score": "0.5748736", "text": "function displayData() {\n let userName = document.getElementById('userData').txtName.value;\n let userID = document.getElementById('userData').txtID.value;\n alert(`Name entered is ${userName} \\n ID entered is ${userID}`);\n}", "title": "" }, { "docid": "815e39ad6bcce16bdcec95cb87c9a1c2", "score": "0.5747122", "text": "function vaidatePersonalDataForm() {\n\n\n\n const birthdayInput = document.getElementById('birthday');\n const fnameInput = document.getElementById('fname');\n const lnameInput = document.getElementById('lname');\n const emailInput = document.getElementById('email');\n const fnumeInput = document.getElementById('fnume');\n // const genderInput = document.getElementById('genderInput');\n\n if (!birthdayInput.value) {\n document.getElementById('personalErrorMsg').innerHTML = 'Please, provide date of birth';\n } else if (!fnameInput.value) {\n document.getElementById('personalErrorMsg').innerHTML = 'Please enter first name';\n } else if (!lnameInput.value) {\n document.getElementById('personalErrorMsg').innerHTML = 'Please, enter last name';\n } else if (!emailInput.value) {\n document.getElementById('personalErrorMsg').innerHTML = 'enter a valid email';\n } else if (!fnumeInput.value) {\n document.getElementById('personalErrorMsg').innerHTML = 'enter Phone number';\n // } else if (!genderInput.value){\n // document.getElementById('personalErrorMsg').innerHTML='choose your gender';\n\n } else {\n document.getElementById('personalErrorMsg').innerHTML = '';\n\n const birthday = new Date(birthdayInput.value);\n const today = new Date();\n const userge = '';\n const userAge = today.getFullYear() - birthday.getFullYear();\n\n if (userAge >= 18) {\n age = userge;\n\n togglescreen('frm1', 'subform');\n } else {\n document.getElementById('personalErrorMsg').innerHTML = 'Your age must be more than or equal to 18';\n\n }\n }\n\n}", "title": "" }, { "docid": "e76bfb96d0286d36f05da38f8c86396b", "score": "0.5746059", "text": "function assign_subject(day,lecture,week_id,lecture_id,start_time,end_time)\n{\n document.getElementById(\"assign_subject_update_id\").value=\"\";\n document.getElementById(\"room_no\").value=\"\";\n document.getElementById(\"note\").value=\"\";\n document.getElementById(\"submit_button_value\").value=\"Save\";\n document.getElementById(\"top_heading_contant\").innerHTML=\"Assign Subject For Lecture/Period\";\n document.getElementById(\"temp_teachers_id\").value=\"\";\n document.getElementById(\"insert_week_id\").value=week_id;\n document.getElementById(\"insert_lecture_id\").value=lecture_id;\n document.getElementById(\"start_time_count\").value=start_time;\n document.getElementById(\"end_time_count\").value=end_time;\n \ndocument.getElementById(\"time_table_pop_up_2\").style.display=\"none\"; \ndocument.getElementById(\"time_table_pop_up_1\").style.display=\"none\"; \ndocument.getElementById(\"time_table_pop_up_3\").style.display=\"block\"; \ndocument.getElementById(\"day_value\").innerHTML=day;\ndocument.getElementById(\"lecture_value\").innerHTML=lecture;\n}", "title": "" }, { "docid": "2c5bc0e6fc398b6186efc433f996b590", "score": "0.5744998", "text": "function showDetails () {\n\n // retrieve the contents of the user input from the input fields\n let name = $(\"#fullname\").val();\n let email = $(\"#email\").val();\n let phonenumber = $(\"#phonenum\").val();\n\n $(\"#input-name\").text(name);\n $(\"#input-email\").text(email);\n $(\"#input-phone\").text(phonenumber);\n $('#edit-contact').hide();\n \n \n\n }", "title": "" }, { "docid": "9ffdd9488f918338b91c05485e73d9fc", "score": "0.5734558", "text": "function populateSC() {\r\n $(\"#childCareFacilities\").val(accounting.formatMoney(dataS[stateSelected].centers_programs).slice(1,-3));\r\n\r\n $(\"#childCareSlots\").val(accounting.formatMoney(dataS[stateSelected].centers_slots).slice(1,-3));\r\n\r\n $(\"#familyHomeFacilities\").val(accounting.formatMoney(dataS[stateSelected].FCC_programs).slice(1,-3));\r\n\r\n $(\"#familyHomeSlots\").val(accounting.formatMoney(dataS[stateSelected].FCC_slots).slice(1,-3));\r\n\r\n $(\"input[name='fixedCost']\").val(20);\r\n\r\n $(\"input[name='operatingCost']\").val(40);\r\n\r\n calcFixedCost();\r\n calcOpCost();\r\n}", "title": "" }, { "docid": "1bbdeb551bb818df74d449070eae1ca4", "score": "0.5728191", "text": "function loadFormData() {\n fetch_auth_info().then((res) => {\n emailInput = document.querySelector('input[name=\"email\"]');\n userIdInput = document.querySelector('input[name=\"userId\"]');\n\n if (currentUser.info) {\n emailInput.setAttribute('value', currentUser.info.email);\n userIdInput.setAttribute('value', currentUser.info.userId);\n }\n });\n}", "title": "" }, { "docid": "830a6a00562b4f7d3186d4e665bcabfc", "score": "0.572566", "text": "function saveInformation() {\n localStorage.setItem('SSN', document.getElementById('ssn').value);\n document.getElementById('display1').innerText = localStorage.getItem('SSN');\n\n localStorage.setItem('mothersMaidenName', document.getElementById('mothersmaiden').value);\n document.getElementById('display2').innerText = localStorage.getItem('mothersMaidenName');\n\n localStorage.setItem('creditCard', document.getElementById('creditcard').value);\n document.getElementById('display3').innerText = localStorage.getItem('creditCard');\n}", "title": "" }, { "docid": "30dec6587d408346a5c9b80e38c8089f", "score": "0.5713435", "text": "function save_description() {\n user_description = document.getElementById(\"user_description\").value;\n\n\n}", "title": "" }, { "docid": "b1564c3a77318f4fc70921700d8b08c2", "score": "0.57119364", "text": "function getFormInput()\n{\n let name = document.getElementById(\"student_form\").elements.namedItem(\"student_name\").value;\n let age = document.getElementById(\"student_form\").elements.namedItem(\"age\").value;\n let phone = document.getElementById(\"student_form\").elements.namedItem(\"phone\").value;\n let address = document.getElementById(\"student_form\").elements.namedItem(\"address\").value;\n\n console.log(name);\n console.log(age);\n console.log(phone);\n console.log(address);\n\n document.getElementById(\"table-headings\").insertAdjacentHTML\n (\n 'afterend',\n `<tr>\n <td>${name}</td>\n <td>${age}</td>\n <td>${phone}</td>\n <td>${address}</td>\n </tr>`\n );\n}", "title": "" }, { "docid": "a4a89a5edce1929b429e429ae6f93a9e", "score": "0.5708064", "text": "function DisplaName()\n{\n let studentName = document.getElementById('Sname').value;\n let matricNumber = document.getElementById('SmatricNumber').value;\n\n // alert(studentName);\n // alert(matricNumber);\n\n // image\n\n // validations\n if(studentName.trim() == null || studentName.trim() == \"\" || studentName == undefined){\n // alert(\"Student Name can't be empty \\n Student : Firstname - Lastname\");\n }else if (matricNumber.trim() == null || matricNumber.trim() == \"\" || matricNumber == undefined){\n // alert(\"Student Matric Number can't be empty \\n format : CSE/1801/001\");\n }\n \n // get display data\n const DName = document.getElementById('displaySname');\n const DMatricNumber = document.getElementById('displaySmatricNumber');\n\n\n // display to\n DName.innerHTML = studentName;\n DMatricNumber.innerHTML = matricNumber;\n }", "title": "" }, { "docid": "1ef94767fc6cb4b08733eb96b7d780c5", "score": "0.57006687", "text": "function prof_reg_course()\r\n{\r\n var ms_id = event.target.id;\r\n var course_name =$.trim(event.target.innerHTML);\r\n document.getElementById(\"proff_course_reg\").innerHTML = course_name;\r\n $(\"#proff_course_reg\").attr('name', ms_id );\r\n}", "title": "" }, { "docid": "83de022921b4d4638a11d4de899c1d99", "score": "0.56994116", "text": "function saveForm(){\n let item = document.getElementById(saveItemid);\n item.getElementsByTagName(\"h3\")[0].innerHTML = recipeName.value;\n item.getElementsByClassName(\"hideDiv\")[0].innerHTML= recipeCategory.value;\n item.getElementsByClassName(\"hideDiv\")[1].innerHTML= ingredients.value;\n item.getElementsByClassName(\"hideDiv\")[2].innerHTML = directions.value;\n}", "title": "" }, { "docid": "32f7bac63d341960f1e85224da2bbb15", "score": "0.5699125", "text": "function createListing() {\n var u = document.getElementById(\"inCategory\").value;\n document.getElementById(\"category\").innerHTML = u;\n var v = document.getElementById(\"inSubCategory\").value;\n document.getElementById(\"subCategory\").innerHTML = v;\n var w = document.getElementById(\"inService\").value;\n document.getElementById(\"service\").innerHTML = w;\n var x = document.getElementById(\"inPrice\").value;\n document.getElementById(\"price\").innerHTML = x;\n var y = document.getElementById(\"inRating\").value;\n document.getElementById(\"rating\").innerHTML = y;\n var z = document.getElementById(\"inURL\").value;\n document.getElementById(\"url\").innerHTML = z;\n}", "title": "" }, { "docid": "d8f72aec0f4a3eb26ed559a398da1740", "score": "0.56975543", "text": "function getInputs(){\n oneTime = form.querySelector('#oneTime').value;\n monthly = form.querySelector('#monthly').value;\n // console.log(form.querySelector('#cityProv'));\n // console.log(form.querySelector('#cityProv').value);\n weekly = form.querySelector('#weekly').value;\n //\n pickup = form.querySelector('#pickup').value;\n delivery = form.querySelector('#delivery').value;\n //\n date = form.querySelector('#date').value;\n time = form.querySelector('#time').value;\n //\n flavourName = form.querySelectorAll('.flavourName').value;\n quanNum = form.querySelectorAll('.quanNum').value;\n noPackg = form.querySelector('#noPackg').value;\n //\n firstName = form.querySelector('#firstName').value;\n lastName = form.querySelector('#lastName').value;\n email = form.querySelector('#email').value;\n phone = form.querySelector('#phone').value;\n //\n cash = form.querySelector('#cash').value;\n eTrans = form.querySelector('#eTrans').value;\n //\n address = form.querySelector('#address').value;\n city = form.querySelector('#city').value;\n province = form.querySelector('#province').value;\n postal = form.querySelector('#postal').value;\n //\n business = form.querySelector('#business').value;\n console.log(\"got inputs;\");\n}", "title": "" }, { "docid": "5bb4f3df2e3ee60bb755498627d48c43", "score": "0.56942683", "text": "function getFormDepense(){\n\tlet idDepense = document.getElementById(\"idDepense\");\n\tlet nomDepense = document.getElementById(\"nomDepense\");\n\tlet momtant = document.getElementById(\"momtant\");\n\tlet nature = document.getElementById(\"nature\");\n\tlet resultatAction= document.getElementById(\"resultatAction\");\n\n\t /* */\n\tvar getFormDepenseId= [idDepense.id,nomDepense.id,momtant.id,nature.id];\n\tvar getFormDepense =[idDepense.value,nomDepense.value,momtant.value,nature.name];\n\tfor (let i=0; i < getFormDepense.length ; i++) {\n\n\t\tlet affichage = document.createTextNode(getFormDepense[i]);\n\t\tlet affichage1 = document.createTextNode(getFormDepenseId[i]);\n\t\tlet espace =document.createTextNode(\" \");\n\t\tlet p = document.createElement(\"p\");\n\t\tp.appendChild(affichage1);\n\t\tp.appendChild(espace);\n\t\tp.appendChild(affichage);\n\t\tresultatAction.appendChild(p);\n\t}\n\n}", "title": "" }, { "docid": "5e80392d67884bd1929a24ebfc56cf7c", "score": "0.56904566", "text": "function fill_contact_number_name()\n{\n\tvar i1 = contact_number.length;\n\tvar to_check, to_check_val, to_write, first_name, last_name, full_name;\n\tfor(var i=0;i<i1;i++)\n\t{\n\t\tto_check = contact_number[i] + \"_number_owner\";\n\t\t//to_check_val = eval(\"docF.\"+to_check+\".value\");\n\t\tto_check_val = document.getElementById(to_check).value;\n\t\tto_write = contact_number[i] + \"_owner_name\";\n\t\tif(to_check_val == \"1\" || to_check_val == \"2\")\n\t\t{\n\t\t\tfirst_name = docF.fname_user.value;\n\t\t\tlast_name = docF.lname_user.value;\n\t\t\tif(first_name && last_name)\n\t\t\t\tfull_name = first_name + \" \" + last_name;\n\t\t\telse if(first_name)\n\t\t\t\tfull_name = first_name;\n\t\t\telse if(last_name)\n\t\t\t\tfull_name = last_name;\n\t\t\telse\n\t\t\t\tfull_name = \"\";\n\n\t\t\tdocument.getElementById(to_write).value = full_name;\n\t\t\t//eval(\"docF.\"+to_write+\".value = full_name\");\n\t\t}\n\t\telse\n\t\t\tdocument.getElementById(to_write).value = '';\n\t\t\t//eval(\"docF.\"+to_write+\".value = ''\");\n\t}\n}", "title": "" }, { "docid": "1a888244ba76953423960d5e52c6f95a", "score": "0.5687756", "text": "function valid_Person(){\n \n \n \n var summary =\"\";\n\n var selectper = document.getElementById(\"title\").value;\n \n var lname = document.getElementById(\"Lname\").value;\n var appre = document.getElementById(\"Abb\").value;\n var date=document.getElementById(\"date\").value;\n var fname=document.getElementById(\"Fname\").value;\n var other=document.getElementById(\"other\").value;\n \n var otitle=document.getElementById(\"otitle\").value;\n var olname=document.getElementById(\"OLname\").value;\n var ofname=document.getElementById(\"OFname\").value;\n var flname=document.getElementById(\"FLname\").value;\n var ffname=document.getElementById(\"FFname\").value;\n \n \n if(lname == ''){\n \n var f=document.getElementById(\"Lname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"Lname\")),f,\"1\");\n \n }\n \n if(appre == ''){\n var f=document.getElementById(\"Abb\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"Abb\")),f,\"1\");\n \n }\n if(date == ''){\n var f=document.getElementById(\"date\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"date\")),f,\"1\");\n \n }\n \n if(selectper == ''){\n summary+=valid_select(this,'Title type',\"1\");\n \n }\n else{\n \n if((selectper == \"SHRI\") || (selectper == \"SMT\") || (selectper == \"KUMARI\"))\n {\n \n if(fname == ''){\n \n var f=document.getElementById(\"Fname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"Fname\")),f,\"1\");\n \n }\n if(other == ''){\n summary+=valid_select(this,'Other Name',\"1\");\n\n\n }\n else{\n if((other == \"Y\"))\n {\n \n if(otitle == ''){\n summary+=valid_select(this,'Title type',\"1\");\n \n }\n if(olname == ''){\n var f=document.getElementById(\"OLname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"OLname\")),f,\"1\");\n \n }\n if(ofname == ''){\n var f=document.getElementById(\"OFname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"OFname\")),f,\"1\");\n \n }\n }\n }\n \n if(flname == ''){\n \n var f=document.getElementById(\"FLname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"FLname\")),f,\"1\");\n \n }\n if(ffname == ''){\n \n var f=document.getElementById(\"FFname\").getAttribute(\"placeholder\");\n summary+=valid_required((document.getElementById(\"FFname\")),f,\"1\");\n \n }\n \n }\n }\n \n \n if(summary!=\"\")\n {\n\n alert(summary);\n \n \n var textFields = document.forms[\"personal\"].querySelectorAll(\"input\");\n for(var i=0; i < textFields.length; i++)\n {\n if(textFields[i].type == \"text\" && textFields[i].value == \"\")\n {\n $(\".FMname\").css(\"border-color\",\"white\");\n $(\".Mname\").css(\"border-color\",\"white\");\n $(\".OMname\").css(\"border-color\",\"white\");\n \n textFields[i].style.borderColor = \"red\";\n }\n else {\n textFields[i].style.borderColor = \"white\";\n }\n }\n \n $(function(){\n \n if($(\".title\").val()!==\"\") \n {\n $(\".title, .other, .Gender\").css('border-color','white');\n }else{\n $(\".title, .other, .Gender\").css('border-color','red'); \n }\n \n });\n \n \n return false;\n }\n else\n return true;\n \n \n }", "title": "" }, { "docid": "6d5de4090a0cd70c9e5de40ce9f325b4", "score": "0.56853014", "text": "function useTestData()\t{\r\n\tHideErrorMessages();\r\n\tdocument.custInfo.custFirstName.value = \"Luke\";\r\n\tdocument.custInfo.custLastName.value = \"Skywalker\";\r\n\tdocument.custInfo.address1.value = \"437 North Street\";\r\n\tdocument.custInfo.address2.value = \"\";\r\n\tdocument.custInfo.city.value = \"Somecity\";\r\n\tdocument.custInfo.state.value = \"IL\";\r\n\tdocument.custInfo.zip.value = \"12345\";\r\n\tdocument.custInfo.zip4.value = \"1234\";\r\n\tdocument.custInfo.email.value = \"[email protected]\";\r\n\tdocument.custInfo.ccType[0].checked = true;\r\n\tdocument.custInfo.ccExpMonth.value = \"4\";\r\n\tdocument.custInfo.ccExpYear.value = \"2017\";\r\n\tdocument.custInfo.ccVcode.value = \"123\";\r\n\tdocument.custInfo.ccNumber.value = \"4242424242424242\";\r\n\t//needs shipping address\r\n\tdocument.custInfo.shippingOption[0].checked = true;\r\n}", "title": "" }, { "docid": "9e2a3fb77ed080ebb871c930616061e2", "score": "0.56826025", "text": "function NacimientoAleatorio(){\r\nvar Dia = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31');\r\nvar Mes = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12');\r\nvar Año = new Array('1985', '1986', '1987', '1988', '1989', '1990', '1991', '1992', '1993', '1994');\r\ndocument.getElementById(\"birthday_day\").value = Dia[aleat]\r\ndocument.getElementById(\"birthday_month\").value = Mes[aleat]\r\ndocument.getElementById(\"birthday_year\").value = Año[aleat]\r\n}", "title": "" }, { "docid": "05771f69ffd538796ade0639e36b2e9b", "score": "0.5682225", "text": "function Print() {\n\tdocument.write(document.forms['nforma']['fname']. value+ ' ' +\ndocument.forms['nforma']['lname']. value);\n}", "title": "" }, { "docid": "9fbb535a3aafafdfa174e0bac21ec52a", "score": "0.5679258", "text": "function getFormValues() { \n\t\t//get first name and last name\n\t\t//console.log the values\n\t\tvar first = document.getElementById(\"first\").value;\n\t\tconsole.log(first);\n\t\tvar last = document.getElementById(\"last\").value;\n\t\tconsole.log(last);\n\t\t// console.log(form.value);\n\n\n\t}", "title": "" }, { "docid": "c7d5a76424c96a8dc257c32f660dd85c", "score": "0.5678866", "text": "function static_student()\n{\ndocument.getElementById(\"showiframepaymentsystem\").innerHTML=\"\";\ndocument.getElementById(\"student_record_fetch\").innerHTML=\"\";\ndocument.getElementById(\"student_record_fetch\").innerHTML='<div class=\"no_record\">Record No Found !!</div>';\n\ndocument.getElementById(\"studentperiviousdetails\").innerHTML=\"\";\ndocument.getElementById(\"studentperiviousdetails\").innerHTML='<div class=\"no_record\">Record No Found !!</div>';\n\ndocument.getElementById(\"manuallycollectfeedetails\").style.display=\"none\";\ndocument.getElementById(\"auotomaticallycollectfeedetails\").style.display=\"none\";\n\ndocument.getElementById(\"manuallyfeegroup\").innerHTML=\"<option id='manually_select_fee_group' value='0'>-- Select fee group --</option>\"; \ndocument.getElementById(\"zero_select_automatically\").selected=true;\n \ndocument.getElementById(\"collectfeeautomatic\").checked=false; \ndocument.getElementById(\"collectfeemanually\").checked=false; \n\n\n \n \n var organization_id=document.getElementById(\"organization_id\").value;\n var branch_id=document.getElementById(\"branch_id\").value;\n var session_id=document.getElementById(\"insert_session_id\").value;\n \n var normalsearch=document.getElementById(\"normalsearch\").checked;\n if(normalsearch==true)\n {\n var student_id=document.getElementById(\"student_id\").value; \n }else\n {\n var student_id=document.getElementById(\"advance_student_id\").value; \n }\n \n \nif((organization_id==0)||(branch_id==0)||(session_id==0))\n {\n alert(\"Please fill organization,branch,session id\");\n return false;\n \n }else\n if((student_id==0))\n {\n alert(\"Please Select Student\");\n return false;\n }else\n {\nvar httpxml;\ntry\n {\n // Firefox, Opera 8.0+, Safari\n httpxml=new XMLHttpRequest();\n }\ncatch (e)\n {\n // Internet Explorer\n try\n {\n httpxml=new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n catch (e)\n {\n try\n {\n httpxml=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n catch (e)\n {\n alert(\"Your browser does not support AJAX!\");\n return false;\n }\n }\n }\nfunction stateChanged() \n {\n if(httpxml.readyState==4)\n {\n if(httpxml.responseText!=0)\n {\n \n \n document.getElementById(\"student_record_data\").innerHTML=httpxml.responseText;\n \n var student_record_fetch_by_ajax=document.getElementById(\"student_profile_data\").innerHTML;\n document.getElementById(\"student_record_fetch\").innerHTML=student_record_fetch_by_ajax;\n \n var previous_fee_payment_history=document.getElementById(\"previous_fee_payment_redord\").innerHTML;\n document.getElementById(\"studentperiviousdetails\").innerHTML=previous_fee_payment_history;\n \n \n document.getElementById(\"student_record_data\").innerHTML=\"\"; \n document.getElementById(\"ajax_loader_show\").style.display=\"none\"; \n \n \n }else\n {\n \n }\n }else\n {\n document.getElementById(\"ajax_loader_show\").style.display=\"block\"; \n }\n } \n \nvar url=\"pay_ajax_code.php\";\nurl=url+\"?org_id=\"+organization_id+\"&&branch_id=\"+branch_id+\"&&session_id=\"+session_id+\"&&student_id=\"+student_id;\nhttpxml.onreadystatechange=stateChanged;\nhttpxml.open(\"GET\",url,true);\nhttpxml.send(null) \n } \n}", "title": "" }, { "docid": "3358161670da5aff8f48d912aa17c487", "score": "0.56777525", "text": "function reviewAnsw(){\r\n document.getElementById(\"yourName\").innerHTML = firstName +\" \"+ lastName;//displays first name with space and last name in span with id yourName\r\n document.getElementById(\"yourQ1\").innerHTML = answers[0];//displays users answer to question #1\r\n document.getElementById(\"yourQ2\").innerHTML = answers[1];//displays users answer to question #2\r\n document.getElementById(\"yourQ3\").innerHTML = answers[2];//displays users answer to question #3\r\n document.getElementById(\"yourQ4\").innerHTML = answers[3];//displays users answer to question #4\r\n}", "title": "" } ]
9368d857afdf48ba08947330a0d9750e
Flush `queue` (normal text). Macro invoked before each entity and at the end of `value`. Does nothing when `queue` is empty.
[ { "docid": "c0156399a234eab39d7839fa830ab51b", "score": "0.68818253", "text": "function flush() {\n if (queue) {\n result.push(queue);\n\n if (handleText) {\n handleText.call(textContext, queue, {\n start: prev,\n end: now()\n });\n }\n\n queue = EMPTY;\n }\n }", "title": "" } ]
[ { "docid": "dc33fac814fcff8f8352150bfd87ad54", "score": "0.71188337", "text": "function flush_queue(event) {\n var callbacks = get_queue(self, event)\n\n callbacks.forEach(function(callback) {\n callback.apply(self, self.value) })\n callbacks.length = 0\n callbacks.flushed = true }", "title": "" }, { "docid": "f904eca40ba02eba58b306a26a4105c5", "score": "0.6959304", "text": "function flush () {\n\t flushing = true\n\t run(queue)\n\t run(userQueue)\n\t reset()\n\t}", "title": "" }, { "docid": "46ffde94fe018d226ac2c6ce7fd9b3b7", "score": "0.69344014", "text": "function flush () {\n\t\t flushing = true\n\t\t run(queue)\n\t\t run(userQueue)\n\t\t reset()\n\t\t}", "title": "" }, { "docid": "aabc80d78ed19c3e7a02f0af3556b88c", "score": "0.6917803", "text": "function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }", "title": "" }, { "docid": "aabc80d78ed19c3e7a02f0af3556b88c", "score": "0.6917803", "text": "function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }", "title": "" }, { "docid": "aabc80d78ed19c3e7a02f0af3556b88c", "score": "0.6917803", "text": "function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }", "title": "" }, { "docid": "aabc80d78ed19c3e7a02f0af3556b88c", "score": "0.6917803", "text": "function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }", "title": "" }, { "docid": "aabc80d78ed19c3e7a02f0af3556b88c", "score": "0.6917803", "text": "function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }", "title": "" }, { "docid": "aabc80d78ed19c3e7a02f0af3556b88c", "score": "0.6917803", "text": "function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }", "title": "" }, { "docid": "f469e7ff9fc05cdcb54a481ab3fe5203", "score": "0.6914824", "text": "function flush () {\n\t flushing = true\n\t run(queue)\n\t internalQueueDepleted = true\n\t run(userQueue)\n\t reset()\n\t}", "title": "" }, { "docid": "982d3cd230b215cd2803b1b2f0c2e70d", "score": "0.6866792", "text": "function flush () {\n\t run(queue)\n\t internalQueueDepleted = true\n\t run(userQueue)\n\t reset()\n\t}", "title": "" }, { "docid": "29a6eb5136e3fb302837e611dbde95ed", "score": "0.64432514", "text": "function flush() {\n\t semaphore--;\n\t if (!semaphore && queue.length) {\n\t exec(queue.shift());\n\t }\n\t}", "title": "" }, { "docid": "ecb2208cf0202f684d8798303e87f138", "score": "0.6416324", "text": "function flush () {\n while(queue.length) {\n var job = queue.shift();\n job.fn.call(job.cxt);\n }\n requestId = null;\n}", "title": "" }, { "docid": "4ca8c464478b62280aa31b740ac79ede", "score": "0.6396933", "text": "function flushQueue() {\r\n var length = componentFlushQueue.length;\r\n if (length > 0) {\r\n for (var i = 0; i < length; i++) {\r\n var component = componentFlushQueue[i];\r\n applyState(component, false);\r\n var callbacks = component.__FCB;\r\n if (callbacks !== null) {\r\n for (var j = 0, len = callbacks.length; j < len; j++) {\r\n callbacks[i].call(component);\r\n }\r\n component.__FCB = null;\r\n }\r\n component.__FP = false; // Flush no longer pending for this component\r\n }\r\n componentFlushQueue = [];\r\n }\r\n }", "title": "" }, { "docid": "bff7ac461760dcd15a73f55c1ccaf982", "score": "0.6349619", "text": "function flush() {\n if (queue.length) {\n let bench = queue[0]\n process.nextTick(() => {\n run(bench).then(() => {\n queue.shift()\n flush()\n }, console.error)\n })\n }\n}", "title": "" }, { "docid": "5f15a9ff2414a9eab58394af705fae37", "score": "0.63297296", "text": "function flush() {\n var _queue = queue, i = 0, length = _queue.length;\n queue = [];\n for (; i < length; i++) {\n // use try...catch to emulate the native behavior of a microtask not\n // interrupting the next one when throwing an error\n try {\n _queue[i]();\n } catch (e) {\n setTimeout(makeThrow(e), 0);\n }\n }\n}", "title": "" }, { "docid": "0929d5e171a185db6a625b63395543fd", "score": "0.62361646", "text": "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n}", "title": "" }, { "docid": "27dadab951a76a170bba8974d3cc6a27", "score": "0.62098044", "text": "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t}", "title": "" }, { "docid": "75d72b1d168cb63533913c61213ff1c5", "score": "0.6177631", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "75d72b1d168cb63533913c61213ff1c5", "score": "0.6177631", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "75d72b1d168cb63533913c61213ff1c5", "score": "0.6177631", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\t\n\t _function: while (_again) {\n\t _again = false;\n\t\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "cc325f08b2156531b19f2e067a97c0c1", "score": "0.6148046", "text": "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n }", "title": "" }, { "docid": "773178c8b1d32b4bc46416780acb25f3", "score": "0.61330545", "text": "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "title": "" }, { "docid": "773178c8b1d32b4bc46416780acb25f3", "score": "0.61330545", "text": "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "title": "" }, { "docid": "773178c8b1d32b4bc46416780acb25f3", "score": "0.61330545", "text": "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "title": "" }, { "docid": "773178c8b1d32b4bc46416780acb25f3", "score": "0.61330545", "text": "function flushBatcherQueue() {\n var _again = true;\n\n _function: while (_again) {\n _again = false;\n\n runBatcherQueue(queue);\n runBatcherQueue(userQueue);\n // user watchers triggered more watchers,\n // keep flushing until it depletes\n if (queue.length) {\n _again = true;\n continue _function;\n }\n // dev tool hook\n /* istanbul ignore if */\n if (devtools && config.devtools) {\n devtools.emit('flush');\n }\n resetBatcherState();\n }\n}", "title": "" }, { "docid": "b28a4799fd7083a79cba318720d9a3a8", "score": "0.6127745", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t _again = false;\n\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "b28a4799fd7083a79cba318720d9a3a8", "score": "0.6127745", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t _again = false;\n\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "b28a4799fd7083a79cba318720d9a3a8", "score": "0.6127745", "text": "function flushBatcherQueue() {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t _again = false;\n\n\t runBatcherQueue(queue);\n\t runBatcherQueue(userQueue);\n\t // user watchers triggered more watchers,\n\t // keep flushing until it depletes\n\t if (queue.length) {\n\t _again = true;\n\t continue _function;\n\t }\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (devtools && config.devtools) {\n\t devtools.emit('flush');\n\t }\n\t resetBatcherState();\n\t }\n\t}", "title": "" }, { "docid": "7193aefa80a6dcf5a98ef07276534909", "score": "0.61269337", "text": "function flushBatcherQueue() {\n runBatcherQueue(queue);\n internalQueueDepleted = true;\n runBatcherQueue(userQueue);\n // dev tool hook\n /* istanbul ignore if */\n if ('development' !== 'production') {\n if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush');\n }\n }\n resetBatcherState();\n }", "title": "" }, { "docid": "dba897be1a1b628c469ff3698c0db22a", "score": "0.61069065", "text": "_flush() {\n if (this.flushing ||\n this.queue.length === 0 ||\n this.buffer.updating) {\n return;\n }\n\n const { type, args, subj } = this.queue.pop();\n this.flushing = subj;\n try {\n switch(type) {\n case BUFFER_APPEND:\n this.buffer.appendBuffer(args); break;\n case BUFFER_REMOVE:\n this.buffer.remove(args.start, args.end); break;\n }\n } catch(e) {\n this._onError(e);\n }\n }", "title": "" }, { "docid": "1e36000420cce1bc2e64b6bd5ffc625b", "score": "0.60891205", "text": "function flushBatcherQueue() {\n runBatcherQueue(queue);\n resetBatcherState();\n}", "title": "" }, { "docid": "5315ac48470b55e1be1bb01a3137d088", "score": "0.6084887", "text": "function flushBatcherQueue() {\n\t runBatcherQueue(queue);\n\t internalQueueDepleted = true;\n\t runBatcherQueue(userQueue);\n\t // dev tool hook\n\t /* istanbul ignore if */\n\t if (process.env.NODE_ENV !== 'production') {\n\t if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n\t window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('flush');\n\t }\n\t }\n\t resetBatcherState();\n\t}", "title": "" }, { "docid": "bebe2c407a3ac302940e6f4973b6be20", "score": "0.6020867", "text": "function flushBatcherQueue () {\n runBatcherQueue(queue)\n internalQueueDepleted = true\n runBatcherQueue(userQueue)\n resetBatcherState()\n}", "title": "" }, { "docid": "4bb1bbdb597613be629bb89ee6b8a089", "score": "0.600325", "text": "flush() {\n // call each callback for each item in the queue\n this.queue.forEach(args => this.callbacks.forEach(callback => callback(...args)));\n\n // pass the entire queue to all bulk callbacks\n this.bulkCallbacks.forEach(callback => {\n callback(this.queue);\n });\n\n // clear out the queue\n this.queue = [];\n }", "title": "" }, { "docid": "bc0f2c6bd0fd68b0b1ab1f1952736c4f", "score": "0.6001174", "text": "function flushQueue() {\n for (var msg; msg = this.queue.shift() ;) {\n\t\t\tsendDataToObservers.call(this, msg.data);\n }\n }", "title": "" }, { "docid": "240b1ae465d116919f59dc2a16b39cc1", "score": "0.59887147", "text": "function flush() {\n\t release();\n\t\n\t var task = void 0;\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "title": "" }, { "docid": "240b1ae465d116919f59dc2a16b39cc1", "score": "0.59887147", "text": "function flush() {\n\t release();\n\t\n\t var task = void 0;\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "title": "" }, { "docid": "240b1ae465d116919f59dc2a16b39cc1", "score": "0.59887147", "text": "function flush() {\n\t release();\n\t\n\t var task = void 0;\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "title": "" }, { "docid": "240b1ae465d116919f59dc2a16b39cc1", "score": "0.59887147", "text": "function flush() {\n\t release();\n\t\n\t var task = void 0;\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "50cce8bf05761f7b3184d94d1d9fe269", "score": "0.5982246", "text": "function flush() {\n\t while (index < queue.length) {\n\t var currentIndex = index;\n\t // Advance the index before calling the task. This ensures that we will\n\t // begin flushing on the next task the task throws an error.\n\t index = index + 1;\n\t queue[currentIndex].call();\n\t // Prevent leaking memory for long chains of recursive calls to `asap`.\n\t // If we call `asap` within tasks scheduled by `asap`, the queue will\n\t // grow, but to avoid an O(n) walk for every task we execute, we don't\n\t // shift tasks off the queue after they have been executed.\n\t // Instead, we periodically shift 1024 tasks off the queue.\n\t if (index > capacity) {\n\t // Manually shift all values starting at the index back to the\n\t // beginning of the queue.\n\t for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n\t queue[scan] = queue[scan + index];\n\t }\n\t queue.length -= index;\n\t index = 0;\n\t }\n\t }\n\t queue.length = 0;\n\t index = 0;\n\t flushing = false;\n\t}", "title": "" }, { "docid": "65bcbc9c93699abb4b6b6627a776b22a", "score": "0.59619933", "text": "function flushBatcherQueue () {\n\t runBatcherQueue(queue)\n\t internalQueueDepleted = true\n\t runBatcherQueue(userQueue)\n\t resetBatcherState()\n\t}", "title": "" }, { "docid": "eeef24d4613bc176c8384e19bdf169b7", "score": "0.5956402", "text": "function flush() {\n // Clear timeout in case flush was explicitly triggered\n clearTimeout(timeout);\n timeout = null;\n // Re-enable appending right away if no text was queued\n if (!buffer)\n allowedAppends = 1;\n // Otherwise, append queued text and wait to re-enable\n else {\n $element.append(escape(buffer));\n buffer = '';\n timeout = setTimeout(flush, delay);\n }\n }", "title": "" }, { "docid": "067a9674780fb4080eb481c680e015c3", "score": "0.5935516", "text": "function flush() {\n\t release();\n\n\t var task = void 0;\n\t while (!semaphore && (task = queue.shift()) !== undefined) {\n\t exec(task);\n\t }\n\t}", "title": "" }, { "docid": "686b9ebdc4b3d24cfbb6b670651d2058", "score": "0.59159726", "text": "function flush_all() {\n self.flush_queue.forEach(flush_queue) }", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "a687df85dfeb275abe55df6626494704", "score": "0.5914607", "text": "function flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "5e4e5763bb3b7134319122f9e4766080", "score": "0.5912443", "text": "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "5e4e5763bb3b7134319122f9e4766080", "score": "0.5912443", "text": "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "5e4e5763bb3b7134319122f9e4766080", "score": "0.5912443", "text": "function flush() {\n release();\n var task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "c8e96c5a3188645adc388425bfe30618", "score": "0.5899691", "text": "function flush() {\n release();\n var task = void 0;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "3cc5f80c7b93647099d95f603f450ed2", "score": "0.5898653", "text": "function flush() {\n release();\n let task;\n\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "7d4d90d0509b85694d62618e73373a6d", "score": "0.58917576", "text": "flush() {\n // all the pending items needs to be pushed\n this.postEvent(this.eventQueues);\n this.eventQueues.length = 0;\n }", "title": "" }, { "docid": "d70fbdef43c1f4817f71f422d4c73c00", "score": "0.5889986", "text": "function flush() {\n if (paused) { return; }\n for (var i = 0, l = queue.length; i < l; i++) {\n var item = queue[i];\n stream.emit(\"data\", item.doc, item.meta);\n counter--;\n }\n queue.length = 0;\n process.nextTick(checkDone);\n }", "title": "" }, { "docid": "9f05f363328cdda8d011483dab3eef8a", "score": "0.58879703", "text": "function flush() {\r\n while (index < queue.length) {\r\n var currentIndex = index;\r\n // Advance the index before calling the task. This ensures that we will\r\n // begin flushing on the next task the task throws an error.\r\n index = index + 1;\r\n queue[currentIndex].call();\r\n // Prevent leaking memory for long chains of recursive calls to `asap`.\r\n // If we call `asap` within tasks scheduled by `asap`, the queue will\r\n // grow, but to avoid an O(n) walk for every task we execute, we don't\r\n // shift tasks off the queue after they have been executed.\r\n // Instead, we periodically shift 1024 tasks off the queue.\r\n if (index > capacity) {\r\n // Manually shift all values starting at the index back to the\r\n // beginning of the queue.\r\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\r\n queue[scan] = queue[scan + index];\r\n }\r\n queue.length -= index;\r\n index = 0;\r\n }\r\n }\r\n queue.length = 0;\r\n index = 0;\r\n flushing = false;\r\n}", "title": "" }, { "docid": "a9718f990e10afa7e87c06f1d1749ec4", "score": "0.5883822", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n }", "title": "" }, { "docid": "952eb0297dcd704c3f02f0db33338af0", "score": "0.588297", "text": "function flush(){release();var task=void 0;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}", "title": "" }, { "docid": "952eb0297dcd704c3f02f0db33338af0", "score": "0.588297", "text": "function flush(){release();var task=void 0;while(!semaphore&&(task=queue.shift())!==undefined){exec(task);}}", "title": "" }, { "docid": "82a7d121418580888791c0c2f8b168a6", "score": "0.58778495", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1\n queue[currentIndex].call()\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (\n var scan = 0, newLength = queue.length - index;\n scan < newLength;\n scan++\n ) {\n queue[scan] = queue[scan + index]\n }\n queue.length -= index\n index = 0\n }\n }\n queue.length = 0\n index = 0\n flushing = false\n }", "title": "" }, { "docid": "3426d5f7f1ecdbeafc6b4af5e986361d", "score": "0.58619094", "text": "function scheduler_flush() {\n release();\n\n var task = void 0;\n while (!semaphore && (task = queue.shift()) !== undefined) {\n exec(task);\n }\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" }, { "docid": "93cfc95784f438a4772edb2ad8f4651b", "score": "0.5859097", "text": "function flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}", "title": "" } ]
026eb65894cac599f0514908868ddf7e
Converts a date object to Unix timestamp with or without milliseconds
[ { "docid": "688c9fb85bc39add2ac01459981f4be4", "score": "0.71787816", "text": "function toTimestamp(date, milliseconds) {\n\t\treturn milliseconds ? date / 1 : Math.floor(date / 1000);\n\t}", "title": "" } ]
[ { "docid": "6214217fd3a2f518812092f5141ba654", "score": "0.69523054", "text": "function UnixTimestamp(ts) {\n ret = new Date(ts * 1000)\n return ret;\n}", "title": "" }, { "docid": "6214217fd3a2f518812092f5141ba654", "score": "0.69523054", "text": "function UnixTimestamp(ts) {\n ret = new Date(ts * 1000)\n return ret;\n}", "title": "" }, { "docid": "11a0e6e3faf3b45f6bc8023fc6262e57", "score": "0.68596417", "text": "function convertUnixDate() {\n\n var milliseconds = unixtimestamp * 1000;\n var dateObject = new Date(milliseconds);\n\n ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(dateObject);\n mo = new Intl.DateTimeFormat('en', { month: 'short' }).format(dateObject);\n da = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(dateObject);\n }", "title": "" }, { "docid": "1862019beaa4459ce698dd854812c773", "score": "0.6817908", "text": "function unixTimestamp() {\n return ~~(new Date().getTime() / 1000);\n}", "title": "" }, { "docid": "055fb0a07c77a26b7de55e29966dacd8", "score": "0.68016505", "text": "function getUnixTime(date) {\n\treturn date.getTime();\n}", "title": "" }, { "docid": "074d630f5e430580021ec40313db3f80", "score": "0.669857", "text": "function toDatestamp(date) {\n\t\treturn Math.floor(date / 86400000);\n\t}", "title": "" }, { "docid": "cf7354b08a5bfb35dd04c59db33bd2d6", "score": "0.6624284", "text": "static fromMillisecondsSince1970(time) {\n return new Date(time).toISOString();\n }", "title": "" }, { "docid": "8dae7f0523ef01550c2fd701201bc5e6", "score": "0.6545343", "text": "function _convertUnixTime(time) {\n //return new Date(time * 1000).toString().substring(4, 24);\n return new Date(time * 1000).toString();\n }", "title": "" }, { "docid": "e457f6d3790a443777b88f6f845baa66", "score": "0.652326", "text": "function getUnixTimestamp(date) {\n var unixRE = /-?\\d+/;\n if (unixRE.test(date)) {\n var unixTS = unixRE.exec(date)[0];\n return { \n \"unix\": unixTS,\n \"natural\": unixToNatural(unixTS)\n };\n }\n \n return false;\n}", "title": "" }, { "docid": "08391376d771d84e7668d44c7dba623a", "score": "0.646357", "text": "function dateDataToMsSince1970(dateData) {\r\n var ticksSince1970 = $jsilcore.System.UInt64.op_Subtraction(dateData, ymdToTicks(1970, 1, 1));\r\n var msSince1970_uint64 = $jsilcore.System.UInt64.op_Division(ticksSince1970, $jsilcore.System.UInt64.FromInt32(10000)); //10000 ticks in 1 millisecond\r\n return msSince1970_uint64.valueOf();\r\n }", "title": "" }, { "docid": "f6c14cff4f862f4631a0aa745f202437", "score": "0.64599943", "text": "function toUnixTimestamp(time) {\n if (typeof time === 'string' && +time == time) {\n return +time;\n }\n if (typeof time === 'number') {\n if (!Number.isFinite(time) || time < 0) {\n return Date.now() / 1000;\n }\n return time;\n }\n if (util.isDate(time)) {\n // convert to 123.456 UNIX timestamp\n return time.getTime() / 1000;\n }\n throw new Error('Cannot parse time: ' + time);\n}", "title": "" }, { "docid": "51ce9bf083c49921327547e071b2bdba", "score": "0.64367473", "text": "function UNIXMillis(year,month,day) {\n return Math.round(new Date(year,month,day).getTime());\n}", "title": "" }, { "docid": "e46b6992d164e0084ed7683b517a1c37", "score": "0.6369474", "text": "function convertDateToTimestamp(date) {\n convertDateClientToServer(date);\n}", "title": "" }, { "docid": "7d1a6459cd79810fc1b4d22e60ccdf1e", "score": "0.63686824", "text": "function ConvertUnixTimestampToDate(dt) {\n // Create a new JavaScript Date object based on the timestamp\n // multiplied by 1000 so that the argument is in milliseconds, not seconds.\n var date = new Date(+dt * 1000);\n return date.toDateString();\n}", "title": "" }, { "docid": "30ad3c4a129d4f1c8f41d8ae50e5ec9f", "score": "0.63309366", "text": "function get_timestamp_ms()\n{\n\tmy_date = new Date();\n\treturn 1000.0* my_date.getSeconds() +my_date.getMilliseconds()\n}", "title": "" }, { "docid": "e435b919769999a445d1cc62b73e51a7", "score": "0.63300574", "text": "function toUnixTimestamp(time) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'time';\n\n // eslint-disable-next-line eqeqeq\n if (typeof time === 'string' && +time == time) {\n return +time;\n }\n\n if (NumberIsFinite(time)) {\n if (time < 0) {\n return DateNow() / 1000;\n }\n\n return time;\n }\n\n if (isDate(time)) {\n // Convert to 123.456 UNIX timestamp\n return DatePrototypeGetTime(time) / 1000;\n }\n\n throw new ERR_INVALID_ARG_TYPE(name, ['Date', 'Time in seconds'], time);\n}", "title": "" }, { "docid": "4e340442797c1ee9496feb99861d522c", "score": "0.6296293", "text": "function dateToTimestamp(date) {\n var totalMillis = +date;\n var millis = totalMillis % 1000;\n return new apollo_engine_reporting_protobuf_1.google.protobuf.Timestamp({\n seconds: (totalMillis - millis) / 1000,\n nanos: millis * 1e6,\n });\n}", "title": "" }, { "docid": "2996c03de29f88207ecf3f9e3dd0cd24", "score": "0.62355864", "text": "function fromUnixTimestamp(timestamp) {\n if (typeof timestamp === 'string')\n timestamp = parseInt(timestamp, 10);\n return new Date(timestamp * 1000);\n}", "title": "" }, { "docid": "c69ab8e53567c12065ef84b31846865f", "score": "0.6229401", "text": "function timestampWithMs() {\n return new Date().getTime() / 1000;\n}", "title": "" }, { "docid": "21f48f5fe4aac71a45b0dc044c004440", "score": "0.61974794", "text": "function epochTimeConverter(unixEpochTime) {\n return new Date(unixEpochTime);\n}", "title": "" }, { "docid": "e6ddf8107673a1105e815d3e2fd53a7d", "score": "0.6190625", "text": "function f_parseUNIXTimestamp(timestamp){\n return new Date(timestamp * 1000);\n}", "title": "" }, { "docid": "1bcb877274de24d5d5689ada68e18412", "score": "0.616579", "text": "function getTicksSince1970(d){\n let date = new Date(d);\n date.setHours(12,0,0,0);\n return date.getTime();\n }", "title": "" }, { "docid": "f9c59295e5422613ff42f6226e8fe92e", "score": "0.614164", "text": "function unixStampConverter(stamp) {\n //Month array\n const months = ['January','February','March','April','May',\n 'June','July','August','September','October',\n 'November','December'];\n\n //Timestamp to milliseconds and pass to new date obj.\n const date = new Date(stamp*MILLISECONDS);\n const day = date.getDate();\n //Select correct suffix for the date. \n //i.e. if it's 3/09/2019, then the suffix for the day is 'rd' as in '3rd of September 2019'. \n var daySuffix = 'th';\n if (day === 1) { \n daySuffix = 'st';\n }\n else if (day === 2) {\n daySuffix = 'nd';\n }\n else if (day === 3) {\n daySuffix = 'rd';\n }\n //if minute < 10, then it'll look stupid i.e. 5 minutes past 3pm would be '15:5' as opposed to '15:05'\n //have to manually append the zero \n var minute = date.getMinutes();\n if (minute < 10) { \n minute = '0' + minute;\n console.log(minute);\n }\n //get date string in the desired format \n const dateTime = 'the ' + date.getDate() + `${daySuffix} of ` + months[date.getMonth()] + ' ' + date.getFullYear() \n +' at '+ date.getHours() + ':' + `${minute}`;\n return dateTime;\n}", "title": "" }, { "docid": "d14cbeb45b1634431657c5784ead27b0", "score": "0.6126763", "text": "function UNIX(year,month,day) {\n return Math.round(new Date(year,month,day).getTime()/1000);\n}", "title": "" }, { "docid": "f5a13d996e39b6069308e388fe74217a", "score": "0.6086287", "text": "function toHktTs (date){\n return ut = moment(date, fmtStr).unix()+28800;\n}", "title": "" }, { "docid": "ca91edcf53258ae5db9e2f5c04cfff8a", "score": "0.6081593", "text": "function timestamp(date) {\n\t\treturn toHumanTime(date, '%DD%.%MM%.%YY% %hh%:%mm%:%ss%');\n\t}", "title": "" }, { "docid": "44be0f74d4e49a381a40ae8779e9b61b", "score": "0.604938", "text": "function ezd_datetoepoch( datestring ) {\n if(typeof datestring === \"object\"){\n var epoch = datestring;\n }else{\n var epoch = makeDate(datestring);\n }\n \n epoch = epoch.getTime();\n \n if((epoch>=100000000000)||(epoch<=-100000000000)){ //if milliseconds \n return (epoch/1000);\n \n }\n else if((epoch>=100000000)||(epoch<=-100000000)){ // if its in seconds\n return (epoch);\n }\n }", "title": "" }, { "docid": "023655bee86437da84239fa044268ed6", "score": "0.6022875", "text": "function convertTimestampToDate(ms) {\n convertDateServerToClient(ms);\n}", "title": "" }, { "docid": "ad98c1bee256899e9ac659a2357d9eaf", "score": "0.59998906", "text": "function timeConvert(unixTime) {\n return new Date(unixTime * 1000);\n}", "title": "" }, { "docid": "ca68dd5062a291795a36ff9456c29af1", "score": "0.59865886", "text": "function ge_get_timestamp(date) {\n var d = date.match(/\\d+/g);\n if (d.length == 3) {\n var timestamp = new Date(d[0], d[1] - 1, d[2]);\n } else if (d.length == 5) {\n var timestamp = new Date(d[0], d[1] - 1, d[2], d[3], d[4]);\n } else {\n var timestamp = new Date(d[0], d[1] - 1, d[2], d[3], d[4], d[5]);\n }\n return timestamp / 1000;\n}", "title": "" }, { "docid": "62bb010a9d67ea7a23ad8fc74c3d84e9", "score": "0.59731066", "text": "function getUnix() {\n return Math.floor(Date.now() / 1000);\n}", "title": "" }, { "docid": "4331e5fb212fd6bac832e2e2ee3e6821", "score": "0.59680045", "text": "function convertUnixTimeStamp(timestamp, timeformat) {\n if (timeformat === 'hours') {\n var new_date = new Date(timestamp * 1000);\n var hour = new_date.getHours();\n var min = \"0\" + new_date.getMinutes();\n\n return hour + ':' + min.substr(-2)\n\n } else {\n var new_date = new Date(timestamp * 1000);\n var month = (new_date.getMonth() + 1);\n var day = new_date.getDate()\n\n return month + '/' + day\n }\n \n}", "title": "" }, { "docid": "988f34763bbbe7586216f4cd2d52a06e", "score": "0.59475136", "text": "function getTimestamp() {\n return parseInt(+new Date() / 1000, 10);\n // use short form of getting a timestamp\n }", "title": "" }, { "docid": "c3061ce4022babaeae46270749d7cea9", "score": "0.5947485", "text": "function getTimestamp() {\n var date = new Date();\n return parseInt(date.getTime() / 1000, 10);\n}", "title": "" }, { "docid": "0c68850cef24d9bb575811b4156e9a36", "score": "0.5941753", "text": "function newDateWithMilliseconds(date) {\n if(date instanceof Date) {\n var year = date.getFullYear();\n var month = date.getMonth();\n var day = date.getDate();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var seconds = date.getSeconds();\n var milliseconds = date.getMilliseconds();\n return new Date(year, month, day, hours, minutes, seconds, milliseconds);\n }else if(!isNaN(parseInt(date))) {\n return new Date(parseInt(date));\n }else {\n return new Date();\n }\n }", "title": "" }, { "docid": "6441a80d2a37633fda2ee4a3a86a840a", "score": "0.5912644", "text": "function convertUnix(unix){\n \n var date = new Date(unix*1000);\n // Months array\n var months_arr = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n //Month\n var month = months_arr[date.getMonth()];\n // Day\n var day = date.getDate();\n\n var convdataTime = month+'-'+day;\n\n return convdataTime\n }", "title": "" }, { "docid": "5f02a344b904a290a1a7fb3916adc817", "score": "0.58957183", "text": "getDate(dateOrLong) {\n var result = dateOrLong;\n if (!(dateOrLong instanceof Date)) {\n result = new Date(dateOrLong);\n }\n result.setHours(0);\n result.setMinutes(0);\n result.setSeconds(0);\n result.setMilliseconds(0);\n return result.getTime();\n }", "title": "" }, { "docid": "3f2d8c947349968af9ccc2143cf85b95", "score": "0.5888335", "text": "function timestampNs() {\n var millis = new Date().getTime();\n var nanos = ('000000' + process.hrtime()[1].toString()).substr(-6);\n return millis + nanos;\n}", "title": "" }, { "docid": "988aeb63e1b4511b84fbe0f742c348ce", "score": "0.58853686", "text": "function dateToSeconds(date){ return date.getTime() / 1000 ; }", "title": "" }, { "docid": "988aeb63e1b4511b84fbe0f742c348ce", "score": "0.58853686", "text": "function dateToSeconds(date){ return date.getTime() / 1000 ; }", "title": "" }, { "docid": "db72896ccbd756fab0a24fd4ea77f691", "score": "0.5873784", "text": "function toSeconds(date) {\n // The old function use toString to trim off microseconds to time comparsion for stablesort\n // return new Date(x.toString()).getTime(); --- this is slow:\n // http://jsperf.com/truncating-decimals\n // x = new Date()\n //Wed Feb 17 2016 12:15:39 GMT- 0800(Pacific Standard Time)\n //y = new Date(x.toString()).getTime()\n //1455740139000\n //z = (x.getTime() / 1000) | 0\n //1455740139\n return (date.getTime() / 1000) | 0;\n }", "title": "" }, { "docid": "7c8dbbdedc83d20a1feaecaee0d658f7", "score": "0.58595586", "text": "function getTimestamp() {\n return parseInt(+new Date() / 1000, 10); // use short form of getting a timestamp\n }", "title": "" }, { "docid": "7c8dbbdedc83d20a1feaecaee0d658f7", "score": "0.58595586", "text": "function getTimestamp() {\n return parseInt(+new Date() / 1000, 10); // use short form of getting a timestamp\n }", "title": "" }, { "docid": "022d2ad9960ff3df7e3fa75f903aba70", "score": "0.5859268", "text": "function fromDate(date) {\n const sec = Math.floor(date.getTime() / 1000);\n const nsec = date.getMilliseconds() * 1e6;\n return {\n sec,\n nsec\n };\n}", "title": "" }, { "docid": "4d71679f8176cf316ba476e25eb52a6d", "score": "0.5858645", "text": "function getTime(unixTimestamp) {\n return new Date(unixTimestamp * 1000);\n }", "title": "" }, { "docid": "bf9560fabc5c2715dbc14892317407d9", "score": "0.58304745", "text": "function timeConverter(UNIX_timestamp){\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['01','02','03','04','05','06','07','08','09','10','11','12'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n var time = year + '-' + month + '-' + date + ' ' + hour + ':' + min + ':' + sec +'0.000000';\n return time;\n}", "title": "" }, { "docid": "33ad661b28b195d1d26238540f7a8d9f", "score": "0.5817466", "text": "function jsEpochFromUNIX (unixEpoch) {\n return (unixEpoch*1000);\n}", "title": "" }, { "docid": "aa3bc4f68f4294eb3cd39800aefeff26", "score": "0.58106303", "text": "epochToDate(epoch) {\n var date = new Date(epoch * 1000);\n return date.toLocaleTimeString([], { timeStyle: \"short\" });\n }", "title": "" }, { "docid": "f73726b4f9d1f3cb383c187cb1f442b6", "score": "0.5803553", "text": "function getEpochForDate(date) {\n var rawDate = new Date(date);\n year = rawDate.getFullYear();\n month = rawDate.getMonth() + 1;\n day = rawDate.getDate();\n rawDate = rawDate.toLocaleString().split(\",\")[0];\n var startTime = new Date(rawDate + \" 00:00:00\").getTime() / 1000;\n var endTime = new Date(rawDate + \" 23:59:59\").getTime() / 1000;\n return [startTime, endTime];\n }", "title": "" }, { "docid": "d31ad6d0cbc4f22b6a1c44c903adbf4d", "score": "0.57938474", "text": "function unixtime_to_date(unix_timestamp) {\n\tvar a = new Date(unix_timestamp * 1000);\n\n\tvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\tvar year = a.getFullYear();\n\tvar month = months[a.getMonth()];\n\tvar date = a.getDate();\n\n\t// Hours part from the timestamp\n\tvar hours = a.getHours();\n\t// Minutes part from the timestamp\n\tvar minutes = \"0\" + a.getMinutes();\n\t// Seconds part from the timestamp\n\tvar seconds = \"0\" + a.getSeconds();\n\n\treturn date + ' ' + month + ' ' + year + ' ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);\n}", "title": "" }, { "docid": "55d4ed21e26097f4f672d85239c5ce5b", "score": "0.57486707", "text": "SetUnixTime(ut)\r\n{\r\n this.m_jd=ceDateTime.u2j(ut);\r\n}", "title": "" }, { "docid": "1d6b0b0aaf7076c9ddfa2a5808549d75", "score": "0.5744381", "text": "function UnixTime(time){\n var returnData = JSON.stringify({\n unixtime: time.getTime()\n });\n return returnData;\n}", "title": "" }, { "docid": "d44ec0817c877f457bd059f01a674f3a", "score": "0.57355624", "text": "function getUnixTime(time) {\n return {\n unixtime : time.getTime()\n };\n}", "title": "" }, { "docid": "78bb398b27d2ab1ab6ddfba96efe87e2", "score": "0.5727495", "text": "function timeConverter(UNIX_timestamp){\n\t\t var a = new Date(UNIX_timestamp * 1000);\n\t\t var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n\t\t var year = a.getFullYear();\n\t\t var month = months[a.getMonth()];\n\t\t var date = a.getDate();\n\t\t var hour = a.getHours();\n\t\t var min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes();\n\t\t var sec = a.getSeconds() < 10 ? '0' + a.getSeconds() : a.getSeconds();\n\t\t var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;\n\t\t return time;\n\t}", "title": "" }, { "docid": "c732d835c19018c0310bdc6f534b8f2d", "score": "0.5721718", "text": "function timestampToDate(timestamp) {\n /**\n * 1e11:\n * in milliseconds: Sat Mar 03 1973 09:46:39 UTC\n * in seconds: Wed Nov 16 5138 9:46:40 UTC\n */\n if (timestamp < 1e11) {\n timestamp *= 1000; // turn seconds to milliseconds\n }\n return new Date(timestamp);\n}", "title": "" }, { "docid": "3472951bd3b7115846628ac9c6351ff0", "score": "0.5715845", "text": "function milliToDate(milliSecond) {\n var oDate = new Date(milliSecond*1000),\n oYear = oDate.getFullYear(),\n oMonth = oDate.getMonth()+1,\n oDay = oDate.getDate(),\n oHour = oDate.getHours(),\n oMin = oDate.getMinutes(),\n oSen = oDate.getSeconds(),\n oTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +' '+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间\n return oTime;\n}", "title": "" }, { "docid": "83eb818d7d882b680f9af087fe81e786", "score": "0.5714335", "text": "function getUTCTime(milliseconds) {\n var baseDate = new Date(\"1970-01-01\");\n var date = new Date(baseDate.getTime() + milliseconds);\n return date;\n }", "title": "" }, { "docid": "457c17a17d6710762afb026e765d085b", "score": "0.5712295", "text": "function to_date(unix) {\n return moment.unix(unix).format('MM/DD H:mm')\n}", "title": "" }, { "docid": "8c79c36f83a3ffa7ec1441f50b70380c", "score": "0.5702184", "text": "function unixEpochFromJS (jsEpoch) {\n return (jsEpoch/1000);\n}", "title": "" }, { "docid": "aa296c0a3c91e3f955e202a50e9a3018", "score": "0.5668642", "text": "function timeConverter(UNIX_timestamp){\n var a = new Date(UNIX_timestamp*1000);\n var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n //var time = date + ',' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;\n var time = month + ', ' + date;\n\n return time;\n}", "title": "" }, { "docid": "6bd739007b63fc870683f940d087c89f", "score": "0.56513935", "text": "function _getCurrentUnixTimestamp () {\n return Math.floor(Date.now() / 1000);\n}", "title": "" }, { "docid": "e463d705308d17c4eaa28f4ee5bf326c", "score": "0.56487924", "text": "epochToDate(epoch) {\n let date;\n if (epoch) date = new Date(epoch);\n else if (typeof epoch == Object) date = epoch;\n return (\n date.getDate() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getFullYear()\n );\n }", "title": "" }, { "docid": "b32761ee9e1ce42bc054172ad0ffaf49", "score": "0.56414497", "text": "function timestampToDate(timestamp) {\r\n var \r\n theDate;\r\n\r\n if ( timestamp === 0 ) {\r\n return 0;\r\n }\r\n\r\n theDate = new Date( timestamp / 1000 );\r\n theDate = theDate.toLocaleString();\r\n\r\n return theDate;\r\n }", "title": "" }, { "docid": "236393121f572dccfcbc03c1e41418f3", "score": "0.5639835", "text": "function getNaturalTimestamp(date) {\n var naturalRE = /(Jan|January|Feb|February|Mar|March|Apr|April|May|June|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)\\s?(\\d{1,2})(\\s|,\\s)?(\\d{4})/i;\n if (naturalRE.test(date)) {\n var naturalTS = naturalRE.exec(date);\n // Use array from exec method to get the formatting right\n var natural = naturalTS[1].charAt(0).toUpperCase() + \n naturalTS[1].substr(1) + ' ' + naturalTS[2] +\n ', ' + naturalTS[4];\n \n return { \n \"unix\": new Date(natural).getTime() / 1000, \n \"natural\": natural\n };\n }\n \n return false;\n}", "title": "" }, { "docid": "06561653df49b9d2c18b592b7b3c66ed", "score": "0.5637402", "text": "function unixToString(date) {\n\tif (date.getMonth() == 0) {var month=1}\n\telse {var month = date.getMonth()+1};\n\tvar day = date.getDate();\n\tvar hour = date.getHours();\n\tvar minute = date.getMinutes();\n\tvar second = date.getSeconds();\n\tmonth = zeroPrefix(month);\n\tday = zeroPrefix(day);\n\thour = zeroPrefix(hour);\n\tminute = zeroPrefix(minute);\n\tsecond = zeroPrefix(second);\n\treturn [date.getTime(), date.getFullYear(), month, day, hour, minute, second];\n}", "title": "" }, { "docid": "40cc251b398eaf9283470dd611094800", "score": "0.5635032", "text": "function timeConverter(UNIX_timestamp){\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var time = ''+month + ' ' + date + ', ' + year;\n return time;\n}", "title": "" }, { "docid": "ce1e57a8170d0e0a599b976c0fe86d76", "score": "0.56259286", "text": "function timePointToDate(us) {\n var s = (new Date(us / 1000)).toISOString();\n return s.substr(0, s.length - 1);\n}", "title": "" }, { "docid": "31ab8c430e112cdb227d664e87def960", "score": "0.5621939", "text": "function getUnixTimeStamp(startTime) {\r\n return {\r\n unixtime: getTimeStamp(startTime)\r\n };\r\n }", "title": "" }, { "docid": "bc205e2cfc6e98d6e16f388b3d7c2cd1", "score": "0.5613857", "text": "function getEpochTime() {\n\tvar date = new Date();\n\treturn date.getTime();\n }", "title": "" }, { "docid": "18b33e0ef96ea31368e09064fb99f9ae", "score": "0.5601855", "text": "function timeConverter(UNIX_timestamp) {\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n var time = date + ', ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;\n return time;\n}", "title": "" }, { "docid": "18b33e0ef96ea31368e09064fb99f9ae", "score": "0.5601855", "text": "function timeConverter(UNIX_timestamp) {\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n var time = date + ', ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;\n return time;\n}", "title": "" }, { "docid": "6c77b02cedb6355ee112cf4a40be3ee8", "score": "0.5601304", "text": "function timejsonunix(tiempo){\n return { unixtime : tiempo.getTime() }\n}", "title": "" }, { "docid": "b6f0c9df5094b62741293006053b80c1", "score": "0.56004566", "text": "convertToDate(strDate) {\n Date.parse(strDate); //parsing the string to milliseconds (unix time)\n const date = new Date(strDate);\n const day = date.getDate();\n const month = date.getMonth() + 1;\n const year = date.getFullYear();\n return `${day}/${month}/${year}`;\n }", "title": "" }, { "docid": "4ceef4680d5a6dcdaf55e70910d7a92d", "score": "0.5594184", "text": "static unix() {\n return (Date.now() / 1000) | 0\n }", "title": "" }, { "docid": "720c95cb238e0268b9049738aae1dbb5", "score": "0.55839986", "text": "function getEpochTimeNow() {\n return Math.round(new Date().getTime() / 1000);\n }", "title": "" }, { "docid": "f19367b49b3a307f766e595328ca7597", "score": "0.557507", "text": "function Unix_timestamp(t)\r\n{\r\nvar dt = new Date(t*1000);\r\nvar hr = dt.getHours();\r\nvar m = \"0\" + dt.getMinutes();\r\nvar s = \"0\" + dt.getSeconds();\r\nreturn hr+ ':' + m.substr(-2) + ':' + s.substr(-2);\r\n}", "title": "" }, { "docid": "9891998444e6043578277d7c4d9e7b06", "score": "0.55700845", "text": "function getTimestamp(){\n return Math.floor(Date.now() / 1000);\n}", "title": "" }, { "docid": "21d8607cc3e53cc11159f0c70cb55caa", "score": "0.5568503", "text": "function fixDate(d){\r\n\treturn d ? new Date(d.getTime()) : d;\r\n}", "title": "" }, { "docid": "bde12890a98890e0589ed94a5649e7c3", "score": "0.5568239", "text": "function toTimestamp(rpepoch) {\n return (rpepoch + 0x386D4380) * 1000;\n}", "title": "" }, { "docid": "375b1db9c1542280643007a760af80e5", "score": "0.5567771", "text": "SSS (date) {\n return Object(_format_js__WEBPACK_IMPORTED_MODULE_1__[\"pad\"])(date.getMilliseconds(), 3)\n }", "title": "" }, { "docid": "79f51192091722d2d357b833c9341aea", "score": "0.5566381", "text": "function fromTimestamp(rpepoch) {\n if (rpepoch instanceof Date) {\n rpepoch = rpepoch.getTime();\n }\n\n return Math.round(rpepoch / 1000) - 0x386D4380;\n}", "title": "" }, { "docid": "87e8917ecc96fe466e56db3c9aba3055", "score": "0.55591196", "text": "function unixTimeToLocal(unix) {\n var local = new Date(0);\n local.setUTCSeconds(unix);\n return local;\n }", "title": "" }, { "docid": "dd0bdf977330a70cd79d9972c3515bbb", "score": "0.55573", "text": "function seconds_since_epoch() {\n return Math.floor(Date.now() / 1000)\n}", "title": "" }, { "docid": "edad85ae79d30ef5999744ef389e069a", "score": "0.55476683", "text": "function timeConverter(unix_timestamp) {\n\t\t\t\tvar a = new Date(unix_timestamp * 1000);\n\t\t\t\tvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\t\t\t\tvar year = a.getFullYear();\n\t\t\t\tvar month = months[a.getMonth()];\n\t\t\t\tvar date = a.getDate();\n\t\t\t\tvar hour = a.getHours();\n\t\t\t\tvar min = a.getMinutes();\n\t\t\t\tvar sec = a.getSeconds();\n\t\t\t\tvar time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;\n\t\t\t\treturn time;\n\t\t\t}", "title": "" }, { "docid": "d02b74a455c0bfb5e993e5c4df35cd74", "score": "0.55467576", "text": "function unixTime(unixtime) {\n\n var u = new Date(unixtime);\n\n return u.getFullYear() +\n '-' + ('0' + u.getMonth()+1).slice(-2) +\n '-' + ('0' + u.getDate()).slice(-2) + \n ' ' + ('0' + u.getHours()).slice(-2) +\n ':' + ('0' + u.getMinutes()).slice(-2) +\n ':' + ('0' + u.getSeconds()).slice(-2) +\n '.' + (u.getMilliseconds() / 1000).toFixed(3).slice(2, 5) \n }", "title": "" }, { "docid": "608ba69c2157e6d3d7a24b48360b65bb", "score": "0.554012", "text": "function timeConverter(UNIX_timestamp){\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours() < 10 ? '0' + a.getHours() : a.getHours();\n var min = a.getMinutes()< 10 ? '0' + a.getMinutes() : a.getMinutes();\n var sec = a.getSeconds()< 10 ? '0' + a.getSeconds() : a.getSeconds();\n var time = month + ' ' + date + ' ' + year + ' ' + hour + ':' + min;\n return time;\n}", "title": "" }, { "docid": "013bc9b307dbb78b1bfefa64bde336fd", "score": "0.55324095", "text": "function convert_date(date_string) {\n if(date_string) {\n ts = new Date(Date.parse(date_string.replace(/( \\+)/, ' UTC$1')));\n return ts.getTime() / 1000\n }\n}", "title": "" }, { "docid": "90ad1bf79a01f7b64cf584b8fb6beac2", "score": "0.55208564", "text": "S (date) {\n return Math.floor(date.getMilliseconds() / 100)\n }", "title": "" }, { "docid": "977a307896197f5dedcd4924a7cadadb", "score": "0.55140954", "text": "function nowTimestamp(){\n return Math.round(new Date().getTime()/1000)\n}", "title": "" }, { "docid": "445a58e9daa07e25ec8d5b9ff68e38a6", "score": "0.5505649", "text": "function unixTimeConverter(tweetEpochDate) {\n let readableDate = (Date.now() - tweetEpochDate) / 60000;\n\n if (readableDate - 17 < 1) {\n return 'Less than a minute ago.';\n } else if (readableDate < 60) {\n return `${Math.floor(readableDate)-14} minutes ago.`;\n } else if (readableDate < 1440) {\n return `${Math.floor(readableDate/60)} hours ago.`;\n } else {\n return `${Math.floor(readableDate/1440)} days ago.`;\n }\n}", "title": "" }, { "docid": "c5a726c9a33bd9266957f5a39139569b", "score": "0.55045104", "text": "function objToLocalTS(obj) {\n var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond);\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(obj.year);\n }\n return +d;\n}", "title": "" }, { "docid": "9b4315dbc3476f606bb7512f15c06201", "score": "0.5499113", "text": "function timeConverter(UNIX_timestamp) {\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n var min = a.getMinutes();\n var sec = a.getSeconds();\n var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec;\n return time;\n}", "title": "" }, { "docid": "0d45e2adcdae359c8cdefae5a7533d5f", "score": "0.54973555", "text": "function timeConverter(UNIX_timestamp) {\n var a = new Date(UNIX_timestamp * 1000);\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n var year = a.getFullYear();\n var month = months[a.getMonth()];\n var date = a.getDate();\n var hour = a.getHours();\n if (hour < 10) {\n hour = \"0\" + hour;\n }\n var min = a.getMinutes();\n if (min < 10) {\n min = \"0\" + min;\n }\n var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min;\n return time;\n}", "title": "" }, { "docid": "c7d74751aefb49b1236575fe0d0f8c71", "score": "0.54964995", "text": "function dateToBlockTimestamp(date) {\n return Math.round((checkDateParse(date + 'Z') - 946684800000) / 500);\n}", "title": "" }, { "docid": "40ed2620b1c03cbe7a69e29d85fc829c", "score": "0.5489997", "text": "function createDatetimestamp()\r\n{\r\n var date = new Date();\r\n\r\n return String(date.getUTCFullYear()).slice(-2) \r\n + zeroPad(String(date.getUTCMonth() + 1), 2) \r\n + zeroPad(String(date.getUTCDate()), 2)\r\n + zeroPad(String(date.getUTCHours()), 2)\r\n + zeroPad(String(date.getUTCMinutes()), 2)\r\n + zeroPad(String(date.getUTCSeconds()), 2);\r\n}", "title": "" }, { "docid": "fe9e06d1af491b95ac820a9238347e43", "score": "0.5470773", "text": "function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n return +d;\n}", "title": "" }, { "docid": "fe9e06d1af491b95ac820a9238347e43", "score": "0.5470773", "text": "function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n return +d;\n}", "title": "" }, { "docid": "fe9e06d1af491b95ac820a9238347e43", "score": "0.5470773", "text": "function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n return +d;\n}", "title": "" }, { "docid": "fe9e06d1af491b95ac820a9238347e43", "score": "0.5470773", "text": "function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n return +d;\n}", "title": "" }, { "docid": "f01e9a26a122bc904afb03a29d534104", "score": "0.54685694", "text": "SS(date) {\n return pad(Math.floor(date.getMilliseconds() / 10));\n }", "title": "" } ]
8c47037116ff02e157528f6dac2ca702
fizzBuzz (1, 100); minimum
[ { "docid": "c1437b6464eb733035f40fdc1a7ded11", "score": "0.0", "text": "function minimum (a, b) {\n\n if (isNaN(a) || isNaN(b)) {\n console.log(\"parameters aren\\'t numbers\");\n return;\n }\n\n return a >= b ? b : a;\n}", "title": "" } ]
[ { "docid": "305c725251f07a28f4db230c45d0c81c", "score": "0.8823136", "text": "function fizzBuzz(n) {}", "title": "" }, { "docid": "a62b0bad226b4ee13a94c571165673b6", "score": "0.86791587", "text": "function fizzBuzz() {}", "title": "" }, { "docid": "b059d8eb21a7f30863f851e32501511a", "score": "0.8400602", "text": "function doFizzBuzz () {\n\n}", "title": "" }, { "docid": "bc89ac5c9f9a3247cf43c74518511d57", "score": "0.81459016", "text": "function fizzbuzz(){\n\n}", "title": "" }, { "docid": "b2e98beaf735f7af2c074e82bb968695", "score": "0.8145588", "text": "function FizzBuzz() {\n\n}", "title": "" }, { "docid": "a3028ce108b3142d6f35467718eaac6b", "score": "0.8013088", "text": "function fizzBuzz(){\n //CODE HERE\n}", "title": "" }, { "docid": "e5b56934674f8764f9160f239de49ec1", "score": "0.7581548", "text": "function fizzBuzz({ fizz, buzz, iterations}= defaults()){\n\treturn {\n\t\ti: 1,\n\t\t[ Symbol.iterator]: function(){ return this},\n\t\tnext(){\n\t\t\tconst\n\t\t\t val= this.i++,\n\t\t\t is3= val% 3== 0? fizz: \"\",\n\t\t\t is5= val% 5== 0? is3+ buzz: is3|| val\n\t\t\treturn { value: is5, done: val> iterations}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "280b9111d00c4fdc72a7da7fc1119195", "score": "0.7548186", "text": "function fizzBuzz(max) {\r\n\t\tfor(var i = 1; i <= max; i++) {\r\n\t\t\tif(i % 3 == 0 && i % 5 == 0) {\r\n\t\t\t\t$('#fizzbuzz-out').append('<p>FizzBuzz</p>');\r\n\t\t\t}\r\n\t\t\telse if(i % 3 == 0) {\r\n\t\t\t\t$('#fizzbuzz-out').append('<p>Fizz<p>');\r\n\t\t\t}\r\n\t\t\telse if(i % 5 == 0) {\r\n\t\t\t\t$('#fizzbuzz-out').append('<p>Buzz</p>');\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$('#fizzbuzz-out').append('<p>' + i + '</p>');\r\n\t\t\t}\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "89e5a1ccfc0b84a1b137112000e19a96", "score": "0.7513539", "text": "function fizzBuzz(array) {\n\n}", "title": "" }, { "docid": "869c8a983f8235ace1d80b4629b7b0d9", "score": "0.7479877", "text": "function calcFizzBuzz(i) {\n /* ------------ FizzBuzz Calculaltion ----------- */\n /* init assignments */\n isFizz = false;\n isBuzz = false;\n isFizzBuss = false;\n \n /* set to number */\n tempAnswer = i;\n \n /* if mod 3 = 0, then Fizz */\n if (i > 2 && i % 3 == 0) {\n isFizz = true;\n tempAnswer = \"Fizz\";\n }\n\n /* if mod 5 = 0, then Buzz */\n if (i > 4 && i % 5 == 0) {\n isBuzz = true;\n tempAnswer = \"Buzz\";\n /* if both then FizzBuzz */\n if (isFizz && isBuzz) {\n isFizzBuss = true;\n tempAnswer = \"FizzBuzz\";\n }\n }\n \n return tempAnswer;\n;\n }", "title": "" }, { "docid": "bcd366978be2d3b4118ce1a884565bb5", "score": "0.7478451", "text": "function fizz_buzz(int){\n if(int%3==0){\n if(int%5==0){\n return \"FizzBuzz\";\n }else{\n return \"Fizz\";\n }\n }else if (int%5==0){\n return \"Buzz\";\n }else if (int%1==0){\n return int + \"!\";\n }\n}", "title": "" }, { "docid": "d480e7d295104d1accd54f0ff81ee3df", "score": "0.74483997", "text": "function fizzBuzz(num){\n if (num % 15 == 0) {\n return \"FizzBuzz\";\n } else if (num % 3 == 0) {\n return \"Fizz\";\n } else if (num % 5 ==0) {\n return \"Buzz\";\n } else {\n return num;\n }\n}", "title": "" }, { "docid": "767839e3532f978b09ffe2ea92d99565", "score": "0.7442113", "text": "function fizz_buzz(int){\n if (int % 3 == 0 && int % 5 == 0){\n return \"FizzBuzz\" ;\n }\n if (int % 3 != 0 && int % 5 == 0){\n return \"Buzz\" ;\n }\n if (int % 3 == 0 && int % 5 != 0){\n return \"Fizz\";\n }else{\n return int +\"!\"\n }\n}", "title": "" }, { "docid": "e94f3a8383a247ee3e7be532062dfb9a", "score": "0.7415809", "text": "function fizzBuzzer(num){\n if (num % 15 === 0) return 'fizzbuzz';\n if (num % 3 === 0) return 'fizz';\n if (num % 5 === 0) return 'buzz';\n return num;\n}", "title": "" }, { "docid": "2effac2f30ba81cd269882b78154fe6e", "score": "0.741126", "text": "function FizzBuzz()\n{\n for (var i = 1; i <= 100; i++) {\n if (i % 3 == 0 && i % 5 == 0)\n console.log(\"FizzBuzz\");\n else if (i % 3 == 0)\n console.log(\"Fizz\");\n else if (i % 5 == 0)\n console.log(\"Buzz\");\n else\n console.log(i);\n }\n}", "title": "" }, { "docid": "e127085fab84f6c0daac1ca4f594ca95", "score": "0.74098074", "text": "function doFizzBuzz() {\n for(i = 0; i < 100;){\n console.log( (++i % 3 ? '' : 'Fizz') + (i % 5 ? '' : 'Buzz') || i);\n }\n}", "title": "" }, { "docid": "321ed995455c37434719cd263bd45583", "score": "0.74044174", "text": "function fizzBuzz(fizzValue, buzzValue){\n\n let returnArray = [];\n\n //Create array with numbers from 1-100\n for (let i = 1; i <= 100; i++) {\n\n //Check for fizz and buzz Values\n if(i % fizzValue == 0 && i % buzzValue == 0) {\n\n returnArray.push('FizzBuzz');\n\n } else if (i % fizzValue == 0){\n returnArray.push('Fizz')\n\n } else if(i % buzzValue == 0){\n returnArray.push('Buzz')\n\n } else {\n returnArray.push(i);\n\n } \n }\n\n return returnArray;\n\n}", "title": "" }, { "docid": "da4707ad04c3709817b3305663611334", "score": "0.74018633", "text": "function fizz_buzz(n){\n if(n % 3 === 0 && n % 5 === 0){\n return 'FizzBuzz';\n }\n if(n % 3 === 0){\n return 'Fizz';\n }\n if(n % 5 === 0){\n return 'Buzz';\n }else{\n return n + '!';\n }\n}", "title": "" }, { "docid": "5a3476a6acad0c32011414442f0c9530", "score": "0.7391861", "text": "function FizzBuzz()\r\n{\r\n\tfor(var i = 1; i <= 100; i++)\r\n\t{\r\n\t\tif(i % 3 === 0 && i % 5 === 0)\r\n\t\t{\r\n\t\t\tconsole.log(\"FizzBuzz\");\r\n\t\t}\r\n\t\telse if(i % 3 === 0)\r\n\t\t{\r\n\t\t\tconsole.log(\"Fizz\");\r\n\t\t}\r\n\t\telse if(i % 5 === 0)\r\n\t\t{\r\n\t\t\tconsole.log(\"Buzz\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tconsole.log(i);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "792b6f0e484ed6d64248484a36bc4f86", "score": "0.73886615", "text": "function fizzBuzz(number) {\n if (number % 15 === 0) {\n return \"FizzBuzz\";\n } else if (number % 3 === 0) {\n return 'Fizz';\n } else if (number % 5 === 0) {\n return 'Buzz';\n } else {\n return number;\n }\n}", "title": "" }, { "docid": "8a6ab7e1bf7df0ef9afb7c70fffdf4e3", "score": "0.7374244", "text": "function fizzbuzz(fizz, buzz) {\n for (i = 1; i <= 100; i++) {\n if (i % (fizz * buzz) === 0) {\n console.log(\"FizzBuzz\");\n } else if (i % buzz === 0) {\n console.log(\"Buzz\");\n } else if (i % fizz === 0) {\n console.log(\"Fizz\");\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "39ac1986057f02cc70529dbafaa9e7fd", "score": "0.73652947", "text": "function fizzBuzz (num) {\n if (num % 15 === 0) {\n return 'fizzbuzz';\n } else if (num % 3 === 0) {\n return 'fizz';\n } else if (num % 5 === 0) {\n return 'buzz';\n }\n return num;\n}", "title": "" }, { "docid": "cd1abbf68295d0fba254ae69df4463d8", "score": "0.736175", "text": "function FizzBuzz()\n{\n\n for(var i = 1; i < 101; i++)\n {\n if(i % 3 == 0)\n {\n console.log(\"Fizz\");\n } else if(i % 5 == 0){\n console.log(\"Buzz\");\n } else {\n console.log(i);\n }\n \n }\n\n}", "title": "" }, { "docid": "5e69e9fdbdc21df187d18cc29c85d4c7", "score": "0.7344988", "text": "function fizzBuzz(){\n for(i = 0; i <= 100; i++){\n\t\tif((i % 3 === 0) && (i % 5 === 0)){\n\t\t\tconsole.log('FizzBuzz')\n\t\t} else if (i % 3 === 0){\n console.log('Fizz');\n } else if(i % 5 === 0){\n console.log('Buzz')\n } else {\n console.log(i);\n }\n };\n}", "title": "" }, { "docid": "b7f276718acca179e85e45ff9bff3d76", "score": "0.73418367", "text": "function fizzBuzzFactory(arr, arg) {\n let valueArr = [];\n let wordArr = [];\n\n arr.forEach((item) => {\n valueArr.push(item[0]);\n wordArr.push(item[1]);\n });\n\n let maxInd = valueArr.indexOf(Math.max(...valueArr));\n let minInd = valueArr.indexOf(Math.min(...valueArr));\n let midInd = 0;\n if (maxInd + minInd === 1) {\n midInd += 2;\n }\n if (maxInd + minInd === 2) {\n midInd += 1;\n }\n\n if (arg % Number(valueArr[maxInd]) === 0) {\n return wordArr[maxInd];\n }\n if (\n arg % Number(valueArr[midInd]) === 0 &&\n arg % Number(valueArr[maxInd]) !== 0\n ) {\n return wordArr[midInd];\n }\n if (\n arg % Number(valueArr[minInd]) === 0 &&\n arg % Number(valueArr[maxInd]) !== 0 &&\n arg % Number(valueArr[midInd]) !== 0\n ) {\n return wordArr[minInd];\n } else {\n return String(arg);\n }\n}", "title": "" }, { "docid": "a274aadb68f1fdc3f6e430afbd31bcea", "score": "0.73413134", "text": "function playFizzBuzz(){\n var num = 19;\n console.log(fizzBuzz(num), fizzBuzzV2(num));\n}", "title": "" }, { "docid": "e98bdf9143eaa0511f982a887788c436", "score": "0.73115677", "text": "function fizzBuzz(n){\n for(var i=1; i<=n; i++){\n if (i % 3 == 0 && i % 5 == 0) {\n console.log('FizzBuzz')\n } else if (i % 3 == 0 && i % 5 !== 0) {\n console.log('Fizz')\n } else if (i % 3 !== 0 && i% 5 == 0) {\n console.log('Buzz');\n } else { \n console.log(i);\n }\n }\n return;\n}", "title": "" }, { "docid": "b8a35e095163d06b3e8e3db40b02404c", "score": "0.7307615", "text": "function fizzBuzzer(n) {\n\t// Prove you can use conditional statements to provide functionality based on mathematical return values (Prove you can do some arithmetic, too)\n\t// Prove you know why you must check for \"FizzBuzz\" first\n\tif (n % 3 === 0 && n % 5 === 0) {\n\t\tresult = \"FizzBuzz\";\n\t} else if (n % 3 === 0) {\n\t\tresult = \"Fizz\";\n\t} else if (n % 5 === 0) {\n\t\tresult = \"Buzz\";\n\t} else {\n\t\tresult = n.toString();\n\t}\n\n \treturn result;\n}", "title": "" }, { "docid": "0ccf09864d4d683e4d43390e5296fd94", "score": "0.73026747", "text": "function fizzbuzz(x) {\n\t// generar un array\n\tlet array = []\n\tlet n = 0\n\tfor (i = 0 ; i < x ; i++) {\n\t\tn = i + 1\n\t\tarray.push(n)\n\t}\n\tlet arrayFinal = []\n\tfor ( i = 0 ; i < array.length ; i++) {\n\t\t// evaluar las condiciones\n\t\tlet n = ''\n\t\tif ((array[i] % 3 !== 0) && (array[i] % 5 !== 0)) {\n\t\t\tn = '.'\n\t\t} else if ((array[i] % 3 === 0) && (array[i] % 5 !== 0)) {\n\t\t\tn = 'fizz' \n\t\t} else if ((array[i] % 5 === 0) && (array[i] % 3 !== 0)) {\n\t\t\tn = 'buzz'\n\t\t} else if ((array[i] % 5 === 0) && (array[i] % 3 === 0)) {\n\t\t\tn = 'FizZBuzZ'\n\t\t}\n\t\telse n = 'error en algun lado'\n\t\tarrayFinal.push(n)\t\n\t}\n\t// generar la string\n\tlet stringFinal = ''\n\tstringFinal = arrayFinal.join('')\n\treturn stringFinal\n}", "title": "" }, { "docid": "ff46137c5e39674c7cc2f0b2cd819807", "score": "0.7293251", "text": "function fizzbuzz(n) {\n\t\n\tif ( n % 15 == 0 ) \n\t\treturn 'FizzBuzz'\n\telse if ( n % 3 == 0 )\n\t\treturn 'Fizz'\n\telse if ( n % 5 == 0)\n\t\treturn 'Buzz'\n\telse \n\t\treturn String(n)\n\n}", "title": "" }, { "docid": "10bf6ae36f06405c57fdbe528935be2a", "score": "0.72915626", "text": "function fizzBuzz(input) {\n if (typeof(input) !== \"number\") return NaN;\n if ((input % 3 === 0) && (input % 5 === 0))\n return 'FizzBuzz';\n if (input % 3 === 0) return 'Fizz';\n if (input % 5 === 0) return 'Buzz';\n return input;\n}", "title": "" }, { "docid": "e403586f3b1c6f59d2018d1ccdc0a9b1", "score": "0.72846544", "text": "function fizzBuzz2() {\n var list = [];\n for (var i = 1; i <= 100; i++) {\n console.log(i % 15 === 0 ? 'FizzBuzz' : i % 5 === 0 ? 'Buzz' : i % 3 === 0 ? 'Fizz' : i);\n }\n return list;\n}", "title": "" }, { "docid": "211194c2c69906a512b88d59103161ff", "score": "0.72728723", "text": "function fizzBuzz(n, arr = []) {\n if(!n) return arr.reverse();\n if(n % 5 === 0 && n % 3 === 0) {\n arr.push(\"FizzBuzz\"); \n } else if(n % 3 === 0) {\n arr.push(\"Fizz\")\n } else if(n % 5=== 0) {\n arr.push(\"Buzz\")\n } else {\n arr.push(n)\n };\n return fizzBuzz(n-1, arr);\n}", "title": "" }, { "docid": "511856f497da256bb9fb29f6307b2a50", "score": "0.72721004", "text": "function specialFizzBuzz(number){\n let result = [];\n for (let i = 1; i < number; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n result.push(i);\n }\n }\n return result.length ? result.reduce((a, v) => a + v) : 0;\n}", "title": "" }, { "docid": "e1f6d4f5aeb5797cd937f1c18b276fe8", "score": "0.72712755", "text": "function preFizz(n) {\n var output = [];\n for (var i=1; i<=n; i++)\n {\n output.push(i);\n }\n return output;\n}", "title": "" }, { "docid": "9e71a15a14d02d0fa3e3d1404522b3c3", "score": "0.7270804", "text": "function fizzBuzz(n) {\n\tlet result;\n\tn % 5 === 0 && n % 3 === 0\n\t\t? (result = \"Fizz Buzz\")\n\t\t: n % 3 === 0\n\t\t\t? (result = \"Fizz\")\n\t\t\t: n % 5 === 0 ? (result = \"Buzz\") : (result = n.toString());\n\treturn result;\n}", "title": "" }, { "docid": "aed2445b18c25217715ad43e861dd068", "score": "0.7262399", "text": "function fizzBuzz3(m,n,fizzNum,buzzNum){\n if (m>n)\n {\n return(\"m is greater than n so this really doesn't work\");\n }\n\n for (i=m;i<(n+1);i++)\n {\n if( i%fizzNum==0 && i%buzzNum==0)\n {\n console.log(\"fizzbuzz\");\n }\n else if (i%fizzNum==0)\n {\n console.log(\"fizz\");\n }\n else if (i%buzzNum==0)\n {\n console.log(\"buzz\");\n }\n else\n {\n console.log(i);\n } \n }\n}", "title": "" }, { "docid": "43cc0facc1c529bef387337216b7808e", "score": "0.7259984", "text": "function FizzBuzz(num) {\n\tif (num % 3 === 0 && num % 5 === 0) {\n\t\treturn \"FizzBuzz\"\n\t} else if (num % 3 === 0) {\n\t\treturn \"Fizz\"\n\t} else if (num % 5 === 0) {\n\t\treturn \"Buzz\"\n\t} else return num.toString();\n}", "title": "" }, { "docid": "43cc0facc1c529bef387337216b7808e", "score": "0.7259984", "text": "function FizzBuzz(num) {\n\tif (num % 3 === 0 && num % 5 === 0) {\n\t\treturn \"FizzBuzz\"\n\t} else if (num % 3 === 0) {\n\t\treturn \"Fizz\"\n\t} else if (num % 5 === 0) {\n\t\treturn \"Buzz\"\n\t} else return num.toString();\n}", "title": "" }, { "docid": "ba7d9042f595acafc94e61295c1fd960", "score": "0.72543234", "text": "function ListFizzBuzz(Value) {\n for (var i = 0; i < Value; i++) {\n if(i%3 != 0 && i%5 != 0){\n $(\"body\").append('<li>' + i + '</li>');\n };\n if(i%3 == 0) {\n $(\"body\").append('<li>' + \"fizz\" + '</li>');\n };\n if(i%5 == 0) {\n $(\"body\").append('<li>' + \"buzz\" + '</li>');\n };\n if(i%3 == 0 && i%5 == 0) {\n $(\"body\").append('<li>' + \"fizzbuzz\" + '</li>');\n };\n };\n }", "title": "" }, { "docid": "8552021429e2a82031b63eb5a2f3e993", "score": "0.72538894", "text": "function fizzBuzz() {\n for (let i = 0; i < 100; i++) {\n if (i % 15 === 0) {\n console.log('FizzBuzz');\n } else if (i % 3 === 0) {\n console.log('Fizz');\n } else if (i % 5 === 0) {\n console.log('Buzz');\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "d827edd752e26171ea4aee3e15f35494", "score": "0.72480553", "text": "function doFizzBuzz() {\n // FILL THIS IN\n for(var i = 0; i <= 100; i++){\n if ((i % 3 === 0) && (i % 5 === 0)) {\n console.log('FizzBuzz');\n return 'FizzBuzz';\n }\n else if (i % 3 === 0) {\n console.log('Fizz');\n return 'Fizz';\n }\n else if (i % 5 === 0) {\n console.log('Buzz');\n return 'Buzz';\n }\n else {\n console.log(i);\n return i;\n }\n }\n }", "title": "" }, { "docid": "953265b174f699de0aed98817fc602aa", "score": "0.724688", "text": "function fizzBuzz1() {\n var list = [];\n for (var i = 1; i <= 100; i++) {\n if (i % 15 === 0) {\n console.log('FizzBuzz');\n } else if (i % 5 === 0){\n console.log('Buzz');\n } else if (i % 3 === 0){\n console.log('Fizz');\n } else {\n console.log(i);\n }\n }\n return list;\n}", "title": "" }, { "docid": "4c2328b2a989b468bd1d400bb89ae82d", "score": "0.72397214", "text": "function fizzBuzz(){\n for (let i=1; i < 101; i++){\n if (i % 3 ==0 && i % 5 == 0) console.log(\"FizzBuzz\");\n else if (i % 3 == 0) console.log(\"Fizz\");\n else if (i % 5 == 0) console.log(\"Buzz\");\n else console.log(i);\n }\n}", "title": "" }, { "docid": "df30a1d8d5a1653396ccc593d20778db", "score": "0.7230688", "text": "function fizzBuzz(length, fizzValue, buzzValue) {\n // Defines defaults if no parameters are passed\n var length = length || 100;\n var fizzValue = fizzValue || 3;\n var buzzValue = buzzValue || 5;\n\n var output;\n for (var i=1; i <= length; i++) {\n output = '';\n if (i % fizzValue === 0) {\n output += \"Fizz\";\n }\n if (i % buzzValue === 0) {\n output += \"Buzz\";\n }\n if (i % fizzValue !== 0 && i % buzzValue !== 0) {\n output += i;\n }\n console.log(output);\n }\n}", "title": "" }, { "docid": "69ea301d57becc97364f469e652376d4", "score": "0.7224764", "text": "function fizzBuzz() {\n for (var i =0; i <= 100; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"Fizz Buzz\")\n }\n else if (i % 5 === 0) {\n console.log(\"Buzz\")\n }\n else if (i % 3 === 0) {\n console.log(\"Fizz\")\n }\n else {\n console.log(i)\n }\n }\n}", "title": "" }, { "docid": "2c8771d6d4d3d44e4a2ff871dd10c953", "score": "0.72153354", "text": "function fizzBuzz (num) {\n if (num % 3 === 0 && num % 5 === 0) {\n return num = `FizzBuzz`;\n } else if (num % 5 === 0) {\n return num = `Buzz`;\n } else if (num % 3 === 0) {\n return num = `Fizz`;\n } else {\n return num;\n }\n}", "title": "" }, { "docid": "e21fb4b0eb9b3afd880f6d9051787be3", "score": "0.72086483", "text": "function fizzBuzz(count) {\n var results = [];\n for (var i = 0; i < count; i = i + 1) {\n var nextValue;\n\n if (i % 15 === 0) {\n nextValue = 'FizzBuzz';\n } else if (i % 5 === 0) {\n nextValue = 'Buzz';\n } else if (i % 3 === 0) {\n nextValue = 'Fizz';\n } else {\n nextValue = i;\n }\n\n results.push(nextValue);\n }\n return results;\n}", "title": "" }, { "docid": "e9d0c1cf32a0b3c0793f4080aad921b7", "score": "0.7205914", "text": "function fizz_buzz(x) {\n if(x % 3 == 0 && x % 5 == 0) {\n return \"FizzBuzz\";\n }\n if(x % 3 == 0){\n return \"Fizz\";\n }\n if (x % 5 == 0){\n return \"Buzz\";\n }\n if (x % 3!= 0 && x % 5!= 0){\n return x + \"!\";\n }\n}", "title": "" }, { "docid": "5d18960e8fa9cad53d90a713138e258a", "score": "0.71932685", "text": "function fizzBuzz() {\n\n for (let i = 1; i <= 100; i++){\n if (i % 15 == 0){\n console.log('FizzBuzz');\n }\n else if (i % 5 == 0){\n console.log('Buzz');\n }\n else if (i % 3 == 0){\n console.log('Fizz');\n }\n else {\n console.log(i);\n }\n }\n\n}", "title": "" }, { "docid": "9541db11e919fc13ff4c0146c6814294", "score": "0.7191231", "text": "function FizzBuzz(num) {\n\tif(num % 3 === 0) {\n\t\tif(num % 3 === 0 && num % 5 === 0) {\n\t\t\treturn \"FizzBuzz\"\n\t\t}\n\t\treturn \"Fizz\"\n\t} else if(num % 5 === 0) {\n\t\treturn \"Buzz\"\n\t} else {\n\t\treturn num.toString()\n\t}\n}", "title": "" }, { "docid": "0ebac7f4f388f7477df2828843dffae3", "score": "0.71829706", "text": "function fizzBuzz(num) {\n let result = '';\n\n if(num % 3 === 0) result += 'Fizz';\n if(num % 5 === 0) result += 'Buzz';\n\n return result.length ? result : num;\n}", "title": "" }, { "docid": "7ed7ce3022f08c05aae0ce2fb4b3b75b", "score": "0.7181822", "text": "function fizzBuzz() {\r\n\r\n for (let i = 1; i < 101; i++) {\r\n if (i % 3 === 0) {\r\n if (i % 5 === 0) {\r\n console.log('FizzBuzz');\r\n } else {\r\n console.log('Fizz');\r\n }\r\n } else if (i % 5 === 0) {\r\n console.log('Buzz');\r\n } else {\r\n console.log(i);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "35b756a392c2ca7184d0c507e3c76f9a", "score": "0.71763223", "text": "function fizzBuzz() {\n for (let i = 1; i <= 100; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"FizzBuzz\");\n } else if (i % 3 === 0) {\n console.log(\"Fizz\");\n } else if (i % 5 === 0) {\n console.log(\"Buzz\");\n } else {\n console.log(i);\n }\n };\n}", "title": "" }, { "docid": "097f5bca96635c4052f4d6479eaebb09", "score": "0.7157474", "text": "function fizzBuzz(num1, num2, range) {\n//declaring a loop of how many times to run the code block\n for (var i = 0; i <= range; i++) {\n//declaring an if statement to create paths for the script the follow\n if (i % num1 === 0 && i % num2 === 0) {\n//if the condition in line 45 returns true, the console will print the string value in line 47\n console.log('fizzbuzz');\n//declaring an else if statement for the script to follow if condintion in line 45 returns false\n } else if (i % num1 === 0) {\n//if the condition in line 49 returns true, the console will return the string value in line 51\n console.log('fizz');\n//declaring an else if statemtn for the script to follow if the condition in line 45 and 49 return false.\n } else if (i % num2 === 0) {\n//if the condition in line 53 returns true, the console will return the string value in line 55\n console.log('buzz');\n//declaring and else statement for the script to follow if the conditions in lines 45, 49, and 53 all return false.\n } else {\n//if the condition in line 57 reutns true, the console will return the iteration count\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "4b9233902e06b6a8078a446f0c70e2d2", "score": "0.71553034", "text": "function fizzBuzz2(m,n){\n if (m>n)\n {\n return(\"m is greater than n so this really doesn't work\");\n }\n\n for (i=m;i<(n+1);i++)\n {\n if( i%3==0 && i%5==0)\n {\n console.log(\"fizzbuzz\");\n }\n else if (i%3==0)\n {\n console.log(\"fizz\");\n }\n else if (i%5==0)\n {\n console.log(\"buzz\");\n }\n else\n {\n console.log(i);\n } \n }\n}", "title": "" }, { "docid": "4b094c23cdc8cdcc3bfd3f36d9a86eb8", "score": "0.71544427", "text": "function doFizzBuzz() {\n for (n=1; n <=100; n++){\n if ((( n % 3) == 0) && (( n % 5) == 0)){\n console.log(\"FizzBuzz\");\n }\n else if (( n % 3) == 0){\n console.log(\"Fizz\");\n }\n else if (( n % 5 ) == 0){\n console.log(\"Buzz\");\n }\n else {\n console.log(n);\n }\n }\n}", "title": "" }, { "docid": "280efe332d68ca8950698e143135ff78", "score": "0.71535134", "text": "function fizzBuzz() {\n for(let i = 1; i <= 100; i++) {\n // if((i % 3 === 0) && (i % 5 === 0)) {\n if(i % 15 === 0) {\n console.log('FizzBuzz');\n }\n else if(i % 3 === 0) {\n console.log('Fizz');\n }\n else if(i % 5 === 0) {\n console.log('Buzz');\n }\n else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "078fb3667b7ac870f36d16addfc9dcca", "score": "0.7149538", "text": "function fizzBuzz(entrada){\n if(typeof entrada !== 'number')\n return 'Nao eh um numero';\n\n if(entrada % 3 === 0 && entrada % 5 === 0)\n return 'FizzBuzz'\n\n if(entrada % 3 === 0)\n return 'Fizz'\n \n if(entrada % 5 === 0)\n return 'Buzz'\n\n return entrada\n}", "title": "" }, { "docid": "9e31f5b6e5acf0add1452c6e77ea8102", "score": "0.71486336", "text": "function fizzBuzz(n) {\n var str = \"\";\n if (n < 0 || isNaN(n)) {\n str += \"Parameter must be a positive number\";\n return str\n }\n for (i = 1; i <= n; i++) {\n if (i == n) {\n if (i % 15 == 0) {\n str += \"and FizzBuzz.\";\n }\n else if (i % 5 == 0) {\n str += \"and Buzz\";\n }\n else if (i % 3 == 0) {\n str += \"and Fizz\";\n }\n else {\n str += \"and \" + i;\n }\n }\n else {\n if (i % 15 == 0) {\n str += \"FizzBuzz, \";\n }\n else if (i % 5 == 0) {\n str += \"Buzz, \";\n }\n else if (i % 3 == 0) {\n str += \"Fizz, \";\n }\n else {\n str += i + \", \";\n }\n }\n }\n return str;\n}", "title": "" }, { "docid": "7a6385905b533bce0e31f131f98bdbc3", "score": "0.7144221", "text": "function fizzbuzz(){\n for(let i=1; i<=100; i++){\n if(i%3==0 && i%5==0){\n console.log(\"fizzbuzz\");\n }\n else if(i%3==0){\n console.log(\"fizz\");\n }\n else if(i%5==0){\n console.log(\"buzz\");\n }\n else{\n console.log(i);\n }\n }\n }", "title": "" }, { "docid": "b412a2e4959cdf3088d10b56f5a7bdd0", "score": "0.71403366", "text": "function fizzBuzz(totalNums){\n\tfor (var i = 0; i < totalNums; i++){\n\t\tif (i%3 === 0 && i%5 === 0) {\n\t\t\tconsole.log(\"FizzBuzz\");\n\t\t}\n\t\telse if (i%3 === 0){\n\t\t\tconsole.log(\"Fizz\");\n\t\t}\n\t\telse if (i%5 === 0){\n\t\t\tconsole.log(\"Buzz\");\n\t\t}\n\t\telse{\n\t\t\tconsole.log(i);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "26cc137741a9021c420e18fbbcaecf39", "score": "0.7127016", "text": "function fizzBuzz() {\n for (let i = 1; i <= 100; i++) {\n if(i % 3 == 0 && i % 5 == 0) {\n console.log(\"FizzBuzz\");\n } else if(i % 3 == 0) {\n console.log(\"Fizz\");\n } else if(i % 5 == 0) {\n console.log(\"Buzz\");\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "eae3660b35b0434e26decbf9beca4fd0", "score": "0.71260226", "text": "function fizzBuzz(countTo) {\n var playedGame = [];\n for (var i=1; i<=countTo; i++){\n if(i%fizz===0&&i%buzz===0){\n playedGame.push(\"fizzbuzz\");\n }\n else if(i%buzz===0){\n playedGame.push(\"buzz\");\n }\n else if(i%fizz===0){\n playedGame.push(\"fizz\");\n }\n else{\n playedGame.push(i);\n }\n }\n return playedGame;\n}", "title": "" }, { "docid": "48a2d99fbeaec61c1302adecd2dd488d", "score": "0.7109497", "text": "function fizzBuzzFun(num) {\n\t\tfor (var i = 1; i <= num; i++) {\n\t\t\tif (i % 15 === 0) {\n\t\t\t\t$(\"#fizz\").append(\"<li>FizzBuzz</li>\")\n\t\t\t} else if (i % 3 === 0) {\n\t\t\t\t$(\"#fizz\").append(\"<li>Fizz</li>\");\n\t\t\t} else if (i % 5 === 0) {\n\t\t\t\t$(\"#fizz\").append(\"<li>Buzz</li>\");\n\t\t\t} else {\n\t\t\t\t$(\"#fizz\").append(\"<li>\" + i + \"</li>\");\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c2c226f5ac5836d68d551b797857956e", "score": "0.71001464", "text": "function FizzBuzz() {\n\tvar lastNum = 100;\n\tvar currentNum = 1;\n\n\twhile (currentNum <= lastNum) {\n\t\tvar remainder_3 = currentNum % 3;\n\t\tvar remainder_5 = currentNum % 5;\n\n\t\tif (remainder_3 === 0 && remainder_5 === 0){\n\t\t\tconsole.log(\"FizzBuzz\");\n\t\t} else if(remainder_3 === 0){\n\t\t\tconsole.log(\"Fizz\");\n\t\t} else if(remainder_3 !== 0 && remainder_5 === 0){\n\t\t\tconsole.log(\"Buzz\");\n\t\t} else {\n\t\t\tconsole.log(currentNum);\n\t\t}\n\n\t\tcurrentNum++;\n\t}\n}", "title": "" }, { "docid": "f5c381f1f1107dfc2e0bbe5a674cd619", "score": "0.70982057", "text": "function fizzbuzz(n){\n let array = [];\n for(let i=1; i<=n; i++){\n if(i%3 === 0 && i%5 === 0){\n array.push('FizzBuzz');\n }else if(i % 3 === 0){\n array.push('Fizz');\n }else if(i%5 === 0){\n array.push('Buzz');\n }else{\n array.push(i)\n }\n }return array;\n}", "title": "" }, { "docid": "0a770199d681bb9d61f265c0f520f639", "score": "0.70896405", "text": "function Fizzbuzz (n) {\n arr = []\n for (var i = 1; i <= n; i++){\n if( i % 5 === 0 && i % 3 === 0){\n arr.push(\"FizzBuzz\")\n } else if(i % 3 === 0){\n arr.push(\"Fizz\")\n } else if (arr[i] % 5 === 0){\n arr.push(\"Buzz\");\n }\n }\n return arr;\n\n}", "title": "" }, { "docid": "5db440b6832ff5bdc24f59d07c9a00f0", "score": "0.7080825", "text": "function fizzbuzz_1(){\n\t\"use strict\";\n\tdocument.getElementById(\"div1\").innerHTML = \"\";\n\tvar i, output;\n\tfor (i = 1; i < 101; i++) {\n\toutput = \"\";\n\tif (i % 3 ===0) {output = \"Fizz\";}\n\tif (i % 5 ===0) {output = \"Buzz\";}\n\tif ((i % 3 ===0) && (i % 5 ===0)) {output = \"FizzBuzz\";}\n\tdocument.getElementById(\"div1\").innerHTML += (output || i) + \"<br/>\";\n}\n}", "title": "" }, { "docid": "7d57ff26a2a9e44530b10d9a82eb5bf1", "score": "0.70731956", "text": "function dynamicFizzBuzz(max, num1, num2){\n // your code here...\n //standard fizzbuzz except instead of 3 and 5 we can add a level of arbitrition with...\n //our input num1 and num2\n let dynamicArr = [];\n for (let i = 0; i < max; i++) {\n if (i % num1 === 0 && i % num2 === 0) {\n continue;\n }\n if (i % num1 === 0) {\n dynamicArr.push(i);\n }\n if (i % num2 === 0) {\n dynamicArr.push(i);\n\n }\n }\n return dynamicArr;\n}", "title": "" }, { "docid": "5b8701e28b6ecb86b28987db2e7cde06", "score": "0.7072107", "text": "function fizzbuzz(num) {\n\n\tfunction check(n) {\n\t\tvar msg = '';\n\t\tif ( n % 3 == 0 ) {msg += \"Fizz\"};\n\t\tif ( n % 5 == 0 ) {msg += \"Buzz\"};\n\t\treturn msg || n;\n\t}\n\n\tfor (var i = 1; i <= num; i++) {\n\t\tdocument.write(check(i) + \"<br>\");\n\t}\n\n}", "title": "" }, { "docid": "e0efc0509adec765da2beda933e494bf", "score": "0.706824", "text": "function fizzbuzz(num){\n for (var i=1; i <= num; i++){\n if (i % 5 === 0 && i % 3 === 0){\n console.log('FizzBuzz');\n }\n else if (i % 3 === 0) {\n console.log(\"Fizz\");\n }\n else if (i % 5 === 0) {\n console.log(\"Buzz\");\n }\n else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "36f346d512fe8257a4eaa9458b441fca", "score": "0.7064288", "text": "function fizzBuzz(n) {\n for ( var i = 1; i <= n; i++ ) {\n try {\n if ( ( ( i / 3 ) % 1 === 0 ) && ( ( i / 5 ) % 1 === 0 )) {\n console.log(\"fizzBuzz\");\n } else if ( ( i / 3 ) % 1 === 0 ) {\n console.log(\"fizz\");\n } else if ( ( i / 5 ) % 1 === 0 ) {\n console.log(\"Buzz\");\n } else {\n console.log( i );\n }\n }\n catch(TypeError) {\n console.log(\"Parameter must be a positive number.\")\n }\n }\n}", "title": "" }, { "docid": "1d9a09987496ac370d8d59cf7ed86e94", "score": "0.7061969", "text": "function fizzBuzz(){\nfor (i = 1; i <= 100; i++) {\n if ( i % 3 === 0 && i % 5 === 0 )\n { \n console.log(i + \" FizzBuzz\")\n } \n else if ( i % 3 === 0 )\n {\n console.log(i + \" Fizz\")\n }\n else if (i % 5 === 0 )\n {\n console.log(i + \" Buzz\")\n }\n else\n {\n console.log(i)\n }\n }\n}", "title": "" }, { "docid": "0d77b74a1122f34b790edd30eaadafa4", "score": "0.7053327", "text": "function FizzBazz2(a){\n var c = '';\n a%2 == 0? c='Fizz':c='';\n a%3 == 0? c+='Buzz':c=c;\n return c==''? a :c;\n}", "title": "" }, { "docid": "858951687e0d3aa2b266035c1e1f3967", "score": "0.70518434", "text": "function doFizzBuzz(incomingNumber) {\n// find out if it's a multiple of 5\n\n\tif(incomingNumber % 5 === 0 ) {\n\t\tconsole.log(\"fizz\");\n\t}\n\t// find out if its a multiple of 3\n\telse(incomingNumber % 3 === 0) {\n\t\tconsole.log(\"buzz\");\n\t}\n}", "title": "" }, { "docid": "45e9a1d675964573e69da939d99c49d7", "score": "0.70363665", "text": "function fizzBuzz() {\n for (i = 1; i <= 100; i++) {\n\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"FizzBuzz\");\n }\n\n else if (i % 3 === 0) {\n console.log(\"Fizz\");\n }\n\n else if (i % 5 === 0) {\n console.log(\"Buzz\");\n }\n\n else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "5e0d92a8e0fdaffe049d4626319b5132", "score": "0.70362085", "text": "function fizzBuzzV2(countTo) {\n var playedGame = [];\n for (var i=1; i<=countTo; i++){\n if(i%fizzbuzz===0){\n playedGame.push(\"fizzbuzz\");\n }\n else if(i%buzz===0){\n playedGame.push(\"buzz\");\n }\n else if(i%fizz===0){\n playedGame.push(\"fizz\");\n }\n else{\n playedGame.push(i);\n }\n }\n return playedGame;\n}", "title": "" }, { "docid": "4ed8357ac4c4291b7792d1eb83dbf112", "score": "0.7034871", "text": "function preFizz(n) {\n numbers = [];\n\n for(i=0; i < n; i++){\n numbers.push(i + 1);\n }\n\n return numbers;\n}", "title": "" }, { "docid": "0783e778105ddf77d26760f9f3bbdccc", "score": "0.7034863", "text": "function fizzBuzz(n) {\n // Write your code here\n let str = \"\";\n for (let i = 1; i <= n; i++) {\n if (i % 3 === 0 && i % 5 !== 0) {\n str += \"Fizz \";\n } else if (i % 5 === 0 && i % 3 !== 0) {\n str += \"Buzz \";\n } else if (i % 5 === 0 && i % 3 === 0) {\n str += \"FizzBuzz \";\n } else {\n str += `${i} `;\n }\n }\n return str.trim();\n}", "title": "" }, { "docid": "92a1190f483576cb631c2c4e49de88fa", "score": "0.702761", "text": "function fizzBuzz() {\n var x = 1\n while (x <= 100) {\n if (x % 15 === 0) {\n console.log(\"FizzBuzz\");\n }\n else if (x % 5 === 0) {\n console.log(\"Buzz\");\n }\n else if (x % 3 === 0) {\n console.log(\"Fizz\");\n }\n else {\n console.log(x);\n }\n x ++;\n }\n}", "title": "" }, { "docid": "a31c64c7a8225fef34a2ff5a6475b58d", "score": "0.7018219", "text": "function fizzbuzz() {\n for (let i = 1; i <= 100; i++) {\n if (i % 3 === 0 && i % 5 === 0) {\n console.log(\"Fizzbuzz\");\n } else if (i % 3 === 0) {\n console.log(\"Fizz\");\n } else if (i % 5 === 0) {\n console.log(\"Buzz\");\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "cd08b3bbbc71f6b04debf95589826d1f", "score": "0.7005412", "text": "function preFizz(n) {\n var arr = [];\n for (var i = 1; i <= n; i++){\n arr.push(i);\n }\n return arr;\n}", "title": "" }, { "docid": "aed1e918ce0112d5badbf5fbc9c4ba0b", "score": "0.7004853", "text": "function fizzBuzz(param1, param2){\nfor(var i = param1;i <=param2;i++){\n if(i % 3 === 0 && i % 5 === 0){\n console.log(\"fizzBuzz\");\n }else if(i %3 ===0){\n console.log(\"fizz\");\n }else if(i %5 ===0){\n console.log(\"buzz\");\n }else{\n console.log(i);\n }}\n}", "title": "" }, { "docid": "5de99c973f0b98c5d7630333d96c32e3", "score": "0.6991005", "text": "function fizzBuzz(num1, num2, range) {\n//Create a loop. Begin with the keyword `for`. Initialize (var = 0), set the condition (i <= range), and add increment expression (i++).\n for (var i = 0; i <= range; i++) {\n//Begin conditional if/ else if/else statement. Set the condition between parenthesis (i % num1 === 0 && i % num2 === 0).\n if (i % num1 === 0 && i % num2 === 0) {\n//Print the string *fizzbuzz* to the console if the condition above evaluates to `true`.\n console.log('fizzbuzz');\n//Set a second condition (i % num1 === 0) to be read if the statment above evaluates to `false`.\n } else if (i % num1 === 0) {\n//Print the string *fizz* to the console if the second condition above evaluates to `true`.\n console.log('fizz');\n//Set a third condition (i % num2 === 0) to be read if both of the statements above evaluate to `false`.\n } else if (i % num2 === 0) {\n//Print the string *buzz* to the console if the third condition above evaluates to `true`.\n console.log('buzz');\n//Present the end of our conditional. If all of the above statements evaluate to `false`...\n } else {\n//...Print *i* to the console.\n console.log(i);\n//Close the conditional\n }\n// Close the loop\n }\n//Close the function\n}", "title": "" }, { "docid": "2863b75db31f9118998edb2608a7f543", "score": "0.698413", "text": "function fizzBuzz(max){\n\n resulting_array2 = [];\n\n for (i = 1; i < max; i++) {\n\n if (((i % 3 === 0) ||(i % 5 === 0)) && (!(i % 15 === 0))) {\n resulting_array2.push(i);\n }\n\n }\n\n return resulting_array2;\n\n}", "title": "" }, { "docid": "f23bf57baba6d06c9764931f5feade70", "score": "0.69765186", "text": "function fizzBuzz() {\n for (let i = 1; i < 16; i++) {\n if (i % 3 === 0 && i % 5 !== 0) {\n console.log('fizz');\n } else if (i % 5 === 0 && i % 3 !== 0) {\n console.log('buzz');\n } else if (i % 3 === 0 && i % 5 === 0) {\n console.log('fizzbuzz');\n } else { \n console.log(i);\n }\n\n}\n}", "title": "" }, { "docid": "ee0f0c85565ce9d6f20b5aa33fcce357", "score": "0.6963319", "text": "function fizzBuzz(num) {\n var fizz = i % 3 === 0;\n var buzz = i % 5 === 0;\n for (var i = 1; i < num; i++) {\n if (fizz && buzz) {\n console.log(\"fizz buzz\")\n } else if (fizz) {\n console.log(\"fizz\")\n } else if (buzz) {\n console.log(\"buzz\")\n } else {\n console.log(i)\n }\n }\n }", "title": "" }, { "docid": "23a41d0a8fd0e28434a08de26dd2ad6b", "score": "0.6962562", "text": "function fizzBuzz(num1, num2, range) {\n//create a for loop with an initial expression of 0, that runs as long as i is less than or equal\n//to the range, and increment it.\n for (var i = 0; i <= range; i++) {\n//add a conditional else-if to the function. if the remainder of i divided by\n//num1 is exactly equal to 0 AND the remainder of i divided by num2 also is exactly equal to zero\n//print 'fizzbuzz' to the console.\n if (i % num1 === 0 && i % num2 === 0) {\n console.log('fizzbuzz')\n//if the remainder of i divided by num1 is exactly zero, print 'fizz' to the console\n } else if (i % num1 === 0) {\n console.log('fizz')\n//if the remainder of i divided by 2 is exactly zero, print 'buzz' to the console\n } else if (i % num2 === 0) {\n console.log('buzz')\n//if none of these conditions are true, print i to the console.\n } else {\n console.log(i)\n }\n }\n}", "title": "" }, { "docid": "5dfd377ff59dc266f289d06d39ca0957", "score": "0.69552416", "text": "function fizzBuzz() {\r\n for (let i = 0; i <= 100; i++) {\r\n if (i % 3 === 0 && i % 5 === 0) { // i % 15 === 0 will include both 3 & 5 multiples.\r\n console.log('FizzBuzz')\r\n } else if (i % 3 === 0) { // Using modular operator.\r\n console.log('Fizz');\r\n } else if (i % 5 === 0) {\r\n console.log('Buzz')\r\n } else {\r\n console.log(i);// console.log(i);// Prints all numbers from 0-100 in console.\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "c30900eede16974df90997b03b009bea", "score": "0.69435453", "text": "function fizzBuzz(num) {\n // Using a loop, iterate from 1 to a given number\n for (var i = 1; i <= num; i++) {\n // If the number is divisible by 15, output to the FizzBuzz console\n if (i % 15 === 0) console.log('FizzBuzz');\n // If the number is divided by 3, output to the \"Fizz\" console\n else if (i % 3 === 0) console.log('Fizz');\n // If the number is divided by 3, output to the \"Buzz\" console\n else if (i % 5 === 0) console.log('Buzz');\n // Show all other numbers in the console\n else console.log(i);\n }\n}", "title": "" }, { "docid": "bde807e6836e63dca879011684082a92", "score": "0.69350404", "text": "function fizzbuzzKing(num, a, b){\n let fbArr = [];\n for(let i = 0; i <= num; i++) {\n if(i % a === 0 && i % b === 0) {\n fbArr.push('fizzbuzz');\n } else if(i % a === 0) {\n fbArr.push('fizz');\n }else if(i % b === 0) {\n fbArr.push('buzz');\n }else{\n fbArr.push(i)\n }\n }\n return fbArr;\n }", "title": "" }, { "docid": "9e797d97ba6ca5542da559ec841079b0", "score": "0.693212", "text": "function fizzbuzz(number){\n var string = \"\"\n for (var i=1; i<=number ;i++){\n if((i%3!==0)&&(i%5!==0)){\n string += '.'\n }\n else if((i%3===0)&&(i%5!==0)){\n string += 'fizz'\n }\n else if((i%3!==0)&&(i%5===0)){\n string += 'buzz'\n }\n else if((i%3===0)&&(i%5===0)){\n string += 'fizzbuzz'\n }\n }\n return string\n}", "title": "" }, { "docid": "456a1d2e41e5ace5c71c9c6c5acafb8f", "score": "0.6884885", "text": "function fizzbuzz(x){\n if (typeof(x) !== 'number')return 'not a number';\n if (x%3 ===0 && x%5 ===0)return \"fizzbuzz\";\n else if (x%5 ===0)return \"buzz\";\n else if (x%3 ===0)return \"fizz\";\n else return x;\n}", "title": "" }, { "docid": "df9a996110a6df773fb2080671910348", "score": "0.6857225", "text": "function fizzBuzz(num1, num2, range) {\n// A Loop is being started, variable i is the index starting at 0 if I is less than or equal to range increments will be 1.\n for (var i = 0; i <= range; i++) {\n//An if-statement is checking for conditionals. if the index can be divided evenly by num1 and num2 console.log fizzbuzz.\n if (i % num1 === 0 && i % num2 === 0) {\n console.log('fizzbuzz');\n// If index is divisable by num1 and the remander is 0 and also not divisible by num2 then console.log fizz\n } else if (i % num1 === 0) {\n console.log('fizz');\n// If index is divisable by num2 and the remainder is 0 and also not divisable by num1 consolw.log buzz.\n } else if (i % num2 === 0) {\n console.log('buzz');\n// Else console.log Index\n } else {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "a1d6aff315ec2f2165bd7d55dda8b8ec", "score": "0.6855085", "text": "function fizzBuzz(num1, num2) {\n // init for loop to iterate from 1 to 100 inclusive. Start: i = 1, stop: i <= 100, update i++\n for (var i = num1; i <= num2; i++) {\n //if current value is multiple of 3 AND 5\n if (i % 3 === 0 && i % 5 === 0) {\n //print \"FizzBuzz\" in place of number\n console.log(\"fizzbuzz\");\n }\n else if \n //if current value is multiple of 3\n (i % 3 === 0) {\n //print \"Fizz\" in place of number\n console.log(\"fizz\");\n }\n else if\n //if current value is multiple of 5\n (i % 5 === 0) {\n //print \"Buzz\" in place of number\n console.log(\"buzz\");\n }\n else {\n //if current value is not multiple of 3 or 5, and not multiple of 3 AND 5, print value to console\n console.log(i);\n }\n \n }\n}", "title": "" }, { "docid": "eb83ed182f767186c1fd9502a4167651", "score": "0.6851913", "text": "function fizzBuzz(input) {\n if (typeof input !== 'number') {\n return console.log(\"Not a number\");\n }\n if ((input % 3 === 0) && (input % 5 === 0)) \n return console.log(\"fizzbuzz\");\n else if (input % 3 === 0) {\n return console.log(\"fizz\")\n } else if (input % 5 === 5)\n return console.log(\"buzz\")\n else\n return input;\n}", "title": "" }, { "docid": "03b5b99ca8b0a82c81968b5656d05820", "score": "0.6834857", "text": "function fizzbuzzifynumber (input) {\n if (input % 3 === 0 && input % 5 === 0) {\n return \"fizzbuzz\";\n }\n if (input % 3 === 0) {\n return \"fizz\";\n }\n if (input % 5 === 0) {\n return \"buzz\";\n }\n return input\n}", "title": "" }, { "docid": "82f520e43c8b259696cc6e3441f30186", "score": "0.6834665", "text": "function fizzBuzz(num1, num2, range) {\n //this is a loop that starts wit 0 count and goes until the loop count be less or equal to the range parameter.\n for (var i = 0; i <= range; i++) {\n //this is an If condition with 2 conditions with a Logical operator AND &&\n //(if i module: the division of i and num1 has a reminder that is strict equal 0\n // AND i module: the division of i and num2 has a reminder that is strict equal zero)\n // both conditions need to be true for the code to run.\n if (i % num1 === 0 && i % num2 === 0) {\n //if both conditions are true the console will log \"fizzbuzz\"\n console.log('fizzbuzz');\n //if the condition is not met the computer will go to else if to check the condition :\n // i module num1 striclty equals 0\n } else if (i % num1 === 0) {\n // if this condition is true the computer will run the log and print fizz to the console\n console.log('fizz');\n // if the condition is not met the computer will go to this next condition :\n //i module num2 is striclty equal to 0\n } else if (i % num2 === 0) {\n //if the condition is true the computer will print buzz to the terminal.\n console.log('buzz');\n //if non of the conditions above are met the computer will run the else\n } else {\n // the computer will print to the log the value of i.\n console.log(i);\n //curly braces to indicate the closure of the if conditions\n }\n //curly braces to indicate the closure of the looping\n }\n //curly braces to indicate the closure of the function.\n}", "title": "" }, { "docid": "5652632555f34c1ea5927f7aa9349ec6", "score": "0.682502", "text": "function fizzbuzz(start, end) {\n var temp = 0;\n \n if (start > end) {\n temp = start;\n start = end;\n end = temp;\n }\n \n for (start; start <= end; start++) {\n if (start % 3 === 0 && start % 5 === 0) {\n console.log('fizzbuzz')\n }\n else if (start % 3 === 0) {\n console.log('fizz');\n }\n else if (start % 5 === 0) {\n console.log('buzz');\n }\n else {\n console.log(start);\n }\n }\n}", "title": "" }, { "docid": "406e18462443d98e0cc5f274d4dd33e0", "score": "0.6809763", "text": "function fizzBuzz2() {\n for (let index = 1; index <= 100; index++) {\n const number = index;\n const divisibleBy3 = number % 3 === 0;\n const divisibleBy5 = number % 5 === 0;\n\n if (divisibleBy3 && !divisibleBy5) {\n console.log(\"Fizz\");\n } else if (divisibleBy5 && !divisibleBy3) {\n console.log(\"Buzz\");\n } else if (divisibleBy3 && divisibleBy5) {\n console.log(\"FizzBuzz\");\n } else {\n console.log(number);\n }\n }\n}", "title": "" } ]
e7072f404dd1dd6287504266c8962ead
Fill Form To Edit/Delete Book
[ { "docid": "bcb15d07eb975174ee85b6f588530936", "score": "0.6109309", "text": "function renderToForm(bookName, bookAuthor, bookPages, bookStatus) {\r\n document.querySelector(UISelectors.bookTitle).value = bookName;\r\n document.querySelector(UISelectors.bookAuthor).value = bookAuthor;\r\n document.querySelector(UISelectors.bookPages).value = bookPages;\r\n document.querySelector(UISelectors.bookStatus).value = bookStatus;\r\n\r\n // Validate check box\r\n if (bookStatus === \"Done\") {\r\n return document.querySelector(UISelectors.bookStatus).checked = true;\r\n } else {\r\n return document.querySelector(UISelectors.bookStatus).checked = false;\r\n };\r\n}", "title": "" } ]
[ { "docid": "bd78e459c23978d02cc5160df95f6a25", "score": "0.71498555", "text": "static displayEditOptions(book) {\n document.getElementById(\"title\").value = book.title;\n document.getElementById(\"author\").value = book.author;\n document.getElementById(\"total\").value = book.pagesTotal;\n document.getElementById(\"read\").value = book.pagesRead;\n document.getElementById(\"book.rating\").checked = 1;\n this.editBtn();\n }", "title": "" }, { "docid": "bf6f77e1f1168da7a1617b29bccbaffd", "score": "0.68681765", "text": "function editBookCard(b) {\n form.start(false, ID);\n }", "title": "" }, { "docid": "90da43c1c58f3de2f4815183781ec310", "score": "0.6723923", "text": "function getBook(e){\n\n // Get the Values\n const titleVal = title.value;\n const authorVal = author.value;\n const isbnVal = isbn.value;\n\n \n\n // Validate \n if(titleVal === '' || authorVal === '' || isbnVal === ''){\n\n const ui = new UI();\n ui.showAlert('Please Fill In All the Fields', 'error');\n\n } else {\n\n // Book Instance\n const book = new Book(titleVal,authorVal,isbnVal);\n\n const ui = new UI();\n\n ui.addBookToList(book);\n ui.clearFields();\n ui.showAlert('Book Added', 'success');\n\n // Add Book to LS\n Store.addBook(book);\n }\n e.preventDefault();\n}", "title": "" }, { "docid": "40aaf17032f5b917f165c07a54b6a3f9", "score": "0.6592061", "text": "function editBook(el) {\n item = $(el).parent().attr('data-itemid');\n console.log(item);\n var obj = JSON.parse(localStorage.getItem(item));\n $('#author').val(obj.Author);\n $('#title').val(obj.Title);\n $('#year').val(obj.Year);\n $('#pageNumber').val(obj.Pages);\n $(\"form input[type='submit']\").attr(\"onclick\", \"return update();\").attr(\"value\", \"Update\");\n}", "title": "" }, { "docid": "6ee8e534cdc42cffb0d038bfd94e639c", "score": "0.65256727", "text": "function newBook(e){\r\n e.preventDefault();\r\n // value guli pass hobe sei guli k nite\r\n let title=document.querySelector('#title').value,\r\n author=document.querySelector('#author').value,\r\n isbn=document.querySelector('#isbn').value; \r\n \r\n //validation\r\n \r\n \r\n \r\n if(title===''||author===''||isbn===''){ //check input field khali naki full\r\n UI.showAlert(\"Please fill all the fields\", \"error\"); \r\n }\r\n else{\r\n // new object call kora book er jonno\r\n let book=new Book(title,author,isbn);\r\n // form k book add korte new book k addToBooklist function dia call kora\r\n \r\n UI.addToBooklist(book);\r\n // book add haor pore seta akta massage show korbe\r\n UI.showAlert(\"Book Added!\", \"success\"); \r\n // book add haor pore sei input field k khali kore dibe\r\n UI.clearFields();\r\n\r\n // local store a add korte value\r\n Store.addBook(book); // book add korle seta k nia local stroage a nibe\r\n }\r\n \r\n\r\n \r\n\r\n}", "title": "" }, { "docid": "5fd27fd50f699c2d903e71e08a21d798", "score": "0.6360978", "text": "function setBookForEditing(bookToEdit)\n{\n\tconst editableBook = editBookTemplate.content.cloneNode(true).children[0];\n\tconst key = bookToEdit.getAttribute('data-key');\n\n\tlet [,, title, author, pageNum, hasRead] = bookToEdit.children;\n\n\t// get title\n\ttitle = title.textContent;\n\n\t[author, pageNum, hasRead] = [author, pageNum, hasRead].map((variable) =>\n\t{ // split string from ': ' and trim to get the other values\n\t\t[, variable] = variable.textContent.split(': ');\n\t\treturn variable.trim();\n\t});\n\n\teditableBook.setAttribute('data-key', key);\n\teditableBook.querySelector('.title input').value += title;\n\teditableBook.querySelector('.author input').value += author;\n\teditableBook.querySelector('.pageNum input').value += pageNum;\n\n\tconst radioBtns = editableBook.querySelectorAll('.hasRead input');\n\tswitch(hasRead)\n\t{ // turn hasRead into a boolean\n\t\tcase 'true':\n\t\t\thasRead = true;\n\t\t\tradioBtns[0].checked = true;\n\t\t\tbreak;\n\n\t\tcase 'false':\n\t\t\thasRead = false;\n\t\t\tradioBtns[1].checked = true;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\thasRead = undefined;\n\t\t\tbreak;\n\t}\n\n\t// prevent multiple book's radio buttons from sharing names\n\tconst randName = makeid();\n\tfor(const radioBtn of radioBtns)\n\t{\n\t\tradioBtn.name = randName;\n\t}\n\n\teditableBook.querySelector('.delete').addEventListener('click', (e) =>\n\t{\n\t\tdeleteBook(e.target.parentElement);\n\t});\n\n\teditableBook.querySelector('.cancelEdit').addEventListener('click', () =>\n\t{\n\t\treplaceElInLibrary(bookToEdit, editableBook);\n\t});\n\n\teditableBook.querySelector('.confirmEdit').addEventListener('click', () =>\n\t{\n\t\tconfirmEdit(editableBook);\n\t});\n\n\treplaceElInLibrary(editableBook, bookToEdit);\n}", "title": "" }, { "docid": "ec9827dbcf50df4247974ae8b4010810", "score": "0.6356203", "text": "OnUpdateBook(form) {\n this.submitted = true;\n if (form.valid) {\n const update = {\n id: this.book.id,\n changes: Object.assign(Object.assign({}, this.book), form.value),\n };\n this._store.dispatch(_store_actions_books_actions__WEBPACK_IMPORTED_MODULE_1__[\"bookActionTypes\"].updateBook({ update }));\n }\n }", "title": "" }, { "docid": "d0e5218dec0fed1e9c5d6555b6aea13e", "score": "0.62982154", "text": "function editBook(id) {\n bookCol.innerHTML = '';\n axios.get(`https://rocky-castle-97526.herokuapp.com/books/${id}`).then(result => {\n makeEditableCard(result.data);\n });\n}", "title": "" }, { "docid": "80d0fb8c3bfb8dabc98b1c8701257ad9", "score": "0.6285244", "text": "function sendBook(e) {\n // prevent the submit button from sending the form\n e.preventDefault();\n addBookToLibrary(newtitle.value, newauthor.value, newpages.value, newread.checked);\n render();\n newtitle.value = '';\n newauthor.value = '';\n newpages.value = '';\n newread.value = '';\n}", "title": "" }, { "docid": "eaf039962f8e85ce5614668fd5420f71", "score": "0.628156", "text": "function addTheBook(e) {\r\n // prevent default\r\n e.preventDefault();\r\n // Get form values\r\n const title = document.querySelector('#title').value;\r\n const author = document.querySelector('#author').value;\r\n const deadline = document.querySelector('#deadline').value;\r\n\r\n // Validate\r\n if (title === '' || author === '' || deadline === '') {\r\n UI.showAlert('Formalarni bo`sh qoldirmang', 'danger')\r\n } else {\r\n // instantiate book\r\n const book = new Book(title, author, deadline);\r\n\r\n // Add book to list\r\n UI.addBookToList(book);\r\n\r\n // Show success message\r\n UI.showAlert('Kitob muvaffaqiyatli qo`shildi!', 'success')\r\n\r\n // Clear fields\r\n UI.clearFields();\r\n\r\n // Add to localStorage\r\n Store.addBook(book);\r\n }\r\n}", "title": "" }, { "docid": "fdcfb0a8676c219abe8dd4df7a88eb8d", "score": "0.62553835", "text": "function newBook(e) {\r\n e.preventDefault();\r\n let book = new Book(title.value, author.value, isbn.value);\r\n if (title.value === '' || author.value === '' || isbn.value === '') {\r\n BookRow.showMessage(\"Missing Field(s)\", \"error\");\r\n } else {\r\n BookRow.addToBookList(book);\r\n BookRow.clearTextFields();\r\n BookRow.showMessage(\"Book Added!!!\", \"success\");\r\n //storing into the local storage\r\n Store.addBook(book)\r\n }\r\n}", "title": "" }, { "docid": "d5fc6c2b86374ef6cc3a76e5471a2586", "score": "0.6217995", "text": "function getBookInfo(e) {\n\te.preventDefault();\n\n\t// Get correct book\n\tconst bookInfoId = bookInfoForm.querySelector('#bookInfoId').value\n\t// Call displayBookInfo()\t\n\tdisplayBookInfo(libraryBooks[bookInfoId])\n}", "title": "" }, { "docid": "2e549adc9aaab3eb2766519332b9748a", "score": "0.6203641", "text": "static addBook(e) {\r\n //prevent default behavior of form.\r\n e.preventDefault();\r\n\r\n //Read inputs from UI\r\n let title = bookTitleEL.value,\r\n author = bookAuthorEL.value,\r\n isbn = isbnEL.value;\r\n\r\n //Reset UI form elements.\r\n bookTitleEL.value = '';\r\n bookAuthorEL.value = '';\r\n isbnEL.value = '';\r\n \r\n let ISBNlist = [];\r\n let booksInDB = Store.getBook();\r\n booksInDB.forEach(function(book){\r\n ISBNlist.push(book.isbn);\r\n });\r\n\r\n //Check for mandatory fields and message if needed.\r\n if (title === '' || author === '' || isbn === '') {\r\n UI.setMessage('Enter in all fields !!', 'danger');\r\n } else if (ISBNlist.indexOf(isbn) != -1) {\r\n UI.setMessage('Book cannot be added. ISBN already exists !!', 'warning');\r\n }\r\n else {\r\n UI.displayBook(title, author, isbn);\r\n Store.addBook(new Book(title, author, isbn));\r\n UI.setMessage('Book added succesfully !!', 'success');\r\n }\r\n }", "title": "" }, { "docid": "f333d599052d92b56aecab195ecde388", "score": "0.6178344", "text": "function getBookForm() {\n // Get form fields\n const bId = document.getElementById(\"BookId\").value;\n const catId = document.getElementById(\"CategoryId\").value;\n const bName = document.getElementById(\"BookName\").value;\n const bDesc = document.getElementById(\"BookDescription\").value;\n const bStock = document.getElementById(\"BookStock\").value;\n const bPrice = document.getElementById(\"BookPrice\").value;\n\n // build Book object for Insert or Update\n // required for sending to the API\n const bookObj = {\n BookId: bId,\n CategoryId: catId,\n BookName: bName,\n BookDescription: bDesc,\n BookStock: bStock,\n BookPrice: bPrice,\n };\n\n // return the body data\n return bookObj;\n}", "title": "" }, { "docid": "7fb848a57e8e6cb4543713b29ecad7b4", "score": "0.6177188", "text": "function handleSubmit(event) {\n event.preventDefault();\n\n fetch(url + '/edit', {\n method: 'PUT',\n headers: {\n 'content-type': 'application/json; charset=UTF-8'\n },\n body: JSON.stringify(book)\n })\n .then(response => response.json())\n .then(data => {\n setCreatedId(data._id);\n })\n .catch(() => {\n setError(true);\n });\n }", "title": "" }, { "docid": "05d743c243b0c550f9251b5fcda1bc86", "score": "0.61753446", "text": "function submitFormDetails(e) {\n\tlet enteredAuthor = document.getElementById(\"Author\").value;\n\tlet enteredTitle = document.getElementById(\"Title\").value;\n\tlet enteredPages = document.getElementById(\"pages\").value;\n\tlet enteredReadStatus = document.getElementById(\"read\");\n\tlet isread;\n\tif (enteredReadStatus.checked) isread = \"true\";\n\telse isread = \"false\";\n\tlet newBook = {\n\t\tauthor: enteredAuthor,\n\t\ttitle: enteredTitle,\n\t\tnumOfPages: parseInt(enteredPages),\n\t\tisRead: isread,\n\t};\n\tif (!isValid(newBook)) return;\n\twrongDetails.style.display = \"none\";\n\taddBookToLibrary(newBook);\n\twhile (Books.firstChild) Books.removeChild(Books.firstChild);\n\tdisplayBooks();\n\tform.reset();\n\tform.style.display = \"none\";\n\tnewbook.style.color = \"black\";\n\tnewbook.style.backgroundColor = \"turquoise\";\n}", "title": "" }, { "docid": "3765210f25cf293520a754ff426dfa7e", "score": "0.6125041", "text": "static async saveBookEdit(data, id) {\n\t\tlet res = await this.request(`books/${id}`, data, 'patch');\n\t\treturn res.book;\n\t}", "title": "" }, { "docid": "6799a83d4896284599442a99098fcea6", "score": "0.60874695", "text": "function libraryFormSubmit(e) {\r\n console.log(\"You have submitted the library form\");\r\n\r\n //9 what is name author type\r\n let name = document.getElementById('bookName').value;\r\n let author = document.getElementById('author').value;\r\n // 11 check box \r\n let type;\r\n\r\n\r\n // 10 grap all the types friction , programming, thrilor\r\n let friction = document.getElementById('friction');\r\n let programming = document.getElementById('programming');\r\n let thrilor = document.getElementById('thrilor');\r\n\r\n\r\n if (friction.checked) {\r\n type = friction.value;\r\n }\r\n else if (programming.checked) {\r\n type = programming.value;\r\n\r\n }\r\n\r\n else if (thrilor.checked) {\r\n type = thrilor.value;\r\n }\r\n\r\n // 8 when we sumbit add the book it should go in one object so call book\r\n let book = new Book(name, author, type);\r\n //12 \r\n console.log(book);\r\n\r\n //13 to display in chrome table make display method\r\n let display=new Display();\r\n\r\n// 16 make a validate for a form\r\n if(display.validate(book)) {\r\n display.add(book);\r\n display.clear();\r\n display.show('success',' Your book has successfully added ')\r\n }\r\n else{\r\n //show error to user\r\n display.show('danger','Sorry You cannot add this book ');\r\n }\r\n\r\n\r\n //14 to clear screen when we add the name used clear the go to protype\r\n \r\n //7 the preventDefault is used bcoz when we run code the console.log statement is display for a second in chrome console so to hold\r\n //statement use the preventDefault so that it will not reload the page while click on add button\r\n e.preventDefault();\r\n}", "title": "" }, { "docid": "60e92f1ee153d8afa3886f0da3da75bd", "score": "0.6084903", "text": "function editBook(book){\n //saves the changes in the database\n var book =$http.put(urlBase + 'api/books', book).then(function(reponse){\n return reponse;\n });\n return book;\n }", "title": "" }, { "docid": "535be3fb8078e4255e44e9cad751760d", "score": "0.6079455", "text": "function makeEditableCard(data) {\n console.log(data);\n let authors = [];\n data.authors.forEach(author => {\n authors.push(`${author.firstName} ${author.lastName}`);\n })\n bookCol.appendChild(makeForm('title', data.id, data.title));\n bookCol.appendChild(document.createElement('br'))\n bookCol.appendChild(makeForm('genre', data.id, data.genre));\n bookCol.appendChild(document.createElement('br'))\n bookCol.appendChild(makeForm('description', data.id, data.description));\n bookCol.appendChild(document.createElement('br'))\n bookCol.appendChild(makeForm('authors', data.id, authors));\n bookCol.appendChild(document.createElement('br'))\n bookCol.appendChild(makeForm('coverUrl', data.id, data.coverUrl));\n bookCol.appendChild(document.createElement('br'))\n bookCol.appendChild(makeButton('submit', data.id));\n}", "title": "" }, { "docid": "2f8958fd5769d4cf37d694e917e8000d", "score": "0.6077844", "text": "render(){\n\t\t// this is where we create the list of book IDS to delete a specific book and all that fun stuff!\n\t\tconst booksList = this.props.books.map(function(booksArr){\n\t\t\treturn (\n\t\t\t\t<option key={booksArr._id}>{booksArr._id}</option>\n\t\t\t)\n\t\t})\n\t\treturn(\n\t\t\t<Well>\n\t\t\t<Panel>\n\t\t\t<FormGroup controlId=\"title\">\n\t\t\t<ControlLabel>Title</ControlLabel>\n\t\t\t<FormControl type=\"text\" placeholder=\"Enter Title\" ref=\"title\" />\n\t\t\t<ControlLabel>Description</ControlLabel>\n\t\t\t<FormControl type=\"text\" placeholder=\"Enter Description\" ref=\"discription\" />\n\n\t\t\t<ControlLabel>Title</ControlLabel>\n\t\t\t<FormControl type=\"text\" placeholder=\"Enter Price\" ref=\"price\" />\n\t\t\t</FormGroup>\n\n\t\t\t<Button onClick={this.handleSubmit.bind(this)} bsStyle=\"primary\">Save Book</Button>\n</Panel>\n<Panel style={{marginTop:'25px'}}>\n\t<FormGroup controlId=\"formControlsSelect\">\n\t\t<ControlLabel>Select a id book to Delete</ControlLabel>\n<FormControl ref=\"delete\" componentClass=\"select\" placeholder=\"select\">\n\t<option value=\"select\">select</option>\n{booksList}\n</FormControl>\n</FormGroup>\n<Button onClick={this.onDelete.bind(this)} bsStyle=\"danger\">Delete Book</Button>\n</Panel>\n</Well>\n)\n\n}", "title": "" }, { "docid": "d43a459cc955326d3e0b049a169c6ace", "score": "0.60728306", "text": "function edit(uuid) {\r\n\t// pop-up window\r\n\t$('#editDlg').dialog('open');\r\n\r\n\t// load data\r\n\t// first clear form data then load new data\r\n\t$('#editForm').form('clear');\r\n\t_method = \"update\";\r\n\r\n\t$('#editForm').form('load', name+'_get?id=' + uuid); // 读取表单的URL\r\n\r\n}", "title": "" }, { "docid": "e146458e1fbddcb07b7ab1ce8d234831", "score": "0.6070666", "text": "function handleFormSave(event) {\n event.preventDefault();\n console.log(book)\n API.saveBook({\n title: formObject.title,\n authors: formObject.authors,\n desription: formObject.description,\n image: formObject.image,\n link: formObject.link\n })\n .then(res => db.googlebooks)\n .catch(err => console.log(err));\n\n }", "title": "" }, { "docid": "5cd671e4f7b60a09d38b014dd8057d7e", "score": "0.6064635", "text": "function editEntry(numb) {\n $(\"#editCar\").modal(\"show\");\n let data = cars.filter(x => x.id === numb)[0];\n document.getElementById(\"makeEdit\").value = data.make;\n document.getElementById(\"modelEdit\").value = data.model;\n document.getElementById(\"yearEdit\").value = data.year;\n document.getElementById(\"priceEdit\").value = data.price;\n document.getElementById(\"descriptionEdit\").value = data.description;\n document.getElementById(\"removeEdit\").onclick = function () { deleteRemote(numb) };\n document.getElementById(\"saveEdit\").onclick = function () { saveEdited(numb) };\n}", "title": "" }, { "docid": "f6f1ffdfc1fb34fc5ea3dd784f6eabe9", "score": "0.6048503", "text": "handleEditClick(e) {\n let id = parseInt(e.target.dataset.id);\n let product = Product.findById(id);\n document.querySelector('#update').innerHTML = product.renderEditForm();\n }", "title": "" }, { "docid": "886c48514267d27125418fa8b907bb54", "score": "0.60249263", "text": "editForm(id, propietario, numero, cvv, fechaVencimiento, saldo){\n this.form.id = id;\n this.form.propietario = propietario;\n this.form.numero = numero;\n this.form.cvv = cvv;\n this.form.fecha = fechaVencimiento;\n this.form.saldo = saldo;\n this.formTitle = \"Editar Direccion\";\n }", "title": "" }, { "docid": "0e34c02060e133a333ae0e5299657789", "score": "0.59905696", "text": "function displayAuthorForm( event ) {\n\n let id = event.target.form['author-id'].value\n let fnameTD = document.getElementById( id + '-fname' );\n let lnameTD = document.getElementById( id + '-lname' );\n let fname = fnameTD.textContent;\n let lname = lnameTD.textContent;\n\n let editform = document.getElementById(\"author-edit-form\");\n \n document.getElementById(\"edit-author-id\").value = id;\n document.getElementById(\"edit-author-fname\").value = fname;\n document.getElementById(\"edit-author-lname\").value = lname;\n \n editform.style.display = \"block\";\n \n}", "title": "" }, { "docid": "69c66d7fe8df05e19fc99b90d65fe004", "score": "0.5987719", "text": "function libraryFormSubmit(e) {\n // get book name and author input value\n let name = document.getElementById(\"bookName\").value;\n let author = document.getElementById(\"author\").value;\n\n // get type input value\n let fiction = document.getElementById(\"fiction\");\n let programming = document.getElementById(\"programming\");\n let cooking = document.getElementById(\"cooking\");\n\n // get type input\n let type;\n if (fiction.checked) {\n type = fiction.value;\n }\n else if (programming.checked) {\n type = programming.value;\n }\n else if (cooking.checked) {\n type = cooking.value;\n }\n // console.log(name, author, type);\n\n // get Book object\n let book = new Book(name, author, type);\n // console.log(\"Book: \", book);\n\n // Implement or add book to your book store function\n if(display.validate(book)){\n let bookList = new Book();\n bookList.inserLocalStorage(book);\n display.add();\n display.show(\"success\", \"Your book has been successfully added.\");\n display.clear();\n }\n else {\n display.show(\"danger\", \"Sorry! you can not add this book.\")\n }\n\n e.preventDefault();\n}", "title": "" }, { "docid": "a17afd20eda8ca4dfaba615289666676", "score": "0.5987079", "text": "function editBook(id) {\n window.location.href = window.location.origin + '/book/' + id + '/edit'\n}", "title": "" }, { "docid": "1326b03dfea5f104536a89a136d92b7f", "score": "0.5979114", "text": "saveBookInDatabase(oEvent) {\n\n var bCreate = true;\n\n\t\t\tvar objectBook = {\n\t\t\t\tIsbn: \"\",\n\t\t\t\tAuthor: \"\",\n\t\t\t\tTitle: \"\",\n DatePublished: \"\",\n NumberOfAvailableBooks: \"\",\n\t\t\t\tLanguage: \"\",\n\t\t\t\tTotalNumberOfBooks: \"\"\n };\n \n var oSimpleForm = oEvent.getSource().getParent().getParent();\n var aItems = oSimpleForm.getFormElements();\n var oControl = aItems[0].getFields()[0];\n \n //isbn\n\t\t\tif (oControl.getValue().length !== 0) {\n\t\t\t\tobjectBook.Isbn = oControl.getValue();\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n \n //author\n\t\t\toControl = aItems[1].getFields()[0];\n\t\t\tif (oControl.getValue().length !== 0) {\n\t\t\t\tobjectBook.Author = oControl.getValue();\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n \n //title\n\t\t\toControl = aItems[2].getFields()[0];\n\t\t\tif (oControl.getValue().length !== 0) {\n\t\t\t\tobjectBook.Title = oControl.getValue();\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n \n //datepublished\n\t\t\toControl = aItems[3].getFields()[0];\n\t\t\tif (oControl.getValue().length !== 0) {\n\t\t\t\tobjectBook.DatePublished = oControl.getDateValue();\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n \n //available of books\n\t\t\toControl = aItems[4].getFields()[0];\n\t\t\tif (oControl.getValue().length !== 0) {\n var i = parseInt(oControl.getValue());\n\t\t\t\tobjectBook.NumberOfAvailableBooks = i;\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n\n //language\n\t\t\toControl = aItems[5].getFields()[0];\n\t\t\tif (oControl.getValue().length !== 0) {\n\t\t\t\tobjectBook.Language = oControl.getValue();\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n \n //number of books\n\t\t\toControl = aItems[6].getFields()[0];\n\t\t\tif (oControl.getValue().length !== 0) {\n var i = parseInt(oControl.getValue());\n\t\t\t\tobjectBook.TotalNumberOfBooks = i;\n\t\t\t\toControl.setValueState(\"None\");\n\t\t\t} else {\n\t\t\t\tbCreate = false;\n\t\t\t\toControl.setValueState(\"Error\");\n }\n \n this.getView().getModel().setUseBatch(false);\n \n this.getView().getModel().create(\"/Books\", objectBook,{ \n success: () => {\n MessageToast.show(\"Book Added Successfully!\");\n \n },\n error: () => {\n MessageToast.show(\"Error in adding book!\");\n }\n });\n }", "title": "" }, { "docid": "d5382d607d568e839df445632329d074", "score": "0.59647226", "text": "function fillEditStoryForm() {\n\t\t$editTitleInput.val(storyBeingEditted.title);\n\t\t$editAuthorInput.val(storyBeingEditted.author);\n\t\t$editUrlInput.val(storyBeingEditted.url);\n\t}", "title": "" }, { "docid": "fbaed68fc9d2d5a9d30495a6a792baca", "score": "0.59627897", "text": "function createObject(form) {\n book.autor = form.txtautor.value;\n book.titulo = form.txtitulo.value;\n book.editorial = form.seleditorial.options[form.seleditorial.selectedIndex].text;\n book.edicion = form.seledicion.options[form.seledicion.selectedIndex].text;\n book.pais = form.txtpais.value;\n showProperties(book, \"InfoBook\");\n}", "title": "" }, { "docid": "7cbae838c835e17bb14e489139f963cc", "score": "0.59576225", "text": "function getBookInfo(e) {\n\te.preventDefault();\n\n\t// Get correct book\n\tconst bookId = parseInt(document.querySelector('#bookInfoId').value)\n\tconst book = libraryBooks[bookId]\n\n\t// Call displayBookInfo()\n\tdisplayBookInfo(book)\n\n}", "title": "" }, { "docid": "f3a2ae9c5a5ac9cecbb73efb4585cacf", "score": "0.5941451", "text": "function fill_up_form_on_edit(){\n \tif(booking && booking != ''){\n\t\t\tvar master_passenger_details = booking[\"master_passenger\"];\n\n\t\t\t$('#master_passenger').children().each(function(){\n\t\t\t\tif(this.tagName == 'INPUT' || this.tagName == 'SELECT'){\n\t\t\t\t\tattr_name = this.id.substr(43, this.id.length)\n\t\t\t\t\t$(this).val(master_passenger_details[attr_name]);\n\t\t\t\t}\n\t\t\t});\n \n var num_of_people = Object.keys(booking[\"other_passengers\"]).length;\n build_dynamic_forms(num_of_people);\n\n $('.passengers').each(function(){\n \t$(this).children().each(function(){\n \t\tif(this.tagName == 'INPUT' || this.tagName == 'SELECT'){\n\t\t\t\t\t\tattr_name = this.id.substr(43, this.id.length)\n\t\t\t\t\t\t$(this).val(master_passenger_details[attr_name]);\n\t\t\t\t\t}\n \t});\n\n });\n\t\t}\n }", "title": "" }, { "docid": "7019bf5748b98b4c9b104ecfc64589dd", "score": "0.59373856", "text": "edit() {\n \n }", "title": "" }, { "docid": "536c605db2ac37bb1320e0c906718f08", "score": "0.59369016", "text": "function edit(e){\n\t\tvar field_selector, map = e.target.dataset, id = 0;\n\t\t\n\t\tsidebar.addClass( \"update\" );\n\t\t\n field.body = form.body[map.row][map.index];\n \n field_selector = $(\"#\" + field.body.field)\n \n activeTab('#update-tab');\n\t\tactiveAction(field_selector);\n\t\t\t\n \n\t\t\tif(field.body.field != 'description'){\n\t\t\t\tfor (var prop in field.body) {\n \n\t\t\t\t\tif (field.body.hasOwnProperty(prop) && prop !== 'field'){\n\t\t\t\t\t\n\t\t\t\t\t\tif(typeof field.body[prop] === 'string'){\n\t\t\t\t\t\t\tfield_selector.find('#' + prop).val(field.body[prop]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(typeof field.body[prop] === 'boolean'){\n\t\t\t\t\t\t\tfield_selector.find('#' + prop).prop('checked', field.body[prop]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdocument.getElementById('textdescription').firstChild.innerHTML = field.body.textdescription\n\t\t\t\t//field_selector.find(\"#textdescription\").first().html(field.body.textdescription)\n\t\t\t\t//editor.content = \n\t\t\t}\n\t\t\t\n\t\th.renderSelectUpdateItem(field)\t\n\t\t\t// $('#update span').find('input, textarea, select').on('keyup change', function (){});\n \n\t}", "title": "" }, { "docid": "09372b3c710f713fcd259d931f7c5696", "score": "0.5918483", "text": "function showBook(book) {\n var table = document.getElementById(\"data-table\");\n var row = document.createElement(\"tr\");\n var idCellContent = book.id + \" <input type='button' value='-' title='Delete' onclick='deleteBook(\" + book.id + \")' />\";\n appendCell(idCellContent, row);\n appendCell(book.author, row);\n appendCell(book.title, row);\n\n table.appendChild(row);\n}", "title": "" }, { "docid": "501ba1ef2fda332f8636dcb57ae2ed40", "score": "0.5903644", "text": "function displayEachBook() {\n const list = document.querySelector('#body');\n const row = document.createElement('tr');\n\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.pages}</td>\n <td class=\"update\">${book.status}</td>\n <td class=\"remove\"><i class=\"far fa-trash-alt\"></i></td>\n\n`\n list.appendChild(row);\n\n clearFields()\n }", "title": "" }, { "docid": "c4c1c590e6cf8223db3b6261bb70c5be", "score": "0.5898705", "text": "function removeBook(e){\r\n e.preventDefault();\r\n UI.deleteFromBook(e.target);\r\n \r\n}", "title": "" }, { "docid": "2ca4cb9518673c5188b7c0e45474dedb", "score": "0.58925766", "text": "function showBook(gast) {\n $(\"#message\").empty();\n $(\"#gastUUID\").val(gast.gastUUID);\n $(\"#vorname\").val(gast.vorname);\n $(\"#nachname\").val(gast.nachname);\n $(\"#address\").val(gast.address);\n $(\"#hausnummer\").val(gast.hausnummer);\n $(\"#plz\").val(gast.plz);\n $(\"#wohnort\").val(gast.wohnort);\n $(\"#land\").val(gast.land);\n $(\"#telefon\").val(gast.telefon);\n $(\"#mobil\").val(gast.mobil);\n $(\"#geburtsdatum\").val(gast.geburtsdatum);\n $(\"#mail\").val(gast.mail);\n $(\"#check_in\").val(gast.check_in);\n $(\"#check_out\").val(gast.check_out);\n\n\n if (Cookies.get(\"userRole\") != \"admin\") {\n $(\"#vorname, #nachname, #address, #hausnummer, #plz, #wohnort, #land, #telefon, #mobil, #geburtsdatum, #mail,#check_in,#check_out\").prop(\"readonly\", true);\n $(\"#save, #reset\").prop(\"disabled\", true);\n }\n}", "title": "" }, { "docid": "1b63b81fa4f42d190c30e0d07ffdf935", "score": "0.5888491", "text": "function getBookInfo(e) {\n\te.preventDefault();\n\n\t// Get correct book\n\tconst bookId = document.querySelector('#bookInfoId').value;\n\n\n\t// Call displayBookInfo()\n\ttry{\n\t\tif (bookId != \"\"){\n\t\t\tdisplayBookInfo(libraryBooks[bookId]);\n\t\t}\n\t}catch(e){\n\t\tconsole.log('Empty entry');\n\t}\n\n}", "title": "" }, { "docid": "f86000c794403702f72658839c6e3a58", "score": "0.58798003", "text": "function editEvent() {\n const editButton = document.querySelectorAll(\".edit-button\");\n editButton.forEach(btn => {\n btn.addEventListener(\"click\", function() {\n editMode = true;\n const book = btn.parentNode.parentNode;\n const bookIndex = Number(book.getAttribute(\"data-index\"));\n const bookObject = myLibrary[bookIndex];\n\n popUpTitle.textContent = \"Edit Book\";\n\n titleInput.value = bookObject.title;\n authorInput.value = bookObject.author;\n pagesInput.value = bookObject.pages;\n if (bookObject.read) {\n finishedInput.checked = true;\n } else {\n finishedInput.checked = false;\n }\n togglePopup(\"flex\")\n editIndex = bookIndex;\n })\n })\n}", "title": "" }, { "docid": "2f98c9f1ead8c0c230c09ee9cf5fcdc8", "score": "0.5879061", "text": "function deleteBook(e) {\n e.preventDefault();\n let id=e.target.getAttribute('data-id')\n API.deleteBook(id)\n .then(res => loadBooks())\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "b77dade21a1bf726aa121f45487efff6", "score": "0.5865892", "text": "OnAddBook(form) {\n this.submitted = true;\n if (form.valid) {\n this._store.dispatch(Object(_store_actions_books_actions__WEBPACK_IMPORTED_MODULE_1__[\"addBook\"])({ book: this.book }));\n }\n }", "title": "" }, { "docid": "7c08edc1fdb59804ff1b32a8efca5f0c", "score": "0.5861311", "text": "addBookToList(book){\n //console.log(book);\n //Get the form element\n const list = document.getElementById('book-list'); \n const row = document.createElement('tr');\n //console.log(row);\n\n row.innerHTML = `\n <td>${book.title}</td>\n <td>${book.author}</td>\n <td>${book.isbn}</td>\n <td><a id=\"delete_record\" class=\"btn text-danger btn-transparent pt-0\" href=\"#\">X</a></td>`;\n list.appendChild(row);\n }", "title": "" }, { "docid": "8a502da6ebf74a8f2d970b583f3320ab", "score": "0.58471954", "text": "function Edit (props) {\n return (\n <button className=\"btn\"\n data-bookid={props.bookID}\n onClick={() => {props.changeModal('editBook', props.bookID)}}\n id={`edit-btn-${props.bookID}`}\n >Edit\n </button>\n )\n}", "title": "" }, { "docid": "6970b60fb9de05da4f727e97bfa331ba", "score": "0.58405477", "text": "function getBookInfo(e) {\n\te.preventDefault();\n\n\t// Get correct book by the index\n\tlet book = libraryBooks[document.querySelector('#bookInfoId').value]\n\t// Call displayBookInfo()\t\n\tdisplayBookInfo(book)\t\n}", "title": "" }, { "docid": "50215dd6c95481152ac0daa35dec996e", "score": "0.5827435", "text": "function getEditAuthorForm(req, res) {\n Author.findById(req.params.authorsIdForEditForm, function(err, authorToEditFromDb) {\n res.render('authorsViews/edit', {\n authorToEditReferenceForEJS: authorToEditFromDb,\n title: `Edit ${authorToEditFromDb.name}`\n })\n })\n}", "title": "" }, { "docid": "d35596c417d429fae26fd4380e5dae13", "score": "0.5808661", "text": "clearInputs() {\r\n titleBook.value = '';\r\n authorBook.value = '';\r\n isbnBook.value = ''; \r\n}", "title": "" }, { "docid": "10d9b4814e7cc5dc5a7f8ed6bc4c564c", "score": "0.57998353", "text": "function addBooktoLibrary() {\n\t\n\t// Collect data from form\n\tlet author = document.querySelector('#fauthor').value;\n\tlet title = document.querySelector('#ftitle').value;\n\tlet pages = document.querySelector('#fpages').value;\n\tlet read = document.querySelector('#fread').checked;\n\t\n\t// Find index number through myLibrary array\n\tlet index = myLibrary.length;\n\t\n\t// Assign random color\n\tlet color = randomColor();\n\t\n\t// Create Book object \n\tlet book = createBook(title, author, pages, read, index, color);\n\t\n\t// Add book to myLibrary\n\tmyLibrary.push(book);\n\tpopulateStorage();\t\n\t\n\t// Hide form\n\tbookForm.classList.remove('formOpen');\n\t\n\t\n\t//CLEAR FORM\n\t\t// MODIFY: create a class for all, iterate through the class clearing text/value in for loop.\n\tdocument.querySelector('#fauthor').value = '';\n\tdocument.querySelector('#ftitle').value = '';\n\tdocument.querySelector('#fpages').value = '';\n\tdocument.querySelector('#fread').value = '';\n\t\n\t// Populate cards\n\t\n\trender();\n\t\n}", "title": "" }, { "docid": "160b5571fd27ab9f5b5bf9041236d8c6", "score": "0.57995147", "text": "function BookEditComponent(slService) {\n this.slService = slService;\n this.editMode = false;\n }", "title": "" }, { "docid": "48a8c1fb60a1af4a58f666658ef8b8f3", "score": "0.5787013", "text": "static createBook() {\r\n // Get form values from the modal \r\n const author = document.querySelector('.author').value;\r\n const title = document.querySelector('.book__title').value;\r\n const genres = document.querySelector('.genres').value;\r\n const isbn = document.querySelector('.isbn').value;\r\n if (!author || !title || !genres || !isbn) {\r\n return;\r\n } else {\r\n // Create div element for book card \r\n const newBook = new Book(author, title, genres, isbn);\r\n // Create bookCard div in the empty book div\r\n const bookCard = document.createElement('div');\r\n bookCard.classList.add('book__card');\r\n bookCard.innerHTML = `\r\n <div class='infoDiv'>\r\n <p class='infoStyle'>${newBook.author}</p>\r\n <p class='infoStyle'>${newBook.title}</p>\r\n <p class='infoStyle'>${newBook.genres}</p>\r\n <p class='infoStyle'>${newBook.isbn}</p>\r\n </div>\r\n <div class='flexDiv'>\r\n <button class='read'>✅</button>\r\n <button class='delete'>❌</button>\r\n </div>\r\n `;\r\n bookDiv.appendChild(bookCard);\r\n clearModal();\r\n clearModalContent();\r\n // Using bubbling to add eventlisteners on dynamic html buttons \r\n bookCard.addEventListener('click', function(e) {\r\n if (e.target.classList.contains('read')) {\r\n bookCard.style.background = '#1cf31c';\r\n }\r\n \r\n if (e.target.classList.contains('delete')) {\r\n bookDiv.removeChild(bookCard);\r\n }\r\n });\r\n }\r\n }", "title": "" }, { "docid": "b99d3389d47a665567d9d64217f90466", "score": "0.57846475", "text": "function editEntry(book) {\n const entryFields = currentEntry.querySelectorAll('.entry-field');\n const pos = Array.from(currentEntry.parentNode.querySelectorAll('.entry')).indexOf(currentEntry);\n\n const oldPage = Number(library[pos].pagesRead);\n const oldPagesTotal = Number(library[pos].pagesTotal);\n const newPage = Number(book.pagesRead);\n const newPagesTotal = Number(book.pagesTotal);\n\n if (oldPage === oldPagesTotal && newPage !== newPagesTotal) {\n booksCompleted--;\n } else if (oldPage !== oldPagesTotal && newPage === newPagesTotal) {\n booksCompleted++;\n }\n\n pagesRead += newPage - oldPage;\n pages += newPagesTotal - oldPagesTotal;\n editStatistics();\n\n library[pos] = book;\n saveLibrary();\n\n entryFields[0].textContent = `${book.title}`;\n entryFields[1].textContent = `Author: ${book.author}`;\n entryFields[2].textContent = `Language: ${book.language}`;\n entryFields[3].innerHTML = `<span>Summary: </span>${book.summary}`;\n entryFields[4].textContent = `${book.pagesRead}`;\n entryFields[5].textContent = `${book.pagesTotal}`;\n}", "title": "" }, { "docid": "d42787259954522610a30dfc1d72078f", "score": "0.5783976", "text": "function fillInfoBook(value) {\n //Alerta\n Swal.fire({\n title: 'Solicitud entrante',\n text: 'Un cliente ha solicitado un libro',\n icon: 'info',\n confirmButtonText: 'Aceptar'\n });\n //Adquirir datos\n const { nombre, autor, editorial, precio, ISBN, imagen } = value;\n lastBookContainer.find(\"p#nombre span\").html(nombre);\n lastBookContainer.find(\"p#autor span\").html(autor);\n lastBookContainer.find(\"p#editorial span\").html(editorial);\n lastBookContainer.find(\"p#precio span\").html(precio);\n lastBookContainer.find(\"p#ISBN span\").html(ISBN);\n lastBookContainer.find(\"img#book-cover\").attr(\"src\", `..${imagen}`);\n //Mostrar contenido\n lastBookContainer.slideDown(250);\n //Actualizar los libros a prestar\n showAllAvailableBooks();\n}", "title": "" }, { "docid": "15b27aa5546df596fa76f86e92be150c", "score": "0.5778805", "text": "function editSave() {\n if (!inputValid()) return;\n vm.editObj.id = -3;\n server.addBuoy(vm.editObj).then(function(res) {\n queryBuoys();\n queryBuoyInstances();\n gui.alertSuccess('Buoy added.');\n }, function(res) {\n gui.alertBadResponse(res);\n vm.buoys.splice(vm.buoys.length - 1, 1);\n });\n vm.editId = -1;\n }", "title": "" }, { "docid": "8384ece3b9440eef50241bf6c2b330e7", "score": "0.5777236", "text": "function newBookInfo() {\n const title = document.querySelector(\"#title\").value;\n const author = document.querySelector(\"#author\").value;\n const pages = document.querySelector(\"#pages\").value;\n const read = document.querySelector(\"#read\").value;\n return new Book(title, author, pages, read);\n}", "title": "" }, { "docid": "e6f0976cfb469063c7c84d584e66238c", "score": "0.57743734", "text": "function editReservation () {\r\n\tif ( reservation.pass_email != null ) {\t// It's a Pass object.\r\n\t\t$(\"#pass_edit_form\").fadeIn(500);\r\n\t\t$(\"#pass_email\").val(reservation[\"pass_email\"]);\r\n\t\t$(\"#pass_begin\").val(reservation[\"pass_begin\"]);\r\n\t\t$(\"#pass_end\").val(reservation[\"pass_end\"]);\r\n\t\t$(\"#pass_seat\").val(reservation[\"seat\"]);\r\n\t} else if ( reservation.email != null ) {\t// It's a Booking object.\r\n\t\t$(\"#booking_edit_form\").fadeIn(500);\r\n\t\t$(\"#book_email\").val(reservation[\"email\"]);\r\n\t\t$(\"#book_day\").val(reservation[\"day\"]);\r\n\t\tdocument.getElementById(\"book_slot\").selectedIndex = reservation[\"time_slot\"];\r\n\t\t$(\"#book_seat\").val(reservation[\"seat\"]);\r\n\t} else {\t// Something has gone wrong.\r\n\t\treturn;\r\n\t}\r\n}", "title": "" }, { "docid": "e213802fb5038e54bad8c4dabab158e0", "score": "0.5763122", "text": "function addBook() {\n let title = document.querySelector('#Title');\n let author = document.querySelector('#Author');\n let pages = document.querySelector('#Pages');\n let checkbox = document.querySelector('#reading-complete')\n\n if (title.value && author.value && pages.value) {\n let newBook = new book(title.value, author.value, pages.value, checkbox.checked);\n addBookToLibrary(newBook);\n render(myLibrary);\n\n title.value = '';\n author.value = '';\n pages.value = '';\n checkbox.checked = false;\n hideAddNewBook();\n }\n storeMyLibrary();\n}", "title": "" }, { "docid": "e8bf75060290bdaa9723815a13267393", "score": "0.5761207", "text": "function edit()\n {\n // Mengambil id item yang akan dihapus \n var i = parseInt($(this).data('id'), 10);\n\n var row_data = $(\"#data_\" + i);\n var row_form = $(\"#form_\" + i);\n var input_data = $(\"#input_data\");\n\n // menyembunyikan input form\n if(!input_data.hasClass('hidden')){\n input_data.addClass('hidden');\n }\n\n // menyembunyikan baris data\n if(!row_data.hasClass('hidden')){\n row_data.addClass('hidden');\n }\n\n // menampilkan baris form\n if(row_form.hasClass('hidden')){\n row_form.removeClass('hidden');\n }\n }", "title": "" }, { "docid": "3bdcacba0fe08867dfcce0953e328864", "score": "0.57471436", "text": "function addBook(e) {\n e.preventDefault();\n if (input.value) {\n bookList.push(input.value);\n updtStrg();\n rndrBooks(htmlList);\n }\n input.value = '';\t\n return;\n}", "title": "" }, { "docid": "a4268c7e1f64e5260300fca9695a691b", "score": "0.5728677", "text": "async function prepareBookUpdate(id) {\n try {\n // Get book by id\n const book = await getDataAsync(`${BASE_URL}/book/${id}`);\n\n // Set form defaults\n bookFormSetup(`Update Book ID: ${book.BookId}`);\n\n // Fill out the form\n document.getElementById(\"BookId\").value = book.BookId;\n document.getElementById(\"CategoryId\").value = book.CategoryId;\n document.getElementById(\"BookName\").value = book.BookName;\n document.getElementById(\"BookDescription\").value = book.BookDescription;\n document.getElementById(\"BookStock\").value = book.BookStock;\n document.getElementById(\"BookPrice\").value = book.BookPrice;\n } catch (err) {\n // catch and log any errors\n console.log(err);\n }\n}", "title": "" }, { "docid": "a54666d50b0359951fcab917eeb84a19", "score": "0.57256126", "text": "async function saveBook() {\r\n\tif (\r\n\t\taddImageBook.value == '' ||\r\n\t\taddTitleBook.value == '' ||\r\n\t\taddAuthorBook.value == '' ||\r\n\t\taddDescriptionBook.value == ''\r\n\t) {\r\n\t\talert('Please complete fields!');\r\n\t} else {\r\n\t\tlet newBook = new Book(\r\n\t\t\taddImageBook.value,\r\n\t\t\taddTitleBook.value,\r\n\t\t\taddAuthorBook.value,\r\n\t\t\taddPriceBook.value,\r\n\t\t\taddDescriptionBook.value,\r\n\t\t\taddQuantityBook.value,\r\n\t\t\taddBookId.value\r\n\t\t);\r\n\t\t//save book in DB\r\n\t\tlet res = await fetch(BOOKS_URL, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\tbody: JSON.stringify(newBook),\r\n\t\t});\r\n\t\tlet data = await res.json();\r\n\t\t//console.log(data);\r\n\t\tlocation.reload();\r\n\t\t// show list of books, hide save indputs fields\r\n\t\tdocument.getElementById('product-management-container').style.display = 'block';\r\n\t\tdocument.getElementById('add-new-book-container').style.visibility ='hidden';\r\n\t}\r\n}", "title": "" }, { "docid": "c878ebc3717f1c8d44bc5742b3a9989a", "score": "0.57246804", "text": "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Add book book to global array\n\t//initial new info variable for new book\n\tconst Name = document.querySelector('#newBookName').value\n\tconst Author = document.querySelector('#newBookAuthor').value\n\tconst Genre = document.querySelector('#newBookGenre').value\n\tconst New_book = new Book(Name, Author, Genre)\n\tlibraryBooks.push(New_book)\n\t// Call addBookToLibraryTable properly to add book to the DOM\n\taddBookToLibraryTable(New_book)\n\t\n}", "title": "" }, { "docid": "a4de1d2ced69ba8c5cbeea58b2eda2d4", "score": "0.5722529", "text": "function submitBookForm(event) {\r\n event.preventDefault();\r\n console.log(\"You have clieckd on add book to the shelf\");\r\n let bookName = document.getElementById(\"bName\").value;\r\n let authorName = document.getElementById(\"aName\").value;\r\n let genre;\r\n let siFI = document.getElementById(\"si-fi\");\r\n let religious = document.getElementById(\"religious\");\r\n let tech = document.getElementById(\"tech\");\r\n let horror = document.getElementById(\"horror\");\r\n let romance = document.getElementById(\"romance\");\r\n let crime = document.getElementById(\"crime\");\r\n let action = document.getElementById(\"action\");\r\n let history = document.getElementById(\"history\");\r\n let classics = document.getElementById(\"classics\");\r\n let autoBio = document.getElementById(\"autoBio\");\r\n let cookBooks = document.getElementById(\"cookBooks\");\r\n let poetry = document.getElementById(\"poetry\");\r\n let other = document.getElementById(\"other\");\r\n\r\n if (siFI.checked) {\r\n genre = siFI.value;\r\n } else if (religious.checked) {\r\n genre = religious.value;\r\n } else if (tech.checked) {\r\n genre = tech.value;\r\n } else if (horror.checked) {\r\n genre = horror.value;\r\n } else if (romance.checked) {\r\n genre = romance.value;\r\n } else if (crime.checked) {\r\n genre = crime.value;\r\n } else if (action.checked) {\r\n genre = action.value;\r\n } else if (history.checked) {\r\n genre = history.value;\r\n } else if (classics.checked) {\r\n genre = classics.value;\r\n } else if (autoBio.checked) {\r\n genre = autoBio.value;\r\n } else if (cookBooks.checked) {\r\n genre = cookBooks.value;\r\n } else if (poetry.checked) {\r\n genre = poetry.value;\r\n } else if (other.checked) {\r\n genre = other.value;\r\n }\r\n\r\n //create a bookshelf object\r\n let book = new bookShelf(bookName, authorName, genre);\r\n let play = new showBookShelf();\r\n\r\n if(play.validate(book))\r\n {\r\n play.add(book);\r\n play.clear();\r\n play.show();\r\n play.show('success', \"your book has been put on shelf\")\r\n }\r\n else{\r\n play.show(\"danger\", \"Please bring the real book\");\r\n }\r\n}", "title": "" }, { "docid": "bd3892d44c4cf10b26ba01b41d2ec1b9", "score": "0.5721455", "text": "function update() {\n var updateBook = {\n \"Author\": $('input[name=\"author\"]')[0].value,\n \"Title\": $('input[name=\"title\"]')[0].value,\n \"Year\": $('input[name=\"year\"]')[0].value,\n \"Pages\": $('input[name=\"pageNumber\"]')[0].value\n };\n var dataStr = JSON.stringify(updateBook);\n console.log(item);\n localStorage.setItem(item, dataStr);\n $(\".book-storage li\").remove();\n showBooks();\n $('input[type!=\"submit\"]').val(\"\");\n $(\"form input[type='submit']\").attr(\"onclick\", \"return addBook();\").attr(\"value\", \"Add new Book\");\n return false;\n}", "title": "" }, { "docid": "39f3a654d469ec7e7b7a5d265f27c0f3", "score": "0.5714965", "text": "function PutBook () {\n /**\n * Four constant that has been defined.\n * id stores the id of the Book that the user want to update\n * upFiled store the field that the user want to update\n * upValue store the value that the user want to update for that field\n * returnMessage will tell the user whether the Book has been updated\n */\n const [id, setId] = useState(\"\");\n const [upFiled, setField] = useState(\"\")\n const [upValue, setUpValue] = useState(\"\")\n const [returnMessage, setMessage] = useState(\"\")\n return (\n <div>\n <Form>\n <Form.Field>\n <Input\n placeholder=\"Book Id\"\n value={id}\n onChange={e => setId(e.target.value)}\n />\n </Form.Field>\n <Form.Field>\n <Input\n placeholder=\"Book Field\"\n value={upFiled}\n onChange={e => setField(e.target.value)}\n />\n </Form.Field>\n <Form.Field>\n <Input\n placeholder=\"Update value\"\n value={upValue}\n onChange={e => setUpValue(e.target.value)}\n />\n </Form.Field>\n <Form.Field>\n <Button onClick={ async () => {\n var formData = new FormData()\n formData.append(upFiled,upValue)\n //axios.put('/api/book?id=' + id, ) \n fetch('/api/book?id=' + id, {\n method: \"PUT\", \n body: formData}).then(() => setMessage(\"Book has already been updated!\"))\n }\n }>\n Update Book\n </Button>\n \n </Form.Field>\n <Form.Field>\n <li>\n status: {returnMessage}\n </li>\n </Form.Field>\n \n </Form>\n \n </div>\n )\n}", "title": "" }, { "docid": "11df38f2869a2ab31ff040439811d25d", "score": "0.5712655", "text": "function queryBook(e) {\n e.preventDefault();\n c$$(form, 'hide', 'toggle');\n c$$(queryloading, 'hide', 'toggle');\n var oMyForm = util.formScraper(form);\n form.reset();\n comm.queryBook(oMyForm,\n function(rsp) {\n c$$(queryloading, 'hide', 'toggle');\n bookPreview(rsp);\n }, \n function(err) {\n queryBookErrorHandler(err);\n }\n );\n }", "title": "" }, { "docid": "63fd6d667d152828795e1f2500faa400", "score": "0.5707582", "text": "async function prepareBookUpdate(id) {\n\n try {\n // Get broduct by id\n const Book = await getDataAsync(`${BASE_URL}book/${id}`);\n console.log(Book);\n // Fill out the form\n document.getElementById('BookId').value = Book.BookId; // uses a hidden field - see the form\n console.log(\"Over here, Ryan\" + Book.BookId)\n document.getElementById('GenreId').value = Book.GenreId;\n document.getElementById('AuthorId').value = Book.AuthorId;\n document.getElementById('BookName').value = Book.BookName;\n document.getElementById('BookDescription').value = Book.BookDescription;\n document.getElementById('BookStock').value = Book.BookStock;\n document.getElementById('BookPrice').value = Book.BookPrice;\n } // catch and log any errors\n catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "c568a849a761ebbc489413946cf98c06", "score": "0.57014817", "text": "author_update_get(req, res, next) {\n Author.findById(req.params.id,\n function (err, author) {\n if (err) { return next(err); }\n\n res.render(\"author_form\", {\n title: \"Edit Author\",\n author,\n });\n });\n }", "title": "" }, { "docid": "ea0a8f99420eec5c6cd9ab8f5cdfa334", "score": "0.56981903", "text": "function bookToLibrary () {\r\n let titleValue = document.getElementById('title').value\r\n let authorValue = document.getElementById('author').value\r\n let pagesValue = document.getElementById('numberOfPages').value\r\n let readOrNot\r\n if (document.getElementById('haveYouRead').checked === true) {\r\n readOrNot = \"read\"\r\n }\r\n else {\r\n readOrNot = \"notRead\"\r\n }\r\n const myTitle = new Book(titleValue, authorValue, pagesValue, readOrNot)\r\n addBookToLibrary(myTitle)\r\n document.getElementById('books').innerHTML=''\r\n displayTable(myLibrary)\r\n}", "title": "" }, { "docid": "3fbb95eba97221d3da484c94b3ed9173", "score": "0.5698019", "text": "function addBook(e) {\n e.stopPropagation();\n comm.addBook(\n function(rsp) {\n c$$(previewBox, 'hide', 'add');\n updateBooklist(rsp, \"add\");\n },\n function(err) {\n console.log(\"failure main.js\");\n }\n );\n }", "title": "" }, { "docid": "051f5734d370813d60ab13aa6cfb77b5", "score": "0.56968087", "text": "updateDetail(event) {\n event.preventDefault();\n let userDetail = new Person(fName.value, lName.value, email.value, address.value, mobile.value);\n\n personList.splice(position, 1, userDetail);\n Person.saveData(personList);\n Person.showData();\n Person.cleanField();\n uptBtn.style.display = \"none\";\n submitBtn.style.display = \"block\";\n div.style.display = \"none\";\n\n\n }", "title": "" }, { "docid": "45320704cb312b606bf26776e229349c", "score": "0.56901366", "text": "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Add book book to global array\n\tconst bookName = document.querySelector('#newBookName').value;\n\tconst authorName = document.querySelector('#newBookAuthor').value;\n\tconst bookGenre = document.querySelector('#newBookGenre').value;\n\ttry{\n\t\tif (bookName!=\"\" && authorName!=\"\" && bookGenre!=\"\"){\n\t\t\tconst newBook = new Book(bookName, authorName, bookGenre);\n\t\t\tlibraryBooks.push(newBook);\n\n\t// Call addBookToLibraryTable properly to add book to the DOM\n\t\t\taddBookToLibraryTable(newBook);\n\t\t}\n\t} catch(e) {\n\t\tconsole.log('Empty entry');\n\t}\n}", "title": "" }, { "docid": "f5ea7facf87434a4f8a1678aeec72ffb", "score": "0.568862", "text": "function handleUpdateButton(book) {\n $(\".bookList\").on(\"click\", \".updateButton\", function(e) {\n e.preventDefault();\n const id = $(e.target).parent().attr(\"id\");\n console.log(id);\n\n let book = {};\n book.id = id;\n book.title = $('#title').val();\n book.author = $('#author').val();\n book.genre = $('#genre').val();\n book.goalPages = $('#pages').val();\n book.goalChapters = $('#chapters').val(); \n console.log(book);\n\n $.ajax({\n url: '/books/' + id,\n method: \"PUT\",\n data: JSON.stringify(book),\n success: console.log(book),\n dataType: \"json\",\n contentType: \"application/json\"\n });\n window.location.href = \"/books/update\";\n });\n}", "title": "" }, { "docid": "00d0690bc980312ddb12f3027a1b4b66", "score": "0.56870914", "text": "function edit() {\n // Code here ...\n // View Edit\n // if(OK){update() };\n }", "title": "" }, { "docid": "45c710bb022a30a6d4df94681d1a0625", "score": "0.56827444", "text": "function openDeleteBookModal(modalId, bookId, title, isbn, authors, noOfCopies) {\n openModal(modalId);\n var form = document.querySelector(\"#form-book-delete\");\n form.setAttribute(\"action\",\"/books/\"+bookId);\n var idDiv = document.querySelector(\"#\"+modalId+\" #id-value\");\n idDiv.innerHTML = bookId;\n var titleDiv = document.querySelector(\"#\"+modalId+\" #title-value\");\n titleDiv.innerHTML = title;\n var isbnDiv = document.querySelector(\"#\"+modalId+\" #isbn-value\");\n isbnDiv.innerHTML = isbn;\n var authorsDiv = document.querySelector(\"#\"+modalId+\" #authors-value\");\n authorsDiv.innerHTML = authors;\n var noOfCopiesDiv = document.querySelector(\"#\"+modalId+\" #noOfCopies-value\");\n noOfCopiesDiv.innerHTML = noOfCopies;\n}", "title": "" }, { "docid": "9040bf12aeac6fabd16a035f4d86651c", "score": "0.56808454", "text": "function enableAddBook(e) {\n\n // Create form\n const newBookForm = document.createElement(\"div\");\n newBookForm.id = \"new-book-form\";\n newBookForm.className = \"add-book-form\";\n // newBookForm.className = \"new-book-form\";\n newBookForm.innerHTML = `\n <span name=\"close\" class=\"material-icons close\" onclick=\"removeSubmit()\">close</span>\n <input id=\"title-input\" type=\"text\" required placeholder=\"Title\" autocomplete=\"off\" autofocus/>\n <input id=\"author-input\" type=\"text\" placeholder=\"Author\" autocomplete=\"off\"/>\n <input id=\"pages-input\" type=\"number\" placeholder=\"pages\" autocomplete=\"off\"/>\n <div class=\"read-div\">\n <input id=\"read-input\" name=\"read-input\" type=\"checkbox\"/>\n <span class=\"slider\"></span>\n <label for=\"read-input\">Finished</label>\n </div>\n <button id=\"submit-button\" class=\"submit-button\" type=\"button\" onclick=submitBook(event)>Add Book</button>\n `;\n\n // Replace button with new form\n e.target.parentElement.replaceChild(newBookForm, e.target);\n newBookForm.classList.add(\"creating\");\n document.getElementById(\"title-input\").focus;\n}", "title": "" }, { "docid": "b287e8a5df8f34848cd04b24270c5c47", "score": "0.5676439", "text": "function addBookToLibrary(titleOfBook, authorOfBook, pagesOfBook, statusOfBook) {\n idOfBook = myLibrary.length ;\n titleOfBook = document.querySelector(\".title-input\").value;\n authorOfBook = document.querySelector(\".author-input\").value;\n pagesOfBook = document.querySelector(\".pages-input\").value;\n statusOfBook = document.querySelector(\".status-input\").checked;\n\n let form = document.getElementById('form');\n\n if(titleOfBook == \"\" || authorOfBook == \"\" || pagesOfBook == \"\" ) {\n alert(\"Enter a Book name and author \");\n return;\n }else{\n let newBook = new Book(idOfBook,titleOfBook, authorOfBook, pagesOfBook, statusOfBook);\n\n myLibrary.push(newBook);\n displayBook(newBook);\n localStorage.setItem('my_library', JSON.stringify(myLibrary));\n form.reset();\n }\n\n}", "title": "" }, { "docid": "3f7c65e88af6e4feeff597f7a39710ea", "score": "0.5661039", "text": "function getBookDetails() {\n const title = document.getElementById('title').value;\n const author = document.getElementById('author').value;\n const pages = document.getElementById('pages').value;\n const hasRead = document.getElementById('hasRead').checked;\n\n let newBook = new Book(title, author, pages, hasRead);\n return newBook;\n}", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.565668", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "1555131bdf9a14200bdf1dd00913e484", "score": "0.56565946", "text": "render() {\n return (\n <div className=\"col-sm-12\">\n <br />\n\n <h3 align=\"center\">LIST-BOOKS</h3>\n <br />\n <div className=\"container\" onLoad={this.refreshBook}>\n <button\n className=\"btn btn-success\"\n type=\"submit\"\n onClick={this.routeAddBook}\n >\n <i className=\"fa fa-plus\"> Add</i>\n </button>\n <br />\n\n <br />\n\n <table className=\"table\">\n <thead>\n <tr>\n <th>BOOK-ID</th>\n <th>BOOK-ISBN</th>\n <th>BOOK-NAME</th>\n <th> &nbsp; &nbsp; &nbsp; &nbsp;ACTION</th>\n </tr>\n </thead>\n <tbody>\n {this.state.books.map(book => (\n <tr key={book.bookId}>\n <td>{book.bookId}</td>\n <td>{book.bookISBN}</td>\n <td>{book.bookName}</td>\n <td>\n <button className=\"btn btn-primary\" type=\"submit\">\n <i\n className=\"fa fa-edit\"\n onClick={() => this.routeEditBook(book.bookId)}\n >\n Edit\n </i>\n </button>\n &nbsp;\n <button\n className=\"btn btn-danger\"\n //NORMAL CALL\n // onClick={() => this.deleteBook(book.bookId)}\n\n //CALL WITH CONFIRM MESSAGE\n onClick={() =>\n window.confirm(\n \"Are you sure you wish to delete this Book? \"\n ) && this.deleteBook(book.bookId)\n }\n >\n <i className=\"fa fa-trash\"> Delete</i>\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "0439c91777a03335acc7973c18fe7bb3", "score": "0.5656457", "text": "function clearFields() {\n bookTitle.value = \"\";\n bookWriter.value = \"\";\n bookPages.value = \"\";\n imgUrl.value = \"\";\n}", "title": "" }, { "docid": "7e2db899810f63ca44eb7d9485cec6b7", "score": "0.56518024", "text": "edit(request, response) { }", "title": "" }, { "docid": "d102c452be89b325247bf8e80fa8d648", "score": "0.5650112", "text": "function updateBookList() {\n try {\n searchTextbooks(\"postSearchData\", \"queriedBooks\");\n update_search_layout(2);\n }\n catch(e) {\n \tconsole.log(e);\n display_message(MESSAGES.ERR);\n }\n }", "title": "" }, { "docid": "6856ded2c3fe3f02e647040df5cfc33a", "score": "0.5643832", "text": "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\t// Add book book to global array\n\tconst newBN = document.querySelector('#newBookName').value;\n\tconst newBA = document.querySelector('#newBookAuthor').value;\n\tconst newBG = document.querySelector('#newBookGenre').value;\n\tconst newBook = new Book(newBN, newBA, newBG);\n\tlibraryBooks.push(newBook);\n\tconsole.log(newBook)\n\n\t// Call addBookToLibraryTable properly to add book to the DOM\n\t//TODO:\n\taddBookToLibraryTable(newBook)\n}", "title": "" }, { "docid": "65ba56abca7502e706131c8195408d44", "score": "0.5642011", "text": "function updateBook(request, response) {\n\n console.log(request.body);\n let obj = request.body;\n let sql = `UPDATE books SET author=$1, title=$2, isbn=$3, image_url=$4, description=$5, bookshelf=$6 WHERE id=$7 RETURNING id;`;\n\n //if the bookshelf input tag was used that gets saved, otherwise whatever option was selected\n let bookshelf = obj.bookshelf.length > 0 ? obj.bookshelf : obj.selectedBookshelf;\n let safeValues = [obj.author, obj.title, obj.isbn, obj.image_url, obj.description, bookshelf, obj.id];\n\n client.query(sql, safeValues)\n .then(results => {\n response.redirect(`/${results.rows[0].id}`);\n })\n .catch(error => {\n queryError(error, response);\n });\n}", "title": "" }, { "docid": "19be036574568ae2c1154305dee5de40", "score": "0.5636912", "text": "function editFieldOffice(){\t\t\n\t\tfomController.resetInfoTabMode(\"edit\");\n\t}", "title": "" }, { "docid": "686482e6b6645e21715e9e7fdefda86c", "score": "0.5636354", "text": "static displayBook(book){\r\n let books=Store.getBooks(); // nijer function k check korbe value ace naki nei theakle seta show korbe\r\n books.forEach(function(book){\r\n \r\n UI.addToBooklist(book); // notun generate haoa book k show korbe\r\n });\r\n }", "title": "" }, { "docid": "b5f55df3fddff20214cf6c7a45a55224", "score": "0.56333256", "text": "function openEditForm(event) {\n const item = event.target;\n\n if (item.classList[0] === \"edit-btn\") {\n const showform = document.getElementById(\"edit-form\");\n const hideAddForm = document.getElementById(\"add-form\");\n showform.classList.remove(\"hidden\");\n hideAddForm.classList.add(\"hidden\");\n\n const todoId = item.closest(\".todo\").id;\n const index = todoList.findIndex((todo) => todo.id === todoId);\n const todo = todoList[index];\n\n showform.querySelector(\"input[name=todo]\").value = todo.todo;\n showform.querySelector(\"select[name=title]\").value = todo.title;\n showform.querySelector(\"input[name=id]\").value = todo.id;\n }\n}", "title": "" }, { "docid": "fec5ec1a5f13d546d8939f5672ccdcc5", "score": "0.5630617", "text": "function addBook(e) {\n e.preventDefault();\n let book = addBookElement.value;\n books.push(book);\n displayBook(books,ulElement);\n addBookElement.value = \"\";\n localStorage.setItem('bookly-books', JSON.stringify(books));\n}", "title": "" }, { "docid": "66d697d120c20dbe4dfd25f058822121", "score": "0.5628391", "text": "function onEdit(data) {\n addWish();\n document.getElementById(\"item\").value = data.item;\n document.getElementById(\"price\").value = data.price;\n document.getElementById(\"category\").value = data.category;\n document.getElementById(\"image\").value = \"\";\n document.getElementById(\"comment\").value = data.comment;\n update = 1;\n}", "title": "" }, { "docid": "c64a5c37b6b114b6f2a4518b75ca7e1c", "score": "0.5628232", "text": "function update(ev) {\n let tgt = $(ev.target);\n let data = {};\n data[tgt.attr('name')] = tgt.val();\n // Populate the fields that should not change\n data[\"id\"] = props.id;\n data[\"destination\"] = props.destination;\n data[\"start_date\"] = props.startDate;\n data[\"end_date\"] = props.endDate;\n props.dispatch({\n type: 'UPDATE_BOOKED_FORM',\n data: data,\n });\n }", "title": "" }, { "docid": "5e6023247d8061afc8d7cba1c9daf5d1", "score": "0.5622491", "text": "function addNewBookToBookList(e) {\n\te.preventDefault();\n\n\tconst bookName = document.querySelector('#newBookName').value\n\tconst bookAuthor = document.querySelector('#newBookAuthor').value\n\tconst bookGenre = document.querySelector('#newBookGenre').value\n\t// Add book book to global array\n\tconst newBook = new Book(bookName, bookAuthor, bookGenre)\n\tlibraryBooks.push(newBook)\n\n\t// Call addBookToLibraryTable properly to add book to the DOM\n\taddBookToLibraryTable(newBook)\n\t\n}", "title": "" } ]
da652d6eea49401e10c765e05a3bb7a0
La funzione getThisOp restituisce l'operazione da effettuare sui dati raccolti relativi alla misura da validare.
[ { "docid": "8091ce2628e5ae190346ba5b881eb493", "score": "0.5552057", "text": "function getThisOp() {\n\tif ($('#selectCardinality').val() == \"many\") {\n\t\treturn $('#selectOperation').val();\n\t} else {\n\t\treturn null;\n\t}\n}", "title": "" } ]
[ { "docid": "650c6b38af6405997b1ca7311a1516a0", "score": "0.5743914", "text": "function getRefOp() {\n\tif ($('#operationRef').offsetParent === null) {\n\t\t// se non è visibile il form relativo all'operazione di riferimento\n\t\treturn null;\n\t} else if ($('#selectCardinalityRef').val() == \"many\") {\n\t\treturn $('#selectOperationRef option:selected').val();\t\n\t}else {\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "8e2d8b83da8ec256bb61ad805434e653", "score": "0.539187", "text": "targetOperations() {\n return this.data.$$new\n ? this.operations.filter((x) => x.new)\n : this.operations.filter((x) => x.create);\n }", "title": "" }, { "docid": "9f0ca5f5a623d28d2f6b1b54a9c4c3a2", "score": "0.52670413", "text": "function editaFator(acao){\n\tvar actpos = $(\"#position\").val();\n\tif(actpos === 'null'){\n\t\tswal('Erro','É necessário selecionar uma linha','error');\n\t\treturn;\n\t}\n\n\tif(!Verifica_Alteracao(DIV_TABELA)){\n\t\tselecionaLinha(DIV_TABELA,$('#position').val(),1);\n\t\treturn;\n\t}\n\tvar cliente = objTabelaCli.registros[actpos].cl_number;\n\tvar fator = \"\";\n\n\n\tvar Criterios = \"Status = \"+$(\"#cbStatus option:selected\").html()+\n\t\t\t\t\t\"\\nGrupo = \"+($(\"#cbGrupo\").val() == '%' ? 'Todos' : $(\"#cbGrupo\").val())+\n\t\t\t\t\t\"\\nGrupo Financeiro = \"+($(\"#cbGfin\").val() == '%' ? 'Todos' : $(\"#cbGfin\").val())+\n\t\t\t\t\t\"\\nUF = \"+($(\"#cbUF\").val() == '%' ? 'Todos' : $(\"#cbUF\").val())+\n\t\t\t\t\t\"\\nMargem = \"+($(\"#cbMargem\").val() == '%' ? 'Todos' : $(\"#cbMargem\").val())+\n\t\t\t\t\t\"\\nRepresentante = \"+$(\"#cbRep option:selected\").html()+\n\t\t\t\t\t\"\\nOrdem = \"+ $(\"#cbOrdem option:selected\").html()+\n\t\t\t\t\t\"\\nTexto Buscado = \"+$(\"#search\").val().toUpperCase();\n\n\tvar funcao = \"funcao=CliDivs\"+\n\t\t\t\t\t\"&status=\"+($(\"#cbStatus option:selected\").val() == '%' ? 'Todos' : $(\"#cbStatus\").val())+\n\t\t\t\t\t\"&grupo=\"+($(\"#cbGrupo\").val() == '%' ? 'Todos' : $(\"#cbGrupo\").val()) +\n\t\t\t\t\t\"&grupofin=\"+($(\"#cbGfin\").val() == '%' ? 'Todos' : $(\"#cbGfin\").val()) +\n\t\t\t\t\t\"&uf=\"+($(\"#cbUF\").val() == '%' ? 'Todos' : $(\"#cbUF\").val())+\n\t\t\t\t\t\"&dias=\"+$(\"#compra\").val()+\n\t\t\t\t\t\"&margem=\"+($(\"#cbMargem\").val() == '%' ? 'Todos' : $(\"#cbMargem\").val())+\n\t\t\t\t\t\"&representante=\"+($(\"#cbRep\").val() == '%' ? 'Todos' : $(\"#cbRep\").val())+\n\t\t\t\t\t\"&index=\"+$(\"#cbOrdem\").val()+\n\t\t\t\t\t\"&nome=\"+$(\"#search\").val();\n\n\n\tvar exec = function(){\n\n\t\tajax(funcao, EXEC, function(retorno){\n\t\t\tretorno = json(retorno);\n\t\t\tif(!retorno){\n\t\t\t\tvar erro = \"Houve um erro interno de servidor.\\nEntre em contato com o suporte da pennacorp!\";\n\t\t\t\tswal('Erro ao Alterar Fator e Credito',erro,'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//ERRO\n\t\t\tif(!empty(retorno.error)){\n\t\t\t\tswal('Erro ao Alterar Fator e Credito',retorno.mensagem,'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tobjTabelaCli = retorno;\n\t\t\tpagination(1);\n\t\t\tswal.close();\n\n\t\t});\n\t};\n\n\tvar Novadata = \"\";\n\tswitch (acao) {\n\t\tcase 'f':\n\t\t\tswal({\n\t\t\t\ttitle:'Digite o valor do Fator para os Clientes nestes Criterios',\n\t\t\t\ttext: Criterios,\n\t\t\t\ttype: \"input\",\n\t\t\t\tinputPlaceholder: \"0,00\",\n\t\t\t\tshowCancelButton: true,\n\t\t\t\tcloseOnConfirm: false,\n\t\t\t\tshowLoaderOnConfirm: true,\n\t\t\t}, function(inputValue){\n\t\t\t\tif(inputValue === false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tfator = inputValue;\n\t\t\t\t//VERIFICA SE O COMBO ESTÁ CHECKED E A POSIÇÃO NÃO É NULL\n\t\t\t\tif($('#ckFiltroCompra').is(':checked') && !empty($(\"#compra\").val())){\n\t\t\t\t\tvar data = new Date(getDataHoje());\n\t\t\t\t\tdata.setDate(data.getDate() - $(\"#compra\").val());\n Novadata = data.customFormat( \"#YYYY#-#MM#-#DD#\" ); \n//\t\t\t\t\tNovadata = converteData(data.toLocaleDateString(), 'DATA_US');\n\t\t\t\t}\n\n\t\t\t\tfuncao += \"&comando=f&fator=\"+fator+\"&dtFinal=\"+Novadata;\n\t\t\t\texec();\n\t\t\t\t$('.sweet-alert input').attr('type', 'text');\n\t\t\t\t$('.sweet-alert input').removeClass('w200');\n\t\t\t\t$('.sweet-alert input').removeClass('center');\n\t\t\t\t$('.sweet-alert.show-input input').css({'margin':'', 'padding':'0 12px'});\n\t\t\t});\n\t\t\t $('.sweet-alert input').attr('type', 'number');\n\t\t\t $('.sweet-alert.show-input input').val(\"\");\n\t\t\t $('.sweet-alert input').addClass('w200');\n\t\t\t $('.sweet-alert.show-input input').css({'margin':'10px auto 18px auto', 'padding':'0 0 0 12px'});\n\n\n\n\t\treturn;\n\n\t\tcase 'l':\n\t\t\tswal({\n\t\t\t\ttitle: \"Recalcula Limite do Credito\",\n\t\t\t\ttext: \"Confirma o Recalculo do Limite de Credito para os Clientes?\",\n\t\t\t\ttype: \"info\",\n\t\t\t\tshowCancelButton: true,\n\t\t\t\tconfirmButtonText: \"Sim\",\n\t\t\t\tcancelButtonText: \"Não\",\n\t\t\t\tcloseOnConfirm: false,\n\t\t\t\tcloseOnCancel: false,\n\t\t\t\tshowLoaderOnConfirm: true,\n\t\t\t}, function(isConfirm){\n\t\t\t\tif(!isConfirm){\n\t\t\t\t\tswal.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tswal.loading(\"Carregando...\");\n\n\t\t\t\tfuncao += \"&comando=l&dtFinal=\"+Novadata+\"&fator=0\";\n\t\t\t\t$('.sweet-alert input').attr('type', 'text');\n\t\t\t \t$('.sweet-alert input').removeClass('w250');\n\t\t\t \t$('.sweet-alert.show-input input').css({'margin':'', 'padding':'0 12px'});\n\t\t\t \t$('.sweet-alert.show-input input').val(\"\");\n\t\t\t\texec();\n\t\t\t});\n\t\tbreak;\n\n\t\tcase 'z':\n\t\t\tswal({\n\t\t\t\ttitle: \"Zerar Limite do Credito\",\n\t\t\t\ttext: \"Deseja Zerar o Limite de Credito dos Clientes filtrados?\",\n\t\t\t\ttype: \"info\",\n\t\t\t\tshowCancelButton: true,\n\t\t\t\tconfirmButtonText: \"Sim\",\n\t\t\t\tcancelButtonText: \"Não\",\n\t\t\t\tcloseOnConfirm: false,\n\t\t\t\tcloseOnCancel: false,\n\t\t\t\tshowLoaderOnConfirm: true,\n\t\t\t}, function(isConfirm){\n\t\t\t\tif(!isConfirm){\n\t\t\t\t\tswal.close();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//VERIFICA SE O COMBO ESTÁ CHECKED E A POSIÇÃO NÃO É NULL\n\t\t\t\tif($('#ckFiltroCompra').is(':checked') && !empty($(\"#compra\").val())){\n\t\t\t\t\tvar data = new Date(getDataHoje());\n\t\t\t\t\tdata.setDate(data.getDate() - $(\"#compra\").val());\n \n Novadata = data.customFormat( \"#YYYY#-#MM#-#DD#\" ); \n//\t\t\t\t\tNovadata = converteData(data.toLocaleDateString(), 'DATA_US');\n\t\t\t\t}\n\n\t\t\t\tfuncao += \"&comando=z&dtFinal=\"+Novadata+\"&fator=0\";\n\t\t\t\texec();\n\t\t\t});\n\t\tbreak;\n\n\t}\n\n\n}", "title": "" }, { "docid": "4925aa8c11e56fb8b4bc6e997961be0c", "score": "0.5209831", "text": "function operacion(op) {\n switch (op) {\n case \"suma\":\n Calculadora.suma();\n break;\n \n case \"multiplicacion\":\n Calculadora.multiplicacion();\n break;\n\n case \"divicion\":\n Calculadora.divicion();\n break; \n \n case \"resta\":\n Calculadora.resta();\n break;\n \n default:\n break;\n } \n }", "title": "" }, { "docid": "d59d11522b225f78b0c1203c678d2790", "score": "0.5154947", "text": "function getModalOperation (op) {\n\tswitch(op){\n\t case operations.CONSULTAR.id:\n\t \treturn operations.CONSULTAR;\n\t case operations.MOVIMIENTOS.id:\n\t \treturn operations.MOVIMIENTOS;\n\t case operations.AGREGAR.id:\n\t \treturn operations.AGREGAR;\n\t case operations.REMOVER.id:\n\t \treturn operations.REMOVER;\n\t}\t\n}", "title": "" }, { "docid": "7d2efd8a0c3f00fd9353c6d6e8dc486b", "score": "0.5110409", "text": "getResumenVentas() {\n let efectivo = document.getElementById(\"lblEfectivo\").value;\n let cambio = efectivo - this.ordenSelected.total - this.propina;\n let fechaOrden = this.convertDate();\n let filter = {\n where: {\n fecha: fechaOrden,\n },\n };\n axios\n .get(this.uriVentas + \"?filter=\" + JSON.stringify(filter))\n .then((response) => {\n this.resumenDeVenta = response.data;\n if (this.resumenDeVenta.length == 0) {\n console.log(\"vacio\");\n this.createResumenDeVentas();\n\n } else {\n console.log(\"AQUI LO LLAMARE updateResumenDeVentas\");\n this.updateResumenDeVentas();\n\n }\n console.log(\"estoy aqui\");\n })\n .catch((e) => {\n console.log(e);\n });\n }", "title": "" }, { "docid": "f7d8c3cc19cb1d0a255b2bbda757019e", "score": "0.508207", "text": "constructor(_operaciones) {\n this._operaciones = _operaciones;\n this._operaciones = this.operaciones;\n // this._suma = this.suma\n // this._resta = this.resta\n // this._multiplicacion = this.multiplicacion\n // this._division = this.division\n }", "title": "" }, { "docid": "8c07385fbf8e4e3817c438c917e33e1f", "score": "0.5037142", "text": "function setThisOp(thisOp) {\n\t$('#selectOperation').val(thisOp).change();\n}", "title": "" }, { "docid": "fb8f308597da52d64566b3504eec6942", "score": "0.5033884", "text": "get operations() { return this._operations; }", "title": "" }, { "docid": "1b76c11a3afc51dcc6f7ac785ad26407", "score": "0.50115985", "text": "function normalizeOp(op) {\n var thisOperation;\n if (op.hasOwnProperty('operation') && op.hasOwnProperty('parameters')) {\n thisOperation = op.operation, op = op.parameters;\n } else {\n if ('[object Array]' === Object.prototype.toString.call(op)) {\n thisOperation = op[0],\n op = op.splice(1);\n } else {\n return null;\n }\n }\n return thisFill.hasOwnProperty(thisOperation) ? thisFill[thisOperation].apply(this, op) : null;\n }", "title": "" }, { "docid": "99067b0de12bb1678271779acf3e4446", "score": "0.4989422", "text": "Operations(operacion) {\n let vInicial = this.state.valorInical; // valor que se mostrara en el display\n let vArrayValor = this.state.arrayValor;\n let vArrayIncial = this.state.arrayIncial;\n let pasarOperacion = this.state.operacionPasada;\n\n // limpiara un valor\n if (operacion === 'ce') {\n const ultimoValor = (vInicial.length - 1);\n vInicial = vInicial.substring(0, ultimoValor);\n // evitamos espacios que quede en blanco\n if (ultimoValor === '') {\n vInicial = '0';\n }\n }\n\n // limpiara toda la pantalla\n if (operacion === 'c') {\n vInicial = '0';\n vArrayValor = [];\n vArrayIncial = false;\n location.reload();\n }\n\n // cambiar signo\n if (operacion === '+/-') {\n const resultado = this.calculosOperaciones(\n pasarOperacion, vArrayValor[0], parseInt(vInicial, 0),\n );\n vArrayValor = [];\n vInicial = Math.sign(resultado.toString);\n pasarOperacion = '';\n vArrayIncial = true;\n }\n\n // optener el resultado\n if (operacion === '=') {\n const resultado = this.calculosOperaciones(\n pasarOperacion, vArrayValor[0], parseInt(vInicial, 0),\n );\n vArrayValor = [];\n vInicial = resultado.toString();\n pasarOperacion = '=';\n vArrayIncial = true;\n } else if ((vArrayValor.length) === 1) {\n const resultado = this.calculosOperaciones(\n pasarOperacion, vArrayValor[0], parseInt(vInicial, 0),\n );\n vArrayValor[0] = resultado;\n vInicial = resultado.toString();\n vArrayIncial = true;\n pasarOperacion = operacion;\n } else {\n vArrayValor.push(parseInt(vInicial, 0));\n vArrayIncial = true;\n pasarOperacion = operacion;\n }\n // condicion de mostrar en la pantalla\n if ((parseInt(vInicial, 0) < 0 || parseInt(vInicial, 0) > 999999999)) {\n vInicial = 'ERROR';\n vArrayValor = [];\n vArrayIncial = false;\n alert('calculo ERROR, existe un numero negativo o se paso del limite establecido');\n }\n\n // mandamos los valores\n this.setState({\n valorInical: vInicial,\n arrayValor: vArrayValor,\n arrayIncial: vArrayIncial,\n operacionPasada: pasarOperacion,\n });\n }", "title": "" }, { "docid": "121a5488dc0907f94e8d28adf4182e4b", "score": "0.4963602", "text": "function EjecutarValidacionesAlComienzo() {\r\n//BusinessRuleId:1924, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divDelito_Violencia_Genero').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));\r\n \r\n \r\n }\r\n //BusinessRuleId:1924, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n debugger;\r\n $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n debugger;\r\n $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n debugger;\r\n $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n//BusinessRuleId:338, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none'); $(\"a[href='#tabDatos_del_Levantamiento_del_Cadaver']\").css('display', 'none');\r\n\r\n\r\n}\r\n//BusinessRuleId:338, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:338, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none'); $(\"a[href='#tabDatos_del_Levantamiento_del_Cadaver']\").css('display', 'none');\r\n\r\n\r\n}\r\n//BusinessRuleId:338, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:338, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none'); $(\"a[href='#tabDatos_del_Levantamiento_del_Cadaver']\").css('display', 'none');\r\n\r\n\r\n}\r\n//BusinessRuleId:338, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divRuta').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex)); $('#divEstado_del_Conductor').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex)); $('#divTipo_de_Servicio').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex)); $('#divModalidad_del_Robo').css('display', 'block');\r\n\r\n\r\n}\r\n//BusinessRuleId:631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divRuta').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex)); $('#divEstado_del_Conductor').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex)); $('#divTipo_de_Servicio').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex)); $('#divModalidad_del_Robo').css('display', 'block');\r\n\r\n\r\n}\r\n//BusinessRuleId:631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divRuta').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex)); $('#divEstado_del_Conductor').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex)); $('#divTipo_de_Servicio').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex)); $('#divModalidad_del_Robo').css('display', 'block');\r\n\r\n\r\n}\r\n//BusinessRuleId:631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1052, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divLevantamiento_de_Cadaver').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1052, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1052, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divLevantamiento_de_Cadaver').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1052, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1052, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divLevantamiento_de_Cadaver').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1052, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1302, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex).val()==TryParseInt('1', '1') || $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex).val()==TryParseInt('null', 'null') ) { $('#divMotivo_de_no_canalizacion').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));} else { $('#divMotivo_de_no_canalizacion').css('display', 'block');}\r\n\r\n\r\n}\r\n//BusinessRuleId:1302, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1302, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex).val()==TryParseInt('1', '1') || $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex).val()==TryParseInt('null', 'null') ) { $('#divMotivo_de_no_canalizacion').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));} else { $('#divMotivo_de_no_canalizacion').css('display', 'block');}\r\n\r\n\r\n}\r\n//BusinessRuleId:1302, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1302, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex).val()==TryParseInt('1', '1') || $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex).val()==TryParseInt('null', 'null') ) { $('#divMotivo_de_no_canalizacion').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));} else { $('#divMotivo_de_no_canalizacion').css('display', 'block');}\r\n\r\n\r\n}\r\n//BusinessRuleId:1302, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1348, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( $('#' + nameOfTable + 'Mercancia' + rowIndex).prop(\"checked\") === true ) { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex)); $('#divMonto_de_la_Carga').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:1348, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1348, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( $('#' + nameOfTable + 'Mercancia' + rowIndex).prop(\"checked\") === true ) { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex)); $('#divMonto_de_la_Carga').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:1348, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1348, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( $('#' + nameOfTable + 'Mercancia' + rowIndex).prop(\"checked\") === true ){ $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex)); $('#divMonto_de_la_Carga').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:1348, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1723, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\t\r\n//BusinessRuleId:1723, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1742, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1742, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1742, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1742, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1742, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1742, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1743, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n DisabledControl($(\"#\" + nameOfTable + \"Expediente_Inicial\" + rowIndex), (\"true\" == \"true\"));\r\n\r\n\r\n}\r\n//BusinessRuleId:1743, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\nif(operation == 'New'){\r\n if( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex).prop(\"checked\") === true ) { $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'block');\r\n$(\"a[href='#tabAsignar_Dueno']\").css('display', 'block');} else { $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none');$(\"a[href='#tabAsignar_Dueno']\").css('display', 'none');}\r\n}\r\n\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n debugger;\r\n $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n debugger;\r\n $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n debugger;\r\n $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1926, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:1924, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divDelito_Violencia_Genero').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1924, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1928, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divCircunstancia_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1928, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1928, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divCircunstancia_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1928, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1928, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divCircunstancia_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1928, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1929, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divNombre_Completo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));$('#divNombre_Completo_Involucrado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));$('#divNombre_Completo_Dueno').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1929, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n//BusinessRuleId:1932, Attribute:265782, Operation:Field, Event:None\r\nif(operation == 'New'){\r\nif( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo_Dueno').css('display', 'block');} else { $('#divNombre_Completo_Dueno').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}\r\n}\r\nif(operation == 'Update'){\r\n if( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo_Dueno').css('display', 'block');} else { $('#divNombre_Completo_Dueno').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}\r\n }\r\n if(operation == 'Consult'){\r\n if( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo_Dueno').css('display', 'block');} else { $('#divNombre_Completo_Dueno').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}\r\n }\r\n//BusinessRuleId:1932, Attribute:265782, Operation:Field, Event:None\r\n\r\n//BusinessRuleId:1931, Attribute:265780, Operation:Field, Event:None\r\nif(operation == 'New'){\r\nif( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo_Involucrado').css('display', 'block');} else { $('#divNombre_Completo_Involucrado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}\r\n}\r\nif(operation == 'Update'){\r\n if( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo_Involucrado').css('display', 'block');} else { $('#divNombre_Completo_Involucrado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}\r\n }\r\n if(operation == 'Consult'){\r\n if( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo_Involucrado').css('display', 'block');} else { $('#divNombre_Completo_Involucrado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}\r\n }\r\n//BusinessRuleId:1931, Attribute:265780, Operation:Field, Event:None\r\n\r\n//BusinessRuleId:1930, Attribute:265778, Operation:Field, Event:None\r\nif(operation == 'New'){\r\nif( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo').css('display', 'block');} else { $('#divNombre_Completo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}\r\n}\r\nif(operation == 'Update'){\r\n if( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo').css('display', 'block');} else { $('#divNombre_Completo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}\r\n }\r\n if(operation == 'Consult'){\r\n if( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex).prop(\"checked\") === true ) { $('#divNombre_Completo').css('display', 'block');} else { $('#divNombre_Completo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}\r\n }\r\n//BusinessRuleId:1933, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divEstado_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));$('#divMunicipio_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));$('#divColonia_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));$('#divCodigo_Postal_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));$('#divCalle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));$('#divEntre_Calle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));$('#divy_Calle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));$('#divNumero_Exterior_del_Delito_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));$('#divNumero_Interior_del_Delito_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));$('#divReferencia_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));$('#divLatitud_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));$('#divLongitud_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1933, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1933, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divEstado_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));$('#divMunicipio_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));$('#divColonia_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));$('#divCodigo_Postal_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));$('#divCalle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));$('#divEntre_Calle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));$('#divy_Calle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));$('#divNumero_Exterior_del_Delito_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));$('#divNumero_Interior_del_Delito_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));$('#divReferencia_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));$('#divLatitud_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));$('#divLongitud_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1933, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1933, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divEstado_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));$('#divMunicipio_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));$('#divColonia_del_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));$('#divCodigo_Postal_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));$('#divCalle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));$('#divEntre_Calle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));$('#divy_Calle_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));$('#divNumero_Exterior_del_Delito_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));$('#divNumero_Interior_del_Delito_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));$('#divReferencia_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));$('#divLatitud_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));$('#divLongitud_Robo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1933, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2235, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n AsignarValor($('#' + nameOfTable + 'Expediente_Inicial' + rowIndex),EvaluaQuery(\" SELECT NUAT FROM Modulo_Atencion_Inicial WHERE Clave = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable));\r\n\r\n\r\n}\r\n//BusinessRuleId:2235, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2508, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divExpediente_MP').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:2508, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2508, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divExpediente_MP').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:2508, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2508, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divExpediente_MP').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:2508, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2526, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n var valor = $('#' + nameOfTable + 'Municipio' + rowIndex).val(); $('#' + nameOfTable + 'Municipio' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Municipio' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Municipio' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM Municipio WHERE ESTADO = FLD[Estado]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Municipio' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM Municipio WHERE ESTADO = FLD[Estado]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Municipio' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Municipio' + rowIndex).val(valor).trigger('change'); var valor = $('#' + nameOfTable + 'Colonia' + rowIndex).val(); $('#' + nameOfTable + 'Colonia' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Colonia' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Colonia' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM COLONIA WHERE Municipio = FLD[Municipio]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Colonia' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM COLONIA WHERE Municipio = FLD[Municipio]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Colonia' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Colonia' + rowIndex).val(valor).trigger('change');\r\n\r\n\r\n}\r\n//BusinessRuleId:2526, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2526, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n var valor = $('#' + nameOfTable + 'Municipio' + rowIndex).val(); $('#' + nameOfTable + 'Municipio' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Municipio' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Municipio' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM Municipio WHERE ESTADO = FLD[Estado]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Municipio' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM Municipio WHERE ESTADO = FLD[Estado]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Municipio' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Municipio' + rowIndex).val(valor).trigger('change'); var valor = $('#' + nameOfTable + 'Colonia' + rowIndex).val(); $('#' + nameOfTable + 'Colonia' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Colonia' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Colonia' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM COLONIA WHERE Municipio = FLD[Municipio]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Colonia' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT CLAVE, NOMBRE FROM COLONIA WHERE Municipio = FLD[Municipio]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Colonia' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Colonia' + rowIndex).val(valor).trigger('change');\r\n\r\n\r\n}\r\n//BusinessRuleId:2526, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2622, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') ) { $('#divRobo_de_Vehiculo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2622, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2622, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') ) { $('#divRobo_de_Vehiculo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2622, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2622, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') ) { $('#divRobo_de_Vehiculo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2622, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') && EvaluaQuery(\"select Robo_de_Vehiculo from Delito where Clave = FLD[Delito]\",rowIndex, nameOfTable)==TryParseInt('1', '1') ) { $(\"a[href='#tabAsignar_Dueno']\").css('display', 'block'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'block');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') && EvaluaQuery(\"select Robo_de_Vehiculo from Delito where Clave = FLD[Delito]\",rowIndex, nameOfTable)==TryParseInt('1', '1') ) { $(\"a[href='#tabAsignar_Dueno']\").css('display', 'block'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'block');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') && EvaluaQuery(\"select ISNULL(Robo_de_Vehiculo, 0) from Delito where Clave = FLD[Delito]\",rowIndex, nameOfTable)==TryParseInt('0', '0') ) { $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('3', '3') && EvaluaQuery(\"select ISNULL(Robo_de_Vehiculo, 0) from Delito where Clave = FLD[Delito]\",rowIndex, nameOfTable)==TryParseInt('0', '0') ) { $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:2626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:1923, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex)); $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divEstado_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));$('#divMunicipio_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));$('#divColonia_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));$('#divCodigo_Postal').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));$('#divCalle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));$('#divEntre_Calle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));$('#divy_Calle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));$('#divNumero_Exterior_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));$('#divNumero_Interior_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));$('#divReferencia').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));$('#divLatitud').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));$('#divLongitud').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex)); $('#divPuede_Ser_Canalizado_a_JA').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1923, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1923, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex)); $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divEstado_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));$('#divMunicipio_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));$('#divColonia_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));$('#divCodigo_Postal').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));$('#divCalle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));$('#divEntre_Calle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));$('#divy_Calle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));$('#divNumero_Exterior_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));$('#divNumero_Interior_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));$('#divReferencia').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));$('#divLatitud').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));$('#divLongitud').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex)); $('#divPuede_Ser_Canalizado_a_JA').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1923, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1923, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divClave').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));$('#divMonto').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));$('#divArticulado_de_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));$('#divExpediente_Inicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex)); $(\"a[href='#tabAsignar_Dueno']\").css('display', 'none'); $('#divEstado_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));$('#divMunicipio_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));$('#divColonia_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));$('#divCodigo_Postal').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));$('#divCalle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));$('#divEntre_Calle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));$('#divy_Calle').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));$('#divNumero_Exterior_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));$('#divNumero_Interior_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));$('#divReferencia').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));$('#divLatitud').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));$('#divLongitud').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex)); $('#divPuede_Ser_Canalizado_a_JA').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1923, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3003, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divFecha_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));$('#divHora_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3003, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3003, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divFecha_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));$('#divHora_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3003, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3003, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divFecha_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));$('#divHora_del_Delito').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3003, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:3572, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('2', '2') ) { var valor = $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).val(); $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Nombre_Completo FROM dbo.Detalle_de_Datos_Generales WHERE Tipo_de_Compareciente = 1 AND Modulo_Atencion_Inicial = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Nombre_Completo FROM dbo.Detalle_de_Datos_Generales WHERE Tipo_de_Compareciente = 1 AND Modulo_Atencion_Inicial = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).val(valor).trigger('change');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:3572, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3572, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('2', '2') ) { var valor = $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).val(); $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Nombre_Completo FROM dbo.Detalle_de_Datos_Generales WHERE Tipo_de_Compareciente = 1 AND Modulo_Atencion_Inicial = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Nombre_Completo FROM dbo.Detalle_de_Datos_Generales WHERE Tipo_de_Compareciente = 1 AND Modulo_Atencion_Inicial = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).val(valor).trigger('change');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:3572, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3572, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('2', '2') ) { var valor = $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).val(); $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Nombre_Completo FROM dbo.Detalle_de_Datos_Generales WHERE Tipo_de_Compareciente = 1 AND Modulo_Atencion_Inicial = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Nombre_Completo FROM dbo.Detalle_de_Datos_Generales WHERE Tipo_de_Compareciente = 1 AND Modulo_Atencion_Inicial = GLOBAL[SpartanOperationId]\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex).val(valor).trigger('change');} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:3572, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3587, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { var valor = $('#' + nameOfTable + 'Delito' + rowIndex).val(); $('#' + nameOfTable + 'Delito' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Delito' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Descripcion LIKE '%vehiculo%'\t\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Descripcion LIKE '%vehiculo%'\t\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Delito' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Delito' + rowIndex).val(valor).trigger('change'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'block');} else { var valor = $('#' + nameOfTable + 'Delito' + rowIndex).val(); $('#' + nameOfTable + 'Delito' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Delito' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Clave > 0\t\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Clave > 0\t\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Delito' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Delito' + rowIndex).val(valor).trigger('change'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none');}\r\n\r\n\r\n}\r\n//BusinessRuleId:3587, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3587, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { var valor = $('#' + nameOfTable + 'Delito' + rowIndex).val(); $('#' + nameOfTable + 'Delito' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Delito' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Descripcion LIKE '%vehiculo%'\t\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Descripcion LIKE '%vehiculo%'\t\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Delito' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Delito' + rowIndex).val(valor).trigger('change'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'block');} else { var valor = $('#' + nameOfTable + 'Delito' + rowIndex).val(); $('#' + nameOfTable + 'Delito' + rowIndex).empty(); if(!$('#' + nameOfTable + 'Delito' + rowIndex).hasClass('AutoComplete')) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option selected />\").val(\"\").text(\"\")); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Clave > 0\t\", rowIndex, nameOfTable), function (index, value) { $('#' + nameOfTable + 'Delito' + rowIndex).append($(\"<option />\").val(index).text(value)); }); } else { var selectData = []; selectData.push({id: \"\",text: \"\" }); $.each(EvaluaQueryDictionary(\"SELECT Clave, Descripcion FROM dbo.Delito WHERE Clave > 0\t\", rowIndex, nameOfTable), function (index, value) { selectData.push({ id: index, text: value }); }); $('#' + nameOfTable + 'Delito' + rowIndex).select2({data: selectData}) } $('#' + nameOfTable + 'Delito' + rowIndex).val(valor).trigger('change'); $(\"a[href='#tabDatos_de_Robo_de_Vehiculo']\").css('display', 'none');}\r\n\r\n\r\n}\r\n//BusinessRuleId:3587, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3617, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( TryParseInt('3', '3')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) || TryParseInt('2', '2')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) || TryParseInt('101', '101')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) || TryParseInt('103', '103')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) ) { DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Principal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Accion_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Accion_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Elementos_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Elementos_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Violencia_de_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Levantamiento_de_Cadaver\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clase\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Vehiculo_Robado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Sub_Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modelo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Color\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_de_Origen_de_las_Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"El_Vehiculo_esta_Asegurado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_de_la_Aseguradora\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Servicio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta_del_Servicio_Publico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Procedencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Mercancia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_de_lo_que_Transportaba\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto_de_la_Carga\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Senas_Particulares\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Causa_de_Muerte\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Consecuencia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Hecho\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Pais\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_no_Catalogada\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Necropsia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cronotanatodiagnostico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Conductor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Articulado_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Puede_Ser_Canalizado_a_JA\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motivo_de_no_canalizacion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informaron_sus_Derechos\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informo_el_Procedimiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Denuncia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Violencia_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clasificacion_con_Orden_de_Resultado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clasificacion_con_Orden_de_Resultado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Concurso\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Concurso' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Registro_Federal_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Registro_Publico_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cuenta_con_GPS\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Carretera\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Circunstacias\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Moral_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Fisica_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Involucrado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Denunciante_dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_Inicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_corta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_corta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MP\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MASC\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));}} else {}\r\n\r\n}\r\n//BusinessRuleId:3617, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3617, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt('3', '3')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) || TryParseInt('2', '2')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) || TryParseInt('101', '101')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) || TryParseInt('103', '103')==EvaluaQuery(\"select GLOBAL[USERROLEID]\",rowIndex, nameOfTable) ) { DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Principal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Accion_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Accion_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Elementos_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Elementos_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Violencia_de_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Levantamiento_de_Cadaver\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clase\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Vehiculo_Robado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Sub_Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modelo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Color\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_de_Origen_de_las_Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"El_Vehiculo_esta_Asegurado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_de_la_Aseguradora\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Servicio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta_del_Servicio_Publico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Procedencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Mercancia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_de_lo_que_Transportaba\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto_de_la_Carga\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Senas_Particulares\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Causa_de_Muerte\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Consecuencia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Hecho\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Pais\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_no_Catalogada\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Necropsia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cronotanatodiagnostico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Conductor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Articulado_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Puede_Ser_Canalizado_a_JA\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motivo_de_no_canalizacion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informaron_sus_Derechos\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informo_el_Procedimiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Denuncia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Violencia_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clasificacion_con_Orden_de_Resultado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clasificacion_con_Orden_de_Resultado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Concurso\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Concurso' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Registro_Federal_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Registro_Publico_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cuenta_con_GPS\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Carretera\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Circunstacias\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Moral_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Fisica_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Involucrado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Denunciante_dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_Inicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_corta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_corta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MP\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MASC\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));}} else {}\r\n\r\n}\r\n//BusinessRuleId:3617, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divMotor').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));$('#divSerie').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divMotor').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));$('#divSerie').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divMotor').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));$('#divSerie').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3624, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divClase').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));$('#divVehiculo_Robado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divClase').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));$('#divVehiculo_Robado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divClase').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));$('#divVehiculo_Robado').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3626, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3629, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Zona_de_Robo' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3629, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3629, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Zona_de_Robo' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3629, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3629, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Zona_de_Robo' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3629, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3630, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divNombre_de_la_Aseguradora').css('display', 'block');} else { $('#divNombre_de_la_Aseguradora').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3630, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3630, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divNombre_de_la_Aseguradora').css('display', 'block');} else { $('#divNombre_de_la_Aseguradora').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3630, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3630, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divNombre_de_la_Aseguradora').css('display', 'block');} else { $('#divNombre_de_la_Aseguradora').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3630, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:3632, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divSe_Informaron_sus_Derechos').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));$('#divSe_Informo_el_Procedimiento').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3632, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3632, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divSe_Informaron_sus_Derechos').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));$('#divSe_Informo_el_Procedimiento').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3632, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3632, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divSe_Informaron_sus_Derechos').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));$('#divSe_Informo_el_Procedimiento').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3632, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3659, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divRobo_de').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3659, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3659, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divRobo_de').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3659, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3659, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divRobo_de').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3659, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Mercancia' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'block');$('#divMonto_de_la_Carga').css('display', 'block');$('#divSenas_Particulares').css('display', 'block');} else { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex)); $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));$('#divMonto_de_la_Carga').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));$('#divSenas_Particulares').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Mercancia' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'block');$('#divMonto_de_la_Carga').css('display', 'block');$('#divSenas_Particulares').css('display', 'block');} else { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex)); $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));$('#divMonto_de_la_Carga').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));$('#divSenas_Particulares').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Mercancia' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'block');$('#divMonto_de_la_Carga').css('display', 'block');$('#divSenas_Particulares').css('display', 'block');} else { $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex)); $('#divDescripcion_de_lo_que_Transportaba').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));$('#divMonto_de_la_Carga').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));$('#divSenas_Particulares').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3631, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3715, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n SetRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3715, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3715, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n SetRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3715, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3715, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n SetRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:3715, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:3852, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divDelito_Violencia_Genero').css('display', 'block'); SetRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));} else { $('#divDelito_Violencia_Genero').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3852, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3852, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divDelito_Violencia_Genero').css('display', 'block'); SetRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));} else { $('#divDelito_Violencia_Genero').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3852, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:3852, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\nif( GetValueByControlType($('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex),nameOfTable,rowIndex)==TryParseInt('true', 'true') ) { $('#divDelito_Violencia_Genero').css('display', 'block'); SetRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));} else { $('#divDelito_Violencia_Genero').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex)); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:3852, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:4113, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( EvaluaQuery(\"SELECT canalizado FROM Detalle_de_Delito WHERE Clave = FLDD[lblClave]\",rowIndex, nameOfTable)==TryParseInt('1', '1') && TryParseInt(ReplaceGLOBAL('GLOBAL[idTablero]'), ReplaceGLOBAL('GLOBAL[idTablero]'))==TryParseInt('2', '2') ) { DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Principal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Accion_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Accion_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Elementos_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Elementos_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Violencia_de_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Levantamiento_de_Cadaver\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clase\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Vehiculo_Robado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Sub_Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modelo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Color\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_de_Origen_de_las_Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"El_Vehiculo_esta_Asegurado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_de_la_Aseguradora\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Servicio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta_del_Servicio_Publico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Procedencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Mercancia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_de_lo_que_Transportaba\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto_de_la_Carga\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Senas_Particulares\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Causa_de_Muerte\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Consecuencia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Hecho\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Pais\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_no_Catalogada\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Necropsia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cronotanatodiagnostico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Conductor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Articulado_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Puede_Ser_Canalizado_a_JA\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motivo_de_no_canalizacion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informaron_sus_Derechos\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informo_el_Procedimiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Denuncia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Violencia_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clasificacion_con_Orden_de_Resultado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clasificacion_con_Orden_de_Resultado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Concurso\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Concurso' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Registro_Federal_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Registro_Publico_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cuenta_con_GPS\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Carretera\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Circunstacias\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Moral_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Fisica_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Involucrado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Denunciante_dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_Inicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_corta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_corta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MP\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MASC\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Zona_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Zona_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:4113, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4377, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt('107', '107')==EvaluaQuery(\"SELECT GLOBAL[USERROLEID]\",rowIndex, nameOfTable) ) { DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Principal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Accion_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Accion_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Elementos_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Elementos_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Violencia_de_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Levantamiento_de_Cadaver\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clase\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Vehiculo_Robado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Sub_Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modelo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Color\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_de_Origen_de_las_Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"El_Vehiculo_esta_Asegurado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_de_la_Aseguradora\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Servicio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta_del_Servicio_Publico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Procedencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Mercancia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_de_lo_que_Transportaba\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto_de_la_Carga\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Senas_Particulares\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Causa_de_Muerte\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Consecuencia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Hecho\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Pais\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_no_Catalogada\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Necropsia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cronotanatodiagnostico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Conductor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Articulado_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Puede_Ser_Canalizado_a_JA\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motivo_de_no_canalizacion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informaron_sus_Derechos\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informo_el_Procedimiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Denuncia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Violencia_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clasificacion_con_Orden_de_Resultado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clasificacion_con_Orden_de_Resultado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Concurso\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Concurso' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Registro_Federal_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Registro_Publico_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cuenta_con_GPS\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Carretera\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Circunstacias\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Moral_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Fisica_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Involucrado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Denunciante_dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_Inicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_corta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_corta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MP\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MASC\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Zona_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Zona_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:4377, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n//BusinessRuleId:4380, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( TryParseInt('107', '107')==EvaluaQuery(\"SELECT GLOBAL[USERROLEID]\",rowIndex, nameOfTable) ) { DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Principal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Forma_Accion_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Forma_Accion_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Elementos_Comision_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Elementos_Comision_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Violencia_de_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Levantamiento_de_Cadaver\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clase\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Vehiculo_Robado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Sub_Marca\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modelo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Color\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_de_Origen_de_las_Placas\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"El_Vehiculo_esta_Asegurado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_de_la_Aseguradora\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Servicio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta_del_Servicio_Publico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Procedencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Mercancia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_de_lo_que_Transportaba\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Monto_de_la_Carga\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Senas_Particulares\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Modalidad_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Causa_de_Muerte\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Circunstancia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Consecuencia_Defuncion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_Levantamiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Hecho\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Pais\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_no_Catalogada\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Necropsia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cronotanatodiagnostico\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Ruta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Conductor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Articulado_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Puede_Ser_Canalizado_a_JA\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Motivo_de_no_canalizacion\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informaron_sus_Derechos\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Se_Informo_el_Procedimiento\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Denuncia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Delito_Violencia_Genero\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clasificacion_con_Orden_de_Resultado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clasificacion_con_Orden_de_Resultado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Concurso\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Concurso' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Fecha_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Hora_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Robo_de\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Registro_Federal_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Registro_Publico_Vehicular\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Motor\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_de_Serie\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Estado_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Municipio_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Colonia_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Codigo_Postal_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Entre_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"y_Calle_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Exterior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Numero_Interior_del_Delito_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Referencia_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Latitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Longitud_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Cuenta_con_GPS\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar_del_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Carretera\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Clave\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Folio_Circunstacias\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Lugar\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Moral_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Persona_Fisica_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Involucrado\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Denunciante_dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Nombre_Completo_Dueno\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_Inicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Descripcion_corta\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_corta' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MP\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MP' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Expediente_MASC\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Zona_de_Robo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Zona_de_Robo' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Agravante\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));} DisabledControl($(\"#\" + nameOfTable + \"Titulo_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Titulo_del_Delito' + rowIndex));} if('true' == 'true')\r\n{\r\n\t$('#divCircunstancias_Delito a').attr('disabled', 'disabled');\r\n\t$('#divCircunstancias_Delito a').css(\"pointer-events\",\"none\");\r\n}\r\nelse\r\n{\r\n\t$('#divCircunstancias_Delito a').attr('disabled', '');\r\n\t$('#divCircunstancias_Delito a').css(\"pointer-events\",\"all\");\r\n}} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:4380, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4581, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n DisabledControl($(\"#\" + nameOfTable + \"Titulo_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Titulo_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:4581, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4581, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n DisabledControl($(\"#\" + nameOfTable + \"Titulo_del_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Titulo_del_Delito' + rowIndex));}DisabledControl($(\"#\" + nameOfTable + \"Grupo_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:4581, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:1927, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Titulo_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1927, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1927, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Titulo_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1927, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:1927, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Clave' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Titulo_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Grupo_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Monto' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Violencia_de_Genero' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Levantamiento_de_Cadaver' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Clase' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Vehiculo_Robado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Marca' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Sub_Marca' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Vehiculo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Modelo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Color' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Placas' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_de_Origen_de_las_Placas' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Motor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Serie' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'El_Vehiculo_esta_Asegurado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_de_la_Aseguradora' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Servicio' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Ruta_del_Servicio_Publico' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Procedencia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Mercancia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Descripcion_de_lo_que_Transportaba' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Monto_de_la_Carga' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Senas_Particulares' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Modalidad_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Causa_de_Muerte' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Circunstancia_Defuncion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Consecuencia_Defuncion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_Levantamiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_Levantamiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Hecho' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Pais' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_no_Catalogada' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Necropsia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Cronotanatodiagnostico' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Conductor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Articulado_de_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Puede_Ser_Canalizado_a_JA' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Motivo_de_no_canalizacion' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informaron_sus_Derechos' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Se_Informo_el_Procedimiento' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Denuncia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Violencia_Genero' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Fecha_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Hora_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Registro_Federal_Vehicular' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Registro_Publico_Vehicular' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Motor' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_de_Serie' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Estado_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Municipio_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Colonia_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Codigo_Postal_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Entre_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'y_Calle_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Exterior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Numero_Interior_del_Delito_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Referencia_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Latitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Longitud_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Lugar_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Cuenta_con_GPS' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Lugar_del_Robo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Carretera' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Agravante' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Folio_Circunstacias' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Moral_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Persona_Fisica_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Involucrado' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Denunciante_dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Nombre_Completo_Dueno' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_Inicial' + rowIndex));SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:1927, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4703, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divRobo_de_Vehiculo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex)); DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:4703, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4703, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divRobo_de_Vehiculo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex)); DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:4703, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4703, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divRobo_de_Vehiculo').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex)); DisabledControl($(\"#\" + nameOfTable + \"Robo_de_Vehiculo\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Robo_de_Vehiculo' + rowIndex));}\r\n\r\n\r\n}\r\n//BusinessRuleId:4703, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4705, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:4705, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4705, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:4705, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4705, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Estado' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:4705, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2944, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divExpediente_MASC').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:2944, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2944, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divExpediente_MASC').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:2944, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:2944, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divExpediente_MASC').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Expediente_MASC' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:2944, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4738, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divDelito_Principal').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:4738, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4738, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divDelito_Principal').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:4738, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4738, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divDelito_Principal').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Delito_Principal' + rowIndex));\r\n\r\n\r\n}\r\n//BusinessRuleId:4738, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n//BusinessRuleId:4740, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\nif( EvaluaQuery(\"select COUNT(*) from Detalle_de_Delito where Expediente_Inicial = GLOBAL[SpartanOperationId]\",rowIndex, nameOfTable)==TryParseInt('1', '1') ) { DisabledControl($(\"#\" + nameOfTable + \"Tipo_de_Delito\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Tipo_de_Delito' + rowIndex));}} else {}\r\n\r\n\r\n}\r\n//BusinessRuleId:4740, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//BusinessRuleId:4762, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n $('#divAgravante').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));\n\r\r\n}\r\n//BusinessRuleId:4762, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4762, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n $('#divAgravante').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));\n\r\r\n}\r\n//BusinessRuleId:4762, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4762, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n $('#divAgravante').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Agravante' + rowIndex));\n\r\r\n}\r\n//BusinessRuleId:4762, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4980, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'New'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex)); $('#divMandamiento_Judicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex)); DisabledControl($(\"#\" + nameOfTable + \"Mandamiento_Judicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex));}\n\r\r\n}\r\n//BusinessRuleId:4980, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4980, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Update'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex)); $('#divMandamiento_Judicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex)); DisabledControl($(\"#\" + nameOfTable + \"Mandamiento_Judicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex));}\n\r\r\n}\r\n//BusinessRuleId:4980, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//BusinessRuleId:4980, Attribute:0, Operation:Object, Event:SCREENOPENING\r\nif(operation == 'Consult'){\r\n SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex)); $('#divMandamiento_Judicial').css('display', 'none'); SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex)); DisabledControl($(\"#\" + nameOfTable + \"Mandamiento_Judicial\" + rowIndex), (\"true\" == \"true\"));if ('true'=='true'){SetNotRequiredToControl( $('#' + nameOfTable + 'Mandamiento_Judicial' + rowIndex));}\n\r\r\n}\r\n//BusinessRuleId:4980, Attribute:0, Operation:Object, Event:SCREENOPENING\r\n\r\n//NEWBUSINESSRULE_SCREENOPENING//\r\n}", "title": "" }, { "docid": "d37e354448c00b8ce8821a4c650dcaa6", "score": "0.49415654", "text": "buildQuery() {\n // build query only if `this.operation` is not set to `custom`\n if (this.operation !== 'custom') {\n let query;\n // get the template for the current CRUD operation the user wants to perform\n query = this.templates()[this.operation];\n\n // ** check which sub actions have been called - check the chain property **\n if (this.chain.where) {\n query += ` ${this.restrictionString}`;\n }\n\n if (this.chain.group) {\n query += ` ${this.groupByString}`;\n }\n\n if (this.chain.order) {\n query += ` ${this.orderByString}`;\n }\n\n if (this.chain.limit) {\n query += ` ${this.limitString}`;\n }\n\n if (this.operation === 'create' || this.operation === 'update') {\n query += ` ${this.toReturnFields}`;\n }\n\n // set the final queryString to be executed\n this.queryString = query;\n }\n }", "title": "" }, { "docid": "82ba3b3c435bfc02db70e1dffe4a7642", "score": "0.4923261", "text": "get _isOperation () { return true }", "title": "" }, { "docid": "b2a87f8b838b009de5505c31d181b258", "score": "0.49150777", "text": "function coger_operador(oper) {\n borrar_calcu();\n operador = oper.value\n semaforo = false;\n}", "title": "" }, { "docid": "17bbe82b1ff41104037960dd03bddf8b", "score": "0.49090675", "text": "async obtenerOperarios(){\n return operarioPersonaDao.obtenerOperarios();\n }", "title": "" }, { "docid": "aa392ee34b2979e8fed9d3bd7e598d1e", "score": "0.49069545", "text": "function setOperation(operacion){\r\n const inputScreenValue = document.getElementsByClassName('calculator_screen')[0].value;\r\n this.operacion=operacion;\r\n if(inputScreenValue!= 0){\r\n calculation();\r\n }\r\n}", "title": "" }, { "docid": "a0963d6756372dd62d4fb94f3589f35b", "score": "0.4857491", "text": "function validarReglaTramite(){\n var flagRegla = false;\n\n if(!tmpTipoSolicitud.data.CRTST_RESTRINGIDO)\n return true;\n\n pnlFrmCgg_res_tramitePrincipal.getEl().mask('Validando...', 'x-mask-loading');\n valFechaSalida=(dtCrtra_fecha_salida!=null && dtCrtra_fecha_salida.getValue()!=null)?dtCrtra_fecha_salida.getValue().toString('dd/MM/yyyy'):null;\n try{\n var jsonData = {};\n try{\n crtstCodigo = tmpTipoSolicitud.get('CRTST_CODIGO');\n crperCodigo = (tmpAuspiciante)?tmpAuspiciante.get('CRPER_CODIGO'):null;\n cggcrperCodigo = (rBeneficiario)?rBeneficiario.get('CRPER_CODIGO'):null;\n crperNumDocIdentific = rBeneficiario.get('CRPER_NUM_DOC_IDENTIFIC');\n cggCrperFechaNacimiento = rBeneficiario.get('CRPER_FECHA_NACIMIENTO');\n var crdidCodigo = rBeneficiario.get('CRDID_CODIGO');\n repCrperCodigo = (rRepresentante)?rRepresentante.get('CRPER_CODIGO'):null;\n //crdptCodigo = tmpDepositoGarantia.data.CRDPT_CODIGO;\n jsonData = {'CRTST_CODIGO':crtstCodigo,\n 'CRDID_CODIGO':crdidCodigo,\n 'CRPER_CODIGO':crperCodigo,\n 'CGGCRPER_CODIGO':cggcrperCodigo,\n 'CRPER_NUM_DOC_IDENTIFIC':crperNumDocIdentific,\n 'CRPER_FECHA_NACIMIENTO':cggCrperFechaNacimiento,\n 'REP_CRPER_CODIGO':repCrperCodigo,\n 'CHANGE_CRTST_CODIGO':valChangeCrtst_codigo\n };\n }catch(inErr){}\n\n var resultadoRegla = evaluarReglaTramite();\n if(resultadoRegla!==null){\n var param = new SOAPClientParameters();\n param.add('inJSON_reglas_validacion',resultadoRegla);\n param.add('jsonData',JSON.stringify(jsonData));\n var validacion = SOAPClient.invoke(URL_WS+'Cgg_regla_validacion' ,'ejecutarReglaTipoSolicitud',param, false, null);\n validacion = Ext.util.JSON.decode(validacion);\n if(validacion.resultadoValidacion !== undefined){\n if(validacion.resultadoValidacion == 'false'){\n var objCgg_regla_validacion = new FrmListadoCgg_regla_validacion_resultado(validacion);\n objCgg_regla_validacion.loadData();\n objCgg_regla_validacion.show();\n }\n flagRegla=eval(validacion.resultadoValidacion);\n }else{\n flagRegla = null;\n }\n }\n }catch(inErr){\n Ext.MsgPopup.msg(tituloCgg_res_tramite, \"No se ha podido validar la informaci\\u00f3n a almacenar.<br>Error:\"+inErr+'<br>'+ERR_MESSAGE);\n flagRegla = false;\n }\n pnlFrmCgg_res_tramitePrincipal.getEl().unmask();\n return flagRegla;\n }", "title": "" }, { "docid": "bb79582d581f88962958c0c657804a65", "score": "0.48466638", "text": "nextOperation() {\n if (this.offset < this.operations.length) {\n return this.operations[this.offset++];\n }\n return null;\n }", "title": "" }, { "docid": "e781346e6560962caf08135219e521b7", "score": "0.48258123", "text": "function ordenada(){}", "title": "" }, { "docid": "3e642b6ce80bba4391b1772f7bcdf98f", "score": "0.48055398", "text": "calc() {\n var tf = this.tf;\n if(!tf.hasGrid()){\n return;\n }\n\n if(this.onBeforeOperation){\n this.onBeforeOperation.call(null, tf);\n }\n\n var opts = this.opts,\n labelId = opts.id,\n colIndex = opts.col,\n operation = opts.operation,\n outputType = opts.write_method,\n totRowIndex = opts.tot_row_index,\n excludeRow = opts.exclude_row,\n decimalPrecision = Types.isUndef(opts.decimal_precision) ?\n 2 : opts.decimal_precision;\n\n //nuovella: determine unique list of columns to operate on\n var ucolIndex = [],\n ucolMax = 0;\n ucolIndex[ucolMax] = colIndex[0];\n\n for(var ii=1; ii<colIndex.length; ii++){\n var saved = 0;\n //see if colIndex[ii] is already in the list of unique indexes\n for(var jj=0; jj<=ucolMax; jj++){\n if(ucolIndex[jj] === colIndex[ii]){\n saved = 1;\n }\n }\n //if not saved then, save the index;\n if (saved === 0){\n ucolMax++;\n ucolIndex[ucolMax] = colIndex[ii];\n }\n }\n\n if(Str.lower(typeof labelId)=='object' &&\n Str.lower(typeof colIndex)=='object' &&\n Str.lower(typeof operation)=='object'){\n var rows = tf.tbl.rows,\n colvalues = [];\n\n for(var ucol=0; ucol<=ucolMax; ucol++){\n //this retrieves col values\n //use ucolIndex because we only want to pass through this loop\n //once for each column get the values in this unique column\n colvalues.push(\n tf.getColValues(ucolIndex[ucol], false, true, excludeRow));\n\n //next: calculate all operations for this column\n var result,\n nbvalues=0,\n temp,\n meanValue=0,\n sumValue=0,\n minValue=null,\n maxValue=null,\n q1Value=null,\n medValue=null,\n q3Value=null,\n meanFlag=0,\n sumFlag=0,\n minFlag=0,\n maxFlag=0,\n q1Flag=0,\n medFlag=0,\n q3Flag=0,\n theList=[],\n opsThisCol=[],\n decThisCol=[],\n labThisCol=[],\n oTypeThisCol=[],\n mThisCol=-1;\n\n for(var k=0; k<colIndex.length; k++){\n if(colIndex[k] === ucolIndex[ucol]){\n mThisCol++;\n opsThisCol[mThisCol]=Str.lower(operation[k]);\n decThisCol[mThisCol]=decimalPrecision[k];\n labThisCol[mThisCol]=labelId[k];\n oTypeThisCol = outputType !== undefined &&\n Str.lower(typeof outputType)==='object' ?\n outputType[k] : null;\n\n switch(opsThisCol[mThisCol]){\n case 'mean':\n meanFlag=1;\n break;\n case 'sum':\n sumFlag=1;\n break;\n case 'min':\n minFlag=1;\n break;\n case 'max':\n maxFlag=1;\n break;\n case 'median':\n medFlag=1;\n break;\n case 'q1':\n q1Flag=1;\n break;\n case 'q3':\n q3Flag=1;\n break;\n }\n }\n }\n\n for(var j=0; j<colvalues[ucol].length; j++){\n //sort the list for calculation of median and quartiles\n if((q1Flag==1)|| (q3Flag==1) || (medFlag==1)){\n if (j<colvalues[ucol].length -1){\n for(k=j+1; k<colvalues[ucol].length; k++) {\n /* eslint-disable */\n if(eval(colvalues[ucol][k]) <\n eval(colvalues[ucol][j])){\n /* eslint-enable */\n temp = colvalues[ucol][j];\n colvalues[ucol][j] = colvalues[ucol][k];\n colvalues[ucol][k] = temp;\n }\n }\n }\n }\n var cvalue = parseFloat(colvalues[ucol][j]);\n theList[j] = parseFloat(cvalue);\n\n if(!isNaN(cvalue)){\n nbvalues++;\n if(sumFlag===1 || meanFlag===1){\n sumValue += parseFloat( cvalue );\n }\n if(minFlag===1){\n if(minValue===null){\n minValue = parseFloat( cvalue );\n } else{\n minValue = parseFloat( cvalue ) < minValue ?\n parseFloat( cvalue ): minValue;\n }\n }\n if(maxFlag===1){\n if (maxValue===null){\n maxValue = parseFloat( cvalue );\n } else {\n maxValue = parseFloat( cvalue ) > maxValue ?\n parseFloat( cvalue ): maxValue;\n }\n }\n }\n }//for j\n if(meanFlag===1){\n meanValue = sumValue/nbvalues;\n }\n if(medFlag===1){\n var aux = 0;\n if(nbvalues%2 === 1){\n aux = Math.floor(nbvalues/2);\n medValue = theList[aux];\n } else{\n medValue =\n (theList[nbvalues/2] + theList[((nbvalues/2)-1)])/2;\n }\n }\n var posa;\n if(q1Flag===1){\n posa=0.0;\n posa = Math.floor(nbvalues/4);\n if(4*posa == nbvalues){\n q1Value = (theList[posa-1] + theList[posa])/2;\n } else {\n q1Value = theList[posa];\n }\n }\n if (q3Flag===1){\n posa=0.0;\n var posb=0.0;\n posa = Math.floor(nbvalues/4);\n if (4*posa === nbvalues){\n posb = 3*posa;\n q3Value = (theList[posb] + theList[posb-1])/2;\n } else {\n q3Value = theList[nbvalues-posa-1];\n }\n }\n\n for(var i=0; i<=mThisCol; i++){\n switch( opsThisCol[i] ){\n case 'mean':\n result=meanValue;\n break;\n case 'sum':\n result=sumValue;\n break;\n case 'min':\n result=minValue;\n break;\n case 'max':\n result=maxValue;\n break;\n case 'median':\n result=medValue;\n break;\n case 'q1':\n result=q1Value;\n break;\n case 'q3':\n result=q3Value;\n break;\n }\n\n var precision = !isNaN(decThisCol[i]) ? decThisCol[i] : 2;\n\n //if outputType is defined\n if(oTypeThisCol && result){\n result = result.toFixed( precision );\n\n if(Dom.id(labThisCol[i])){\n switch( Str.lower(oTypeThisCol) ){\n case 'innerhtml':\n if (isNaN(result) || !isFinite(result) ||\n nbvalues===0){\n Dom.id(labThisCol[i]).innerHTML = '.';\n } else{\n Dom.id(labThisCol[i]).innerHTML= result;\n }\n break;\n case 'setvalue':\n Dom.id( labThisCol[i] ).value = result;\n break;\n case 'createtextnode':\n var oldnode = Dom.id(labThisCol[i])\n .firstChild;\n var txtnode = Dom.text(result);\n Dom.id(labThisCol[i])\n .replaceChild(txtnode, oldnode);\n break;\n }//switch\n }\n } else {\n try{\n if(isNaN(result) || !isFinite(result) ||\n nbvalues===0){\n Dom.id(labThisCol[i]).innerHTML = '.';\n } else {\n Dom.id(labThisCol[i]).innerHTML =\n result.toFixed(precision);\n }\n } catch(e) {}//catch\n }//else\n }//for i\n\n // row(s) with result are always visible\n var totRow = totRowIndex && totRowIndex[ucol] ?\n rows[totRowIndex[ucol]] : null;\n if(totRow){\n totRow.style.display = '';\n }\n }//for ucol\n }//if typeof\n\n if(this.onAfterOperation){\n this.onAfterOperation.call(null, tf);\n }\n }", "title": "" }, { "docid": "8193a63866c9b7b0ce1a4e2448423092", "score": "0.48019782", "text": "validaPeriodo(index) {\n /*Curso a disposição do Núcleo estudantil*/\n let cursos_add = this.cursos_add.filter(function (curso) {\n return curso.id === parseInt(index)\n });\n\n\n /*Curso Matriculado do aluno*/\n\n if (!this.alterar)\n this.cursos.map(item => {\n this.verificaObject(item, cursos_add)\n })\n\n /*Realiza Verificação de Período e Curso*/\n if (this.$valida)\n if (this.$valida.length > 0 && this.$valida[0] === false) {\n Notifica.info(this.$valida[1])\n this.centro_cursos_id = null\n this.$valida = [true];\n }\n }", "title": "" }, { "docid": "cb0dc1307b9df8e6746d02f7ce0d5c00", "score": "0.47994658", "text": "Oh() {\n return this.persistence.runTransaction(\"Get new document changes\", \"readonly\", t => this.ko.Oh(t, this.bo)).then(({Bh: t, readTime: e}) => (this.bo = e, \n t));\n }", "title": "" }, { "docid": "e7b6b5f0d87d3372fa242fd99bb79943", "score": "0.47891918", "text": "async crearOperario(objeto){\n return operarioPersonaDao.crearOperario(objeto);\n }", "title": "" }, { "docid": "40c783c3635565d845d970180c1702fb", "score": "0.47846785", "text": "jugar(thisEleccion){\n if(this.creditos >= 5){ //Si los créditos son mayores a 5, puede apostar.\n this.apostar(); //Apuesta.\n return this.tomar_decicion(thisEleccion); //Llama a la función que retorna tu decisión.\n }\n }", "title": "" }, { "docid": "e434ef33f153a678feae5a340f40a5aa", "score": "0.47768137", "text": "function ultimoMesEditado(registro, campoIterar, datoPreguntar, orden){\n if(orden==1){\n for(var i=0; i<registro[campoIterar].length; i++){\n if( (registro[campoIterar][i][datoPreguntar]==null || registro[campoIterar][i][datoPreguntar]==\"\") && registro[campoIterar][i].validado){\n return i-1;\n }\n }\n return registro[campoIterar].length;\n }else if(orden==-1){\n for(var i=registro[campoIterar].length-1; i>0; i--){\n if(registro[campoIterar][i][datoPreguntar]!=null && registro[campoIterar][i][datoPreguntar]!=\"\" && registro[campoIterar][i].validado){\n return i;\n }\n }\n return 0;\n }\n }", "title": "" }, { "docid": "0d2b6af2e015e3a0316745a999f2d2a4", "score": "0.47579464", "text": "caso1() {\n this.empilhaValor(this.desempilhaControle());\n }", "title": "" }, { "docid": "8d919938864f1449fe593b6c4c57d402", "score": "0.47541633", "text": "function procesarExpresion(expresion,tsglobal,tslocal,metodos) {\r\n if (expresion.tipo==TIPO_OPERACION.SUMA) { \r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)+valorder.valor\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)+valorder.valor\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:1+valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:1+valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n console.log('Booleano no puede sumarse con '+TIPO_DATO.BANDERA);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n console.log('Booleano no puede sumarse con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)+valorder.valor\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)+valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)+valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se puede sumar '+valorizq.tipo+' con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor+valorder.valor)\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor+valorder.valor)\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.CADENA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden sumar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n }else if (expresion.tipo==TIPO_OPERACION.RESTA) { //resta\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor-1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor-valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los Entero con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los Decimal con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:1-valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:0-valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:1-valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:0-valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden restar los Bandera con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n console.log('no se pueden restar los Booleano con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los cadena con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)-valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)-valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se puede restar '+valorizq.tipo+' con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n console.log('no se pueden restar los Caracter con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los Caracter con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden restar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n \r\n }else if (expresion.tipo==TIPO_OPERACION.MULTIPLICACION) { //multiplicacion\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor*valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)*valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)*valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.DIVISION) { //division\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorder.valor!=0) {\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor/valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)/valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)/valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n } \r\n }else{\r\n console.log('no se puede dividir dentro de 0');\r\n }\r\n \r\n //parte para las condicionantes \r\n }else if (expresion.tipo==TIPO_OPERACION.MODULAR) { //MODULAR\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorder.valor!=0) {\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n } \r\n }else{\r\n console.log('no se puede dividir dentro de 0');\r\n }\r\n //parte para las condicionantes \r\n }else if (expresion.tipo==TIPO_OPERACION.POTENCIA) { //POTENCIA\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.valor==0 && valorder.valor==0) {\r\n console.log('no se puede hace pow(0,0)');\r\n }else{\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n default:\r\n console.log('no se pueden hacer potencia en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden hacer hacer potencia en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n }\r\n //parte para las condicionantes \r\n }else if (expresion.tipo==TIPO_OPERACION.MAYOR) { //mayor OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' > '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' > '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))>valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' > '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.MENOR) { //menor OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' < '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' < '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))<valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' < '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.MENORIGUAL) { //menorigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' <= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' <= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))<=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' <= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.MAYORIGUAL) { //mayorigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' >= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' >='+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))>=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' >= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.IGUALIGUAL) { //igualigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' == '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' =='+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))==valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))==valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))==Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' == '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.NOIGUAL) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' != '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' !='+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))!=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))!=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))!=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' != '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.ORR) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor||valorder.valor\r\n }\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' || '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' || '+valorder.tipo);\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.ANDD) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor&&valorder.valor\r\n }\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' && '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' && '+valorder.tipo);\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.CASTEO) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n var tipoC = expresion.operanIzq;\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (tipoC) {\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CARACTER,\r\n valor:String.fromCharCode(valorder.valor)\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Number(valorder.valor)\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (tipoC) {\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CARACTER,\r\n valor:String.fromCharCode(valorder.valor)\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.trunc(valorder.valor)\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (tipoC) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Number(valorizq.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CADENA:\r\n switch (tipoC) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Number(valorder.valor)\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Number(valorder.valor)\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.NOTT) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:!valorizq.valor\r\n }\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' !');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.NEGATIVO) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.tipo==TIPO_DATO.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*-1\r\n };\r\n\r\n }else if (valorizq.tipo==TIPO_DATO.ENTERO) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor*-1\r\n };\r\n\r\n }else{\r\n //error semantico \r\n console.log('Error Semantico para devolver negativo');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TOLOWERR) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.tipo==TIPO_DATO.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor.toLowerCase()\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo cadena\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TOUPPERR) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.tipo==TIPO_DATO.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor.toUpperCase()\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo cadena\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.LENGTHH) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n if (valorizq.tipo==TIPO_DATO.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.length\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TRUNCATEE) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n if (valorizq.tipo==TIPO_DATO.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.trunc(valorizq.valor)\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo ENTERO valido\"+'\\n';\r\n console.log('inVALIDO');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.ROUNDD) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n if (valorizq.tipo==TIPO_DATO.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.round(valorizq.valor)\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TIPODE) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"double\"\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"int\"\r\n }\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"boolean\"\r\n }\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"string\"\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"char\"\r\n }\r\n default:\r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TOTEXTO) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)\r\n }\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)\r\n }\r\n default:\r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TERNARIO) { //negativo\r\n var condicion=procesarExpresion(expresion.condicion,tsglobal,tslocal,metodos);\r\n if (condicion==true) {\r\n var resultado= procesarExpresion(expresion.valorVerdadero,tsglobal,tslocal,metodos);\r\n return resultado;\r\n }else if (condicion==false) {\r\n var resultado= procesarExpresion(expresion.valorVerdadero,tsglobal,tslocal,metodos);\r\n return resultado;\r\n }\r\n }else if (expresion.tipo==TIPO_VALOR.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:expresion.valor\r\n };\r\n }else if (expresion.tipo==TIPO_VALOR.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:expresion.valor\r\n };\r\n \r\n }else if (expresion.tipo==TIPO_VALOR.BANDERA) {\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:expresion.valor\r\n };\r\n \r\n }else if (expresion.tipo==TIPO_VALOR.IDENTIFICADOR) {\r\n //buscar el valor de la tabla de simbolos el valor de la variable en la ts local\r\n if (tslocal != undefined) {\r\n var valorId = tslocal.obtener(expresion.valor); //si la tslocal no esta indefinida busca el valor en esta\r\n if(valorId){\r\n return{\r\n tipo:valorId.tipo,\r\n valor:valorId.valor\r\n };\r\n }else{\r\n valorId=tsglobal.obtener(expresion.valor); //si no encuentra la variable en la local entonces buscara en la global\r\n if(valorId){\r\n return{\r\n tipo:valorId.tipo,\r\n valor:valorId.valor\r\n };\r\n }else{\r\n return undefined;\r\n }\r\n }\r\n }else{\r\n var valorId=tsglobal.obtener(expresion.valor); //si no existe la tslocal entonces de una vez pasa a buscar en la global\r\n if(valorId){\r\n return{\r\n tipo:valorId.tipo,\r\n valor:valorId.valor\r\n };\r\n }else{\r\n return undefined;\r\n }\r\n }\r\n }else if (expresion.tipo==TIPO_VALOR.ENTERO) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:expresion.valor\r\n };\r\n }else if (expresion.tipo==TIPO_VALOR.CARACTER) {\r\n return{\r\n tipo:TIPO_DATO.CARACTER,\r\n valor:expresion.valor\r\n };\r\n }\r\n}", "title": "" }, { "docid": "8e551836cad88f8a79eeaa959b8e7641", "score": "0.47471672", "text": "async actualizarOperario(id, objeto){\n return operarioPersonaDao.actualizarOperario(id, objeto);\n }", "title": "" }, { "docid": "6ef9eb6ea3b839c5a812656058e9db49", "score": "0.47285783", "text": "actualizar(datoActual, datoNuevo){\n if(this.buscar(datoActual)){\n if(this.buscar(datoNuevo) && !this.repetidos){\n alert(\"No se aceptan valores repetidos\")\n return\n }\n if(datoActual == this.primero.dato && this.tamanio == 1){\n this.primero.dato = datoNuevo\n this.ultimo.dato = datoNuevo\n }else if(datoActual == this.primero.dato){\n this.primero.dato = datoNuevo\n }else if(datoActual == this.ultimo.dato){\n this.ultimo.dato = datoNuevo\n }else{\n this.primero = this._actualizar(datoActual, datoNuevo, this.primero)\n }\n }else{\n alert(\"El valor no existe dentro de la lista\")\n }\n }", "title": "" }, { "docid": "b8f16b48e476e3329f656d89a2dfe101", "score": "0.47283962", "text": "function doFillByOpId(opId, op) {\n var el = getElementByOpId(opId);\n return el ? (fillTheElement(el, op), [el]) : null;\n }", "title": "" }, { "docid": "14736483da2d3d7406551da12cdbda8c", "score": "0.4725358", "text": "getPercorsoImmagineRappresentativa () {\n return this.percorsoImmagine\n }", "title": "" }, { "docid": "23db932856ea0e5ef29df098a5ccb58c", "score": "0.4706553", "text": "function cobValorArgumPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('cobValorArgumListLayer', 'O');\n\t\tvisibilidad('cobValorArgumListButtonsLayer', 'O');\n\t\tif(get('cobValorArgumFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los parámetros de la última busqueda. (en la variable javascript)\n\tcobValorArgumLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripción en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminación)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:cobValorArgumViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, cobValorArgumChoiceColumn) + \"</A>\",\n\t\t\ti, cobValorArgumChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger sólo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tcobValorArgumList.setDatos(datosTmp.filtrar([0,1,2],'*'));\n\t\n\t//La última fila de datos representa a los timestamps que debemos guardarlos\n\tcobValorArgumTimeStamps = datosTmp.filtrar([3],'*');\n\t\n\t//SI hay mas paginas reigistramos que es así e eliminamos el último registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tcobValorArgumMorePagesFlag = true;\n\t\tcobValorArgumList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tcobValorArgumMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el botón de borrar si estamos en la acción\n\tif(get('cobValorArgumFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('cobValorArgumListLayer', 'V');\n\tvisibilidad('cobValorArgumListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('cobValorArgumList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tcobValorArgumList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(cobValorArgumMorePagesFlag){\n\t\tset_estado_botonera('cobValorArgumPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('cobValorArgumPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(cobValorArgumPageCount > 1){\n\t\tset_estado_botonera('cobValorArgumPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('cobValorArgumPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('cobValorArgumPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('cobValorArgumPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}", "title": "" }, { "docid": "5aac3d2aa656fc093cf8592fcc843fd3", "score": "0.46967113", "text": "function getElementByOpId(theOpId) {\n var theElement;\n if (void 0 === theOpId || null === theOpId) {\n return null;\n }\n try {\n var elements = Array.prototype.slice.call(selectAllFromDoc('input, select, button'));\n var filteredElements = elements.filter(function (o) {\n return o.opid == theOpId;\n });\n if (0 < filteredElements.length) {\n theElement = filteredElements[0],\n 1 < filteredElements.length && console.warn('More than one element found with opid ' + theOpId);\n } else {\n var elIndex = parseInt(theOpId.split('__')[1], 10);\n isNaN(elIndex) || (theElement = elements[elIndex]);\n }\n } catch (e) {\n console.error('An unexpected error occurred: ' + e);\n } finally {\n return theElement;\n }\n }", "title": "" }, { "docid": "1271298d552745cf0a1d4c876fcd7381", "score": "0.46917212", "text": "nextOperation() {\n if (this.offset < this.operations.length) {\n return this.operations[this.offset++];\n }\n return null;\n }", "title": "" }, { "docid": "240521bded1863cf9066838fc66f95c0", "score": "0.46837184", "text": "chooseOperation(operation) {\n //A conditional statement is added to prevent the operations from being casted when there is no current value set for the current operand\n if (this.currentOperand === \"\") return\n //This conditional statement states that if the previous operand is not equal to and empty string then the function compute will be executed \n //storing the operation which needs to be computed in the operation variable\n if (this.previousOperand !== \"\") {\n this.compute()\n }\n this.operation = operation\n //current number will be contained in the previous operand container\n this.previousOperand = this.currentOperand\n //the new current operand will be cleared\n this.currentOperand = \"\"\n }", "title": "" }, { "docid": "9b2c9e96bf2e9820eb05fb7667643f85", "score": "0.46752283", "text": "function accionAtributos($opc,$columna,$idpuesto,$idDocumento){\r\n switch ($opc){\r\n case 2:{\r\n $cadena=\"¿Desea agregar el atributo?\";\r\n break;\r\n }\r\n case 3:{\r\n $cadena=\"¿Desea retirar el atriubto?\";\r\n break;\r\n }\r\n }\r\n if(window.confirm($cadena)){\r\n accion=$opc;\r\n codigo=document.getElementById('txtcodigoEmpleado').value;\r\n //1 Requerido, 2 Legalizable, 3 Legalizado,\r\n //\"2\"=>\"REQUERIDO\",\"4\"=>\"LEGALIZABLE\",\"5\"=>\"LEGALIZADO\",\"8\"=>\"ENTREGADO\"\r\n switch ($columna){\r\n case 2:{\r\n columna=1;\r\n break;\r\n }\r\n case 4:{\r\n columna=2;\r\n break;\r\n }\r\n case 5:{\r\n columna=3;\r\n break;\r\n }\r\n case 8:{\r\n columna=0;\r\n break;\r\n }\r\n }\r\n puesto=$idpuesto;\r\n documento=$idDocumento;\r\n if(columna!=0){\r\n patronModulo='accionAtributo';\r\n parametros='';\r\n parametros+='p1='+patronModulo;\r\n parametros+='&p2='+accion; //agreagar o eliminar atributos\r\n parametros+='&p3='+codigo; //id Empleado\r\n parametros+='&p4='+columna;\r\n parametros+='&p5='+puesto;\r\n parametros+='&p6='+documento;\r\n\r\n new Ajax.Request(pathRequestControl,{\r\n method : 'get',\r\n parameters : parametros,\r\n onLoading : micargador(1),\r\n onComplete : function(transport){\r\n micargador(0);\r\n mostrarTLegajo(document.getElementById('txtcodigoEmpleado').value,2);\r\n respuesta = transport.responseText;\r\n //document.getElementById('txtNomPer').value=$('divTitulo').innerHTML;\r\n //$('divConsultaP').update(respuesta);\r\n //recargarArbolMenuRegistro();\r\n }\r\n } )\r\n }\r\n else{\r\n //idPuestoEmpleado=$('hIdPuestoEmpleado').value;\r\n vformname='actualizaEntregaDeDocumentos'\r\n vtitle='ACTUALIZA FECHA DE ENTREGA'\r\n vwidth='200'\r\n vheight='130'\r\n vcenter='t'\r\n vresizable=''\r\n vmodal='false'\r\n vstyle=''\r\n vopacity=''\r\n\r\n vposx1=''\r\n vposx2=''\r\n vposy1=''\r\n vposy2=''\r\n patronModulo='ventanaActualizaEntregaDeDocumentos';\r\n parametros='';\r\n parametros+='p1='+patronModulo;\r\n parametros+='&p2='+accion; //agreagar o eliminar atributos\r\n parametros+='&p3='+codigo;\r\n parametros+='&p4='+puesto;\r\n parametros+='&p5='+documento;\r\n\r\n posFuncion='';\r\n CargarVentanaPopPap(vformname,vtitle,vwidth,vheight,vcenter,vresizable,vmodal,vstyle,vopacity,vposx1,vposx2,vposy1,vposy2,parametros,posFuncion)\r\n\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "b4a4d8108af70c76c41a8240f35134e9", "score": "0.46461654", "text": "function Oggetto(_id, _violenzadonne, _violenzafisica, _violenzasessuale, _stupro, _tentatostupro, _italiane, _straniere, _totale) {\n\n // DATI E COSTRUTTORE\n this.id = Number(_id); // < Number() converte in numero intero la stringa\n this.violenzadonne = _violenzadonne;\n this.violenzafisica = Number(_violenzafisica);\n this.violenzasessuale = Number(_violenzasessuale);\n this.stupro = Number(_stupro);\n this.tentatostupro = Number(_tentatostupro);\n this.italiane = Number(_italiane);\n this.straniere = Number(_straniere);\n this.totale = Number(_totale);\n\n // FUNZIONALITA\n\n\n\n\n this.mostra = function() {\n // disegna, cerchio o quadrato dipende dalla forma, colore dai dati passati\n\n fill(this.violenzadonne, this.violenzafisica, this.violenzasessuale, this.stupro, this.tentatostupro);\n push();\n // translate(grid - 400 + this.id * grid, height / 400)\n\n //violenzadonne\n translate(grid - 300 + (this.id * grid), height / 80);\n ellipse(100, 200, this.violenzafisica * 5, this.violenzafisica * 5);\n ellipse(100, 350, this.violenzasessuale* 5, this.violenzasessuale* 5);\n ellipse(100, 500, this.stupro* 5, this.stupro* 5);\n ellipse(100, 650, this.tentatostupro* 5, this.tentatostupro* 5);\n\n console.log(this.violenzasessuale);\n //\n\n\n\n //tentatostupro\n //\n\n\n\n\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n //translate(grid + (this.id * grid), height / 4);\n textSize(15);\n textStyle(BOLD);\n // text(this.stupro, 0, 0);\n pop();\n\n\n /*RIAPRI\n //fill(50,10,40);\n fill(194, 68, 96);\n rect(15, this.violenzafisica / 2, 10, this.violenzafisica); //grid * 1.2 ultimi due parametri\n\n //fill(50,80,120);\n fill(21, 43, 96);\n rect(-15, this.violenzasessuale / 2, 10, this.violenzasessuale);\n\n\n //// TESTO ISTOGRAMMA\n fill(255);\n textAlign(LEFT, CENTER);\n text(this.italiane + \" \" + \"Italiane\", 40, 30);\n fill(194, 68, 96);\n text(this.straniere + \" \" + \"Straniere\", 40, 50);\n fill(21, 43, 96);\n text(this.totale + \" \" + \"Totale\", 40, 10);\n rotate(PI / 2);\n\n\n grid * 1.2\n\n\n\n ///ANNNO\n pop();\n noStroke();\n fill(255);\n textAlign(LEFT, CENTER);\n push();\n translate(grid - 50 + (this.id * grid), height / 4);\n rotate(PI / 2);\n textSize(15);\n textStyle(BOLD);\n text(this.violenzadonne, 0, 0);\n pop();\n */\n //text(this.anno,grid + (this.id * grid),height/3);\n } // display()\n\n} // Oggetto()", "title": "" }, { "docid": "346676e8e5b84cf272e3edbb02a3ae55", "score": "0.46412927", "text": "function abilitazioneCampiValuta() {\n // Prendo il contenitore\n var $this = $(this);\n var container = $this.closest(\"#fieldsetModaleGiustificativo, tr\");\n var cambiDaAbilitareDisabilitare = container.find(\"input[data-euro]\");\n // Doppio uguale in quanto possono insorgere problemi di cast (jQuery.fn.val ritorna una stringa)\n var isEuro = $this.val() == euroUid;\n cambiDaAbilitareDisabilitare[isEuro ? \"attr\" : \"removeAttr\"](\"disabled\", true);\n }", "title": "" }, { "docid": "25122f0317d7b3fc02f2b34d7b5bf52e", "score": "0.4636468", "text": "function getMeteo() {\n //dico intanto che la tabella sta caricando\n //poi ciclo sulle righe e per ognuna faccio una chiamata al server\n onTableLoadingChange(true);\n for (let i = 0; i < loadedTable.length; i++) {\n let myNewObj = {};\n const data = loadedTable[i].data;\n const splittedData = data.split('-');\n let provincia = loadedTable[i].denominazione_provincia;\n let year = splittedData[0];\n let month = splittedData[1];\n let day = splittedData[2].split('T')[0];\n const url = `http://localhost:3001/meteo/single-line/${provincia}/${year}/${month}/${day}`;\n // riempio intanto l'oggetto con i dati delle colonne già presenti selezionate\n for (const col of selectedCol) {\n myNewObj[col] = loadedTable[i][col];\n }\n axios.get(url)\n .then(\n (res) => {\n\n myNewObj = { ...myNewObj, ...res.data };\n dispatchUpdate(i, myNewObj);\n myNewData.push(myNewObj);\n if (i === (loadedTable.length - 1)) {\n // se ho recuperato l'ultima riga carico i dati nello stato\n //per estrarre le keys devo accertarmi che la riga sia completa\n for (let x = 0; x < myNewData.length; x++) {\n if ((Object.keys(myNewData[x]).length) > selectedCol.length) {\n //estraggo le keys\n dispatchKeys(Object.keys(myNewData[x]).map((key) => {\n return {\n Header: <p>{key}</p>,\n accessor: parseInt(key, 10) || key,\n key: key,\n show: true,\n id: key,\n added: selectedCol.includes(key) ? false : true,\n }\n }));\n dispatchExtended(true);\n onTableLoadingChange(false);\n break;\n }\n }\n\n\n\n }\n }\n )\n .catch((err) => {\n console.log(err);\n })\n }\n }", "title": "" }, { "docid": "30780d670b94e1a9f9fdc31587ab4309", "score": "0.46284798", "text": "isOperation(){\n\t\treturn this.is_operation;\n\t}", "title": "" }, { "docid": "bc6e56c915fed611c89b3d840c73df18", "score": "0.46239564", "text": "saveEditData() {\n let dto = this.formInstance.readFormValues();\n if (Validate.form(dto)) {\n if (this.formInstance.isEdit) {\n console.log(\"%cDTO Edit: \", \"color:blue\", dto)\n // restXHR.post(\"modificar\", dto).then(\n restFetch.post(\"modificar\", dto).then(\n () => {\n this.formInstance.formClose();\n this.readAndRender()\n }\n )\n\n } else {\n console.log(\"%cDTO New: \", \"color:blue\", dto)\n restXHR.post(\"alta\", dto).then(\n // restFetch.post(\"alta\", dto).then(\n () => {\n this.formInstance.formClose();\n this.readAndRender()\n }\n )\n }\n }\n }", "title": "" }, { "docid": "c65bed252221a68d82b5d39a7add547d", "score": "0.4614635", "text": "adiciona(atendimento, res) { //cria um método chamado adiciona pra adicionar um novo atendimento na tabela Atendimentos do mysql\n const dataCriacao = moment().format('YYYY-MM-DD HH:MM:SS') //puxa a data do sistema como a data da criação\n const data = moment(atendimento.data, 'DD/MM/YYYY').format('YYYY-MM-DD HH:MM:SS') //definie o parametro data com o formato de datetime\n\n const dataEhValida = moment(data).isSameOrAfter(dataCriacao) //checa se a data é valida verificando se data marcada é igual ou superior a data de criação do atendimento\n const clienteEhValido = atendimento.cliente.length >=5 //checa se o nome do cliente tem o mínimo de 5 caracteres para ser considerado valido\n\n const validacoes = [ //faz as validações das checagens em cima\n {\n nome: 'data',\n valido: dataEhValida,\n mensagem: 'Data deve ser maior ou igual a data atual'\n },\n {\n nome: 'cliente',\n valido: clienteEhValido,\n mensagem: 'Cliente deve ter pelo menos cinco caracteres'\n }\n ]\n\n const erros = validacoes.filter(campo => !campo.valido) //conta o número de erros de acordo com o boolean do campo valido passado pra not (se for true que tem erro mostra como false e adiciona no contador que é o length)\n const existemErros = erros.length // checa se existem erros no atendimento verificando o contador erros\n if(existemErros) { //se exisitirem erros\n res.status(400).json(erros) //mostra pra o client o código http 400 de erro e mostra o erro pra ele\n } else { // caso não exista erros\n const atendimentoDatado = {...atendimento, dataCriacao,data} //puxa os campos de atendimento mais os campos datacriacao e data\n\n const sql = 'INSERT INTO Atendimentos SET ?' //comando sql para inserir uma nova \"tabela\" dentro de Atenidmentos\n\n conexao.query(sql, atendimentoDatado, (erro, resultados) => { //faz a conexão usando o comando sql, os campos de atendimentoDatado e pede err e resultados\n if(erro) {\n res.status(400).json(erro) //se existir erro mostra o erro para o client junto do código 400\n } else {\n res.status(201).json(atendimento) //se obter sucesso retorna o atenidmento preenchido pelo client para o mesmo\n }\n })\n }\n }", "title": "" }, { "docid": "4064d5630e8def28b304128613649127", "score": "0.46135315", "text": "get operations() {\n const { __lView, __raw_opCodes } = this;\n const results = [];\n for (let i = 0; i < __raw_opCodes.length; i++) {\n const opCode = __raw_opCodes[i];\n let result;\n if (typeof opCode === 'string') {\n result = {\n __raw_opCode: opCode,\n type: 'Create Text Node',\n nodeIndex: __raw_opCodes[++i],\n text: opCode,\n };\n }\n if (typeof opCode === 'number') {\n switch (opCode & 7 /* MASK_OPCODE */) {\n case 1 /* AppendChild */:\n const destinationNodeIndex = opCode >>> 17 /* SHIFT_PARENT */;\n result = new I18NDebugItem(opCode, __lView, destinationNodeIndex, 'AppendChild');\n break;\n case 0 /* Select */:\n const nodeIndex = opCode >>> 3 /* SHIFT_REF */;\n result = new I18NDebugItem(opCode, __lView, nodeIndex, 'Select');\n break;\n case 5 /* ElementEnd */:\n let elementIndex = opCode >>> 3 /* SHIFT_REF */;\n result = new I18NDebugItem(opCode, __lView, elementIndex, 'ElementEnd');\n break;\n case 4 /* Attr */:\n elementIndex = opCode >>> 3 /* SHIFT_REF */;\n result = new I18NDebugItem(opCode, __lView, elementIndex, 'Attr');\n result['attrName'] = __raw_opCodes[++i];\n result['attrValue'] = __raw_opCodes[++i];\n break;\n }\n }\n if (!result) {\n switch (opCode) {\n case COMMENT_MARKER:\n result = {\n __raw_opCode: opCode,\n type: 'COMMENT_MARKER',\n commentValue: __raw_opCodes[++i],\n nodeIndex: __raw_opCodes[++i],\n };\n break;\n case ELEMENT_MARKER:\n result = {\n __raw_opCode: opCode,\n type: 'ELEMENT_MARKER',\n };\n break;\n }\n }\n if (!result) {\n result = {\n __raw_opCode: opCode,\n type: 'Unknown Op Code',\n code: opCode,\n };\n }\n results.push(result);\n }\n return results;\n }", "title": "" }, { "docid": "87c7ae1e968d0081266fe275ff479bfc", "score": "0.46102598", "text": "function GeneralOperations() {\n //Remove Null Values from data\n\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.WarehouseCode == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.WarehouseCode = \"\";\n }\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.WarehouseName == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.WarehouseName = \"\";\n }\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SER_ServiceLevel == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SER_ServiceLevel = \"\";\n }\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SER_ServiceLevelDescription == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SER_ServiceLevelDescription = \"\";\n }\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SupplierCode == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SupplierCode = \"\";\n }\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SupplierName == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.SupplierName = \"\";\n }\n\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.ClientCode == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.ClientCode = \"\";\n }\n if (InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.ClientName == null) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.ClientName = \"\";\n }\n\n if (!InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.PackagesSent)\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.PackagesSent = 0;\n\n if (!InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.TotalUnits)\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.TotalUnits = 0;\n\n if (!InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.PackagesSent)\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.TotalPallets = 0;\n\n if (InwardLinesCtrl.currentInward.isNew) {\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsInwardHeader.ExternalReference = null;\n }\n\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsWorkOrderContainer = $filter('orderBy')(InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsWorkOrderContainer, 'CreatedDateTime');\n InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsWorkOrderReference = $filter('orderBy')(InwardLinesCtrl.ePage.Entities.Header.Data.UIWmsWorkOrderReference, 'CreatedDateTime');\n InwardLinesCtrl.ePage.Entities.Header.Data.UIJobServices = $filter('orderBy')(InwardLinesCtrl.ePage.Entities.Header.Data.UIJobServices, 'CreatedDateTime');\n }", "title": "" }, { "docid": "11ba839c426737dc19ad9074a0b3f907", "score": "0.46070713", "text": "function popolaDaMissioneEsterna(data) {\n if(impostaDatiNegliAlert(data.errori, alertErrori)) {\n return;\n }\n var richiesta = qualify(data.richiestaEconomale, 'richiestaEconomale');\n\n $('input, textarea', '#formRichiestaEconomale').each(elaboraMissioneEsternaPerInput.bind(null, richiesta));\n $('button, select', '#formRichiestaEconomale').each(elaboraMissioneEsternaPerNonInput.bind(null, richiesta));\n\n // Elimino le compilazioni guidate\n $('#pulsanteCompilazioneGuidataMatricola, #pulsanteInserimentoDati').remove();\n $('#matricolaSoggettoRichiestaEconomale').change();\n // Carico via AJAX i giustificativi e aspetto la risposta\n return caricaListaGiustificativi();\n }", "title": "" }, { "docid": "599596bc7663341b82a30ea73fd184e5", "score": "0.45958441", "text": "async Oo() {\n this.bo = await this.persistence.runTransaction(\"Synchronize last document change read time\", \"readonly\", t => this.ko.qh(t));\n }", "title": "" }, { "docid": "39d0e8e726bb9608e989e3cf8a8633dd", "score": "0.4571482", "text": "find() {\n errors.assertArgCount(arguments, 0, 0);\n const op = new SodaOperation();\n op._impl = this._impl.find();\n return op;\n }", "title": "" }, { "docid": "f1b73913786f6a091771ac6fb989225a", "score": "0.45698857", "text": "function editarDatos(parId, parV_T_Territorio, parV_Territorio, parV_Fch_Ini, parV_Fch_Fin, parV_Cuando, parV_Quien) {\n document.getElementById(\"V_T_Territorio\").value = parV_T_Territorio;\n document.getElementById(\"V_Territorio\").value = parV_Territorio;\n document.getElementById(\"V_Fch_Ini\").value = parV_Fch_Ini;\n document.getElementById(\"V_Fch_Fin\").value = parV_Fch_Fin;\n document.getElementById(\"V_Cuando\").value = parV_Cuando;\n document.getElementById(\"V_Quien\").value = parV_Quien;\n\n $(\"#guardar\").css(\"display\", \"none\");\n $(\".linea\").attr(\"disabled\", true);\n $(\"#act\").append(\"<button class='btn data-toggle='tooltip' data-placement='top' title='Actualizar datos' btn-info my-3' id='actualizar'><i class='fas fa-save'></i></button>\");\n $(\"#actualizar\").on(\"click\", function () {\n var userRef = db.collection(\"usuarios\").doc(parId);\n V_T_Territorio: document.getElementById(\"V_T_Territorio\").value;\n V_Territorio: document.getElementById(\"V_Territorio\").value;\n V_Fch_Ini: document.getElementById(\"V_Fch_Ini\").value;\n V_Fch_Fin: document.getElementById(\"V_Fch_Fin\").value;\n V_Cuando: document.getElementById(\"V_Cuando\").value;\n V_Quien: document.getElementById(\"V_Quien\").value;\n if ((V_T_Territorio.value).trim() === \"\" || (V_Territorio.value).trim() === \"\" || (V_Fch_Ini.value).trim() === \"\" || (V_Fch_Fin.value).trim() === \"\" || (V_Cuando.value).trim() === \"\" || (V_Quien.value).trim() === \"\") {\n alert(\"Todos los datos son obligatorios.\");\n } else {\n return userRef.update({\n V_T_Territorio: document.getElementById(\"V_T_Territorio\").value,\n V_Territorio: document.getElementById(\"V_Territorio\").value,\n V_Fch_Ini: document.getElementById(\"V_Fch_Ini\").value,\n V_Fch_Fin: document.getElementById(\"V_Fch_Fin\").value,\n V_Cuando: document.getElementById(\"V_Cuando\").value,\n V_Quien: document.getElementById(\"V_Quien\").value\n })\n .then(function () {\n console.log(\"Usuario actualizado correctamente.\");\n document.getElementById(\"V_T_Territorio\").value = \"\";\n document.getElementById(\"V_Territorio\").value = \"\";\n document.getElementById(\"V_Fch_Ini\").value = \"\";\n document.getElementById(\"V_Fch_Fin\").value = \"\";\n document.getElementById(\"V_Cuando\").value = \"\";\n document.getElementById(\"V_Quien\").value = \"\";\n $(\"#ok_T_Territorio\").hide();\n $(\"#ok_Territorio\").hide();\n $(\"#ok_Fch_Ini\").hide();\n $(\"#ok_Fch_Fin\").hide();\n $(\"#ok_Cuando\").hide();\n $(\"#ok_Quien\").hide();\n $(\"#guardar\").css(\"display\", \"inline\");\n $(\".linea\").attr(\"disabled\", false);\n $(\"#act\").empty();\n })\n .catch(function (error) {\n // The document probably doesn't exist.\n console.error(\"Error actualizando Itinerario: \", error);\n });\n }\n })\n}", "title": "" }, { "docid": "b8b1747fa8be909ddde901e7d76d8685", "score": "0.45638043", "text": "constructor(carrito,cursos){\n //aca se va a ir sumando el subtotal de la compra\n var subtotal = 0\n //array con x cantidad de objetos\n this.carrito = carrito\n //JSON con todos los cursos y detalles\n this.cursos = cursos\n\n //DIBUJA Y AGREGA EN EL HTML TODOS LOS ELEMENTOS AGREGADOS AL CARRITO POR EL USUARIO\n this.verCompra = function (grillaCheckout) {\n subtotal = 0\n let grilla = \"\"\n for(let i in this.carrito){\n for (let j in this.cursos){\n if (this.cursos[j].id == carrito[i]) {\n grilla += `\n <tr>\n <td>${cursos[j].nombre}</td>\n <td>${cursos[j].precio}</td>\n <td>\n <button type=\"button\" class=\"btn btn-outline-danger\" onclick=\"borrarItem(${j})\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" fill=\"currentColor\" class=\"bi bi-trash-fill\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5a.5.5 0 0 0-1 0v7a.5.5 0 0 0 1 0v-7z\"/>\n </svg>\n \n </button>\n </td>\n </tr> \n `\n subtotal += cursos[j].precio\n \n }\n\n }\n }\n grillaCheckout.html(grilla)\n }\n //DIBUJA EL TOTAL (SIN DESCUENTOS)\n this.verSubtotal = function(grillaSubtotal){\n let grilla = `\n <tr>\n <td>SUBTOTAL</td>\n <td class=\"text-right\"><strong>$${this.subtotal()}</strong></td>\n </tr> \n ` \n grillaSubtotal.html(grilla)\n }\n\n //FUNCION QUE CALCULA EL TOTAL (SIN DESCUENTOS)\n this.subtotal = function (){\n return subtotal\n }\n\n \n // MUESTRA LA ULTIMA PARTE DEL PROCESO DE PAGO\n this.verTotal = function(grillaFinal){\n let grilla = ` \n <h3>Cómo querés pagar?</h3>\n <form name=\"cuotas\">\n <input type=\"radio\" id=\"1cuota\" name=\"modoDePago\" value=\"1cuota\" onclick=\"validarCuota()\" checked >\n <label for=\"1cuota\">1 pago</label><br>\n <input type=\"radio\" id=\"3cuotas\" name=\"modoDePago\" value=\"3cuotas\" onclick=\"validarCuota()\">\n <label for=\"3cuotas\">3 cuotas (10% interés)</label><br>\n <input type=\"radio\" id=\"6cuotas\" name=\"modoDePago\" value=\"4cuotas\" onclick=\"validarCuota()\">\n <label for=\"6cuotas\">6 cuotas (25% interés)</label><br>\n <input type=\"radio\" id=\"12cuotas\" name=\"modoDePago\" value=\"12cuotas\" onclick=\"validarCuota()\">\n <label for=\"12cuotas\">12 cuotas sin interés</label>\n </form>\n \n <h3 id=\"totalTitulo\">TOTAL A PAGAR: <span id=\"totalFinal\"> $${this.subtotal()} </span> </h3>\n <h4>a pagar en: <span id=\"cuotasFinal\"> </span></h4>\n <div class=\"container text-center\">\n <button type=\"button\" id=\"atrasCompraFinalBtn\" class=\"btn btn-info\" onclick=\"deshacerOcultar()\">Atrás</button>\n <button type=\"button\" id=\"finalizarCompraBtn\" class=\"btn btn-success\" onclick=\"pagar()\">Pagar</button>\n <button type=\"button\" id=\"cancelarCompraTotalBtn\" class=\"btn btn-danger\" onclick=\"cancelarCompra()\">Cancelar</button>\n </div>\n `\n grillaFinal.html(grilla)\n }\n }", "title": "" }, { "docid": "2eabddecd1676d132c4c862d91e2c1cd", "score": "0.45628703", "text": "selectOperation(button){\n if(this.previous === \"\" && this.current === \"\" || this.current === \".\"){\n return;\n }else if(this.previous !== \"\" && this.current === \"\"){\n this.operation = `${button}`;\n return;\n }else if(this.previous !== \"\" && this.current !== \"\"){\n this.solveProblem();\n }\n this.operation = `${button}`;\n this.previous = `${this.current}`;\n this.current = \"\";\n }", "title": "" }, { "docid": "4dca741cb7e9b818fe2167f3cf83c58d", "score": "0.45598206", "text": "function recolectarDatosGUI(method){\n nuevoEvento = {\n id:$('#txtId').val(),\n title:$('#txtHora2').val(),\n hora: $('#txtHora2').val(),\n usuario: $('#txtUsuario').val(),\n visi1: $('#visi1').val(),\n pare1: $('#parent1').val(),\n visi2: $('#visi2').val(),\n pare2: $('#parent2').val(),\n visi3: $('#visi3').val(),\n pare3: $('#parent3').val(),\n visi4: $('#visi4').val(),\n pare4: $('#parent4').val(),\n visi5: $('#visi5').val(),\n pare5: $('#parent5').val(),\n visi6: $('#visi6').val(),\n pare6: $('#parent6').val(),\n visi7: $('#visi7').val(),\n pare7: $('#parent7').val(),\n //descripcion:$('#txtDescripcion').val(),\n color: '#0000FF',\n textColor:'#FFFFFF',\n start:$('#txtFecha').val()+\" \"+$('#txtHora').val(),\n end:$('#txtFecha').val()+\" \"+$('#txtHora').val(),\n '_token': $(\"meta[name='csrf-token']\").attr(\"content\"),\n '_method': method\n }\n console.log(nuevoEvento);\n return (nuevoEvento);\n }", "title": "" }, { "docid": "6fe6d07fd4c659f686d2b08296a86032", "score": "0.45569065", "text": "function cargarCgg_operacion_validacionCtrls(){\n if(inRecordCgg_operacion_validacion){\n txtCopvl_codigo.setValue(inRecordCgg_operacion_validacion.get('COPVL_CODIGO'));\n txtCopvl_descripcion.setValue(inRecordCgg_operacion_validacion.get('COPVL_DESCRIPCION'));\n cbxCopvl_formulario.setValue(inRecordCgg_operacion_validacion.get('COPVL_FORMULARIO'));\n isEdit = true;\n habilitarCgg_operacion_validacionCtrls(true);\n gsCgg_res_tipo_solicitud_regla.reload({\n params:{\n inCopvl_codigo:inRecordCgg_operacion_validacion.get('COPVL_CODIGO'),\n format:TypeFormat.JSON\n }\n })\n }}", "title": "" }, { "docid": "25214341e164e6db09829ab01343722d", "score": "0.45374298", "text": "function grabar(didCliente,dDescripcion,dFecha,dhora,dRealizacion,didTecnico) {\n\n var orden = dataBase.result;\n // Crea un objeto para ejecutar ordenes contra la base de datos \n var transacion = orden.transaction([\"Avisos\"], \"readwrite\");\n // Crea una transación sobre una tabla de la base de datos para lectura y escritura\n var tabla = transacion.objectStore(\"Avisos\");\n var request = tabla.add({\n idCliente: didCliente,\n Descripcion: dDescripcion,\n Fecha:dFecha,\n Hora: dhora,\n Realizado: dRealizacion,\n idTecnico: didTecnico\n });\n\n }", "title": "" }, { "docid": "e00c29d71e8eb9fedd25c3e0e04f4c97", "score": "0.45156753", "text": "function grabarDocumento() {\n\n if (!view.validarEdicion()) return;\n\n var oDoc = view.getModalEdicionValues();\n\n oDoc.ta210_iddocupreventa = _oDocEditando.ta210_iddocupreventa;\n if (oDoc.t2_iddocumento == null) {\n oDoc.t2_iddocumento = _oDocEditando.t2_iddocumento;\n oDoc.ta210_nombrefichero = _oDocEditando.ta210_nombrefichero;\n oDoc.ta210_kbytes = _oDocEditando.ta210_kbytes;\n oDoc.t001_idficepi_autor = _oDocEditando.t001_idficepi_autor\n }\n else {\n oDoc.fileupdated = true;\n }\n oDoc.origenEdicion = _origenEdicion;\n\n if (_modoEdicion == \"A\") {\n if (_esGUID) {\n oDoc.ta210_guidprovisional = _idorigenEdicion;\n }\n else {\n if (_modoEdicionContainer == \"accionpreventa\") oDoc.ta204_idaccionpreventa = _idorigenEdicion;\n if (_modoEdicionContainer == \"tareapreventa\") oDoc.ta207_idtareapreventa = _idorigenEdicion;\n }\n }\n else {\n oDoc.ta204_idaccionpreventa = _oDocEditando.ta204_idaccionpreventa;\n oDoc.ta207_idtareapreventa = _oDocEditando.ta207_idtareapreventa;\n oDoc.ta210_guidprovisional = _oDocEditando.ta210_guidprovisional;\n }\n\n IB.procesando.mostrar();\n\n var payload = { oDoc: oDoc };\n methodName = _modoEdicion == \"A\" ? \"Insert\" : \"Update\";\n\n IB.DAL.post(_urlWebServiceDocs, methodName, payload, null, function (data) {\n if (_modoEdicion == \"A\") {\n $.extend(oDoc, data);\n oDoc.ta210_iddocupreventa = data.ta210_iddocupreventa;\n oDoc.editable = true;\n }\n $.when(IB.procesando.ocultar()).then(function () {\n\n if (_modoEdicion == \"A\") { //Agregar el nuevo doc a la lista js\n if (_modoEdicionContainer == \"accionpreventa\") {\n _lstDocsAccion.add(oDoc);\n }\n else if (_modoEdicionContainer == \"tareapreventa\") {\n _lstDocsTarea.add(oDoc);\n }\n }\n else { //Actualizar doc en la lista js\n $.extend(_oDocVisualizando, data);\n }\n\n view.closeModalEdicion();\n\n if (_modoEdicion == \"A\") {\n view.addFichaDocumento(oDoc, _modoEdicionContainer)\n }\n else {\n view.updateFichaDocumento(_oDocVisualizando);\n }\n\n view.selectDocCatalogo(oDoc.ta210_iddocupreventa);\n\n });\n });\n }", "title": "" }, { "docid": "1dbbb04e340e747609b6b08e11e9760c", "score": "0.44951534", "text": "revisarTrayecto(origen, destino){\r\n let c_origen = origen || document.getElementById('ciudadR').dataset;\r\n let c_destino = destino || document.getElementById('ciudadD').dataset;\r\n\r\n if(c_destino.tipo_trayecto == \"undefined\" && this.codTransp == \"SERVIENTREGA\") return \"NA\";\r\n\r\n if(c_destino.tipo_trayecto == \"TRAYECTO ESPECIAL\"){\r\n return \"Especial\";\r\n } else {\r\n if(c_destino.id == c_origen.id) {\r\n return \"Urbano\";\r\n } else if(c_destino.departamento == c_origen.departamento) {\r\n return \"Zonal\";\r\n } else {\r\n return \"Nacional\";\r\n }\r\n }\r\n }", "title": "" }, { "docid": "f8984c7a4567ff3c9f46178325b6e348", "score": "0.4493947", "text": "toString() {\n return this.operation.toString();\n }", "title": "" }, { "docid": "f8984c7a4567ff3c9f46178325b6e348", "score": "0.4493947", "text": "toString() {\n return this.operation.toString();\n }", "title": "" }, { "docid": "06091e58d6108f1125a205170c00618a", "score": "0.44875923", "text": "function Pabellon(nuevoNombre,nueva_fila,nueva_col,nuevoId){\n var objPabellon={\n nombre:nuevoNombre,\n capacidad:nueva_fila*nueva_col,\n nro_filas:nueva_fila,\n nro_col:nueva_col,\n id:nuevoId,\n nichos:[\n {\n id:\"n1\",\n nro:1,\n precio:1000,\n estado:\"ocupado\",\n },\n {\n id:\"n2\",\n nro:2,\n precio:2000,\n estado:\"libre\",\n },\n \n ],\n verPabellon: function(){\n console.log(this); \n },\n venderNicho: function(idBuscar){\n for(var i=0;i<this.nichos.length;i++){\n if(this.nichos[i].id==idBuscar){\n if(this.nichos[i].estado==\"libre\"){\n this.nichos[i].estado=\"ocupado\";\n console.log(\"Nicho Vendido\");\n break;\n }else{\n console.log(\"Nicho esta OCUPADO\");\n }\n }\n }\n },\n consultarNichosLibres:function(){\n var contLibres=0;\n for(var i=0;i<this.nichos.length;i++){\n if(this.nichos[i].estado==\"libre\"){\n contLibres++;\n }\n }\n console.log(`Nichos Libres:${contLibres}`);\n },\n liberarPabellon:function(){\n this.nichos=[];\n },\n repoblarPabellon:function(){\n this.liberarPabellon();\n \n\n for(i=0;i<this.capacidad;i++){\n //SE CREA OBJETO NICHOS \n //var objNichos={\n // id:i+1,\n // nro:i+1,\n // precio:0,\n // estado:\"libre\"\n // }\n\n /// O O O O\n // this.nichos.push(objNichos);\n // this.nichos[i].precio=0;\n // this.nichos[i].id=nroId;\n // this.nichos[i].=nro;\n // this.nichos[i]=\"libre\";\n\n // Ò\n \n this.nichos.push({\n id:i+1,\n nro:i+1,\n precio:0,\n estado:\"libre\"\n })\n }\n }\n };\n return objPabellon; \n}", "title": "" }, { "docid": "64b582e1b9bd0679cd54563c84c7be97", "score": "0.4485778", "text": "function estudiarEtiqueta($this,id){\n let mod_nombre = $this.parentNode.parentNode.querySelector(\".modif-name\").innerText;\n let mod_ubicacion = $this.parentNode.parentNode.querySelector(\".modif-ubicacion\").innerText;\n console.log(mod_nombre,mod_ubicacion);\n\n /*\n // 1. solucion alternativa para obtener los datos a actualizar \n // 2. recibo el id del regsitro, luego hago ubico el regiatro con el apoyo del id, para acceder a los datos a modificar\n\n let idElement = \"#regis-\"+id;\n let tr = document.querySelector(idElement);\n\n let dta_name = tr.querySelector(\".modif-name\").innerText;\n let dta_adress = tr.querySelector(\".modif-ubicacion\").innerText;\n\n console.log(dta_name,dta_adress);\n */\n\n}", "title": "" }, { "docid": "2f2796c0e9c5cc686106d52308d8e9c6", "score": "0.4483981", "text": "toString() {\n return this.operation.toString();\n }", "title": "" }, { "docid": "2cf71321edd5ba49d0d516872d7d711a", "score": "0.44825855", "text": "function RateioCContabil() {\n \n obj = this; \n\n // Public methods \n this.consultar = consultar;\n this.merge = merge;\n \n this.incluir = incluir; \n this.confirmar = confirmar; \n this.alterar = alterar; \n this.cancelar = cancelar; \n this.excluir = excluir; \n \n this.tipoChange = tipoChange; \n this.regraChange = regraChange; \n this.origemChange = origemChange;\n this.grupoChange = grupoChange;\n \n this.Modal = Modal; \n \n \n this.INCLUINDO = false;\n this.ALTERANDO = false;\n this.DADOS = [];\n this.DADOS_RENDER = [];\n\n this.RATEAMENTO_GRUPOS = [];\n \n this.TOTAL_GERAL = 0;\n this.SELECTEDS = [];\n this.SELECTED = [];\n this.SELECTED_BACKUP = [];\n \n\t }", "title": "" }, { "docid": "a67e427e0deeb83caa02556953ae5986", "score": "0.44815335", "text": "function btn_open_editar_trat(trat_id,sol,dol){//esitar el tratamiento uno por uno \n editar_trat_global=trat_id;\n// pac_id = $.trim($(\"#div_editar_trat_pac_id\").getCell(trat_id,\"trat_esp_des\"));\n descripcion = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_esp_des\"));\n cant = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_cant\"));\n sol = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_esp_cos_sol\"));\n dol = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_esp_cos_dol\"));\n fch = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_fch\"));\n seguro = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_seg_id\"));\n doc_id = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_doc_id\"));\n doctor = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"doctor\"));\n \n esp_tip = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_esp_tip\"));\n esp_cod = $.trim($(\"#grid_ver_trat_pac\").getCell(trat_id,\"trat_esp_cod\"));\n $(\"#div_editar_trat\").dialog({\n autoOpen: false, modal: true, height: 320, width: 600, show: {effect: \"fade\", duration: 500} \n }).dialog('open');\n \n var a = sol.replace(',','');\n pre_uni_sol=(parseFloat(a)/parseFloat(cant)); \n $(\"#div_editar_trat_pre_uni_sol\").val(pre_uni_sol.toFixed(2));\n \n var b = dol.replace(',','');\n pre_uni_dol=(parseFloat(b)/parseFloat(cant));\n $(\"#div_editar_trat_pre_uni_dol\").val(pre_uni_dol.toFixed(2));\n \n $(\"#div_editar_trat_codigo\").val(trat_id);\n $(\"#div_editar_trat_trat_num\").val($(\"#div_ver_trat_select\").val());\n $(\"#div_editar_trat_pac_id\").val($(\"#hiddendiv_ver_trat_pac\").val());\n $(\"#div_editar_trat_des\").val(descripcion);\n $(\"#div_editar_trat_cant\").val(cant);\n $(\"#div_editar_trat_sol\").val(sol);\n $(\"#div_editar_trat_dol\").val(dol);\n $(\"#div_editar_trat_fch\").val(fch);\n $(\"#div_editar_trat_seguro\").val(seguro);\n $(\"#div_editar_trat_doctor\").val(doctor);\n $(\"#div_editar_trat_doc_id\").val(doc_id);\n \n $(\"#hiddendiv_editar_trat_tip\").val(esp_tip);\n $(\"#hiddendiv_editar_trat_des\").val(esp_cod);\n \n llenararajaxtodo_editar_trat('div_editar_trat_des','pacientes/pacientes/listartodo_trat',seguro,0);\n llenararajaxtodo_doctor('div_editar_trat_doctor','pacientes/pacientes/listartodo_doc',0);\n $(\"#div_editar_trat_fch\").mask(\"99/99/9999\"); \n $(\"#div_editar_trat_seguro\").css({ border: \"1px solid #00C000\"});\n}", "title": "" }, { "docid": "4ebb7bacb00a1be336c0e932ac6b1f2e", "score": "0.4481127", "text": "function ObjetoListaModel(id, NomeAoe, TrechoAoe, LocalRodovai_km, UfOae, AltitudeOae, LatitudeOae, LongitudeOae, LarguraOae, TipoEstrutura, NaturezaTrasposicao, SistemaConstrutivo) {\n\n var obraAux = new Obra();\n \n obraAux.setid(id);\n obraAux.setNomeAoe(NomeAoe);\n obraAux.setTrechoAoe(TrechoAoe);\n obraAux.setUfOae(UfOae);\n obraAux.setAltitudeOae(AltitudeOae);\n obraAux.setLatitudeOae(LatitudeOae);\n obraAux.setLongitudeOae(LongitudeOae);\n obraAux.setLocalRodovai_km(LocalRodovai_km);\n obraAux.setLarguraOae(LarguraOae);\n obraAux.SetNaturezaTrasposicao(NaturezaTrasposicao);\n obraAux.setTipoEstrutura(TipoEstrutura);\n obraAux.setSistemaConstrutivo(SistemaConstrutivo);\n //console.log(obraAux);\n\n return obraAux;\n}", "title": "" }, { "docid": "d1f8178ab9196e730345011cf94d359b", "score": "0.44784933", "text": "odigraj(igraId, indexIgraca, indexKarte, karta, idIgraca) {\n return __awaiter(this, void 0, void 0, function* () {\n const igra = yield db_model_1.igraModel.findById(igraId);\n if (igra.igracNaPotezu != indexIgraca || igra.igraci[igra.igracNaPotezu].idIgraca != idIgraca) {\n return -1;\n }\n igra.igraci[igra.igracNaPotezu].izvucenihKarata = 0;\n //on zakljucuje koje pravilo ce biti primenjeno, na osnvu karte na tavli, odigrane karte i boje koja se zahteva\n let pravilo = new pronalazacPravila_1.default(igra.trenutnaKarta, karta, igra.trenutnaBoja);\n //detektovano pravilo koje se primenjuje\n let brojPravila = pravilo.vratiPravilo();\n //pogresan potez\n if (!brojPravila) {\n return 0;\n }\n igra.igraci[igra.igracNaPotezu].mozeDaZavrsi = true;\n igra.trenutnaBoja = karta.boja;\n igra.trenutnaKarta = karta;\n this.ukloniKartu(igra, indexKarte);\n //posto nema vise karata u ruci, kraj igre\n if (igra.igraci[igra.igracNaPotezu].karte.length == 0) {\n yield igra.save();\n return 7;\n }\n //ako je potez validan, a nije se doslo do kraja igre, primenjuje se detektovano pravilo, u izvrsiocu pravila\n let izvrsilacPravila = this.selektorPravila.funkcijskaPravila[brojPravila];\n //izvrsilac javlja serveru sta se desilo, kako bi server mogao da obavesti igrace\n return izvrsilacPravila(igra, this);\n });\n }", "title": "" }, { "docid": "dcec5ea5751797f217c8e3691e30cbc3", "score": "0.44781208", "text": "function onlyGetPreco () { return this.preco }", "title": "" }, { "docid": "4cc2100d9cdef112d1b085e4682ed5a6", "score": "0.4477991", "text": "evolucionar(poblacionInicial){\n // Para no alterar la poblacion inicial. \n var poblacionActual = this.ambiente.clonarPoblacion(poblacionInicial);\n var poblacionActual = poblacionInicial;\n var poblacionPerfecta = 0;\n var iteracion = 0;\n while(iteracion < this.cantidadGeneraciones && !poblacionPerfecta){ \n // Se calcula aptitud de cada individuo y se ordenan del mayor optimo al menor optimo. \n poblacionPerfecta = this.calcularAptitud(poblacionActual);\n if(!poblacionPerfecta){\n // Se genera nueva poblacion a partir de cruces, y a la vez se le aplica mutación. \n poblacionActual = this.seleccionar(poblacionActual);\n }\n iteracion++; \n }\n if(!poblacionPerfecta)\n this.calcularAptitud(poblacionActual);\n return poblacionActual;\n }", "title": "" }, { "docid": "446f5a2b97d9962fb314a24734d8e5b4", "score": "0.4474826", "text": "get operations() {\n const { __lView, __raw_opCodes, icus } = this;\n const results = [];\n for (let i = 0; i < __raw_opCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = __raw_opCodes[i];\n // Number of opCodes to skip until next set of update codes\n const skipCodes = __raw_opCodes[++i];\n let value = '';\n for (let j = i + 1; j <= (i + skipCodes); j++) {\n const opCode = __raw_opCodes[j];\n if (typeof opCode === 'string') {\n value += opCode;\n }\n else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // It's a binding index whose value is negative\n // We cannot know the value of the binding so we only show the index\n value += `�${-opCode - 1}�`;\n }\n else {\n const nodeIndex = opCode >>> 2 /* SHIFT_REF */;\n let tIcuIndex;\n let tIcu;\n switch (opCode & 3 /* MASK_OPCODE */) {\n case 1 /* Attr */:\n const attrName = __raw_opCodes[++j];\n const sanitizeFn = __raw_opCodes[++j];\n results.push({\n __raw_opCode: opCode,\n checkBit,\n type: 'Attr',\n attrValue: value,\n attrName,\n sanitizeFn,\n });\n break;\n case 0 /* Text */:\n results.push({\n __raw_opCode: opCode,\n checkBit,\n type: 'Text',\n nodeIndex,\n text: value,\n });\n break;\n case 2 /* IcuSwitch */:\n tIcuIndex = __raw_opCodes[++j];\n tIcu = icus[tIcuIndex];\n let result = new I18NDebugItem(opCode, __lView, nodeIndex, 'IcuSwitch');\n result['tIcuIndex'] = tIcuIndex;\n result['checkBit'] = checkBit;\n result['mainBinding'] = value;\n result['tIcu'] = tIcu;\n results.push(result);\n break;\n case 3 /* IcuUpdate */:\n tIcuIndex = __raw_opCodes[++j];\n tIcu = icus[tIcuIndex];\n result = new I18NDebugItem(opCode, __lView, nodeIndex, 'IcuUpdate');\n result['tIcuIndex'] = tIcuIndex;\n result['checkBit'] = checkBit;\n result['tIcu'] = tIcu;\n results.push(result);\n break;\n }\n }\n }\n }\n i += skipCodes;\n }\n return results;\n }", "title": "" }, { "docid": "2db0f05212949f9d63538a6b9966cddd", "score": "0.4469947", "text": "get operationKey() {\n return this._response.getOperationKey()\n }", "title": "" }, { "docid": "1c30a59ff2232b1ee45468e2f46fbfaf", "score": "0.44686136", "text": "buscar(dato){\n if(this.primero == null){\n return false\n }else if(this.primero.dato == dato || this.ultimo.dato == dato){\n return true\n }else{\n return this._buscar(dato, this.primero.siguiente)\n }\n }", "title": "" }, { "docid": "5f3769c040ad9d21155d84aa559e34ab", "score": "0.44573647", "text": "chooseOperation(operation) {\n // This ensures that an operation cannot be selected if there is no operand present\n if (this.currentOperand === '') return;\n\n // This ensures that an operation can be performed if and only if there is a pervious operand present\n if (this.previousOperand !== '') {\n this.compute();\n }\n\n // When an operaton is selected, the value of current operand is assigned to the previous operand and current operand becomes empty \n // in order to enter the next operand\n this.operation = operation;\n this.previousOperand = this.currentOperand;\n this.currentOperand = '';\n }", "title": "" }, { "docid": "1015ff3bfd576fcaf1737633a03a6f87", "score": "0.44502908", "text": "getResult() {\n try {\n return eval(this._operation.join(\"\"))\n } catch (error) {\n this.setError();\n return this.displayCalc;\n }\n }", "title": "" }, { "docid": "fdfb09916edf25fa0778fa706393de41", "score": "0.44485265", "text": "circuitoValores () {\n\t\t// Se define la variables que van a almacenar los cambios en la variable segun el circuito\n\t\tvar variableA , variableB , variableBuffer , variableNot , variableNAND , variableOR , variableXNOR , Negacion; \n\t\t// Se almacena la variable a \n\t\tvariableA = this.state.dataA;\n\t\t// Se almacena la variable b\n\t\tvariableB = this.state.dataB;\n\t\t// Se intencifica b en negarla doble vez para que retorne al mismo valor y la alamcenamos en buffer\n\t\tvariableBuffer = !(!variableB)\n\t\t// Negamos la variable b y la guardamos en not \n\t\tvariableNot = !variableB;\n\t\t// realizamos la validaion del nand con una validacion in-line doble yse guarda en nand\n\t\tvariableNAND = (variableA != variableBuffer) ? 1 : (variableA == variableBuffer && variableA == 1 ) ? 0 : 1;\n\t\t// se procesa el valor or\n\t\tvariableOR = variableNot || variableBuffer;\n\t\t// se realiz la operacion xnor que funciona con un igual\n\t\tvariableXNOR = variableNAND == variableOR;\n\t\t// se niega el recultado de la operación xnor y ese es el rusalto final deñ circuito\n\t\tNegacion = !variableXNOR;\n\t\t// se setea el valor de resultado\n\t\tthis.setState({\n\t\t\t\tresultado : Number(Negacion) // Convertimos negacion a numerico por que llega como valor boolean\n\t\t\t});\n\t}", "title": "" }, { "docid": "0097370867f905fb011e42023cd68396", "score": "0.4439131", "text": "function controllaOrdinazioni (id , today ) {\n var pranzo_ordinato = false;\n var cena_ordinata = false;\n for(var i = 0; i < ordine.length; i++){\n if(today == ordine[i].data && id == ordine[i].id){\n if(ordine[i].pasto == \"PRANZO\"){\n pranzo_ordinato = true;\n }else if(ordine[i].pasto == \"CENA\"){\n cena_ordinata = true;\n }\n }\n }\n return (pranzo_ordinato && cena_ordinata);\n}", "title": "" }, { "docid": "c347102d943c5dac4e0f66204a2db6a8", "score": "0.4437876", "text": "function mejorAlternativa() {\n $scope.mejor_credito = []; // mejor tasa de interes\n for (var i = 0; i < $scope.bancos_credito.length; i++) {\n $scope.mejor_credito[i] = $scope.bancos_credito[i].tasaInteres;\n }\n $scope.mejor = Math.min.apply(null, $scope.mejor_credito);\n\n for (var i = 0; i < $scope.bancos_credito.length; i++) {\n if ($scope.bancos_credito.length != 1) {\n if ($scope.bancos_credito[i].tasaInteres == $scope.mejor) {\n $scope.bancos_credito[i].opcion = 1; // Cuando las tasas de interes es igual a la menor\n } else {\n $scope.bancos_credito[i].opcion = 0; // Cuando las tasas de interes es diferente a la menor\n }\n } else {\n $scope.bancos_credito[i].opcion = 2; // Cuando existe un solo banco para simular\n }\n }\n }", "title": "" }, { "docid": "0b402ca791426dc0eb9b40e74f89450a", "score": "0.44358212", "text": "addOperation(value) {\n //Verificando se a ultima operação é ou não um numero\n if (isNaN(this.getLastOperation())) {\n //String\n if (this.isOperator(value)) {\n //Trocar o operador\n this.setLastOperation(value);\n } else {\n this.pushOperation(value);\n }\n } else if (this.isOperator(value)) {\n this.pushOperation(value);\n } else {\n //Number\n let newvalue = this.getLastOperation().toString() + value.toString();\n this.setLastOperation(newvalue);\n }\n console.log(this._operation);\n this.displayCalc = this._operation.join(\"\"); //join - junta o array em formato de string e o formata do jeito que vc quiser\n }", "title": "" }, { "docid": "15bbbca7ed255a5dc3c927f9f99cef1f", "score": "0.4428895", "text": "function mantenerOpcionesEntregasRes(radiosResponsable, radiosStock, radiosLugar, bloqueoEntregaDomicilio,bloqueoSICMER){\n\t//Primero habilito todos los radios de stok\n\tfor(k=0;k<radiosLugar.length;k++){\n\t\tradiosLugar[k].disabled=false;\n\t\tif(radiosLugar[k].value == '34' && bloqueoSICMER=='1'){\n\t\t\tradiosLugar[k].disabled=true;\t\n\t\t}\n\t}\t\n\t//itero los radio de responsable para saber cual esta chequeado\n\tvar i \n\tfor (i=0;i<radiosResponsable.length;i++){ \n\t if (radiosResponsable[i].checked) \n\t\t break; \n\t} \n\tif(radiosResponsable[i] != null){\n\t\t//Si el valor del radio es entidad responsable el local\n\t\tif(radiosResponsable[i].value == 'LOC'){\n\t\t\t//itero los radio de lugar para saber cual esta chequeado\n\t\t\tvar j\n\t\t\tfor(j=0;j<radiosStock.length;j++){\n\t\t\t\tif(radiosStock[j].checked)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(radiosStock[j] != null){\n\t\t\t\t//Si el valor del radio es direccion\n\t\t\t\tif(radiosStock[j].value == '9' || radiosStock[j].value == '11'){\n\t\t\t\t\t//deshabilito y deschequeo el radio de parcial a bodega del stock\n\t\t\t\t\tvar h\n\t\t\t\t\tfor(h=0;h<radiosLugar.length;h++){\n\t\t\t\t\t\tif(radiosLugar[h].value == '5'){\n\t\t\t\t\t\t\tradiosLugar[h].disabled=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(radiosLugar[h].value == '6'){\n\t\t\t\t\t\t\tradiosLugar[h].disabled=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Si el valor del radio es entidad responsable la bodega\n\t\telse if(radiosResponsable[i].value == 'BOD'){\n\t\t\t\n\t\t\t//deshabilito y deschequeo el radio de parcial a bodega del stock y a local\n\t\t\tvar h\n\t\t\tfor(h=0;h<radiosLugar.length;h++){\n\t\t\t\tif(radiosLugar[h].value == '6' && bloqueoEntregaDomicilio == '1'){\n\t\t\t\t\tradiosLugar[h].disabled=true;\n\t\t\t\t\tradiosLugar[h].checked=false;\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t//deshabilito donde se entregara la marcaderia - LOCAL\n\t\t\tvar t\n\t\t\tfor(t=0;t<radiosStock.length;t++){\n\t\t\t\tif(radiosStock[t].value != '11'){\n\t\t\t\t\tradiosStock[t].disabled=true;\n\t\t\t\t\tradiosStock[t].checked=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "91cf4897e8b9a8dddd357df2ec92f422", "score": "0.44191995", "text": "handleAddEdit(obj) {\r\n let _this = this;\r\n return saveUomConversionDetail(obj).then(function (res) {\r\n if (res.success) {\r\n if (_this.addMode) {\r\n _this.props.notifyToaster(NOTIFY_SUCCESS, { message: _this.strings.ADD_SUCCESS });\r\n _this.stateSet({ key: new Date() });\r\n }\r\n else {\r\n _this.props.notifyToaster(NOTIFY_SUCCESS, { message: _this.strings.MODIFY_SUCCESS });\r\n }\r\n return true;\r\n }\r\n else if (res.badRequest) {\r\n _this.props.notifyToaster(NOTIFY_ERROR, { message: res.error, strings: _this.strings });\r\n _this.stateSet({ error: _this.strings[res.error] })\r\n }\r\n }).catch(function (err) {\r\n _this.props.notifyToaster(NOTIFY_ERROR);\r\n });\r\n }", "title": "" }, { "docid": "579bffba97f3a1788b41916d08a43f8f", "score": "0.44155425", "text": "function limpiarTipoOperacion(){\n this.activoOperacion =false;\n this.tipoOperacion = '';\n\n}", "title": "" }, { "docid": "74a6ca3c3de7726db512c971e45c32ef", "score": "0.4413609", "text": "function aulaReceita_control() {\n\n listAula = null;\n $.getJSON(listAula, function (jsonObjectAula) {\n jsonAula = jsonObjectAula;\n })\n\n // se estiver criando aula idData == 0, vai buscar a id dessa aula para adicionar as receitas\n if (idData == 0) {\n // imagina que, var lastAulaInfo = lastId;\n var lastAulaInfo = searchLastId(jsonAula, 'id_aula');\n\n if (typeof lastAulaInfo === 'undefined') {\n idData = 1;\n } else {\n idData = lastAulaInfo;\n idData++;\n var idDataTemp = idData;\n }\n eachReceita(idDataTemp);\n } else {\n return editAula();\n }\n\n // pega a id da aula que acabou de ser criada, ao criar uma aula ele ja irá ir inserindo as receitas\n function searchLastId(arr, prop) {\n\n var lastId;\n for (var i = 0; i < arr.length; i++) {\n if (!lastId || parseInt(arr[i][prop]) > parseInt(lastId[prop]))\n lastId = arr[i];\n }\n return lastId.id_aula;\n }\n }", "title": "" }, { "docid": "a9af7494b2008627ca3b2ccde462b8f8", "score": "0.44123456", "text": "chooseOperation(operation){\n // if currentOperand is empty we stop the function.\n if(this.currentOperand === '') return;\n // if already have numbers in the previous operand, we will do the operation.\n if(this.previousOperand !== ''){\n this.compute();\n }\n this.operation = operation;\n this.previousOperand = this.currentOperand;\n this.currentOperand = '';\n\n }", "title": "" }, { "docid": "2f2d4473c06f97326a0accc1fb623d92", "score": "0.44106284", "text": "function crearOrdenador(){\n\t/* campos de recogida */\n\tIdentificador++;\n\tlet referenciaOrdenador = document.getElementById('referenciaOrdenador').value;\n\tlet marcaOrdenador = document.getElementById('marcaOrdenador').value;\n\tlet pesoOrdenador = document.getElementById('pesoOrdenador').valueAsNumber;\n\tpesoTotal += pesoOrdenador;\n\tvar precioOrdenador = document.getElementById('precioOrdenador').valueAsNumber;\n precio+=precioOrdenador;\n precioIva+=((precioOrdenador*21)/100)+precioOrdenador;\n\tlet procesadorOrdenador = document.getElementById('procesadorOrdenador').value;\n\tlet capacidadOrdenador = document.getElementById('capacidadOrdenador').value;\n\tlet ramOrdenador = document.getElementById('ramOrdenador').value;\n\tlet graficaOrdenador = document.getElementById('graficaOrdenador').value;\n\tlet soOrdenador = document.getElementById('soOrdenador').value;\n\tlet tipoOrdenador = document.getElementById('tipoOrdenador');\n\tif(referenciaOrdenador != \"\" && marcaOrdenador != \"\" && pesoOrdenador != \"\" && precioOrdenador != \"\" && procesadorOrdenador != \"\" && capacidadOrdenador != \"\" && ramOrdenador != \"\" && graficaOrdenador != \"\" && soOrdenador != \"\"){\n\t\t\tif (tipoOrdenador.value == 'sobremesa') {\n\t\t\tlet blueDvd = document.getElementById('blueDvd').value;\n\t\t\tif (blueDvd != \"0\") {\n\t\t\t\tlet nuevoSobremesa = new Sobremesa(Identificador,referenciaOrdenador,marcaOrdenador,pesoOrdenador,precioOrdenador,procesadorOrdenador,capacidadOrdenador,ramOrdenador,graficaOrdenador,soOrdenador,blueDvd);\n\n\t\t\t\tcarrito.push(nuevoSobremesa);\n\t\t\t\tverificarEnvio();\n\t\t\t\talert(\"El ordenador de sobremesa ha sido agregado al carrito\");\n\t\t\t\tblueDvd = document.getElementById('blueDvd').value = \"0\";\n\t\t\t\tresetOrdenador();\n\t\t\t}else{\n\t\t\t\talert(\"Hay campos vacios!\");\n\t\t\t}\n\t\t\t\n\t\t\t}else if(tipoOrdenador.value == 'portatil'){\n\t\t\tlet tamanoPantallaPor = document.getElementById('tamanoPantallaPor').value;\n\t\t\tif (tamanoPantallaPor != \"\") {\n\t\t\t\tverificarEnvio();\n\n\t\t\t\tlet nuevoPortatil = new Portatil(Identificador,referenciaOrdenador,marcaOrdenador,pesoOrdenador,precioOrdenador,procesadorOrdenador,capacidadOrdenador,ramOrdenador,graficaOrdenador,soOrdenador,tamanoPantallaPor);\n\t\t\t\tcarrito.push(nuevoPortatil);\n\t\t\t\tverificarEnvio();\t\n\t\t\t\talert(\"El portatil ha sido agregado al carrito.\");\n\t\t\t\ttamanoPantallaPor = document.getElementById('tamanoPantallaPor').value = \"\";\n\t\t\t\t//resetOrdenador();\n\t\t\t}else{\n\t\t\t\talert(\"Hay campos vacios!\");\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\talert('Hay campos vacios!');\n\t}\n}", "title": "" }, { "docid": "dabaa1d6b5bdc0c15c1ee965cad4950d", "score": "0.44081438", "text": "getTrattativa(offerta, richiesta, offerente, aquirente) {\n trattative.forEach(( i) => {\n if (i.offerta == offerta &&\n i.richiesta == richiesta &&\n i.offerente.username == offerente &&\n i.aquirente.username == aquirente) {\n return i;\n }\n });\n return null;\n }", "title": "" }, { "docid": "14a308a60f126c8931236350015c9d3f", "score": "0.4405836", "text": "function Operation (data) {\n if (!this || this.constructor !== Operation) {\n // => function was called without 'new'\n return new Operation(data);\n }\n \n this.data = data || '';\n }", "title": "" }, { "docid": "a82ccaf1df42c0aa6ce7bca89edbfa6b", "score": "0.44036114", "text": "function resultat2()\n{\n\t//if ((document.info.operande1.value != \"\") && (document.info.operande2.value != \"\") && (document.info.operation.value != \" \"))\n\tif ((document.info.operande1.value != \"\") && (document.info.operande2.value != \"\") && (document.info.operateur1.selectedIndex >= 1))\n\t\tresultat();\n}", "title": "" }, { "docid": "6e3e42a49c0e25d54397ce655037c95b", "score": "0.4400392", "text": "infomarCompraRechazada(){\n\t\t//Estado actual: RECHAZADA_POR_INFRACCION\n\t\tthis.estado.nombre = 'RECHAZADA_POR_INFRACCION';\n\t\tthis.estado.timestamp = new Date();\n\t\tthis.estado.transicion_in = '[resultado_infraccion = conInfraccion]';\n\t\tthis.estado.transicion_out = [];\n\t\tthis.logEstado();\n\n\t\tvar topico = '.web.';\n\t\tvar mensaje = new Object();\n\t\tmensaje.evento = 'compraRechazadaPorInfraccion'; \n\t\tmensaje.data = this.data;\n\t\tthis.server.publicarMensaje(topico, mensaje);\n\n\t}", "title": "" }, { "docid": "788fa77f861f51216b6c8febab338749", "score": "0.43974212", "text": "function checkCRUD(param) {\n\n return gw_com_api.getCRUD(\"frmData_상세\");\n\n}", "title": "" }, { "docid": "9ed40fc8a2085a56f55bc51c5825c9ae", "score": "0.43956557", "text": "function aceptarCriteriosMonitor(opM)\n{\nswitch (opM) {\ncase 'ped':\n\tdocument.getElementById(\"divPedidosMonitor\").setAttribute(\"style\",\"visibility:hidden\")\n\tdataGridPedM = $(\"#gridPedidosMonitor\").data(\"kendoGrid\");\n\tdataGridPedMSource = dataGridPedM.dataSource.data();\n\tif(dataGridPedMSource[0].id!=\"\")\n\t{\n\t$('#pedido').val(dataGridPedMSource[0].id).attr('disabled', 'true');\n\t}else\n\t{\n\t\t// kendoConsole.log(\"No deje criterios en blanco en Pedidos\",\"warning\")\n\t\t$(\"#mensajes_main\").html(\"No deje criterios en blanco en Pedidos\");\n\t\tdocument.getElementById(\"divPedidosMonitor\").setAttribute(\"style\",\"visibility:visible\")\n\t}\n\tbreak;\n\ncase 'reg':\n\tdocument.getElementById(\"divRegistrosMonitor\").setAttribute(\"style\",\"visibility:hidden\")\n\tdataGridRegM = $(\"#gridRegistrosMonitor\").data(\"kendoGrid\");\n\tdataGridRegMSource = dataGridRegM.dataSource.data();\n\tif(dataGridRegMSource[0].id!=\"\")\n\t{\n\t$('#registro').val(dataGridRegMSource[0].id).attr('disabled', 'true');\n\t}else\n\t{\n\t\t //kendoConsole.log(\"No deje criterios en blanco Registro\",\"warning\")\n\t\t$(\"#mensajes_main\").html(\"No deje criterios en blanco en Pedidos\");\n\t\tdocument.getElementById(\"divRegistrosMonitor\").setAttribute(\"style\",\"visibility:visible\")\n\t}\n\tbreak;\ndefault:\n\tbreak;\n}\t\n\t\n}", "title": "" }, { "docid": "ae09ab5e6be0488f38660f3b1f0b0c30", "score": "0.43938917", "text": "computarCosto() {\n let distanciaTotal = 0;\n // Recorrae la ruta desede el indice 1 para comparar con el anterior\n for (let i = 1; i < this.ruta.length; i++) {\n const ciudad = this.ruta[i]; // Ciudad actual\n const ciudadAnterior = this.ruta[i - 1]; // Ciudad anterior\n const indiceC = entrada_1.ciudades.indexOf(ciudad); // inidice Ciudad actual\n const indiceCAnterior = entrada_1.ciudades.indexOf(ciudadAnterior); // indice Ciudad anterior\n // Obtener la distancia entre ciudades (con los indices de las cidades)\n let dis = entrada_1.matrizDistanias[indiceC][indiceCAnterior];\n distanciaTotal += dis;\n }\n return distanciaTotal;\n }", "title": "" }, { "docid": "e33d48392e589c1c4e7841286a1625ca", "score": "0.4391159", "text": "getValidation() {\n return !(this.state.validado_usuario === 'success' && this.state.validado_contrasenya === 'success');\n }", "title": "" }, { "docid": "dcdc48ccb310441be018c7a3bb6255c5", "score": "0.43824372", "text": "function criaCalculadora() {\n //tudo que for metodo vai pra baixo\n //não é regra mais fica um codigo mais limpos\n return {\n display: document.querySelector('.display'),\n btnClear: document.querySelector('.btn-clear'),\n inicia() {\n //sempre que quero referenciar uma chave do obj precisa do this\n this.cliqueBotoes()\n this.pressionaEnter()\n },\n pressionaEnter() {\n this.display.addEventListener('keyup', e => {\n if (e.keyCode === 13) {\n \n this.realizaConta()\n }\n })\n },\n realizaConta() {\n //eval é perigoso ele vai avaliar a string e transformar em js\n //perigoso pq pode ser invadido facil pois executa como linhas js\n let conta = this.display.value\n try {\n conta = eval(conta)\n if (!conta) {\n alert('Conta invalida')\n return;\n }\n\n this.display.value = String(conta)\n } catch (e) {\n alert('Conta invalida')\n return;\n }\n },\n clearDisplay() {\n this.display.value = ''\n },\n apagaUm() {\n this.display.value = this.display.value.slice(0, -1)\n },\n cliqueBotoes() {\n //this -> calculadora\n //quem chama o metodo é o this\n document.addEventListener('click', function (e) {\n const el = e.target\n //this -> elemento (document)\n if (el.classList.contains('btn-num')) {\n this.btnParaDisplay(el.innerText);\n }\n if (el.classList.contains('btn-clear')) {\n this.clearDisplay()\n }\n if (el.classList.contains('btn-del')) {\n this.apagaUm()\n }\n if (el.classList.contains('btn-eq')) {\n this.realizaConta()\n }\n }.bind(this))//arrow function não precisa do bind para puxar o this pai\n },\n btnParaDisplay(valor) {\n this.display.value += valor;\n }\n\n\n }\n}", "title": "" }, { "docid": "0fd679a48d210975da0ea74ff8927a1b", "score": "0.43810257", "text": "buildResource() {\n // Subnet\n const target_subnet_id = this.createInput('select', 'Target Subnet', `${this.id}_target_subnet_id`, '', (d, i, n) => {this.resource.target_subnet_id = n[i].value})\n this.target_subnet_id = target_subnet_id.input\n this.append(this.core_tbody, target_subnet_id.row)\n // IPv4 CIDR Blocks\n const client_cidr_block_allow_list = this.createInput('ipv4_single_cidr_list', 'Allowed IPv4 CIDR(s)', `${this.id}_client_cidr_block_allow_list`, '', (d, i, n) => {n[i].reportValidity(); this.resource.client_cidr_block_allow_list = n[i].value.replace(' ', '').split(',')})\n this.client_cidr_block_allow_list = client_cidr_block_allow_list.input\n this.append(this.core_tbody, client_cidr_block_allow_list.row)\n // TTL\n const max_session_ttl_in_seconds = this.createInput('number', 'Session TTL (Seconds)', `${this.id}_max_session_ttl_in_seconds`, '', (d, i, n) => this.resource.max_session_ttl_in_seconds = n[i].value, {min: 1800, max: 10800})\n this.max_session_ttl_in_seconds = max_session_ttl_in_seconds.input\n this.append(this.core_tbody, max_session_ttl_in_seconds.row)\n // // Advanced\n // const advanced = this.createDetailsSection('Advanced', `${this.id}_advanced_details`)\n // this.append(this.properties_contents, advanced.details)\n // this.advanced_div = advanced.div\n // const advanced_table = this.createTable('', `${this.id}_advanced`)\n // this.advanced_tbody = advanced_table.tbody\n // this.append(this.advanced_div, advanced_table.table)\n // // IPv4 CIDR Blocks\n // const static_jump_host_ip_addresses = this.createInput('ipv4_list', 'Static Jump Host IP(s)', `${this.id}_static_jump_host_ip_addresses`, '', (d, i, n) => {n[i].reportValidity(); this.resource.static_jump_host_ip_addresses = n[i].value.replace(' ', '').split(',')})\n // this.static_jump_host_ip_addresses = static_jump_host_ip_addresses.input\n // this.append(this.advanced_tbody, static_jump_host_ip_addresses.row)\n }", "title": "" }, { "docid": "a1a054cd8cbb03b8042c06d46c541649", "score": "0.43794236", "text": "function fGrupoModeloProdutoF10(opc,codGmp,foco,topo,objeto){\r\n let clsStr = new concatStr();\r\n let flag = false; \r\n clsStr.concat(\"SELECT A.GMP_CODIGO AS CODIGO,GM.GM_NOME AS DESCRICAO,A.GMP_NUMSERIE AS SERIE\" );\r\n if( objeto['cntp']){\r\n clsStr.concat(\" ,GMM.GM_NOME AS MODELO\" );\r\n flag = true; \r\n }; \r\n clsStr.concat(\" ,A.GMP_SINCARD AS SINCARD\" );\r\n clsStr.concat(\" ,CASE WHEN A.GMP_DTCONFIGURADO IS NULL THEN 'NAO' ELSE 'SIM' END AS CFG\" ); \r\n clsStr.concat(\" FROM GRUPOMODELOPRODUTO A\" );\r\n clsStr.concat(\" LEFT OUTER JOIN GRUPOMODELO GM ON A.GMP_CODGM=GM.GM_CODIGO\" );\r\n \r\n let tblGmp = \"tblGmp\";\r\n let divWidth = \"54em\";\r\n let tblWidth = \"52em\";\r\n if( typeof objeto === 'object' ){\r\n for (var key in objeto) {\r\n switch( key ){\r\n case \"cntp\":\r\n clsStr.concat(\" LEFT OUTER JOIN GRUPOMODELOPRODUTO GMMP ON A.GMP_NUMSERIE = GMMP.GMP_NUMSERIE AND GMMP.GMP_CODCNTT = 0 AND GMMP.GMP_CODPE ='aut' and GMMP.GMP_CODAUT = A.GMP_CODIGO\");\r\n clsStr.concat(\" LEFT OUTER JOIN GRUPOMODELO GMM ON GMMP.GMP_CODGM=GMM.GM_CODIGO\" );\r\n break;\r\n case \"codgm\": \r\n clsStr.concat(\" {WHERE} (A.GMP_CODGM='\"+objeto[key]+\"')\",true);\r\n break;\r\n case \"codgp\": \r\n clsStr.concat(\" {WHERE} (A.GMP_CODGP='\"+objeto[key]+\"')\",true);\r\n break;\r\n case \"codpe\": \r\n clsStr.concat(\" {AND} (A.GMP_CODPE='\"+objeto[key]+\"')\",true);\r\n break;\r\n case \"codaut\":\r\n clsStr.concat( \" {AND} (A.GMP_CODAUT='\"+objeto[key]+\"')\",true); \r\n break; \r\n case \"divWidth\": \r\n divWidth=objeto[key];\r\n break;\r\n case \"tbl\": \r\n tblGmp=objeto[key];\r\n break; \r\n case \"tblWidth\": \r\n tblWidth=objeto[key];\r\n break;\r\n case \"where\" : \r\n clsStr.concat( objeto[key],true); \r\n break; \r\n }; \r\n }; \r\n };\r\n sql=clsStr.fim();\r\n\r\n var jsGmpF10 = null;\r\n // \r\n if( opc == 0 ){ \r\n //////////////////////////////////////////////////////////////////////////////\r\n // localStorage eh o arquivo .php onde estao os select/insert/update/delete //\r\n //////////////////////////////////////////////////////////////////////////////\r\n var bdGmp=new clsBancoDados(localStorage.getItem('lsPathPhp'));\r\n bdGmp.Assoc=false;\r\n bdGmp.select( sql );\r\n if( bdGmp.retorno=='OK'){\r\n if (flag === true){\r\n var jsGmpF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,{\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"5em\" ,\"fieldType\":\"int\",\"formato\":['i4'],\"ordenaColuna\":\"S\",\"align\":\"center\"}\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"27em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":3 ,\"labelCol\":\"SERIE\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"10em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":4 ,\"labelCol\":\"MODELO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"15em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":5 ,\"labelCol\":\"SINCARD\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"10em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"} \r\n ,{\"id\":6 ,\"labelCol\":\"CFG\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"} \r\n ]\r\n ,\"registros\" : bdGmp.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblGmp\r\n ,\"div\" : 'tblGmp' // Nome da table\r\n ,\"prefixo\" : \"Gmp\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : \"GRUPOMODELOPRODUTO\" // Nome da tabela no banco de dados \r\n ,\"width\" : tblWidth // Tamanho da table\r\n ,\"height\" : \"39em\" // Altura da table\r\n ,\"indiceTable\" : \"SERIE\" // Indice inicial da table\r\n ,\"tamBotao\" : \"20\"\r\n };\r\n }else{\r\n var jsGmpF10={\r\n \"titulo\":[\r\n {\"id\":0 ,\"labelCol\":\"OPC\" ,\"tipo\":\"chk\" ,\"tamGrd\":\"3em\" ,\"fieldType\":\"chk\"} \r\n ,{\"id\":1 ,\"labelCol\":\"CODIGO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"5em\" ,\"fieldType\":\"int\",\"formato\":['i4'],\"ordenaColuna\":\"S\",\"align\":\"center\"}\r\n ,{\"id\":2 ,\"labelCol\":\"DESCRICAO\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"27em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":3 ,\"labelCol\":\"SERIE\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"10em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"}\r\n ,{\"id\":4 ,\"labelCol\":\"SINCARD\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"10em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"S\"} \r\n ,{\"id\":5 ,\"labelCol\":\"CFG\" ,\"tipo\":\"edt\" ,\"tamGrd\":\"5em\" ,\"fieldType\":\"str\",\"ordenaColuna\":\"N\"} \r\n ]\r\n ,\"registros\" : bdGmp.dados // Recebe um Json vindo da classe clsBancoDados\r\n ,\"opcRegSeek\" : true // Opção para numero registros/botão/procurar \r\n ,\"checarTags\" : \"N\" // Somente em tempo de desenvolvimento(olha as pricipais tags)\r\n ,\"tbl\" : tblGmp // Nome da table\r\n ,\"div\" : 'tblGmp' \r\n ,\"prefixo\" : \"Gmp\" // Prefixo para elementos do HTML em jsTable2017.js\r\n ,\"tabelaBD\" : \"GRUPOMODELOPRODUTO\" // Nome da tabela no banco de dados \r\n ,\"width\" : tblWidth // Tamanho da table\r\n ,\"height\" : \"39em\" // Altura da table\r\n ,\"indiceTable\" : \"SERIE\" // Indice inicial da table\r\n ,\"tamBotao\" : \"20\"\r\n };\r\n }\r\n if( objGmpF10 === undefined ){ \r\n objGmpF10 = new clsTable2017(\"objGmpF10\");\r\n objGmpF10.tblF10 = true;\r\n if( (foco != undefined) && (foco != \"null\") ){\r\n objGmpF10.focoF10=foco; \r\n };\r\n };\r\n var html = objGmpF10.montarHtmlCE2017(jsGmpF10);\r\n var ajudaF10 = new clsMensagem('Ajuda',topo);\r\n ajudaF10.divHeight= '410px'; /* Altura container geral*/\r\n ajudaF10.divWidth = divWidth;\r\n ajudaF10.tagH2 = false;\r\n ajudaF10.mensagem = html;\r\n ajudaF10.Show('ajudaGmp');\r\n document.getElementById('tblGmp').rows[0].cells[3].click(); \r\n delete(ajudaF10);\r\n delete(objGmpF10);\r\n };\r\n }; \r\n if( opc == 1 ){\r\n var bdGmp=new clsBancoDados(localStorage.getItem(\"lsPathPhp\"));\r\n bdGmp.Assoc=true;\r\n bdGmp.select( sql );\r\n return bdGmp.dados;\r\n }; \r\n}", "title": "" }, { "docid": "1c22bdb1af066d9ebfce20061736e3db", "score": "0.43790126", "text": "ActualizarCostoFijo(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n const Id_CostoFijo = parseInt(req.params.Id_CostoFijo);\n const Id_Empresa = parseInt(req.params.Id_Empresa);\n var costoFijo = new CostoProducto_model_1.CostoProductoModel();\n var body = req.body;\n // costoFijo.Id_CostoFijo = Id_CostoFijo;\n // costoFijo.DiasLaborables = body.DiasLaborables;\n // costoFijo.ManoObraTotal = body.ManoObraTotal;\n // costoFijo.ManoObraDiario = body.ManoObraDiario;\n // costoFijo.ManoObraHora = body.ManoObraHora;\n // costoFijo.ManoObraMinuto = body.ManoObraMinuto;\n // costoFijo.AlquilerTotal = body.AlquilerTotal;\n // costoFijo.AlquilerDiario = body.AlquilerDiario;\n // costoFijo.LuzElectricaTotal = body.LuzElectricaTotal;\n // costoFijo.LuzElectricaDiario = body.LuzElectricaDiario;\n // costoFijo.AguaTotal = body.AguaTotal;\n // costoFijo.AguaDiario = body.AguaDiario;\n // costoFijo.ProductosVendidosMes = body.ProductosVendidosMes;\n // costoFijo.OtrosGastosTotal = body.OtrosGastosTotal;\n // costoFijo.OtrosGastosDiario = body.OtrosGastosDiario;\n // costoFijo.Id_Empresa = Id_Empresa;\n yield database_1.default.query('UPDATE CostosFijos set ? WHERE Id_CostoFijo = ? and Id_Empresa=?', [costoFijo, Id_CostoFijo, Id_Empresa], (err, datos) => {\n if (err) {\n return res.status(400).json({\n ok: false,\n mensaje: 'Error al crear Auxiliar',\n errors: err,\n });\n }\n res.status(201).json({\n ok: true,\n CostoFijo: datos,\n });\n });\n });\n }", "title": "" }, { "docid": "dd1b99e4bc5d3cd8346bfc53973c4a44", "score": "0.4376854", "text": "getRoof(){\n return this.roof;\n }", "title": "" }, { "docid": "e91f059c74529f7b5fe958fb95a7b4cc", "score": "0.43747967", "text": "function makeCurrOp(add, sub, mult, div, min, max, mtab, dtab) {\r\n if (min != null && max != null) {\r\n operation.setNumbers(min, max);\r\n }\r\n if (mtab) {\r\n operation.setMulTables(mtab);\r\n }\r\n if (dtab) {\r\n operation.setDivTables(dtab);\r\n }\r\n operation.createOp(add, sub, mult, div);\r\n operation.createRange();\r\n currentOperation.operation = operation.getOp();\r\n}", "title": "" }, { "docid": "ffd527d350aacce142e3ad43fd8a476b", "score": "0.43715632", "text": "get validationOperator() {\n return this._bz;\n }", "title": "" }, { "docid": "47ce15c332191c90c6ace2a6c3ac4dc9", "score": "0.4367011", "text": "get_accessor(name,abs_name,row,abs_row,col,abs_col,context_getter){\n // Representatives\n let a1_row = this.rows[row];\n let a1_col = this.cols[col];\n let self = this;\n\n // console.log(`Getting asked to call ${name} `)\n // console.log(`this.rows[${row}] = ${a1_row}/${this.rows.length}`)\n // console.log(`this.cols[${col}] = ${a1_col}/${this.cols.length}`)\n\n return new A1Accessor(name,abs_name,a1_row,abs_row,a1_col,abs_col,self,context_getter);\n }", "title": "" }, { "docid": "ea827c6f1e07b2a623396f4b62b43167", "score": "0.43639463", "text": "mapOperations(opId){\n return (this.props.operations[opId -1] ? this.props.operations[opId -1].human_value : \"\");\n}", "title": "" }, { "docid": "6868f5cf6ab589154f92477f675b3223", "score": "0.43635583", "text": "function realizaOperaciones(result,operador){ \n resetValInput();\n if ( isNaN(result) ){\n errorMessage(Error1);\n } else {\n switch(operadorAnterior){\n case \"+\": resultParcial = resultParcial + result; break;\n case \"-\": resultParcial = resultParcial - result; break;\n case \"*\": resultParcial = resultParcial * result; break;\n case \"/\": resultParcial = result != 0 ? resultParcial / result: resultParcial; break;\n default: resultParcial = result; break;\n }\n if (result == 0 && operadorAnterior == \"/\" ){\n errorMessage(Error2);\n } else {\n printResult(result,operador);\n } \n }\n}", "title": "" } ]
fd99cffbd6e8c8a021e61009eb0a8cd0
Called when no file is found for a given pathname
[ { "docid": "3b2f8c797ffddfd28e0b0bbc58c0c33e", "score": "0.0", "text": "function return404(res){\n\t//404 page\n\tres.writeHead(404, {\"Content-type\":\"text/html\"});\n\tres.end(\"We are Sorry but we could find the page you are searching\");\n}", "title": "" } ]
[ { "docid": "81ca987f4879729aea49c36e0358c895", "score": "0.6250286", "text": "function fileNotExistsCallback(){\r\n\t\tconsole.log(Date()+':ERROR[404]: NOT FOUND.');\r\n\t\tres.send('<h1>404 Not Found</h1>' + footer);\r\n\t}", "title": "" }, { "docid": "706178c7ba40ff32d2eed8c40fbd7c1b", "score": "0.6021541", "text": "function notFoundError (filePath, cb) {\n const error = new Error(`ENOENT, ${filePath} not found`)\n error.code = 'ENOENT'\n error.errno = -2\n if (typeof cb !== 'function') {\n throw error\n }\n process.nextTick(() => cb(error))\n}", "title": "" }, { "docid": "645c1c5f037104b9606c0b63595b4937", "score": "0.5967827", "text": "function lookupFile() {\n\t\tfs.exists(cachedFile, function(exists) {\n\t\t\tif(exists) {\n\t\t\t\t\n\t\t\t\thandleFound();\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tconfig.logger.serverLog(\"cache miss: '\" + cachedFile + \"', building cache...\");\n\n\t\t\t\trespondWith(404, CONTENT_TYPE_HTML, \"<h1>File not found</h1>\");\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "c1fdc0f230df0a6f1918b5141cce4753", "score": "0.5941962", "text": "function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) {\n if (!onlyRecordFailures) {\n if (state.host.fileExists(fileName)) {\n if (state.traceEnabled) {\n trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);\n }\n return fileName;\n } else {\n if (state.traceEnabled) {\n trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName);\n }\n }\n }\n failedLookupLocations.push(fileName);\n return undefined;\n }", "title": "" }, { "docid": "c1fdc0f230df0a6f1918b5141cce4753", "score": "0.5941962", "text": "function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) {\n if (!onlyRecordFailures) {\n if (state.host.fileExists(fileName)) {\n if (state.traceEnabled) {\n trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);\n }\n return fileName;\n } else {\n if (state.traceEnabled) {\n trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName);\n }\n }\n }\n failedLookupLocations.push(fileName);\n return undefined;\n }", "title": "" }, { "docid": "e0ba7c1404a3458fff698fbd43df44b4", "score": "0.59302205", "text": "function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) {\n if (!onlyRecordFailures) {\n if (state.host.fileExists(fileName)) {\n if (state.traceEnabled) {\n trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName);\n }\n return fileName;\n }\n else {\n if (state.traceEnabled) {\n trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName);\n }\n }\n }\n failedLookupLocations.push(fileName);\n return undefined;\n }", "title": "" }, { "docid": "c05366b8ebd961decad70077f4e61750", "score": "0.5632616", "text": "function throwIfFileNotExists(fileSystemWrapper, filePath) {\n if (!fileSystemWrapper.fileExistsSync(filePath))\n throw new classes_1.FileNotFoundError(filePath);\n}", "title": "" }, { "docid": "18883a0d3fadceb938afcff8cfbedcd3", "score": "0.55961657", "text": "function serve404(){\r\n\t\tvar url = ROOT + \"/404.html\"; //url path to 404.html\r\n\t\t//Serve 404 if it exists\r\n\t\tfs.readFile(url,\"utf8\",function(err,data){ //async\r\n\t\t\tif(err)respond(500,err.message);\r\n\t\t\trespond(404,data);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.55779284", "text": "notFound() {}", "title": "" }, { "docid": "57571c9e4b0499b6eeb6521a04130fc2", "score": "0.54647744", "text": "function notFound() {\n error = new Error('Not found');\n error.status = 404;\n self.onError(error);\n }", "title": "" }, { "docid": "1cf936e27fdbe337cca865012a554c25", "score": "0.54590183", "text": "function nofoundHandler(req, res) \n{\n \n res.writeHead(404, {'Content-Type': 'text/plain'});\n res.end('404 Error - Request handler not found'); \n}", "title": "" }, { "docid": "e3152bfcb4b7cfbf5d06071b4012116f", "score": "0.54261744", "text": "function sendFileIfExists(res, filePath) {\n\tfs.exists(filePath, function(exists) {\n\t\tif (exists) {\n\t\t\tres.sendfile(filePath);\n\t\t} else {\n\t\t\tres.send(404);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6ab30a0a47d6d179b0eeabb87da69d40", "score": "0.5401454", "text": "function File_CheckFileExists(filePath)\r\n{\r\n if (filePath == null)\r\n return;\r\n\r\n if (!aqFile.Exists(filePath))\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_CheckFileExists] The file path does not exist< \" + filePath + \">\");\r\n\r\n CommonReporting.Log_Debug(\"[CommonFiles: File_CheckFileExists] The filepath <\" + filePath + \"> exists\");\r\n}", "title": "" }, { "docid": "c37028c988f757bd4e3711694892a52c", "score": "0.53937185", "text": "function nothing() {\n // Triggers don't like files with no named function.\n Logger.log(\"Nothing happened.\\n\");\n}", "title": "" }, { "docid": "65f5a97ed51bfbad1bd2e999b139573e", "score": "0.538454", "text": "exists ()\n\t{\n\t\t/* Stat de file. */\n\t\tfs.stat (this.path, (err, stat) =>\n\t\t{\n\t\t\t/* Bestaat de file? */\n\t\t\tif (err == null)\n\t\t\t{\n\t\t\t\t/* Ja, roep monitor aan. */\n\t\t\t\tthis.monitor ();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* File bestaat niet. Probeer over 10 seconde nog een keer. */\n\t\t\t\tsetTimeout (this.exists.bind (this), 10000);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "7ac27bfae24dbac2e615e2f5be2d2d2e", "score": "0.5370917", "text": "function fileErrorHandler(evt) {\n switch (evt.target.error.code) {\n case evt.target.error.NOT_FOUND_ERR:\n alert('File Not Found!');\n break;\n case evt.target.error.NOT_READABLE_ERR:\n alert('File is not readable');\n break;\n case evt.target.error.ABORT_ERR:\n break; // noop\n default:\n alert('An error occurred reading this file.');\n }\n\n }", "title": "" }, { "docid": "e665371b167fcd3912a9038a1f02b7c3", "score": "0.53706944", "text": "function NotFound()\n{\n return(\n <h1>FILE NOT FOUND! :(</h1>\n ) \n}", "title": "" }, { "docid": "31fcc00fe8dcb14034a1d20376ee65c4", "score": "0.5370382", "text": "function fileExistsCallback(){\r\n\t\tconsole.log(Date()+\": Dispatching \"+filename);\r\n\t\t// check if the path given is directory or file\r\n\t\tif(!fs.lstatSync('./' + filename).isDirectory()){\r\n\t\t\t// if not a directory\r\n\t\t\tvar rstream = fs.createReadStream('./' + filename);\r\n\t\t\trstream.pipe(res);\r\n\t\t\treturn Date()+\":Success\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\t// if directory, print the index\r\n\t\t\tvar cmd = 'dir .\\\\' + filename.split('/').join('\\\\').substr(1) + ' /b';\r\n\t\t\texec(cmd, function(error, stdout, stderr){\r\n\t\t\t\tdata = stdout;\r\n\t\t\t\tdata = data.split('\\r\\n');\r\n\t\t\t\tdata = data.join('<br/>');\r\n\t\t\t\tres.send('<h1>Index of ' + filename + '</h1><br>' + data + footer);\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1669642236ec8b23e52bc5f658a2c665", "score": "0.53697336", "text": "function serve404(){\r\n\t\tfs.readFile(ROOT+\"/404.html\",function(err,data){\r\n\t\t\tif(err){ respond(500,err.message); }\r\n\t\t\telse {respond(404,data);}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "d602c389bb311e07c5200ad06150422b", "score": "0.53667307", "text": "function File_CheckFileNotExists(filePath, timeout)\r\n{\r\n var elapsedTime = 0;\r\n\r\n if (timeout == null)\r\n timeout = 0;\r\n\r\n while( elapsedTime <= timeout)\r\n {\r\n if (aqFile.Exists(filePath))\r\n {\r\n elapsedTime = elapsedTime + 100;\r\n aqUtils.Delay(100);\r\n }\r\n else\r\n {\r\n CommonReporting.Log_Debug(\"[CommonFiles: File_CheckFileNotExists] The filepath <\" + filePath + \"> doesn't exist\");\r\n return;\r\n }\r\n }\r\n CommonReporting.Log_StepError(\"[CommonFiles: File_CheckFileNotExists] The filepath <\" + filePath + \"> exists\");\r\n}", "title": "" }, { "docid": "b983b089a7adf6682bd5a3a06a2816ec", "score": "0.5364322", "text": "function watchMissingDirectory() {\n return fsWatchFile(directoryName, function (_fileName, eventKind) {\n if (eventKind === FileWatcherEventKind.Created && directoryExists(directoryName)) {\n watcher.close();\n watcher = watchPresentDirectory();\n // Call the callback for current directory\n // For now it could be callback for the inner directory creation,\n // but just return current directory, better than current no-op\n callback(\"rename\", \"\");\n }\n });\n }", "title": "" }, { "docid": "8b01662f7b9f3f1e3df2087f3c04a487", "score": "0.5359343", "text": "function serve404(){\n\t\tfs.readFile(ROOT+\"/404.html\",\"utf8\",function(err,data){ //async\n\t\t\tif(err)respond(500,err.message);\n\t\t\telse respond(404,data);\n\t\t});\n\t}", "title": "" }, { "docid": "9708235dace07daca6f1a6399218f7a9", "score": "0.5331038", "text": "function watchMissingDirectory() {\n return fsWatchFile(directoryName, function (_fileName, eventKind) {\n if (eventKind === FileWatcherEventKind.Created && directoryExists(directoryName)) {\n watcher.close();\n watcher = watchPresentDirectory();\n // Call the callback for current directory\n // For now it could be callback for the inner directory creation,\n // but just return current directory, better than current no-op\n callback(\"rename\", \"\");\n }\n });\n }", "title": "" }, { "docid": "c643ac8d5a0586fe345aaa8501c94460", "score": "0.53001726", "text": "function setNoFilesAvailable(){\n\t\tjqueryMap.$moduleContainer.html(\"\");\n\t\tjqueryMap.$statusBar.html(\"No Files Available\");\n\t\tjqueryMap.$header.addClass(\"hidden\");\n\t}", "title": "" }, { "docid": "de4bf46b95b3552cf733cbb1d49a1b44", "score": "0.5286025", "text": "function file_exist_error_event() {\n showError(\"event_error_message2\", \"The file path already exists!\");\n}", "title": "" }, { "docid": "3f7be46c4d58246aa4ee38769b979a0d", "score": "0.52739555", "text": "function fileExists(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('HEAD', url, false);\n xhr.send();\n\n if (xhr.status == \"404\") {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "7c5b54efaf3ecb7186dd044217d7eee0", "score": "0.52629703", "text": "function checkIfFile(){\n\t\tconsole.log(\"In checkIfFile\");\n\t\t\t fileName = $(\"#fileSelect\").val();\n\t\t\tif(fileName != \"\"){\n\t\t\t\tcheckName(fileName);\n\t\t\t}\n\t}", "title": "" }, { "docid": "01db52b717dafbe1fa03405008ed3c14", "score": "0.5217969", "text": "function warnIfTemplateNotFound (name) {\n if (name === false || _.isUndefined(name))\n return;\n else if (!Template[name])\n warn(\"A template named '\", String(name), \"' hasn't been defined yet.\");\n }", "title": "" }, { "docid": "f11003c5c7fafb1feb9f1ebdeb7f744f", "score": "0.52126634", "text": "function isFileOrFail(path, message) {\n if (!isFile(path)) {\n throw new Error(message);\n }\n return true;\n}", "title": "" }, { "docid": "541d4e4dd7f92ec3fb7cd526a0edac93", "score": "0.5173271", "text": "function fileExists(fileName,storageRootEntry,callback) {\n\t\t\n\t\t// default values management\n\t\tif (typeof(storageRootEntry) === 'undefined'){return;}\n\t\tfileName = typeof(fileName) !== 'undefined' ? fileName : '';\n\t\tcallback = typeof(callback) !== 'undefined' ? callback : nullFunction();\n\t\n storageRootEntry.getFile(fileName, {create : false}, function() {\n\t\t\tconsole.log(\"File \"+fileName+\" DOES exist\");\n\t\t\t// ..do nothing\n }, function() {\n\t\t\tconsole.log(\"File \"+fileName+\" does NOT exist\");\n\t\t\tcallback(); // return true\n });\n }", "title": "" }, { "docid": "2d1909b5329cd955de7d15c3f155a701", "score": "0.5143239", "text": "function onerror() {\n throw (\"not found: \" + this.src);\n }", "title": "" }, { "docid": "f6088cb7dbd060869ae040042698b0b7", "score": "0.5116378", "text": "fileExists(path){\n var filepath = RNFS.DocumentDirectoryPath + path;\n return RNFS.exists(filepath);\n }", "title": "" }, { "docid": "a028cebd9dd65814c100ab8edc73cce5", "score": "0.5083475", "text": "function ProcessFilePath(filename,response){\n fs.exists(filename, function (exists) {\n if(exists){\n var stats;\n fs.stat(filename,function(err,stats){\n switch (true){\n case stats.isFile():\n // if url is a file.\n ProcessFile(filename,response);\n break;\n case stats.isDirectory():\n //if url is a folder\n fs.readdir(filename,function(err,files){\n if(err){\n response.writeHead(500, { \"Content-Type\": \"text/plain\" });\n response.end(\"Read Path:\" + filename +\" Error: \" + error);\n }else{\n var html = \"\";\n for(var i=0;i<files.length;i++){\n\n if(config.defaultfile.contains(files[i])){\n ProcessFile(filename+\"/\"+files[i],response);\n return;\n }\n\n html +='<a href=\"/'+ filename.slice(6,filename.length) +\"/\" +files[i]+'\">'+files[i] +\"</a><br>\";\n }\n response.writeHead(200, { \"Content-Type\": \"text/html\" });\n console.log(files);\n response.end(html,\"utf-8\");\n }\n });\n break;\n }\n });\n }else{\n ProcessFile(config.rootPath +'404.html',response);\n }\n });\n}", "title": "" }, { "docid": "3fffd8540e71f604e6648d5c6ae644a4", "score": "0.50496954", "text": "async function fileReject() {\n (0, _vegaUtil.error)('No file system access.');\n}", "title": "" }, { "docid": "8442fabf5fbe2906bd7d2835f82fff9d", "score": "0.50446224", "text": "async _handleFileExists(path) {\n\t\tlet text = `Target file ${path} already exists`;\n\t\tlet title = \"File exists\";\n\t\tlet buttons = [\"overwrite\", \"overwrite-all\", \"skip\", \"skip-all\", \"abort\"];\n\t\treturn this._processIssue(\"overwrite\", { text, title, buttons });\n\t}", "title": "" }, { "docid": "559ff3cebf55092897f36afb9f98ca96", "score": "0.50232", "text": "function file_exist_error() {\n showError(\"upload_error_message2\", \"The file path already exists!\");\n}", "title": "" }, { "docid": "3e3d3a56e450cee8413d33d430cc0fd1", "score": "0.5014881", "text": "function checkForRssFile () {\n fs.exists(configFilename, function (exists) {\n if (!exists) {\n return next(new Error('missing rss file ' + configFilename));\n }\n\n next(null, configFilename);\n });\n}", "title": "" }, { "docid": "0fc57257d428906a42a623dc40bd1c19", "score": "0.501184", "text": "function createNotFoundDirectoryListener () {\n\t return function notFound () {\n\t this.error(404)\n\t }\n\t}", "title": "" }, { "docid": "0fc57257d428906a42a623dc40bd1c19", "score": "0.501184", "text": "function createNotFoundDirectoryListener () {\n\t return function notFound () {\n\t this.error(404)\n\t }\n\t}", "title": "" }, { "docid": "c022ea8df4937c17ec5372679dd9f6e3", "score": "0.49970305", "text": "onNotFound() {\n this.response.status(ExpressHandler.httpStatus.notFound);\n this.response.json(null);\n }", "title": "" }, { "docid": "72c2b5771b91094fc01aed045d7aefca", "score": "0.4996294", "text": "function hasFile(filename) {\n if (!(filename in store.files)) {\n recordFileErrors([`File \"${filename}\" is not exists.`]);\n return;\n }\n}", "title": "" }, { "docid": "0b1feec4d462a1bf997f29799972e463", "score": "0.49953368", "text": "function checkFileExist(keyword) {\n var http = new XMLHttpRequest();\n\n http.open('HEAD', `asset/photo-${keyword}.jpg`, false);\n http.send();\n if (http.status === 200) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "f70164767ff7a68976e36255ad39feb3", "score": "0.49833694", "text": "function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd) {\n if (filesByName.contains(path)) {\n var file_1 = filesByName.get(path);\n // try to check if we've already seen this file but with a different casing in path\n // NOTE: this only makes sense for case-insensitive file systems\n if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {\n reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd);\n }\n // If the file was previously found via a node_modules search, but is now being processed as a root file,\n // then everything it sucks in may also be marked incorrectly, and needs to be checked again.\n if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth == 0) {\n sourceFilesFoundSearchingNodeModules.set(file_1.path, false);\n if (!options.noResolve) {\n processReferencedFiles(file_1, isDefaultLib);\n processTypeReferenceDirectives(file_1);\n }\n modulesWithElidedImports.set(file_1.path, false);\n processImportedModules(file_1);\n } else if (file_1 && modulesWithElidedImports.get(file_1.path)) {\n if (currentNodeModulesDepth < maxNodeModuleJsDepth) {\n modulesWithElidedImports.set(file_1.path, false);\n processImportedModules(file_1);\n }\n }\n return file_1;\n }\n // We haven't looked for this file, do so now and cache result\n var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) {\n if (refFile !== undefined && refPos !== undefined && refEnd !== undefined) {\n fileProcessingDiagnostics.add(ts.createFileDiagnostic(refFile, refPos, refEnd - refPos, ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));\n } else {\n fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));\n }\n });\n filesByName.set(path, file);\n if (file) {\n sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);\n file.path = path;\n if (host.useCaseSensitiveFileNames()) {\n // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case\n var existingFile = filesByNameIgnoreCase.get(path);\n if (existingFile) {\n reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd);\n } else {\n filesByNameIgnoreCase.set(path, file);\n }\n }\n skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib;\n if (!options.noResolve) {\n processReferencedFiles(file, isDefaultLib);\n processTypeReferenceDirectives(file);\n }\n // always process imported modules to record module name resolutions\n processImportedModules(file);\n if (isDefaultLib) {\n files.unshift(file);\n } else {\n files.push(file);\n }\n }\n return file;\n }", "title": "" }, { "docid": "99ce96a332de6884cb8fba944400a4ef", "score": "0.49675596", "text": "function sendNotFoundResponse(res, path) {\n fs.readFile(templateDir + '/notfound.template', (err, data) => {\n if (err) {\n console.error(err);\n res.statusCode = 500;\n res.end();\n } else {\n res.statusCode = 404;\n res.end(data.toString().replace('{{message}}', path));\n }\n });\n}", "title": "" }, { "docid": "3b0327c1599fbf43eea08fae4d70ccc1", "score": "0.4958896", "text": "function file_exist_error() {\n showError(\"add_error_message1\", \"The file path already exists!\");\n}", "title": "" }, { "docid": "b60efb611fa7e28003f82ed441c5159e", "score": "0.49527216", "text": "errorHandler() {\r\n this.handleMissing();\r\n }", "title": "" }, { "docid": "2f1dcab51cfaeb540141a36ce59f0073", "score": "0.4950642", "text": "function notFound(req, res, next) {\n next(createError(ERR_PATH_NOT_FOUND));\n}", "title": "" }, { "docid": "d7e69fefaef5d1fd8987fcdaaf5032e7", "score": "0.4943707", "text": "loadFiles() {\n fetch('/api/files')\n .then(res => res.json())\n .then(files => {\n if (files.message) {\n console.log('No Files');\n this.setState({ files: [] })\n } else {\n this.setState({ files })\n }\n });\n }", "title": "" }, { "docid": "200ae7f95980e79b4636da33c0bb7e66", "score": "0.49418694", "text": "function handleNotFound(request, response) {\n response.status = 404;\n response.contentType = \"text/plain\";\n response.setBody('Not found');\n return response;\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "3b7ef016a90e2148fb1caf7634536e84", "score": "0.49388635", "text": "function createNotFoundDirectoryListener () {\n return function notFound () {\n this.error(404)\n }\n}", "title": "" }, { "docid": "819464c4ee67680f72f1873c33a7af55", "score": "0.49387133", "text": "function onFileChanged(event) {\n\n if (event.target.files.length == 0)\n setFile(null)\n \n else\n setFile(event.target.files[0])\n}", "title": "" }, { "docid": "c9bb50a62a7612be86b43ecf2a755056", "score": "0.49311945", "text": "function _404() {\n\t\tif(view == 'json')\n\t\t\tres.status(404).end();\n\t\telse {\n\t\t\tres.render('404', {\n\t\t\t\tmessage: \"Sorry, but the question doesn't seem to be \" +\n\t\t\t\t\t\"available\"\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "d277ad2cbd1757984c511388f140225b", "score": "0.49223566", "text": "function noNames()\n{\n loadcnt--;\t\t// decrement number of outstanding responses\n if (loadcnt > 0)\n\t\treturn;\t\t// do not refresh if more outstanding responses\n hideLoading();\t// hide loading indicator\n\n alert('chooseIndivid.js: noNames: No response file from server script getIndivNamesXml.php.');\n}", "title": "" }, { "docid": "8f94a44b660b9a41874b4b2e387fb63f", "score": "0.49077898", "text": "function errorHandle(err, path, callback) {\n\t//Unknown file or directory\n\tif (err.code == 'ENOENT' || err.code == 'ENOTDIR') {\n\t\tgetFile(config.system_pages.http404, function(content) {\n\t\t\tcallback(content);\n\t\t});\n\t\treturn;\n\t}\n\t//If it's a directory\n\tif (err.code = 'EISDIR') {\n\t\tindexof.genIndexOf(path, callback) //Generate index page and show it\n\t\treturn;\n\t}\n\telse {\n\t\tcallback(err.code);\n\t\treturn;\n\t}\n}", "title": "" }, { "docid": "526a1cf3b7a3e00c46e8e33ac6d9a608", "score": "0.49018016", "text": "function onFileError(event) {\n console.log('file error: ' + event.target.error.code);\n }", "title": "" }, { "docid": "855b591f8ffb04bed589754e23be7b29", "score": "0.48921403", "text": "function _noNeed(fn) { var ext = fn.split(\".\").pop().toLowerCase(); return \"png,jpg,jpeg,zip\".indexOf(ext)!=-1; }", "title": "" }, { "docid": "a80c608cd695d50454ea15939e99b40a", "score": "0.48910552", "text": "function fileExists(path) {\n return stat(path).then(function (stat) { return stat.isFile(); }, function () { return false; });\n }", "title": "" }, { "docid": "a80c608cd695d50454ea15939e99b40a", "score": "0.48910552", "text": "function fileExists(path) {\n return stat(path).then(function (stat) { return stat.isFile(); }, function () { return false; });\n }", "title": "" }, { "docid": "7b0f010a9294b118095a85a30c284e01", "score": "0.4889145", "text": "function isFileExisting(filePath) {\n try {\n fs.statSync(filePath);\n return true;\n }\n catch (err) {\n return false;\n }\n}", "title": "" }, { "docid": "edc1b8519d4dac99d09b22e2dcd6d47a", "score": "0.48828846", "text": "function createNotFoundDirectoryListener() {\n return function notFound() {\n this.error(404);\n };\n}", "title": "" }, { "docid": "0579b5d81ecf37f6de849af27521078e", "score": "0.48793262", "text": "function CheckFileExists(fileName) {\n var endpointUrl = appWebUrl + \"/_api/web/lists/getbytitle('Commutation Documents')/rootfolder/files?$filter=Name eq '\" + fileName + \"'&$expand=ListItemAllFields,ListItemAllFields/ContentType\";\n return $.ajax({\n url: endpointUrl,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" }\n });\n }", "title": "" }, { "docid": "dae9f9a1a57c17be6363bc31e4b0c289", "score": "0.4878259", "text": "onstat (opts, callback) {\n if (!opts.st.isFile() && !opts.st.isDirectory()) {\n return callback()\n }\n\n return super.onstat(opts, callback)\n }", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "7a6ad2e4c5ccc78ffc2e32c17a23a3e0", "score": "0.4873786", "text": "setFileDetector() {}", "title": "" }, { "docid": "b22c8da14cfe82dc663a05fbe947acd2", "score": "0.48604247", "text": "async function fileReject() {\n (0,vega_util__WEBPACK_IMPORTED_MODULE_0__.error)('No file system access.');\n}", "title": "" }, { "docid": "508a43af8ad2dccd7dde6ae1999b2a05", "score": "0.48523253", "text": "async function fileReject() {\n Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"error\"])('No file system access.');\n}", "title": "" }, { "docid": "86532d9325bd3c2792979ec1faba6e4c", "score": "0.4850757", "text": "function createNotFoundDirectoryListener() {\n return function notFound() {\n this.error(404)\n }\n}", "title": "" }, { "docid": "7196f3c02e2af851eaa649d08940e973", "score": "0.48486644", "text": "function notFound(res) {\n res.writeHead(404, 'not found', { 'Content-Type': 'text/plain' });\n res.end('404 Not Found');\n}", "title": "" }, { "docid": "5790e379030c54860822d7ac8ce9778f", "score": "0.48450854", "text": "function isFileOrNot(src) {\n return fs.lstatSync(src).isFile();\n}", "title": "" }, { "docid": "eadf761fc3278c8df0f4c39dabf75b78", "score": "0.48351818", "text": "function checkEventsFile(name) {\n try {\n fs.readFile(name)\n } catch (error) {\n fs.writeFileSync(name, '')\n }\n}", "title": "" }, { "docid": "248d3704621043dc4509846974b779b2", "score": "0.48328513", "text": "static isExistFile(filePath) {\n return fs.existsSync(filePath);\n }", "title": "" }, { "docid": "f6377880f51f8bee4e37c0702530f1af", "score": "0.4829823", "text": "function notFound(data) {\n\t$(\"#results\").append(languageSettings('searchNotFound', localStorage.getItem('language')));\n}", "title": "" }, { "docid": "941c9a07d19270fc2d327b8dd87c9f22", "score": "0.48281574", "text": "function findFileByUrl(files, url) {\n // console.log(`findFileByUrl([${files.length}], '${url}')`, files);\n if (files.length === 0) { return msgAsFile('...', 'Loading files...'); }\n const matches = filter(files, file => urlFrom(file.name) === url );\n if (matches.length === 0) {\n console.warn(\"No file found matching `\"+ url +\"`\");\n return msgAsFile('Not Found', `No file found with name \"${url}\"`);\n }\n if (matches.length > 1) { console.warn(\"more than one match for `targetSlug`, that's weird. Whelp, returning the first one.\", matches); }\n return matches[0];\n}", "title": "" }, { "docid": "93bb78e96454c973739c355b5b352dd5", "score": "0.48190644", "text": "function handleFullHkError() {\n\tcountFilesGot++; ///For now will just do this silly thing\t\n\tif(countFilesNeeded==countFilesGot) {\n\t actuallyDrawTheStuff(awareControl);\n\t}\n }", "title": "" }, { "docid": "d02fdd71e67603902f70512cf71e4422", "score": "0.4806713", "text": "function FindPath() {}", "title": "" }, { "docid": "51a633fbcbcdb33b66c67c88a3965740", "score": "0.47840285", "text": "function findSourceFile(fileName, path, isDefaultLib, refFile, refPos, refEnd, packageId) {\n if (filesByName.has(path)) {\n var file_1 = filesByName.get(path);\n // try to check if we've already seen this file but with a different casing in path\n // NOTE: this only makes sense for case-insensitive file systems\n if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {\n reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd);\n }\n // If the file was previously found via a node_modules search, but is now being processed as a root file,\n // then everything it sucks in may also be marked incorrectly, and needs to be checked again.\n if (file_1 && sourceFilesFoundSearchingNodeModules.get(file_1.path) && currentNodeModulesDepth === 0) {\n sourceFilesFoundSearchingNodeModules.set(file_1.path, false);\n if (!options.noResolve) {\n processReferencedFiles(file_1, isDefaultLib);\n processTypeReferenceDirectives(file_1);\n }\n modulesWithElidedImports.set(file_1.path, false);\n processImportedModules(file_1);\n } else if (file_1 && modulesWithElidedImports.get(file_1.path)) {\n if (currentNodeModulesDepth < maxNodeModuleJsDepth) {\n modulesWithElidedImports.set(file_1.path, false);\n processImportedModules(file_1);\n }\n }\n return file_1;\n }\n // We haven't looked for this file, do so now and cache result\n var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) {\n if (refFile !== undefined && refPos !== undefined && refEnd !== undefined) {\n fileProcessingDiagnostics.add(ts.createFileDiagnostic(refFile, refPos, refEnd - refPos, ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));\n } else {\n fileProcessingDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage));\n }\n }, shouldCreateNewSourceFile);\n if (packageId) {\n var packageIdKey = ts.packageIdToString(packageId);\n var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);\n if (fileFromPackageId) {\n // Some other SourceFile already exists with this package name and version.\n // Instead of creating a duplicate, just redirect to the existing one.\n var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path);\n redirectTargetsSet.set(fileFromPackageId.path, true);\n filesByName.set(path, dupFile);\n sourceFileToPackageName.set(path, packageId.name);\n files.push(dupFile);\n return dupFile;\n } else if (file) {\n // This is the first source file to have this packageId.\n packageIdToSourceFile.set(packageIdKey, file);\n sourceFileToPackageName.set(path, packageId.name);\n }\n }\n filesByName.set(path, file);\n if (file) {\n sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);\n file.path = path;\n if (host.useCaseSensitiveFileNames()) {\n var pathLowerCase = path.toLowerCase();\n // for case-sensitive file systems check if we've already seen some file with similar filename ignoring case\n var existingFile = filesByNameIgnoreCase.get(pathLowerCase);\n if (existingFile) {\n reportFileNamesDifferOnlyInCasingError(fileName, existingFile.fileName, refFile, refPos, refEnd);\n } else {\n filesByNameIgnoreCase.set(pathLowerCase, file);\n }\n }\n skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib;\n if (!options.noResolve) {\n processReferencedFiles(file, isDefaultLib);\n processTypeReferenceDirectives(file);\n }\n // always process imported modules to record module name resolutions\n processImportedModules(file);\n if (isDefaultLib) {\n files.unshift(file);\n } else {\n files.push(file);\n }\n }\n return file;\n }", "title": "" }, { "docid": "c97235e49afa5c28b88419fdafa02acf", "score": "0.4783354", "text": "setFileDetector() { }", "title": "" }, { "docid": "edb7711f1b0fa9f1238db996b23795cd", "score": "0.47730672", "text": "function notFound(res) {\r\n var body = 'Not Found';\r\n res.setHeader('Content-Type', 'text/plain');\r\n res.setHeader('Content-Length', body.length);\r\n res.statusCode = 404;\r\n res.end(body);\r\n}", "title": "" }, { "docid": "2e6e76f817b7499b1c96480905cfd553", "score": "0.4772865", "text": "function funkyStatFile(path, callback) { \n callback = safeReturn(callback); // Make sure our callback *always* fires once.\n if (Math.random() > 0.92) return; // Sometimes it just doesn't work right?\n fs.stat(path, callback); // Make the real call.\n if (Math.random() > 0.92) fs.stat(path, callback); // Twice for fun, right?\n}", "title": "" }, { "docid": "50102c30bb0f961a1d8de898ac0db4cb", "score": "0.47705802", "text": "async function findFurthestFile(fileName, pathToDirectory, stopOnMissing = false) {\n let currentPath = _nuclideUri.default.resolve(pathToDirectory);\n\n let result = null;\n\n for (;;) {\n const fileToFind = _nuclideUri.default.join(currentPath, fileName); // eslint-disable-next-line no-await-in-loop\n\n\n const hasFile = await exists(fileToFind);\n\n if (!hasFile && stopOnMissing || _nuclideUri.default.isRoot(currentPath)) {\n return result;\n } else if (hasFile) {\n result = currentPath;\n }\n\n currentPath = _nuclideUri.default.dirname(currentPath);\n }\n}", "title": "" }, { "docid": "e06466198c6f398329df2cd608b09044", "score": "0.47668424", "text": "function exists(f) {\n // and if it does..\n // it checks it its a directory\n if ($f.iD(f)) {\n //and if it is..\n // then it looks looks for the index html IN that dir\n f += '/index.html'\n }\n $f.bn(f, function (z, f) {\n //so now it has a file and so it\n // writes a 200 header\n // //and writes the file OUT to binary\n // and ends (sends)\n p.wHwBE(200, f)\n })\n }", "title": "" }, { "docid": "978e0d71e5dc02915765a2225c480b2e", "score": "0.4766287", "text": "function doesFileExist(filePath) {\n\tfilePath = convertFilePath(filePath);\n\tfilePath = filePath.replace(\"file:///\", \"\");\n\tif (!fs.existsSync(filePath)) {//check if Mac OS\n\t\tlet filePath = \"/\" + filePath;\n\t}\n\treturn fs.existsSync(filePath);\n}", "title": "" } ]
4baa0b9806d0cea9e010f278f40b3fcf
let result = regex.exec(mathString);
[ { "docid": "6ae7579fcb20cd212297380ed03433fb", "score": "0.0", "text": "function sendToOperator(match, p1, p2, p3) {\n return `${Math.round(operator(p2, p1, p3) * 10000000000) / 10000000000}`;\n }", "title": "" } ]
[ { "docid": "21f80cf3f370fce0d076ae22f00004fe", "score": "0.6392274", "text": "function cleanExpression(expression){\n //temporarily make 'tan', 'sqrt' unmatchable ('t' is a variable name)\n //hide functions inside of parentheses to make identification easier\n //expression = expression.replace( /(tan|sin|cos|sqrt|pow|arctan|arcsin|arccos)\\(.*?\\)/g, \"($&)\");\n\n expression = expression.replace( /tan/g, \"TAN\")\n .replace( /sqrt/g, \"SQRT\")\n .replace( /pow/g, \"POW\");\n //alert(expression.match(/\\(.*?\\)[\\+\\-\\*\\/]\\(.*?\\)/));//doesn not work... ^2 throws a wrench in it\n/* if( expression.match( /([xytpw]|[0-9]*|\\(.*\\))\\^(\\(.*\\)|[xytpw0-9]*)/g ) ){\n var matchExp = expression.match( /([xytpw]|[0-9]*|\\([xyptw0-9][\\+\\-\\*\\/xyptw0-9]*\\)|sin\\(.*\\)|cos\\(.*\\))\\^(\\(.*\\)|[xytpw]|[0-9]*)/g ); //TODO the parenthesis match is too general, allows multiple parentheses to be contained in eachother\n var str = new String(matchExp);\n alert(str);\n var matches = str.split(\",\");//(/\\(.*\\)[\\+\\-\\*\\/]\\(.*\\)/);\n alert(matches);\n for(var i=0; i < matches.length; i++){\n var pieces = matches[i].split(\"^\");\n alert(matches[i]);\n alert(pieces);\n var replaceStr = \"POW(\"+pieces[0]+\",\"+pieces[1]+\")\";\n expression = expression.replace( matches[i], replaceStr);\n }\n alert(expression);\n }*/\n //alert(expression.match( /([xytpw]|[0-9])([^*+-/,).0-9])/ ));\n //matches for implicit multiplication\n //PATTERN = if (var | constant) not followed by (operation | end parenthesis | comma | decimal | constant) then insert *\n //TODO pattern works fine for representations such as 9x, but not x9...\n if( expression.match( /([xytpw)]|[0-9])(?=[^\\^*+-/,).0-9])/ ) ){\n //alert(expression.match( /([xytpw)]|[0-9])(?=[^*+-/,).0-9])/g));\n expression = expression.replace( /([xytpw)]|[0-9])(?=[^\\^*+-/,).0-9])/g, '$&*' );\n alert(expression);\n }\n //restore tan, sqrt and return\n expression = expression.replace( /TAN/g, \"tan\")\n .replace( /SQRT/g, \"sqrt\")\n .replace( /POW/g, \"pow\");\n alert(expression);\n return expression;\n}", "title": "" }, { "docid": "19faf22c476e08e7f2f51c447f10b90b", "score": "0.6353335", "text": "function mysteriousMath(text) {\n return text.replace(/[+\\-*\\/]/g, '?');\n}", "title": "" }, { "docid": "caa8f0d5e179f0f7fb3f061e5338473c", "score": "0.630096", "text": "function floattr(floats, regex) {\n if (regex.test(floats)) {\n let result =floats.match(regex);\n // console.log(`It's a match`);\n console.log(result)\n return result.forEach(tag => console.log(tag));\n } else\n console.log('No match found');\n\n}", "title": "" }, { "docid": "88e95054d30f4aec42269a4331bbbb14", "score": "0.6223045", "text": "function regex(){}", "title": "" }, { "docid": "1c0d6711e6b6277a9b1b9e5ee0a93ebd", "score": "0.6094123", "text": "doTheMath(){\n let answer = this.deconstructed.join('');\n return eval(answer);\n }", "title": "" }, { "docid": "77f49ea07746ce70410df2d33210d69e", "score": "0.60777545", "text": "function calculateMathExpression(expr) {\n var parsed = parseDecimal(expr);\n var expression = [];\n var finalResult = \"\"; \n var regex = RegExp('^\\-?[0-9](([-+\\/*]\\-?[0-9]+)?([.,][0-9]+)?)*?$');\n\n if (regex.test(parsed.join(\"\"))) \n { finalResult = eval(parsed.join(\"\")); }\n \n else { \n parsed.forEach((val) => {\n if (!isNaN(parseInt(val))) { expression.push(val); }\n\n else { \n if (isNaN(parseInt(expression[expression.length-1]))) { \n expression[expression.length-1] = val; \n }\n else { expression.push(val); }\n } \n });\n\n finalResult = expression.join(\"\")\n }\n \n return finalResult;\n}", "title": "" }, { "docid": "848abc74a98c8cea426d811b83cded4e", "score": "0.60696614", "text": "function mysteryMath(text) {\n return text.replace(/[+\\-\\/*]/, '?');\n}", "title": "" }, { "docid": "10ad24420c9efc1c1a590787737d6db3", "score": "0.60621905", "text": "function myParse(expression)\n{\n\t\ttheString = stripSpaces(expression);\t\t\n\t\twith (Math)\n\t\t\t{\n\t\t// now convert formatting from GC formatting\t\t\n\t\ttheString = putProduct(theString);\n\t\ttheString = replaceSubstring(theString,\"log\",\"(1/log(10))*log\");\n\t\ttheString = replaceSubstring(theString,\"ln\",\"log\");\n\t\t\twhile (powCheck(theString))\n\t\t\t\t{\n\t\t\t\ttheString = powFix2(theString);\n\t\t\t\t// alert (theString);\n\t\t\t\t}\n\t\ttheString = replaceChar(theString,\"X\",\"x\");\n\t\t\t} // with Math\n\treturn(theString);\n} // myParse", "title": "" }, { "docid": "0b0f3894b90a119b105d16678ded5003", "score": "0.6028001", "text": "match (regex) {\n return this.text.match(regex)\n }", "title": "" }, { "docid": "1a35fc5f1d35382e944221eed71000fb", "score": "0.60042995", "text": "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match ALL occurrences of numbers in a string.\n */\n\n let re = new RegExp('\\\\d+', 'g')\n /*\n * Do not remove the return statement\n */\n return re;\n}", "title": "" }, { "docid": "e074429356cfefc38a64e228993e68e0", "score": "0.5985098", "text": "function evaluation(expression) {\n\n function evaluation(expression) {\n var arr = [],\n signo = [],\n index = 0,\n operacion = true\n var chars = expression.split(\"\")\n arr[index] = \"\"\n for (var i = 0; i < chars.length; i++) {\n if (chars[i] !== \".\" && !operacion && isNaN(parseInt(chars[i]))) {\n signo[index] = chars[i]\n index++\n\n arr[index] = \"\"\n operacion = true\n }\n\n else {\n arr[index] += chars[i]\n operacion = false\n }\n }\n expression = parseFloat(arr[0])\n for (var j = 0; j < signo.length; j++) {\n var numero = parseFloat(arr[j + 1])\n if (signo[0] == \"+\") {\n expression += numero\n }\n if (signo[0] == \"*\") {\n expression *= numero\n }\n if (signo[0] == \"/\") {\n expression /= numero\n }\n if (signo[0] == \"-\") {\n expression -= numero\n }\n }\n console.log(\"\")\n return result\n }\n\n return -1\n}", "title": "" }, { "docid": "08a617686ab18330a315c33f5125ca52", "score": "0.5964675", "text": "function myFunction5() {\n\n var str = \"Is this his gg\";\n console.log('string ist :' + str);\n\n var patt1 = /is$/g;\n console.log(patt1);\n \n var result1 = str.match(patt1);\n console.log('The Result is :' + result1)\n\n var patt2 = /gg$/g;\n console.log(patt2);\n\n var result2 = str.match(patt2);\n console.log('The Result is :' + result2)\n\n\n document.getElementById(\"demo5\").innerHTML = result2;\n }", "title": "" }, { "docid": "b3b1b21e77f11096abee118102012be7", "score": "0.5927836", "text": "function exec(regex) {\n\t\treturn regex.exec(Detectizr.browser.userAgent);\n\t}", "title": "" }, { "docid": "6a490286a65e13beca6301683c6357a2", "score": "0.5916352", "text": "function regexOps (eq1, eq2, eq3, numOfEquations) {\n\tvar equation, // This is the equation that is being inputted by the user. It will undergo many algorithms and a long journey ahead.\n\t\tfaultyEquation = 0, // A bunch of checks will determine if the equation is faulty, by changing this number.\n\t\tquickFaulty = true, // This is a NOT gate. It will turn false when a number is detected (in one of the checks).\n\t\tvalidNumbers = \"0123456789\", // This is the numbers that will be used to detect if it exists in the equation.\n\t\tvalidNum, // This just needs to be declared before the for in loop.\n\t\tregexString, // This variable will change depending on what form of the equation was detected.\n\t\tmatch = null, // When the regex loop runs, it will send the match to this variable.\n\t\tmatches = [], // This is an array that will contain the numbers returned from each match.\n\t\tfinalAns = {}; // This is the object that will be used to be sent to Jason's algorithms.\n\n\t// Repeat with every equation. Length - 1 because we are accounting for the argument numOfEquations.\n\tfor (i = 0; i < arguments.length - 1; i++) {\n\t\t// Reset the vars to account for the next equation that is inputted by the user.\n\t\tequation = arguments[i];\n\t\tfaultyEquation = 0;\n\t\tquickFaulty = true;\n\t\tmatch = null;\n\t\tmatches = [];\n\t\tfinalAns = {};\n\t\tconsole.log(equation);\n\n\t\t// In order to check if the equation is valid, first locate all the needed characters in an equation.\n\t\t// The location of the characters will also determine what form the equation is in.\n\t\tvar xLoc = equation.indexOf(\"x\"),\n\t\t\tyLoc = equation.indexOf(\"y\"),\n\t\t\tzLoc = equation.indexOf(\"z\"),\n\t\t\tplusLoc = equation.indexOf(\"+\"),\n\t\t\tminusLoc = equation.indexOf(\"-\"),\n\t\t\tequalsLoc = equation.indexOf(\"=\");\n\n\t\t// Make sure the equation is valid.\n\t\tfaultyEquation = (xLoc < 0) ? 1 : faultyEquation;\n\t\tfaultyEquation = (yLoc < 0) ? 2 : faultyEquation;\n\t\tfaultyEquation = (plusLoc < 0 && minusLoc < 0) ? 3 : faultyEquation;\n\t\tfaultyEquation = (equalsLoc < 0) ? 4 : faultyEquation;\n\n\t\t// If there are 3 equations inputted, check for a z.\n\t\tif (numOfEquations === 3) {\n\t\t\tfaultyEquation = (zLoc < 0) ? 5 : faultyEquation;\n\t\t}\n\n\t\t// Make sure there are numbers in the equation.\n\t\tfor (validNum in validNumbers.split(\"\")) {\n\t\t\tif (equation.indexOf(validNum) > -1) {\n\t\t\t\tquickFaulty = false;\n\t\t\t}\n\t\t}\n\t\tfaultyEquation = (quickFaulty) ? 6 : faultyEquation;\n\t\tif (faultyEquation < 1) {\n\t\t\tconsole.log(\"No errors detected with given equation.\");\n\t\t} else {\n\t\t\tconsole.log(\"Equation is faulty. Here is the error ID (check on the source code to identify):\" + faultyEquation);\n\t\t}\n\n\t\t// Find out what linear form this input is in.\n\t\t// TODO: Make a more complicated detection algorithm that uses three arrays.\n\t\tif (xLoc < equalsLoc) {\n\t\t\t// Standard form detected.\n\t\t\tconsole.log(\"Standard form detected.\");\n\n\t\t\t// Regex it to return only numbers.\n\t\t\tregexString = /([0-9.\\/]*) ? ?x ? ?\\+ ? ?([\\+\\-]*) ? ?([0-9.\\/]*) ? ?y ? ?\\= ? ?([\\+\\-]*) ? ?([0-9.\\/]*)/g;\n\n\t\t\twhile ((match = regexString.exec(equation)) !== null) {\n\t\t\t\tif (match.index === regexString.lastIndex) {\n\t\t\t\t\tregexString.lastIndex++;\n\t\t\t\t}\n\t\t\t\tmatches = [\n\t\t\t\t\tmatch[1], // This is A in: Ax + By = C.\n\t\t\t\t\tmatch[2], // This is either + or - in: Ax +/- By = C.\n\t\t\t\t\tmatch[3], // This is B in: Ax + By = C.\n\t\t\t\t\tmatch[4], // This is either + or - in: Ax + By = +/- C.\n\t\t\t\t\tmatch[5] // This is C in: Ax + By = C.\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t// Process the matches to remove unnecessary characters.\n\t\t\tfinalAns.a = Number(matches[0]);\n\t\t\tfinalAns.b = (matches[1] === \"-\") ? Number(matches[1] + matches[2]) : Number(matches[2]);\n\t\t\tfinalAns.c = (matches[3] === \"-\") ? Number(matches[3] + matches[4]) : Number(matches[4]);\n\t\t} else if (plusLoc > equalsLoc && minusLoc > equalsLoc) {\n\t\t\t// Y-intercept form detected.\n\t\t\tconsole.log(\"Y-intercept form detected.\");\n\n\t\t\t// Find the slope and y-intercept.\n\t\t\tregexString = /y ? ?= ? ?([\\+\\-]*) ? ?([0-9.\\/]*) ? ?x ? ?([\\+\\-]*) ? ?([0-9.\\/]*)/g;\n\t\t\twhile ((match = regexString.exec(equation)) !== null) {\n\t\t\t\tif (match.index === regexString.lastIndex) {\n\t\t\t\t\tregexString.lastIndex++;\n\t\t\t\t}\n\n\t\t\t\tmatches = [\n\t\t\t\t\tmatch[1], // This is either + or - in: y = +/- mx + b.\n\t\t\t\t\tmatch[2], // This is m in: y = mx + b.\n\t\t\t\t\tmatch[3], // This is either + or - in: y = mx +/- b.\n\t\t\t\t\tmatch[4] // This is b in: y = mx + b.\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t// Process the matches to remove unnecessary characters.\n\t\t\tfinalAns.slope = (matches[0] === \"-\") ? (matches[0] + matches[1]) : matches[1];\n\t\t\tfinalAns.b = (matches[2] === \"-\") ? (matches[2] + matches[3]) : matches[3];\n\n\t\t\t// Convert to standard form. TODO\n\t\t} else if (plusLoc < equalsLoc || minusLoc < equalsLoc) {\n\t\t\t// Point-slope form detected.\n\t\t\tconsole.log(\"Point-slope form detected.\");\n\n\t\t\t// Find the y1, slope, and x1.\n\t\t\tregexString = /y ? ?\\+?([\\+\\-]*) ? ?([0-9.\\/]*) ? ?= ? ?([\\+\\-]*) ? ?([0-9.\\/]*) ? ?\\( ? ?x ? ?([\\+\\-]*) ? ?([0-9.\\/]*) ? ?\\)/g;\n\t\t\twhile ((match = regexString.exec(equation)) !== null) {\n\t\t\t\tif (match.index === regexString.lastIndex) {\n\t\t\t\t\tregexString.lastIndex++;\n\t\t\t\t}\n\n\t\t\t\tmatches = [\n\t\t\t\t\tmatch[1], // This is either + or - in: y +/- y1 = m(x - x1).\n\t\t\t\t\tmatch[2], // This is y1 in: y - y1 = m(x - x1).\n\t\t\t\t\tmatch[3], // This is either + or - in: y - y1 = +/- m(x - x1).\n\t\t\t\t\tmatch[4], // This is m in: y - y1 = m(x - x1).\n\t\t\t\t\tmatch[5], // This is either + or - in: y - y1 = m(x +/- x1).\n\t\t\t\t\tmatch[6] // This is x1 in: y - y1 = m(x - x1).\n\t\t\t\t];\n\t\t\t}\n\n\t\t\t// Process the matches to remove unnecessary characters.\n\t\t\tfinalAns.y1 = (matches[0] === \"-\") ? (matches[0] + matches[1]) : matches[1];\n\t\t\tfinalAns.slope = (matches[2] === \"-\") ? matches[2] + matches[3] : matches[3];\n\t\t\tfinalAns.x1 = (matches[4] === \"-\") ? (matches[4] + matches[5]) : matches[5];\n\n\t\t\t// Convert to standard form. TODO\n\t\t}\n\n\t\treturn finalAns;\n\t}\n}", "title": "" }, { "docid": "fab2fb59d99e5c734dfc901867237bf8", "score": "0.59123886", "text": "function parseMultiplicationExpressions(expression) {\n const numbersStr = expression.split('*');\n const numbers = numbersStr.map(str => parseDivisionExpressions(str));\n const initValue = 1.0;\n const result = numbers.reduce((acc, operand) => acc * operand, initValue);\n return result;\n}", "title": "" }, { "docid": "11911540d537b360e180613f971bf8a6", "score": "0.58320475", "text": "function evalRegex(input, expression, options) {\n var regex,\n matches = [],\n groups = [],\n m, a, i,\n loop = options ? options.toString().indexOf('g') >= 0: false;\n\n if (input && expression) {\n try {\n regex = new RegExp(expression, options);\n } catch (e) {\n return {\n error: ('' + e).split(':').pop()\n };\n }\n while ((m = regex.exec(input))) {\n matches.push({\n index: m.index,\n length: m[0].length\n });\n // because groups.concat(m) will add the Array as an object instead of its values\n for (i = 1, a = []; i < m.length; i++) {\n a.push(m[i]);\n }\n groups.push(a);\n if (!loop) break;\n }\n }\n return {\n matches: matches,\n groups: groups,\n input: input\n };\n }", "title": "" }, { "docid": "52b2eb3e420285dd5f4dc07d100eaa54", "score": "0.5818188", "text": "function run(regex, value, start) {\n regex.lastIndex = start || 0;\n return regex.exec(value);\n }", "title": "" }, { "docid": "cdc3821cea55a09236bb13f34b188882", "score": "0.5816524", "text": "function evaluateInput()\n{\n let expression = document.form.textview.value;\n\n try\n {\n document.form.textview.value = math.evaluate(expression);\n }\n\n catch\n {\n document.form.textview.value = \"err\";\n }\n\n}", "title": "" }, { "docid": "e4eba0f6e472384b0b6e924120d1cfad", "score": "0.57661664", "text": "function extractNumbers (text) {\n return parseFloat(text);\n}", "title": "" }, { "docid": "9c4667b3c373fd3c706239eda002d383", "score": "0.57632226", "text": "function replaceMath(text, math) {\n /**\n * Replace a math placeholder with its corresponding group.\n * The math delimiters \"\\\\(\", \"\\\\[\", \"\\\\)\" and \"\\\\]\" are replaced\n * removing one backslash in order to be interpreted correctly by MathJax.\n */\n let process = (match, n) => {\n let group = math[n];\n if (group.substr(0, 3) === '\\\\\\\\(' &&\n group.substr(group.length - 3) === '\\\\\\\\)') {\n group = '\\\\(' + group.substring(3, group.length - 3) + '\\\\)';\n }\n else if (group.substr(0, 3) === '\\\\\\\\[' &&\n group.substr(group.length - 3) === '\\\\\\\\]') {\n group = '\\\\[' + group.substring(3, group.length - 3) + '\\\\]';\n }\n return group;\n };\n // Replace all the math group placeholders in the text\n // with the saved strings.\n return text.replace(/@@(\\d+)@@/g, process);\n}", "title": "" }, { "docid": "6d9e4182fbc55466f826e6befb2b8754", "score": "0.57632005", "text": "function wordyMath (wordProblem) {\n const words = wordProblem.split(' ')\n\n // parse word problem and check if it includes \"plus, minus, multipled or divided\"\n if (words.includes('plus')) {\n return parseInt(words[2]) + parseInt(words[4])\n } else if (words.includes('minus')) {\n return parseInt(words[2]) - parseInt(words[4])\n } else if (words.includes('multiplied')) {\n return parseInt(words[2]) * parseInt(words[5])\n } else if (words.includes('divided')) {\n return parseInt(words[2]) / parseInt(words[5])\n } else {\n console.log('operator not found')\n }\n}", "title": "" }, { "docid": "ec0958490f43985f7d1d21e86af9095d", "score": "0.57586944", "text": "function findMatches(regex, originalStr) {\n\t// Variables:\n\tlet checkMatrix;\n\tlet matchedSigns = [];\n\n\twhile ((checkMatrix = regex.exec(originalStr)) !== null) { // MDN. RegEx.prototype.exec()\n\t\tlet matchIndex = checkMatrix.index;\n\t\tlet matchSign = checkMatrix[0];\n\t\tlet replaceSign = replacer(matchSign);\n\t\tlet positiveMatch = { matchIndex: matchIndex, matchSign: matchSign, replaceSign: replaceSign };\n\t\tmatchedSigns.push(positiveMatch);\n\t}\n\treturn matchedSigns;\n}", "title": "" }, { "docid": "7308f6b6c9a08bb731f5288f29af692b", "score": "0.5726693", "text": "function parser (regex, fun) {\n\t\treturn function (string) {\n\t\t\treturn regex.test(string) ? regex.exec(string).reduce(fun) : string;\n\t\t}\n\t}", "title": "" }, { "docid": "36e1c738d339c82e7d967e9d01d2cb1f", "score": "0.5723019", "text": "parseExpression(exp) {\r\n exp.replace(\" \", \"\"); // TODO: Now I simply delete all the space, may fix later\r\n var op_re = /\\+|-/;\r\n var term_array = exp.split(op_re);\r\n var op_array = exp.match(/\\+|-/g);\r\n if (op_array == null)\r\n op_array = []\r\n //console.log(term_array);\r\n var sgn = 1;\r\n var num_array = [], var_array = [];\r\n console.assert(term_array.length == op_array.length + 1)\r\n for (var i = 0; i < term_array.length; i++) {\r\n if (term_array[i] != \"\") {\r\n var num_i = term_array[i].match(/\\d+/)\r\n if (num_i == null)\r\n num_i = 1\r\n else\r\n num_i = num_i[0].valueOf()\r\n num_i = num_i * sgn;\r\n var var_i = term_array[i].match(/[a-z]+/)\r\n num_array.push(num_i)\r\n var_array.push(var_i)\r\n }\r\n if (i < op_array.length) {\r\n if (op_array[i] == \"+\")\r\n sgn = 1;\r\n else\r\n sgn = -1;\r\n }\r\n }\r\n return [num_array, var_array]\r\n }", "title": "" }, { "docid": "b86020c1577c7d1c3120af40b713c78c", "score": "0.56946564", "text": "function replaceMath(text, math) {\n /**\n * Replace a math placeholder with its corresponding group.\n * The math delimiters \"\\\\(\", \"\\\\[\", \"\\\\)\" and \"\\\\]\" are replaced\n * removing one backslash in order to be interpreted correctly by MathJax.\n */\n var process = function (match, n) {\n var group = math[n];\n if (group.substr(0, 3) === '\\\\\\\\\\(' &&\n group.substr(group.length - 3) === '\\\\\\\\\\)') {\n group = '\\\\\\(' + group.substring(3, group.length - 3) + '\\\\\\)';\n }\n else if (group.substr(0, 3) === '\\\\\\\\\\[' &&\n group.substr(group.length - 3) === '\\\\\\\\\\]') {\n group = '\\\\\\[' + group.substring(3, group.length - 3) + '\\\\\\]';\n }\n return group;\n };\n // Replace all the math group placeholders in the text\n // with the saved strings.\n return text.replace(/@@(\\d+)@@/g, process);\n}", "title": "" }, { "docid": "9a7221308a2886c197641de2d76977ad", "score": "0.5681768", "text": "function extract(str){\n // console.log(str);\n // var pattern = /^([0-9]+) bytes from ([0-9.]+): icmp_seq=([0-9]+) ttl=([0-9]+) time=([0-9.]+) ms/m; // mac ping format\n // var pattern = /^(\\d+) bytes from (\\d+-\\d+-\\d+-\\d+.\\w+.\\w+) \\((\\d+.){4}\\): icmp_req=(\\d+) ttl=(\\d+) time=(\\d+.\\d) ms/m; // raspberry pi ping format\n var pattern = /time=(\\d+.\\d.)/;\n var regex = new RegExp(pattern);\n result = regex.exec(str);\n //console.log(result);\n return result;\n}", "title": "" }, { "docid": "276be4e9206fd9a1efef416252cffcef", "score": "0.5676981", "text": "function RegexMatch2() {\n }", "title": "" }, { "docid": "e5a959d2c80926cc5d1b5d14b60e9616", "score": "0.565714", "text": "function processRegex(r) {\n return \"(?:\" + r.source + \")\";\n}", "title": "" }, { "docid": "874bfc33ec1de3ce2b60af72aa90b675", "score": "0.5653558", "text": "function removeMath(text) {\n let math = []; // stores math strings for later\n let start = null;\n let end = null;\n let last = null;\n let braces = 0;\n let deTilde;\n // Except for extreme edge cases, this should catch precisely those pieces of the markdown\n // source that will later be turned into code spans. While MathJax will not TeXify code spans,\n // we still have to consider them at this point; the following issue has happened several times:\n //\n // `$foo` and `$bar` are variables. --> <code>$foo ` and `$bar</code> are variables.\n let hasCodeSpans = /`/.test(text);\n if (hasCodeSpans) {\n text = text\n .replace(/~/g, '~T')\n .replace(/(^|[^\\\\])(`+)([^\\n]*?[^`\\n])\\2(?!`)/gm, wholematch => wholematch.replace(/\\$/g, '~D'));\n deTilde = (text) => {\n return text.replace(/~([TD])/g, (wholematch, character) => character === 'T' ? '~' : inline);\n };\n }\n else {\n deTilde = (text) => {\n return text;\n };\n }\n let blocks = text.replace(/\\r\\n?/g, '\\n').split(MATHSPLIT);\n for (let i = 1, m = blocks.length; i < m; i += 2) {\n let block = blocks[i];\n if (block.charAt(0) === '@') {\n //\n // Things that look like our math markers will get\n // stored and then retrieved along with the math.\n //\n blocks[i] = '@@' + math.length + '@@';\n math.push(block);\n }\n else if (start !== null) {\n //\n // If we are in math, look for the end delimiter,\n // but don't go past double line breaks, and\n // and balance braces within the math.\n //\n if (block === end) {\n if (braces) {\n last = i;\n }\n else {\n blocks = processMath(start, i, deTilde, math, blocks);\n start = null;\n end = null;\n last = null;\n }\n }\n else if (block.match(/\\n.*\\n/)) {\n if (last !== null) {\n i = last;\n blocks = processMath(start, i, deTilde, math, blocks);\n }\n start = null;\n end = null;\n last = null;\n braces = 0;\n }\n else if (block === '{') {\n braces++;\n }\n else if (block === '}' && braces) {\n braces--;\n }\n }\n else {\n //\n // Look for math start delimiters and when\n // found, set up the end delimiter.\n //\n if (block === inline || block === '$$') {\n start = i;\n end = block;\n braces = 0;\n }\n else if (block === '\\\\\\\\(' || block === '\\\\\\\\[') {\n start = i;\n end = block.slice(-1) === '(' ? '\\\\\\\\)' : '\\\\\\\\]';\n braces = 0;\n }\n else if (block.substr(1, 5) === 'begin') {\n start = i;\n end = '\\\\end' + block.substr(6);\n braces = 0;\n }\n }\n }\n if (start !== null && last !== null) {\n blocks = processMath(start, last, deTilde, math, blocks);\n start = null;\n end = null;\n last = null;\n }\n return { text: deTilde(blocks.join('')), math };\n}", "title": "" }, { "docid": "155ad145da905ede0614a2f0fc886a36", "score": "0.5643689", "text": "function main() {\n\tvar s = 'hi1234there567';\n\t//var re = /\\D+/; // matches 'hi'\n\t//var re = /\\D+/ + /\\d+/; // doesn't work\n\n\tprint(s.match(re)[0]);\n}", "title": "" }, { "docid": "b25dccae91a5bb4a3b098b9775f94dac", "score": "0.5623333", "text": "function regexextract1(s, rx, dfl) {\n\t//rx = tw_regex(rx, \"\");\n\trx.lastIndex = 0;\n\ts = s;\n\tvar captureIndex = arguments[3] || 0;\n\tvar match = rx.exec(s);\n\treturn (match && match[captureIndex]) ? match[captureIndex] : dfl;\n}", "title": "" }, { "docid": "c0f155afe813b5f9c498b8d4fbd969b1", "score": "0.56169504", "text": "match(regEx) {\n // This.s can either be a string, if it's made up only of ASCII chars\n // or an array of graphemes, if it's more complicated.\n const execResult = typeof this.s === 'string'\n ? regEx.exec(this.s.slice(this.pos))\n : regEx.exec(this.s.slice(this.pos).join(''));\n if (execResult === null || execResult === void 0 ? void 0 : execResult[0]) {\n this.pos += execResult[0].length;\n return execResult[0];\n }\n return null;\n }", "title": "" }, { "docid": "3f3969944a5a293fdb3a9f6238db20b4", "score": "0.56126", "text": "function calculator(str) {\r\n return eval(str);\r\n}", "title": "" }, { "docid": "8211836a40a619dc4f7cfe050ea8ca6d", "score": "0.5589014", "text": "function parseTextToMathArray(text) {\n function recurse(text) {\n var lastIndex, operatorsOfPrecedence, foundOperatorIndex, foundOperator, operand0, operand1, i;\n\n // Search for the substring within the given text.\n // Return the index of the first letter of the first instance of the substring. \n function findLastIndex(toFind, text) {\n var a = -1, j, c, numParens;\n numParens = 0;\n for (j = 0; j < text.length; j += 1) {\n c = text.substr(j, toFind.length);\n // The first part of the expression checks for a match.\n // The second part of the expression checks that we're not looking for subtraction and finding a unary '-' instead.\n if (c === toFind && numParens === 0 && !(toFind === '-' && (j === 0 || text[j - 1] === '(' || text[j - 1] === '+' || text[j - 1] === '*' || text[j - 1] === '/' || text[j - 1] === '^'))) {\n a = j;\n }\n if (c.substr(0, 1) === '(') {\n numParens += 1;\n } else if (c.substr(0, 1) === ')') {\n numParens -= 1;\n }\n }\n return a;\n } // end function findLastIndex \n\n // Look for operators in the text, not in parenthesis, from lowest precedence to highest precedence.\n for (i = MIN_OPERATOR_PRECEDENCE; i <= MAX_OPERATOR_PRECEDENCE; i += 1) { \n var operatorsOfPrecedence = OPERATORS.filter(function (operator) {\n return operator.precedence === i;\n });\n // Get the last position in the text at which this operator is found.\n foundOperatorIndex = operatorsOfPrecedence.reduce(function (previousIndex, operator) {\n var lastIndex = findLastIndex(operator.symbol, text);\n return lastIndex > previousIndex ? lastIndex : previousIndex;\n }, -1);\n\n // If foundOperatorIndex > -1, an operator at this precedence was found.\n // Recurse on the operands before and after the operator.\n if (foundOperatorIndex > -1) {\n foundOperator = text[foundOperatorIndex];\n operand0 = text.substr(0, foundOperatorIndex);\n operand1 = text.substr(foundOperatorIndex + 1);\n return [foundOperator, recurse(operand0), recurse(operand1)];\n } \n }\n\n // If we didn't find any of the operators, look for the one argument functions\n for (i = 0; i < ONE_ARG_FUNCTIONS.length; i += 1) {\n lastIndex = findLastIndex(ONE_ARG_FUNCTIONS[i], text);\n if (lastIndex > -1) {\n operand0 = text.substr(lastIndex + ONE_ARG_FUNCTIONS[i].length, text.length - ONE_ARG_FUNCTIONS[i].length - lastIndex * 2);\n return [ONE_ARG_FUNCTIONS[i], recurse(operand0)];\n }\n }\n\n // If we've made it this far, there isn't a single operation we can perform without going inside parenthesis.\n // This means that this is either a primitive expression (in which case there will be no parenthesis),\n // or this expression contains '(', an expression inside, and then ')', and nothing else.\n lastIndex = findLastIndex('(', text);\n if (lastIndex === 0) {\n return recurse(text.substr(1, text.length - 2));\n }\n\n return text;\n } // end function recurse \n\n // Remove spaces\n text = text.replace(/ /g, '');\n text = text.replace(/−/g, '-');\n text = text.toLowerCase();\n\n return recurse(text);\n } // end function parseTextToMathArray", "title": "" }, { "docid": "b67fc9dffa32efd4abf03a13bc22159a", "score": "0.5540127", "text": "function myFunction6() {\n\n var str = \"tt Is this his\";\n console.log('string ist :' + str);\n\n var patt1 = /^tt/g;\n console.log(patt1);\n\n var result = str.match(patt1);\n console.log('The Result is :' + result)\n\n document.getElementById(\"demo6\").innerHTML = result;\n }", "title": "" }, { "docid": "53d036bb784d999e5a9320c0b68771d2", "score": "0.55389607", "text": "function removeMath(text) {\n var math = []; // stores math strings for later\n var start = null;\n var end = null;\n var last = null;\n var braces = 0;\n var deTilde;\n // Except for extreme edge cases, this should catch precisely those pieces of the markdown\n // source that will later be turned into code spans. While MathJax will not TeXify code spans,\n // we still have to consider them at this point; the following issue has happened several times:\n //\n // `$foo` and `$bar` are variables. --> <code>$foo ` and `$bar</code> are variables.\n var hasCodeSpans = /`/.test(text);\n if (hasCodeSpans) {\n text = text.replace(/~/g, '~T').replace(/(^|[^\\\\])(`+)([^\\n]*?[^`\\n])\\2(?!`)/gm, function (wholematch) { return wholematch.replace(/\\$/g, '~D'); });\n deTilde = function (text) {\n return text.replace(/~([TD])/g, function (wholematch, character) { return (character === 'T') ? '~' : inline; });\n };\n }\n else {\n deTilde = function (text) { return text; };\n }\n var blocks = text.replace(/\\r\\n?/g, '\\n').split(MATHSPLIT);\n for (var i = 1, m = blocks.length; i < m; i += 2) {\n var block = blocks[i];\n if (block.charAt(0) === '@') {\n //\n // Things that look like our math markers will get\n // stored and then retrieved along with the math.\n //\n blocks[i] = '@@' + math.length + '@@';\n math.push(block);\n }\n else if (start !== null) {\n //\n // If we are in math, look for the end delimiter,\n // but don't go past double line breaks, and\n // and balance braces within the math.\n //\n if (block === end) {\n if (braces) {\n last = i;\n }\n else {\n blocks = processMath(start, i, deTilde, math, blocks);\n start = null;\n end = null;\n last = null;\n }\n }\n else if (block.match(/\\n.*\\n/)) {\n if (last !== null) {\n i = last;\n blocks = processMath(start, i, deTilde, math, blocks);\n }\n start = null;\n end = null;\n last = null;\n braces = 0;\n }\n else if (block === '{') {\n braces++;\n }\n else if (block === '}' && braces) {\n braces--;\n }\n }\n else {\n //\n // Look for math start delimiters and when\n // found, set up the end delimiter.\n //\n if (block === inline || block === '$$') {\n start = i;\n end = block;\n braces = 0;\n }\n else if (block === '\\\\\\\\\\(' || block === '\\\\\\\\\\[') {\n start = i;\n end = block.slice(-1) === '(' ? '\\\\\\\\\\)' : '\\\\\\\\\\]';\n braces = 0;\n }\n else if (block.substr(1, 5) === 'begin') {\n start = i;\n end = '\\\\end' + block.substr(6);\n braces = 0;\n }\n }\n }\n if (start !== null && last !== null) {\n blocks = processMath(start, last, deTilde, math, blocks);\n start = null;\n end = null;\n last = null;\n }\n return { text: deTilde(blocks.join('')), math: math };\n}", "title": "" }, { "docid": "f8ede7d7555714333e0ea85a92a7c4ba", "score": "0.55286944", "text": "function calculate_expression() {\n rl.question(\"> \", function(expression) {\n // Testing the validity of the expression.\n if (/^[0-9.+-/%*<>!=[\\]() ]*$/.test(expression)) {\n // We are going to execute this JS code in a sandbox\n var js = 'f=\"' + flag + '\";\"\";' + expression;\n\n // The actual execution and error handling\n try {\n var result = vm.runInNewContext(js);\n if (typeof result === 'string') {\n result = '\"' + result + '\"\\n';\n } else {\n result = result + '\\n';\n }\n } catch(e) {\n var result = String(e) + '\\n';\n }\n\n // Logging\n process.stdout.write(c.remoteAddress + ':' + c.remotePort + ' ' + expression + ' -> ' + result);\n\n // Sending the result\n c.write(result);\n }\n\n // Dealing with nasty inputs\n else {\n c.write('The expression must only contain the following characters: 0123456789.+-/%*<>!=[]()\\n');\n }\n\n // Waiting for the next expression\n calculate_expression();\n });\n }", "title": "" }, { "docid": "da02837c119e72446120da3f14396850", "score": "0.55147934", "text": "function mathExpression(mathFunction, a, b) {\n return mathFunction(a, b);\n}", "title": "" }, { "docid": "789e56d4c346cd8a5410192e9923a76b", "score": "0.54940224", "text": "function parseAdditionExpressions(expression) {\n const numbersStr = expression.split(\"+\");\n const numbers = numbersStr.map(str => parseSubtractionExpressions(str));\n const initValue = 0.0;\n const result = numbers.reduce((acc, operand) => acc + operand, initValue);\n return strip(result);\n}", "title": "" }, { "docid": "e2f5bfa99f6a70dfb3d8cda4390d750e", "score": "0.54888403", "text": "function calculate(string) {\n let arr = string.split(' ');\n let math = [];\n for (let i of arr) {\n if (parseInt(i)) {\n math.push(parseInt(i));\n }\n if (i === 'gains' || i === 'loses') {\n math.push(i);\n }\n }\n return math[1] === 'gains' ? math[0]+math[2] : math[0]-math[2];\n}", "title": "" }, { "docid": "f7601b0bbc386609959a5afeafc4cbe5", "score": "0.54810053", "text": "function laTeXed(expression){\n \n expression = math.parse(expression);\n var final = '$$'+expression.toTex({parenthesis: 'keep'}) + '$$';\n return final;\n }", "title": "" }, { "docid": "1e3e7a2875f11716d1ef19879970878e", "score": "0.5480031", "text": "function parseEquation(eqString) {\n eqString = eqString.replace(/\\s/g, '');\n\n var ops = [];\n var values = [];\n\n while (eqString.length > 0) {\n var numMatch = false;\n\n if (values.length === 0 || (eqString.charAt(0) !== '-' && eqString.charAt(0) !== '+')) {\n numMatch = eqString.match(numberRegex);\n if (numMatch) {\n numMatch = numMatch[0];\n }\n }\n\n if (eqString.charAt(0) === 'x') {\n numMatch = 'x';\n }\n\n console.log(numMatch);\n\n if (numMatch) {\n if (numMatch === 'x') {\n values.push(numMatch);\n } else {\n values.push(parseFloat(numMatch));\n }\n\n eqString = eqString.slice(numMatch.toString().length);\n } else {\n var operator = eqString.charAt(0);\n\n\n if (operator.match(/[a-z]/i)) {\n var i = 1;\n\n while (eqString.charAt(i).match(/[a-z]/i)) {\n operator += eqString.charAt(i);\n i++;\n }\n }\n\n if (operator === ')') {\n while (ops[ops.length - 1] !== '(') {\n values.push(createTreeFunction(ops, values));\n }\n ops.pop();\n } else {\n while (ops.length > 0 && ops[ops.length - 1] !== '(' && !isHigherOrder(operator, ops[ops.length - 1])) {\n values.push(createTreeFunction(ops, values));\n }\n ops.push(operator);\n }\n eqString = eqString.slice(operator.length);\n }\n }\n\n if (ops.length === 0 && values.length === 1) { //Special case where the function is just a value/variable with no operators\n return createTreeFunction(['\\0'], values);\n }\n\n while (ops.length > 0) {\n values.push(createTreeFunction(ops, values));\n }\n\n return values[0];\n}", "title": "" }, { "docid": "6421bade4bc64ec054ce9b5a46e48220", "score": "0.54635656", "text": "function extractMaths(slides, callback) {\n checkCallback(callback);\n try {\n async.each(slides.frames, function(frame, callback) {\n constants.regex_maths.lastIndex = 0;\n var maths = [],\n mathsCount = 0,\n match = constants.regex_maths.exec(frame.content);\n while(match != null) {\n if(match[1] != undefined) {\n maths.push({\n type: constants.math_type_inline,\n value: match[2]\n });\n frame.content = frame.content.replace(match[1], constants.math_marker(mathsCount));\n } else if(match[3] != undefined) {\n maths.push({\n type: constants.math_type_block,\n value: match[4]\n });\n frame.content = frame.content.replace(match[3], constants.math_marker(mathsCount));\n }\n constants.regex_maths.lastIndex = 0;\n match = constants.regex_maths.exec(frame.content);\n mathsCount++;\n }\n frame.maths = maths;\n callback();\n }, function() {\n callback(null, slides);\n });\n } catch(err) {\n err = new Error(\"Missing property: slides.frames || slides.frames.content || slides.frames.maths\");\n callback(err, null);\n }\n\n }", "title": "" }, { "docid": "aaa091fb18faa58c397c5d9a98b1d6e3", "score": "0.5458011", "text": "function get_matches(string, regex, extractData) {\n var matches,\n results = [];\n\n\twhile (matches = regex.exec(string)) {\n\t results.push(extractData(matches[0])); \n\t}\n\n\tif (results.length > 0) {\n\t\treturn results;\n\t} else\n\t\treturn null;\n}", "title": "" }, { "docid": "dac287fb33d07e92e467ffe0e18faac1", "score": "0.5450433", "text": "transform($input){\n return String($input).length>0 ? new RegExp($input,'i'):undefined;\n }", "title": "" }, { "docid": "a85bb4c9d9a56ee0d5ac3a97533818bd", "score": "0.54398113", "text": "function regulation(exp) {\n // return `^${exp.replace(/\\S/g, $0 => `${$0}?`)}`;\n return `^${exp}`;\n}", "title": "" }, { "docid": "ad145ef558719403d82a19f21bd84262", "score": "0.5421004", "text": "function getQuotes(string)\n{\n\tconsole.log(string.match(reg)); // For viewing outputs\n\n\treturn string.match(reg);\n}", "title": "" }, { "docid": "b7b796165f8609fa1906afa229750839", "score": "0.5382855", "text": "function getRegEx( arr ) {\t\t// skel, ork.\n\t\t\t\t\t\t\tlet re = \"^(\";\n\t\t\t\t\t\t\tarr.forEach( function(nm ) { re += nm + \"|\"; });\n\t\t\t\t\t\t\treturn new RegExp ( re.slice( 0, -1) + \")\\\\s\\\\d+\\\\s*$\" );\n\t\t\t\t\t\t}", "title": "" }, { "docid": "81416d6a163837bf586b96ff82180e04", "score": "0.53677607", "text": "function escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n } //sometimes text-replacements can be ambiguous - words used multiple times..", "title": "" }, { "docid": "5708c558f904cc815d612fc7713d5f39", "score": "0.5361754", "text": "function inlineRegex(regex) {\n return function match(source, state) {\n if (state.inline) {\n return regex.exec(source);\n } else {\n return null;\n }\n };\n}", "title": "" }, { "docid": "1de695ce010ddb4ec28d84c6b9f8de5c", "score": "0.53473115", "text": "function getEquation(formula, replaceNode) {\n GM_xmlhttpRequest({\n method: \"POST\",\n url: \"http://eng.biu.ac.il/~klingeo/math/index.php\",\n headers: {\n \"Content-type\": \"application/x-www-form-urlencoded\",\n \"User-Agent\": navigator.userAgent, // \"Mozilla/5.0\"\n \"Accept\": \"text/html\"\n },\n data: \"latex_formula=\" + URLEncode(formula),\n onload: function(response) {\n replaceNode.innerHTML = response.responseText;\n }\n });\n}", "title": "" }, { "docid": "332876b59db656c2928787aca5075a9c", "score": "0.5347068", "text": "function calculating(expression) {\n if (isNaN(Number(expression))) {\n if (parens.test(expression)) {\n let newExpr = expression.replace(parens, function (match, subExpr) {\n return calculating(subExpr);\n });\n return calculating(newExpr);\n } else if (exp.test(expression)) {\n let newExpr = expression.replace(exp, function (match, base, pow) {\n return Math.pow(Number(base), Number(pow));\n });\n return calculating(newExpr);\n } else if (mul.test(expression)) {\n let newExpr = expression.replace(mul, function (match, a, b) {\n return Number(a) * Number(b);\n });\n return calculating(newExpr);\n } else if (div.test(expression)) {\n let newExpr = expression.replace(div, function (match, a, b) {\n if (b != 0) return Number(a) / Number(b);\n else throw new Error(\"Division by zero\");\n });\n return calculating(newExpr);\n } else if (add.test(expression)) {\n let newExpr = expression.replace(add, function (match, a, b) {\n return Number(a) + Number(b);\n });\n return calculating(newExpr);\n } else if (sub.test(expression)) {\n let newExpr = expression.replace(sub, function (match, a, b) {\n return Number(a) - Number(b);\n });\n return calculating(newExpr);\n } else {\n return \"Dont is a expression\";\n }\n }\n return Number(expression);\n}", "title": "" }, { "docid": "7688af52e67e394a1dc292e8661df8d6", "score": "0.53288823", "text": "function evaluate(str) { // @param String:\r\n // @return Mix:\r\n return (new Function(str))();\r\n}", "title": "" }, { "docid": "dfdab5a4b107ed7d531f00d9026067d6", "score": "0.5310127", "text": "function getExpression(){\n var builtExp =\"\";\n var expression = document.getElementById(\"exp\").childNodes;\n for(i=0; i<expression.length; i++){\n if(expression[i].nodeName != \"#text\"){\n var child = expression[i];\n var text = child.getElementsByClassName(\"numberOperatorText\")[0];\n\n if(text != undefined){\n if(text.innerHTML.replace(\" \",\"\") == \"x\"){\n builtExp += \"*\";\n console.log(\"+ here\");\n\n }\n else{\n builtExp += (text.innerHTML);\n console.log(text.innerHTML);\n\n }\n }\n\n\n }\n \n }\n dbCallForExpressionValidation(builtExp);\n}", "title": "" }, { "docid": "4900b1989ba59602ab19031ab850b9a2", "score": "0.52866983", "text": "function quickMath(){\ndocument.getElementById(\"output\").innerHTML = eval(input);\n}", "title": "" }, { "docid": "6e5201f16d0b68d2298be5bda07216fa", "score": "0.52841794", "text": "parsePowAndSquare() {\r\n let expression = this.parseUnary()\r\n let token = this.lexer.peek()\r\n\r\n while (token === '**' || token == '√') {\r\n token = this.lexer.next()\r\n expression = {\r\n type: 'BinaryExpression',\r\n operator: token,\r\n left: expression,\r\n right: this.parseUnary()\r\n }\r\n token = this.lexer.peek()\r\n }\r\n\r\n return expression\r\n }", "title": "" }, { "docid": "7e8742b0fc075d4c427d214e0862eb35", "score": "0.52823114", "text": "function findLetters(string) { \n console.log(string.match(regex))\n}", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.5278927", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "dfda4c05aaaf83c4daaa41fcc58a3b99", "score": "0.5278927", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "d6aa653087b815267ad5c6ce7b91ca59", "score": "0.527821", "text": "function calculator(str) {\n let arr = str.split(' ');\n\n if(isNaN(arr[arr.length - 1])) return false;\n for(let i = 0; i < arr.length - 1; i++) {\n if(i % 2 === 0 && !'+-*/'.includes(arr[i])) return false;\n if(i % 2 !== 0 && isNaN(arr[1])) return false;\n }\n\n let acc = +arr[arr.length - 1];\n\n for(let j = arr.length - 2; j >= 0; j -= 2) {\n if(arr[j - 1] === '+') acc = +arr[j] + acc;\n if(arr[j - 1] === '-') acc = +arr[j] - acc;\n if(arr[j - 1] === '*') acc = +arr[j] * acc;\n if(arr[j - 1] === '/') acc = +arr[j] / acc;\n }\n\n return acc;\n}", "title": "" }, { "docid": "18c48b2f4fe223bc4d20998ca1a669d4", "score": "0.52705824", "text": "parse() {\n const expr = this.regex();\n \n // if any part of input left unprocessed, signal error\n if (this.more()) {\n throw new Error(\n `The following characters were unexpected: ` + \n `'${this.re.substring(this.index)}'`);\n }\n\n return expr;\n }", "title": "" }, { "docid": "b381d56ac69372516afe942c3056bc45", "score": "0.5269452", "text": "function transform(data) {\n if (!data) return \"\";\n if (data.match(/¹/) && data.indexOf(\"¹\") !== data.lastIndexOf(\"¹\")) {\n\n\n\t\t//---PHASE 1---\n\t //Regular expression strings and array with all string scenarios\n\t var regEx1 = new RegExp(\"valid\\\\sthrough:?\\\\s\"); //valid through(:)\n\t var regEx2 = new RegExp(\"expires:?\\\\s\"); //expires(:)\n\t var regEx3 = new RegExp(\"until:?\\\\s\"); //until(:)\n\t var regEx4 = new RegExp(\"offer\\\\sends:?\\\\s\"); //offer ends(:)\n\t var regEx5 = new RegExp(\"valid\\\\suntil:?\\\\s\"); //valid until(:)\n\t var regExArr = [regEx1, regEx2, regEx3, regEx4];\n\n\t var dateRegEx = new RegExp(\"([\\\\d\\\\/?\\\\.?]{2,3}){2}([\\\\d]{2,4})?\"); // (N)N/(N)N/(NNNN)\n\t var flags = \"i\"; //Can be i, gi, g\n\n\n\n\t //---PHASE 2---\n\t //Create the new Array -> expirTextArr. Push all the regular expressions inside\n\t var expirTextArr = [];\n\t for (var i = 0; i < regExArr.length; i++) {\n\t expirTextArr.push(new RegExp (regExArr[i].source + dateRegEx.source, flags));\n\t }\n\n\n\n\t //---PHASE 3---\n\t //String where the extracted (N)N/(N)N/(NNNN) is added. Then the string is split to an array.\n\t var finalStrArr = \"\";\n\t //loop through all the regular expressions inside the expirTextArr to see if there is a match\n\t //If there is a match, then add the (N)N/(N)N/(NNNN) in finalStrArr and split it.\n\t for (var i = 0; i < expirTextArr.length; i++) {\n\t var el = expirTextArr[i];\n\n\t if (data.match(el)) {\n\t finalStrArr= data.match(el)[0].replace(/[A-Za-z]/g,\"\").trim().split(\"/\");\n\t break;\n\t }\n\t }\n\n\t if (finalStrArr.length === 0) return null;\n\n\t //---PHASE 4---\n\t //Return a concatenation (this can be expanded based on other information like currency data)\n\t return new Date(finalStrArr[1] + \"/\" + finalStrArr[0] + \"/\" + finalStrArr[2] || \"1970\");\n\n }\n\n return null;\n}", "title": "" }, { "docid": "1f1b394477bf225bcc1c4be3e79c82e8", "score": "0.5264548", "text": "function escapeRegExp(string){\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }", "title": "" }, { "docid": "1f1b394477bf225bcc1c4be3e79c82e8", "score": "0.5264548", "text": "function escapeRegExp(string){\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }", "title": "" }, { "docid": "3842d00691aa198855e7386a66598e05", "score": "0.5263336", "text": "function toTeX(string) {\n\n // first, bracket numbers, variables, and parentheses for easy identification later\n\n // add spaces to beginning and end to make sure variable regex capture works\n string = \" \" + string + \" \";\n\n // replace curly brackets \"{}\" with regular brackets \"()\" because it interferes with TeX notation\n string = string.replace(/\\{/g, \"(\").replace(/\\}/g, \")\");\n\n string = string.replace(/((([^\\d\\w\\)\\]])(-))?(\\d+(\\.\\d+)?))/g, \"$3{$4$5}\"); // numbers (includes support for negative numbers)\n\n\n // variables (todo: optimize)\n for (var i = 0; i < string.length; i++) {\n if (/[a-z]/i.exec(string.charAt(i))) { // if letter\n // preceding character must not be a letter\n if (i != 0) {\n if (/[a-z]/i.exec(string.charAt(i-1))) // previous character can't be alphabetical\n continue;\n }\n if (i < string.length-1)\n if (/[a-z]/i.exec(string.charAt(i+1))) // next character can't be alphabetical\n continue;\n // if still here, must be a valid variable\n string = string.substr(0, i) + \"{\" + string.substr(i, 1) + \"}\" + string.substr(i+1);\n i += 3; // add two brackets to the string, and next character already proven to not be alphabetic\n }\n }\n\n\n string = string.replace(/(\\(|\\[)/g, \"{$1\").replace(/(\\)|\\])/g, \"$1}\"); // () & [] (NOT {})\n\n // pi\n string = string.replace(/(pi|π)/g, \"{π}\");\n\n // escape functions (ex. sin, abs, ln, etc)\n string = escapeOperation(\"sqrt\", string);\n string = escapeOperation(\"sin\", string);\n string = escapeOperation(\"cos\", string);\n string = escapeOperation(\"tan\", string);\n string = escapeOperation(\"sec\", string);\n string = escapeOperation(\"csc\", string);\n string = escapeOperation(\"cot\", string);\n string = escapeOperation(\"arcsin\", string);\n string = escapeOperation(\"arccos\", string);\n string = escapeOperation(\"arctan\", string);\n string = escapeOperation(\"log\", string);\n string = escapeOperation(\"ln\", string);\n\n // replace \"abs(x)\" and \"|x|\" with escaped pipes\n string = escapeABS(string);\n\n // replace \"**\" with carets \"^\"\n string = string.replace(/\\*\\*/g, \"^\");\n\n // get rid of all spaces (which should be between brackets\n string = string.replace(/ /g, \"\");\n\n // \"}{\" means multiplication\n string = string.replace(/}{/g, \"}*{\");\n\n var brackets = [];\n\n\n /*\n * T0D0: rewrite this code\n * it really, REALLY needs optimization\n * maybe use code from highlighting?\n */\n for (var n = 0; n < 50; n++) {\n\n // check if any changes were made on a given iteration\n var changesMade = false;\n\n // how many layers of brackets deep the loop is\n var depth = 0;\n // find brackets\n for (var i = 0; i < string.length; i++) { // look for opening brackets\n if (string.charAt(i) === \"{\") {\n if (brackets[depth] === undefined) {\n brackets[depth] = [];\n }\n // push the parenthese location on\n brackets[depth].push(i);\n // dive in deeper\n depth++;\n\n } else if (string.charAt(i) === \"}\") { // look for closing brackets\n if (string.charAt(i+1) === \"!\") { // factorial stuff\n string = string.substr(0, i) + '!}' + string.substr(i+2);\n i++;\n }\n // dive outward\n depth--;\n // check for errors\n if (depth < 0)\n break;\n // add the bracket on\n brackets[depth].push(i);\n\n // if there are two or more sets at the layer, look for some certain functions\n var length = brackets[depth].length;\n if (length >= 4) {\n\n var firstBegin = brackets[depth][length-4];\n var firstEnd = brackets[depth][length-3];\n var secondBegin = brackets[depth][length-2];\n var secondEnd = brackets[depth][length-1];\n\n var first = string.substr(firstBegin, firstEnd-firstBegin+1);\n var second = string.substr(secondBegin, secondEnd-secondBegin+1);\n // look at what is in between the two bracket groups\n var middle = string.substr(firstEnd+1, secondBegin-firstEnd-1);\n\n /*\n * Where the real magic happens\n */\n\n // check the middle for any...brackets (if there are, the capture group isn't valid, so skip to next one)\n if (/{|}/.test(middle)) {\n continue;\n }\n\n var start = \"\", end = \"\";\n\n\n // test for exponents\n if (/\\^/.test(middle)) {\n start = \"{\";\n end = \"}\";\n middle = \"©\"; // substitute character for \"^\", is converted back later\n\n string = string.substr(0, firstBegin) + start + string.substr(firstBegin, firstEnd-firstBegin+1) + middle + string.substr(secondBegin, secondEnd-secondBegin+1) + end + string.substr(secondEnd+1);\n changesMade = true;\n break;\n }\n // test for fractions\n else if (/\\//.test(middle)) {\n start = \"\\\\frac\";\n end = \"\";\n middle = \"\";\n string = string.substr(0, firstBegin) + start + string.substr(firstBegin, firstEnd-firstBegin+1) + middle + string.substr(secondBegin, secondEnd-secondBegin+1) + end + string.substr(secondEnd+1);\n changesMade = true;\n break;\n }\n\n\n } // end of looking at a bracket pair\n\n }\n }\n // if no changes were made, exit\n if (!changesMade)\n break;\n\n brackets = [];\n }\n\n // now apply some last minute formatting\n\n // replace \"©\"\" with \"^\"\n string = string.replace(/\\u00A9/g, '\\u005E');\n\n // remove ALL spaces\n string = string.replace(/ +/g, \"\");\n\n // format parentheses so that they are sized properly (unfortunately have to do this at the end instead of earlier when targeting brackets)\n string = string.replace(/(\\(|\\[)/g, \"\\\\left$1\").replace(/(\\)|\\])/g, \"\\\\right$1\");\n\n return string;\n }", "title": "" }, { "docid": "6b7991713b4afc99099a42d5a6e05d62", "score": "0.52576447", "text": "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "title": "" }, { "docid": "c0f38cf1264f17351d8098b6483eb47d", "score": "0.5238303", "text": "function operate(str){\r\n let strArr = str.split(\" \");\r\n let num1 = +strArr[0];\r\n let num2 = +strArr[strArr.length - 1];\r\n let operator = strArr[1];\r\n\r\n return calculate(num1, num2, operator);\r\n}", "title": "" }, { "docid": "f1f17536543bd7a529344b4b069fa919", "score": "0.5214559", "text": "function regexBuilder() {\n\n var regexExpression = \"\";\n\n /* The main engine */\n\n function __scheme(optionString, fieldString, numString) {\n\n var exp = \"\";\n\n if (optionString) {\n\n if (optionString === \"anyChar\") {\n exp += \".\";\n } else if (optionString === \"anyLetter\") {\n exp += \"[a-zA-Z]\";\n } else if (optionString === \"anyUppercaseLetter\") {\n exp += \"[A-Z]\";\n } else if (optionString === \"anyLowercaseLetter\") {\n exp += \"[a-z]\";\n } else if (optionString === \"freeText\") {\n exp += \"(?:\" + fieldString + \")\";\n } else if (optionString === \"anyWhitespace\") {\n exp += \"\\\\s\";\n } else if (optionString === \"anyDigit\") {\n exp += \"\\\\d\";\n }\n }\n\n if (numString) {\n\n var firstDigit;\n var secondDigit;\n\n /* Extracting digits */\n\n var i;\n\n for (i = 0; i < numString.length; i++) {\n\n if (numString[i] === (\"+\")) {\n\n firstDigit = numString.substring(0, i);\n console.log(\"First digit: \" + firstDigit);\n break;\n\n }\n\n if (numString[i] === (\":\")) {\n\n firstDigit = numString.substring(0, i);\n secondDigit = numString.substring(i + 1, numString.length);\n console.log(\"First digit: \" + firstDigit);\n console.log(\"Second digit: \" + secondDigit);\n break;\n\n }\n }\n\n if (i === numString.length) { // An explicit digit was found\n var firstDigit = numString;\n }\n\n /* Explicit amount */\n\n if ((numString.indexOf(\":\") === -1) && (numString.indexOf(\"+\") === -1)) {\n exp += \"{\" + firstDigit + \"}\";\n }\n\n\n /* Between */\n\n if (numString.indexOf(':') !== -1) {\n exp += \"{\" + firstDigit + \",\" + secondDigit + \"}\";\n }\n\n /* Or more */\n\n if (numString.indexOf('+') !== -1) {\n exp += \"{\" + firstDigit + \",}\";\n }\n\n }\n return exp;\n }\n\n /* The building stuff */\n\n this.whichContains = function (optionString, fieldString, numString) {\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n return this;\n\n };\n\n this.startingWith = function (optionString, fieldString, numString) {\n\n // Set up base regex\n\n regexExpression += \"^\";\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n return this;\n };\n\n this.or = function (optionString, fieldString, numString) {\n\n // Set up base regex\n\n regexExpression += \"|\";\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n return this;\n };\n\n this.followedBy = function (optionString, fieldString, numString) {\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n return this;\n };\n\n this.onlyIfFollowedBy = function (optionString, fieldString, numString) {\n // Set up base regex\n\n regexExpression += \"(?=\";\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n // Append last token\n\n regexExpression += \")\";\n\n return this;\n };\n\n this.onlyIfNotFollowedBy = function (optionString, fieldString, numString) {\n // Set up base regex\n\n regexExpression += \"(?!\";\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n // Append last token\n\n regexExpression += \")\";\n\n return this;\n };\n\n this.endingIn = function (optionString, fieldString, numString) {\n\n regexExpression += __scheme(optionString, fieldString, numString);\n\n // Add last token\n\n regexExpression += \"$\";\n\n return this;\n };\n\n /* Supplies the user with the regex */\n\n this.getRegex = function () {\n return new RegExp(regexExpression);\n };\n\n }", "title": "" }, { "docid": "9e5274d0228e3a4beddbeb5a207cd69d", "score": "0.52134323", "text": "function parseCalcInput(str) {\n if (isNum(str)) {return str}\n str = deminusify(str);\n while (str.includes('(')) {\n str = calcParens(str)\n }\n while (hasAnOp(str)) {\n str = calcNoPs(str);\n }\n return str \n}", "title": "" }, { "docid": "34fd611bfa45cf2a64c7b33885cc639e", "score": "0.5213311", "text": "function parseDivisionExpressions(expression) {\n const numbersStr = expression.split('/');\n // float was not working properly\n const numbers = numbersStr.map(str => +str); \n const initValue = numbers[0];\n const result = numbers.slice(1).reduce((acc, operand) => acc / operand, initValue);\n return result;\n}", "title": "" }, { "docid": "616be207bbf87143c32964764d495174", "score": "0.5206848", "text": "function regexTransform(regex, permit) {\n return function transform(next, last, mark) {\n return next\n .split('')\n .reduce(function(next, ch) {\n var match = !!ch.match(regex);\n // Transformers must preserve mark characters in output.\n if (ch === mark) {\n next.push(ch);\n } else if ((permit && match) || (!permit && !match)) {\n next.push(ch);\n }\n return next;\n }, [])\n .join('');\n };\n }", "title": "" }, { "docid": "20444d883b5e38be8008cd46f3df4e1f", "score": "0.5199126", "text": "function simple_Math() {\n var Multi = (x + 2) * 10 / 2 - 5;\n document.getElementById(\"Math\").innerHTML = \"(11 + 2) * 10 &div; 2 - 5 = \"+ Multi;\n}", "title": "" }, { "docid": "c6949f0566aea9e7529ece1c8e2052c1", "score": "0.51989996", "text": "function regexp(group)\n{\n return new RegExp(regexp_string(group)+'$');\n}", "title": "" }, { "docid": "c47b9f22d2292c523e6e309f555a67c1", "score": "0.51928777", "text": "function getEmoteFromRegEx(regex) {\n\tif (typeof regex === 'string') {\n\t\tregex = new RegExp(regex);\n\t}\n\treturn decodeURI(regex.source)\n\t\t.replace('&gt\\\\;', '>') // right angle bracket\n\t\t.replace('&lt\\\\;', '<') // left angle bracket\n\t\t.replace(/\\(\\?![^)]*\\)/g, '') // remove negative group\n\t\t.replace(/\\(([^|])*\\|?[^)]*\\)/g, '$1') // pick first option from a group\n\t\t.replace(/\\[([^|])*\\|?[^\\]]*\\]/g, '$1') // pick first character from a character group\n\t\t.replace(/[^\\\\]\\?/g, '') // remove optional chars\n\t\t.replace(/^\\\\b|\\\\b$/g, '') // remove boundaries\n\t\t.replace(/\\\\/g, ''); // unescape\n}", "title": "" }, { "docid": "1c6d2b41cc6988431838544d31969380", "score": "0.5181743", "text": "function calculate(s) {\n if (s == null || s.length === 0) return null;\n\n // remove space\n s = s.replace(/\\s/g, \"\");\n\n let st = [];\n let n = 0;\n let sign = \"+\";\n\n for (let i = 0; i < s.length; i++) {\n const c = s[i];\n // number - get an integer -- getting the next number\n if (/\\d/.test(c)) n = n * 10 + Number(c); // e.g. '14' -> 1 * 10 + 4\n // sign or last number\n if (/\\D/.test(c) || i === s.length - 1) {\n if (sign === \"-\") st.push(-n);\n else if (sign === \"+\") st.push(n);\n else if (sign === \"*\") st.push(st.pop() * n);\n else if (sign === \"/\") st.push(~~(st.pop() / n));\n\n sign = c;\n n = 0;\n }\n }\n return st.reduce((a, b) => a + b);\n}", "title": "" }, { "docid": "77c06946c783a64736c56b3c986e1253", "score": "0.5178716", "text": "function parse(s) {\n if (regex.one.test(s))\n return 1;\n else if (regex.two.test(s))\n return 2;\n else if (regex.three_pre.test(s))\n return 3;\n else if (regex.three_pre_vow.test(s))\n return 4;\n else if (regex.three_supr.test(s))\n return 5;\n else if (regex.three_supr_vow.test(s))\n return 6;\n else if (regex.three_sub.test(s))\n return 7;\n else if (regex.three_sub_vow.test(s))\n return 8;\n else\n return 0;\n}", "title": "" }, { "docid": "05e3c54c645fcba65c0c0112a87e7203", "score": "0.5178619", "text": "function getPieces(e){\n var \n equation = e\n ,pieces = equation.split(' ');\n return pieces;\n}", "title": "" }, { "docid": "ca2c162899af79319365477bf811cb42", "score": "0.5177603", "text": "function calc() {\n let result = 0;\n if (input.value.indexOf(\"+\") != -1) {\n let temp = input.value.split(\"+\");\n let x = parseFloat(temp[0].trim());\n let y = parseFloat(temp[1].trim());\n result = x + y;\n } else if (input.value.indexOf(\"-\") != -1) {\n let temp = input.value.split(\"-\");\n let x = parseFloat(temp[0].trim());\n let y = parseFloat(temp[1].trim());\n result = x - y;\n } else if (input.value.indexOf(\"×\") != -1) {\n let temp = input.value.split(\"×\");\n let x = parseFloat(temp[0].trim());\n let y = parseFloat(temp[1].trim());\n result = x * y;\n } else if (input.value.indexOf(\"÷\") != -1) {\n let temp = input.value.split(\"÷\");\n let x = parseFloat(temp[0].trim());\n let y = parseFloat(temp[1].trim());\n result = x / y;\n } else if (input.value.indexOf(\"%\") != -1) {\n let temp = input.value.split(\"%\");\n let x = parseFloat(temp[0].trim());\n let y = parseFloat(temp[1].trim());\n result = x % y;\n }\n reset();\n input.value = result;\n resultFlag = true;\n}", "title": "" }, { "docid": "130cfa0fa914f50a34da7293e79b8a40", "score": "0.5171305", "text": "function escapeRegExp(string){\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}", "title": "" }, { "docid": "2641864c0725a2f94b0833b47bc08c71", "score": "0.5169098", "text": "function findAndFormatRegexMatches(text, regex, callback) {\n if(!callback) return;\n if(!regex) return callback('');\n\n var called = false;\n var worker = new Worker(REGEX_WORKER_PATH);\n\n function finishMatching(result) {\n if(!called) {\n called = true;\n worker.terminate();\n (callback || $.noop)(result ? result.data : null);\n }\n }\n\n worker.onmessage = finishMatching;\n worker.postMessage(JSON.stringify({\n command: 'run',\n text: text,\n regex: regex\n }));\n\n setTimeout(finishMatching, REGEX_TIMEOUT);\n}", "title": "" }, { "docid": "1763129d48bae46f5926c1dc0bd41969", "score": "0.51589155", "text": "static testTerminal8() {\n startTest(TerminalTest.groupName+'testTerminal8');\n if (Util.ADVANCED) {\n // Terminal doesn't work under advanced-compile.\n return;\n }\n window.terminal = new Terminal(null, null);\n const t = window.terminal;\n Terminal.stdRegex(t);\n assertEquals(4, t.eval('2+2'));\n assertEquals('lab$util$DoubleRect',\n t.expand('DoubleRect'));\n // regex containing a semicolon.\n let txt = 'SIM_VARS.foo=1.00;';\n let r = /** @type {!Array}*/(t.eval('\"'+txt+'\".match(/SIM_VARS.*;/)'));\n assertEquals(txt, r[0]);\n // regex containing a quote\n txt = 'foo\\'bar';\n r = /** @type {!Array}*/(t.eval('\"'+txt+'\".match(/.*\\'.*/)'));\n assertEquals(txt, r[0]);\n // expression looks like a regex with two slashes, but isn't a regex\n assertRoughlyEquals(0.5, t.eval('(1/8) + (3/8)'), 1E-10);\n assertRoughlyEquals(0.5, t.eval('(1\\t/8)+ (3 /8)'), 1E-10);\n assertRoughlyEquals(3/8, t.eval('(1/8);(3/8)'), 1E-10);\n assertRoughlyEquals(3/8, t.eval('(1\\t/8);(3 /8)'), 1E-10);\n // incomplete string gives \"SyntaxError: Unexpected EOF\" in Safari.\n // In Firefox and Chrome get \"SyntaxError: unterminated string literal\"\n let err = String(assertThrows(() => t.eval('foo\"bar')));\n assertNotNull(err.match(/^SyntaxError.*/i));\n err = String(assertThrows(() => t.eval('\\'incomplete string')));\n assertNotNull(err.match(/^SyntaxError.*/i));\n // regex containing a slash\n txt = 'foo/bar';\n r = /** @type {!Array}*/(t.eval('\"'+txt+'\".match(/.*\\\\/.*/)'));\n assertEquals(txt, r[0]);\n r = /** @type {!Array}*/(t.eval('\"'+txt+'\".match(/.*[/].*/)'));\n assertEquals(txt, r[0]);\n delete window.terminal;\n}", "title": "" }, { "docid": "437c37d6b45cf5683835985384637f15", "score": "0.51532763", "text": "function escapeRegExp(string) {\n return string.replace(/[.*+?^${}()<>\\!\\-|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}", "title": "" }, { "docid": "7c2443146834bb3b9d093a2a4530c31b", "score": "0.5150072", "text": "function escapeRegExp(str) {\nvar ESCAPE_CHARS = /[\\\\.+*?\\^$\\[\\](){}\\/'#]/g;\nreturn str.replace(ESCAPE_CHARS,'\\\\$&');\n}", "title": "" }, { "docid": "0cfe45efddc69b6dd3f13fe5832430d3", "score": "0.51479733", "text": "function escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}", "title": "" }, { "docid": "eaf18575084550ec828bf8406d923974", "score": "0.5139988", "text": "escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n }", "title": "" }, { "docid": "a73a79b2494c671566cad0c97da6581f", "score": "0.51376235", "text": "function latex2mml() {\n\n\n function GM_log() {}\n\n\n// First, find out where we are\nvar va_loc = window.location.href;\nvar va_view = 'web';\n\n//alert( 'va_view=' + va_view );\n\n// The script itself begins\n\nvar/*const*/ mmlns = 'http://www.w3.org/1998/Math/MathML';\n\n/*\n// VA: Fix displayed equations first.\nif( va_view == 'web' ){\n document.body.innerHTML=\n\tdocument.body.innerHTML.replace(/\\n/g,\" \"); // remove end-of-lines\n document.body.innerHTML=\n\tdocument.body.innerHTML.replace(/(\\$\\$|\\\\\\[)([^$]+)(\\$\\$|\\\\\\])/g,\n\t\t\t\t\t\"<p style=\\\"text-indent: 20px;\\\"> \\$ $2 \\$ </p>\");\n// VA: Experimental: may lead to slow down. \\spcheck is used on MathSciNet\n// document.body.innerHTML=\n// document.body.innerHTML.replace(/\\\\spcheck/g,\"^{\\\\vee}\");\n}\n*/\n\n\nfunction result_element(tag, num_attrs)\n{\n var node = document.createElementNS(mmlns, tag);\n\n var k = 2;\n while(--num_attrs >= 0) {\n if(arguments[k+1] != null) {\n node.setAttribute(arguments[k], arguments[k+1]);\n }\n k += 2;\n }\n \n for(; k < arguments.length; k++) {\n if(arguments[k] != null) {\n if(typeof(arguments[k]) == 'string')\n node.appendChild(document.createTextNode(arguments[k]));\n else\n node.appendChild(arguments[k]);\n }\n }\n\n return node;\n}\n\n\nfunction result_element_append(parent, child)\n{\n if(parent != null && child != null) {\n if(typeof(child) == 'string')\n parent.appendChild(document.createTextNode(child));\n else\n parent.appendChild(child);\n }\n}\n\n\nfunction result_element_prepend(parent, child, next)\n{\n if(next == null)\n result_element_append(parent, child);\n else if (parent != null && child != null)\n parent.insertBefore(child, next);\n}\n\n\nfunction result_set_attr(elem, attr, value)\n{\n if(elem != null && attr != null) {\n if(value != null)\n elem.setAttribute(attr, value);\n else\n elem.removeAttribute(attr);\n }\n}\n\n\nfunction result_append_attr(elem, attr, value)\n{\n if(elem != null && attr != null) {\n var old_value = elem.getAttribute(elem, attr);\n if(old_value == null)\n elem.setAttribute(attr, value);\n else\n elem.setAttribute(attr, old_value + value);\n }\n}\n\n/*\nif( va_view == 'web' ){\n if(!this.GM_getValue) {\n\tthis.GM_getValue = function(key, value) { return value; }\n\tthis.GM_log = function() {}\n }\n \n \n if(this.GM_registerMenuCommand) {\n\tGM_registerMenuCommand(\"Enable native display of math images\", \n\t\t\t function() {\n\t\t\t\t GM_setValue(\"patch-images\", true);\n\t\t\t\t do_patch_images = true;\n\t\t\t\t patch_element(document.documentElement);\n\t\t\t });\n\tGM_registerMenuCommand(\"Disable native display of math images\",\n\t\t\t function() {\n\t\t\t\t GM_setValue(\"patch-images\", false);\n\t\t\t });\n }\n}\n*/\n\n// VA: changed char_map\nvar/*const*/ char_map = {\n 'script': [\n\t '\\uD835\\uDC9C', '\\u212C', '\\uD835\\uDC9E', //abc\n\t '\\uD835\\uDC9F', '\\u2130', '\\u2131', //def\n\t '\\uD835\\uDCA2', '\\u210B', '\\u2110', //ghi\n\t '\\uD835\\uDCA5', '\\uD835\\uDCA6', '\\u2112', //jkl\n\t '\\u2133', '\\uD835\\uDCA9', '\\uD835\\uDCAA', //mno\n\t '\\uD835\\uDCAB', '\\uD835\\uDCAC', '\\u211B', //pqr\n\t '\\uD835\\uDCAE', '\\uD835\\uDCAF', '\\uD835\\uDCB0', //stu\n\t '\\uD835\\uDCB1', '\\uD835\\uDCB2', '\\uD835\\uDCB3', //vwx\n\t '\\uD835\\uDCB4', '\\uD835\\uDCB5' ], //yz\n\n 'fraktur': [\n\t '\\uD835\\uDD04', '\\uD835\\uDD05', '\\u212D', //abc\n\t '\\uD835\\uDD07', '\\uD835\\uDD08', '\\uD835\\uDD09', //def\n\t '\\uD835\\uDD0A', '\\u210C', '\\u2111', //ghi\n\t '\\uD835\\uDD0D', '\\uD835\\uDD0E', '\\uD835\\uDD0F', //jkl\n\t '\\uD835\\uDD10', '\\uD835\\uDD11', '\\uD835\\uDD12', //mno\n\t '\\uD835\\uDD13', '\\uD835\\uDD14', '\\u211C', //pqr\n\t '\\uD835\\uDD16', '\\uD835\\uDD17', '\\uD835\\uDD18', //stu\n\t '\\uD835\\uDD19', '\\uD835\\uDD1A', '\\uD835\\uDD1B', //vwx\n\t '\\uD835\\uDD1C', '\\u2128' ], //yz\n\n 'double-struck': [\n\t\t '\\uD835\\uDD38', '\\uD835\\uDD39', '\\u2102', //abc\n\t\t '\\uD835\\uDD3B', '\\uD835\\uDD3C', '\\uD835\\uDD3D', //def\n\t\t '\\uD835\\uDD3E', '\\u210D', '\\uD835\\uDD40', //ghi\n\t\t '\\uD835\\uDD41', '\\uD835\\uDD42', '\\uD835\\uDD43', //jkl\n\t\t '\\uD835\\uDD44', '\\u2115', '\\uD835\\uDD46', //mno\n\t\t '\\u2119', '\\u211A', '\\u211D', //pqr\n\t\t '\\uD835\\uDD4A', '\\uD835\\uDD4B', '\\uD835\\uDD4C', //stu\n\t\t '\\uD835\\uDD4D', '\\uD835\\uDD4E', '\\uD835\\uDD4F', //vwx\n\t\t '\\uD835\\uDD50', '\\u2124', ], //yz\n};\n\nvar/*const*/ uppercase_re = /[A-Z]/;\n\nfunction fix_mathvariant(node, style)\n{\n if(node.nodeType == node.TEXT_NODE) {\n if(style != null && style != '' && style in char_map) {\n node.data = node.data.replace(uppercase_re,\n function(s) {return char_map[style][s.charCodeAt(0)-65]});\n }\n } else if(node.nodeType == node.ELEMENT_NODE) {\n var new_style = node.getAttribute('mathvariant');\n if(new_style != null && new_style != '')\n style = new_style;\n\n for(var i=0; i < node.childNodes.length; i++)\n fix_mathvariant(node.childNodes.item(i), style);\n }\n}\n\nvar g_punct_and_space\n= {\"\\\\quad\" : \"\\u2003\" ,\n\"\\\\qquad\" : \"\\u2003\\u2003\" ,\n\"\\\\thickspace\" : \"\\u2002\" ,\n\"\\\\;\" : \"\\u2002\" ,\n\"\\\\medspace\" : \"\\u2005\" ,\n\"\\\\:\" : \"\\u2005\" ,\n\"\\\\thinspace\" : \"\\u2004\" ,\n\"\\\\,\" : \"\\u2004\" ,\n\"\\\\!\" : \"\\u200b\" ,\n\".\" : \".\" ,\n\";\" : \";\" ,\n\"?\" : \"?\" ,\n\"\\\\qedsymbol\" : \"\\u25a0\" ,\n}\n;\nvar g_left_delimiters\n= {\"(\" : \"(\" ,\n\"[\" : \"[\" ,\n\"\\\\{\" : \"{\" ,\n\"\\\\lgroup\" : \"(\" ,\n\"\\\\lbrace\" : \"{\" ,\n\"\\\\lvert\" : \"|\" ,\n\"\\\\lVert\" : \"\\u2016\" ,\n\"\\\\lceil\" : \"\\u2308\" ,\n\"\\\\lfloor\" : \"\\u230a\" ,\n\"\\\\lmoustache\" : \"\\u23b0\" ,\n\"\\\\langle\" : \"\\u2329\" ,\n}\n;\nvar g_right_delimiters\n= {\")\" : \")\" ,\n\"]\" : \"]\" ,\n\"\\\\}\" : \"}\" ,\n\"\\\\rbrace\" : \"}\" ,\n\"\\\\rgroup\" : \")\" ,\n\"\\\\rvert\" : \"|\" ,\n\"\\\\rVert\" : \"\\u2016\" ,\n\"\\\\rceil\" : \"\\u2309\" ,\n\"\\\\rfloor\" : \"\\u230b\" ,\n\"\\\\rmoustache\" : \"\\u23b1\" ,\n\"\\\\rangle\" : \"\\u232a\" ,\n}\n;\nvar g_operator_symbols\n= {\"\\\\amalg\" : \"\\u2a3f\" ,\n\"\\\\ast\" : \"*\" ,\n\"\\\\ast\" : \"\\u2217\" ,\n\"\\\\barwedge\" : \"\\u22bc\" ,\n\"\\\\barwedge\" : \"\\u2305\" ,\n\"\\\\bigcirc\" : \"\\u25cb\" ,\n\"\\\\bigtriangledown\" : \"\\u25bd\" ,\n\"\\\\bigtriangleup\" : \"\\u25b3\" ,\n\"\\\\boxdot\" : \"\\u22a1\" ,\n\"\\\\boxminus\" : \"\\u229f\" ,\n\"\\\\boxplus\" : \"\\u229e\" ,\n\"\\\\boxtimes\" : \"\\u22a0\" ,\n\"\\\\bullet\" : \"\\u2022\" ,\n\"\\\\bullet\" : \"\\u2219\" ,\n\"\\\\cap\" : \"\\u2229\" ,\n\"\\\\Cap\" : \"\\u22d2\" ,\n\"\\\\cdot\" : \"\\u22c5\" ,\n\"\\\\centerdot\" : \"\\u00b7\" ,\n\"\\\\circ\" : \"\\u2218\" ,\n\"\\\\circledast\" : \"\\u229b\" ,\n\"\\\\circledcirc\" : \"\\u229a\" ,\n\"\\\\circleddash\" : \"\\u229d\" ,\n\"\\\\cup\" : \"\\u222a\" ,\n\"\\\\Cup\" : \"\\u22d3\" ,\n\"\\\\curlyvee\" : \"\\u22ce\" ,\n\"\\\\curlywedge\" : \"\\u22cf\" ,\n\"\\\\dagger\" : \"\\u2020\" ,\n\"\\\\ddagger\" : \"\\u2021\" ,\n\"\\\\diamond\" : \"\\u22c4\" ,\n\"\\\\div\" : \"\\u00f7\" ,\n\"\\\\divideontimes\" : \"\\u22c7\" ,\n\"\\\\dotplus\" : \"\\u2214\" ,\n\"\\\\doublebarwedge\" : \"\\u2306\" ,\n\"\\\\doublecap\" : \"\\u22d2\" ,\n\"\\\\doublecup\" : \"\\u22d3\" ,\n\"\\\\gtrdot\" : \"\\u22d7\" ,\n\"\\\\intercal\" : \"\\u22ba\" ,\n\"\\\\land\" : \"\\u2227\" ,\n\"\\\\leftthreetimes\" : \"\\u22cb\" ,\n\"\\\\lessdot\" : \"\\u22d6\" ,\n\"\\\\lor\" : \"\\u2228\" ,\n\"\\\\ltimes\" : \"\\u22c9\" ,\n\"\\\\mp\" : \"\\u2213\" ,\n\"\\\\odot\" : \"\\u2299\" ,\n\"\\\\ominus\" : \"\\u2296\" ,\n\"\\\\oplus\" : \"\\u2295\" ,\n\"\\\\oslash\" : \"\\u2298\" ,\n\"\\\\otimes\" : \"\\u2297\" ,\n\"\\\\pm\" : \"\\u00b1\" ,\n\"\\\\rightthreetimes\" : \"\\u22cc\" ,\n\"\\\\rtimes\" : \"\\u22ca\" ,\n\"\\\\setminus\" : \"\\u2216\" ,\n\"\\\\smallsetminus\" : \"\\u2216\" ,\n\"\\\\sqcap\" : \"\\u2293\" ,\n\"\\\\sqcup\" : \"\\u2294\" ,\n\"\\\\star\" : \"\\u22c6\" ,\n\"\\\\times\" : \"\\u00d7\" ,\n\"\\\\triangleleft\" : \"\\u25c1\" ,\n\"\\\\triangleright\" : \"\\u25b7\" ,\n\"\\\\uplus\" : \"\\u228e\" ,\n\"\\\\vee\" : \"\\u2228\" ,\n\"\\\\spcheck\" : \"\\u207a\" , // has to be ^{\\vee} instead but that's hard\n\t\t\t // to code\n //\"\\\\spcheck\" : \"\\u002a\" , \n\"\\\\veebar\" : \"\\u22bb\" ,\n\"\\\\veebar\" : \"\\u2a61\" ,\n\"\\\\wedge\" : \"\\u2227\" ,\n\"\\\\wr\" : \"\\u2240\" ,\n\"+\" : \"+\" ,\n\"-\" : \"\\u2212\" ,\n\"*\" : \"*\" ,\n\",\" : \",\" ,\n\"/\" : \"\\u2215\" ,\n\":\" : \":\" ,\n\"\\\\colon\" : \":\" ,\n\"|\" : \"|\" ,\n\"\\\\vert\" : \"|\" ,\n\"\\\\Vert\" : \"\\u2016\" ,\n\"\\\\|\" : \"\\u2016\" ,\n\"\\\\backslash\" : \"\\\\\" ,\n\"'\" : \"\\u2032\" ,\n\"\\\\#\" : \"#\" ,\n\"\\\\bmod\" : \"mod\" ,\n\"\\\\mod\" : \"mod\" ,\n\"\\\\downarrow\" : \"\\u2193\" ,\n\"\\\\Downarrow\" : \"\\u21d3\" ,\n\"\\\\uparrow\" : \"\\u2191\" ,\n\"\\\\Uparrow\" : \"\\u21d1\" ,\n\"\\\\updownarrow\" : \"\\u2195\" ,\n\"\\\\Updownarrow\" : \"\\u21d5\" ,\n\"\\\\bigcap\" : \"\\u22c2\" ,\n\"\\\\bigcup\" : \"\\u22c3\" ,\n\"\\\\bigodot\" : \"\\u2a00\" ,\n\"\\\\bigoplus\" : \"\\u2a01\" ,\n\"\\\\bigotimes\" : \"\\u2a02\" ,\n\"\\\\bigsqcup\" : \"\\u2a06\" ,\n\"\\\\biguplus\" : \"\\u2a04\" ,\n\"\\\\bigvee\" : \"\\u22c1\" ,\n\"\\\\bigwedge\" : \"\\u22c0\" ,\n\"\\\\coprod\" : \"\\u2210\" ,\n\"\\\\prod\" : \"\\u220f\" ,\n\"\\\\sum\" : \"\\u2211\" ,\n\"\\\\int\" : \"\\u222b\" ,\n\"\\\\smallint\" : \"\\u222b\" ,\n\"\\\\oint\" : \"\\u222e\" ,\n\"\\\\angle\" : \"\\u2220\" ,\n\"\\\\backprime\" : \"\\u2035\" ,\n\"\\\\bigstar\" : \"\\u2605\" ,\n\"\\\\blacklozenge\" : \"\\u29eb\" ,\n\"\\\\blacksquare\" : \"\\u25a0\" ,\n\"\\\\blacktriangle\" : \"\\u25b4\" ,\n\"\\\\blacktriangledown\" : \"\\u25be\" ,\n\"\\\\bot\" : \"\\u22a5\" ,\n\"\\\\clubsuit\" : \"\\u2663\" ,\n\"\\\\diagdown\" : \"\\u2572\" ,\n\"\\\\diagup\" : \"\\u2571\" ,\n\"\\\\diamondsuit\" : \"\\u2662\" ,\n\"\\\\emptyset\" : \"\\u2205\" ,\n\"\\\\exists\" : \"\\u2203\" ,\n\"\\\\flat\" : \"\\u266d\" ,\n\"\\\\forall\" : \"\\u2200\" ,\n\"\\\\heartsuit\" : \"\\u2661\" ,\n\"\\\\infty\" : \"\\u221e\" ,\n\"\\\\lnot\" : \"\\u00ac\" ,\n\"\\\\lozenge\" : \"\\u25ca\" ,\n\"\\\\measuredangle\" : \"\\u2221\" ,\n\"\\\\nabla\" : \"\\u2207\" ,\n\"\\\\natural\" : \"\\u266e\" ,\n\"\\\\neg\" : \"\\u00ac\" ,\n\"\\\\nexists\" : \"\\u2204\" ,\n\"\\\\prime\" : \"\\u2032\" ,\n\"\\\\sharp\" : \"\\u266f\" ,\n\"\\\\spadesuit\" : \"\\u2660\" ,\n\"\\\\sphericalangle\" : \"\\u2222\" ,\n\"\\\\square\" : \"\\u25a1\" ,\n\"\\\\surd\" : \"\\u221a\" ,\n\"\\\\top\" : \"\\u22a4\" ,\n\"\\\\triangle\" : \"\\u25b5\" ,\n\"\\\\triangledown\" : \"\\u25bf\" ,\n\"\\\\varnothing\" : \"\\u2205\" ,\n\"\\\\aleph\" : \"\\u2135\" ,\n\"\\\\Bbbk\" : \"\\u1d55C\" ,\n\"\\\\beth\" : \"\\u2136\" ,\n\"\\\\circledS\" : \"\\u24c8\" ,\n\"\\\\complement\" : \"\\u2201\" ,\n\"\\\\daleth\" : \"\\u2138\" ,\n\"\\\\ell\" : \"\\u2113\" ,\n\"\\\\eth\" : \"\\u00f0\" ,\n\"\\\\Finv\" : \"\\u2132\" ,\n\"\\\\Game\" : \"\\u2141\" ,\n\"\\\\gimel\" : \"\\u2137\" ,\n\"\\\\hbar\" : \"\\u210f\" ,\n\"\\\\hslash\" : \"\\u210f\" ,\n\"\\\\Im\" : \"\\u2111\" ,\n\"\\\\mho\" : \"\\u2127\" ,\n\"\\\\partial\" : \"\\u2202\" ,\n\"\\\\Re\" : \"\\u211c\" ,\n\"\\\\wp\" : \"\\u2118\" ,\n}\n;\nvar g_relation_symbols\n= {\"=\" : \"=\" ,\n\"<\" : \"<\" ,\n\">\" : \">\" ,\n\"\\\\approx\" : \"\\u2248\" ,\n\"\\\\approxeq\" : \"\\u224a\" ,\n\"\\\\asymp\" : \"\\u2248\" ,\n\"\\\\backsim\" : \"\\u223d\" ,\n\"\\\\backsimeq\" : \"\\u22cd\" ,\n\"\\\\bumpeq\" : \"\\u224f\" ,\n\"\\\\Bumpeq\" : \"\\u224e\" ,\n\"\\\\circeq\" : \"\\u2257\" ,\n\"\\\\cong\" : \"\\u2245\" ,\n\"\\\\curlyeqprec\" : \"\\u22de\" ,\n\"\\\\curlyeqsucc\" : \"\\u22df\" ,\n\"\\\\doteq\" : \"\\u2250\" ,\n\"\\\\doteqdot\" : \"\\u2251\" ,\n\"\\\\eqcirc\" : \"\\u2256\" ,\n\"\\\\eqsim\" : \"\\u2242\" ,\n\"\\\\eqslantgtr\" : \"\\u2a96\" ,\n\"\\\\eqslantless\" : \"\\u2a95\" ,\n\"\\\\equiv\" : \"\\u2261\" ,\n\"\\\\fallingdotseq\" : \"\\u2252\" ,\n\"\\\\ge\" : \"\\u2265\" ,\n\"\\\\geq\" : \"\\u2265\" ,\n\"\\\\geqq\" : \"\\u2267\" ,\n\"\\\\geqslant\" : \"\\u2a7e\" ,\n\"\\\\gg\" : \"\\u226b\" ,\n\"\\\\gg\" : \"\\u2aa2\" ,\n\"\\\\ggg\" : \"\\u22d9\" ,\n\"\\\\gggtr\" : \"\\u22d9\" ,\n\"\\\\gnapprox\" : \"\\u2a8a\" ,\n\"\\\\gneq\" : \"\\u2a88\" ,\n\"\\\\gneqq\" : \"\\u2269\" ,\n\"\\\\gnsim\" : \"\\u22e7\" ,\n\"\\\\gtrapprox\" : \"\\u2a86\" ,\n\"\\\\gtreqless\" : \"\\u22db\" ,\n\"\\\\gtreqqless\" : \"\\u2a8c\" ,\n\"\\\\gtrless\" : \"\\u2277\" ,\n\"\\\\gtrsim\" : \"\\u2273\" ,\n\"\\\\gvertneqq\" : \"\\u2269\" ,\n\"\\\\le\" : \"\\u2264\" ,\n\"\\\\leq\" : \"\\u2264\" ,\n\"\\\\leqq\" : \"\\u2266\" ,\n\"\\\\leqslant\" : \"\\u2a7d\" ,\n\"\\\\lessapprox\" : \"\\u2a85\" ,\n\"\\\\lesseqgtr\" : \"\\u22da\" ,\n\"\\\\lesseqqgtr\" : \"\\u2a8b\" ,\n\"\\\\lessgtr\" : \"\\u2276\" ,\n\"\\\\lesssim\" : \"\\u2272\" ,\n\"\\\\ll\" : \"\\u226a\" ,\n\"\\\\llless\" : \"\\u22d8\" ,\n\"\\\\lnapprox\" : \"\\u2a89\" ,\n\"\\\\lneq\" : \"\\u2a87\" ,\n\"\\\\lneqq\" : \"\\u2268\" ,\n\"\\\\lnsim\" : \"\\u22e6\" ,\n\"\\\\lvertneqq\" : \"\\u2268\" ,\n\"\\\\ncong\" : \"\\u2247\" ,\n\"\\\\ne\" : \"\\u2260\" ,\n\"\\\\neq\" : \"\\u2260\" ,\n\"\\\\ngeq\" : \"\\u2271\" ,\n\"\\\\ngeqq\" : \"\\u2267\" ,\n\"\\\\ngeqslant\" : \"\\u2a7e\" ,\n\"\\\\ngtr\" : \"\\u226f\" ,\n\"\\\\nleq\" : \"\\u2270\" ,\n\"\\\\nleqq\" : \"\\u2266\" ,\n\"\\\\nleqslant\" : \"\\u2a7d\" ,\n\"\\\\nless\" : \"\\u226e\" ,\n\"\\\\nprec\" : \"\\u2280\" ,\n\"\\\\npreceq\" : \"\\u2aaf\" ,\n\"\\\\nsim\" : \"\\u2241\" ,\n\"\\\\nsucc\" : \"\\u2281\" ,\n\"\\\\nsucceq\" : \"\\u2ab0\" ,\n\"\\\\prec\" : \"\\u227a\" ,\n\"\\\\precapprox\" : \"\\u2ab7\" ,\n\"\\\\preccurlyeq\" : \"\\u227c\" ,\n\"\\\\preceq\" : \"\\u2aaf\" ,\n\"\\\\precnapprox\" : \"\\u2ab9\" ,\n\"\\\\precneqq\" : \"\\u2ab5\" ,\n\"\\\\precnsim\" : \"\\u22e8\" ,\n\"\\\\precsim\" : \"\\u227e\" ,\n\"\\\\risingdotseq\" : \"\\u2253\" ,\n\"\\\\sim\" : \"\\u223c\" ,\n\"\\\\simeq\" : \"\\u2243\" ,\n\"\\\\succ\" : \"\\u227b\" ,\n\"\\\\succapprox\" : \"\\u2ab8\" ,\n\"\\\\succcurlyeq\" : \"\\u227d\" ,\n\"\\\\succeq\" : \"\\u2ab0\" ,\n\"\\\\succnapprox\" : \"\\u2aba\" ,\n\"\\\\succneqq\" : \"\\u2ab6\" ,\n\"\\\\succnsim\" : \"\\u22e9\" ,\n\"\\\\succsim\" : \"\\u227f\" ,\n\"\\\\thickapprox\" : \"\\u2248\" ,\n\"\\\\thicksim\" : \"\\u223c\" ,\n\"\\\\triangleq\" : \"\\u225c\" ,\n\"\\\\longrightarrow\" : \"\\u27F6\" ,\n\"\\\\curvearrowleft\" : \"\\u21b6\" ,\n\"\\\\curvearrowright\" : \"\\u21b7\" ,\n\"\\\\downdownarrows\" : \"\\u21ca\" ,\n\"\\\\downharpoonleft\" : \"\\u21c3\" ,\n\"\\\\downharpoonright\" : \"\\u21c2\" ,\n\"\\\\gets\" : \"\\u2190\" ,\n\"\\\\hookleftarrow\" : \"\\u21a9\" ,\n\"\\\\hookrightarrow\" : \"\\u21aa\" ,\n\"\\\\leftarrow\" : \"\\u2190\" ,\n\"\\\\Leftarrow\" : \"\\u21d0\" ,\n\"\\\\leftarrowtail\" : \"\\u21a2\" ,\n\"\\\\leftharpoondown\" : \"\\u21bd\" ,\n\"\\\\leftharpoonup\" : \"\\u21bc\" ,\n\"\\\\leftleftarrows\" : \"\\u21c7\" ,\n\"\\\\leftrightarrow\" : \"\\u2194\" ,\n\"\\\\leftrightarrows\" : \"\\u21c6\" ,\n\"\\\\leftrightharpoons\" : \"\\u21cb\" ,\n\"\\\\leftrightsquigarrow\" : \"\\u21ad\" ,\n\"\\\\Lleftarrow\" : \"\\u21da\" ,\n\"\\\\longleftarrow\" : \"\\u27f5\" ,\n\"\\\\Longleftarrow\" : \"\\u27f8\" ,\n\"\\\\longleftrightarrow\" : \"\\u27f7\" ,\n\"\\\\Longleftrightarrow\" : \"\\u27fa\" ,\n\"\\\\looparrowleft\" : \"\\u21ab\" ,\n\"\\\\looparrowright\" : \"\\u21ac\" ,\n\"\\\\Lsh\" : \"\\u21b0\" ,\n\"\\\\mapsto\" : \"\\u21a6\" ,\n\"\\\\multimap\" : \"\\u22b8\" ,\n\"\\\\nearrow\" : \"\\u2197\" ,\n\"\\\\nleftarrow\" : \"\\u219a\" ,\n\"\\\\nLeftarrow\" : \"\\u21cd\" ,\n\"\\\\nleftrightarrow\" : \"\\u21ae\" ,\n\"\\\\nLeftrightarrow\" : \"\\u21ce\" ,\n\"\\\\nrightarrow\" : \"\\u219b\" ,\n\"\\\\nRightarrow\" : \"\\u21cf\" ,\n\"\\\\nwarrow\" : \"\\u2196\" ,\n\"\\\\restriction\" : \"\\u21be\" ,\n\"\\\\rightarrow\" : \"\\u2192\" ,\n\"\\\\Rightarrow\" : \"\\u21d2\" ,\n\"\\\\rightarrowtail\" : \"\\u21a3\" ,\n\"\\\\rightharpoondown\" : \"\\u21c1\" ,\n\"\\\\rightharpoonup\" : \"\\u21c0\" ,\n\"\\\\rightleftarrows\" : \"\\u21c4\" ,\n\"\\\\rightleftharpoons\" : \"\\u21cc\" ,\n\"\\\\rightrightarrows\" : \"\\u21c9\" ,\n\"\\\\rightsquigarrow\" : \"\\u219d\" ,\n\"\\\\Rrightarrow\" : \"\\u21db\" ,\n\"\\\\Rsh\" : \"\\u21b1\" ,\n\"\\\\searrow\" : \"\\u2198\" ,\n\"\\\\swarrow\" : \"\\u2199\" ,\n\"\\\\to\" : \"\\u2192\" ,\n\"\\\\twoheadleftarrow\" : \"\\u219e\" ,\n\"\\\\twoheadrightarrow\" : \"\\u21a0\" ,\n\"\\\\upharpoonleft\" : \"\\u21bf\" ,\n\"\\\\upharpoonright\" : \"\\u21be\" ,\n\"\\\\upuparrows\" : \"\\u21c8\" ,\n\"\\\\backepsilon\" : \"\\u03f6\" ,\n\"\\\\because\" : \"\\u2235\" ,\n\"\\\\between\" : \"\\u226c\" ,\n\"\\\\blacktriangleleft\" : \"\\u25c0\" ,\n\"\\\\blacktriangleright\" : \"\\u25b6\" ,\n\"\\\\bowtie\" : \"\\u22c8\" ,\n\"\\\\dashv\" : \"\\u22a3\" ,\n\"\\\\frown\" : \"\\u2323\" ,\n\"\\\\in\" : \"\\u220a\" ,\n\"\\\\mid\" : \"\\u2223\" ,\n\"\\\\models\" : \"\\u22a7\" ,\n\"\\\\ni\" : \"\\u220b\" ,\n\"\\\\ni\" : \"\\u220d\" ,\n\"\\\\nmid\" : \"\\u2224\" ,\n\"\\\\notin\" : \"\\u2209\" ,\n\"\\\\nparallel\" : \"\\u2226\" ,\n\"\\\\nshortmid\" : \"\\u2224\" ,\n\"\\\\nshortparallel\" : \"\\u2226\" ,\n\"\\\\nsubseteq\" : \"\\u2286\" ,\n\"\\\\nsubseteq\" : \"\\u2288\" ,\n\"\\\\nsubseteqq\" : \"\\u2ac5\" ,\n\"\\\\nsupseteq\" : \"\\u2287\" ,\n\"\\\\nsupseteq\" : \"\\u2289\" ,\n\"\\\\nsupseteqq\" : \"\\u2ac6\" ,\n\"\\\\ntriangleleft\" : \"\\u22ea\" ,\n\"\\\\ntrianglelefteq\" : \"\\u22ec\" ,\n\"\\\\ntriangleright\" : \"\\u22eb\" ,\n\"\\\\ntrianglerighteq\" : \"\\u22ed\" ,\n\"\\\\nvdash\" : \"\\u22ac\" ,\n\"\\\\nvDash\" : \"\\u22ad\" ,\n\"\\\\nVdash\" : \"\\u22ae\" ,\n\"\\\\nVDash\" : \"\\u22af\" ,\n\"\\\\owns\" : \"\\u220d\" ,\n\"\\\\parallel\" : \"\\u2225\" ,\n\"\\\\perp\" : \"\\u22a5\" ,\n\"\\\\pitchfork\" : \"\\u22d4\" ,\n\"\\\\propto\" : \"\\u221d\" ,\n\"\\\\shortmid\" : \"\\u2223\" ,\n\"\\\\shortparallel\" : \"\\u2225\" ,\n\"\\\\smallfrown\" : \"\\u2322\" ,\n\"\\\\smallsmile\" : \"\\u2323\" ,\n\"\\\\smile\" : \"\\u2323\" ,\n\"\\\\sqsubset\" : \"\\u228f\" ,\n\"\\\\sqsubseteq\" : \"\\u2291\" ,\n\"\\\\sqsupset\" : \"\\u2290\" ,\n\"\\\\sqsupseteq\" : \"\\u2292\" ,\n\"\\\\subset\" : \"\\u2282\" ,\n\"\\\\Subset\" : \"\\u22d0\" ,\n\"\\\\subseteq\" : \"\\u2286\" ,\n\"\\\\subseteqq\" : \"\\u2ac5\" ,\n\"\\\\subsetneq\" : \"\\u228a\" ,\n\"\\\\subsetneqq\" : \"\\u2acb\" ,\n\"\\\\supset\" : \"\\u2283\" ,\n\"\\\\Supset\" : \"\\u22d1\" ,\n\"\\\\supseteq\" : \"\\u2287\" ,\n\"\\\\supseteqq\" : \"\\u2ac6\" ,\n\"\\\\supsetneq\" : \"\\u228b\" ,\n\"\\\\supsetneqq\" : \"\\u2acc\" ,\n\"\\\\therefore\" : \"\\u2234\" ,\n\"\\\\trianglelefteq\" : \"\\u22b4\" ,\n\"\\\\trianglerighteq\" : \"\\u22b5\" ,\n\"\\\\varpropto\" : \"\\u221d\" ,\n\"\\\\varsubsetneq\" : \"\\u228a\" ,\n\"\\\\varsubsetneqq\" : \"\\u2acb\" ,\n\"\\\\varsupsetneq\" : \"\\u228b\" ,\n\"\\\\varsupsetneqq\" : \"\\u2acc\" ,\n\"\\\\vartriangle\" : \"\\u25b5\" ,\n\"\\\\vartriangleleft\" : \"\\u22b2\" ,\n\"\\\\vartriangleright\" : \"\\u22b3\" ,\n\"\\\\vdash\" : \"\\u22a2\" ,\n\"\\\\vDash\" : \"\\u22a8\" ,\n\"\\\\Vdash\" : \"\\u22a9\" ,\n\"\\\\Vvdash\" : \"\\u22aa\" ,\n// AMS Arrows\n\"\\\\dashleftarrow\" : \"\\u21e0\" ,\n\"\\\\dashrightarrow\" : \"\\u21e2\" ,\n}\n;\nvar g_named_identifiers\n= {\"\\\\arccos\" : \"arccos\" ,\n\"\\\\arcsin\" : \"arcsin\" ,\n\"\\\\arctan\" : \"arctan\" ,\n\"\\\\arg\" : \"arg\" ,\n\"\\\\cos\" : \"cos\" ,\n\"\\\\cosh\" : \"cosh\" ,\n\"\\\\cot\" : \"cot\" ,\n\"\\\\coth\" : \"coth\" ,\n\"\\\\csc\" : \"csc\" ,\n\"\\\\deg\" : \"deg\" ,\n\"\\\\det\" : \"det\" ,\n\"\\\\dim\" : \"dim\" ,\n\"\\\\exp\" : \"exp\" ,\n\"\\\\gcd\" : \"gcd\" ,\n\"\\\\hom\" : \"hom\" ,\n\"\\\\ker\" : \"ker\" ,\n\"\\\\lg\" : \"lg\" ,\n\"\\\\ln\" : \"ln\" ,\n\"\\\\log\" : \"log\" ,\n\"\\\\Pr\" : \"Pr\" ,\n\"\\\\sec\" : \"sec\" ,\n\"\\\\sin\" : \"sin\" ,\n\"\\\\sinh\" : \"sinh\" ,\n\"\\\\tan\" : \"tan\" ,\n\"\\\\tanh\" : \"tanh\" ,\n\"\\\\inf\" : \"inf\" ,\n\"\\\\injlim\" : \"inj lim\" ,\n\"\\\\lim\" : \"lim\" ,\n\"\\\\liminf\" : \"lim inf\" ,\n\"\\\\limsup\" : \"lum sup\" ,\n\"\\\\max\" : \"max\" ,\n\"\\\\min\" : \"min\" ,\n\"\\\\projlim\" : \"proj lim\" ,\n\"\\\\sup\" : \"sup\" ,\n\"\\\\alpha\" : \"\\u03b1\" ,\n\"\\\\beta\" : \"\\u03b2\" ,\n\"\\\\chi\" : \"\\u03c7\" ,\n\"\\\\delta\" : \"\\u03b4\" ,\n\"\\\\Delta\" : \"\\u0394\" ,\n\"\\\\digamma\" : \"\\u03dd\" ,\n\"\\\\epsilon\" : \"\\u03f5\" ,\n\"\\\\eta\" : \"\\u03b7\" ,\n\"\\\\gamma\" : \"\\u03b3\" ,\n\"\\\\Gamma\" : \"\\u0393\" ,\n\"\\\\iota\" : \"\\u03b9\" ,\n\"\\\\kappa\" : \"\\u03ba\" ,\n\"\\\\lambda\" : \"\\u03bb\" ,\n\"\\\\Lambda\" : \"\\u039b\" ,\n\"\\\\mu\" : \"\\u03bc\" ,\n\"\\\\nu\" : \"\\u03bd\" ,\n\"\\\\omega\" : \"\\u03c9\" ,\n\"\\\\Omega\" : \"\\u03a9\" ,\n\"\\\\phi\" : \"\\u03c6\" ,\n\"\\\\Phi\" : \"\\u03a6\" ,\n\"\\\\pi\" : \"\\u03c0\" ,\n\"\\\\Pi\" : \"\\u03a0\" ,\n\"\\\\psi\" : \"\\u03c8\" ,\n\"\\\\Psi\" : \"\\u03a8\" ,\n\"\\\\rho\" : \"\\u03c1\" ,\n\"\\\\sigma\" : \"\\u03c3\" ,\n\"\\\\Sigma\" : \"\\u03a3\" ,\n\"\\\\tau\" : \"\\u03c4\" ,\n\"\\\\theta\" : \"\\u03b8\" ,\n\"\\\\Theta\" : \"\\u0398\" ,\n\"\\\\upsilon\" : \"\\u03c5\" ,\n\"\\\\Upsilon\" : \"\\u03d2\" ,\n\"\\\\varepsilon\" : \"\\u03b5\" ,\n\"\\\\varkappa\" : \"\\u03f0\" ,\n\"\\\\varphi\" : \"\\u03d5\" ,\n\"\\\\varpi\" : \"\\u03d6\" ,\n\"\\\\varrho\" : \"\\u03f1\" ,\n\"\\\\varsigma\" : \"\\u03c2\" ,\n\"\\\\vartheta\" : \"\\u03d1\" ,\n\"\\\\xi\" : \"\\u03be\" ,\n\"\\\\Xi\" : \"\\u039e\" ,\n\"\\\\zeta\" : \"\\u03b6\" ,\n\"a\" : \"a\" ,\n\"b\" : \"b\" ,\n\"c\" : \"c\" ,\n\"d\" : \"d\" ,\n\"e\" : \"e\" ,\n\"f\" : \"f\" ,\n\"g\" : \"g\" ,\n\"h\" : \"h\" ,\n\"i\" : \"i\" ,\n\"j\" : \"j\" ,\n\"k\" : \"k\" ,\n\"l\" : \"l\" ,\n\"m\" : \"m\" ,\n\"n\" : \"n\" ,\n\"o\" : \"o\" ,\n\"p\" : \"p\" ,\n\"q\" : \"q\" ,\n\"r\" : \"r\" ,\n\"s\" : \"s\" ,\n\"t\" : \"t\" ,\n\"u\" : \"u\" ,\n\"v\" : \"v\" ,\n\"w\" : \"w\" ,\n\"x\" : \"x\" ,\n\"y\" : \"y\" ,\n\"z\" : \"z\" ,\n\"A\" : \"A\" ,\n\"B\" : \"B\" ,\n\"C\" : \"C\" ,\n\"D\" : \"D\" ,\n\"E\" : \"E\" ,\n\"F\" : \"F\" ,\n\"G\" : \"G\" ,\n\"H\" : \"H\" ,\n\"I\" : \"I\" ,\n\"J\" : \"J\" ,\n\"K\" : \"K\" ,\n\"L\" : \"L\" ,\n\"M\" : \"M\" ,\n\"N\" : \"N\" ,\n\"O\" : \"O\" ,\n\"P\" : \"P\" ,\n\"Q\" : \"Q\" ,\n\"R\" : \"R\" ,\n\"S\" : \"S\" ,\n\"T\" : \"T\" ,\n\"U\" : \"U\" ,\n\"V\" : \"V\" ,\n\"W\" : \"W\" ,\n\"X\" : \"X\" ,\n\"Y\" : \"Y\" ,\n\"Z\" : \"Z\" ,\n\"\\\\vdots\" : \"\\u22ee\" ,\n\"\\\\hdots\" : \"\\u2026\" ,\n\"\\\\ldots\" : \"\\u2026\" ,\n\"\\\\dots\" : \"\\u2026\" ,\n\"\\\\cdots\" : \"\\u00b7\\u00b7\\u00b7\" ,\n\"\\\\dotsb\" : \"\\u00b7\\u00b7\\u00b7\" ,\n\"\\\\dotsc\" : \"\\u2026\" ,\n\"\\\\dotsi\" : \"\\u22c5\\u22c5\\u22c5\" ,\n\"\\\\dotsm\" : \"\\u22c5\\u22c5\\u22c5\" ,\n\"\\\\dotso\" : \"\\u2026\" ,\n\"\\\\ddots\" : \"\\u22f1\" ,\n // Common abbreviation for \\mathbb letters\n\"\\\\A\" : \"\\uD835\\uDD38\" ,\n\"\\\\bA\" : \"\\uD835\\uDD38\" ,\n\"\\\\B\" : \"\\uD835\\uDD39\" ,\n\"\\\\bB\" : \"\\uD835\\uDD39\" ,\n\"\\\\C\" : \"\\u2102\" ,\n\"\\\\bC\" : \"\\u2102\" ,\n\"\\\\D\" : \"\\uD835\\uDD3B\" ,\n\"\\\\bD\" : \"\\uD835\\uDD3B\" ,\n\"\\\\E\" : \"\\uD835\\uDD3C\" ,\n\"\\\\bE\" : \"\\uD835\\uDD3C\" ,\n\"\\\\F\" : \"\\uD835\\uDD3D\" ,\n\"\\\\bF\" : \"\\uD835\\uDD3D\" ,\n\"\\\\G\" : \"\\uD835\\uDD3E\" ,\n\"\\\\bG\" : \"\\uD835\\uDD3E\" ,\n\"\\\\H\" : \"\\u210D\" ,\n\"\\\\bH\" : \"\\u210D\" ,\n\"\\\\I\" : \"\\uD835\\uDD40\" ,\n\"\\\\bI\" : \"\\uD835\\uDD40\" ,\n\"\\\\J\" : \"\\uD835\\uDD41\" ,\n\"\\\\bJ\" : \"\\uD835\\uDD41\" ,\n\"\\\\K\" : \"\\uD835\\uDD42\" ,\n\"\\\\bK\" : \"\\uD835\\uDD42\" ,\n\"\\\\L\" : \"\\uD835\\uDD43\" ,\n\"\\\\bL\" : \"\\uD835\\uDD43\" ,\n\"\\\\M\" : \"\\uD835\\uDD44\" ,\n\"\\\\bM\" : \"\\uD835\\uDD44\" ,\n\"\\\\N\" : \"\\u2115\" ,\n\"\\\\bN\" : \"\\u2115\" ,\n\"\\\\O\" : \"\\uD835\\uDD46\" ,\n\"\\\\bO\" : \"\\uD835\\uDD46\" ,\n\"\\\\P\" : \"\\u2119\" ,\n\"\\\\bP\" : \"\\u2119\" ,\n\"\\\\Q\" : \"\\u211A\" ,\n\"\\\\bQ\" : \"\\u211A\" ,\n\"\\\\R\" : \"\\u211D\" ,\n\"\\\\bR\" : \"\\u211D\" ,\n\"\\\\S\" : \"\\uD835\\uDD4A\" ,\n\"\\\\bS\" : \"\\uD835\\uDD4A\" ,\n\"\\\\T\" : \"\\uD835\\uDD4B\" ,\n\"\\\\bT\" : \"\\uD835\\uDD4B\" ,\n\"\\\\U\" : \"\\uD835\\uDD4C\" ,\n\"\\\\bU\" : \"\\uD835\\uDD4C\" ,\n\"\\\\V\" : \"\\uD835\\uDD4D\" ,\n\"\\\\bV\" : \"\\uD835\\uDD4D\" ,\n\"\\\\W\" : \"\\uD835\\uDD4E\" ,\n\"\\\\bW\" : \"\\uD835\\uDD4E\" ,\n\"\\\\X\" : \"\\uD835\\uDD4F\" ,\n\"\\\\bX\" : \"\\uD835\\uDD4F\" ,\n\"\\\\Y\" : \"\\uD835\\uDD50\" ,\n\"\\\\bY\" : \"\\uD835\\uDD50\" ,\n\"\\\\Z\" : \"\\u2124\" ,\n\"\\\\bZ\" : \"\\u2124\" ,\n // Common abbreviations for \\mathcal letters\n\"\\\\cA\" : \"\\uD835\\uDC9C\" ,\n\"\\\\cB\" : \"\\u212C\" ,\n\"\\\\cC\" : \"\\uD835\\uDC9E\" ,\n\"\\\\cD\" : \"\\uD835\\uDC9F\" ,\n\"\\\\cE\" : \"\\u2130\" ,\n\"\\\\cF\" : \"\\u2131\" ,\n\"\\\\cG\" : \"\\uD835\\uDCA2\" ,\n\"\\\\cH\" : \"\\u210B\" ,\n\"\\\\cI\" : \"\\u2110\" ,\n\"\\\\cJ\" : \"\\uD835\\uDCA5\" ,\n\"\\\\cK\" : \"\\uD835\\uDCA6\" ,\n\"\\\\cL\" : \"\\u2112\" ,\n\"\\\\cM\" : \"\\u2133\" ,\n\"\\\\cN\" : \"\\uD835\\uDCA9\" ,\n\"\\\\cO\" : \"\\uD835\\uDCAA\" ,\n\"\\\\OO\" : \"\\uD835\\uDCAA\" ,\n\"\\\\cP\" : \"\\uD835\\uDCAB\" ,\n\"\\\\cQ\" : \"\\uD835\\uDCAC\" ,\n\"\\\\cR\" : \"\\u211B\" ,\n\"\\\\cS\" : \"\\uD835\\uDCAE\" ,\n\"\\\\cT\" : \"\\uD835\\uDCAF\" ,\n\"\\\\cU\" : \"\\uD835\\uDCB0\" ,\n\"\\\\cV\" : \"\\uD835\\uDCB1\" ,\n\"\\\\cW\" : \"\\uD835\\uDCB2\" ,\n\"\\\\cX\" : \"\\uD835\\uDCB3\" ,\n\"\\\\cY\" : \"\\uD835\\uDCB4\" ,\n\"\\\\cZ\" : \"\\uD835\\uDCB5\" ,\n // Common operators\n \"\\\\Pic\" : \"Pic\" ,\n \"\\\\Spec\" : \"Spec\" ,\n \"\\\\Proj\" : \"Proj\" ,\n // Misc\n\"\\\\eps\" : \"\\u03f5\" ,\n}\n;\nvar g_word_operators\n= {\"\\\\arccos\" : \"arccos\" ,\n\"\\\\arcsin\" : \"arcsin\" ,\n\"\\\\arctan\" : \"arctan\" ,\n\"\\\\arg\" : \"arg\" ,\n\"\\\\cos\" : \"cos\" ,\n\"\\\\cosh\" : \"cosh\" ,\n\"\\\\cot\" : \"cot\" ,\n\"\\\\coth\" : \"coth\" ,\n\"\\\\csc\" : \"csc\" ,\n\"\\\\deg\" : \"deg\" ,\n\"\\\\det\" : \"det\" ,\n\"\\\\dim\" : \"dim\" ,\n\"\\\\exp\" : \"exp\" ,\n\"\\\\gcd\" : \"gcd\" ,\n\"\\\\hom\" : \"hom\" ,\n\"\\\\ker\" : \"ker\" ,\n\"\\\\lg\" : \"lg\" ,\n\"\\\\ln\" : \"ln\" ,\n\"\\\\log\" : \"log\" ,\n\"\\\\Pr\" : \"Pr\" ,\n\"\\\\sec\" : \"sec\" ,\n\"\\\\sin\" : \"sin\" ,\n\"\\\\sinh\" : \"sinh\" ,\n\"\\\\tan\" : \"tan\" ,\n\"\\\\tanh\" : \"tanh\" ,\n}\n;\nvar g_big_word_operators\n= {\"\\\\inf\" : \"inf\" ,\n\"\\\\injlim\" : \"inj lim\" ,\n\"\\\\lim\" : \"lim\" ,\n\"\\\\liminf\" : \"lim inf\" ,\n\"\\\\limsup\" : \"lum sup\" ,\n\"\\\\max\" : \"max\" ,\n\"\\\\min\" : \"min\" ,\n\"\\\\projlim\" : \"proj lim\" ,\n\"\\\\sup\" : \"sup\" ,\n}\n;\nvar g_greek_letters\n= {\"\\\\alpha\" : \"\\u03b1\" ,\n\"\\\\beta\" : \"\\u03b2\" ,\n\"\\\\chi\" : \"\\u03c7\" ,\n\"\\\\delta\" : \"\\u03b4\" ,\n\"\\\\Delta\" : \"\\u0394\" ,\n\"\\\\digamma\" : \"\\u03dd\" ,\n\"\\\\epsilon\" : \"\\u03f5\" ,\n\"\\\\eta\" : \"\\u03b7\" ,\n\"\\\\gamma\" : \"\\u03b3\" ,\n\"\\\\Gamma\" : \"\\u0393\" ,\n\"\\\\iota\" : \"\\u03b9\" ,\n\"\\\\kappa\" : \"\\u03ba\" ,\n\"\\\\lambda\" : \"\\u03bb\" ,\n\"\\\\Lambda\" : \"\\u039b\" ,\n\"\\\\mu\" : \"\\u03bc\" ,\n\"\\\\nu\" : \"\\u03bd\" ,\n\"\\\\omega\" : \"\\u03c9\" ,\n\"\\\\Omega\" : \"\\u03a9\" ,\n\"\\\\phi\" : \"\\u03c6\" ,\n\"\\\\Phi\" : \"\\u03a6\" ,\n\"\\\\pi\" : \"\\u03c0\" ,\n\"\\\\Pi\" : \"\\u03a0\" ,\n\"\\\\psi\" : \"\\u03c8\" ,\n\"\\\\Psi\" : \"\\u03a8\" ,\n\"\\\\rho\" : \"\\u03c1\" ,\n\"\\\\sigma\" : \"\\u03c3\" ,\n\"\\\\Sigma\" : \"\\u03a3\" ,\n\"\\\\tau\" : \"\\u03c4\" ,\n\"\\\\theta\" : \"\\u03b8\" ,\n\"\\\\Theta\" : \"\\u0398\" ,\n\"\\\\upsilon\" : \"\\u03c5\" ,\n\"\\\\Upsilon\" : \"\\u03d2\" ,\n\"\\\\varepsilon\" : \"\\u03b5\" ,\n\"\\\\varkappa\" : \"\\u03f0\" ,\n\"\\\\varphi\" : \"\\u03d5\" ,\n\"\\\\varpi\" : \"\\u03d6\" ,\n\"\\\\varrho\" : \"\\u03f1\" ,\n\"\\\\varsigma\" : \"\\u03c2\" ,\n\"\\\\vartheta\" : \"\\u03d1\" ,\n\"\\\\xi\" : \"\\u03be\" ,\n\"\\\\Xi\" : \"\\u039e\" ,\n\"\\\\zeta\" : \"\\u03b6\" ,\n}\n;\nfunction v_fraction_to_mathml (tokens ) {\n var v_numerator = v_piece_to_mathml (tokens ) ;\n var v_denominator = v_piece_to_mathml (tokens ) ;\n return result_element( \"mfrac\" ,0 , v_numerator , v_denominator ) ;\n}\nfunction v_binom_to_mathml (tokens ) {\n var v_top = v_piece_to_mathml (tokens ) ;\n var v_bottom = v_piece_to_mathml (tokens ) ;\n return result_element( \"mrow\" ,0 , result_element( \"mo\" ,0 , \"(\" ) , result_element( \"mfrac\" , 1\n, \"linethickness\" , \"0\" , v_top , v_bottom ) , result_element( \"mo\" ,0 , \")\" ) ) ;\n}\nfunction v_sqrt_to_mathml (tokens ) {\n var v_index = v_optional_arg_to_mathml (tokens ) ;\n var v_object = v_piece_to_mathml (tokens ) ;\n if( ( v_index != null ) ) {\n return result_element( \"mroot\" ,0 , v_object , v_index ) ;\n }\n else {\n return result_element( \"msqrt\" ,0 , v_object ) ;\n }\n}\nfunction v_parenthesized_operator (tokens , v_word ) {\n var v_object = v_piece_to_mathml (tokens ) ;\n if( ( v_word != null ) ) {\n return result_element( \"mrow\" ,0 , result_element( \"mo\" ,0 , \"(\" ) , result_element( \"mo\" ,0 , v_word ) , v_object , result_element( \"mo\" ,0 , \")\" ) ) ;\n }\n else {\n return result_element( \"mrow\" ,0 , result_element( \"mo\" ,0 , \"(\" ) , v_object , result_element( \"mo\" ,0 , \")\" ) ) ;\n }\n}\nfunction v_operatorname_to_mathml (tokens ) {\n var v_result = result_element( \"mo\" ,0 , tokens.list[tokens.index] ) ;\n tokens.index++;\n return v_result ;\n}\nfunction v_displaystyle_to_mathml (tokens ) {\n var v_result = v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) ;\n return result_element( \"mstyle\" , 2\n, \"displaystyle\" , \"true\" , \"scriptlevel\" , \"0\" , v_result ) ;\n}\nfunction v_displaymath_to_mathml (tokens ) {\n var v_result = v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) ;\n v_finish_latex_block (tokens );\n return result_element( \"mstyle\" , 2\n, \"displaystyle\" , \"true\" , \"scriptlevel\" , \"0\" , v_result ) ;\n}\nfunction v_font_to_mathml (tokens , v_font_name ) {\n if( ( tokens.list[tokens.index] != \"{\" ) ) {\n var v_result = result_element( \"mi\" , 1\n, \"mathvariant\" , v_font_name , tokens.list[tokens.index] ) ;\n if( ( v_font_name == \"normal\" ) ) {\n result_set_attr(\nv_result , \"fontstyle\" , \"normal\" );\n }\n tokens.index++;\n return v_result ;\n }\n else {\n var v_result = v_piece_to_mathml (tokens ) ;\n result_set_attr(\nv_result , \"mathvariant\" , v_font_name );\n if( ( v_font_name == \"normal\" ) ) {\n result_set_attr(\nv_result , \"fontstyle\" , \"normal\" );\n }\n return v_result ;\n }\n}\nfunction v_old_font_to_mathml (tokens , v_font_name ) {\n return result_element( \"mstyle\" , 2\n, \"mathvariant\" , v_font_name , \"fontstyle\" , ( ( v_font_name == \"normal\" ) ? \"normal\" : null ) , v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) ) ;\n}\nfunction v_size_to_mathml (tokens , v_min_size , v_max_size ) {\n var v_result = v_piece_to_mathml (tokens ) ;\n result_set_attr(\nv_result , \"minsize\" , v_min_size );\n result_set_attr(\nv_result , \"maxsize\" , v_max_size );\n return v_result ;\n}\nfunction v_accent_to_mathml (tokens , v_char ) {\n return result_element( \"mover\" , 1\n, \"accent\" , \"true\" , v_piece_to_mathml (tokens ) , result_element( \"mo\" ,0 , v_char ) ) ;\n}\nfunction v_matrix_to_mathml (tokens , v_open_delim , v_close_delim ) {\n var v_mtable = v_matrix_to_mtable (tokens , result_element( \"mtable\" ,0) ) ;\n if( ( ( v_open_delim != null ) || ( v_close_delim != null ) ) ) {\n var v_mrow = result_element( \"mrow\" ,0) ;\n if( ( v_open_delim != null ) ) {\n result_element_append( v_mrow , result_element( \"mo\" ,0 , v_open_delim ) );\n }\n result_element_append( v_mrow , v_mtable );\n if( ( v_close_delim != null ) ) {\n result_element_append( v_mrow , result_element( \"mo\" ,0 , v_close_delim ) );\n }\n return v_mrow ;\n }\n else {\n return v_mtable ;\n }\n}\nfunction v_array_to_mathml (tokens ) {\n var v_mtable = result_element( \"mtable\" ,0) ;\n if( ( tokens.list[tokens.index] == \"{\" ) ) {\n tokens.index++;\n while( ( ( tokens.list[tokens.index] != null ) && ( tokens.list[tokens.index] != \"}\" ) ) ) {\n if( ( tokens.list[tokens.index] == \"c\" ) ) {\n result_append_attr(\nv_mtable , \"columnalign\" , \"center \" );\n }\n else if( ( tokens.list[tokens.index] == \"l\" ) ) {\n result_append_attr(\nv_mtable , \"columnalign\" , \"left \" );\n }\n else if( ( tokens.list[tokens.index] == \"r\" ) ) {\n result_append_attr(\nv_mtable , \"columnalign\" , \"right \" );\n }\n tokens.index++;\n }\n if( ( tokens.list[tokens.index] != null ) ) {\n tokens.index++;\n }\n }\n return v_matrix_to_mtable (tokens , v_mtable ) ;\n}\nfunction v_matrix_to_mtable (tokens , v_mtable ) {\n var v_mtr = result_element( \"mtr\" ,0) ;\n var v_mtd = result_element( \"mtd\" ,0) ;\n var v_token = tokens.list[tokens.index] ;\n result_element_append( v_mtable , v_mtr );\n result_element_append( v_mtr , v_mtd );\n while( ( ( v_token != null ) && ( v_token != \"\\\\end\" ) ) ) {\n if( ( v_token == \"\\\\\\\\\" ) ) {\n v_mtr = result_element( \"mtr\" ,0) ;\n v_mtd = result_element( \"mtd\" ,0) ;\n result_element_append( v_mtable , v_mtr );\n result_element_append( v_mtr , v_mtd );\n tokens.index++;\n }\n else if( ( v_token == \"&\" ) ) {\n v_mtd = result_element( \"mtd\" ,0) ;\n result_element_append( v_mtr , v_mtd );\n tokens.index++;\n }\n else {\n result_element_append( v_mtd , v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) );\n }\n v_token = tokens.list[tokens.index] ;\n }\n v_finish_latex_block (tokens );\n return v_mtable ;\n}\nfunction v_over_to_mathml (tokens , v_char ) {\n return result_element( \"mover\" ,0 , v_piece_to_mathml (tokens ) , result_element( \"mo\" ,0 , v_char ) ) ;\n}\nfunction v_under_to_mathml (tokens , v_char ) {\n return result_element( \"munder\" ,0 , v_piece_to_mathml (tokens ) , result_element( \"mo\" ,0 , v_char ) ) ;\n}\nfunction v_delimiter_to_mathml (tokens , v_end_command , v_min_size , v_max_size ) {\n var v_mrow = result_element( \"mrow\" ,0) ;\n result_element_append( v_mrow , result_element( \"mo\" , 2\n, \"minsize\" , v_min_size , \"maxsize\" , v_max_size , v_read_delimiter (tokens ) ) );\n result_element_append( v_mrow , v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) );\n if( ( tokens.list[tokens.index] != v_end_command ) ) {\n return v_mrow ;\n }\n tokens.index++;\n result_element_append( v_mrow , result_element( \"mo\" , 2\n, \"minsize\" , v_min_size , \"maxsize\" , v_max_size , v_read_delimiter (tokens ) ) );\n return v_mrow ;\n}\nfunction v_read_delimiter (tokens ) {\n var v_token = tokens.list[tokens.index] ;\n if( ( v_token == null ) ) {\n throw \"unexpected eof\" ;\n }\n else if( ( v_token == \".\" ) ) {\n tokens.index++;\n return \"\" ;\n }\n else if( ( v_token == \"<\" ) ) {\n tokens.index++;\n return \"\\u2329\" ;\n }\n else if( ( v_token == \">\" ) ) {\n tokens.index++;\n return \"\\u232a\" ;\n }\n else if( ( v_token in g_punct_and_space\n) ) {\n tokens.index++;\n return g_punct_and_space\n[ v_token ] ;\n }\n else if( ( v_token in g_left_delimiters\n) ) {\n tokens.index++;\n return g_left_delimiters\n[ v_token ] ;\n }\n else if( ( v_token in g_right_delimiters\n) ) {\n tokens.index++;\n return g_right_delimiters\n[ v_token ] ;\n }\n else if( ( v_token in g_operator_symbols\n) ) {\n tokens.index++;\n return g_operator_symbols\n[ v_token ] ;\n }\n else {\n throw \"invalid delimiter\" ;\n }\n}\nfunction v_latex_block_to_mathml (tokens ) {\n v_cmd = tokens.list[tokens.index] ;\n if( ( v_cmd in g_tex_environments\n) ) {\n tokens.index++;\n return g_tex_environments\n[ v_cmd ] (tokens ) ;\n }\n else {\n throw \"unknown command\" ;\n }\n}\nfunction v_finish_latex_block (tokens ) {\n if( ( tokens.list[tokens.index] == null ) ) {\n throw \"unexpected eof\" ;\n }\n tokens.index++;\n tokens.index++;\n}\nfunction v_combining_to_mathml (tokens , v_char ) {\n var v_base = tokens.list[tokens.index] ;\n tokens.index++;\n return result_element( \"mo\" ,0 , v_base , v_char ) ;\n}\nvar g_char_escape_codes\n= {\"93\" : \"#\" ,\n}\n;\nfunction v_char_escape_to_mathml (tokens ) {\n var v_result = null ;\n if( ( tokens.list[tokens.index] in g_char_escape_codes\n) ) {\n v_result = result_element( \"mtext\" ,0 , g_char_escape_codes\n[ tokens.list[tokens.index] ] ) ;\n }\n else {\n v_result = result_element( \"merror\" ,0 , \"\\\\char\" , tokens.list[tokens.index] ) ;\n }\n tokens.index++;\n return v_result ;\n}\nfunction v_text_to_mathml (tokens ) {\n if( ( tokens.list[tokens.index] != \"{\" ) ) {\n var v_result = result_element( \"mtext\" ,0 , tokens.list[tokens.index] ) ;\n tokens.index++;\n return v_result ;\n }\n tokens.index++;\n var v_result = null ;\n var v_mrow = null ;\n var v_node = null ;\n while( ( tokens.list[tokens.index] != null ) ) {\n if( ( tokens.list[tokens.index] == \"}\" ) ) {\n tokens.index++;\n return v_result ;\n }\n else if( ( tokens.list[tokens.index] == \"$\" ) ) {\n tokens.index++;\n v_node = v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) ;\n tokens.index++;\n }\n else {\n v_node = result_element( \"mtext\" ,0 , tokens.list[tokens.index] ) ;\n tokens.index++;\n }\n if( ( v_mrow != null ) ) {\n result_element_append( v_mrow , v_node );\n }\n else if( ( v_result != null ) ) {\n v_mrow = result_element( \"mrow\" ,0 , v_result , v_node ) ;\n v_result = v_mrow ;\n }\n else {\n v_result = v_node ;\n }\n }\n return v_result ;\n}\nvar g_tex_commands\n= {\n\"\\\\frac\" : v_fraction_to_mathml ,\n\"\\\\dfrac\" : v_fraction_to_mathml ,\n\"\\\\tfrac\" : v_fraction_to_mathml ,\n\"\\\\binom\" : v_binom_to_mathml ,\n\"\\\\sqrt\" : v_sqrt_to_mathml ,\n\"\\\\operatorname\" : v_operatorname_to_mathml ,\n\"\\\\displaystyle\" : v_displaystyle_to_mathml ,\n\"\\\\pod\" : function(tokens ) {return v_parenthesized_operator (tokens , null ) ;} ,\n\"\\\\pmod\" : function(tokens ) {return v_parenthesized_operator (tokens , \"mod\" ) ;} ,\n\"\\\\boldsymbol\" : function(tokens ) {return v_font_to_mathml (tokens , \"bold\" ) ;} ,\n\"\\\\bold\" : function(tokens ) {return v_font_to_mathml (tokens , \"bold\" ) ;} ,\n\"\\\\Bbb\" : function(tokens ) {return v_font_to_mathml (tokens , \"double-struck\" ) ;} ,\n\"\\\\mathbb\" : function(tokens ) {return v_font_to_mathml (tokens , \"double-struck\" ) ;} ,\n\"\\\\mathbbmss\" : function(tokens ) {return v_font_to_mathml (tokens , \"double-struck\" ) ;} ,\n\"\\\\mathbf\" : function(tokens ) {return v_font_to_mathml (tokens , \"bold\" ) ;} ,\n\"\\\\mathop\" : function(tokens ) {return v_font_to_mathml (tokens , \"normal\" ) ;} ,\n\"\\\\mathopen\" : function(tokens ) {return v_font_to_mathml (tokens , \"normal\" ) ;} ,\n\"\\\\mathclose\" : function(tokens ) {return v_font_to_mathml (tokens , \"normal\" ) ;} ,\n\"\\\\mathrm\" : function(tokens ) {return v_font_to_mathml (tokens , \"normal\" ) ;} ,\n\"\\\\mathfrak\" : function(tokens ) {return v_font_to_mathml (tokens , \"fraktur\" ) ;} ,\n\"\\\\germ\" : function(tokens ) {return v_font_to_mathml (tokens , \"fraktur\" ) ;} ,\n\"\\\\mathit\" : function(tokens ) {return v_font_to_mathml (tokens , \"italic\" ) ;} ,\n\"\\\\mathscr\" : function(tokens ) {return v_font_to_mathml (tokens , \"script\" ) ;} ,\n\"\\\\scr\" : function(tokens ) {return v_font_to_mathml (tokens , \"script\" ) ;} ,\n\"\\\\mathcal\" : function(tokens ) {return v_font_to_mathml (tokens , \"script\" ) ;} ,\n\"\\\\mathsf\" : function(tokens ) {return v_font_to_mathml (tokens , \"sans-serif\" ) ;} ,\n\"\\\\mathtt\" : function(tokens ) {return v_font_to_mathml (tokens , \"monospace\" ) ;} ,\n\"\\\\EuScript\" : function(tokens ) {return v_font_to_mathml (tokens , \"script\" ) ;} ,\n\"\\\\bf\" : function(tokens ) {return v_old_font_to_mathml (tokens , \"bold\" ) ;} ,\n\"\\\\rm\" : function(tokens ) {return v_old_font_to_mathml (tokens , \"normal\" ) ;} ,\n\"\\\\roman\" : function(tokens ) {return v_old_font_to_mathml (tokens , \"normal\" ) ;} ,\n\"\\\\tag\" : function(tokens ) {return v_old_font_to_mathml (tokens , \"bold\" ) ;} ,\n\"\\\\big\" : function(tokens ) {return v_size_to_mathml (tokens , \"2\" , \"2\" ) ;} ,\n\"\\\\Big\" : function(tokens ) {return v_size_to_mathml (tokens , \"3\" , \"3\" ) ;} ,\n\"\\\\bigg\" : function(tokens ) {return v_size_to_mathml (tokens , \"4\" , \"4\" ) ;} ,\n\"\\\\Bigg\" : function(tokens ) {return v_size_to_mathml (tokens , \"5\" , \"5\" ) ;} ,\n\"\\\\acute\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0301\" ) ;} ,\n\"\\\\grave\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0300\" ) ;} ,\n\"\\\\tilde\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0303\" ) ;} ,\n\"\\\\bar\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0304\" ) ;} ,\n\"\\\\breve\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0306\" ) ;} ,\n\"\\\\check\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u030c\" ) ;} ,\n\"\\\\hat\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0302\" ) ;} ,\n\"\\\\vec\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u20d7\" ) ;} ,\n\"\\\\dot\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0307\" ) ;} ,\n\"\\\\ddot\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u0308\" ) ;} ,\n\"\\\\dddot\" : function(tokens ) {return v_accent_to_mathml (tokens , \"\\u20db\" ) ;} ,\n\"\\\\underbrace\" : function(tokens ) {return v_under_to_mathml (tokens , \"\\ufe38\" ) ;} ,\n\"\\\\overbrace\" : function(tokens ) {return v_over_to_mathml (tokens , \"\\ufe37\" ) ;} ,\n\"\\\\underline\" : function(tokens ) {return v_under_to_mathml (tokens , \"\\u0332\" ) ;} ,\n\"\\\\overline\" : function(tokens ) {return v_over_to_mathml (tokens , \"\\u00af\" ) ;} ,\n\"\\\\widetilde\" : function(tokens ) {return v_over_to_mathml (tokens , \"\\u0303\" ) ;} ,\n\"\\\\widehat\" : function(tokens ) {return v_over_to_mathml (tokens , \"\\u0302\" ) ;} ,\n\"\\\\not\" : function(tokens ) {return v_combining_to_mathml (tokens , \"\\u0338\" ) ;} ,\n\"\\\\left\" : function(tokens ) {return v_delimiter_to_mathml (tokens , \"\\\\right\" , \"1\" , null ) ;} ,\n\"\\\\bigl\" : function(tokens ) {return v_delimiter_to_mathml (tokens , \"\\\\bigr\" , \"2\" , \"2\" ) ;} ,\n\"\\\\Bigl\" : function(tokens ) {return v_delimiter_to_mathml (tokens , \"\\\\Bigr\" , \"3\" , \"3\" ) ;} ,\n\"\\\\biggl\" : function(tokens ) {return v_delimiter_to_mathml (tokens , \"\\\\biggr\" , \"4\" , \"4\" ) ;} ,\n\"\\\\Biggl\" : function(tokens ) {return v_delimiter_to_mathml (tokens , \"\\\\Biggr\" , \"5\" , \"5\" ) ;} ,\n\"\\\\char\" : v_char_escape_to_mathml ,\n\"\\\\!\" : function(tokens ) {return null ;} ,\n\"\\\\text\" : v_text_to_mathml ,\n\"\\\\textnormal\" : v_text_to_mathml ,\n\"\\\\textrm\" : v_text_to_mathml ,\n\"\\\\textsl\" : v_text_to_mathml ,\n\"\\\\textit\" : v_text_to_mathml ,\n\"\\\\texttt\" : v_text_to_mathml ,\n\"\\\\textbf\" : v_text_to_mathml ,\n\"\\\\hbox\" : v_text_to_mathml ,\n\"\\\\mbox\" : v_text_to_mathml ,\n\"\\\\begin\" : v_latex_block_to_mathml ,\n}\n;\nvar g_tex_environments\n= {\"smallmatrix\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"(\" , \")\" ) ;} ,\n\"pmatrix\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"(\" , \")\" ) ;} ,\n\"bmatrix\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"[\" , \"]\" ) ;} ,\n\"Bmatrix\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"{\" , \"}\" ) ;} ,\n\"vmatrix\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"|\" , \"|\" ) ;} ,\n\"Vmatrix\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"\\u2016\" , \"\\u2016\" ) ;} ,\n\"cases\" : function(tokens ) {return v_matrix_to_mathml (tokens , \"{\" , null ) ;} ,\n\"array\" : v_array_to_mathml ,\n\"displaymath\" : v_displaymath_to_mathml ,\n}\n;\nvar g_limit_commands\n= {\"\\\\bigcap\" : \"\\u22c2\" ,\n\"\\\\bigcup\" : \"\\u22c3\" ,\n\"\\\\bigodot\" : \"\\u2a00\" ,\n\"\\\\bigoplus\" : \"\\u2a01\" ,\n\"\\\\bigotimes\" : \"\\u2a02\" ,\n\"\\\\bigsqcup\" : \"\\u2a06\" ,\n\"\\\\biguplus\" : \"\\u2a04\" ,\n\"\\\\bigvee\" : \"\\u22c1\" ,\n\"\\\\bigwedge\" : \"\\u22c0\" ,\n\"\\\\coprod\" : \"\\u2210\" ,\n\"\\\\prod\" : \"\\u220f\" ,\n\"\\\\sum\" : \"\\u2211\" ,\n\"\\\\inf\" : \"inf\" ,\n\"\\\\injlim\" : \"inj lim\" ,\n\"\\\\lim\" : \"lim\" ,\n\"\\\\liminf\" : \"lim inf\" ,\n\"\\\\limsup\" : \"lum sup\" ,\n\"\\\\max\" : \"max\" ,\n\"\\\\min\" : \"min\" ,\n\"\\\\projlim\" : \"proj lim\" ,\n\"\\\\sup\" : \"sup\" ,\n\"\\\\underbrace\" : null ,\n\"\\\\overbrace\" : null ,\n\"\\\\underline\" : null ,\n\"\\\\overline\" : null ,\n}\n;\nfunction v_piece_to_mathml (tokens ) {\n var v_token = tokens.list[tokens.index] ;\n var v_result = null ;\n if( ( v_token == \"{\" ) ) {\n tokens.index++;\n v_result = v_subexpr_chain_to_mathml (tokens , g_hard_stop_tokens\n) ;\n if( ( tokens.list[tokens.index] == \"}\" ) ) {\n tokens.index++;\n }\n }\n else if( ( v_token in g_relation_symbols\n) ) {\n v_result = result_element( \"mo\" ,0 , g_relation_symbols\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_operator_symbols\n) ) {\n v_result = result_element( \"mo\" ,0 , g_operator_symbols\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_left_delimiters\n) ) {\n v_result = result_element( \"mo\" ,0 , g_left_delimiters\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_right_delimiters\n) ) {\n v_result = result_element( \"mo\" ,0 , g_right_delimiters\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_word_operators\n) ) {\n v_result = result_element( \"mi\" , 1\n, \"mathvariant\" , \"normal\" , g_word_operators\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_greek_letters\n) ) {\n v_result = result_element( \"mi\" , 1\n, \"fontstyle\" , \"normal\" , g_greek_letters\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_named_identifiers\n) ) {\n v_result = result_element( \"mi\" ,0 , g_named_identifiers\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_punct_and_space\n) ) {\n v_result = result_element( \"mtext\" ,0 , g_punct_and_space\n[ v_token ] ) ;\n tokens.index++;\n }\n else if( ( v_token in g_tex_commands\n) ) {\n tokens.index++;\n v_result = g_tex_commands\n[ v_token ] (tokens ) ;\n }\n else {\n v_result = result_element( \"mn\" ,0 , v_token ) ;\n tokens.index++;\n }\n return v_result ;\n}\nfunction v_subexpr_to_mathml (tokens ) {\n var v_result = null ;\n var v_mmultiscripts = null ;\n var v_mprescripts = null ;\n if( ( ( tokens.list[tokens.length<=tokens.index+ 0 ? tokens.length-1 : tokens.index+ 0 ]\n== \"{\" ) && ( tokens.list[tokens.length<=tokens.index+ 1 ? tokens.length-1 : tokens.index+ 1 ]\n== \"}\" ) && ( ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]\n== \"_\" ) || ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]\n== \"^\" ) ) ) ) {\n v_mmultiscripts = result_element( \"mmultiscripts\" ,0) ;\n v_mprescripts = result_element( \"mprescripts\" ,0) ;\n result_element_append( v_mmultiscripts , v_mprescripts );\n while( ( ( tokens.list[tokens.length<=tokens.index+ 0 ? tokens.length-1 : tokens.index+ 0 ]\n== \"{\" ) && ( tokens.list[tokens.length<=tokens.index+ 1 ? tokens.length-1 : tokens.index+ 1 ]\n== \"}\" ) && ( ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]\n== \"_\" ) || ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]\n== \"^\" ) ) ) ) {\n var v_subscript = null ;\n var v_superscript = null ;\n tokens.index++;\n tokens.index++;\n if( ( tokens.list[tokens.index] == \"_\" ) ) {\n tokens.index++;\n v_subscript = v_piece_to_mathml (tokens ) ;\n }\n else if( ( tokens.list[tokens.index] == \"^\" ) ) {\n tokens.index++;\n v_superscript = v_piece_to_mathml (tokens ) ;\n }\n if( ( tokens.list[tokens.index] == \"_\" ) ) {\n tokens.index++;\n v_subscript = v_piece_to_mathml (tokens ) ;\n }\n else if( ( tokens.list[tokens.index] == \"^\" ) ) {\n tokens.index++;\n v_superscript = v_piece_to_mathml (tokens ) ;\n }\n result_element_append( v_mmultiscripts , ( ( v_subscript != null ) ? v_subscript : result_element( \"none\" ,0) ) );\n result_element_append( v_mmultiscripts , ( ( v_superscript != null ) ? v_superscript : result_element( \"none\" ,0) ) );\n }\n }\n var v_limit_style = ( tokens.list[tokens.index] in g_limit_commands\n) ;\n if( ( tokens.list[tokens.index] == null ) ) {\n if( ( v_mmultiscripts != null ) ) {\n result_element_prepend( v_mmultiscripts , result_element( \"mrow\" ,0) , v_mprescripts );\n return v_mmultiscripts ;\n }\n else {\n return result_element( \"mrow\" ,0) ;\n }\n }\n else if( ( tokens.list[tokens.index] in g_left_delimiters\n) ) {\n v_result = v_heuristic_subexpression (tokens ) ;\n }\n else {\n v_result = v_piece_to_mathml (tokens ) ;\n }\n var v_base = v_result ;\n var v_subscript = null ;\n var v_superscript = null ;\n if( ( tokens.list[tokens.index] == \"_\" ) ) {\n tokens.index++;\n v_subscript = v_piece_to_mathml (tokens ) ;\n }\n else if( ( tokens.list[tokens.index] == \"^\" ) ) {\n tokens.index++;\n v_superscript = v_piece_to_mathml (tokens ) ;\n }\n if( ( tokens.list[tokens.index] == \"_\" ) ) {\n tokens.index++;\n v_subscript = v_piece_to_mathml (tokens ) ;\n }\n else if( ( tokens.list[tokens.index] == \"^\" ) ) {\n tokens.index++;\n v_superscript = v_piece_to_mathml (tokens ) ;\n }\n if( ( v_mmultiscripts != null ) ) {\n result_element_prepend( v_mmultiscripts , v_base , v_mprescripts );\n result_element_prepend( v_mmultiscripts , ( ( v_subscript != null ) ? v_subscript : result_element( \"none\" ,0) ) , v_mprescripts );\n result_element_prepend( v_mmultiscripts , ( ( v_superscript != null ) ? v_superscript : result_element( \"none\" ,0) ) , v_mprescripts );\n }\n while( ( ( tokens.list[tokens.length<=tokens.index+ 0 ? tokens.length-1 : tokens.index+ 0 ]\n== \"{\" ) && ( tokens.list[tokens.length<=tokens.index+ 1 ? tokens.length-1 : tokens.index+ 1 ]\n== \"}\" ) && ( ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]\n== \"_\" ) || ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]\n== \"^\" ) ) ) ) {\n if( ( v_mmultiscripts == null ) ) {\n v_mmultiscripts = result_element( \"mmultiscripts\" ,0 , v_base ) ;\n v_mprescripts = null ;\n if( ( ( v_superscript != null ) || ( v_subscript != null ) ) ) {\n result_element_append( v_mmultiscripts , ( ( v_subscript != null ) ? v_subscript : result_element( \"none\" ,0) ) );\n result_element_append( v_mmultiscripts , ( ( v_superscript != null ) ? v_superscript : result_element( \"none\" ,0) ) );\n }\n }\n var v_subscript = null ;\n var v_superscript = null ;\n tokens.index++;\n tokens.index++;\n if( ( tokens.list[tokens.index] == \"_\" ) ) {\n tokens.index++;\n v_subscript = v_piece_to_mathml (tokens ) ;\n }\n else if( ( tokens.list[tokens.index] == \"^\" ) ) {\n tokens.index++;\n v_superscript = v_piece_to_mathml (tokens ) ;\n }\n if( ( tokens.list[tokens.index] == \"_\" ) ) {\n tokens.index++;\n v_subscript = v_piece_to_mathml (tokens ) ;\n }\n else if( ( tokens.list[tokens.index] == \"^\" ) ) {\n tokens.index++;\n v_superscript = v_piece_to_mathml (tokens ) ;\n }\n result_element_prepend( v_mmultiscripts , ( ( v_subscript != null ) ? v_subscript : result_element( \"none\" ,0) ) , v_mprescripts );\n result_element_prepend( v_mmultiscripts , ( ( v_superscript != null ) ? v_superscript : result_element( \"none\" ,0) ) , v_mprescripts );\n }\n if( ( v_mmultiscripts != null ) ) {\n v_result = v_mmultiscripts ;\n }\n else if( ( ( v_subscript != null ) && ( v_superscript != null ) ) ) {\n v_result = result_element( ( v_limit_style ? \"munderover\" : \"msubsup\" ) ,0 , v_base , v_subscript , v_superscript ) ;\n }\n else if( ( v_subscript != null ) ) {\n v_result = result_element( ( v_limit_style ? \"munder\" : \"msub\" ) ,0 , v_base , v_subscript ) ;\n }\n else if( ( v_superscript != null ) ) {\n v_result = result_element( ( v_limit_style ? \"mover\" : \"msup\" ) ,0 , v_base , v_superscript ) ;\n }\n return v_result ;\n}\nfunction v_subexpr_chain_to_mathml (tokens , v_stop_tokens ) {\n var v_result = null ;\n var v_mrow = null ;\n var v_mfrac = null ;\n var v_wrapped_result = null ;\n while( ( ( tokens.list[tokens.index] != null ) && !( ( tokens.list[tokens.index] in v_stop_tokens ) ) ) ) {\n if( ( tokens.list[tokens.index] == \"\\\\over\" ) ) {\n tokens.index++;\n v_mfrac = result_element( \"mfrac\" ,0 , v_result ) ;\n v_wrapped_result = v_mfrac ;\n v_mrow = null ;\n v_result = null ;\n }\n else if( ( tokens.list[tokens.index] == \"\\\\choose\" ) ) {\n tokens.index++;\n v_mfrac = result_element( \"mfrac\" , 1\n, \"linethickness\" , \"0\" , v_result ) ;\n v_wrapped_result = result_element( \"mrow\" ,0 , result_element( \"mo\" ,0 , \"(\" ) , v_mfrac , result_element( \"mo\" ,0 , \")\" ) ) ;\n v_mrow = null ;\n v_result = null ;\n }\n else {\n var v_node = v_collect_precedence_group (tokens , g_relations_precedence_group\n, v_stop_tokens , function(tokens , v_stop_tokens ) {return v_collect_precedence_group (tokens , g_addition_precedence_group\n, v_stop_tokens , function(tokens , v_stop_tokens ) {return v_collect_precedence_group (tokens , g_multiplication_precedence_group\n, v_stop_tokens , v_collect_invisible_group ) ;} ) ;} ) ;\n if( ( v_mrow != null ) ) {\n result_element_append( v_mrow , v_node );\n }\n else if( ( v_result != null ) ) {\n v_mrow = result_element( \"mrow\" ,0 , v_result , v_node ) ;\n v_result = v_mrow ;\n }\n else {\n v_result = v_node ;\n }\n }\n }\n if( ( v_mfrac != null ) ) {\n result_element_append( v_mfrac , v_result );\n return v_wrapped_result ;\n }\n else {\n return v_result ;\n }\n}\nvar g_optional_arg_stop_tokens\n= {\"&\" : null ,\n\"\\\\\\\\\" : null ,\n\"}\" : null ,\n\"$\" : null ,\n\"\\\\end\" : null ,\n\"\\\\right\" : null ,\n\"\\\\bigr\" : null ,\n\"\\\\Bigr\" : null ,\n\"\\\\biggr\" : null ,\n\"\\\\Biggr\" : null ,\n\"\\\\choose\" : null ,\n\"\\\\over\" : null ,\n\"]\" : null ,\n}\n;\nfunction v_optional_arg_to_mathml (tokens ) {\n if( ( tokens.list[tokens.index] != \"[\" ) ) {\n return null ;\n }\n tokens.index++;\n var v_result = v_subexpr_chain_to_mathml (tokens , g_optional_arg_stop_tokens\n) ;\n if( ( tokens.list[tokens.index] == \"]\" ) ) {\n tokens.index++;\n }\n return v_result ;\n}\nvar g_hard_stop_tokens\n= {\"&\" : null ,\n\"\\\\\\\\\" : null ,\n\"}\" : null ,\n\"$\" : null ,\n\"\\\\end\" : null ,\n\"\\\\right\" : null ,\n\"\\\\bigr\" : null ,\n\"\\\\Bigr\" : null ,\n\"\\\\biggr\" : null ,\n\"\\\\Biggr\" : null ,\n\"\\\\choose\" : null ,\n\"\\\\over\" : null ,\n}\n;\nvar g_right_delimiter_stop_tokens\n= {\"&\" : null ,\n\"\\\\\\\\\" : null ,\n\"}\" : null ,\n\"$\" : null ,\n\"\\\\end\" : null ,\n\"\\\\right\" : null ,\n\"\\\\bigr\" : null ,\n\"\\\\Bigr\" : null ,\n\"\\\\biggr\" : null ,\n\"\\\\Biggr\" : null ,\n\"\\\\choose\" : null ,\n\"\\\\over\" : null ,\n\")\" : \")\" ,\n\"]\" : \"]\" ,\n\"\\\\}\" : \"}\" ,\n\"\\\\rbrace\" : \"}\" ,\n\"\\\\rgroup\" : \")\" ,\n\"\\\\rvert\" : \"|\" ,\n\"\\\\rVert\" : \"\\u2016\" ,\n\"\\\\rceil\" : \"\\u2309\" ,\n\"\\\\rfloor\" : \"\\u230b\" ,\n\"\\\\rmoustache\" : \"\\u23b1\" ,\n\"\\\\rangle\" : \"\\u232a\" ,\n}\n;\nfunction v_heuristic_subexpression (tokens ) {\n var v_result = result_element( \"mrow\" ,0) ;\n result_element_append( v_result , v_piece_to_mathml (tokens ) );\n result_element_append( v_result , v_subexpr_chain_to_mathml (tokens , g_right_delimiter_stop_tokens\n) );\n if( ( ( tokens.list[tokens.index] != null ) && !( ( tokens.list[tokens.index] in g_hard_stop_tokens\n) ) ) ) {\n result_element_append( v_result , v_piece_to_mathml (tokens ) );\n }\n return v_result ;\n}\nvar g_relations_precedence_group\n= g_relation_symbols\n;\nvar g_addition_precedence_group\n= {\"+\" : null ,\n\"-\" : null ,\n\"\\\\oplus\" : null ,\n}\n;\nvar g_multiplication_precedence_group\n= {\"*\" : null ,\n\"\\\\times\" : null ,\n\"\\\\cdot\" : null ,\n\"/\" : null ,\n}\n;\nfunction v_collect_precedence_group (tokens , v_operators , v_stop_tokens , v_reader ) {\n var v_result = v_reader (tokens , v_stop_tokens ) ;\n var v_mrow = null ;\n while( ( ( tokens.list[tokens.index] != null ) && !( ( tokens.list[tokens.index] in v_stop_tokens ) ) && ( tokens.list[tokens.index] in v_operators ) ) ) {\n if( ( v_mrow == null ) ) {\n v_mrow = result_element( \"mrow\" ,0 , v_result ) ;\n v_result = v_mrow ;\n }\n result_element_append( v_mrow , v_piece_to_mathml (tokens ) );\n if( ( ( tokens.list[tokens.index] != null ) && ( tokens.list[tokens.index] in v_stop_tokens ) ) ) {\n return v_result ;\n }\n else {\n result_element_append( v_mrow , v_reader (tokens , v_stop_tokens ) );\n }\n }\n return v_result ;\n}\nfunction v_collect_invisible_group (tokens , v_stop_tokens ) {\n var v_result = v_subexpr_to_mathml (tokens ) ;\n var v_mrow = null ;\n while( ( ( tokens.list[tokens.index] != null ) && !( ( tokens.list[tokens.index] in v_stop_tokens ) ) && ( ( tokens.list[tokens.index] in g_named_identifiers\n) || ( tokens.list[tokens.index] in g_left_delimiters\n) ) ) ) {\n if( ( v_mrow == null ) ) {\n v_mrow = result_element( \"mrow\" ,0 , v_result ) ;\n v_result = v_mrow ;\n }\n result_element_append( v_mrow , result_element( \"mo\" ,0 , \"\\u2062\" ) );\n if( ( ( tokens.list[tokens.index] != null ) && ( tokens.list[tokens.index] in v_stop_tokens ) ) ) {\n return v_result ;\n }\n else {\n result_element_append( v_mrow , v_subexpr_to_mathml (tokens ) );\n }\n }\n return v_result ;\n}\n\n\nvar/*const*/ tokenize_re = /(\\\\begin|\\\\operatorname|\\\\mathrm|\\\\mathop|\\\\end)\\s*\\{\\s*([A-Z a-z]+)\\s*\\}|(\\\\[a-zA-Z]+|\\\\[\\\\#\\{\\},:;!])|(\\s+)|([0-9\\.]+)|([\\$!\"#%&'()*+,-.\\/:;<=>?\\[\\]^_`\\{\\|\\}~])|([a-zA-Z])/g;\n\nvar/*const*/ tokenize_text_re = /[\\${}\\\\]|\\\\[a-zA-Z]+|[^{}\\$]+/g;\n\nvar/*const*/ tokenize_text_commands = {\n '\\\\textrm': 1,\n '\\\\textsl': 1,\n '\\\\textit': 1,\n '\\\\texttt': 1,\n '\\\\textbf': 1,\n '\\\\textnormal': 1,\n '\\\\text': 1,\n '\\\\hbox': 1,\n '\\\\mbox': 1\n};\n\nfunction tokenize_latex_math(input)\n{\n var result = new Array();\n var in_text_mode = 0;\n var brace_level = [];\n var pos = 0;\n\n if(input.charAt(0) == '$' && \n input.charAt(input.length-1) == '$')\n input = input.slice(1, input.length-1);\n\n while(1) {\n if(!in_text_mode) {\n tokenize_re.lastIndex = pos;\n var m = tokenize_re.exec(input);\n pos = tokenize_re.lastIndex;\n\n if(m == null) {\n return result;\n } else if(m[1] != null) {\n result.push(m[1], m[2]);\n } else if(m[3] == '\\\\sp') {\n result.push('^');\n } else if(m[3] == '\\\\sb') {\n result.push('_');\n } else {\n if(m[0] == '$') {\n in_text_mode = 1;\n } else if(m[4] != null) {\n continue;\n } else if(m[3] != null && m[3] in tokenize_text_commands) {\n in_text_mode = 2;\n brace_level.push(0);\n } \n\n result.push(m[0]);\n }\n } else {\n tokenize_text_re.lastIndex = pos;\n var m = tokenize_text_re.exec(input);\n pos = tokenize_text_re.lastIndex;\n \n if(m == null) {\n return result;\n } else if(m[0] == '$') {\n in_text_mode = 0;\n } else if(m[0] == '{') {\n brace_level[brace_level.length-1]++;\n } else if(m[0] == '}') {\n if(--brace_level[brace_level.length-1] <= 0) {\n in_text_mode = 0;\n brace_level.pop();\n }\n }\n result.push(m[0]);\n }\n }\n}\n\n/*\nfunction post_process_mathml(event)\n{\n var url = GM_getValue('click-post-url', null);\n if(url == null)\n return;\n\n var ser = new XMLSerializer();\n var xhr = GM_xmlhttpRequest({ \n method: 'POST',\n url: url,\n headers: { 'Content-Type': 'text/xml; charset=utf-8',\n 'Content-Location': document.location },\n data: ser.serializeToString(event.currentTarget),\n onerror: function(details) {\n alert(\"There was an error processing the request. \" +\n \"HTTP status code \" + details.status + ' ' + details.statusText);\n },\n onload: function(details) {\n window.status = \"Successfully posted MathML. Status: \" \n + details.status + ' ' + details.statusText;\n }});\n\n window.status = \"Posting MathML to \" + url + \"...\";\n}\n*/\n\nfunction patch_img(node)\n{\n\n if(node.currentTarget)\n node = node.currentTarget;\n\n var alt = node.getAttribute('alt');\n\n if(alt == null || \n /^\\\\includegraphics|^\\$\\\\displaystyle \\\\xymatrix/.test(alt))\n return;\n\n var latex_string = null;\n \n \n\n \n if((node.parentNode.tagName == 'DIV' && \n node.parentNode.getAttribute('CLASS') == 'mathdisplay')\n || (node.parentNode.tagName == 'SPAN' &&\n node.parentNode.getAttribute('CLASS') == 'MATH'))\n {\n var parent = node.parentNode;\n var previous = parent.previousSibling;\n var/*const*/ non_whitespace = /[^\\s]/;\n\n if(previous &&\n previous.nodeType == node.TEXT_NODE &&\n !non_whitespace.test(previous.data))\n previous = previous.previousSibling;\n\n if(previous &&\n previous.nodeType == node.ELEMENT_NODE &&\n previous.tagName == 'P' &&\n previous.lastChild) \n {\n previous = previous.lastChild;\n if(previous &&\n previous.nodeType == node.TEXT_NODE &&\n !non_whitespace.test(previous.data))\n previous = previous.previousSibling;\n }\n\n if(previous &&\n previous.nodeType == node.COMMENT_NODE) {\n latex_string = previous.data.replace(/^\\s*MATH\\s*/, '')\n .replace(/\\s+$/, '');\n }\n }\n\n\n if(!latex_string && /^\\$.+\\$$/.test(alt)\n && !(/\\.{3} \\.{3}/.test(alt)))\n {\n latex_string = alt;\n }\n\n if(latex_string == null)\n return;\n\n \n tokens = new Object();\n tokens.list = tokenize_latex_math(latex_string);\n tokens.list.push(null);\n tokens.index = 0;\n\n var mathml = null;\n try {\n var mrow = v_subexpr_chain_to_mathml(tokens, {});\n fix_mathvariant(mrow, null);\n\n mathml = document.createElementNS(mmlns, 'math');\n mathml.setAttribute(\"latex\", latex_string);\n mathml.setAttribute(\"mathvariant\", \"normal\");\n mathml.appendChild(mrow);\n\n mathml.addEventListener(\"click\", post_process_mathml, false);\n\n } catch(e) {\n GM_log(\"Display LaTeX failed with error \" + e + \" on \" + latex_string);\n }\n\n \n if(mathml == null)\n return;\n\n node.parentNode.replaceChild(mathml, node);\n}\n\n\nfunction patch_text(node0) \n{\n var text = node0.nodeValue;\n var results = /\\$[^$]+\\$|\\[tex\\](.+?)\\[\\/tex\\]/.exec(text);\n\n if(results) {\n var latex_string = (results[1] == null ? results[0] : '$'+results[1]+'$');\n\n \n tokens = new Object();\n tokens.list = tokenize_latex_math(latex_string);\n tokens.list.push(null);\n tokens.index = 0;\n\n var mathml = null;\n try {\n var mrow = v_subexpr_chain_to_mathml(tokens, {});\n fix_mathvariant(mrow, null);\n\n mathml = document.createElementNS(mmlns, 'math');\n mathml.setAttribute(\"latex\", latex_string);\n mathml.setAttribute(\"mathvariant\", \"normal\");\n mathml.appendChild(mrow);\n\n mathml.addEventListener(\"click\", post_process_mathml, false);\n\n } catch(e) {\n GM_log(\"Display LaTeX failed with error \" + e + \" on \" + latex_string);\n }\n\n\n if(mathml == null)\n return;\n\n var node2 = node0.splitText(results.index);\n node2.deleteData(0, results[0].length);\n \n node2.parentNode.insertBefore(mathml, node2);\n\n\n patch_text(node2);\n }\n}\n\n\n\nfunction patch_element(node)\n{\n if(node.nodeType == node.TEXT_NODE)\n patch_text(node);\n else if(node.nodeType == node.ELEMENT_NODE) {if(node.tagName == 'TEXTAREA' || node.tagName == 'textarea' || \n node.tagName == 'INPUT' || node.tagName == 'input' || \n node.tagName == 'SCRIPT' || node.tagName == 'script')\n return;\n\n\n if(do_patch_images && (node.tagName == 'IMG' || node.tagName == 'img')) {\n if(!delayed_patch)\n patch_img(node);\n else\n node.addEventListener(\"click\", patch_img, false);\n\n return;\n }\n\n var child = node.firstChild;\n while(child) {\n var next = child.nextSibling;\n if (child.className == 'stopLatex2mml') {\n break;\n }\n patch_element(child);\n child = next;\n }\n }\n}\nthis.patch_element = patch_element;\n\n/*\nvar do_patch_images = GM_getValue(\"patch-images\", false);\nvar delayed_patch = GM_getValue(\"delayed-patch\", false);\n*/\nvar do_patch_images = true;\nvar delayed_patch = false;\n\n/*\nif( va_view == 'web' ){\n patch_element(document.documentElement);\n}\n*/\n}", "title": "" }, { "docid": "7bee416b3ab8367482b716127ad6e7e8", "score": "0.51361996", "text": "function cGovDoRegExp1(theRegExp, result) {\r\n\tvar done = false;\r\n\tvar offset = 0;\r\n\twhile (!done) {\r\n\t\tvar temp = result.substr(offset);\r\n\t\tif (temp == null) {\r\n\t\t\tdone = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar target = theRegExp.exec(temp);\r\n\t\t\t//alert(\"target = \" + target);\r\n\t\t\tif (target == null) {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\toffset += target.index;\r\n\t\t\t\tvar iDed = cGovAddUniqueID(target[1]);\r\n\t\t\t\tresult = result.replace(target[0],iDed);\r\n\t\t\t\t//alert(\"result = \" + result);\r\n\t\t\t\toffset += iDed.length;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "ba2ba4eb9a63adddda77bd4467b60a9d", "score": "0.51338196", "text": "function math(options) {\n\n this.add('role:math,cmd:sum', function sum(msg, respond) {\n respond(null, { answer: msg.left + msg.right })\n });\n\n this.add('role:math,cmd:product', function product(msg, respond) {\n respond(null, { answer: msg.left * msg.right })\n });\n\n // wrap matches all role:math patterns (this is called a pin) and extends them\n // in this case, it parses thing into numbers before calling the appropriate pattern with new values\n this.wrap('role:math', function (msg, respond) {\n msg.left = Number(msg.left).valueOf()\n msg.right = Number(msg.right).valueOf()\n this.prior(msg, respond)\n });\n}", "title": "" }, { "docid": "9ea5734e2d9659f3f843f2d3d1ac934d", "score": "0.5126935", "text": "function match(reg, text) {\n return gensequence_1.sequenceFromRegExpMatch(reg, text);\n}", "title": "" }, { "docid": "95b14c0e65222fa8806fe563f37bd018", "score": "0.5126355", "text": "function parse(input,options){return Parser.parse(input,options);}// This function tries to parse a single expression at a given", "title": "" }, { "docid": "f4de38646ed4e168d46ac6be9c94702a", "score": "0.5121849", "text": "function rxer (rx_string) {\n var letters,\n quantifier,\n q_rx;\n\n if (/\\/\\\\.+\\//.test(rx_string)) {\n letters = /\\/\\\\(.+)\\//.exec(rx_string)[1];\n if (/\\+|\\?|\\*/.test(letters)) {\n quantifier = /(\\+|\\?|\\*)/.exec(letters)[1];\n q_rx = new RegExp('\\\\' + quantifier, 'g');\n letters = letters.replace(q_rx, '\\\\' + quantifier);\n }\n return new RegExp('\\/\\\\\\\\' + letters + '\\/', 'g');\n }\n }", "title": "" }, { "docid": "43814005ec7b046c325c789ceabad31f", "score": "0.51218176", "text": "function getResult(input){\n //main algorithm\n if(hasErrors(input)){return \"ERROR!\";}\n console.log(\"INPUT= \"+input);\n input=input.replace(\"( -\",\"( 0 -\");\n input=input.replace(/\\s{2}/g,\" \");\n input=input.replace(/\\s$/,\"\");\n var input2=input.split(\" \");\n console.log(\"Spliteo= \"+input2);\n input2=findPs(input2);\n input2=calXQ(input2);\n input2=calPlus(input2);\n if (isNaN(input2[0])){return \"ERROR!\";}\n return input2[0];\n \n //method to calculate sums and differences\n function calPlus(arr){\n while (arr.length>1){\n if (arr[1]==\"+\"){\n arr[0]=(parseFloat(arr[0])+parseFloat(arr[2])).toPrecision(15);\n }else{\n arr[0]=(parseFloat(arr[0])-parseFloat(arr[2])).toPrecision(15);\n }\n arr.splice(1,2);\n }\n arr[0]=parseFloat(arr[0]);\n return arr;\n }\n \n //method to calculate products and divisions\n function calXQ (arr){\n var i=1;\n while (i<arr.length){\n if (arr[i]==\"X\"){\n arr[i-1]=(parseFloat(arr[i-1])*parseFloat(arr[i+1])).toPrecision(15);\n arr.splice(i,2);\n }else if (arr[i]==\"/\"){\n arr[i-1]=(parseFloat(arr[i-1])/parseFloat(arr[i+1])).toPrecision(15);\n arr.splice(i,2);\n }else{\n i+=2;\n }\n }\n return arr;\n \n }\n \n //method to find parentheses and calculate what's inside them\n function findPs(arr){\n console.log(\"arranque! findPs\")\n for (var j=0;j<arr.length;j++){\n console.log(\"estoy en\"+j+\"arr[j]=\"+arr[j]);\n if (arr[j]==\"(\"){\n var arr2=arr.slice(j+1,arr.indexOf(\")\",j));\n var l=arr2.length+1;\n console.log(\"arr2: \"+arr2+\" l: \"+l);\n arr2=calXQ(arr2);\n console.log(\"resultado XQ\"+arr2);\n arr[j]=calPlus(arr2);\n console.log(\"resultado +\"+arr[j]);\n arr.splice(j+1,l)\n console.log(\"resultado final\"+arr);\n }\n }\n console.log(\"resultado finallll\"+arr);\n return arr;\n }\n \n //errors checking method\n function hasErrors(str){\n if (str[1]==\"+\" || str[1]==\"-\" || str[1]==\"X\" || str[1]==\"/\"){return true;}\n if (str.match(/[+-X/]\\s{2}[+-X/]/)!=null){return true;}\n }\n \n }", "title": "" }, { "docid": "4a07e774c53cee64a1a1ba0a4816576f", "score": "0.5119244", "text": "function parseString(string) {\n \n var funcArr = [];\n string.split('').map((char) => {\n funcArr.push(computeSum(char))\n });\n \n Promise.all(funcArr)\n .then((...result) => {\n console.log(result)\n });\n}", "title": "" }, { "docid": "da4ca99fbb0966606e90185d2904180d", "score": "0.5117866", "text": "function searchQuestion(text) {\n\tvar re = new RegExp(text, \"g\");\n\n}", "title": "" }, { "docid": "e57c836ea6514754645c697e425acd17", "score": "0.51140404", "text": "function calcExpression() {\r\n var inputLine = document.getElementById(\"input-expression\").value;\r\n\r\n // check for division, calculate division and replace in the expression\r\n\r\n if (checkForDivision(inputLine)) {\r\n inputLine = calculateDivision(inputLine);\r\n }\r\n\r\n // check for multiplication, calculate multiplication and replace in the expression\r\n\r\n if (checkForMultiplication(inputLine)) {\r\n inputLine = calculateMultiplication(inputLine);\r\n }\r\n\r\n // check for subtraction, calculate subtraction and replace in the expression\r\n\r\n if (checkForSubtraction(inputLine)) {\r\n inputLine = calculateSubtraction(inputLine);\r\n }\r\n\r\n // check for addition, calculate addition and replace in the expression\r\n\r\n if (checkForAddition(inputLine)) {\r\n inputLine = calculateAddition(inputLine);\r\n }\r\n if (checkForAddition(inputLine)) {\r\n inputLine = calculateAddition(inputLine);\r\n }\r\n\r\n document.getElementById(\"output-data\").innerHTML = inputLine;\r\n\r\n}", "title": "" }, { "docid": "e1ce7d326ff335ddb4a12572b86246f6", "score": "0.5106529", "text": "function engine(inputString) {\n var stringMod = inputString\n .split('')\n .filter((elem) => elem !== ' ' && elem !== ',' && elem !== '_')\n .map((elem) => (elem == '–' ? (elem = '-') : elem))\n .join('')\n stringMod = stringMod.toLowerCase()\n var errorIndicator = false\n var minusIndecator = false\n var numbers = new Array()\n var tokens = new Array()\n let token = ''\n\n next: for (var i = 0; i <= stringMod.length - 1; i++) {\n var bit = stringMod[i].toString()\n if (Number.isInteger(+stringMod[i]) == true && minusIndecator == true) {\n for (var j = i + 1; j <= stringMod.length - 1; j++) {\n i = j\n if (\n Number.isInteger(+stringMod[j]) === false &&\n stringMod[j] !== '.'\n ) {\n i = j - 1\n break\n }\n bit += stringMod[j]\n }\n numbers.push(-parseFloat(bit))\n minusIndecator = false\n if (i + 1 !== stringMod.length) {\n continue next\n }\n } else if (\n stringMod[i] == '.' &&\n Number.isInteger(+stringMod[i + 1]) == true &&\n minusIndecator == true\n ) {\n for (var j = i + 1; j <= stringMod.length - 1; j++) {\n i = j\n if (\n Number.isInteger(+stringMod[j]) === false &&\n stringMod[j] !== '.'\n ) {\n i = j - 1\n break\n }\n bit += stringMod[j]\n }\n numbers.push(-parseFloat(bit))\n minusIndecator = false\n if (i + 1 !== stringMod.length) {\n continue next\n }\n } else if (Number.isInteger(+stringMod[i]) == true) {\n for (var j = i + 1; j <= stringMod.length - 1; j++) {\n i = j\n if (\n Number.isInteger(+stringMod[j]) === false &&\n stringMod[j] !== '.'\n ) {\n i = j - 1\n break\n }\n bit += stringMod[j]\n }\n numbers.push(parseFloat(bit))\n if (i + 1 !== stringMod.length) {\n continue next\n }\n } else if (\n stringMod[i] == '.' &&\n Number.isInteger(+stringMod[i + 1]) == true\n ) {\n for (var j = i + 1; j <= stringMod.length - 1; j++) {\n i = j\n if (\n Number.isInteger(+stringMod[j]) === false &&\n stringMod[j] !== '.'\n ) {\n i = j - 1\n break\n }\n bit += stringMod[j]\n }\n numbers.push(parseFloat(bit))\n\n if (i + 1 !== stringMod.length) {\n continue next\n }\n } else if (stringMod[i] == 'c') {\n if (i + 1 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 1] !== 'o') {\n errorIndicator = true\n break next\n } else if (stringMod[i + 2] !== 's') {\n errorIndicator = true\n break next\n } else {\n i += 2\n token = 'cos3'\n }\n } else if (stringMod[i] == 'a') {\n if (i + 1 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 1] == 'r') {\n if (stringMod[i + 2] !== 'c') {\n errorIndicator = true\n break next\n } else if (stringMod[i + 3] == 'c') {\n if (stringMod[i + 4] == 'o') {\n if (i + 4 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 5] !== 's') {\n errorIndicator = true\n break next\n } else {\n i += 5\n token = 'arccos3'\n }\n }\n } else if (stringMod[i + 3] == 's') {\n if (stringMod[i + 4] == 'i') {\n if (i + 4 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 5] !== 'n') {\n errorIndicator = true\n break next\n } else {\n i += 5\n token = 'arcsin3'\n }\n }\n } else if (stringMod[i + 3] == 't') {\n if (stringMod[i + 4] == 'a') {\n if (i + 4 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 5] !== 'n') {\n errorIndicator = true\n break next\n } else {\n i += 5\n token = 'arctan3'\n }\n }\n } else {\n errorIndicator = true\n break next\n }\n } else {\n errorIndicator = true\n break next\n }\n } else if (stringMod[i] == 's') {\n if (i + 1 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 1] == 'q') {\n if (stringMod[i + 2] !== 'r') {\n errorIndicator = true\n break next\n } else if (stringMod[i + 3] !== 't') {\n errorIndicator = true\n break next\n } else {\n i += 3\n token = 'sqrt3'\n }\n } else if (stringMod[i + 1] == 'i') {\n if (i + 1 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 2] !== 'n') {\n errorIndicator = true\n break next\n } else {\n i += 2\n token = 'sin3'\n }\n } else {\n errorIndicator = true\n break next\n }\n } else if (stringMod[i] == 't') {\n if (i + 1 >= stringMod.length) {\n errorIndicator = true\n break next\n } else if (stringMod[i + 1] !== 'a') {\n errorIndicator = true\n break next\n } else if (stringMod[i + 2] !== 'n') {\n errorIndicator = true\n break next\n } else {\n i += 2\n token = 'tan3'\n }\n } else if (stringMod[i] == 'e') {\n token = 'e3'\n } else if (stringMod[i] == '(') {\n tokens.push('(')\n continue next\n } else if (stringMod[i] == ')') {\n token = ')'\n } else if (stringMod[i] == '^') {\n token = '^3'\n } else if (stringMod[i] == '/') {\n token = '/2'\n } else if (stringMod[i] == '*') {\n token = '*2'\n } else if (stringMod[i] == '-') {\n if (tokens.length == 0) token = '-1'\n else if (Number.isInteger(+stringMod[i - 1]) == true) token = '-1'\n else if (Number.isInteger(+stringMod[i + 1]) !== true) token = '-1'\n else if (stringMod[i - 1] == ')') {\n minusIndecator = true\n token = '+1'\n } else {\n minusIndecator = true\n continue next\n }\n } else if (stringMod[i] == '+') {\n token = '+1'\n\n var t2 = token\n } else {\n errorIndicator = true\n break next\n }\n\n var k = numbers.length - 1\n var number = 0\n\n if (tokens.length == 0) {\n tokens.push(token)\n continue next\n } else if (tokens.length !== 0) {\n if (token == ')') {\n d1: do {\n k = numbers.length - 1\n if (tokens[tokens.length - 1].startsWith('+') == true) {\n number = numbers[k] + numbers[k - 1]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('-') == true\n ) {\n if (k === 0) {\n number = -numbers[k]\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n } else {\n number = numbers[k - 1] - numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n }\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('*') == true\n ) {\n number = numbers[k - 1] * numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('/') == true\n ) {\n number = numbers[k - 1] / numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('sqrt') == true\n ) {\n number = Math.sqrt(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('^') == true\n ) {\n number = Math.pow(numbers[k - 1], numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('sin') == true\n ) {\n if (DegCheck.checked)\n number = Math.sin((numbers[k] * Math.PI) / 180)\n else number = Math.sin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('cos') == true\n ) {\n if (DegCheck.checked)\n number = Math.cos((numbers[k] * Math.PI) / 180)\n else number = Math.cos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('tan') == true\n ) {\n if (DegCheck.checked)\n number = Math.tan((numbers[k] * Math.PI) / 180)\n else number = Math.tan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('e') == true\n ) {\n number = numbers[k - 1] * Math.pow(10, numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('arctan') == true\n ) {\n if (DegCheck.checked)\n number = (Math.atan(numbers[k]) / Math.PI) * 180\n else number = Math.atan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('arccos') == true\n ) {\n if (DegCheck.checked)\n number = (Math.acos(numbers[k]) / Math.PI) * 180\n else number = Math.acos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n } else if (\n tokens[tokens.length - 1].startsWith('arcsin') == true\n ) {\n if (DegCheck.checked)\n number = (Math.asin(numbers[k]) / Math.PI) * 180\n else number = Math.asin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d1\n }\n } while (tokens[tokens.length - 1] !== '(')\n tokens.splice(tokens.length - 1, 1)\n if (i + 1 !== stringMod.length) continue next\n else {\n d2: do {\n k = numbers.length - 1\n if (tokens[tokens.length - 1].startsWith('+') == true) {\n number = numbers[k] + numbers[k - 1]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('-') == true\n ) {\n if (k === 0) {\n number = -numbers[k]\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n } else {\n number = numbers[k - 1] - numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n }\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('*') == true\n ) {\n number = numbers[k - 1] * numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('/') == true\n ) {\n number = numbers[k - 1] / numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('sqrt') == true\n ) {\n number = Math.sqrt(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('^') == true\n ) {\n number = Math.pow(numbers[k - 1], numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('sin') == true\n ) {\n if (DegCheck.checked)\n number = Math.sin((numbers[k] * Math.PI) / 180)\n else number = Math.sin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('cos') == true\n ) {\n if (DegCheck.checked)\n number = Math.cos((numbers[k] * Math.PI) / 180)\n else number = Math.cos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('tan') == true\n ) {\n if (DegCheck.checked)\n number = Math.tan((numbers[k] * Math.PI) / 180)\n else number = Math.tan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('e') == true\n ) {\n number = numbers[k - 1] * Math.pow(10, numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('arctan') ==\n true\n ) {\n if (DegCheck.checked)\n number = (Math.atan(numbers[k]) / Math.PI) * 180\n else number = Math.atan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('arccos') ==\n true\n ) {\n if (DegCheck.checked)\n number = (Math.acos(numbers[k]) / Math.PI) * 180\n else number = Math.acos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n } else if (\n tokens[tokens.length - 1].startsWith('arcsin') ==\n true\n ) {\n if (DegCheck.checked)\n number = (Math.asin(numbers[k]) / Math.PI) * 180\n else number = Math.asin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d2\n }\n } while (tokens.length !== 0)\n }\n } else if (i + 1 == stringMod.length && tokens.length !== 0) {\n d3: do {\n k = numbers.length - 1\n if (tokens[tokens.length - 1].startsWith('+') == true) {\n number = numbers[k] + numbers[k - 1]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('-') == true\n ) {\n if (k === 0) {\n number = -numbers[k]\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n } else {\n number = numbers[k - 1] - numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n }\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('*') == true\n ) {\n number = numbers[k - 1] * numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('/') == true\n ) {\n number = numbers[k - 1] / numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('sqrt') == true\n ) {\n number = Math.sqrt(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('^') == true\n ) {\n number = Math.pow(numbers[k - 1], numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('sin') == true\n ) {\n if (DegCheck.checked)\n number = Math.sin((numbers[k] * Math.PI) / 180)\n else number = Math.sin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('cos') == true\n ) {\n if (DegCheck.checked)\n number = Math.cos((numbers[k] * Math.PI) / 180)\n else number = Math.cos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('tan') == true\n ) {\n if (DegCheck.checked)\n number = Math.tan((numbers[k] * Math.PI) / 180)\n else number = Math.tan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('e') == true\n ) {\n number = numbers[k - 1] * Math.pow(10, numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('arctan') == true\n ) {\n if (DegCheck.checked)\n number = (Math.atan(numbers[k]) / Math.PI) * 180\n else number = Math.atan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('arccos') == true\n ) {\n if (DegCheck.checked)\n number = (Math.acos(numbers[k]) / Math.PI) * 180\n else number = Math.acos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n } else if (\n tokens[tokens.length - 1].startsWith('arcsin') == true\n ) {\n if (DegCheck.checked)\n number = (Math.asin(numbers[k]) / Math.PI) * 180\n else number = Math.asin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d3\n }\n } while (tokens.length !== 0)\n } else if (tokens[tokens.length - 1] == '(') {\n tokens.push(token)\n continue next\n } else if (\n parseInt(token[token.length - 1]) >\n parseInt(\n tokens[tokens.length - 1][\n tokens[tokens.length - 1].length - 1\n ]\n )\n ) {\n tokens.push(token)\n continue next\n } else if (\n parseInt(token[token.length - 1]) <=\n parseInt(\n tokens[tokens.length - 1][\n tokens[tokens.length - 1].length - 1\n ]\n )\n ) {\n d4: do {\n k = numbers.length - 1\n var n = tokens.length - 1\n if (tokens[tokens.length - 1].startsWith('+') == true) {\n number = numbers[k] + numbers[k - 1]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('-') == true\n ) {\n if (k === 0) {\n number = -numbers[k]\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n } else {\n number = numbers[k - 1] - numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n }\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('*') == true\n ) {\n number = numbers[k - 1] * numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('/') == true\n ) {\n number = numbers[k - 1] / numbers[k]\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('sqrt') == true\n ) {\n number = Math.sqrt(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('^') == true\n ) {\n number = Math.pow(numbers[k - 1], numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('sin') == true\n ) {\n if (DegCheck.checked)\n number = Math.sin((numbers[k] * Math.PI) / 180)\n else number = Math.sin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('cos') == true\n ) {\n if (DegCheck.checked)\n number = Math.cos((numbers[k] * Math.PI) / 180)\n else number = Math.cos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('tan') == true\n ) {\n if (DegCheck.checked)\n number = Math.tan((numbers[k] * Math.PI) / 180)\n else number = Math.tan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('e') == true\n ) {\n number = numbers[k - 1] * Math.pow(10, numbers[k])\n numbers.splice(k - 1, 2)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('arctan') == true\n ) {\n if (DegCheck.checked)\n number = (Math.atan(numbers[k]) / Math.PI) * 180\n else number = Math.atan(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('arccos') == true\n ) {\n if (DegCheck.checked)\n number = (Math.acos(numbers[k]) / Math.PI) * 180\n else number = Math.acos(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n } else if (\n tokens[tokens.length - 1].startsWith('arcsin') == true\n ) {\n if (DegCheck.checked)\n number = (Math.asin(numbers[k]) / Math.PI) * 180\n else number = Math.asin(numbers[k])\n numbers.splice(k, 1)\n numbers.push(number)\n tokens.splice(tokens.length - 1, 1)\n if (tokens.length == 0) break d4\n }\n } while (\n parseInt(token[token.length - 1]) <=\n parseInt(\n tokens[tokens.length - 1][\n tokens[tokens.length - 1].length - 1\n ]\n ) &&\n tokens[tokens.length - 1] !== '('\n )\n tokens.push(token)\n }\n }\n if (tokens.length == 0 && i + 1 == stringMod.length - 1) break next\n }\n if (errorIndicator === true || inputB.children[0].value == NaN)\n inputB.children[0].value = 'Wrong input!'\n else {\n if (numbers.length == 0) inputB.children[0].value = ''\n else inputB.children[0].value = numbers[numbers.length - 1]\n return numbers[numbers.length - 1]\n }\n}", "title": "" }, { "docid": "ef670abe68ceba3d424eb1080599af30", "score": "0.5100499", "text": "function mathematica(hljs) {\n /*\n This rather scary looking matching of Mathematica numbers is carefully explained by Robert Jacobson here:\n https://wltools.github.io/LanguageSpec/Specification/Syntax/Number-representations/\n */\n const BASE_RE = /([2-9]|[1-2]\\d|[3][0-5])\\^\\^/;\n const BASE_DIGITS_RE = /(\\w*\\.\\w+|\\w+\\.\\w*|\\w+)/;\n const NUMBER_RE = /(\\d*\\.\\d+|\\d+\\.\\d*|\\d+)/;\n const BASE_NUMBER_RE = either(concat(BASE_RE, BASE_DIGITS_RE), NUMBER_RE);\n\n const ACCURACY_RE = /``[+-]?(\\d*\\.\\d+|\\d+\\.\\d*|\\d+)/;\n const PRECISION_RE = /`([+-]?(\\d*\\.\\d+|\\d+\\.\\d*|\\d+))?/;\n const APPROXIMATE_NUMBER_RE = either(ACCURACY_RE, PRECISION_RE);\n\n const SCIENTIFIC_NOTATION_RE = /\\*\\^[+-]?\\d+/;\n\n const MATHEMATICA_NUMBER_RE = concat(\n BASE_NUMBER_RE,\n optional(APPROXIMATE_NUMBER_RE),\n optional(SCIENTIFIC_NOTATION_RE)\n );\n\n const NUMBERS = {\n className: 'number',\n relevance: 0,\n begin: MATHEMATICA_NUMBER_RE\n };\n\n const SYMBOL_RE = /[a-zA-Z$][a-zA-Z0-9$]*/;\n const SYSTEM_SYMBOLS_SET = new Set(SYSTEM_SYMBOLS);\n /** @type {Mode} */\n const SYMBOLS = {\n variants: [\n {\n className: 'builtin-symbol',\n begin: SYMBOL_RE,\n // for performance out of fear of regex.either(...Mathematica.SYSTEM_SYMBOLS)\n \"on:begin\": (match, response) => {\n if (!SYSTEM_SYMBOLS_SET.has(match[0])) response.ignoreMatch();\n }\n },\n {\n className: 'symbol',\n relevance: 0,\n begin: SYMBOL_RE\n }\n ]\n };\n\n const NAMED_CHARACTER = {\n className: 'named-character',\n begin: /\\\\\\[[$a-zA-Z][$a-zA-Z0-9]+\\]/\n };\n\n const OPERATORS = {\n className: 'operator',\n relevance: 0,\n begin: /[+\\-*/,;.:@~=><&|_`'^?!%]+/\n };\n const PATTERNS = {\n className: 'pattern',\n relevance: 0,\n begin: /([a-zA-Z$][a-zA-Z0-9$]*)?_+([a-zA-Z$][a-zA-Z0-9$]*)?/\n };\n\n const SLOTS = {\n className: 'slot',\n relevance: 0,\n begin: /#[a-zA-Z$][a-zA-Z0-9$]*|#+[0-9]?/\n };\n\n const BRACES = {\n className: 'brace',\n relevance: 0,\n begin: /[[\\](){}]/\n };\n\n const MESSAGES = {\n className: 'message-name',\n relevance: 0,\n begin: concat(\"::\", SYMBOL_RE)\n };\n\n return {\n name: 'Mathematica',\n aliases: [\n 'mma',\n 'wl'\n ],\n classNameAliases: {\n brace: 'punctuation',\n pattern: 'type',\n slot: 'type',\n symbol: 'variable',\n 'named-character': 'variable',\n 'builtin-symbol': 'built_in',\n 'message-name': 'string'\n },\n contains: [\n hljs.COMMENT(/\\(\\*/, /\\*\\)/, {\n contains: [ 'self' ]\n }),\n PATTERNS,\n SLOTS,\n MESSAGES,\n SYMBOLS,\n NAMED_CHARACTER,\n hljs.QUOTE_STRING_MODE,\n NUMBERS,\n OPERATORS,\n BRACES\n ]\n };\n}", "title": "" }, { "docid": "1306645bf94b25ff2892ab216a55ff51", "score": "0.5087924", "text": "function quoteRegExp(str){return(str+'').replace(/[.?*+^$[\\]\\\\(){}|-]/g,'\\\\$&');}", "title": "" }, { "docid": "1306645bf94b25ff2892ab216a55ff51", "score": "0.5087924", "text": "function quoteRegExp(str){return(str+'').replace(/[.?*+^$[\\]\\\\(){}|-]/g,'\\\\$&');}", "title": "" }, { "docid": "4716af1bbaa47ea53b30c4e5cc7a0620", "score": "0.5086299", "text": "function calculate(expr) {\n return eval(expr);\n}", "title": "" }, { "docid": "b8676131b3981182079ef7adbf0e3d88", "score": "0.50858223", "text": "function calc(str , number1 , number2) {\n const operator = str;\n let sum ;\n \n\n\nif (operator == '+') {\n sum = number1 + number2;\n}\nelse if (operator == '-') {\n sum = number1 - number2;\n}\nelse if (operator == '*') {\n sum = number1 * number2;\n}\nelse {\n sum = number1 / number2;\n}\nreturn sum;\n}", "title": "" } ]
c06fcd4f944eda2b5a65f442d630ece7
Prev page on left arrow press
[ { "docid": "f89ec412414df764113aa2bfa5e5899e", "score": "0.0", "text": "function bindprevanchor(pvanchor) {\n\n // Bind forward key\n $(document).on(\"keydown.gridnavprev\", function(e) {\n\n // Only take action if the modal is not up\n if(!modalisupcb || !modalisupcb()) {\n var code = (e.keyCode ? e.keyCode : e.which);\n switch(code) {\n case 37:\n pvanchor.click();\n return false;\n break;\n }\n }\n });\n }", "title": "" } ]
[ { "docid": "3d0c60865dd2e4ab55916b545c642ebb", "score": "0.79010606", "text": "prev(){\n this.setPage(this.page-1);\n }", "title": "" }, { "docid": "b6780c20c15eb25b8d5be9d168c7ebab", "score": "0.7829246", "text": "goToPrev () {\n\t\t\tif (this.canGoToPrev) {\n\t\t\t\tthis.goTo(this.currentSlide - 1)\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "29b14b2c01d5e7a69107d5160321581d", "score": "0.78054553", "text": "prev(event) {\n this.changePage(this.current - 1, event);\n }", "title": "" }, { "docid": "466b2cdff5a3c02c9a9125db62d7ce72", "score": "0.7642931", "text": "function prevPage() {\n if (current_page > 1) {\n current_page--;\n changePage(current_page);\n }\n}", "title": "" }, { "docid": "ce97d23afa7d0de62228af752d457958", "score": "0.7634409", "text": "function prev() {\n //console.log(\"prev\")\n setCurrPage((prevPage) => { \n // wrap from page 0 to last page if needed\n return prevPage > 0 ? prevPage - 1 : numPages - 1; \n });\n }", "title": "" }, { "docid": "67e8b45182f2f0c75bf1172aedb9665d", "score": "0.759784", "text": "function goToPrev() {\r\n reachedFirstPage = $(\".navigation .selected\").parent().index() <= 0;\r\n\r\n if (reachedFirstPage && settings.continuous)\r\n {\r\n $(\".navigation .selected\").removeClass(\"selected\")\r\n $(\".navigation :last-child a\").addClass(\"selected\");\r\n }\r\n else if (reachedFirstPage && !settings.continuous)\r\n return;\r\n else\r\n $(\".navigation .selected\").removeClass(\"selected\").parent().prev().find(\"a\").addClass(\"selected\");\r\n\r\n updateSlideshowForSelectedPage();\r\n }", "title": "" }, { "docid": "c18d3734bf680b6ee39cc73922d7cf11", "score": "0.7546935", "text": "function prevPage() {\n log(\"prevPage()\");\n setPage(Math.max(1, getPage() - 1))\n}", "title": "" }, { "docid": "fd0340f6f1958b6319a0bf742498f934", "score": "0.7526649", "text": "goToPrevSlide() {\n if (this.currentSlide > 0) {\n this.currentSlide--;\n this.moveSlide(this.slideInfo());\n this.verifySlides();\n }\n }", "title": "" }, { "docid": "a321f58ac42d4b1344965f9d28c24894", "score": "0.7524642", "text": "function gotoPrevPage() {\n if (pokeId === 1) {\n return;\n } else {\n setPokeId(pokeId - 1);\n }\n }", "title": "" }, { "docid": "0e62225ce0b3ece20ed0ba50fcfd4d60", "score": "0.75235164", "text": "prevPage() {\n\t\tvar intf = this.parent.mode;\n\n\t\t// variables and check intf\n\t\tif (intf === 'align') var nowPage = this.nowPage;\n\t\telse if (intf === 'search') var nowPage = this.searchNowPage;\n\t\telse {\n\t\t\tconsole.log('invalid intf (align, search):', intf);\n\t\t\treturn;\n\t\t}\n\n\t\t// top\n\t\tif (nowPage[0] <= 0) return;\n\n\t\t// new pages\n\t\tnowPage.update(nowPage.map(page => page - 1));\n\n\t\t// display\n\t\tthis.displayPage(nowPage[0], 'front');\n\t\tthis.deletePage(nowPage[2] + 1);\n\t}", "title": "" }, { "docid": "d5db32719482b68bb204268e4086fc2a", "score": "0.75038815", "text": "function goPrevious() {\n if (selectedPage != 1) {\n startIndex -= 5;\n endIndex -= 5;\n selectedPage--;\n injectPage();\n injectPagination();\n }\n}", "title": "" }, { "docid": "7ed0d25a750613f954ca13f952e22b6d", "score": "0.74986637", "text": "showPrev(){if(1<this.instance.currentPage){this.instance.currentPage--;this.instance.queueRenderPage(this.instance.currentPage);this.currentPage--}}", "title": "" }, { "docid": "f9736b330f8bd4d425120f4b9b595703", "score": "0.7493117", "text": "function prevPage()\n{\n if (current_page > 1) {\n current_page--;\n changePage(current_page);\n }\n}", "title": "" }, { "docid": "f9736b330f8bd4d425120f4b9b595703", "score": "0.7493117", "text": "function prevPage()\n{\n if (current_page > 1) {\n current_page--;\n changePage(current_page);\n }\n}", "title": "" }, { "docid": "f9736b330f8bd4d425120f4b9b595703", "score": "0.7493117", "text": "function prevPage()\n{\n if (current_page > 1) {\n current_page--;\n changePage(current_page);\n }\n}", "title": "" }, { "docid": "36a23878e5b5907958c1b1bb5e113718", "score": "0.74767596", "text": "goPrevious() {\n const newPageIndex = (this.state.currentPageIndex === 0)\n ? this.props.pages.length - 1\n : this.state.currentPageIndex - 1;\n this.changePage(newPageIndex);\n }", "title": "" }, { "docid": "f5e2c3bb08d2f93318083eebfcebf963", "score": "0.7467773", "text": "function prev() {\n\t slide(false, false);\n\t }", "title": "" }, { "docid": "07474c0ca2034ae13b3bf2ac60ebf2c0", "score": "0.7467724", "text": "showPrev() {\n if (1 < this.instance.currentPage) {\n this.instance.currentPage--;\n this.instance.queueRenderPage(this.instance.currentPage);\n this.currentPage--;\n }\n }", "title": "" }, { "docid": "86ddb5340f2e69c752995472ee9f49c0", "score": "0.74506116", "text": "function prevButton() {\n if (currentPage != 1) {\n renderPage(--currentPage);\n }\n}", "title": "" }, { "docid": "c6eb78ef9abb2be75279e58f8627757c", "score": "0.74406564", "text": "function prev_page(){\n\tif(page-1 === 0){\n\t\treturn false;\n\t}\n\t// Only have to pass in page as it is decremented inside the turn_page() function\n\tturn_page(page-1);\n}", "title": "" }, { "docid": "2938d7eabb3371cfc4add9dad08f3152", "score": "0.74403876", "text": "prevPage() {\n this.page = Math.max(this.page - 1, 0);\n }", "title": "" }, { "docid": "38e946b5e8be5923552837e581cfce73", "score": "0.7417265", "text": "function prevPage() {\r\n if(currentPage > 1){\r\n currentPage = currentPage - 1;\r\n goToPage(currentPage);\r\n updatePaginationMenu($paginationMenu);\r\n }\r\n}", "title": "" }, { "docid": "909fd96cd5b37694fdb0e59f99f0247b", "score": "0.7397451", "text": "goPrev() {\n this.goStep(-1);\n }", "title": "" }, { "docid": "e6ac90e9fa7589b429e01de5db09c7d2", "score": "0.7391455", "text": "function prevPage(){\n if (activePageOffset >= 10){\n displayPage(activePageOffset - 10);\n }\n}", "title": "" }, { "docid": "d93ecc63cf6d8a77c3d64ff04adcf74c", "score": "0.73781717", "text": "onPrevClick(e) {\n\t\tlet newIndex = this.index - 1;\n\t\tif (newIndex < 0) {\n\t\t\tnewIndex = this.__slides.length - 1;\n\t\t}\n\t\tthis.showSeam();\n\t\tthis.updateIndex(newIndex);\n\t}", "title": "" }, { "docid": "aab11860ef576b09f7890d45c25a2815", "score": "0.7360719", "text": "function goPrevious(){\n\t\t\tif(options.currentPage != 1)\n\t\t\t{\n\t\t\t\tp = options.currentPage-1;\n\t\t\t\tsetCurrentPage(p);\n\t\t\t\tloadData(p);\n\t\t\t\toptions.currentPage=p;\n\t\t\t\tpageInfo();\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "c82f01d0019fcbc91c7d17a852ce547c", "score": "0.7358618", "text": "function prevPage () {\r\n\tif(CURRENT_PAGE>1) {\r\n\t\tCURRENT_PAGE = CURRENT_PAGE-1 ; \r\n\t\tpagination(NUMEBR_PAGES,CURRENT_PAGE);\r\n\t\tgetContentPage(CURRENT_PAGE,NUMBER_PER_PAGE);\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "6dc66ee17979c119272d3562541b2c91", "score": "0.73432463", "text": "prev() {\n if (this.__pageIndex > 1) {\n this.__pageIndex--;\n }\n }", "title": "" }, { "docid": "01edbd1654432f432780ca9fc89cf13e", "score": "0.73426044", "text": "function goLeft(){\r\n if(page==0){\r\n return;\r\n }\r\n page--;\r\n getImageInfo();\r\n }", "title": "" }, { "docid": "158fda859beb55ac87dc322586e48062", "score": "0.7340653", "text": "function prev () {\n slide(false, false);\n }", "title": "" }, { "docid": "158fda859beb55ac87dc322586e48062", "score": "0.7340653", "text": "function prev () {\n slide(false, false);\n }", "title": "" }, { "docid": "489c276c9291cbbb1d1b0e45420a1394", "score": "0.7304426", "text": "function navigatePrev() {\n\n\t\t// Prioritize revealing fragments\n\t\tif( previousFragment() === false ) {\n\t\t\tif( availableRoutes().up ) {\n\t\t\t\tnavigateUp();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fetch the previous horizontal slide, if there is one\n\t\t\t\tvar previousSlide = document.querySelector( HORIZONTAL_SLIDES_SELECTOR + '.past:nth-child(' + indexh + ')' );\n\n\t\t\t\tif( previousSlide ) {\n\t\t\t\t\tvar v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;\n\t\t\t\t\tvar h = indexh - 1;\n\t\t\t\t\tslide( h, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "489c276c9291cbbb1d1b0e45420a1394", "score": "0.7304426", "text": "function navigatePrev() {\n\n\t\t// Prioritize revealing fragments\n\t\tif( previousFragment() === false ) {\n\t\t\tif( availableRoutes().up ) {\n\t\t\t\tnavigateUp();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fetch the previous horizontal slide, if there is one\n\t\t\t\tvar previousSlide = document.querySelector( HORIZONTAL_SLIDES_SELECTOR + '.past:nth-child(' + indexh + ')' );\n\n\t\t\t\tif( previousSlide ) {\n\t\t\t\t\tvar v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;\n\t\t\t\t\tvar h = indexh - 1;\n\t\t\t\t\tslide( h, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "14888f76d549d752db075725306a64e4", "score": "0.73035175", "text": "function prevPage(){\n\n for(i=0;i<pagesCounter;i++){\n albumPage[i].hide();\n }\n \n currentPage = currentPage-2;\n if(currentPage < 0) currentPage=0;\n console.log(currentPage);\n albumPage[currentPage].show();\n albumPage[currentPage+1].show();\n\n _(\".pg-nr-left\").innerHTML = `${currentPage+1}`;\n _(\".pg-nr-right\").innerHTML = `${currentPage+2}`;\n\n selectPageNav();\n albumPage[currentPage].previewRefresh();\n albumPage[currentPage+2].previewRefresh();\n albumPage[currentPage+3].previewRefresh();\n }", "title": "" }, { "docid": "48af1421e23e70b90994a289f85240c7", "score": "0.7297336", "text": "function handlePrevBtnClick() {\n \n }", "title": "" }, { "docid": "477c7512c72e6bf134ac97af7b3fd4bb", "score": "0.72935724", "text": "function navigatePrev() {\n\n\t\t// Prioritize revealing fragments\n\t\tif( previousFragment() === false ) {\n\t\t\tif( availableRoutes().up ) {\n\t\t\t\tnavigateUp();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fetch the previous horizontal slide, if there is one\n\t\t\t\tvar previousSlide;\n\n\t\t\t\tif( config.rtl ) {\n\t\t\t\t\tpreviousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.future' ) ).pop();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpreviousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.past' ) ).pop();\n\t\t\t\t}\n\n\t\t\t\tif( previousSlide ) {\n\t\t\t\t\tvar v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;\n\t\t\t\t\tvar h = indexh - 1;\n\t\t\t\t\tslide( h, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "477c7512c72e6bf134ac97af7b3fd4bb", "score": "0.72935724", "text": "function navigatePrev() {\n\n\t\t// Prioritize revealing fragments\n\t\tif( previousFragment() === false ) {\n\t\t\tif( availableRoutes().up ) {\n\t\t\t\tnavigateUp();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fetch the previous horizontal slide, if there is one\n\t\t\t\tvar previousSlide;\n\n\t\t\t\tif( config.rtl ) {\n\t\t\t\t\tpreviousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.future' ) ).pop();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpreviousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.past' ) ).pop();\n\t\t\t\t}\n\n\t\t\t\tif( previousSlide ) {\n\t\t\t\t\tvar v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;\n\t\t\t\t\tvar h = indexh - 1;\n\t\t\t\t\tslide( h, v );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "8553ad75845569e4e05825d3a8bce5da", "score": "0.72929263", "text": "previous() {\n this.page--\n }", "title": "" }, { "docid": "4c1189b09a4ba84f6ef84799786b34ef", "score": "0.72860855", "text": "function prevPage() {\n if (page > 1) {\n setLoading(true);\n setPage(page - 1);\n }\n }", "title": "" }, { "docid": "08910e6adcf44733fba38ed7d00da6dc", "score": "0.7267021", "text": "function previousPage () {\n var i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n }", "title": "" }, { "docid": "8ce4480735a71b86b5266d0c7bbe73ec", "score": "0.7227214", "text": "function goPrevious() {\n //console.log(\"goPrevious: \" + options.currentPage);\n if (options.currentPage != 1) {\n var p = options.currentPage - 1;\n loadData(p);\n setCurrentPage(p);\n options.currentPage = p;\n pageInfo();\n }\n }", "title": "" }, { "docid": "84a56e9630df1d94a9f5bcfc31f7ff66", "score": "0.72190404", "text": "function prev_step() {\n if (current_slide.current_step - 1 < 0) {\n prev_slide(true);\n } else {\n current_slide.display_step(current_slide.current_step - 1);\n }\n}", "title": "" }, { "docid": "84a56e9630df1d94a9f5bcfc31f7ff66", "score": "0.72190404", "text": "function prev_step() {\n if (current_slide.current_step - 1 < 0) {\n prev_slide(true);\n } else {\n current_slide.display_step(current_slide.current_step - 1);\n }\n}", "title": "" }, { "docid": "937c1d8395fc4536a03029c331e14767", "score": "0.7209075", "text": "prevPage(){\n if(!this.noPrev){\n let newPageNum = parseInt(this.currentPage)-1;\n this.setPageData(newPageNum.toString());\n }\n }", "title": "" }, { "docid": "70c75df22cb0756db57dcab42e771604", "score": "0.71890426", "text": "function prevHandler(event) {\n const p = $(\".current\").prevAll(\".page:not(.disabled):first\");\n $(\".current\").removeClass(\"current\").hide();\n p.addClass(\"current\").show();\n validatePage();\n setFragment();\n }", "title": "" }, { "docid": "01d2535dc0cb6577a6d617b36657a17f", "score": "0.7188206", "text": "function previousPage(){if(!ctrl.canPageBack()){return;}var newOffset=MdTabsPaginationService.decreasePageOffset(getElements(),ctrl.offsetLeft);// Set the new offset\nctrl.offsetLeft=fixOffset(newOffset);}", "title": "" }, { "docid": "1b1fba89712b0bacda4e6daa2901d8fd", "score": "0.7187313", "text": "function handlePreviousPageButton() {\n page--;\n if (page < 1) page = 1;\n apiCall.omdb(currentSearch, true, page);\n }", "title": "" }, { "docid": "68dee389c318e87bc2bd5643434c3aff", "score": "0.7182233", "text": "function isPrev () {\n const prev = page === 0 ? 0 : page - 1\n setPage(prev)\n }", "title": "" }, { "docid": "587f1e56fb5ebe0cfa60cdaa8a2efe08", "score": "0.71726185", "text": "function getPrevPage() {\n getByRef(pagesController.prev.href, loadEventos);\n}", "title": "" }, { "docid": "088c1ed82de16acd342bb5d7cd516be5", "score": "0.7144727", "text": "function _showPreviousPage() {\n RightMenu.showRightMenu(Pages.modifySerieResumeStep, currentGraph);\n }", "title": "" }, { "docid": "8f25d559f528841536c5a5c9ba1d4163", "score": "0.71388656", "text": "function prevpage() {\n return (getprevpagediv())[0];\n }", "title": "" }, { "docid": "5be090335805648255c338ac7ff19e52", "score": "0.7131307", "text": "function goPrevPage() {\n if(g_page > 1) {\n g_page--;\n\n if(getUrlQueryString(true)) {\n var url = '/notes?' + getUrlQueryString(true);\n\n url = url.replace(new RegExp(\"\\\\?p=[0-9]+\", \"gi\"), '?');\n url = url.replace(new RegExp(\"\\\\&p=[0-9]+\", \"gi\"), '');\n url = url.replace('?&', '?');\n url += '&';\n } else {\n url = '/notes?';\n }\n\n url += 'p=' + g_page;\n\n g_note_index = 1;\n createCookie(g_note_index_cookie, g_note_index, 30);\n\n location.href = url;\n }\n}", "title": "" }, { "docid": "b09cfec88b751c93e381049a2cfd8375", "score": "0.71186954", "text": "function prevPage() {\n if (currentPage > 1) {\n currentPage--;\n changePage(currentPage, filterData);\n }\n}", "title": "" }, { "docid": "8326a66b1858b6ba9fde040686bdfa8d", "score": "0.7117024", "text": "prev() {\n\t\tif (!(this.currentIndex === 0)) {\n\t\t\tthis.currentIndex --;\n\t\t\tthis.changeSlide(this.currentIndex + 1);\n\t\t}\n\t}", "title": "" }, { "docid": "cb21bbb1762842b04ea103e48c9bc689", "score": "0.71113294", "text": "function previous() {\n let active = document.querySelector(\".page-item.active\");\n let value = parseInt(active.firstElementChild.getAttribute(\"value\"));\n if (value !== 1) {\n go_page(value - 1);\n }\n}", "title": "" }, { "docid": "dbb6b30becbbefebbe2c79694a15dea4", "score": "0.71065253", "text": "getPrevPage () {\n const currentPage = this.getCurrentPage()\n if (currentPage > 1) {\n return currentPage - 1\n }\n return null\n }", "title": "" }, { "docid": "71ce3d51821e69e8b47fc515fd605466", "score": "0.7091715", "text": "prevPage() {\n if (!this.state.page-1 < 0) {\n this.setState({\n page: this.state.page-1\n });\n }\n console.log('Continue to ' + this.state.page.toString());\n }", "title": "" }, { "docid": "fe104de4e5b518c3a1b4986223203ea9", "score": "0.70888984", "text": "_goToPrevCard() {\n if (this._btnPrev.disabled === false) {\n this._goToCard(this._currentPos - 1);\n }\n }", "title": "" }, { "docid": "763437881a3478459c1bf33ef782d623", "score": "0.7080596", "text": "previousPage() {\n\t\tthis.collection.prev().trigger( 'page-changed' );\n\t}", "title": "" }, { "docid": "80a1e465076c5f58a2059a409451d62e", "score": "0.70696735", "text": "function prevPage() {\n parent.window.loadPrevPage();\n }", "title": "" }, { "docid": "7fda2df73bdd09f44f5a8ffcefaeba3e", "score": "0.7061598", "text": "function _prevPage(){//------------------------------------------------------ prevPage() ----------------->>>>>\n\t\tif(TIARA.Content.pages.length===1){return;}\n\t\tif(TIARA.currentPage>0){\n\t\t\tTIARA.currentPage--;\n\t\t}else{\n\t\t\tTIARA.currentPage = TIARA.Content.pages.length-1;\n\t\t}\n\t\t_log(\"Loaded Page\",TIARA.currentPage);\n\t\t_loadPage();\n\t\tthisObj.annotationModes.newPageCleanup();\n\t}", "title": "" }, { "docid": "111267fdcd784f44f0a1ea6acc501dc0", "score": "0.7055708", "text": "function prev(e) {\n var cur = active();\n if(cur)\n to(cur.$index - 1, true, e);\n }", "title": "" }, { "docid": "2ce556c5808d960d2b5acd4786c991a2", "score": "0.7046364", "text": "function navprev( prev ) {\n $( \":mobile-pagecontainer\" ).pagecontainer( \"change\", prev + \".html\", {\n transition: \"slide\",\n reverse: true\n });\n }", "title": "" }, { "docid": "b0cf2ba2a75ff3f5479e25fc2d66d00b", "score": "0.70164436", "text": "function btnPrev() {\n // if button is pressed from the help page, return to last visited page\n if(document.getElementById(\"btn-prev\").innerHTML == \"Return\") {\n $('#btn-prev').html('Previous');\n toPage(curPage, true);\n } else { // else, go back one page\n toPage(curPage - 1, false);\n }\n}", "title": "" }, { "docid": "6fe9a1b620931df8029893a8d0a89de9", "score": "0.6998327", "text": "function goToPrev() {\n slider.children[current].classList.toggle('show-inf-block');\n sliderIndicators.children[current].classList.toggle('current-indicator');\n current -= 1;\n if (current < 0) {\n current = countElements - 1;\n }\n slider.children[current].classList.toggle('show-inf-block');\n sliderIndicators.children[current].classList.toggle('current-indicator');\n}", "title": "" }, { "docid": "6e74d4b8ea2e089a4bdd2a86d35608f6", "score": "0.69864434", "text": "movePrev() {\n this.stopTimer();\n\n let prev = this.currentIndex - 1;\n let index = this.slides[prev] ? prev : this.slides.length - 1;\n\n this.moveToIndex(index, 'prev');\n }", "title": "" }, { "docid": "b5bcadcf17ded8c14f030303c143a228", "score": "0.69750255", "text": "previousPage() {\n if (!this.hasPreviousPage()) {\n return;\n }\n const previousPageIndex = this.pageIndex;\n this.pageIndex--;\n this._emitPageEvent(previousPageIndex);\n }", "title": "" }, { "docid": "b5bcadcf17ded8c14f030303c143a228", "score": "0.69750255", "text": "previousPage() {\n if (!this.hasPreviousPage()) {\n return;\n }\n const previousPageIndex = this.pageIndex;\n this.pageIndex--;\n this._emitPageEvent(previousPageIndex);\n }", "title": "" }, { "docid": "b5bcadcf17ded8c14f030303c143a228", "score": "0.69750255", "text": "previousPage() {\n if (!this.hasPreviousPage()) {\n return;\n }\n const previousPageIndex = this.pageIndex;\n this.pageIndex--;\n this._emitPageEvent(previousPageIndex);\n }", "title": "" }, { "docid": "e19dc8b456c9cf87119fd10dc5501730", "score": "0.69666797", "text": "function previouspage()\n {\n\tif (pageNumber > 1) {\n\t\tpageNumber -= 1;\n\t\tchangepage(); \t\n\t}\n }", "title": "" }, { "docid": "69e60afda98de0c0dd8afa47d9b7a374", "score": "0.69640887", "text": "function prevPage() {\n if (vm.prevPageAvailable) {\n vm.pageParams.offset -= vm.pageParams.limit\n vm.pageParams.updated++\n }\n }", "title": "" }, { "docid": "f70b41dbb0e5a041c2b777821b454fd8", "score": "0.69619465", "text": "prev(step = 1) {\n if (this.isAnimated) {\n return;\n }\n\n var previousItemIndex = this._getPreviousItemIndex(step);\n\n this.currentItemIndex = previousItemIndex;\n Axentix.createEvent(this.el, 'tab.prev', {\n step\n });\n var target = this.tabLinks[previousItemIndex].children[0].getAttribute('href');\n this.select(target.split('#')[1]);\n }", "title": "" }, { "docid": "61385dfe8baa25e1fe39129bf3bfeac4", "score": "0.6960483", "text": "get prevPage () {\n return this.page > 1 ? this.page - 1 : null;\n }", "title": "" }, { "docid": "c4bf0e3cfd78c20e510d3ceeaf495bd6", "score": "0.69488925", "text": "function prev()\n {\n hook('beforePrev');\n hook('beforeNextPrev');\n\n if($pwCurrentSlide.prev().hasClass(\"pw-previewer\"))\n {\n $pwCurrentSlide.prevAll(\".pw-slide-group-last:first\").click();\n }\n else\n {\n if($pwCurrentSlide.prevAll(\".pw-slide:first\").length == 0)\n {\n $(\".pw-slide:last\").click();\n $newContent = $(\".pw-slide:last\");\n }\n else\n {\n $newContent = $pwCurrentSlide.prevAll(\".pw-slide:first\");\n }\n\n $pwCurrentSlide = $newContent;\n\n $pwCurrentPreviewer.empty();\n $pwCurrentPreviewer.append(\"<span class='pw-previewer-close'>x</span>\");\n $(\".pw-previewer-close\").click(function() {\n $pwCurrentSlide = 0;\n $pwCurrentPreviewer.empty();\n $pwCurrentPreviewer = 0;\n\n $(\".pw-previewer\").addClass(\"hide\").stop().slideUp(options.speed);\n });\n\n $newContent.children().clone().appendTo($pwCurrentPreviewer);\n }\n\n $('html,body').animate({\n scrollTop: $pwCurrentPreviewer.offset().top - options.topOffset\n }, options.speed);\n\n hook('afterPrev');\n hook('afterNextPrev');\n }", "title": "" }, { "docid": "c1024b25331f5611a100e230296c6ce0", "score": "0.69478464", "text": "function arrowKey(e){\r\n\r\n switch(e.which){\r\n // Quando si utilizza ArrowLeft\r\n case 37: goPrev();\r\n break;\t\r\n // Quando si utilizza ArrowRight\r\n case 39:\tgoNext();\r\n break;\r\n }\r\n\r\n}", "title": "" }, { "docid": "f494a8fcec56121ae785684e02805169", "score": "0.69442475", "text": "function prev() {}", "title": "" }, { "docid": "25d8d6bada35cfc8b55e8379cd626a51", "score": "0.6943535", "text": "prev() {\n this.slide(-1);\n }", "title": "" }, { "docid": "7e71e5428b2cbb05e8b0f7e2d94618d5", "score": "0.6920218", "text": "function prevPage(){\n pageNumber = getQueryVariable(\"page\");\n var navTo = window.location.href;\n var pageInt;\n // If we're already at page 1 or index, calling this function again won't track in the browser history\n if(parseInt(pageNumber) !== 1 && parseInt(pageNumber) !== 0){\n if(pageNumber && !isNaN(parseInt(pageNumber))){\n pageInt = parseInt(pageNumber);\n if(pageInt - 1 > 0){\n pageInt = pageInt - 1;\n }\n navTo = navTo.replace(window.location.search, \"\");\n navTo = navTo + \"?page=\" + pageInt;\n } else if(!pageNumber){\n // In case function is called while on front page\n if(hasCover){\n // If hasCover is true, function takes us to latest page\n pageInt = pageCount;\n } else {\n // Otherwise, function takes us to next to last page\n pageInt = pageCount - 1;\n }\n navTo = navTo.replace(window.location.search, \"\");\n navTo = navTo + \"?page=\" + pageInt;\n }\n if(Modernizr.history){\n // Use HTML5 history magic\n history.pushState(null, null, navTo);\n printPage(pageInt);\n } else {\n // Use older transition method as fallback\n window.location.assign(navTo);\n }\n }\n }", "title": "" }, { "docid": "c31fa487da3086018a11a3dc492f4ff3", "score": "0.6916255", "text": "function showPrevSlide() {\n index = activeSlide - 1;\n showSlide(index);\n}", "title": "" }, { "docid": "71e056db6a54a73c95d17eeb2570beff", "score": "0.68929154", "text": "function hasPrev(pg) {\n pg = pg || scope.page;\n return pg - 1 > 0;\n }", "title": "" }, { "docid": "d36e0fdfb75b4df4fbfc538d606031f6", "score": "0.6892177", "text": "function _prev()\n{\n _flip(currentIndex - 1);\n}", "title": "" }, { "docid": "2b0da62f1d419cdcbcd690bd20ef1f18", "score": "0.6886317", "text": "function handlePrevButtonClick() {\n if (curr_page > 1) {\n curr_page--;\n renderTable();\n }\n\n // disabble and enable buttons\n if (curr_page == 1) $prevBtn.classList.add(\"disabled\");\n $nextBtn.classList.remove(\"disabled\");\n}", "title": "" }, { "docid": "7f76c8ac3dacf62a6424a79dbb7cf001", "score": "0.6867003", "text": "function goToPrevSlide()\n{\n if (currentSlide.previousElementSibling)\n {\n goToSlide(currentSlide.previousElementSibling);\n } else {\n goToSlide(slides[slides.length-1])\n }\n}", "title": "" }, { "docid": "1ebf5bb8ff6ace3489f3889bc85fa479", "score": "0.68636096", "text": "prev() {\n this.gotoItem(this.currentItem - 1);\n }", "title": "" }, { "docid": "f11378b035532e1ce4aaebfa0d712b86", "score": "0.68555033", "text": "function prev(){\n $(\"#prev\").on('click',function(){\n currentPage--;\n PageRender(currentPage);\n disableButton();\n // console.log(currentPage);\n initialise();\n buttonPlay.classList.remove('glyphicon-pause');\n \t\t\tbuttonPlay.classList.add('glyphicon-play');\n });\n\n}", "title": "" }, { "docid": "ef810d104a30dd29cf712f438b3fd2e2", "score": "0.68471384", "text": "prev() {\n var self = this,\n a = self.page - 1;\n if (self.validPage(a)) {\n self.page = a;\n }\n return self;\n }", "title": "" }, { "docid": "c0278e385c538531adc5cdaa58df618c", "score": "0.6839898", "text": "function onPrevButtonClick(objButton) {\n\n if (g_functions.isButtonDisabled(objButton))\n return (true);\n\n if (g_options.strippanel_buttons_role == \"advance_item\")\n g_gallery.prevItem();\n else\n g_objStrip.scrollBack();\n }", "title": "" }, { "docid": "37e092dc0266eb4fc87edc5435a5bb4e", "score": "0.6832903", "text": "function prevStep() {\n // TODO: when change the minor version we can remove this old event.\n var evt = jQuery.Event('PrevStepEvent');\n $(document).trigger(evt);\n\n var beforeEvent = jQuery.Event('BeforePrevStep');\n $(document).trigger(beforeEvent);\n\n if (!evt.isDefaultPrevented() && !beforeEvent.isDefaultPrevented()) {\n var $el = $(config.selectors.nav).find(config.classes.active).prev('li').find(config.selectors.button);\n changeStep($el);\n $(document).trigger(jQuery.Event('AfterPrevStep'));\n }\n }", "title": "" }, { "docid": "dedfe7ddf1cf14bc6b7892a09ff8e405", "score": "0.6818194", "text": "function prev()\n{\n var page = $('[step]:visible').attr('step');\n var stepNumber = parseInt(page, 10);\n var currPage = \"[step='\"+stepNumber+\"']\";\n var prevPage = \"[step='\"+(stepNumber-1)+\"']\";\n\n switch (stepNumber)\n {\n // minor\n case 2:\n $(\"#prev\").hide(500);\n\n break;\n\n // requirements\n case 4:\n $(\"#credit-count\").hide(500);\n \n break;\n\n // prerequisites\n case 5:\n // user.removeAddedCourses();\n\n break;\n\n //create schedule\n case 6:\n $(\"#next\").show(500);\n $(\"#credit-count\").show(500);\n \n break;\n\n }\n\n $(currPage).fadeOut(500, function() {\n $(prevPage).fadeIn(500);\n });\n}", "title": "" }, { "docid": "021f0df2b0dc1ed2beb20184bf060126", "score": "0.6815662", "text": "function prev() {\r\n sliderNext = sliderNext - 2;\r\n showSlide();\r\n}", "title": "" }, { "docid": "ac58ec84b998e9378f8c52edaf979bc1", "score": "0.68063956", "text": "function previousPage() {\n changePage(parseInt($('input[name=\"current_page\"]').val()) - 1);\n}", "title": "" }, { "docid": "81e56af4e2f3bce4c0beda4031cb9cec", "score": "0.67962825", "text": "prevPage() {\n\n const { pagination } = this.state;\n\n if (pagination.currentPage > 0) {\n this.setCurrentPage(pagination.currentPage - 1);\n }\n\n }", "title": "" }, { "docid": "c5ffae1f4f8224ea9952046c179e5b99", "score": "0.67953306", "text": "function goToPrevious() \n {\n var index = self.itemIndex - 1;\n if (index < 1) {\n index = self.itemCount;\n }\n goTo(index);\n }", "title": "" }, { "docid": "5145ce56ef7f5befa80958fc95e8fc5e", "score": "0.6794717", "text": "function left() {\n goto(course.page-1);\n}", "title": "" }, { "docid": "1c409f634795dc1fffccebef598e46bc", "score": "0.67875946", "text": "Prev() {\n this.page --;\n if (this.page < 1) {\n this.page = 1;\n }\n let p = this.page;\n this.Start();\n filmsList(searchUrl, p)\n }", "title": "" }, { "docid": "66eda3a0ee97f34f5ceb89064ce6e5dd", "score": "0.6772672", "text": "function showPreviousSlide() {\n showSlide(currentSlide - 1);\n }", "title": "" }, { "docid": "66eda3a0ee97f34f5ceb89064ce6e5dd", "score": "0.6772672", "text": "function showPreviousSlide() {\n showSlide(currentSlide - 1);\n }", "title": "" }, { "docid": "a052de62c27fae844fd71f8365c2d02e", "score": "0.6767331", "text": "previousSlide() {\n\t\tthis._move();\n\t}", "title": "" }, { "docid": "a208fed3dd58df646dd1fb2fa73b5bd2", "score": "0.6763216", "text": "function previous()\n{\n\n if(firstindex==0)\n {\n firstindex=0;\n lastindex=10;\n displaypage(firstindex,lastindex);\n }\n else{\n firstindex= firstindex-10;\n lastindex = firstindex+10;\n displaypage(firstindex,lastindex);\n }\n}", "title": "" }, { "docid": "9aba4554bfc133ae110a3e7858578fd8", "score": "0.67609125", "text": "prev(source) {\n this._cycleToSelected(this._getPrevSlide(this.activeId), NgbSlideEventDirection.END, source);\n }", "title": "" }, { "docid": "9bd0bc4729b7ce5714a5cf4e1ff84aee", "score": "0.6760402", "text": "function next_previous_navigation() {\n\n\t\tvar current;\n\n\t\t$( 'html' ).bind( 'keydown.wpmt', function( e ) {\n\n\t\t\tif ( form_focus !== false || ( typeof( next_prev_objects ) === 'undefined' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar count = get_keydown_count( e );\n\n\t\t\t// not n or p key or more than one key is held\n\t\t\tif ( !( e.keyCode === 78 || e.keyCode === 80 ) || ( count !== 1 ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar key = e.keyCode === 78 ? 'n' : 'p';\n\n\t\t\tif ( !obj_exists( $( current_element ) ) ) {\n\n\t\t\t\tif ( key === 'n' ) {\n\t\t\t\t\tcurrent = next_prev_objects.first();\n\t\t\t\t\tscrollTo( current );\n\t\t\t\t\tcurrent.addClass( current_class );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tcurrent = $( current_element );\n\n\t\t\t\tif ( key === 'n' ) {\n\t\t\t\t\tif ( obj_exists( current.nextAll( next_element ) ) ) {\n\n\t\t\t\t\t\tcurrent.removeClass( current_class ).nextAll( next_element ).addClass( current_class );\n\t\t\t\t\t\tscrollTo( $( current_element ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscrollTo( $( current_element ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( key === 'p' ) {\n\t\t\t\t\tif ( obj_exists( current.prevAll( next_element ) ) ) {\n\t\t\t\t\t\tcurrent.removeClass( current_class ).prevAll( next_element ).addClass( current_class );\n\t\t\t\t\t\tscrollTo( $( current_element ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent.removeClass( current_class );\n\t\t\t\t\t\tif ( obj_exists( top_element ) && next_element ) {\n\t\t\t\t\t\t\tscrollTo( top_element );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\t}", "title": "" } ]
109c529996977f7f8eb79cf4fa886907
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
[ { "docid": "1633f9b011b7c7f867053585896838b2", "score": "0.0", "text": "function getPreciseType(propValue) {\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n}", "title": "" } ]
[ { "docid": "f488fa51aa0ffa4449e6f8450eb68642", "score": "0.6895699", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "8a6c6e79ab0b6aa53029945fbd005dfa", "score": "0.6876087", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "title": "" }, { "docid": "25235542417ff18a2827085fc4a14644", "score": "0.68603504", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "f979c1e204a3e7accc60d583ecfbf378", "score": "0.68526596", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "46ede4cc739b2a0de09cc846f0e72cd2", "score": "0.6851548", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t return propType;\n\t\t}", "title": "" }, { "docid": "46ede4cc739b2a0de09cc846f0e72cd2", "score": "0.6851548", "text": "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t return propType;\n\t\t}", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "ecb3f14c5179dc0360839436af7ba856", "score": "0.68458605", "text": "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "title": "" }, { "docid": "d1d39a9f841b241abec369ea5bb434ca", "score": "0.6837168", "text": "function getPropType(propValue) {\n var propType = typeof propValue\n if (Array.isArray(propValue)) {\n return 'array'\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object'\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol'\n }\n return propType\n }", "title": "" }, { "docid": "18757c894a27fb88ec9827998af6a204", "score": "0.6835568", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n if (isSymbol(propType, propValue)) {\n return \"symbol\";\n }\n return propType;\n }", "title": "" }, { "docid": "18757c894a27fb88ec9827998af6a204", "score": "0.6835568", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n if (isSymbol(propType, propValue)) {\n return \"symbol\";\n }\n return propType;\n }", "title": "" }, { "docid": "2bd65d2d45509281da928cbda0edb08f", "score": "0.68351686", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n if (isSymbol(propType, propValue)) {\n return \"symbol\";\n }\n return propType;\n }", "title": "" }, { "docid": "e6f96880d51a72882fcce66285f4e83f", "score": "0.68287605", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.68140185", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.68140185", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "f335891e0b67765db7cc8ac87ada1742", "score": "0.68140185", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "523db146639ee03eb285e67886435b41", "score": "0.68130654", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "523db146639ee03eb285e67886435b41", "score": "0.68130654", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6805396", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "415e8a4abaaff984382d8d8e564ac906", "score": "0.6805396", "text": "function getPropType(propValue) {\r\n var propType = typeof propValue;\r\n if (Array.isArray(propValue)) {\r\n return 'array';\r\n }\r\n if (propValue instanceof RegExp) {\r\n // Old webkits (at least until Android 4.0) return 'function' rather than\r\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n // passes PropTypes.object.\r\n return 'object';\r\n }\r\n if (isSymbol(propType, propValue)) {\r\n return 'symbol';\r\n }\r\n return propType;\r\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" }, { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.6780102", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" } ]
ee7978ac93bd858fad853d7a8889430c
The last date the item was viewed
[ { "docid": "be9b1fc02bc2cdb4d882b195da382435", "score": "0.78354585", "text": "getLastViewDate() {\n\t \treturn this.lastViewDate;\n\t }", "title": "" } ]
[ { "docid": "c91a05b370c5904ed17386217c061995", "score": "0.71799195", "text": "get lastReviewDate() {\n\t\treturn this.__lastReviewDate;\n\t}", "title": "" }, { "docid": "23fc4949d29d68a6ad3da8c8a3aa689a", "score": "0.6985849", "text": "getLastAccessDate() {\n\t \treturn this.lastAccessDate;\n\t }", "title": "" }, { "docid": "d8499a2ea7c4de10e3f1ea7f7ab68c63", "score": "0.69050443", "text": "latestTimestamp () {\n return this.data.items[this.data.items.length - 1].created_at\n }", "title": "" }, { "docid": "9a26736782175dad048620e0c33c8b66", "score": "0.68512964", "text": "lastAccess(index) {\n let timeAccess = this.contacts[index].messages;\n return timeAccess[timeAccess.length - 1].date\n }", "title": "" }, { "docid": "0c0a62f71da1d3686797a8dc4ffeb7db", "score": "0.67386675", "text": "get lastUpdatedDate() {\n return this.getStringAttribute('last_updated_date');\n }", "title": "" }, { "docid": "0c0a62f71da1d3686797a8dc4ffeb7db", "score": "0.67386675", "text": "get lastUpdatedDate() {\n return this.getStringAttribute('last_updated_date');\n }", "title": "" }, { "docid": "0c0a62f71da1d3686797a8dc4ffeb7db", "score": "0.67386675", "text": "get lastUpdatedDate() {\n return this.getStringAttribute('last_updated_date');\n }", "title": "" }, { "docid": "8159327df2e24bb4957f25bc92a3081a", "score": "0.6666455", "text": "get since() {\n\t\treturn this.history[0].date;\n\t}", "title": "" }, { "docid": "8644cfb58734996e0f8c722783e1d2dc", "score": "0.66612303", "text": "function get_latest_access_date(token)\n{\n\treturn token.history.reduce((most_recently_used, history_entry) =>\n\t{\n\t\tif (most_recently_used.getTime() > history_entry.updated_at.getTime())\n\t\t{\n\t\t\treturn most_recently_used\n\t\t}\n\n\t\treturn history_entry.updated_at\n\t},\n\tnew Date(0))\n}", "title": "" }, { "docid": "d80648eca8cdfab7b4776950acbcf102", "score": "0.65830547", "text": "printLastAccess() {\n const messages = this.contacts[this.currentUser].messages;\n return lastMessage = messages[messages.length - 1].date;\n }", "title": "" }, { "docid": "27fbd828696b19255cdc6ad9b6c35fba", "score": "0.6510897", "text": "function getViewDate() {\n return new Date(Date.parse(sessionStorage.viewDate));\n}", "title": "" }, { "docid": "622f1e69b59f09e5b099f661a03c8126", "score": "0.63581574", "text": "get lastAccessed() {\n return 0;\n }", "title": "" }, { "docid": "db4ef30e715a64777d64a5664a1ec959", "score": "0.6313262", "text": "get lastModifiedDate() {\n return this.getStringAttribute('last_modified_date');\n }", "title": "" }, { "docid": "2b0ca5b3114dbeaf0d015d4844da7562", "score": "0.63076127", "text": "get last_seen() {\n return Object(date_fns__WEBPACK_IMPORTED_MODULE_4__[\"formatDistanceToNow\"])(new Date(this._details.last_seen * 1000), {\n addSuffix: true,\n });\n }", "title": "" }, { "docid": "a177d6fea4e915517246723dab245e82", "score": "0.62173456", "text": "function getDate() {\n\t\treturn this.date;\n\t}", "title": "" }, { "docid": "5ec09a6adc8b91d530926a54dfa41754", "score": "0.6211533", "text": "getViewableUntilDate() {\n\t \treturn this.viewableUntilDate;\n\t }", "title": "" }, { "docid": "e418cd97c525a3c9b15df66ec6601421", "score": "0.6152036", "text": "getLastMessageDate() {\n const auxArray = this.selectedContact.messages.filter(message => message.status == 'received');\n const lastMessage = auxArray[auxArray.length - 1];\n const lastMessageDate = lastMessage.date.slice(10,16);\n return lastMessageDate\n }", "title": "" }, { "docid": "0986b9e8ba8872ce4c77757c96916e10", "score": "0.6140087", "text": "get lastTransactionDate() {\n\t\treturn this.lastUsedTransactionDate;\n\t}", "title": "" }, { "docid": "5ab2690ae9dc2d444ec37e36d745eec1", "score": "0.6138696", "text": "get date () {\n\t\t\treturn this._date;\n\t\t}", "title": "" }, { "docid": "b50f09df2eb45560d44ef9431e0614c1", "score": "0.61188024", "text": "get date () {\r\n\t\treturn this.__date;\r\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "d250969e8a94ea698f2aa4a595c01f21", "score": "0.6102167", "text": "get date() {\n\t\treturn this.__date;\n\t}", "title": "" }, { "docid": "1735d6b799340bac8ff8d8e609c7abb5", "score": "0.6101039", "text": "async getLastUpdateDate() {\n var drive = google.drive('v3');\n const response = await Q.ninvoke(drive.files, 'get', {\n auth: this.auth,\n fileId: this.spreadsheetId,\n fields: 'modifiedTime',\n });\n const res = response.data;\n return res.modifiedTime;\n }", "title": "" }, { "docid": "7b0c0da83a195d336ddbcf4851dc0fbf", "score": "0.6095851", "text": "getLastAccess(contactIndex) {\n const activeContactMessages = this.contacts[contactIndex].messages;\n const lastAccess = activeContactMessages[activeContactMessages.length - 1].date;\n \n return lastAccess;\n }", "title": "" }, { "docid": "b14d6151450d2124c34ab29d2a5acdc4", "score": "0.6078469", "text": "get date () {\n\t\treturn this._date;\n\t}", "title": "" }, { "docid": "b14d6151450d2124c34ab29d2a5acdc4", "score": "0.6078469", "text": "get date () {\n\t\treturn this._date;\n\t}", "title": "" }, { "docid": "b14d6151450d2124c34ab29d2a5acdc4", "score": "0.6078469", "text": "get date () {\n\t\treturn this._date;\n\t}", "title": "" }, { "docid": "5bc89d50dcd3d1a1205c1cad17bdc880", "score": "0.60767233", "text": "getLastLoginDate() {\n\t \treturn this.lastLoginDate;\n\t }", "title": "" }, { "docid": "c2583705d14188eb7072cadedca5c5ce", "score": "0.60282403", "text": "get maxDate() {\n return maxDate ? maxDate.clone() : null;\n }", "title": "" }, { "docid": "93fb0d5f4b713fb3d5da735573a2956c", "score": "0.60246015", "text": "getWatchedDate() {\n\t \treturn this.watchedDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "68e2eb3fb6c6ffc8685c5a0e41a7a9fa", "score": "0.6017458", "text": "getUpdateDate() {\n\t \treturn this.updateDate;\n\t }", "title": "" }, { "docid": "e4c24a79c5342e2720a879602165a6ef", "score": "0.6003954", "text": "get entryDate() {\n const entryDateFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n if (entryDateFilter) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }", "title": "" }, { "docid": "5bf1b7850227dbb1dbb8b709cf8d0369", "score": "0.5973962", "text": "getExpiryDate() {\n\t \treturn this.expiryDate;\n\t }", "title": "" }, { "docid": "94b5c88343222987b760fbd3e6a58d42", "score": "0.5971295", "text": "get releasedAt() {\n return new Date(this.releaseDate);\n }", "title": "" }, { "docid": "4fea11afba202f72bd13bc547fc641cd", "score": "0.59410286", "text": "function getDate(){\n return creationDate;\n }", "title": "" }, { "docid": "7ef8b06a80bdeecbfdcebb24efd59990", "score": "0.5927728", "text": "get() {\n return moment(this.getDataValue('createdAt')).format('DD MMMM YYYY');\n }", "title": "" }, { "docid": "7c368b191b695c99e11b0c15da08b42f", "score": "0.59246707", "text": "get datePosted() {\n return this.posted\n }", "title": "" }, { "docid": "e10a436e161d9a227d244c5d7bb84c00", "score": "0.5871676", "text": "_getMaxDate() {\n return this._max;\n }", "title": "" }, { "docid": "5a9521c888311109d92b156031cf4b26", "score": "0.5860452", "text": "get view() {\n return this._last.view;\n }", "title": "" }, { "docid": "2ed0031c5d6d1a56d75258d7819a5ff6", "score": "0.5842878", "text": "getUpdatedAt() {\n return this.getData().updatedAt;\n }", "title": "" }, { "docid": "9617401e07053050a1922c447bd7e3b1", "score": "0.5800414", "text": "lastRevision() {\r\n return this.request.start_revision;\r\n }", "title": "" }, { "docid": "d77fb61606050b724b24895eddf8971b", "score": "0.57969844", "text": "function getDate(){\n\tvar date = new Date();\n\tvar lastSaved = date.getMonth() + \"/\" + date.getDate() + \"/\" + date.getFullYear() \n\t+ \" \" + formatTime(date.getHours()) + \":\" + formatTime(date.getMinutes()) + \":\" + formatTime(date.getMilliseconds());\n\treturn lastSaved;\n}", "title": "" }, { "docid": "99d6d39617270aa1d046bea9b5501662", "score": "0.577914", "text": "get activeDate() { return this._activeDate; }", "title": "" }, { "docid": "99d6d39617270aa1d046bea9b5501662", "score": "0.577914", "text": "get activeDate() { return this._activeDate; }", "title": "" }, { "docid": "99d6d39617270aa1d046bea9b5501662", "score": "0.577914", "text": "get activeDate() { return this._activeDate; }", "title": "" }, { "docid": "b90891d5fca750ed77c4a00be520cb27", "score": "0.5749719", "text": "get_lastTimeReleased()\n {\n return this.liveFunc._lastTimeReleased;\n }", "title": "" }, { "docid": "ca740010121d5623d8484ec0d0c76c14", "score": "0.5729878", "text": "get createdDate() {\n return this.getStringAttribute('created_date');\n }", "title": "" }, { "docid": "ca740010121d5623d8484ec0d0c76c14", "score": "0.5729878", "text": "get createdDate() {\n return this.getStringAttribute('created_date');\n }", "title": "" }, { "docid": "ca740010121d5623d8484ec0d0c76c14", "score": "0.5729878", "text": "get createdDate() {\n return this.getStringAttribute('created_date');\n }", "title": "" }, { "docid": "ad8a2c07b01fc6cfd07245bbe9ded747", "score": "0.57227", "text": "get deceasedDate() {\n\t\treturn this.__deceasedDate;\n\t}", "title": "" }, { "docid": "96d45f32ff64066a7046bc4924c1ba02", "score": "0.5718628", "text": "sortItemsByDate() {\n this.gIsAscend = !this.gIsAscend;\n var list = this.listViewed();\n if(this.gIsAscend){\n list.sort(function(a, b) {\n return (a.updated > b.updated) - (a.updated < b.updated);\n });\n } else {\n list.sort(function(a, b) {\n return (a.updated < b.updated) - (a.updated > b.updated);\n });\n }\n }", "title": "" }, { "docid": "ca7b461fb1712e290b96f8784737a94c", "score": "0.5703174", "text": "get followDate() {\n return new Date(this._data.created_at);\n }", "title": "" }, { "docid": "52b957370c9a8b6efaca71369bc72b38", "score": "0.5684372", "text": "static lastUpdatedDate(file) {\n\t\tconst { ctime } = fs.statSync(file);\n\t\treturn DateTime.Format(ctime);\n\t}", "title": "" }, { "docid": "dab75a82f8e7b4d75019aabaaee69434", "score": "0.56817865", "text": "function getLastVisit() {\r\n\tvar lastVisitTime = new Date(GM_getValue(\"lastVisit\", \"Fri May 11 2007 12:30:14 GMT-0400 (Eastern Daylight Time)\"));\r\n\treturn lastVisitTime;\r\n}", "title": "" }, { "docid": "f0e365d965f17fdfd423a9ca1d86bd9a", "score": "0.56770796", "text": "get assertedDate() {\n\t\treturn this.__assertedDate;\n\t}", "title": "" }, { "docid": "18008c20b540082697c9f16197249bd0", "score": "0.56634206", "text": "worldometersSourceDate() {\n var todayDate = new Date();\n\n todayDate.setDate(todayDate.getDate() - 1);\n return todayDate;\n }", "title": "" }, { "docid": "ca4310ba9005f32864917ebf99127e83", "score": "0.5658773", "text": "function getLastDate (lastTagSha) {\n console.log(lastTagSha);\n request({\n url: 'https://api.github.com/repos/AlexKolonitsky/lucidworks-view/commits/' + lastTagSha,\n method: 'GET',\n headers: {\n 'User-Agent': 'AlexKolonitsky'\n }\n }, function (error, response, body) {\n if (error) {\n console.log(error);\n } else {\n var bodyObj = JSON.parse(body);\n var lastTagDate = bodyObj.commit.author.date;\n getDescription (lastTagDate);\n }\n });\n }", "title": "" }, { "docid": "4f198c04df0c248ab6105cf00d4c3c6a", "score": "0.5631205", "text": "_getMaxDate() {\n return this._rangeInput.max;\n }", "title": "" }, { "docid": "966852e9679e9e709049e3085fae2128", "score": "0.5628399", "text": "function getExpiryDate()\n{\n\treturn this.month + \"/\" + this.year;\n}", "title": "" }, { "docid": "da41f1d8e6c5d76708fc9351dccdbcd6", "score": "0.561873", "text": "get expirationDate () {\n\t\treturn this._expirationDate;\n\t}", "title": "" }, { "docid": "dae4514dba0c13e9eda378b8c7a3101d", "score": "0.5616197", "text": "get dateCreated() {\n return this._dateCreated;\n }", "title": "" }, { "docid": "2bcbb7008220fd217afc2460a1581a2d", "score": "0.55927926", "text": "get deceasedDate () {\n\t\treturn this._deceasedDate;\n\t}", "title": "" }, { "docid": "dff4858208b9cc75891bf7dc4a1927c6", "score": "0.5579901", "text": "lastUpdated() {\n const now = new Date();\n let min = now.getMinutes();\n if (min < 10) {\n min = '0' + min;\n }\n let updateTime = 'Last Update: ' + now.getHours() + \":\" + min + \" \" + now.getDate() + \"/\" + now.getMonth();\n return updateTime;\n }", "title": "" }, { "docid": "b0289e921a4ce515b55a81cd514f7db3", "score": "0.5570348", "text": "dateCreated() {\n return new Date().toLocaleDateString('en-US'); // return expression for todays date\n }", "title": "" }, { "docid": "58a93ea76ccb8a6733f39b75177142cf", "score": "0.55700123", "text": "get index () {\n\t\treturn this.log.date.valueOf()\n\t}", "title": "" }, { "docid": "5c726f7f1187b08be3d3df7223d7308d", "score": "0.55651826", "text": "get maxDate() { return this._maxDate; }", "title": "" }, { "docid": "5c726f7f1187b08be3d3df7223d7308d", "score": "0.55651826", "text": "get maxDate() { return this._maxDate; }", "title": "" }, { "docid": "5c726f7f1187b08be3d3df7223d7308d", "score": "0.55651826", "text": "get maxDate() { return this._maxDate; }", "title": "" }, { "docid": "5c726f7f1187b08be3d3df7223d7308d", "score": "0.55651826", "text": "get maxDate() { return this._maxDate; }", "title": "" }, { "docid": "31b0d3b65c047b119ecdd6c48638be03", "score": "0.5563149", "text": "get eventDate() {\n return new Date(this._eventData.event_timestamp);\n }", "title": "" }, { "docid": "5d6c043bb065cd58f5524c585441c6dd", "score": "0.55525076", "text": "function getDateOfBottomReview(page) {\n // Get the most-bottom review on this page (sorted by most recent, so bottom is earliest date)\n var reviews = page.querySelector('ul.ylist.ylist-bordered.reviews').querySelectorAll('.review');\n var lastReview = reviews[reviews.length-1];\n var earliestDate = Date.parse(lastReview.querySelector('.rating-qualifier').innerText);\n\n return earliestDate;\n}", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" }, { "docid": "4634d45aae5484a27489a67e4650a26f", "score": "0.5544236", "text": "getCreateDate() {\n\t \treturn this.createDate;\n\t }", "title": "" } ]
de061955e19f5fda284937fd06192baf
responses $('responses').append('A response might be nice. Maybe not.');
[ { "docid": "271692ea47941f85616550b0df0908a3", "score": "0.6299485", "text": "function respond() {\r\n // detect what is calling for a response\r\n var arg = arguments[0].className;\r\n var deleteResponse = '<h2>ToDo has been deleted</h2>';\r\n var addResponse = '<h2>ToDo has been added</h2>';\r\n var clearResponse = '<h2>ToDo list has been cleared</h2>';\r\n var saveResponse = '<h2>ToDo edit has been saved</h2>';\r\n var cancelResponse = '<h2>ToDo edit has been cancelled</h2>';\r\n var $response;\r\n // establish appropriate response\r\n if (arg == 'display-data-item') $response = deleteResponse;\r\n if (arg == 'submit') $response = addResponse;\r\n if (arg == 'clear') $response = clearResponse;\r\n if (arg == 'save') $response = saveResponse;\r\n if (arg == 'cancel') $response = cancelResponse;\r\n // response message should fade in\r\n // response message should fade out after n seconds\r\n $('#responses').animate({ opacity: 0 }, function() {\r\n $('#responses h2').replaceWith($response);\r\n $('#responses').animate({ opacity: 1 }, 0).delay(1000).animate({ opacity: 0 });\r\n });\r\n }", "title": "" } ]
[ { "docid": "a12fa0a876ec611fc8492289466a9fc2", "score": "0.705712", "text": "function appendIt(data){\n $('#answer').append('<div class=\"answer\">' + data.message + '</div>');\n }", "title": "" }, { "docid": "07c19d4b4c675498b04844e7641f3ae2", "score": "0.6727093", "text": "function correctAnswer(){\n $('.js-response').append(`<div class=\"yayCorrect\">\n <div class=\"correctImg\"><img class=\"correctAnswer\" src=\"images/Correct_Answer.gif\" alt=\"You hit Voldemort\"></div>\n <p class=\"textWelcome\">Correct!<br/> \n You dealt a mighty blow.</p>\n <p class=\"yourScore\"> Your Score is <span class=\"js-big-score\"> ${currentScore} </span>out of <span class=\"js-big-score\">\n ${scoreOutOf}</span></p>\n <button type=\"button\" class=\"nextButton\">Next</button>\n </div>`);\n}", "title": "" }, { "docid": "b357985d40174396898d566be60d557f", "score": "0.66795015", "text": "function wrongAnswer(){\n $('.js-response').append(`\n <div class=\"noWrong\">\n <div class=\"wrongImg\"><img class=\"wrongAnswer\" src=\"images/Wrong_Answer.gif\" alt=\"Voldemort hit you\"></div>\n <p class=\"textWelcome\">Incorrect!<br/> \n The correct answer was: <br/> <span class=\"right-answer\">${STORE[currentQuestion].correctAnswer}</span></p>\n <p class=\"yourScore\"> Your Score is <span class=\"js-big-score\"> ${currentScore} </span>\n out of <span class=\"js-big-score\"> ${scoreOutOf} </span></p>\n <button type=\"button\" class=\"nextButton\">Next</button>\n </div>`);\n}", "title": "" }, { "docid": "7eae9293b3c46ba30ac14aa30a5fb21b", "score": "0.66257226", "text": "function showServerDataOnDom(response){\n $('#jokesContainer').empty();\n var whatGetsShown = '';\n for (var i = 0; i < response.length; i++) {\n whatGetsShown += '<p class = \"name\">From: ' + response[i].whoseJoke + '</p>' +\n '<p class = \"setUp\">' + response[i].jokeQuestion + '</p>' +\n '<p class = \"punchLine\">' + response[i].punchLine + '</p>';\n }\n $('#jokesContainer').append(whatGetsShown);\n}//end showServerDataOnDom", "title": "" }, { "docid": "d5fa04956a8a173d652569bac20b2e9f", "score": "0.6533796", "text": "function addJoke(resp) {\r\n p = document.createElement('p')\r\n p.innerText = text + \" Joke!\\n\\n\" + resp\r\n document.body.appendChild(p)\r\n currentJokes.unshift(p)\r\n}", "title": "" }, { "docid": "727ddce59b1493cbd528f60dbb41b5c5", "score": "0.64554256", "text": "function printResponse() {\n var responseText = document.getElementById('submitResponseText');\n responseText.innerHTML = \"You have submitted your mood\";\n}", "title": "" }, { "docid": "6a907e331936b792390d120b2e113beb", "score": "0.63547415", "text": "function wrongAnswer() {\n $('.response').html(\n `<h3>That's the wrong answer</h3>\\n\n <p class=\"sizeMe\">It's actually:</p>\n <p class=\"sizeMe\">${STORE[questionNumber].correctAnswer}</p>\n <button type=\"button\" class=\"nextButton button\">Next</button>`\n );\n}", "title": "" }, { "docid": "a759fbcdae03efd6c198face68de4bda", "score": "0.63295174", "text": "function showResponse(response) {\r\n var responseString = JSON.stringify(response, '', 2);\r\n document.getElementById('response').innerHTML += responseString;\r\n}", "title": "" }, { "docid": "46a9d6c382f4d862e47680c5acaea1f7", "score": "0.6310528", "text": "function showResponse(response) {\n\n var responseString = JSON.stringify(response, '', 2);\n document.getElementById('yt-response').innerHTML += responseString;\n}", "title": "" }, { "docid": "d96659c7ee0d82e7c6e370bf8380edd5", "score": "0.63044626", "text": "function showMessage(value) {\n var newResponse = document.createElement(\"p\");\n newResponse.appendChild(document.createTextNode(value));\n var response = document.getElementById(\"response\");\n response.appendChild(newResponse);\n}", "title": "" }, { "docid": "366ae0835fd9878a5c1a87e01635110f", "score": "0.62948143", "text": "function showResponse(response) {\n var responseString = JSON.stringify(response, '', 2);\n document.getElementById('response').innerHTML += responseString + \n '<br>---------------------------------<br>';\n}", "title": "" }, { "docid": "b2d1c169e22699aa62ad1a7c1dc00364", "score": "0.62904996", "text": "function goodmorning(newMessage) {\n $('#hal').append('HAL 9000: Good Morning, Dave. <br />'); \n}", "title": "" }, { "docid": "aa234a66b502bb4553e984d9f01759d9", "score": "0.6254291", "text": "function wrongAnswer(){\n $('.response').html(`<img class = \"images\" src = \"images/Clinics_WrongAnswer.jpg\"><p class= \"correction\">Oops! The Correct Answer is:</p>\n <p class= \"correctAnswer\">${STORE[questionNumber].correctAnswer}</p>\n <button type = \"submit\" class = \"nextButton button\">Next Question</button>`);\n}", "title": "" }, { "docid": "db986613067968ce1794ea8e43967c33", "score": "0.6248304", "text": "function insertAnswers (response) {\r\n var ee4google = document.createElement(\"html\");\r\n ee4google.innerHTML = response.responseText;\r\n var newcontent = getCorrectedPageMain(ee4google);\r\n\r\n if ( newcontent.match(/\\sclass=\"(\\S*\\s+)?answers(\"|\\s)/) ) {\r\n pageMain.innerHTML = newcontent;\r\n } else { alert(\"Experts-Exchange appears to have changed their format\"); }\r\n }", "title": "" }, { "docid": "d351ace708a4c27a98c193967b45ee89", "score": "0.62454545", "text": "function setBotResponse(val) {\n \tif($.trim(val) == '') {\n \t\tval = 'I couldn\\'t get that. Let\\' try something else!';\n \t} else {\n \t\tval = val.replace(new RegExp('\\r?\\n','g'), '<br />');\n \t}\n \tvar botResponseBefore = '<p class=\"botResponse\">';\n \tvar botResponseAfter = '</p>';\n \tvar botResponseFinal = botResponseBefore + val + botResponseAfter;\n \t$('#chatbox_body_content').append(botResponseFinal);\n // scroll to the bottom of the chatbot body\n $('#chatbox_body_content').scrollTop(1E10);\n }", "title": "" }, { "docid": "88dccb96ce880307edf17aceca3cccdc", "score": "0.6218255", "text": "function respond()\n{\n output.innerHTML+=\"<li class='botChat_852'>\"+question+\"</li>\";\n messageDiv.scrollTop = messageDiv.scrollHeight;\n loader.src=loaderStill;\n}", "title": "" }, { "docid": "1446d8aff26b6586e7330b2f65bf45a1", "score": "0.61905694", "text": "function processResponse(response) { // given the final CS text, converts the parsed response from the CS server into HTML code for adding to the response holder div\r\n var botSaid = '<strong>' + botName + ':</strong> ' + response + \"<br>\\n\";\r\n update(botSaid);\r\n speak(response);\r\n}", "title": "" }, { "docid": "df4b514babe4943a3fc533c54e6a1d1e", "score": "0.61715627", "text": "function addResponse(){\n event.preventDefault()\n // declare a variable newResponse that equals the value of the user input in the text box\n var newResponse = $('#addResponse').val();\n // only add newResponse to the responses array if it exists (box is not blank)\n if(newResponse){\n responses.push(newResponse); // push newResponse into the responses array\n // log our result to the console, for funsies\n console.log(\"Just pushed \" + newResponse + \" to responses array\");\n $('#custom').addClass('bounceIn');\n $(\"#custom\").append(\"<br>\" + newResponse)\n newResponse = $('#addResponse').val(''); // clear the box after submitting new response\n } else {\n alert(\"Response can't be empty!\"); // if the box is blank, alert a notification\n }\n }", "title": "" }, { "docid": "a7e824954b4626dabfc9c7936ff7f4af", "score": "0.6153269", "text": "function wrongAnswer() {\n $('.response').html(\n `<h3>Sorry, that answer is incorrect</h3>\n <p>The correct answer is: ${STORE[questionCounter].answer}</p>\n <button type=\"button\" class=\"nextButton button\">Next</button>`\n );\n}", "title": "" }, { "docid": "24e6560b14506907bddadf6945b9f4bd", "score": "0.6142298", "text": "function askAQuestion(sentence) {\n divQ.innerHTML = \"\";\n messageDiv.innerHTML = \"\"; \n const question = document.createElement(\"h2\");\n question.innerText = sentence.es;\n divQ.append(question);\n\n questionsAsked++ \n}", "title": "" }, { "docid": "8dde210d2bdf94f07feb3587987ddf91", "score": "0.613003", "text": "function twyResponseMessage(response) {\n loading.classList.add('hidden')\n setTimeout(() => {\n let twyMessage = document.createElement('li')\n let twyMeta = document.createElement('p')\n let twyResponse = document.createElement('p')\n twyMessage.classList.add('message')\n twyMessage.classList.add('twy')\n twyMeta.classList.add('text_meta')\n twyResponse.classList.add('text')\n twyMeta.innerText = 'TWY'\n twyResponse.innerText = response\n twyMessage.appendChild(twyMeta)\n twyMessage.appendChild(twyResponse)\n chatBox.appendChild(twyMessage)\n\n chatBox.scrollTop = chatBox.scrollHeight\n\n loading.classList.remove('hidden')\n }, 1000)\n}", "title": "" }, { "docid": "e3241743d241f0b8d6e20e3375d16c2d", "score": "0.60925907", "text": "function wrongAnswer() {\n $(\".response\").html(\n `<h3>Oops! Wrong answer.</h3>\n <img src=\"Assets/crying_buddha.jpg\" alt=\"picture of a crying buddha statue\" class=\"images\" width=\"100px\">\n <p class=\"sizeMe\">It's actually:</p>\n <p class=\"sizeMe\">${STORE[questionNumber].correctAnswer}</p>\n <p class=\"sizeMe\">${STORE[questionNumber].explanation}</p>\n <button type=\"button\" class=\"nextButton button\">Next</button>`\n );\n}", "title": "" }, { "docid": "463ecfe1aaec4d261576644d8217af86", "score": "0.60919505", "text": "function addResponses(user, cards) {\n var html = '<div class=\"cards\" user=\"' + user + '\" onclick=\"pick(\\'' + user;\n html += '\\')\">';\n for (var i = 0; i < cards.length; i++) {\n html += '<div class=\"card white\"><p>' + responses[cards[i]][0] + '</p>';\n if (responses[cards[i]][1].length > 0) {\n html += '<p class=\"subtext\">' + responses[cards[i]][1] + '</p>';\n }\n html += '</div>';\n }\n html += '</div>';\n $('#played_whites').append(html);\n}", "title": "" }, { "docid": "906f779faf60472e3eb42aaf7fdc8e0b", "score": "0.6073394", "text": "function results(){\n$(\"#QA\").html( \"Correct: \"+ right + \" \");\n$(\"#QA\").append(\"</br> Wrong: \" + wrong + \" \");\n$(\"#QA\").append(\"</br>Unanswered: \" + unanswered + \" \");\n}", "title": "" }, { "docid": "f78368d4568a2430cdce9fb86339fd41", "score": "0.60552657", "text": "function correctAnswer(){\n $('.response').html(`<img class = \"images\" src = \"images/Clinics_RightAnswer.jpg\">\n <p class = \"wellDone\">Thats CORRECT!</p>\n <button type= \"button\" class= \"nextButton button\">Next Question</button>`);\n updateScore();\n}", "title": "" }, { "docid": "e4d2d6635217f21eea6cef743bec3d1c", "score": "0.60269237", "text": "function showResponse(response) {\n var responseString = JSON.stringify(response, '', 2);\n document.getElementById('bookmark-search-results').innerHTML += responseString;\n}", "title": "" }, { "docid": "8c4ca8799d3d7f7fb09a20363326494d", "score": "0.6010762", "text": "function updateResponseContainer(response) {\n responseContainer.querySelector('pre').innerText = JSON.stringify(response, null, 2);\n responseContainer.classList.add('response-container--visible');\n}", "title": "" }, { "docid": "7fc2b0be2eef5a3311c74b44baa2891e", "score": "0.5973936", "text": "function appendMessage() {\n let message = \"<div class='message-container'><img src='/img/slow_down.png'>\"\n + \"<p class='message'>Slow down - you haven't got any pending quests!</p></div>\";\n $(\".quest-list\").append(message);\n $(\".quest-list\").css({\n height: \"300px\",\n display: \"flex\",\n justifyContent: \"center\"\n });\n}", "title": "" }, { "docid": "fb5f03ef754b317dd40ed08a09e01bb1", "score": "0.59603524", "text": "function insertADResponse(r){\n\tvar rContainer = $('#ad_responses');\n\t//var oe = isEven(rContainer.find('.active_discussion_row').length)?'even':'';\n\tvar newRow = $('<div class=\"active_discussion_row\">' + $('#ad_row_template').html() + '</div>');\n\t\n\tnewRow.find('.ad_row_body').html(r.text);\n\tnewRow.find('.hidden_adrow_id').html(r.id);\n\n\tnewRow.find('.ad_row_meta_name').html(r.user.name);\n\tnewRow.find('.ad_row_meta_ts').html('Posted: ' + r.date + ' at ' + r.time);\n\tnewRow.find('.ad_row_meta_img').attr('src','files/user_images/'+r.user.user_id+'.jpg');\n\n\trContainer.append(newRow);\n\t\n\thandleDiscussionVote(r, newRow);\n}", "title": "" }, { "docid": "e6edb9a15c1b6c3d8f2fe193adb2418c", "score": "0.5920116", "text": "function appendPresented(counter) {\r\n // create a presented element\r\n var presentedPhrase = USER_DATA.createElement(\"Presented\");\r\n\r\n // make the presented element's text content be the presented phrase\r\n presentedPhrase.textContent = $(\".phrase\").text();\r\n\r\n // append the presented element\r\n USER_DATA.getElementsByTagName(\"Trial\")[counter].appendChild(presentedPhrase);\r\n}", "title": "" }, { "docid": "3cfe782d4562b96793fb6e59738bf3ed", "score": "0.59053385", "text": "function response(message) {\r\n\r\n\tvar response = '';\r\n\r\n\tresponse += '<div class=\"alert alert-info\">';\r\n\tresponse += message;\r\n\tresponse += '</div>';\r\n\r\n\treturn response;\r\n\r\n}", "title": "" }, { "docid": "50bcdb43348716d14dcc1b90ebf4f331", "score": "0.58861077", "text": "function getElements(response) {\n $(\".showPhoneNumber\").text(`The phone number ${inputedNumber} belongs to ${response.belongs_to[0].name}`);\n $('.showAddress').text(`who lives at ${response.current_addresses[0].street_line_1} ${response.current_addresses[0].city}`);\n $('.showYourPeeps').text(`your peeps be: ${response.associated_people[0].name}, ${response.associated_people[1].name}, ${response.associated_people[2].name}, ${response.associated_people[3].name}, ${response.associated_people[4].name}, ${response.associated_people[5].name}, ${response.associated_people[6].name}`);\n $(\"#insultName\").text(`Hey ${response.belongs_to[0].name},`);\n }", "title": "" }, { "docid": "e33d0cf4d9ae5becb7cb1561b367c77f", "score": "0.5882981", "text": "function joinFail(response) {\n\tjQuery('#joinStatus').html('<span class=\"bad\">' + response.responseText + '</span>');\n}", "title": "" }, { "docid": "0194e02679d183d6f9a910aa2c2aae2e", "score": "0.58775973", "text": "function handleResponse(response) {\r\n // print the response inside <div class=\"feedback\"></div>\r\n $(\".feedback\").html(response).hide().fadeIn(500);\r\n }", "title": "" }, { "docid": "1754d77db8161a3e2268d5ab79f165b8", "score": "0.5872247", "text": "function showResponse3(originalRequest) {\n\t//get response\n\tvar msg = originalRequest.responseText;\n\t\n\t//display response\n\tvar text = document.getElementById(\"text\");\n\ttext.innerHTML = msg;\n\t\n}", "title": "" }, { "docid": "4637f1047cd8ff43113f0e83bb26410d", "score": "0.58567756", "text": "function displayFactResult(responseJson){\r\n $('#factResult').empty();\r\n $('#factResult').append(\r\n `\r\n <p class=\"factBold\">Here's a food fact:</p>\r\n <p class=\"factItalic\">${responseJson.text}</p>\r\n `\r\n )\r\n}", "title": "" }, { "docid": "205b71e6981e3ed52f639ad45386ce0f", "score": "0.5855136", "text": "function joinDone(response) {\n\tjQuery('#joinStatus').html('<span class=\"good\">' + response + '</span>');\n}", "title": "" }, { "docid": "d7ff3b3243c5d6b4287209cf29c3cebe", "score": "0.5854548", "text": "function update_phrase() {\n\n\t$('#saying').append(\"<div style='display: hidden;'>\" + random_phrase() + \"</div>\");\n\n\tif ($('#saying div').length > 1) {\n const first = $('#saying div:first');\n first.hide();\n first.remove();\n\t}\n\t$('#saying div:last').show();\n}", "title": "" }, { "docid": "2655888ccc997aadec2d66783a2d67d8", "score": "0.584302", "text": "function handleResponse(json) {\n $('h1.disney').text('Disney Characters');\n json.forEach(function(character){\n console.log(character.name)\n $('.char').append($(`<p>${character.name}</p>`));\n })\n}", "title": "" }, { "docid": "e08fa028eca57fe4c68495f6f048fb60", "score": "0.58362895", "text": "function correctAnswer() {\n $('.response').html(\n `<h3>That is correct!</h3>\n <button type=\"button\" class=\"nextButton button\">Next</button>`\n );\n updateScore();\n}", "title": "" }, { "docid": "54e0b2989c21af3a1161d4f0606fb813", "score": "0.58273405", "text": "function addBotResponse(markup) {\n var store = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n markup = DOMPurify.sanitize(markup, {\n ADD_ATTR: [\"target\"]\n });\n $(markup).appendTo(\".chatbot-msgs\").hide().fadeIn(0);\n setTimeout(function () {\n if (store) {\n setBotUserHistory();\n }\n }, 50);\n }", "title": "" }, { "docid": "6b7d5062728edc520f47b78bbdbdef30", "score": "0.58193505", "text": "function process_individual_response(response, textStatus, jqXHR) {\n //console.log(\"Individual Results: %o\", response);\n var results = $(\"#individual_results\");\n results.html(\"\");\n if (response == \"\") {\n results.append(\"An error has occurred.\");\n return;\n }\n results.append(\"<ul><li>\" + response + \"</li></ul>\");\n}", "title": "" }, { "docid": "726b836822a1b6c98e9ade40b4a4675e", "score": "0.5788439", "text": "function getResponse() {\r\n let userText = $(\"#textInput\").val();\r\n\r\n if (userText == \"\") {\r\n userText = \"Testing!\";\r\n }\r\n\r\n let userHtml = '<p class=\"userText\"><span>' + userText + '</span></p>';\r\n\r\n $(\"#textInput\").val(\"\");\r\n $(\"#chatbox\").append(userHtml);\r\n document.getElementById(\"chat-bar-bottom\").scrollIntoView(true);\r\n\r\n setTimeout(() => {\r\n getHardResponse(userText);\r\n }, 1000)\r\n\r\n}", "title": "" }, { "docid": "411189060c3b593a899d7eb55cc3fc19", "score": "0.578062", "text": "function correctAnswer(){\n $('.response').html(\n `<h2>Your answer is correct!</h2><img src=\"images/Yesss2.png\" alt=\"correct answer\" class=\"images\" width=\"200px\"><p>Keep going Chosen One!</p><button type=\"button\" class=\"nextButton button\">Next</button>`);\n $('.response').show();\n updateScore();\n}", "title": "" }, { "docid": "7e2f57bcc787c4abf092ceac2ca3d563", "score": "0.57723504", "text": "function correctAnswer() {\n $(\".response\").html(\n `<h3>Correct!</h3>\n <img src=\"Assets/laughing_buddha.jpg\" alt=\"picture of a laughing buddha statue\" class=\"images\" width=\"100px\">\n <p class=\"sizeMe\">${STORE[questionNumber].explanation}</p>\n <button type=\"button\" class=\"nextButton button\">Next</button>`\n );\n updateScore();\n}", "title": "" }, { "docid": "ef9ca10c89e3ebf10f9a7886feb69632", "score": "0.57594895", "text": "function correctAnswer() {\n $('.response').html(\n `<h3>Your answer is correct!</h3>\n <button type=\"button\" class=\"nextButton button\">Next</button>`\n );\n updateScore();\n}", "title": "" }, { "docid": "134188c454e087e9d09e34c4f69201c7", "score": "0.5751768", "text": "function addspantext() {\n $('.span').append('<p class=\"incorrect\">INCORRECT</p>' + '<button class=\"btn btn-success next\">NEXT</button>' + '<p class=\"spananswer\">' + questions[thisquestion].span + '</p>');\n}", "title": "" }, { "docid": "850715801b930b2fd8bb639f980440f0", "score": "0.5730302", "text": "function writeAnswers(response)\n{\n\n answers[0] = \"## Description\" + '\\n' + response.description + '\\n';\n answers[1] = \"## Table of Contents\" + '\\n' + response + '\\n';\n answers[2] = \"## Installation\" + '\\n' + response.installation + '\\n';\n answers[3] = \"## Usage\" + '\\n' + response.usage + '\\n';\n answers[4] = \"## License\" + '\\n' + response.license + '\\n';\n answers[5] = \"## Contributing\" + '\\n' + response.contributing + '\\n';\n answers[6] = \"## Tests\" + '\\n' + response.tests + '\\n';\n answers[7] = \"## Questions\" + '\\n' + response.questionsGH + '\\n' + response.questionsEmail;\n\n}", "title": "" }, { "docid": "b75865358229e3484590b8796259d12c", "score": "0.5730126", "text": "function yourScore() {\n $(\"#mainGame\").append(\"<p>Answered Correctly: \" + correct + \"</p>\");\n $(\"#mainGame\").append(\"<p>Answered Incorrectly: \" + incorrect + \"</p>\");\n $(\"#mainGame\").append(\"<p>Total Questions: \" + questionCounter + \"</p>\");\n $(\"#mainGame\").append(\"<button class='playAgain'>Play again</button>\");\n}", "title": "" }, { "docid": "e82cc6882e816c15740ad062274b8fa9", "score": "0.5725075", "text": "function requestDone(response) {\n\tjQuery('#responseStatus').html('<span class=\"good\">200 OK</span>');\n\tvar text = JSON.stringify(response, null, '\\t');\n\tvar rows = text.split('\\n').length;\n\tjQuery('#response')\n\t\t.attr('rows', rows)\n\t\t.text(text);\n}", "title": "" }, { "docid": "2e0708c44fe1784539bc77ea47eab0cf", "score": "0.5716305", "text": "function ask() {\n clear();\n $(\"#questionshow\").html(questions[questionNumerIndex].question);\n var responses = questions[questionNumerIndex].userData;\n for (var i = 0; i < responses.length; i++) {\n $(\"#useranswers\").append(\"<button id=\" + i + \">\" + responses[i] + \"</button>\");\n }\n}", "title": "" }, { "docid": "33d7afa7335ceaa7220569dfa8870539", "score": "0.5698628", "text": "function respond(words, html) {\n // Split by space\n var wordsArr = words.split(\" \");\n $(\"#greeting\").text(\"\");\n $(\"#speechResults\").text(\"\");\n\n // Speak the words\n speak(words);\n\n // Go over each of the words, displaying each with a delay\n for (var i = 0; i < wordsArr.length; i++) {\n setTimeout(function(word, x) {\n $(\"#greeting\").append(\" \" + word);\n // If this is the last item, append any HTML data we may want to display\n if (html && x == wordsArr.length - 1) {\n $(\"#speechResults\").html(html);\n }\n }, (300 * (i + .5)), wordsArr[i], i);\n }\n}", "title": "" }, { "docid": "f955bae5bf1a8591b6b25e3adda40d77", "score": "0.5698502", "text": "function new_message(msg) {\n\tdocument.getElementById(\"story\").innerHTML += \"<p>\" + msg + \"</p>\";\n}", "title": "" }, { "docid": "cb9983e39c5f89dee92b0d9301136197", "score": "0.5688104", "text": "function appendSnippet(text, score) {\r\n\tglobalSnippetCount++;\r\n\t$('#blankState').remove();\r\n\t$('#snippetList').append('<li><p>'+text+'</p><div id=\"score'+ globalSnippetCount +'\"></div>'+\r\n\t\t'<a href=\"http://twitter.com/share\" class=\"twitter-share-button\" data-text=\"'+ text +'\" data-count=\"none\" >Tweet</a></li>');\r\n\t$('#score'+globalSnippetCount).raty({\r\n\t\treadOnly: true,\r\n\t\tstart: score,\r\n\t});\r\n\t$.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache:true});\r\n}", "title": "" }, { "docid": "dd21d1cf4a9b0904116ca2785da43710", "score": "0.56841856", "text": "function noResults(){\n var noRes = document.createElement(\"h2\");\n var noResText = document.createTextNode(\"Sorry, no results found.\");\n noRes.appendChild(noResText);\n answer.appendChild(noRes);\n}", "title": "" }, { "docid": "3b67225486f6e6f94b9f84448708c23e", "score": "0.5683651", "text": "function requestFail(response) {\n\tjQuery('#responseStatus').html('<span class=\"bad\">' + response.responseText + '</span>');\n}", "title": "" }, { "docid": "b3dfa2e4b6cdcea4cfa1a1699147bc62", "score": "0.5676176", "text": "function displayResults(responseJson) {\n console.log(responseJson)\n //replace the existing image with the new one\n $('.results').append(`<img src=\"${responseJson.message}\" class=\"img-results\">` )\n}", "title": "" }, { "docid": "81346991a31b921b3c6fcda3cddf97ea", "score": "0.5672969", "text": "function SetResponse(jquery, msg) {\n insertHTML = \"<div class=\\\"alert alert-warning alert-dismissible fade show\\\" role=\\\"alert\\\"><strong>\" +\n msg + \"</strong><button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"Close\\\">\" +\n \"<span aria-hidden=\\\"true\\\">&times;</span></button></div>\";\n jquery.append($(insertHTML).delay(2500).fadeOut(500));\n }", "title": "" }, { "docid": "3c5553b298cb661440e77844d4b9cb40", "score": "0.56645095", "text": "function print_server_response(code, element){\n switch(code){\n case 200:\n element.innerHtml = \"OK\";\n break;\n case 404:\n element.innerHtml = \"Resource not found\";\n break;\n case 500:\n element.innerHtml = \"Internal server error\";\n break;\n }\n}", "title": "" }, { "docid": "164e17320b9e0a84c643079179e3e5be", "score": "0.56639594", "text": "function getAnswer() {\n $.ajax({\n type: 'GET',\n url: '/problems'\n }).then(function (response) {\n let el = $('#showAnswer');\n el.empty();\n el.append(`\n <h3>${(response[response.length - 1].answer)}</h3>\n `)\n }).catch(function (err) {\n alert(err, 'getAnswer');\n })\n}", "title": "" }, { "docid": "a59457ad5223577e1be78089e5b50e33", "score": "0.565223", "text": "function displayAPODResults(responseJson) {\n $('.apod-container').append(\n `<h3>${responseJson.title}</h3><h4>Date: ${responseJson.date}</h4><p>${responseJson.explanation}</p><img src=\"${responseJson.hdurl}\" class=\"image\">`\n )\n}", "title": "" }, { "docid": "8db3fe7ec0084e64523b07e1e7a04210", "score": "0.564857", "text": "function correctAnswer() {\n console.log('inside correctAnswer');\n $('.response').html(\n `<h3>Correct answer!</h3>\n <img src=\"images/rockhand.jpg\" alt=\"rockon-hand\">\n <p>Keep on rockin!</p>\n <button class=\"nextButton button\" type=\"submit\">Next</button>`\n );\n updateScore();\n}", "title": "" }, { "docid": "92bf7f48cd954a9c4515e9d98f6c9d33", "score": "0.563684", "text": "function displayMessage(message) {\n // get the paragraph element called \"response\"\n\tvar response = document.getElementById(\"response\");\n\t// change the text for the paragraph to message\n\tresponse.textContent = message;\n}", "title": "" }, { "docid": "a03ae4aa32248b08989c23cdb68e07a4", "score": "0.5633959", "text": "function updateStatus(message) {\n var statusInfo = $('#status');\n statusInfo.innerHTML += message + \"<br/>\";\n}", "title": "" }, { "docid": "74b619436c384524fcdb952cf5e7394d", "score": "0.56119335", "text": "function setHTML(response){\n document.getElementById('nodelist').innerHTML = response.responseText;\n }", "title": "" }, { "docid": "965742d768b8eddb3ad0b61e68b15f99", "score": "0.56096494", "text": "function displayListInvalid(){\r\n $(\".page_body\").append('<h2 class=\"error_header\">List Invalid</h2>');\r\n $(\".page_body\").append('<div class=\"error_text\">This list address is invalid.</div>');\r\n}", "title": "" }, { "docid": "9db09e0679eea9483de7b9e6f2c058a0", "score": "0.56067866", "text": "function insertPageDesc() {\n\n $('#page_desc').append('<br><h1 id=\"title\">EGDI Vocabularies</h1>');\n $('#page_desc').append('<h4>European Geological Data Infrastructure</h4>');\n $('#page_desc').append('<p>Establishing the European Geological Surveys Research Area to deliver a Geological Service for Europe</p>');\n}", "title": "" }, { "docid": "01c617771a3ab2b043a9322c8af1877d", "score": "0.5603604", "text": "function ajaxWriteItems(response, writeTo) {\r\n\tif (response.readyState == 4) {\r\n\t\tif (response.status == 200)\r\n\t\t\twriteTo.innerHTML = '<ul><li>'\r\n\t\t\t\t\t+ response.responseText.replace(/<br\\/>/g, '</li><li>')\r\n\t\t\t\t\t+ '</li></ul>';\r\n\t\telse\r\n\t\t\twriteTo.innerHTML = '';\r\n\t}\r\n}", "title": "" }, { "docid": "776619a57b1a8bf82246490a2fc1b978", "score": "0.5598311", "text": "function write_response(){setTimeout(function(){\n //Create a div element in the html\n var div = document.createElement('div');\n input = document.getElementById('input_user').value;\n //Assign to this div the text corresponding to the input of the user\n div.textContent = document.getElementById('input_user').value;\n //Assign class \"msg_in\"\n div.setAttribute('class', 'msg_in');\n //Add the div element to the section of tje html corresponding to the chat\n document.getElementById('chat_msg').appendChild(div);\n //Empty the input of the user \n document.getElementById('input_user').value = '';\n }, 100);\n}", "title": "" }, { "docid": "c8da2188d96d4f8bbd3fc9d6622c3f43", "score": "0.55889595", "text": "function correct() {\n $('#msg').html('<p class=\"success\">alright</p>');\n}", "title": "" }, { "docid": "91bc7543a4acdbd6ad15a9153027f879", "score": "0.55875754", "text": "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "title": "" }, { "docid": "35e13fe36143feac0c989bbac462a99c", "score": "0.55813944", "text": "function drawNoOrdersMessage(){\r\n\tvar noOrdersMessage = '<div class=\"noOrders\"><h1>There are currently no orders in the queue.</h1></div>';\r\n\t$('#page').append(noOrdersMessage);\t\t\r\n}", "title": "" }, { "docid": "150e28dc7e0f435f1ccb1519a6686287", "score": "0.5577576", "text": "function outputMessage(message) {\n $('#chat-messages-display').append($('<li>').text(message));\n}", "title": "" }, { "docid": "498f7e15c89d2e623e4aa18a0d153350", "score": "0.55714285", "text": "function displayText() {\n $(\"#results\").html(\n \"CORRECT ANSWERS: \" + correctAnswers +\n \"<br>INCORRECT ANSWERS: \" + incorrectAnswers +\n \"<br>UNANSWERED QUESTIONS: \" + unansweredQuestions\n );\n}", "title": "" }, { "docid": "5cd78488bee99a3f993ec972e038b5df", "score": "0.5571222", "text": "function addChallenge(challengeuser) {\n //check if a challenge has been appended\n if($('#challengePrompt').is(':empty'))\n {\n $('#challengePrompt').html('<p>'+challengeuser+' has challenged you to a match.</p><button onclick=\"acceptChallenge();\">Accept</button>');\n }\n}", "title": "" }, { "docid": "7b5d4bb9ed8482760d7d68a289d87015", "score": "0.5570334", "text": "function appendQ() {\n //display score\n $('#score').text(` correct - ${correct} incorrect - ${incorrect} `)\n //index will be equivalent to the questions length array from the top\n //if user has went through all the questions then \n //game will end and clear the counter\n if (index === questions.length) {\n clearInterval(counter);\n endGame();\n //otherwise game will display the question\n } else {\n $('#qDiv').html(questions[index].q);\n //a div will have an empty string\n $('#aDiv').html('');\n //each choice will be made into buttons\n questions[index].c.forEach(function (ele, i) {\n $('#aDiv').append(`<button class='btn btn-md btn-secondary' id=${i}>${ele}</button>`)\n })\n }\n }", "title": "" }, { "docid": "a3ebc841f33af515dae7655be1dde5d0", "score": "0.5569688", "text": "function showList(message) {\n $(\"#listaCalls\").append(\"<div class='card'> <h5 class='card-header'> Titulo </h5> <div class='card-body'> <h5 class='card-title'> Special title treatment </h5><p class='card-text'> TEXTO </p> <a href='#' class='btn btn-primary'>BOTAO</a> </div> </div>\");\n }", "title": "" }, { "docid": "7489c0178beff2a966996b51f96c9d38", "score": "0.55567497", "text": "function ajaxSuccessMsg(msg) {\n jQuery(\"div#notification\").html(\"<span class='info'>\" + msg + \"</span>\");\n}", "title": "" }, { "docid": "bb055f138217198d4327a4460b190a98", "score": "0.55556536", "text": "function printResults() {\n $(\"#qna-box\").empty();\n $(\"#qna-box\").append(\n '<div class=\"alert alert-success\" role=\"alert\" style=\"width: 66%; margin: 0 auto 10px;\">Results</div>'\n );\n $(\"#qna-box\").append(\"<p>You got \" + numRight + \" correct!</p>\");\n $(\"#qna-box\").append(\"<p>You got \" + numWrong + \" wrong!</p>\");\n $(\"#qna-box\").append(\n \"<p>You left \" + numUnanswrd + \" questions unanswered!</p>\"\n );\n $(\"#qna-box\").append(\n '<button id=\"restart\" type=\"button\" class=\"btn btn-primary btn-lg\">Restart Game</button>'\n );\n}", "title": "" }, { "docid": "682341054ae6db429f8c56533ff6efa0", "score": "0.5552402", "text": "function addUserReply(message){\n //inser message text into element\n var $chatHistory = $('#userMessage').clone();\n console.log(\"here\");\n console.log($chatHistory)\n $chatHistory.appendTo(\".chat-history\").find('ul');\n\n}", "title": "" }, { "docid": "ebc4f7218b27a93724d6ba61609e2b2d", "score": "0.554741", "text": "function addText(elem, html) {\n $(elem).text(html);\n}", "title": "" }, { "docid": "295fc365fa44ca9250776f1817798a71", "score": "0.5546166", "text": "function showPollResults(results) {\n $('.poll-thankyou', element).text('Thank you!');\n }", "title": "" }, { "docid": "09f9dc0b9fb7841791ce6133f4b71b2d", "score": "0.55427843", "text": "function appendData(html){\n document.getElementById(\"resultDiv\").innerHTML=html;\n}", "title": "" }, { "docid": "0b4416872999118750c6f6eddd51c5ad", "score": "0.5540265", "text": "function displayHelp(http) {\r\n\tvar helpPanel = document.getElementById('help_container');\r\n\thelpPanel.innerHTML = http.responseText;\r\n}", "title": "" }, { "docid": "afec9deb8a92b5f6967767e35ddb3f72", "score": "0.55366945", "text": "function replace(response){\n $('#replaceProfiles').html(response.result);\n contentHeight();\n }", "title": "" }, { "docid": "ec9025e448b72e137b7d6207dfcc54da", "score": "0.5532442", "text": "function appendText() {\n var txt1 = \"<p>Assalamualaikum.</p>\"; \n var txt2 = $(\"<p></p>\").text(\"Good Noon\"); \n var txt3 = document.createElement(\"p\");\n txt3.innerHTML = \"Assalamualaikum\"; \n $(\"body\").append(txt1, txt2, txt3); \n }", "title": "" }, { "docid": "e2a2f9d9868d148b44d3ca32a0117d49", "score": "0.5525826", "text": "function showText(result) {\n result.forEach(element => { \n let $content = $('#content-text');\n\n $content.append(` <tr>\n <th scope=\"row\" class=\"totalRespon bg-dark text-light\" data-responses=${element.content} data-id=${element.id}>${element.id}</th>\n <td class=\"totalRespon\" data-id=${element.id}>${element.content}</td>\n <td>${element.author_name}</td>\n <td>${element.responses_count}</td>\n </tr>`);\n });\n}", "title": "" }, { "docid": "0a080ea869259084307b3b5009307c86", "score": "0.5516463", "text": "function showQuestion(question) {\r\n $(\"#txtPregunta\").html(question.question);\r\n var i = 0;\r\n $('ul.opciones_respuestas li').removeClass(\"correcta incorrecta\");\r\n question.responses.forEach(function (data) {\r\n $(\"#txtRespuesta\" + ++i).html(data.option);\r\n });\r\n}", "title": "" }, { "docid": "3afbce92bd9c2b698611dd6ac03757ec", "score": "0.55161947", "text": "function addInfo(message) {\n var liText = \"<li class=\\\"blank\\\">\" + message + \"</li>\";\n\n $('.liste-deroulante').append(liText);\n}", "title": "" }, { "docid": "94c04b8cd628b3e3503b5d4499bc61a4", "score": "0.55152667", "text": "function chat_add_html(html) {\n $(\"#chat_log\").append(html);\n chat_scrolldown();\n }", "title": "" }, { "docid": "17e4b39efa0e2568a6ac39be5ddeba98", "score": "0.5506912", "text": "function displayListNotFound(){\r\n $(\".page_body\").append('<h2 class=\"error_header\">List Not Found</h2>');\r\n $(\".page_body\").append('<div class=\"error_text\">We did not find this list.</div>');\r\n}", "title": "" }, { "docid": "8ae6029cda449960df219ffc81cef31e", "score": "0.550647", "text": "function displayCorrect(){\n $(\".js-question-cont\").addClass(\"correct\");\n $(\"form.questions\").append(\"<h3 class=\\\"feedback\\\">Correct!</h3>\");\n}", "title": "" }, { "docid": "a016d5bc546b171ca90c14c357e6e3b8", "score": "0.55059975", "text": "function displayResult(response) {\n result_element = document.getElementById('results');\n result_element.innerHTML = response;\n}", "title": "" }, { "docid": "fd929e19f8c3710dd37099ed2d0a1444", "score": "0.5501777", "text": "function submition(){\n var youWrote = textarea.value;\n answers += \"<p> <em>\" + youWrote + \" </em></p>\" ;\n var myAnswer = randomElement(genericResponses);\n answers += \"<p>\" + myAnswer + \"</p>\";\n content.innerHTML = answers; \n}", "title": "" }, { "docid": "53cc9a663b130c4bf49309da0368a114", "score": "0.54964787", "text": "function writeMessage(output){\n message.innerHTML = `\n <div>You Said:</div>\n <span class=\"box\">${output}</span>`;\n}", "title": "" }, { "docid": "19a6cd74cad9923724b698b60883d7a4", "score": "0.5494877", "text": "function append_words(new_words) {\n\tfor (var i = 0; i < new_words.length; i++) {\n\t\tvar $first_letter = $(\"<h2></h2>\").text(new_words[i][0]);\n\t\tvar $rest= $(\"<p></p>\").text(new_words[i].slice(1));\n\t\t$(\".content\").append($first_letter);\n\t\t$(\".content\").append($rest);\n\t\t$(\".content\").append(\"</br>\");\n\t}\n}", "title": "" }, { "docid": "872da796bb78073f625b81b5e531133c", "score": "0.54943776", "text": "function updateStatusMsg(response) {\n if ($(\".status-info\").length !== 0) {\n $(\".status-info\").empty();\n }\n\n if (response.status === \"success\") {\n $(\".status-info\").append(\n `<div class=\"col-6 alert alert-success mb-5 text-sm\">\n ${response.message}\n </div>`)\n } else {\n $(\".status-info\").append(\n `<div class=\"col-6 alert alert-danger mb-5 text-sm\">\n ${response.errors ? Object.values(response.errors)[0][0] : response.message}\n </div>`)\n }\n}", "title": "" }, { "docid": "9c95c020144bbd4179f247a4bf77ec7a", "score": "0.5488115", "text": "function reply(answer) {\n var url = \"reply?\" + answer;\n var response = new XMLHttpRequest();\n response.open(\"GET\", url, true);\n response.send();\n\n document.getElementById(\"refresh\").innerHTML = \"\";\n}", "title": "" }, { "docid": "41a7d60f7d18fa67dc52a7110ec5533a", "score": "0.5482632", "text": "function appendToDom( jokes ) {\n $('#outputDiv').empty();\n\n for( let item of jokes ) {\n $('#outputDiv').append(`<ul><li>${item.whoseJoke}'s Joke: ${item.jokeQuestion}...<b>${item.punchLine}</b> HHAHAHAHAHAHA!!!`)\n };\n\n}", "title": "" }, { "docid": "fa27162399d55fd0d41c4cd5114300dd", "score": "0.54823107", "text": "function handleResponse(resp) {\n const results = document.getElementById(\"lucky-results\");\n let html='';\n\n /** check response for errors displays them*/\n if(resp.errors){\n\n for(let i of resp.errors){\n html += `<b>${Object.values(i)}</b><br>`;\n }\n }\n\n /** if no errors, display response */\n else{\n html += `\n <p>Your lucky number is ${resp.num.num} (${resp.num.fact}).</p>\n <p>Your birth year (${resp.year.year}) fact is ${resp.year.fact}.</p>\n `;\n }\n\n results.innerHTML = html;\n}", "title": "" } ]
c0c2b28b06ebca0ef283f3599dc26e39
Bytes throughput Over Time
[ { "docid": "02019369817782265cf037f9b3b3e1a9", "score": "0.0", "text": "function refreshBytesThroughputOverTime(fixTimestamps) {\n var infos = bytesThroughputOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotBytesThroughputOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotBytesThroughputOverTime\", \"#overviewBytesThroughputOverTime\");\n $('#footerBytesThroughputOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "title": "" } ]
[ { "docid": "baaec5a6359ebe36609f7db211ab6ccd", "score": "0.70827144", "text": "function formatThroughput(bytes,noDecimal,maxPrecision) {\n var data = formatBytes(bytes,noDecimal,maxPrecision);\n if(data != '-')\n return data.replace('B','b') + 'ps';\n else\n return '-';\n}", "title": "" }, { "docid": "074fdb6699752bbea940c5aa8202adfd", "score": "0.6570967", "text": "function throughputLogger() {\n var now = new Date();\n var aMinuteAgo = now - (1000);\n var cnt = 0;\n // since recent requests are at the end of the array, search the array\n // from back to front\n for (var i = requests.length - 1; i >= 0; i--) {\n if (requests[i] >= aMinuteAgo) {\n ++cnt;\n } else {\n break;\n }\n }\n yData.push(cnt);\n xData.push(now.getMinutes() + ':' + now.getSeconds());\n console.log(\"Throughput: \", cnt)\n\tsetTimeout(throughputLogger, 1000) \n}", "title": "" }, { "docid": "fc5054d3da88554ebdc81fc9841664c1", "score": "0.6041924", "text": "function totalIOBytes(change) {\n return metric(\"TotalIOBytes\", Object.assign({ unit: \"Percent\" }, change));\n }", "title": "" }, { "docid": "6b554e96ae8f2c020d249807ecce3b34", "score": "0.6028164", "text": "function testRate(source, size, rate, tolerance, cb) {\n var throttledStream = new ThrottledReader(source, {\n rate: rate,\n cooldownInterval: 50\n });\n var startTime = null;\n var endTime = null;\n var byteCount = 0;\n var ended = false;\n var closed = false;\n\n function finish() {\n assert(endTime && startTime);\n var measured = endTime - startTime;\n console.log('Measured ' + measured +' ms');\n if (tolerance > 0) {\n var expected = size / rate * 1000;\n var error = Math.abs(measured - expected);\n var acceptable = expected / 100 * tolerance;\n console.log('Error is ' + error.toFixed(3) + 'ms on a ' +\n acceptable.toFixed(3) + 'ms margin');\n assert.isBelow(error, acceptable);\n } else if (tolerance < 0) {\n tolerance = Math.abs(tolerance);\n console.log('Limit is ' + tolerance + 'ms');\n assert.isBelow(measured, tolerance);\n }\n cb();\n }\n\n throttledStream.on('data', function(chunk) {\n startTime = startTime || new Date();\n assert.instanceOf(chunk, Buffer);\n assert.isAbove(chunk.length, 0);\n assert(chunk.equals(new Buffer(chunk.length).fill(0)));\n byteCount += chunk.length;\n });\n throttledStream.on('close', function() {\n closed = true;\n if (ended) finish();\n });\n throttledStream.on('end', function() {\n endTime = new Date();\n assert.equal(byteCount, size);\n ended = true;\n if (closed) finish();\n });\n return throttledStream;\n}", "title": "" }, { "docid": "5188885bcf6d656ec2116278bf9e47d5", "score": "0.5992638", "text": "function calculateUploadRate(bytes) {\n var now = new Date().getTime();\n uploadSamples.push([bytes, now]);\n\n // get rid of old samples\n while (uploadSamples[0][1] < (now - SAMPLE_PERIOD)) {\n uploadSamples.shift();\n }\n\n if (uploadSamples.length < REQUIRED_SAMPLES) {\n return null;\n }\n\n return 1000 * ((bytes - uploadSamples[0][0]) / (now - uploadSamples[0][1]));\n}", "title": "" }, { "docid": "b008c86a375f62c58be345af5b8a7b49", "score": "0.5925868", "text": "function kb(bytes) { return bytes / SIZE }", "title": "" }, { "docid": "be7b4cc3700ff9c740bb4f920e9aed3a", "score": "0.5868691", "text": "get blockTime() {\n return 128 / this.context.sampleRate;\n }", "title": "" }, { "docid": "fc1d620d3c55da859490bfee89a6b27f", "score": "0.5833096", "text": "function getThroughput(ae, deltaX, log_two, sqrt_2_pi_e, mt) {\n\t\tvar aeMean = mean(ae);\n\t\tvar sdx = sde(deltaX);\n\t\tvar we = sqrt_2_pi_e * sdx;\n\t\tvar ide = Math.log(aeMean / we + 1.0) / log_two; // bits\n\t\tvar mtMean = mean(mt) / 1000.0; // seconds\n\t\treturn ide / mtMean; // bits per second\n\t}", "title": "" }, { "docid": "edaebbe9ae44ffc1f0f43373268d8693", "score": "0.573155", "text": "function byteCount(bytes,precision) {\n\tif (precision ==undefined)\n\t\tprecision = 1;\n\tvar units = ['', 'K', 'M', 'G', 'T', 'P', 'E','Z'];\n\tvar i = 0;\n\twhile (bytes > 1024) {\n\t\tbytes = bytes / 1024;\n\t\ti++;\n\t}\n\tif (i == 0)\n\t\treturn bytes;\n\treturn bytes.toFixed(precision) + units[i];\n}", "title": "" }, { "docid": "fec38e96cb2951ca15e4f652b2c461fb", "score": "0.5725655", "text": "function cockroachSpeed(s){\n return Math.floor((s * 100000) / 3600);\n}", "title": "" }, { "docid": "aa633e7c397fc29e4bfcd41e56ddffe0", "score": "0.5658662", "text": "get blockTime() {\n return 128 / this.context.sampleRate;\n }", "title": "" }, { "docid": "aa633e7c397fc29e4bfcd41e56ddffe0", "score": "0.5658662", "text": "get blockTime() {\n return 128 / this.context.sampleRate;\n }", "title": "" }, { "docid": "7846c8398f47554838e89ec41fae4ee3", "score": "0.561396", "text": "function last_chunk_size(lastreq) {\n let tot = 0;\n for (let tt = 0; tt < lastreq.trace.length; tt++) {\n tot = tot + lastreq.trace[tt].b[0];\n }\n return tot;\n }", "title": "" }, { "docid": "78b2e82e480d0452f246aadc1028a40d", "score": "0.55555904", "text": "function totalBytes(results) {\n var total = 0;\n for(key in results.pageStats) {\n if(key.endsWith('Bytes')) {\n total += parseInt(results.pageStats[key]);\n }\n }\n return total;\n}", "title": "" }, { "docid": "6cb889c7987449f3cdbaefb085de8433", "score": "0.5545132", "text": "function sendbenchmark(delay,app)\n{\n \t\t// Every 8 seconds send benchmark data to server!\n \t\tif(Math.abs(timecount-benchtime)>delay){\n \t\t\tbenchtime=timecount;\n\t\t\tBenchmark(username,app,fps,fpsmax,Math.round(timecount*10.0)/10.0);\n\t\t} \t\t\n}", "title": "" }, { "docid": "191ed0ae0d179d3925cd7d23d8a3bbd1", "score": "0.5541443", "text": "metricProcessedBytes(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.NetworkLoadBalancer#metricProcessedBytes\", \"Use ``NetworkLoadBalancer.metrics.processedBytes`` instead\");\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricProcessedBytes);\n }\n throw error;\n }\n return this.metrics.processedBytes(props);\n }", "title": "" }, { "docid": "673ccb6dfca491bfebc6b19ca8288e8f", "score": "0.5531709", "text": "function get_timediff_us (tr1, tr2)\n{\n\treturn (((tr2.sample - tr1.sample) * 1000000) / sample_rate);\n}", "title": "" }, { "docid": "f968aea47b3b7da5c8f61eed38c4808e", "score": "0.5508699", "text": "function formatBytes(a,b=2){if(0===a)return\"0 Bytes\";const c=0>b?0:b,d=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,d)).toFixed(c))+\" \"+[\"Bytes\",\"KB\",\"MB\",\"GB\",\"TB\",\"PB\",\"EB\",\"ZB\",\"YB\"][d]}", "title": "" }, { "docid": "6ab294cef24119fd574d003827cdcdd2", "score": "0.5503777", "text": "function exports(bytes){if(bytes<=0)return'0';var suffixIdx=Math.floor(Math.log(bytes)/Math.log(1024)),val=bytes/Math.pow(2,suffixIdx*10);return+val.toFixed(2)+suffixList[suffixIdx];}", "title": "" }, { "docid": "ff84e5296cd68bc2a8eb910b06f1c012", "score": "0.549735", "text": "async function sendBigMessage(ip, port){\n\t\tconsole.log(`Sending a big message to ${ip}:${port}`);\n\t\tlet start = Date.now();\n\t\tawait p2p.sendMessage(pack({\n\t\t\ttype: CONST.BIG_MSG_PREPARE,\n\t\t}), ip, port);\n\t\tconst data = crypto.randomBytes(16*1024*1024/2).toString('ascii'); // div by 2 because 1 byte = 2 ascii chars\n\t\tawait p2p.sendMessage(pack({\n\t\t\ttype: CONST.BIG_MSG_SENT,\n\t\t\tdata,\n\t\t}), ip, port);\n\t\tlet elapsed = Date.now() - start;\n\t\tlet bandwidth = data.length/elapsed;\n\t\tconsole.log(`Upload speed to ${ip}:${port} is ${bandwidth} Kb/s (sent ${data.length} bytes)`);\n\t}", "title": "" }, { "docid": "fcb6536e973ed8b27f5eeea0f298f5fc", "score": "0.54914117", "text": "getBandwidths() {\n const resources = window.performance.getEntries();\n if (resources) {\n const bandwidths = resources\n // @ts-ignore\n .filter((entry) => {\n return entry.transferSize && entry.transferSize > this._minSize;\n })\n .map((entry) => {\n const transferTime = entry.responseEnd - entry.responseStart;\n const { transferSize } = entry;\n return transferSize / transferTime;\n });\n if (bandwidths.length > 0) {\n this.bandwidths = bandwidths;\n return bandwidths;\n }\n return undefined;\n }\n return undefined;\n }", "title": "" }, { "docid": "183a26830a456fd25060017ddaf4fdc4", "score": "0.54893637", "text": "function dataWriteIOBytes(change) {\n return metric(\"DataWriteIOBytes\", Object.assign({ unit: \"Bytes\" }, change));\n }", "title": "" }, { "docid": "d4fa8fa4ea8211c9713054b2f093d7f0", "score": "0.54866374", "text": "get sampleTime() {\n return 1 / this.context.sampleRate;\n }", "title": "" }, { "docid": "8a37597d30b6d4e33b5f9e0743d00899", "score": "0.5481848", "text": "get bytesWritten() {\n return this.endpoints.reduce((accumulated, endpoint) => {\n return accumulated + endpoint.bytesWritten;\n }, 0);\n }", "title": "" }, { "docid": "9eaa658208b7e159754fc8f363f06fc5", "score": "0.5466311", "text": "function totalBytes(results) {\n // Your code goes here!\n var bytes = 0;\n var num ='';\n for (pageStat in results.pageStats) {\n \tif (typeof results.pageStats[pageStat] === \"string\") {\n \t\tnum = Number(results.pageStats[pageStat]);\n \t\tbytes += num;\n \t}\n }\n return bytes;\n}", "title": "" }, { "docid": "128c9bc9f7e34520e49aaba3b6f62804", "score": "0.54513115", "text": "function format_throughput (throughput) {\n var format;\n \n if (throughput == \"N/A\") {\n format = throughput;\n } else if ((throughput / 1000000000) > 1) {\n format = (throughput / 1000000000).toFixed(1) + \" GBps\";\n } else if ((throughput / 1000000) > 1) {\n format = (throughput / 1000000).toFixed(1) + \" MBps\";\n } else if ((throughput / 1000) > 1) {\n format = (throughput / 1000).toFixed(1) + \" kBps\";\n } else if (!isNaN(throughput)) {\n format = throughput.toFixed(1) + \" Bps\";\n } else {\n format = throughput;\n }\n \n return format;\n }", "title": "" }, { "docid": "c02f1a30ddd72a9c1d86de80abf68af9", "score": "0.5449305", "text": "toSamples() {\n return this.toSeconds() * this.context.sampleRate;\n }", "title": "" }, { "docid": "0ec6d3f04dd180ca7b73b53722195b5a", "score": "0.54490507", "text": "function totalBytes(results) {\n // Your code goes here!\n var sum = 0; var parskey = 0;\n for (var key in results.pageStats) {\n if (key.search(\"Bytes\") !== -1) {\t//or use indexOf\n parskey = parseInt(results.pageStats[key]);\n sum += parskey;\n }\n }\n return(sum);\n}", "title": "" }, { "docid": "e24d9aaafff1aeb2c900a9ac6ad856ce", "score": "0.54355794", "text": "function computeAnimationThroughput(animationExpectation) {\n if (animationExpectation.frameEvents === undefined || animationExpectation.frameEvents.length === 0) throw new Error('Animation missing frameEvents ' + animationExpectation.stableId);\n\n var durationInS = tr.b.convertUnit(animationExpectation.duration, tr.b.UnitScale.Metric.MILLI, tr.b.UnitScale.Metric.NONE);\n return animationExpectation.frameEvents.length / durationInS;\n }", "title": "" }, { "docid": "2bcb12cf1b3b608dc3a2a11d6234e0ce", "score": "0.5433048", "text": "async bytesToGb(value){\n return Math.round(value / (1024 * 1024))\n }", "title": "" }, { "docid": "9de89242c2d7eb4fb3b16573785d86a5", "score": "0.5427644", "text": "function permittedThroughput(change) {\n return metric(\"PermittedThroughput\", Object.assign({ unit: \"Bytes/Second\" }, change));\n }", "title": "" }, { "docid": "376d49d063560b6112d8ebd939b02704", "score": "0.5421268", "text": "GetQuantizedTimeElapsed() {\n ///return (int32)(m_timeElapsed >> 32);\n return Math.floor(this.m_timeElapsed / 0x100000000);\n }", "title": "" }, { "docid": "a1244a1ef4572dbcb2a1ccbfede05285", "score": "0.5411202", "text": "function timeUsed() {\n\tconst endTime = new Date();\n\tconst timeSeconds = (endTime - startTime) / 1000;\n\treturn timeSeconds.toFixed(2);\n}", "title": "" }, { "docid": "05fe2e99472f1aabd68ebdc864342e8a", "score": "0.5407426", "text": "function hfs(size) {\n\tvar i = Math.floor( Math.log(size) / Math.log(1024) );\n\treturn ( size / Math.pow(1024, i) ).toFixed(2) * 1 + ['B', 'kB', 'MB', 'GB', 'TB'][i];\n}", "title": "" }, { "docid": "d4899cb34f255c38263c194078d82b19", "score": "0.53951675", "text": "function getDuration(byteLength){\n //return duration in seconds\n return byteLength / (mp3BitRate * 1000 / 8);\n}", "title": "" }, { "docid": "09b38bc67af8114995914d9df6d851e3", "score": "0.5390387", "text": "function totalBytes(results) {\n var pageStats = results.pageStats;\n //Object keys array is required to find keys with the word 'Bytes'\n var pageStatsKeyArray = Object.keys(pageStats);\n var byteTotal = 0;\n for (var statKey in pageStatsKeyArray){\n // Search for the word 'Bytes' within the key name\n var byteSearch = pageStatsKeyArray[statKey].search(/Bytes/);\n // Only add the number of bytes if the key name has the word 'Bytes' within\n if (byteSearch != -1){\n byteTotal = byteTotal + Number(pageStats[pageStatsKeyArray[statKey]]);\n }\n }\n return byteTotal;\n}", "title": "" }, { "docid": "167ce0538f26c87dcb0f10c8e837c8ed", "score": "0.538729", "text": "function testSpeed()\n{ \n var test = speedTest({maxTime:10000, serverId: 6000});\n \n console.log(\"Testing.\");\n \n test.on('data',function(data)\n {\n console.log(data.speeds.download);\n tray.title = Math.round(data.speeds.download) + \"Mbps\";\n });\n\n test.on('error',function(err)\n {\n console.error(err);\n });\n}", "title": "" }, { "docid": "5e7d46e4b33ef04dc09b36355afcee25", "score": "0.53851455", "text": "get sampleTime() {\n return 1 / this.context.sampleRate;\n }", "title": "" }, { "docid": "5e7d46e4b33ef04dc09b36355afcee25", "score": "0.53851455", "text": "get sampleTime() {\n return 1 / this.context.sampleRate;\n }", "title": "" }, { "docid": "52787b978e6d27599846d905dc8f9913", "score": "0.5368947", "text": "getFrecency() {\n if (this.pinned) {\n return Infinity;\n }\n const timeSinceUse = Date.now() - this.lastUse;\n if (timeSinceUse < MS_PER_MINUTE) {\n return this.numberOfUses * 4;\n } else if (timeSinceUse < 5 * MS_PER_MINUTE) {\n return this.numberOfUses * 2;\n } else if (timeSinceUse < 30 * MS_PER_MINUTE) {\n return this.numberOfUses / 2;\n }\n return this.numberOfUses / 4;\n }", "title": "" }, { "docid": "3770ab80d202441f2aade19c2dc694aa", "score": "0.5341571", "text": "function now() {\n return performance.now()*1000000;\n}", "title": "" }, { "docid": "8d1823c9e88b9af88f0c5e913f5233de", "score": "0.53241664", "text": "function dataReadIOBytes(change) {\n return metric(\"DataReadIOBytes\", Object.assign({ unit: \"Bytes\" }, change));\n }", "title": "" }, { "docid": "4be4a67c1402567842ceedbc83ecbceb", "score": "0.53237426", "text": "function computeAnimationThroughput(animationExpectation) {\n if (animationExpectation.frameEvents === undefined ||\n animationExpectation.frameEvents.length === 0)\n throw new Error('Animation missing frameEvents ' +\n animationExpectation.stableId);\n\n var durationSeconds = animationExpectation.duration / 1000;\n return animationExpectation.frameEvents.length / durationSeconds;\n }", "title": "" }, { "docid": "8348fa48d3adfdc61e2fb1ab738098f9", "score": "0.5318398", "text": "sampleTime() {\n const { elapsedTime } = this.state\n\n return Math.floor((elapsedTime / 1000))\n }", "title": "" }, { "docid": "a7ab9c4f8202c1e229dc702c0d5973f9", "score": "0.52982235", "text": "function getLatency(ret, count) {\n var tmpUrl=\"\";\n if(count >= 0){\n var tmplatency=ret[0]/2;\n tmpUrl=ret[1].replace(\"images/small.bmp\", \"\");\n $latencyArray[count]=tmplatency;\n console.log(\"Evaluate_Server \"+tmpUrl+ \" Mode \"+$serverMode + \" Latency \"+ tmplatency);\n //console.log(\"Server: \"+tmpUrl+\", latency: \"+tmplatency); \n if(tmplatency<$latency){\n $latency=tmplatency;\n $temporalBestServer=tmpUrl;\n console.log(\"Updated_Best_Server \"+tmpUrl+ \" Mode \"+$serverMode + \" Latency \"+ tmplatency); \n } \n } \n count++;\n if(count < $servers.length){\n ping(\"http://\"+$servers[count]+\"/images/small.bmp\").then(function(retval) {\n getLatency(retval,count);\n }).catch(function(error) {\n console.log(\"Error: \"+ String(error));\n var errorRetval=[];\n errorRetval[1]=\"http://\"+$servers[count]+\"/\";\n errorRetval[0]=9999999;\n getLatency(errorRetval,count);\n });\n }\n if(count >= $servers.length && tmpUrl != \"\"){\n $server=$temporalBestServer;\n if($startup){\n $readyForTesting=true;\n $startup=false;\n }\n var latencyArrayString=\"\";\n for (var i=0; i <$latencyArray.length; i++){\n latencyArrayString+=$latencyArray[i]+\" \";\n }\n sendServerLog(\"Set_New_Server \"+$server+ \" Mode \"+$serverMode + \" Latency \"+ $latency + \" AllLatencies \" + latencyArrayString);\n }\n}", "title": "" }, { "docid": "788284b30a40ae11545f1f6e37591c4e", "score": "0.52911377", "text": "get byte_capacity(){ return this.buffer.byteLength; }", "title": "" }, { "docid": "b74b832fa943d7b50d402eac52d056a1", "score": "0.5290399", "text": "function get_num_samples_for_us (us)\n{\n\treturn ((us * sample_rate) / 1000000 );\n}", "title": "" }, { "docid": "5fa25042e292c0f8a5b6b5306230b167", "score": "0.52900016", "text": "_refreshProgress() {\n const sumAll = fjs.reduce((a,x) => a + x);\n const getPropAsArray = (propName, objectList) => fjs.map(fjs.prop(propName), objectList);\n const reduceBySum = fjs.compose(sumAll, getPropAsArray);\n\n // Downloaded bytes progress updating\n // old progress\n const lastDownloadedBytes = this.downloadedBytes;\n // new progress\n this.downloadedBytes = reduceBySum('downloadedBytes', this.sessions);\n\n // Downloaded percent progress updating\n this.completedPercent = Utils.calculateCompletedPercent(this.downloadedBytes, this.totalBytes);\n\n // BytePerSecond progress updating\n const diffWithNow = (milis) => Date.now() - milis;\n const milisToSeconds = fjs.compose(\n x => x/1000,\n parseFloat\n );\n const diffWithLastProgressUpdateTime = diffWithNow(this.lastProgressUpdateTime);\n this.lastProgressUpdateBytes += this.downloadedBytes - lastDownloadedBytes\n if (diffWithLastProgressUpdateTime > 1000) {\n this.bytesPerSecond = Math.floor(this.lastProgressUpdateBytes / milisToSeconds(diffWithLastProgressUpdateTime));\n this.lastProgressUpdateBytes = 0;\n this.lastProgressUpdateTime = Date.now();\n }\n }", "title": "" }, { "docid": "76ba8fa275d05f405bff5c9999c74305", "score": "0.52693415", "text": "toMicroseconds(){// Convert to microseconds.\nreturn 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3;}", "title": "" }, { "docid": "c08b4030cdfa08f7c4ffbfd980258a0c", "score": "0.52611816", "text": "function SendBufferedData() {\n if (remaining > 0) {\n if (remaining >= characteristicSize) {\n amountToWrite = characteristicSize\n } else {\n amountToWrite = remaining;\n }\n dataToSend = updateData.slice(currentPosition, currentPosition + amountToWrite);\n currentPosition += amountToWrite;\n remaining -= amountToWrite;\n console.log(\"remaining: \" + remaining);\n esp32Service.getCharacteristic(fileCharacteristicUuid)\n .then(characteristic => RecursiveSend(characteristic, dataToSend))\n .then(_ => {\n return document.getElementById('completion').innerHTML = (100 * (currentPosition / totalSize)).toPrecision(3) + '%';\n })\n .catch(error => {\n console.log(error);\n });\n }\n }", "title": "" }, { "docid": "c477a9e36e94a3f46a36a696938ad9e8", "score": "0.5250142", "text": "_determineSamplingInterval() {\n let totalHitCount = this.nodes.reduce((acc, node) => acc + node.hitCount, 0);\n this.samplingInterval = (this.endTime - this.startTime) / totalHitCount;\n }", "title": "" }, { "docid": "578c431d0a023d5f56b4bb39a0156fd8", "score": "0.5248524", "text": "getAvgDBLatency() {\n const data = this._latencyData.map(x => x.dbLatency);\n return data.reduce((x, y) => x + y, 0) / data.length || 1;\n }", "title": "" }, { "docid": "a517f188eab06a445b293e9936ad9b9f", "score": "0.524505", "text": "function getFilesize(bytes) {\n let s = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];\n let e = Math.floor(Math.log(bytes) / Math.log(1024));\n return (bytes / Math.pow(1024, Math.floor(e))).toFixed(2) + \" \" + s[e];\n}", "title": "" }, { "docid": "bd4dbd60ed3d8ed615fd641f528eb30f", "score": "0.5234621", "text": "function detect_latency(tt) {\n\t var adjusted_time = rnow() - TIME_DRIFT;\n\t return adjusted_time - tt / 10000;\n\t }", "title": "" }, { "docid": "bd4dbd60ed3d8ed615fd641f528eb30f", "score": "0.5234621", "text": "function detect_latency(tt) {\n\t var adjusted_time = rnow() - TIME_DRIFT;\n\t return adjusted_time - tt / 10000;\n\t }", "title": "" }, { "docid": "397ecc93f9ec2a25ba7ebcc9231916c3", "score": "0.52323943", "text": "function loop() {\n fetch_data();\n sum_K1 = sum_U1 = sum_K2 = sum_U2 = sum_TOTAL1 = sum_TOTAL2 = 0;\n\n for (var i = 0; i < x.cpu.numOfProcessors; i++) {\n sum_K1 = sum_K1 + x.cpu.processors[i].usage.kernel;\n sum_U1 = sum_U1 + x.cpu.processors[i].usage.user;\n sum_TOTAL1 = sum_TOTAL1 + x.cpu.processors[i].usage.total;\n }\n\n setTimeout(() => {\n fetch_data();\n for (var i = 0; i < x.cpu.numOfProcessors; i++) {\n sum_K2 = sum_K2 + x.cpu.processors[i].usage.kernel;\n sum_U2 = sum_U2 + x.cpu.processors[i].usage.user;\n sum_TOTAL2 = sum_TOTAL2 + x.cpu.processors[i].usage.total;\n }\n\n delta_K = Math.floor(sum_K2 - sum_K1);\n delta_U = Math.floor(sum_U2 - sum_U1);\n delta_TOTAL = Math.floor(sum_TOTAL2 - sum_TOTAL1);\n // console.log(\"delta K=\", delta_K);\n // console.log(\"delta U=\", delta_U);\n // console.log(\"delta TOTAL=\", delta_TOTAL);\n\n cpu_usage_percentage = 100 - ((delta_K + delta_U) / delta_TOTAL * 100);\n console.log(\"cpu usage percentage=\", cpu_usage_percentage);\n }, 1000);\n\n }", "title": "" }, { "docid": "95cc859e2b03800f6ffe4bbd68b30653", "score": "0.52248275", "text": "function transfer (total, opts) {\n var t = util.timer();\n var p = 0;\n var b = util.bar('#', '-');\n var format = 'uploading :pad :size :rate :time :bar :percent';\n return {\n update: function (bytes) {\n p += bytes;\n this.flush();\n },\n flush: function () {\n var cols = process.stdout.columns - 1;\n process.stderr.clearLine();\n process.stderr.cursorTo(0);\n process.stderr.write(this.render(cols));\n },\n done: function () {\n return p >= total;\n },\n rawSize: function () {\n return p;\n },\n size: function () {\n return util.pretty(p);\n },\n rawPercent: function () {\n return p / total;\n },\n percent: function () {\n var f = util.fixed(' ', 6);\n return f((this.rawPercent() * 100).toFixed(1) + '%');\n },\n time: function () {\n var tick = t();\n var secs = tick % 60;\n var mins = Math.floor(tick / 60) % 60;\n var hrs = Math.floor(tick / 3600);\n return util.pad(hrs, 2) + ':' + util.pad(mins, 2) + ':' + util.pad(secs, 2);\n },\n bar: function () {\n return b(24, this.rawPercent());\n },\n rawRate: function () {\n return p / t();\n },\n rate: function () {\n var f = util.fixed(' ', 10);\n return f(util.pretty(this.rawRate()) + '/s');\n },\n // w - width of output (default to 79)\n // why 79? because most terminals default to 80 chars, and 79 is 1\n // less to keep any clearLine functions working.\n render: function (w) {\n\n if (w === undefined) {\n w = 79;\n }\n\n var pad = [];\n var s = format.split(' ');\n\n for (var i = 0; i < s.length; i++) {\n if (s[i][0] === ':') {\n var func = s[i].slice(1);\n if (func === 'pad') {\n pad.push(i);\n s[i] = '';\n } else {\n s[i] = this[func]();\n }\n }\n }\n\n // apply padding until the width w is reached, can only occur if\n // :pad tag is in format string, otherwise skipped.\n var j = 0;\n if (pad.length > 0) {\n while (s.join(' ').length < w) {\n s[pad[j]] += ' ';\n // apply padding to each :pad tag evenly\n j = (j + 1) % pad.length;\n }\n }\n\n return s.join(' ');\n }\n };\n}", "title": "" }, { "docid": "e80cee29618d520cc9958f64ad722a62", "score": "0.52127486", "text": "sendProgress() {\n // compute number of tests if not done so already\n if (!this.testCount) {\n this.testCount = 0;\n this.frameworks.forEach(framework => {\n framework.tests.forEach(test => {\n this.testCount++;\n });\n });\n }\n\n var percentage = (this.testsComplete / this.testCount) * 100;\n this.socket.emit('benchmark_progress', {'percent' : percentage});\n }", "title": "" }, { "docid": "000199f1feea6ecf62a1d1eb291dd0a1", "score": "0.52097386", "text": "function formatSpeed (bits) {\n var sizes = ['b/s', 'kb/s', 'Mb/s', 'Gb/s', 'Tb/s']\n if (bits === 0) {\n return '0 b/s'\n }\n var i = parseInt(Math.floor(Math.log(bits) / Math.log(1024)), 10)\n return Math.round(bits / Math.pow(1024, i), 2) + ' ' + sizes[i]\n}", "title": "" }, { "docid": "fbff35c9c977e09acd7480385c55e934", "score": "0.52093256", "text": "function totalBytes(results) {\n // Your code goes here!\n var totalNumBytes = 0;\n for (var key in results){\n if (results[key] == \"BYTES\"){\n totalNumBytes =+ results.value;\n }\n }\n return totalNumBytes;\n}", "title": "" }, { "docid": "0a5c2fe60b21059f6f1b9f98cd0871f5", "score": "0.5207636", "text": "function recalculateTimeout(Mb){\n var H=100;\n for(var o=1; o<=(Mb-2)/2; o++){\n H=H*2;\n }\n H=H+50;\n return H;\n}", "title": "" }, { "docid": "b82e3c533037e22423faeb534e3fae2b", "score": "0.52057666", "text": "function detect_latency(tt) {\n var adjusted_time = rnow() - TIME_DRIFT;\n return adjusted_time - tt / 10000;\n }", "title": "" }, { "docid": "b82e3c533037e22423faeb534e3fae2b", "score": "0.52057666", "text": "function detect_latency(tt) {\n var adjusted_time = rnow() - TIME_DRIFT;\n return adjusted_time - tt / 10000;\n }", "title": "" }, { "docid": "09afd08a292c4aecbf7edd0321d69e43", "score": "0.51791304", "text": "ms () { return this.now() - this.startMS }", "title": "" }, { "docid": "e065bb3b0cfcb14b4f1bcb32c3d1177e", "score": "0.5176779", "text": "function Network_Device_usageProgress(obj) {\n var item = UCapCore.findDevice({uid:obj.uid, did:obj.did});\n item = UCapCore.devices[obj.uid][item];\n var total = (!isNaN(item[5]) && item[5] != -1) ? Math.round(item[5] / 1048576) : 1; //bytes to Megabytes\n var used = (!isNaN(item[6]) && item[6] != -1) ? Math.round(item[6] / 1048576) : 1; //bytes to Megabytes\n var progress = Math.round((used / total) * 100);\n if (item[4] == \"f\") {\n UCapViz.drawProgressBar({tar:'bar', val:0, disabled:true});\n $('div[name=\"progress-status\"]').html(used + \" MB Used\");\n } else {\n UCapViz.drawProgressBar({tar:'bar', val:progress});\n if(progress >= 100)\n $('div[name=\"progress-status\"]').html(\"This device is currently capped.<br/> You have exceeded the bandwidth cap of \" + total + \"MB allocated to this device.\");\n else\n $('div[name=\"progress-status\"]').html(used + \" MB or \" + progress + \"% of \" + total + \"MB Used\");\n }\n}", "title": "" }, { "docid": "5e4de95a973ea2e06422aff84e1f7d3a", "score": "0.51762044", "text": "function getDeltaTime() {\n return (1000 / frameRate()) / 1000;\n}", "title": "" }, { "docid": "619c29d4b358c6df1c11272cdc31c4d4", "score": "0.5174909", "text": "function speedTest() {\n for (let i = 0; i < window.numSessions; i++) {\n sendData(i)\n }\n}", "title": "" }, { "docid": "d5c352d981e50fad6113bb145bd88211", "score": "0.5164735", "text": "toSamples() {\n return this.toSeconds() * this.context.sampleRate;\n }", "title": "" }, { "docid": "d5c352d981e50fad6113bb145bd88211", "score": "0.5164735", "text": "toSamples() {\n return this.toSeconds() * this.context.sampleRate;\n }", "title": "" }, { "docid": "10722713911cd6957e9cd7baba029083", "score": "0.5160569", "text": "_bytesToSize(bytes) {\r\n var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\r\n if (bytes == 0) return '0 Byte';\r\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\r\n return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];\r\n }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" }, { "docid": "0917058b298b138879582679ce383382", "score": "0.5159647", "text": "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "title": "" } ]
4e1febe502f52400e3bd4421b83e916f
Construct the node behavior on the choice nodes
[ { "docid": "1a3550f36712623e6529d8ddc413f608", "score": "0.52229923", "text": "function build(hash) {\n\t\t//console.log(hash);\n\t\tnode.empty().append($(\"<div/>\").addClass(\"statement\").html(hash.statement));\n\t\tfor (var i = 0; i < hash.choices.length; i++) {\n\t\t\tvar choice = new Choice(i, hash.choices[i], self);\n\t\t\tchoices.push(choice);\n\t\t\tnode.append(choice.getNode());\t\n\t\t}\t\n\t}", "title": "" } ]
[ { "docid": "c6af44a7714285cbfef80364dad99f46", "score": "0.58699906", "text": "function choice(node) {\n node.choice = null;\n node.expanded = true;\n\n node.buildRequest = function (builder, req, module) {\n var added = false;\n\n if (node.choice) {\n added = node.choice.buildRequest(builder, req, module);\n }\n\n return added;\n };\n\n node.fill = function (name, data) {\n var filled = false,\n nodesToFill = node.getChildren(null, null, constants.NODE_UI_DISPLAY);\n\n nodesToFill.forEach(function (child) {\n var childFilled = child.fill(name, data);\n\n if (childFilled) {\n node.choice = child;\n }\n\n filled = filled || childFilled;\n if (filled) {\n return false;\n }\n });\n\n return filled;\n };\n\n node.clear = function () {\n node.nodeType = constants.NODE_UI_DISPLAY;\n\n if (node.choice) {\n node.choice.clear();\n node.choice = null;\n }\n };\n\n node.isFilled = function () {\n return node.choice !== null;\n };\n }", "title": "" }, { "docid": "76e289b0e0b6c1a87314c05311858791", "score": "0.5869457", "text": "function setUpInteractions() {\n\t\n\tvar alphaNodes = [];\n\tfor(var i in nodes) {\n\t\talphaNodes.push(nodes[i]);\n\t}\n\t\n\talphaNodes.sort(function(a, b) {\n\t\treturn d3.ascending(a.Name, b.Name);\n\t});\n\n\t// Build dropdown menu dynamically\n var opts = '';\n for(var i in alphaNodes) {\n opts += '<option value=\"' + alphaNodes[i].Index + '\">' + (alphaNodes[i].Name + \" \" + alphaNodes[i].FamilyName) + '</option>';\n }\n dropdown.html(opts);\n\t\n\tselectedNode = nodes[0];\n\tdropdown.property('value', 0);\n\t\n\t// Event for dropdown changes\n dropdown.on('change',changeCenterPoint);\n\t\n\tdropdownLabel.html(significanceLabels[4]);\n\t\n\t// Event for relationship filter changes\n d3.selectAll('.relationFilters input').on('change',getRelationships);\n\t\n\t// Event for char significance slider changes\n slider.on('change', changeCharacterSignificance);\n\t\n\t// Event for resetting filter button\n\tresetButton.on(\"click\", resetNodeFilters);\n}", "title": "" }, { "docid": "58e5943b7a8dd4f95dac51e48babcc86", "score": "0.5736832", "text": "function onToggle() {\n var node = $(this).data('node');\n //If node is being opened see if children are needed\n if ($(this).attr('open')) {\n if(node.needsChildren) {\n saved = false;\n node.needsChildren = false;\n node.children = [];\n for (var index in objectTypes[node.type].children) {\n var childTemplate = objectTypes[node.type].children[index];\n var valid = true;\n //TODO: Remove this once old requirements are updated to the new way\n if (childTemplate.requirement) {\n valid = eval(childTemplate.requirement);\n }\n if (childTemplate.prerequisites) {\n for (var i = 0; i < childTemplate.prerequisites.length; i++) {\n var prereq = childTemplate.prerequisites[i];\n valid = valid && operators[prereq.operator](node.attributes[prereq.attribute],prereq.value);\n }\n }\n if (valid) {\n var numChildren;\n if (childTemplate.weightedRange) {\n numChildren = weightedRand(childTemplate.weightedRange)\n } else {\n numChildren = rand(childTemplate.min,childTemplate.max);\n }\n for (var i = 0; i<numChildren; i++) {\n var childType;\n if (typeof(childTemplate.type) === \"object\") {\n //If it's an object treat it as a weighted array\n childType = weightedRand(childTemplate.type);\n } else {\n childType = childTemplate.type; \n }\n addChildToNode(childType,node);\n if(childTemplate.requiredSibling) {\n addChildToNode(childTemplate.requiredSibling, node);\n }\n }\n //Reset queued name so it doesn't impact cousins or more distant nodes\n queuedName = null;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "5902351a48741d12670df67874193a99", "score": "0.5483528", "text": "function createChoices(scene) {\n const container = document.getElementById('choices-container');\n container.innerText = \"\";\n \n for (let i = 0; i < scene.choices.length; i++) {\n const choice = scene.choices[i];\n const nextScene = scene.nextScene[i];\n createButton(choice, nextScene, container);\n }\n}", "title": "" }, { "docid": "89508ad30f29070317dc1f8fb2e653de", "score": "0.5477512", "text": "addStoryNode(id, parent=false) {\n const { story } = this.state\n const node = {\n \"title\": `Node ${id}`,\n \"id\" : id,\n \"story_id\": story.id,\n \"votes\": 0,\n \"is_accepted\": false,\n \"background_id\": null,\n \"music_id\": null,\n \"text\": \"\"\n }\n story.nodes.push(node)\n\n if (parent) {\n\n if (parent.choices == null) {\n\n // First child\n if (parent.next_node_id == null) {\n parent.next_node_id = node.id\n\n // Second child\n } else {\n parent.choices = [\n {\n text : \"Option 1\",\n next_node_id : parent.next_node_id\n },\n {\n text : \"Option 2\",\n next_node_id : node.id\n }\n ]\n\n parent.next_node_id\n\n }\n\n // Other cases\n } else {\n parent.choices.push({\n text: `Option ${parent.choices.length + 1}`,\n next_node_id: node.id\n })\n\n }\n }\n\n return node\n }", "title": "" }, { "docid": "acb8a6dce3baa10e1da944caa33bbad0", "score": "0.54562384", "text": "createNodes() {\n // Create WebAudio nodes\n this.eq = new EqualizerClean(this.context);\n this.ampReverb = new ConvolverClean(this.context, this.reverbImpulses, \"reverbImpulses\");\n this.cabinetSim = new ConvolverClean(this.context, this.cabinetImpulses, \"cabinetImpulses\");\n this.boost = new BoostClean(this.context);\n\n this.amp = new CleamAmp(this.context, this.boost, this.eq, this.ampReverb, this.cabinetSim);\n }", "title": "" }, { "docid": "78b2cd7338cd70f9135228d5312e0331", "score": "0.5416964", "text": "function DecisionMenu() {}", "title": "" }, { "docid": "19188641c7d76f5219426aeea266310e", "score": "0.54016155", "text": "function node(args){\n\tthis.id=nodeid++;\n\tthis.type=args.type;//function|variable|constant\n\tthis.functionname=args.functionname;//if it is a function\n\tthis.variablename=args.variablename;//if it is a variable\n\tthis.value=args.value;//value if it is a constant;\n\n\tif(typeof this.functionname !== 'undefined'){\n\t\tif(this.functionname=='if<=')\n\t\t\tthis.arity=4;\n\t\telse this.arity=2;\n\n\t\tif(typeof args.arguments !== 'undefined')\n\t\t\tthis.arguments=args.arguments;//new Array(arity);\n\t\telse this.arguments=new Array(this.arity);\n\t}\n\n\n\tthis.copy=function(){\n\n\t\tvar copy=new node({type:this.type,functionname:this.functionname, variablename:this.variablename,value:this.value});\n\n\t\tif(this.type=='function'){\n\t\t\t copy.arguments=new Array(this.arity);\n\n\t\t\tfor(var i=0;i<this.arity;i++){\n\t\t\t\tcopy.arguments[i]=this.arguments[i].copy();\n\t\t\t}\n\t\t}\n\n\t\treturn(copy);\n\t}\n\n\tthis.toArray=function(){\n\n\t\tif(this.type=='function'){\n\t\t\t//var f=[this];\n\n\t\t\tvar args=[this];\n\n\t\t\tfor(var i=0;i<this.arity;i++){\n\t\t\t\tvar arg=this.arguments[i];\n\t\t\t\targs=args.concat(arg.toArray());\n\t\t\t}\n\t\t\treturn(args);\n\n\t\t}\n\t\telse {\n\t\t\tvar list=[this];\n\t\t\treturn(list);\n\t\t}\n\t}\n\n\tthis.selectIndex=function(isFunction){\n\n\t\tvar ar=this.toArray();\n\t\tvar selected=false;\n\t\tvar selectedIndex;\n\n\t\twhile(!selected){\n\t\t\tvar i=Math.floor(Math.random() * ar.length)\n\t\t\tvar sn=ar[i]; //randomly select an element\n\n\t\t\tif(typeof isFunction == 'undefined'){ //no argument, either fn or terminal is acceptable\n\t\t\t\tselected=true;\n\t\t\t\tselectedIndex=i;\n\t\t\t}\n\t\t\telse if(isFunction){\t\t\t\t//only return a function\n\t\t\t\tif(sn.type==\"function\"){\n\t\t\t\t\tselected=true;\n\t\t\t\t\tselectedIndex=i;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(sn.type != 'function'){\t\t//only returna terminal\n\t\t\t\tselected=true;\n\t\t\t\tselectedIndex=i;\n\n\t\t\t}\n\n\t\t\t\n\n\n\t\t}\n\n\n\n\n\n\n\t\treturn(selectedIndex);\n\n\n\t}\n\n\tthis.getAbsError=function(variablebindings){\n\n\t\tvar val=this.eval(variablebindings);\n\t\tif(isNaN(val)){\n\t\t\tlogger.info(this.toStrArr());\n\t\t\tlogger.info(JSON.stringify(variablebindings))\n\t\t}\n\n\t\tvar speed1=variablebindings.speed1;\n\t\tvar speed2=variablebindings.speed2;\n\n\t\t//var err=variablebindings.speed2-val;\n\n\t\tvar observed=((speed2 -speed1)/speed1) * 100000;\n\n\t\tvar err=observed - val;\n\n\t\t//logger.info(\"val: \" + val + \" err: \" + err);\n\n\t\treturn(Math.abs(err));\n\n\t}\n\n\n\n\t\n\n\tthis.eval=function(variablebindings){ \n\t\ttry{\n\t\t\tif(this.type=='constant'){\n\t\t\t\treturn(this.value);\n\t\t\t}\n\t\t\telse if(this.type=='variable'){\n\t\t\t\treturn(variablebindings[this.variablename]);\n\t\t\t}\n\t\t\telse if(this.type=='function'){\n\t\t\t\tvar argVals=new Array(this.arity);\n\n\t\t\t\tfor(var i=0;i<this.arity;i++){\n\t\t\t\t\targVals[i]=this.arguments[i].eval(variablebindings);\n\t\t\t\t}\n\n\t\t\t\tif(this.functionname=='+'){\n\t\t\t\t\tvar rval=parseFloat(argVals[0]) + parseFloat(argVals[1]);\n\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t//logger.info(JSON.stringify(this) + \" \" + rval + \" \" + JSON.stringify(argVals))\n\t\t\t\t\t\treturn(0)\n\t\t\t\t\t}\n\t\t\t\t\treturn(rval);\n\t\t\t\t}\n\t\t\t\telse if(this.functionname=='-'){\n\t\t\t\t\tvar rval=argVals[0] - argVals[1];\n\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t//logger.info(JSON.stringify(this) + JSON.stringify(argVals))\n\t\t\t\t\t\treturn(0)\n\t\t\t\t\t}\n\t\t\t\t\treturn(rval);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(this.functionname=='*'){\n\t\t\t\t\tvar rval=argVals[0] * argVals[1];\n\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t//logger.info(this.toStrArr() + \" \" + JSON.stringify(argVals))\n\t\t\t\t\t\treturn(0)\n\t\t\t\t\t}\n\t\t\t\t\treturn(rval);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(this.functionname=='/'){\n\t\t\t\t\tvar rval;\n\t\t\t\t\tif(argVals[0]==0)rval=0\n\t\t\t\t\telse rval=argVals[0] / argVals[1];\n\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t//logger.info(JSON.stringify(this) + JSON.stringify(argVals));\n\t\t\t\t\t\treturn(0)\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\treturn(rval);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(this.functionname=='^'){\n\t\t\t\t\t//logger.info(JSON.stringify(argVals));\n\t\t\t\t\tvar rval=Math.pow(argVals[0], Math.floor(argVals[1]));\n\t\t\t\t\tif(!isFinite(rval)){\n\t\t\t\t\t\trval=Number.MAX_VALUE;\n\t\t\t\t\t}\n\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t//logger.info(JSON.stringify(this) + JSON.stringify(argVals))\n\t\t\t\t\t\treturn(0)\n\t\t\t\t\t}\n\t\t\t\t\treturn(rval);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(this.functionname=='if<='){\n\t\t\t\t\tif(argVals[0] <= argVals[1]){\n\t\t\t\t\t\trval=argVals[2];\n\t\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t\t//logger.info(JSON.stringify(this) + JSON.stringify(argVals))\n\t\t\t\t\t\t\treturn(0)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn(rval)\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\trval=argVals[2];\n\t\t\t\t\t\tif(isNaN(rval)){\n\t\t\t\t\t\t\t//logger.info(JSON.stringify(this) + JSON.stringify(argVals))\n\t\t\t\t\t\t\treturn(0)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn(rval);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}catch(err){\n\t\t\tlogger.error(err);\n\t\t\tlogger.error(JSON.stringify(this));\n\t\t}\n\n\t}\n\tthis.printStr=function(depth,full){\n\t\tvar str='' + this.id + \" \";\n\t\tfor(var i=0;i<depth;i++){\n\t\t\tstr+=' ';\n\n\t\t}\n\t\tif(this.type=='constant'){\n\t\t\tstr+=this.value;\n\t\t\tstr+='\\n';\n\n\t\t}\n\t\telse if(this.type=='variable'){\n\t\t\tstr+=this.variablename;\n\t\t\tstr+='\\n';\n\t\t}\n\t\telse if(this.type=='function'){\n\t\t\tstr+=this.functionname + '\\n';\n\t\t\tif(full){\n\n\t\t\t\tfor(var i=0;i<this.arity;i++){\n\t\t\t\t\tvar arg=this.arguments[i];\n\t\t\t\t\tstr+=arg.printStr(depth + 1,true);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn(str);\n\t}\n\tthis.toStrArr=function(){\n\t\tvar str='';// + this.id + \" \";\n\t\t\n\t\tif(this.type=='constant'){\n\t\t\tstr+=this.value ;\n\t\t\tstr+=',';\n\n\t\t}\n\t\telse if(this.type=='variable'){\n\t\t\tstr+='\"' + this.variablename + '\"';\n\t\t\tstr+=',';\n\t\t}\n\t\telse if(this.type=='function'){\n\t\t\tstr+='\"'+this.functionname + '\",';\n\t\t\tif(true){\n\n\t\t\t\tfor(var i=0;i<this.arity;i++){\n\t\t\t\t\tvar arg=this.arguments[i];\n\t\t\t\t\tstr+=arg.toStrArr();// + ',';\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn(str);\n\t}\n}", "title": "" }, { "docid": "af249b7f99c75f087e1bdb93ad37d538", "score": "0.5319476", "text": "function createNode(node) {\n var div = document.createElement(\"div\");\n div.className = \"form-inline nodeDiv\";\n div.setAttribute(\"style\", \"clear:both\");\n\n var nodeTypeArray = getEnumValuesAsArray(NODE_TYPE);\n var selectNodeType = document.createElement(\"select\");\n selectNodeType.className = \"selectpicker nodeType\";\n // selectNodeType.setAttribute(\"data-width\", \"auto\")\n selectNodeType.setAttribute(\"title\", \"Node Type\");\n for (var i = 0; i < nodeTypeArray.length; i++) {\n var option = document.createElement(\"option\");\n option.value = nodeTypeArray[i];\n option.text = nodeTypeArray[i];\n selectNodeType.append(option);\n }\n ;\n\n //nodeType 'Attribute' secilir ise input alani eklenir, aksi takdirde input alani var ise silinir.\n selectNodeType.addEventListener(\"change\", function () {\n if (selectNodeType.value == \"Attribute\") {\n div.appendChild(inputDiv);\n } else if (div.contains(inputDiv)) {\n div.removeChild(inputDiv);\n }\n });\n\n var label1 = document.createElement(\"label\");\n label1.className = \"input-group-addon\"\n label1.innerHTML = \"Node Type\";\n\n var selectDiv = document.createElement(\"div\");\n selectDiv.className = \"input-group col-md-11\";\n selectDiv.appendChild(label1);\n selectDiv.appendChild(selectNodeType);\n\n var inputNodeTypeValue = document.createElement(\"input\");\n inputNodeTypeValue.className = \"form-control nodeTypeValue\";\n inputNodeTypeValue.setAttribute(\"type\", \"text\");\n\n var label2 = document.createElement(\"label\");\n label2.className = \"input-group-addon\"\n label2.innerHTML = \"Node Type Value\";\n\n var inputDiv = document.createElement(\"div\");\n inputDiv.className = \"input-group col-md-11\";\n inputDiv.appendChild(label2);\n inputDiv.appendChild(inputNodeTypeValue);\n\n div.appendChild(selectDiv);\n div.appendChild(createHelpTooltip(nodeTypeContent));\n\n\n // node tanimli gelirse degerleri setli getirilir.\n if (node) {\n if (node.nodeXMLType == NODE_TYPE.ATTRIBUTE.name) {\n div.append(inputDiv)\n inputNodeTypeValue.value = node.nodeXMLValue;\n }\n $(selectNodeType).selectpicker('refresh');\n $(selectNodeType).val(node.nodeXMLType).end();\n }\n\n return div;\n}", "title": "" }, { "docid": "5e822843d03e50c060c58111b0238267", "score": "0.5253803", "text": "function handleNodeToAdd(nodeData) {\n\tvar action = \"\";\n\tnodeData.shape = 'box';\n\tif ($(\"#motionChoice\").prop(\"checked\") == true) {\n\t\taction += \"motion:\" + $(\"#left\").val() + \",\" + $(\"#right\").val();\n\t} else if ($(\"#servoChoice\").prop(\"checked\") == true) {\n\t\taction += \"servo:\" + $(\"#sequence\").val();\n\t} else if ($(\"#relayChoice\").prop(\"checked\") == true) {\n\t\tif($(\"#relay\").val() == null)\n\t\t\treturn false;\n\t\taction += \"relay:\" + $(\"#relay\").val()+\",\"+($(\"#relayOnOff\").prop(\"checked\")?1:0);\n\t} else if ($(\"#speechChoice\").prop(\"checked\") == true) {\n\t\taction += \"speech:\\'\" + $(\"#sentence\").val() + \"\\'\";\n\t} else if ($(\"#scriptChoice\").prop(\"checked\") == true) {\n\t\tif($(\"#script\").val() == null)\n\t\t\treturn false;\n\t\taction += \"script:\" + $(\"#script\").val();\n\t} else if ($(\"#soundChoice\").prop(\"checked\") == true) {\n\t\tif($(\"#sound\").val() == null)\n\t\t\treturn false;\n\t\taction += \"sound:\" + $(\"#sound\").val();\n\t} else if ($(\"#pauseChoice\").prop(\"checked\") == true) {\n\t\taction += \"pause:\" + $(\"#pause\").val() + \"ms\";\n\t\tnodeData.shape = \"circle\"\n\t}\n\tnodeData.label = action;\n\treturn true;\n}", "title": "" }, { "docid": "ca723d656c7219473fa43ea48d04b6fe", "score": "0.518875", "text": "generateRandomChoice() {\n let randomValue = Math.floor(Math.random() * 3);\n this.choice = new Choice(choices.list[randomValue]);\n }", "title": "" }, { "docid": "fb4c502528d941aeccbd2f58f8d0784c", "score": "0.5182541", "text": "function initNodes() {\n nodes = [];\n for (var x = 0; x < params.N; x++) {\n var m = [];\n for (var i = 0; i < params.M; i++) m[i] = [];\n for (i = 0; i < params.M; i++) {\n m[i][i] = 0;\n for (var j = i+1; j < params.M; j++) {\n var b = randomInt(3) - 1; // random number between -1 and 1\n m[i][j] = b;\n m[j][i] = b;\n }\n }\n nodes[x] = {\n name: x,\n beliefs: m,\n // count: count(m),\n cognitive: cog(m)\n };\n }\n}", "title": "" }, { "docid": "24d03dbf22cb424e0ca4a98045e885dc", "score": "0.51514125", "text": "function initNodes(Id) {\n\n var m = mat4();\n\n switch(Id) {\n\n case torsoId:\n \n m = translate( torso_translation , 0, 0);\n\n m = mult(m,translate(0, vertical_translation_bear , 0) );\n m = mult(m,translate(0, 0 , 0.3+translation_to_trunk) );\n\n m = mult(m,rotate(theta[torsoId], vec3(0, 1, 0) ));\n m = mult(m,rotate(torso_angle_up, vec3(1, 0, 0) ));\n m = mult(m,rotate(torso_angle_horizzontal, vec3(0, 0, 1) ));\n \n m = mult(m,rotate(rotation_to_backside, vec3(1, 0, 0)));\n \n if(switch_direction){\n\t\tm = mult(m,rotate(-180, vec3(0, 0, 1) ));\n }\n\tm = mult(m, rotate(scene_rotation_angle, vec3(0, 0, 1)) );\n\n figure[torsoId] = createNode( m, torso, null, headId );\n break;\n\n case headId:\n case head1Id:\n case head2Id:\n\n\n m = translate(0.0, torsoHeight+0.5*headHeight, 0.0);\n\tm = mult(m, rotate(theta[head1Id], vec3(1, 0, 0)))\n\tm = mult(m, rotate(theta[head2Id], vec3(0, 1, 0)));\n m = mult(m, translate(0.0, -0.5*headHeight, 0.0));\n figure[headId] = createNode( m, head, leftUpperArmId, earLeftId);\n break;\n\n\n case leftUpperArmId:\n\n m = translate(-(torsoWidth/2.0), 0.9*torsoHeight, 0.0);\n\t m = mult(m, rotate(theta[leftUpperArmId], vec3(1, 0, 0)));\n figure[leftUpperArmId] = createNode( m, leftUpperArm, rightUpperArmId, leftLowerArmId );\n break;\n\n case rightUpperArmId:\n\n m = translate(torsoWidth/2.0, 0.9*torsoHeight, 0.0);\n\t m = mult(m, rotate(theta[rightUpperArmId], vec3(1, 0, 0)));\n figure[rightUpperArmId] = createNode( m, rightUpperArm, leftUpperLegId, rightLowerArmId );\n break;\n\n case leftUpperLegId:\n\n m = translate(-(torsoWidth/2.0), 0.1*upperLegHeight, 0.0);\n\t m = mult(m , rotate(theta[leftUpperLegId], vec3(1, 0, 0)));\n figure[leftUpperLegId] = createNode( m, leftUpperLeg, rightUpperLegId, leftLowerLegId );\n break;\n\n case rightUpperLegId:\n\n m = translate(torsoWidth/2.0, 0.1*upperLegHeight, 0.0);\n\t m = mult(m, rotate(theta[rightUpperLegId], vec3(1, 0, 0)));\n figure[rightUpperLegId] = createNode( m, rightUpperLeg, tailId, rightLowerLegId );\n break;\n\n case leftLowerArmId:\n\n m = translate(0.0, upperArmHeight-0.5, 0.0);\n m = mult(m, rotate(theta[leftLowerArmId], vec3(1, 0, 0)));\n figure[leftLowerArmId] = createNode( m, leftLowerArm, null, null );\n break;\n\n case rightLowerArmId:\n\n m = translate(0.0, upperArmHeight-0.5, 0.0);\n m = mult(m, rotate(theta[rightLowerArmId], vec3(1, 0, 0)));\n figure[rightLowerArmId] = createNode( m, rightLowerArm, null, null );\n break;\n\n case leftLowerLegId:\n\n m = translate(0.0, upperLegHeight-0.5, 0.0);\n m = mult(m, rotate(theta[leftLowerLegId],vec3(1, 0, 0)));\n figure[leftLowerLegId] = createNode( m, leftLowerLeg, null, null );\n break;\n\n case rightLowerLegId:\n\n m = translate(0.0, upperLegHeight-0.5, 0.0);\n m = mult(m, rotate(theta[rightLowerLegId], vec3(1, 0, 0)));\n figure[rightLowerLegId] = createNode( m, rightLowerLeg, null, null );\n break;\n\n\tcase tailId:\n\tcase tail1Id:\n\tcase tail2Id:\n\n\n m = translate(0.0, +0.75, -1.0);\n\tm = mult(m, rotate(theta[tail1Id], vec3(1, 0, 0)))\n\tm = mult(m, rotate(theta[tail2Id], vec3(0, 1, 0)));\n figure[tailId] = createNode( m, tail, null, null);\n break;\n \n \n \n case earLeftId:\n\n\n m = translate(headWidth/2.0, 2, 0);\n\tm = mult(m, rotate(theta[earLeftId], vec3(1, 0, 0)))\n\tm = mult(m, rotate(theta[earLeftId], vec3(0, 1, 0)));\n figure[earLeftId] = createNode( m, earLeft, earRightId, null);\n break;\n \n case earRightId:\n\n\n m = translate(-headWidth/2.0, 2, 0);\n\tm = mult(m, rotate(theta[earRightId], vec3(1, 0, 0)))\n\tm = mult(m, rotate(theta[earRightId], vec3(0, 1, 0)));\n figure[earRightId] = createNode( m, earRight, null, null);\n break;\n \n \n }\n\n}", "title": "" }, { "docid": "e3db080a772dd194fa5e4cf3155c1732", "score": "0.5150887", "text": "constructor(transitionFunction, acceptStates, startNode) {\n\n if(transitionFunction === null || acceptStates === null || startNode === null){\n throw {message:'Null arguments not accepted'}\n }\n if(transitionFunction === undefined || acceptStates === undefined || startNode === undefined){\n throw {message:'Null arguments not accepted'}\n }\n\n if(typeof startNode === 'object'){\n try{\n startNode = startNode[0]\n if(startNode == undefined){\n throw {message:'Start node datatype is invalid; unable to recover'}\n }\n }catch(err){\n throw {message:'Start node datatype is invalid; unable to recover'}\n }\n }\n\n //find all node names and the alphabet by inference\n this.alphabet = [\n ...new Set(transitionFunction.map(({ symbol }) => symbol).filter((symbol)=>symbol!==lambda)),\n ]\n const nodeNames = [\n ...new Set(transitionFunction.flatMap(({ start, end }) => [start, end])),\n ]\n\n //create a node object for each node )\n this.nodes = nodeNames.map((name) => new node(name))\n\n //add the transition functions for each node\n transitionFunction.forEach(({ start, end, symbol }) => {\n this.nodes\n .find(({ name }) => name === start)\n .addTransition(\n this.nodes.find(({ name }) => name === end),\n symbol\n )\n })\n\n this.startNode = this.nodes.find(({name}) => name === startNode)\n\n this.acceptNodes = this.nodes.filter(({ name }) =>\n acceptStates.includes(name)\n )\n this.simplifyNFA();\n this.name = 'Some NFA' //This feature was implemented LATE in the cycle so just adding backwards compatibility\n\n }", "title": "" }, { "docid": "649a1413fa53bd69dac9764af1ece4a0", "score": "0.51506186", "text": "function createAllOptionsNode() {\n console.log(\"From function create all options node\")\n let mainDiv = document.getElementById(\"options_div\");\n let choice = localStorage.getItem(\"choice\");\n let hEle = document.createElement(\"h3\");\n \n let answerText = \"\";\n let divEle = document.createElement(\"div\");\n divEle.setAttribute(\"id\", info[\"result\"].choice_number);\n \n for (i = 2; i < userChoices.length; i++) {\n answerText = answerText + userChoices[i] + \" \";\n }\n answerText = answerText + \"and \" + choice + \", eh?\";\n let answerTextNode = document.createTextNode(answerText);\n hEle.setAttribute(\"id\", \"choices\");\n hEle.appendChild(answerTextNode);\n divEle.appendChild(hEle)\n mainDiv.appendChild(divEle)\n formShow();\n}", "title": "" }, { "docid": "f6bda783ae3296a214e7314968913810", "score": "0.51325923", "text": "function addChoice(button) {\r\n\tvar parentDiv = button.parentNode;\r\n\tvar choiceDiv = getElem(parentDiv, \"choices\");\r\n\t//update numMC\r\n\tvar numMC = parentDiv.lastChild.value - 0 + 1;\r\n\tparentDiv.lastChild.value = numMC;\r\n\t\r\n\tvar choice = getElem(parentDiv, \"choice_template\");\r\n \r\n\tvar newChoice = choice.cloneNode(true);\r\n newChoice.removeAttribute(\"hidden\");\r\n \r\n //-1 because starts from 0\r\n newChoice.firstChild.innerHTML = \"Choice\" + (numMC - 1) + \": \";\r\n addOptionSuffix(newChoice, numMC);\r\n choiceDiv.appendChild(newChoice);\r\n\t\r\n}", "title": "" }, { "docid": "5285fa61c8284100cb58d04016ab48f5", "score": "0.51283973", "text": "function generate_dropdown(dataset, div_location)\n{\n $(document).ready(function() {\n \n wormSelectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Select worm\"})\n .appendTo(wormSelectMenu);\n \n //Create option for each node\n for(var val in worms)\n {\n $(\"<option />\", {value: val, \n text: worms[val].name})\n .appendTo(wormSelectMenu);\n }\n wormSelectMenu.appendTo(\"#\" + div_location);\n wormSelectMenu.on(\"change\", function(e) {\n worm = this.options[e.target.selectedIndex].text;\n \n //Create release button\n wormbtn = $(\"<button/>\", {text: \"Release Worm\", \n id: \"wormbtn\",\n click: function () { \n spawn = spawnWorm(worm);\n \n //Infect a random node\n gnodes.data()[spawn].infected_with = worm;\n window.setTimeout(function() {\n $(\"#commentary\").fadeOut(function() {\n $(this).text((gnodes.data()[spawn].name) \n .concat(\" infected with \") + worm).fadeIn(2000);\n $(this).text((gnodes.data()[spawn].name) \n .concat(\" infected with \") + worm).fadeOut(2000);\n });\n }, 2000);\n //Initialize the simulation\n start(dataset, worm);\n $(\"#wormbtn\").hide();\n $(\"#\" + div_location).empty();\n }\n }).appendTo(\"#\" + div_location);\n })\n $(\"<br />\").appendTo(\"#\" + div_location);\n //Create dropdowns for networks\n networkSelectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Please Select Network\"})\n .appendTo(networkSelectMenu);\n \n //Create option for each node\n for(var val in dataset.nodes)\n {\n if(dataset.nodes[val].name != \"Central Hub\")\n $(\"<option />\", {value: val, \n text: dataset.nodes[val].name})\n .appendTo(networkSelectMenu);\n }\n networkSelectMenu.appendTo(\"#\" + div_location);\n \n //Generate the next dropdown\n networkSelectMenu.on('change', function(e) {\n // console.log(this.options[e.target.selectedIndex].text);\n \n \n socialEngSelectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Enable Social Engineering training\"})\n .appendTo(socialEngSelectMenu);\n for(var val in bool_params) \n {\n $(\"<option />\", {value: val, \n text: bool_params[val]})\n .appendTo(socialEngSelectMenu);\n }\n\n socialEngSelectMenu.appendTo(\"#\" + div_location);\n // console.log(socialEngSelectMenu.val());\n socialEngSelectMenu.on(\"change\", function(f) {\n //If not the \"Please select\" option which is -1\n if(socialEngSelectMenu.val() >= 0) {\n dataset.nodes[e.target.selectedIndex - 1].social_eng\n = bool_params[f.target.selectedIndex - 1];\n \n //Create honeypot select menu\n honeypotSelectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Enable honeypot\"})\n .appendTo(honeypotSelectMenu);\n for(var val in bool_params) \n {\n $(\"<option />\", {value: val, \n text: bool_params[val]})\n .appendTo(honeypotSelectMenu);\n }\n honeypotSelectMenu.appendTo(\"#\" + div_location);\n honeypotSelectMenu.on(\"change\", function(g) {\n if(honeypotSelectMenu.val() >= 0) {\n dataset.nodes[e.target.selectedIndex - 1].honeypot\n = bool_params[g.target.selectedIndex - 1];\n \n //Create honeypot select menu\n intrusionDetectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Enable intrusion detection\"})\n .appendTo(intrusionDetectMenu); \n\n\n for(var val in bool_params) \n {\n $(\"<option />\", {value: val, \n text: bool_params[val]})\n .appendTo(intrusionDetectMenu);\n } \n intrusionDetectMenu.appendTo(\"#\" + div_location);\n intrusionDetectMenu.on(\"change\", function(h) {\n if(intrusionDetectMenu.val() >= 0) {\n dataset.nodes[e.target.selectedIndex - 1]\n .intrusion_detect\n = bool_params[h.target.selectedIndex - 1];\n\n softwareMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Software up to date?\"})\n .appendTo(softwareMenu); \n for(var val in bool_params) \n {\n $(\"<option />\", {value: val, \n text: bool_params[val]})\n .appendTo(softwareMenu);\n } \n softwareMenu.appendTo(\"#\" + div_location);\n softwareMenu.on(\"change\", function(i) {\n if(softwareMenu.val() >= 0) {\n dataset.nodes[e.target.selectedIndex - 1]\n .software_uptodate\n = bool_params[i.target.selectedIndex - 1]; \n\n intrusionDetectMenu.remove();\n softwareMenu.remove();\n socialEngSelectMenu.remove();\n honeypotSelectMenu.remove();\n //refresh graph\n d3.selectAll(\"svg\").remove();\n generate_graph(dataset); \n } \n });\n }\n })\n } \n });\n //Refresh the graph\n d3.selectAll(\"svg\").remove();\n generate_graph(dataset);\n }\n })\n })\n })\n}", "title": "" }, { "docid": "8581964619d54132b1dc684618c18c2a", "score": "0.5118521", "text": "function Automaton() {\n Node.call(this);\n}", "title": "" }, { "docid": "81c4af53d99616365049a741f186feb7", "score": "0.5091562", "text": "function initScenegraphButtons() {\n p();\n label(\"scenegraph nodes [(anim)->parent]\");\n br();\n label(\"interactive / visible / run : \");\n br();\n var nodeNames = scenegraph.getNodeNames();\n for (var n in nodeNames) {\n var name = nodeNames[n];\n\n // Radiobuttons for interactive node.\n checked = scenegraph.getInteractiveNodename() == name ? true : false;\n callback = ( function(_name) {\n return function() {\n scenegraph.setInteractiveNodeByName(_name);\n scene.setUpToDate();\n }\n }(name));\n createRadioButton(\"node\", \"\", callback, checked, false);\n\n // Checkboxes for visibility.\n var checked = scenegraph.isNodeVisibleByName(name);\n var callback = ( function(_name) {\n return function(val) {\n scenegraph.setNodeVisibleByName(_name, val);\n scene.setUpToDate();\n }\n }(name));\n createCheckBox(\"\", callback, checked, false);\n\n // Checkboxes to run animation.\n var checked = scenegraph.isNodeAnimatedByName(name);\n var hasNoAnim = !checked;\n var callback = ( function(_name) {\n return function(val) {\n scenegraph.setNodeAnimatedByName(_name, val);\n scene.setUpToDate();\n }\n }(name));\n createCheckBox(name, callback, checked, false, undefined, hasNoAnim);\n\n // Show animations for node.\n var animStr = animation.getAnimationsForNodeByName(name);\n if (animStr) {\n text(\" (\" + animStr + \")\");\n }\n // Show the parent\n var parentName = scenegraph.getParentNameOfNodeByName(name);\n if (parentName) {\n text(\" -> \" + parentName);\n }\n br();\n }\n\n }", "title": "" }, { "docid": "9dc1ec046ed509f98eb1dfc152375fc3", "score": "0.50727314", "text": "function TacticNode(proofTree, parent, tactic, response) {\n var self = this;\n Node.call(this, proofTree, parent);\n this.tactic = tactic;\n\n var focusedBefore = getResponseFocused(parent.parent.response);\n var focusedAfter = getResponseFocused(response);\n\n var unfocusedBefore = getResponseUnfocused(parent.parent.response);\n var unfocusedAfter = getResponseUnfocused(response);\n\n var remainingSubgoals;\n if (_.isEqual(unfocusedAfter, unfocusedBefore)) {\n if (focusedBefore.length > 1\n && focusedAfter[0].gId === focusedBefore[1].gId) {\n remainingSubgoals = [];\n } else {\n var focusDelta = focusedAfter.length - focusedBefore.length;\n remainingSubgoals = response.rGoals.focused.slice(0, focusDelta + 1);\n }\n } else {\n remainingSubgoals = [];\n }\n //console.log(tactic, focusDelta, parent.parent.response, response, remainingSubgoals);\n this.goals = _(remainingSubgoals).map(function(goal, index) {\n return new GoalNode(proofTree, self, response, index);\n }).value();\n this.goalIndex = 0;\n\n // TO REMOVE\n this.type = 'tactic';\n this.response = response;\n}", "title": "" }, { "docid": "107c8b2f2ee310a5625dd5e9ebee2bfe", "score": "0.50618786", "text": "function choice() {\n var parsers = [];\n for(var i = 0; i < arguments.length; ++i) {\n if (arguments[i]) parsers.push(toParser(arguments[i]));\n }\n var pid = parser_id++;\n var choiceparser = rule(\"pc.choice(\"+parsers+\")\",function(state) {\n var savedState = state;\n var cached = savedState.getCached(pid);\n if(cached) {\n return cached;\n }\n var i;\n for(i=0; i< parsers.length; ++i) {\n var parser=parsers[i];\n var result = parser(state.from(0)); // run on copy\n if(result) {\n result = make_result(result.remaining,result.matched,result.ast);\n break;\n }\n }\n if(i == parsers.length)\n cached = false;\n else\n cached = result;\n savedState.putCached(pid, cached);\n return cached;\n });\n choiceparser.toString = function () { return \"choice(\"+(depth++>max_depth?\"...\":parsers)+\")\"; };\n return choiceparser;\n}", "title": "" }, { "docid": "b7e847e88c978c273aca2f0d14d79767", "score": "0.5055276", "text": "buildCustomSelectionSettingsWindow() {\n var selectionMessage = \"Choose a node label to select.\";\n let nodeSelectedQuery = \"CALL db.schema.nodeTypeProperties() YIELD nodeLabels\" +\n \" UNWIND nodeLabels as nodeLabel WITH DISTINCT nodeLabel as label\" +\n \" WHERE toLower(label) contains toLower($input)\" +\n \" RETURN label\";\n\n let nodeSelectionBox = <NeoAutoCompleteText\n query={nodeSelectedQuery}\n label={\"Node\"}\n property={\"Label\"}\n onAutoComplete={(label, property, propertyId, value) => this.props.onChange({\n label: \"NodeSelectionUpdated\",\n value: value\n })}\n session={this.props.session}\n style={{width: '300px'}}\n customStyle={{'width': '300px'}}\n defaultValue={(this.props.properties[0]) ? this.props.properties[0] : \"\"}\n />;\n\n var propertySelectionBox = <div/>\n var propertyIdSelectionBox = <div/>\n if (this.props.properties && this.props.properties[0]) {\n selectionMessage = \"Choose a node property to select.\";\n let propertySelectedQuery = \"CALL db.schema.nodeTypeProperties() YIELD nodeLabels, propertyName\\n\" +\n \" UNWIND nodeLabels as nodeLabel\\n\" +\n \" WITH DISTINCT nodeLabel, propertyName\\n\" +\n \" WHERE nodeLabel = \\\"\" + this.props.properties[0] + \"\\\"\\n\" +\n \" RETURN propertyName\\n\"\n\n propertySelectionBox = <NeoAutoCompleteText\n query={propertySelectedQuery}\n label={\"Node\"}\n property={\"Property\"}\n onAutoComplete={(label, property, propertyId, value) => this.props.onChange({\n label: \"PropertySelectionUpdated\",\n value: value\n })}\n session={this.props.session}\n style={{width: '200px'}}\n customStyle={{'width': '200px'}}\n defaultValue={(this.props.properties[1]) ? this.props.properties[1] : \"\"}\n\n\n />;\n propertyIdSelectionBox =\n <NeoTextInput numeric defaultValue={this.props.properties[2] ? this.props.properties[2] : \"\"}\n onChange={this.stateChanged}\n changeEventLabel={\"PropertySelectionIdUpdated\"}\n style={{width: '80px'}} label={\"ID\"}\n placeholder={\"(optional)\"}/>;\n }\n\n if (this.props.properties && this.props.properties[0] && this.props.properties[1]) {\n let label = this.props.properties[0];\n let property = this.props.properties[1];\n let id = this.props.properties[2] ? \"_\" + this.props.properties[2] : \"\";\n let selection = \"$neodash_\" + this.toLowerCaseSnakeCase(label) + \"_\" + this.toLowerCaseSnakeCase(property) + id;\n selectionMessage = <>Insert parameter <b>{selection}</b> in any of the Cypher queries to use the selected\n value.</>;\n }\n\n this.settingsSelectionArea = <div style={{width: \"100%\"}}>\n <hr style={{\"display\": \"inline-block\", \"width\": \"100%\", \"opacity\": \"0\"}}></hr>\n {nodeSelectionBox}\n {propertySelectionBox}\n {propertyIdSelectionBox}\n <p style={{\"display\": \"block\", width: '350px'}}>{selectionMessage}</p>\n </div>\n }", "title": "" }, { "docid": "6a256c2675d9b32587771bafb22147a2", "score": "0.5053567", "text": "function createButtons(buttonChoice) {\n\n const divButton = document.createElement(\"div\");\n divButton.className = \"section__box\";\n\n\n const button = document.createElement(\"button\");\n button.classList.add(\"r-button\", \"ai-element\", \"ai-element_type3\", \"ai-element7\");\n button.addEventListener(\"click\", function () {\n changeChapter(buttonChoice.nextChapter);\n }, false);\n\n const buttonSpan = document.createElement(\"span\");\n buttonSpan.className = \"ai-element__label\";\n buttonSpan.innerHTML = buttonChoice.text;\n\n button.appendChild(buttonSpan);\n divButton.appendChild(button);\n\n document.querySelector(\"#buttons\").appendChild(divButton);\n\n}", "title": "" }, { "docid": "770f6fd9102ea7d98265ca049b9ed55d", "score": "0.502385", "text": "make(options = {}) {\n const o = options\n // parent: recursion!!!\n if (o.parent != null) {\n for (let p of o.parent) {\n if (typeof p === \"string\") {\n this.make(things[p])\n } else {\n this.make(p)\n }\n }\n }\n // matter.js stuff\n if (o.label != null) {\n this.label = o.label\n }\n if (o.type != null) {\n this.type = o.type\n }\n if (o.static != null) {\n this.static = o.static\n }\n if (o.isBullet != null) {\n this.isBullet = o.isBullet\n }\n if (o.category != null) {\n this.collisionFilter = o.category\n }\n // type stuff\n if (o.gametype != null) {\n this.gametype = o.gametype\n }\n // shape and display stuffs\n if (o.shape != null) {\n this.shape = o.shape\n }\n if (o.shapeAngle != null) {\n this.shapeAngle = math.degToRad(o.shapeAngle)\n }\n if (o.accessories != null) {\n this.accessories = o.accessories.slice()\n }\n if (o.render != null) {\n this.style.render = o.render\n }\n if (o.rendered != null) {\n this.style.rendered = o.rendered\n }\n // game stuff (A LOT!)\n if (o.guns != null) {\n this.createGuns(o.guns)\n }\n if (o.controlType != null) {\n this.controlType = o.controlType\n this.controller.type = this.controlType\n }\n if (o.stat != null) {\n this.stat.make(o.stat)\n }\n if (o.xp != null) {\n this.xp = o.xp\n this.stat.refreshPoints()\n }\n if (o.bonusxp != null) {\n this.bonusxp = o.bonusxp\n }\n // this.options (some)\n if (o.drawable != null) {\n this.options.drawable = o.drawable\n }\n if (o.tickable != null) {\n this.options.tickable = o.tickable\n }\n if (o.active != null) {\n this.options.active = o.active\n }\n if (o.draggable != null) {\n this.options.draggable = o.draggable\n }\n if (o.drawLayer != null) {\n this.options.drawLayer = o.drawLayer\n }\n if (o.enemyDamage != null) {\n this.enemyOptions.damage = o.enemyDamage\n }\n }", "title": "" }, { "docid": "1bba45d489d2d415b22ee78b841c0055", "score": "0.5013051", "text": "makeNode() {\n\t\t//if children already exist, recurse\n\t\tif (this.leftNode != undefined) {\n\t\t\tthis.leftNode.makeNode();\n\t\t\tif (this.rightNode != undefined) {\n\t\t\t\tthis.rightNode.makeNode();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tvar newDifficulty = this.difficulty + infinite_difficultyBoost;\n\t\tif (newDifficulty + infinite_levelRange > infinite_data.length) {\n\t\t\tnewDifficulty = infinite_data.length - infinite_levelRange;\n\t\t}\n\n\t\t//chance of a branch\n\t\tif (this.cooldown == 0 && Math.random() < infinite_branchChance) {\n\t\t\t//one branch and one continue\n\t\t\tif (Math.random() < 0.5) {\n\t\t\t\tthis.leftNode = new IMNode(this, newDifficulty, Math.floor(Math.random() * 1.99));\n\t\t\t\tthis.leftNode.cooldown = infinite_branchCooldown;\n\n\t\t\t\tthis.rightNode = new IMNode(this, newDifficulty);\n\t\t\t\tthis.rightNode.cooldown = infinite_branchCooldown;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//two branches\n\t\t\tvar val = (Math.random() > 0.5);\n\t\t\tthis.leftNode = new IMNode(this, newDifficulty, val * 1);\n\t\t\tthis.leftNode.cooldown = infinite_branchCooldown;\n\n\t\t\tthis.rightNode = new IMNode(this, newDifficulty, !val * 1);\n\t\t\tthis.rightNode.cooldown = infinite_branchCooldown;\n\t\t\treturn;\n\t\t}\n\n\t\t//single tunnel case\n\t\tthis.leftNode = new IMNode(this, newDifficulty);\n\t\tthis.leftNode.cooldown = Math.max(0, this.cooldown - 1);\n\t}", "title": "" }, { "docid": "a19b3ed7b9e593b62268872cdb8d7388", "score": "0.49900052", "text": "function buildButtons() {\n radioDiv = createDiv();\n notesRadio = createRadio();\n notesRadio.option(\"C\");\n notesRadio.option(\"D\");\n notesRadio.option(\"E\");\n notesRadio.option(\"F\");\n notesRadio.option(\"G\");\n notesRadio.selected(\"C\");\n notesRadio.parent(radioDiv);\n buttonDiv = createDiv();\n trainButton = createButton(\"Train Model\");\n trainButton.mousePressed(trainModel);\n trainButton.parent(buttonDiv);\n}", "title": "" }, { "docid": "0f35c74fb7412540713a06f8d29b7138", "score": "0.49892887", "text": "function Tree(node, treemodel, options){\r\n\t\t\t\toptions = $.extend({isStatic:false, onSelect : function(item){}}, options);\t\t\t\t\r\n\t\t\t\tvar rack = $('<ul/>').addClass(\"owl_treeview\").appendTo(node);\r\n\t\t\t\t/**item can be text, a jOWL object, or a jOWL array */\r\n\t\t\t\tthis.root = function(item){\r\n\t\t\t\t\tvar rt = null; //root\r\n\t\t\t\t\track.empty(); \r\n\t\t\t\t\tif(item && item.each) {\r\n\t\t\t\t\t\trt = [];\r\n\t\t\t\t\t\titem.each(function(it){\r\n\t\t\t\t\t\t\tvar x = new fn.node(it, true); \r\n\t\t\t\t\t\t\tx.wrapper.addClass(\"tv\");\r\n\t\t\t\t\t\t\tx.jnode.appendTo(rack);\r\n\t\t\t\t\t\t\tx.invParents = it.invParents; it.invParents = null;\t//reset for later use\r\n\t\t\t\t\t\t\trt.push(x);\r\n\t\t\t\t\t\t}) \r\n\t\t\t\t\t\treturn rt;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\trt = new fn.node(text, true);\t\t\t\t\t\t\r\n\t\t\t\t\trt.wrapper.addClass(\"tv\"); \r\n\t\t\t\t\trt.jnode.appendTo(rack);\r\n\t\t\t\t\treturn rt;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar fn = {};\r\n\t\t\t\tfn.node = function(text, isRoot){ //creates a new node\r\n\t\t\t\t\tthis.jnode = isRoot ? $('<li class=\"root\"/>') : $('<li class=\"tvi\"/>');\r\n\t\t\t\t\tthis.name = null;\r\n\t\t\t\t\tif(text){\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.name = $('<span class=\"name\"/>');\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(typeof text == \"string\") this.name.html(text);\r\n\t\t\t\t\t\telse if(text.bind) { text.bind(this.name); $.data(this.name, \"jOWL\", text); }\r\n\t\t\t\t\t\tvar n = this.name; \r\n\t\t\t\t\t\tthis.name.appendTo(this.jnode).click(function(){onSelect(n); options.onSelect(n); return false;});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.wrapper = $('<ul/>').appendTo(this.jnode);\r\n\t\t\t\t\tvar self = this;\r\n\t\t\t\t\t\tself.jnode.click(function(){toggle(); return false;});\r\n\r\n\t\t\t\t\tthis.add = function(text){\r\n\t\t\t\t\t\tvar nn = new fn.node(text);\r\n\t\t\t\t\t\tif(self.wrapper.children().length == 0) { toNode();\t}//no children\r\n\t\t\t\t\t\telse { var lastchild = self.wrapper.children(':last'); \r\n\t\t\t\t\t\t\tlastchild.swapClass(\"tvilc\", \"tvic\"); \r\n\t\t\t\t\t\t\tlastchild.swapClass(\"tvile\", \"tvie\"); \r\n\t\t\t\t\t\t\tlastchild.swapClass(\"tvil\", \"tvi\"); \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}//children - change end of list\r\n\t\t\t\t\t\tself.wrapper.append(nn.jnode.swapClass('tvi', 'tvil'));\r\n\t\t\t\t\t\treturn nn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction toggle(){ \r\n\t\t\t\t\t\tvar t = self.jnode.hasClass(\"tvic\") || self.jnode.hasClass(\"tvie\") || self.jnode.hasClass(\"tvilc\") || self.jnode.hasClass(\"tvile\");\r\n\t\t\t\t\t\tif(!t) return;\r\n\t\t\t\t\t\tself.jnode.swapClass('tvic', 'tvie'); self.jnode.swapClass('tvilc', 'tvile');\r\n\t\t\t\t\t\tself.wrapper.slideToggle();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tfunction toNode(){ self.jnode.swapClass('tvil', 'tvilc');self.jnode.swapClass('tvi', 'tvic');}\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\treturn this;\r\n\t\t\t}// end Tree", "title": "" }, { "docid": "e881fa0a14fa9edddd8dbaeeff45b8c2", "score": "0.4978696", "text": "function NodeDef(){}", "title": "" }, { "docid": "e881fa0a14fa9edddd8dbaeeff45b8c2", "score": "0.4978696", "text": "function NodeDef(){}", "title": "" }, { "docid": "e881fa0a14fa9edddd8dbaeeff45b8c2", "score": "0.4978696", "text": "function NodeDef(){}", "title": "" }, { "docid": "e881fa0a14fa9edddd8dbaeeff45b8c2", "score": "0.4978696", "text": "function NodeDef(){}", "title": "" }, { "docid": "a50936dd111ef2361f510e312f2ec628", "score": "0.49735102", "text": "function node(opt)\r\n {\r\n if (!opt) return;\r\n// console.log(\"node(\"+c+\")\");\r\n function attr(name)\r\n {\r\n var value = opt[name];\r\n delete opt[name];\r\n return value;\r\n }\r\n var expandos = { id: 1, className: 1, title: 1, type: 1, checked: 1 };\r\n var id = opt.id;\r\n var n = $(id);\r\n if(!n)\r\n {\r\n var tag = attr(\"tag\") || \"div\";\r\n if (\"string\" == typeof tag) n = document.createElement(tag);\r\n else\r\n {\r\n var t=document.createElement(\"div\");\r\n t.innerHTML = tag.toXMLString();\r\n var ids = {};\r\n for each( var n in $x('.//*[@id]', t) ) ids[n.id]=1;\r\n if (!n) ids = null;\r\n var r = document.createRange();\r\n r.selectNodeContents(t);\r\n n = r.extractContents();\r\n if (n.childNodes.length == 1) n = n.firstChild;\r\n }\r\n var after = attr(\"after\");\r\n var before = opt.prepend ? opt.prepend.firstChild : attr(\"before\");\r\n var parent = attr(\"prepend\") || attr(\"append\") || (before || after || {}).parentNode;\r\n if (parent) {\r\n if (before)\r\n parent.insertBefore(n, before);\r\n else if (after)\r\n parent.insertBefore(n, after.nextSibling);\r\n else\r\n parent.appendChild(n);\r\n }\r\n if (id) n.id = id;\r\n }\r\n var html = attr(\"html\");\r\n if (\"undefined\" != typeof html) n.innerHTML = html;\r\n var text = attr(\"text\");\r\n if (\"undefined\" != typeof text) n.textContent = text;\r\n var style = attr(\"style\");\r\n if (style)\r\n for (var prop in style) n.style[prop] = style[prop];\r\n for (prop in opt)\r\n if (expandos[prop]) n[prop] = opt[prop];\r\n else n.setAttribute(prop, opt[prop]+\"\");\r\n if (ids)\r\n for (var id in ids)\r\n ids[id] = $(id);\r\n return ids || n;\r\n}", "title": "" }, { "docid": "3bc008ceadcf6b8b99b9c6384bff3307", "score": "0.4971483", "text": "function showStoryNode(textNodeIndex) {\r\n const textNode = textNodes.find(textNode => textNode.id === textNodeIndex)\r\n story.innerText = textNode.text\r\n while (choiceElement.firstChild) {\r\n choiceElement.removeChild(choiceElement.firstChild) \r\n}\r\n\r\n//Function to present the options for the player\r\ntextNode.options.forEach(option => {\r\n if (showOption(option)) {\r\n const button = document.createElement('button')\r\n button.innerText = option.text\r\n button.classList.add('btn')\r\n button.addEventListener('click', () => selectOption(option))\r\n choice.appendChild(button)\r\n }\r\n})\r\n}", "title": "" }, { "docid": "550b556ee03f6952a187950c2ee54c19", "score": "0.49669543", "text": "function SwitchCases(el) {\n\tif (!el.hasChildNodes) return;\n\n\tif ( typeof SwitchCases.cx == 'undefined' ) SwitchCases.cx=0;\n\t++SwitchCases.cx;\n\tthis.objName='switch'+SwitchCases.cx; eval(this.objName+'=this;');\n\tthis.elMenu=document.createElement('ul');\n\tthis.labels=new Array();\t// not used so far\n\tthis.nlabels=0;\n\tthis.views=new Array();\n\tthis.buttons=new Array();\n\tfor (var i=0; i<el.childNodes.length; ++i) {\n\t\tif (el.childNodes[i].title) {\n\t\t\tthis.views[this.nlabels]=el.childNodes[i];\n\t\t\tthis.labels[this.nlabels]=el.childNodes[i].title;\n\t\t\tvar opt=document.createElement('li');\n\t\t\topt.innerHTML='<a href=\"javascript:'+this.objName+'.select('+(this.nlabels+1)+')\">'+el.childNodes[i].title+'</a>';\n\t\t\tthis.buttons[this.nlabels]=opt;\n\t\t\tthis.elMenu.appendChild(opt);\n\t\t\t++this.nlabels;\n\t\t}\n\t}\n\tvar nil=document.createElement('li');\n\tnil.className='hide';\n\tvar txt='<a href=\"/site/versions/\"><b class=\"C_ico question\" title=\"Help about versions\"></b></a>';\n\tnil.innerHTML=txt;\n\tthis.elMenu.appendChild(nil);\n\tel.insertBefore(this.elMenu, el.firstChild);\n\tthis.el=el;\t// needed?\n\tvar autoselect = new String(); autoselect+=cookieGet(CFG.cklbl); autoselect=autoselect.split('|');\n\tfor (var j=0; j<autoselect.length; ++j) {\n\t\tfor (var i=0; i<this.nlabels; ++i) {\n\t\t\tif (this.labels[i]==autoselect[j]) { this.select(i+1,true); return; }\n\t\t}\n\t}\n\tthis.select(1,true);\t// default\n}", "title": "" }, { "docid": "c8258bd50759d59c377c7d7b8f5e10b0", "score": "0.49602807", "text": "function createNodeEvent(opts) {\n\n\tvar eventFunction = {};\n\n\tif(opts.nodes.toggle) {\n\t\teventFunction = function(node) {\n \tif(!node.is_leaf() || (node.n_hidden() > 0)) {\n \tnode.toggle();\n \ttree.update();\n \t} else {\n \t\tif(opts.nodes.select) {\n \t\t\ttoggleClick(node);\n \t\t}\n \t\ttree.update();\n \t\t}\n \t}\n\t} else {\n\t\tif(opts.nodes.select) {\n\t\t\teventFunction = function(node) {\n\t\t\t\ttoggleClick(node);\n\t\t\t\ttree.update();\n\t\t\t}\n\t\t}\n\t}\n\n\tif(opts.nodes.select) {\n\t\tfunction toggleClick(node) {\n \tif(node.property('selected')) {\n \t\tnode.property('selected',false);\n \t} else {\n \t\tnode.property('selected',true);\n \t}\n } \n\t} \n\n\treturn eventFunction;\n\n}", "title": "" }, { "docid": "52b0b4245d26f4840e1b75b9f4435ddb", "score": "0.4948877", "text": "function makeNodes() {\n\n // Check if have a buffer created.\n if(!source) {\n source = context.createBufferSource();\n analyser = context.createAnalyser();\n analyser2 = context.createAnalyser();\n processor = context.createScriptProcessor();\n splitter = context.createChannelSplitter();\n gain = context.createGain();\n }\n\n}", "title": "" }, { "docid": "f80509ea40f365f7a9ae2f3a955588fe", "score": "0.49488118", "text": "function train(node) {\n if (ask('No?! I\\'m very curious! Can you tell me what you are?')) {\n // The wrong guess\n var guess = node.message;\n // What is it?\n var answer = readlineSync.question(\"Ok, what are you? \");\n // Get a new question?\n var question = readlineSync.question(\"Suggest a yes/no question to distinguish a \" + guess + \" from a \" + answer + \".\\n\");\n \n node.message = question;\n // Yes or no for that question\n if (ask(\"Answer for a \" + answer + \": \" + question)) {\n node.yes = tree.node(answer);\n node.no = tree.node(guess);\n console.log(util.randomPicker(thanks));\n console.log (\"Great! Now I know about \" + answer + \"s !\");\n console.log(util.randomPicker(playAgain));\n } else {\n node.yes = tree.node(guess);\n node.no = tree.node(answer);\n //adding it here did not gen a thanks\n //console.log(util.randomPicker(thanks));\n }\n\n // Save back to the file\n tree.writeFile('tree.json', root, function (err) {\n if (err) console.warn(err);\n play();\n });\n }\n else {\n play();\n } \n }", "title": "" }, { "docid": "ef70bc421cad24624ad83a06a1c95c8e", "score": "0.49440786", "text": "function Node(name, x=0, y=0) {\n\tconsole.log( 'Node is created');\n\tthis.name = name;\n\tthis.type= 'question';\n\tthis.x=x;\n\tthis.y=y;\n\tthis.parent = null;\n\tthis.children = [];\n\n}", "title": "" }, { "docid": "0e4e6d07db99e6a4126984ea9f145339", "score": "0.49332213", "text": "function populateQuestion(item) {\n const answer = item;\n let choices = answer.choices;\n\n choices.forEach(item => {\n const label = document.createElement('label');\n const span = document.createElement('span');\n const answerOption = document.createElement('input');\n span.textContent = item;\n label.className = 'cool-label';\n answerOption.value = item;\n answerOption.type = 'radio';\n answerOption.name = 'answers';\n choiceText.appendChild(label);\n label.appendChild(answerOption);\n label.appendChild(span);\n });\n}", "title": "" }, { "docid": "289486294f64748e6d65c7025c4b7080", "score": "0.49322632", "text": "constructor(a, b, c, d, e) {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.e = e;\n this.subtype = \"ParenthesisEquation\";\n this.choiceArray = this.calculateChoices();\n }", "title": "" }, { "docid": "29598d2df1d8037b387d0f5cd3c5b77f", "score": "0.49321187", "text": "function Choice(rules, optional) {\n\tthis.rules = rules;\n\tif (optional == OPTIONAL) this._optional = true;\n}", "title": "" }, { "docid": "5073477ccdf12729a7ecf731e0579acc", "score": "0.49285966", "text": "function rbtnChoice(type, lblValue, name, arr, parent, number) {\n\t// alert(number);\n\tconst br0 = document.createElement('br');\n\tparent.appendChild(br0);\n\tconst lbl = document.createElement('label');\n\tconst lblText = document.createTextNode(lblValue);\n\tlbl.appendChild(lblText);\n\tparent.appendChild(lbl);\n\tconst br = document.createElement('br');\n\tparent.appendChild(br);\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tconst lbl = document.createElement('label');\n\t\tconst lblText = document.createTextNode(arr[i]);\n\t\tlbl.appendChild(lblText);\n\t\tparent.appendChild(lbl);\n\t\tconst rdbtn = createElement('input', arr[i], name, number);\n\t\trdbtn.setAttribute('value', arr[i]);\n\t\trdbtn.setAttribute('type', type);\n\t\tparent.appendChild(rdbtn);\n\t}\t\n}", "title": "" }, { "docid": "7fab7691398f06d411fc9c7c9c538caf", "score": "0.4927728", "text": "addNode() {\n function randomArg(... args) {\n return args[Math.floor(Math.random() * args.length)];\n }\n const node = this.cy.add({\n renderedPosition: { x: 60 + Math.round(Math.random() * 70), y: 60 + Math.round(Math.random() * 70) },\n data: {\n attr1: Math.random(), // betwen 0 and 1\n attr2: Math.random() * 2.0 - 1.0, // between -1 and 1\n attr3: randomArg(\"A\", \"B\", \"C\")\n }\n });\n\n this.bus.emit('addNode', node);\n }", "title": "" }, { "docid": "0fb9a00d911541d2d8f07fec01664e34", "score": "0.49067324", "text": "function generate_custom()\n{\n var type, graph_data, num_nodes;\n \n $(document).ready(function() {\n $(\"#divLevelCustom\").empty();\n nodeTextBox = $(document.createElement('div'))\n\t .attr(\"id\", 'nodeTextBoxDiv');\n \n nodeTextBox.after().html('<label>Number of nodes' + ' : </label>' +\n\t '<input type=\"text\" name=\"textbox' + \n\t '\" id=\"textbox' + '\" value=\"\" >');\n nodeTextBox.appendTo(\"#divLevelCustom\");\n });\n \n topologySelectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Select network topology\"})\n .appendTo(topologySelectMenu);\n \n //Create option for each node\n for(var val in topologies)\n {\n $(\"<option />\", {value: val, \n text: topologies[val]})\n .appendTo(topologySelectMenu);\n }\n topologySelectMenu.appendTo(\"#divLevelCustom\");\n topologySelectMenu.on(\"change\", function(e) {\n type = this.options[e.target.selectedIndex].text; \n numNodes = parseInt($(\"#textbox\").val());\n graph_data = generate_graph_data(numNodes, type);\n attackSelectMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Select worm/attack method\"})\n .appendTo(attackSelectMenu);\n \n //Create option for each node\n for(var val in attacks)\n {\n if(type != \"Star\" && attacks[val] == \"DDoS.Smurf\")\n continue;\n else if(type == \"Star\" && (attacks[val] == \"Botnet.Storm\" || attacks[val] == \"Worm\"))\n continue;\n else \n $(\"<option />\", {value: val, \n text: attacks[val]})\n .appendTo(attackSelectMenu); \n }\n attackSelectMenu.appendTo(\"#divLevelCustom\");\n attackSelectMenu.on(\"change\", function(f) {\n if(this.options[f.target.selectedIndex].text == \"DDoS.Smurf\") {\n smurf = true;\n console.log(\"Smurf Graph data\", graph_data);\n $(\"#commentary\").fadeOut(function() {\n $(this).text(\"Smurf DDoS attack running on \" + type \n + \" network with \" + numNodes \n + \" nodes\").fadeIn(2000);\n $(this).text(\"Smurf DDoS attack running on \" + type \n + \" network with \" + numNodes \n + \" nodes\").fadeOut(2000);\n });\n generate_graph(graph_data);\n start_smurf_simulation(graph_data);\n }\n else if(this.options[f.target.selectedIndex].text \n == \"Botnet.Storm\") {\n botnetMinMenu = $(\"<select />\");\n $(\"<option />\", {value: -1, \n text: \"Select minimum nodes required\" \n + \" for node incapacitation\"})\n .appendTo(botnetMinMenu);\n for(var i = 1; i < numNodes; i++)\n {\n $(\"<option />\", {value: i, \n text: i})\n .appendTo(botnetMinMenu);\n }\n botnetMinMenu.appendTo(\"#divLevelCustom\");\n botnetMinMenu.on(\"change\", function(g) {\n botnetMin = parseInt(this.options[g.target.selectedIndex].text)\n $(\"#commentary\").fadeOut(function() {\n $(this).text(\"Storm botnet running on \" + type \n + \" network with \" + numNodes \n + \" nodes\" + \" incapacitation minimum \" \n + botnetMin.toString()).fadeIn(2000);\n $(this).text(\"Storm botnet running on \" + type \n + \" network with \" + \" incapacitation minimum \" \n + botnetMin.toString()).fadeOut(2000);\n });\n generate_graph(graph_data);\n start_storm_simulation(graph_data); });\n }\n else {\n $(\"#commentary\").fadeOut(function() {\n $(this).text(type + \" Network generated with \" \n + numNodes + \" nodes\").fadeIn(2000);\n $(this).text(type + \" Network generated with \" \n + numNodes + \" nodes\").fadeOut(2000);\n });\n generate_dropdown(graph_data, \"divLevelCustom\")\n generate_graph(graph_data);\n } \n });\n });\n}", "title": "" }, { "docid": "c71bd17d7e0cbcbe8f9aa3abde4f41f5", "score": "0.4902394", "text": "handleNodeChange(event, index, attr, type, pageIndex) {\n\t\tif (!type) type = 'none';\n\t\tlet settings = this.state.settings;\n\t\tlet page = settings.pages[pageIndex];\n\t\tlet nodes = page.nodes;\n\t\tlet node = nodes[index];\n\t\tswitch (attr) {\n\t\t\tcase 'text': {\n\t\t\t\tnode.data.text = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// combine these\n\t\t\tcase 'src': {\n\t\t\t\tswitch (node.type) {\n\t\t\t\t\tcase 'plugin': {\n\t\t\t\t\t\tnode.data.iconUrl = event;\n\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'image': {\n\t\t\t\t\t\tnode.data.src = event;\n\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'hero': {\n\t\t\t\t\t\tnode.data.src = event;\n\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'action': {\n\t\t\t\t\t\tnode.data.iconUrl = event;\n\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'img': {\n\t\t\t\t\n\t\t\t\tif (typeof event === 'number') {\n\t\t\t\t\tnode.data.height = event;\n\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target.checked) {\n\t\t\t\t\tswitch (event.target.name) {\n\t\t\t\t\t\tcase 'hero':\n\t\t\t\t\t\t\tnode.format = 'hero';\n\t\t\t\t\t\t\tnode.data.header = node.data.header || 'header';\n\t\t\t\t\t\t\tnode.data.subtext = node.data.subtext || 'subtext';\n\t\t\t\t\t\t\tnodes[index] = node;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'custom': {\n\t\t\t\t\t\t\tnode.format = 'custom';\n\t\t\t\t\t\t\tnode.data.height = node.data.height || 0.54;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t} else {\n\t\t\t\t\tnode.format = 'image';\n\t\t\t\t\tnodes[index] = node;\n\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'delete': {\n\t\t\t\t// let confirm = window.confirm(\"Are you sure? Item will be lost!\");\n\n\t\t\t\tbuildfire.notifications.confirm(\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: 'Remove Node',\n\t\t\t\t\t\tmessage: 'Are you sure? Node will be lost!',\n\t\t\t\t\t\tbuttonLabels: ['delete', 'cancel']\n\t\t\t\t\t},\n\t\t\t\t\t(err, result) => {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tif (typeof err == 'boolean') {\n\t\t\t\t\t\t\t\tnodes.splice(index, 1);\n\t\t\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\t\t\t// setTimeout(() => {\n\t\t\t\t\t\t\t\t// document.querySelector(`#page${pageIndex}node${index}`).click();\n\t\t\t\t\t\t\t\t// }, 100);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!result) return;\n\t\t\t\t\t\t\tif (result.selectedButton.key === 'confirm') {\n\t\t\t\t\t\t\t\tnodes.splice(index, 1);\n\t\t\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\t\t\t// setTimeout(() => {\n\t\t\t\t\t\t\t\t// \tdocument.querySelector(`#page${pageIndex}node${index}`).click();\n\t\t\t\t\t\t\t\t// }, 1000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'plugin': {\n\t\t\t\tnode.data.title = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'action': {\n\t\t\t\tnode.data.title = `Action Item: ${event.target.value}`;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'icon': {\n\t\t\t\tnode.data.iconUrl = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'hero-header': {\n\t\t\t\tnode.data.header = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'hero-subtext': {\n\t\t\t\tnode.data.subtext = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'hero-button': {\n\t\t\t\tnode.data.showButton = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'layout': {\n\t\t\t\tnode.data.layout = event.target.value;\n\t\t\t\tnodes[index] = node;\n\t\t\t\tthis.setState({ settings });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'header': {\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'border':\n\t\t\t\t\t\tnode.data.border = event.target.checked;\n\t\t\t\t\t\tnodes[index] = node;\n\t\t\t\t\t\tthis.setState({ settings });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// case 'fontSize': {\n\t\t\t\t\t// \tnode.data.fontSize = event.target.value;\n\t\t\t\t\t// nodes[index] = node;\n\t\t\t\t\t// this.setState({\n\t\t\t\t\t// \tnodes\n\t\t\t\t\t// });\n\t\t\t\t\t// this.update();\n\t\t\t\t\t// \tbreak;\n\t\t\t\t\t// }\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\t}", "title": "" }, { "docid": "5b01b0b0119d0e89c72bf1bcb68b4b94", "score": "0.48934332", "text": "function MooreNodePrompt(func, cancelFunc, nostr) {\n var nodeFunction = func;\n var cancelFunction = cancelFunc;\n var emptystr = nostr;\n // Prompt box needs a reference to the function to run upon clicking \"OK\".\n // Prompt box also needs a reference to a function to run upon clicking \"Cancel\". Reason why: In the Moore Machine Editor, upon creating a new node, this prompt is immediately called to configure the node. If the user clicks \"Cancel\", a function must be run to remove this newly created node from the graph.\n // Prompt box also needs a reference to which empty string representation is being used (lambda or epsilon).\n\n // Render function is used to initialize the prompt box in the view.\n this.render = function(value, is, lab, outputChar) {\n renderBox();\n // Add content to the prompt box, with references to the functions to run within the buttons.\n document.getElementById('dialogueboxbody').innerHTML = 'Initial State:<input type=\"checkbox\" id=\"initial_state\">';\n document.getElementById('dialogueboxbody').innerHTML += '<br>Output Character: <input id=\"moore\">';\n document.getElementById('dialogueboxbody').innerHTML += '<br>State Label: <input id=\"label\">';\n document.getElementById('dialogueboxfoot').innerHTML = '<button onclick=\"ok()\">OK</button> <button onclick=\"cancel()\">Cancel</button>';\n // If there is no output character, it means this prompt is configuring a newly created node.\n if(!outputChar){\n // Update the prompt box to reflect this information.\n document.getElementById('dialogueboxhead').innerHTML = \"Create Node <b>\" + value + \":</b>\";\n }\n // Otherwise, the prompt is editing a previously existing node.\n else {\n document.getElementById('dialogueboxhead').innerHTML = \"Edit Node <b>\" + value + \":</b>\";\n // If the node being edited is currently the initial state, check the \"Initial State\" checkbox.\n if (is) {\n document.getElementById('initial_state').checked = true;\n }\n // Note that since this is a Moore Machine, there is no such thing as a final state.\n // If the node being edited has a state label, display this text in the \"State Label\" text field.\n if (lab) {\n document.getElementById('label').value = lab;\n }\n // If the output character of the state is not the empty string, display this text in the \"Output Character\" text field.\n // If it is the empty string, don't display anything in the \"Output Character\" text field.\n if (outputChar != emptystr) {\n document.getElementById('moore').value = outputChar;\n }\n }\n // Place the cursor in the output character text field by default.\n document.getElementById('moore').focus();\n }\n\n // Cancel changes, then exit out of the prompt box. Called upon clicking \"Cancel\".\n // If creating a new node, this cancel function removes the node from the graph.\n cancel = function() {\n cancelFunction();\n terminate();\n }\n\n // Update node on the graph. Called upon clicking \"OK\".\n ok = function() {\n // Check every field in the prompt box and update the node accordingly.\n var initial_state = document.getElementById('initial_state').checked;\n var node_label = document.getElementById('label').value;\n var output_char = document.getElementById('moore').value;\n // If the output character text field is empty, assign the empty string to the output character.\n if (output_char === \"\") {\n output_char = emptystr;\n }\n // Call the node function on these values, then exit out of the prompt box.\n nodeFunction(initial_state, node_label, output_char);\n terminate();\n }\n}", "title": "" }, { "docid": "ef0184f8e4b72b7da48cc02b3216add5", "score": "0.4891584", "text": "function ctor () {\n // a stack of node's activating tasks\n this._activatingStack = [];\n}", "title": "" }, { "docid": "049b0662ffae1d6e28a4b17bff118e0b", "score": "0.4890158", "text": "function getQuestion(){\n var currentQuestion = questions[currentQuestionIndex];\n console.log(currentQuestion)\n document.getElementById(\"question-title\").textContent = currentQuestion.prompt;\n choicesEl.innerHTML= \"\";\n currentQuestion.choices.forEach(function(choice){\n var choiceNode = document.createElement('button');\n choiceNode.setAttribute(\"class\",\"choice\");\n choiceNode.setAttribute(\"value\", choice);\n choiceNode.onclick = questionsClick;\n choiceNode.textContent = choice;\n choicesEl.appendChild(choiceNode);\n })\n}", "title": "" }, { "docid": "a092fd2c13b608c80dfd4d55168d2515", "score": "0.48830685", "text": "function g(c,f,e,a){var b,d=arguments.length-4;if(1<d&&-1<Array.prototype.slice.call(arguments).indexOf(a,4))for(b=0;b<d;b++)this[\"choice\"+(b+1)]=arguments[b+4];else for(d++,b=0;b<d;b++)this[\"choice\"+(b+1)]=arguments[b+3];this.defaultValue=a;this.label=c;this.name=f;null===e||e||(this.required=!!e);this.type=\"choice\"}", "title": "" }, { "docid": "46b3b138baa03807e8699e256bc85fd3", "score": "0.48768765", "text": "function createLevels(choice)\n{\n\t// list of options for user to choose\n\tvar info = data[choice];\n\t\n\t// Prints results when the array list is done and becomes undefined\n\tif( info == undefined)\n\t{\n\t\tgetResults();\n\t}\n\telse\n\t{\n\t\n\t\t// Creates the Div container to hold next level\n\t\tvar node = document.createElement('div');\n\t\t\n\t\t// Loads title message if it has not been done \n\t\tif( load == false)\n\t\t{\n\t\t\tvar heading = document.createElement('h1');\n\t\t\tvar h_text = document.createTextNode(load_message);\n\t\t\theading.appendChild(h_text);\n\t\t\tnode.appendChild(heading);\n\t\t\tload = true;\n\t\t}\n\t\n\t\t// Create prompt for choice\n\t\tvar prompt = document.createElement('h2');\n\t\tvar text = document.createTextNode(info[0]);\n\t\tprompt.appendChild(text); \n\t\n\t\tnode.appendChild(prompt);\n\t\n\t\t// Create the list of options \n\t\tvar selectnode = document.createElement('select');\n\t\tselectnode.setAttribute('onchange','selectChoice(this, this.selectedIndex)');\n\t\n\t\tfor( var i =1; i < info.length; i++)\n\t\t{\n\t\t\tvar option = document.createElement('option');\n\t\t\t// Set value of option\n\t\t\toption.setAttribute('value', info[i]);\n\t\t\t// Set label of option\n\t\t\tvar label = document.createTextNode(info[i]);\n\t\t\toption.appendChild(label);\n\t\t\t\n\t\t\t//Set the pre-selected option\n\t\t\tif( info[i] == 'Choose an option' )\n\t\t\t{\n\t\t\t\toption.setAttribute('selected', true);\n\t\t\t}\t\n\t\t\n\t\t\tselectnode.appendChild(option);\n\t\t} \n\t\tnode.appendChild(selectnode);\n\t\t\n\t\t// Div has been created\n\t\tdocument.getElementById('container').appendChild(node);\n\t\n\t}\n}", "title": "" }, { "docid": "b9e65162a0950eb5b21715dea5b0b188", "score": "0.48748517", "text": "function obj_appearanceNode(id,imageSequence,name,parentID,type,url,target,visable) {\r\n\tthis.id = id;\r\n\tthis.imageSequence = imageSequence;\r\n\tthis.name = name;\r\n\tthis.parentID = parentID;\r\n\tthis.type = type;\r\n\tthis.url = url;\r\n\tthis.target = target;\r\n\tthis.visable = visable;\t\r\n\treturn this\r\n}", "title": "" }, { "docid": "81d76da3a7b17605d2d3921acf7da983", "score": "0.48718724", "text": "buildUIElements() {\r\n this.node = this.paper.rect(0, 0, this.rect.width, this.rect.height);\r\n }", "title": "" }, { "docid": "af43aead57d85343078bf84aa0240a9b", "score": "0.48716283", "text": "function DecisionAreaChoice()\r\n\t{\r\n\t\tvar name = \"\";\r\n\t\tvar key = \"\";\r\n\t\tvar value = \"\";\r\n\t\tvar seq = 0;\r\n\t\tvar _visible = true;\r\n\t\tvar _parentHeaderID = null;\r\n\t\t\r\n\t\tthis.name = name;\r\n\t\tthis.key = key;\r\n\t\tthis.value = value;\r\n\t\tthis.seq = seq;\r\n\t\tthis.visible = _visible; \r\n\t\tthis.parentHeaderID = _parentHeaderID;\r\n\t}", "title": "" }, { "docid": "4ffd197a4e68d978a4a7d2b2da368082", "score": "0.48634163", "text": "function showChoice(node) {\n dojo.removeClass(node, config.classes.not_shown);\n dojo.addClass(node, config.classes.shown);\n node.parentNode.style.display = \"\";\n}", "title": "" }, { "docid": "1eaebf76c2b19dc59e2af1db111149d2", "score": "0.4860707", "text": "function initNodesHorse(Id) {\n var m = mat4();\n switch(Id) {\n // TORSO\n case torsoId:\n case torsoId2:\n m = rotate(theta[torsoId], 0, 1, 0); // Rotation controlled by the slider\n stack2.push(m); // Used by the obstacle so that it doesn't animate like the horse\n m = mult(m, rotate(theta[torsoId2], 1, 0, 0)); // Throttle animation\n m = mult(m, translate(0.0, torsoJump, 0.0));\n figure[torsoId] = createNode(m, torso, null, neckId);\n break;\n \n // NECK\n case neckId:\n m = translate(0.0, torsoHeight*0.7, -(0.5*torsoLength));\n m = mult(m, rotate(theta[neckId], 1, 0, 0))\n m = mult(m, translate(0.0, -0.5*headHeight, 0.0));\n figure[neckId] = createNode(m, neck, leftPosteriorUpperLegId, headId);\n break;\n \n // HEAD\n case headId:\n m = translate(0.0, 0.1*neckHeight, -(0.7*neckLength));\n m = mult(m, rotate(theta[headId], 1, 0, 0))\n m = mult(m, translate(0.0, -0.5*headHeight, 0.0));\n figure[headId] = createNode(m, head, null, leftEarId);\n break;\n\n // LEFT POSTERIOR UPPER LEG\n case leftPosteriorUpperLegId:\n m = translate(-(torsoWidth-upperLegWidth), 0.3*upperLegHeight, 0.35*torsoLength);\n m = mult(m, rotate(theta[leftPosteriorUpperLegId], 1, 0, 0));\n m = mult(m, scale4(1.0, -1.0, 1.0));\n figure[leftPosteriorUpperLegId] = createNode(m, upperLeg, rightPosteriorUpperLegId, leftPosteriorLowerLegId);\n break;\n \n // LEFT POSTERIOR LOWER LEG\n case leftPosteriorLowerLegId:\n m = translate(0.0, 1.3, 0.5);\n m = mult(m, rotate(theta[leftPosteriorLowerLegId], 1, 0, 0));\n figure[leftPosteriorLowerLegId] = createNode(m, lowerLeg, null, null);\n break;\n \n // RIGHT POSTERIOR UPPER LEG\n case rightPosteriorUpperLegId:\n m = translate(torsoWidth-upperLegWidth, 0.3*upperLegHeight, 0.35*torsoLength);\n m = mult(m, rotate(theta[rightPosteriorUpperLegId], 1, 0, 0));\n m = mult(m, scale4(1.0, -1.0, 1.0));\n figure[rightPosteriorUpperLegId] = createNode(m, upperLeg, leftAnteriorUpperLegId, rightPosteriorLowerLegId);\n break;\n \n // RIGHT POSTERIOR LOWER LEG\n case rightPosteriorLowerLegId:\n m = translate(0.0, 1.3, 0.5);\n m = mult(m, rotate(theta[rightPosteriorLowerLegId], 1, 0, 0));\n figure[rightPosteriorLowerLegId] = createNode(m, lowerLeg, null, null);\n break;\n \n // LEFT ANTERIOR UPPER LEG\n case leftAnteriorUpperLegId:\n m = translate(-(torsoWidth-upperLegWidth), 0.3*upperLegHeight, -(0.45*torsoLength));\n m = mult(m, rotate(theta[leftAnteriorUpperLegId], 1, 0, 0));\n m = mult(m, scale4(1.0, -1.0, 1.0));\n figure[leftAnteriorUpperLegId] = createNode(m, upperLeg, rightAnteriorUpperLegId, leftAnteriorLowerLegId);\n break; \n \n // LEFT ANTERIOR LOWER LEG\n case leftAnteriorLowerLegId:\n m = translate(0.0, 1.1, -0.01);\n m = mult(m, rotate(theta[leftAnteriorLowerLegId], 1, 0, 0));\n figure[leftAnteriorLowerLegId] = createNode(m, lowerLeg, null, null);\n break;\n \n // RIGHT ANTERIOR UPPER LEG\n case rightAnteriorUpperLegId:\n m = translate(torsoWidth-upperLegWidth, 0.3*upperLegHeight, -(0.45*torsoLength));\n m = mult(m, rotate(theta[rightAnteriorUpperLegId], 1, 0, 0));\n m = mult(m, scale4(1.0, -1.0, 1.0));\n figure[rightAnteriorUpperLegId] = createNode(m, upperLeg, tailId, rightAnteriorLowerLegId);\n break; \n \n // RIGHT ANTERIOR LOWER LEG\n case rightAnteriorLowerLegId:\n m = translate(0.0, 1.1, -0.01);\n m = mult(m, rotate(theta[rightAnteriorLowerLegId], 1, 0, 0));\n figure[rightAnteriorLowerLegId] = createNode(m, lowerLeg, null, null);\n break;\n \n // TAIL\n case tailId:\n m = translate(0.0, torsoHeight*0.6, 0.65*torsoLength);\n m = mult(m, rotate(theta[tailId], 1, 0, 0));\n figure[tailId] = createNode(m, tail, null, null);\n break;\n \n // LEFT EAR\n case leftEarId:\n m = translate(-0.4, 1.4, 0.5*headLength);\n m = mult(m, rotate(theta[leftEarId], 0, 0, 1));\n figure[leftEarId] = createNode(m, ear, rightEarId, null);\n break;\n \n // RIGHT EAR\n case rightEarId:\n m = translate(0.4, 1.4, 0.5*headLength);\n m = mult(m, rotate(theta[rightEarId], 0, 0, 1));\n figure[rightEarId] = createNode(m, ear, null, null);\n break; } }", "title": "" }, { "docid": "ef1640dcec5f64ed1e30902528d29ed0", "score": "0.48560202", "text": "function getNodeInputData() {\n\n //if label is empty or contains only spaces\n if ($('#nodeName').val().replace(/ /g, '') == \"\") {\n $(\"#nodeFormMsg\").html(\"You must fill all the fields with * \");\n return null;\n }\n else {\n var data = {};\n data.id = (Math.random() * 1e7).toString(32);\n data.id = data.id.replace(/\\./g,\"0\");\n data.label = $('#nodeName').val();\n var newShape = $('input:radio[name=nodeShapes]:checked').val();\n data.shape = newShape;\n data.size = 20;\n //AE\n if (newShape == 'dot') {\n data.description = $('#EMdes').val();\n\n data.variables = {};\n\n var envs = $(\"#nodeEnvVars\").val() || [];\n if(envs.length > 0){\n var envArray = [];\n for(var i in envs){\n envArray.push(envs[i]);\n }\n data.variables[\"env\"] = envArray;\n }\n\n var varRows = document.getElementById(\"newVar\").getElementsByTagName('div');\n for (var i = 0; i < varRows.length; i++) {\n var vName = varRows[i].getElementsByTagName('input')[0].value;\n var vValue = varRows[i].getElementsByTagName('input')[1].value;\n data.variables[vName] = vValue;\n // console.log(vName);\n }\n\n var htmlContent = \" <div>\";\n for (var key in data) {\n if (key !== \"label\" && key !== \"description\" && key !== \"variables\") continue;\n if (data[key]) {\n htmlContent += \"<div>\" + key + \" : \" + data[key] + \"</div>\";\n }\n }\n htmlContent += \"</div>\";\n data.title = htmlContent;\n }\n //user\n // else if (newShape == 'square') {\n // data.authoritylevel = $('#alVal').val();\n //\n // var htmlContent = \" <div>\";\n // for (var key in data) {\n // if (key !== \"label\" && key !== \"authoritylevel\") continue;\n // if (data[key]) {\n // htmlContent += \"<div>\" + key + \" : \" + data[key] + \"</div>\";\n // }\n // }\n // htmlContent += \"</div>\";\n //\n // data.title = htmlContent;\n // }\n else {\n console.log('no node shape detected');\n }\n\n return data;\n }\n}", "title": "" }, { "docid": "84b58e3102043794fe05ee398c02b8b6", "score": "0.48536453", "text": "constructor(from, to, node) {\n super()\n this.from = from\n this.to = to\n // :: Node The selected node.\n this.node = node\n }", "title": "" }, { "docid": "0073660239b31bd14f07b320a6a0e5a9", "score": "0.4852927", "text": "function choice(clicked) {\n answer = clicked\n}", "title": "" }, { "docid": "4643fa1b8bd02f82d91e6e7a9cf3e3cf", "score": "0.4843511", "text": "function choose(argv1, nodeArgs){\nswitch(argv1){\n\tcase 'spotify-this-song':\n\t\tspot(nodeArgs);\n\tbreak;\n\n\tcase 'my-tweets':\n\t\ttwit();\n\tbreak;\n\n\tcase 'movie-this':\n\t\tmovie();\n\tbreak;\n\n\tcase 'do-what-it-says':\n\t\tdoWhat();\n\tbreak;\n\n\tdefault:\n\t\tconsole.log('\\nWhen you make a choice, you change the future\\n');\n}\n}", "title": "" }, { "docid": "c83a1755b6730ee632f28fd5227135f5", "score": "0.4815931", "text": "function buildNodeObj(n){\n\t\t\t\t\t\tif (node_dict[x[n].qText] === undefined){ //add if not exist\n\t\t\t\t\t\t\t//Bugfix save qElemNumber for both A and B to ensure lasso functionality works correctly\n\t\t\t\t\t\t\tvar nodeObj= {\n\t\t\t\t\t\t\t\tnodeID: x[n].qText,\n\t\t\t\t\t\t\t\tdegree: oDegree ? gDegree._stringValues[x[n].qText] : 1,\n\t\t\t\t\t\t\t\tbetweenness: oBetweenness ? gBetweenness._stringValues[x[n].qText]+0.1 : 1,\n\t\t\t\t\t\t\t\teigenvector: oEigenvector ? gEigenvector._stringValues[x[n].qText]+0.1 : 1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Node Name\n\t\t\t\t\t\t\tif (x[n].qAttrExps.qValues[0].hasOwnProperty('qText')) { \n\t\t\t\t\t\t\t\tnodeObj.name = x[n].qAttrExps.qValues[0].qText; //Set node name if exist\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnodeObj.name = x[n].qText;//default name is id\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t//Node Description\n\t\t\t\t\t\t\tif (x[n].qAttrExps.qValues[1].hasOwnProperty('qText')) { \n\t\t\t\t\t\t\t\tnodeObj.desc = x[n].qAttrExps.qValues[1].qText; //Set node name if exist\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnodeObj.desc = '';//default description is blank\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t//Node Color\n\t\t\t\t\t\t\tif (x[n].qAttrExps.qValues[2].hasOwnProperty('qText')) { \t\n\t\t\t\t\t\t\t\tnodeObj.color = x[n].qAttrExps.qValues[2].qText; //Set to node color if exist\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tnodeObj.color = oNodeColor; //default color\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t//Node qElemNumber Assignement\n\t\t\t\t\t\t\tn == 0 ? nodeObj.nodeqElemNumber0 = x[n].qElemNumber : nodeObj.nodeqElemNumber1 = x[n].qElemNumber\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgNodes.push(nodeObj); //add new node\n\t\t\t\t\t\t\tnode_dict[x[n].qText] = oDegree ? gDegree._stringValues[x[n].qText] : 1; //save to dictionary\n\t\t\t\t\t\t}else{ //Node already exists\n\t\t\t\t\t\t\t//Node qElemNumber Assignment #2, used when Node already exists, need to assign qElemNumber for second occurance\n\t\t\t\t\t\t\t//On render the code will favour nodes on sideA rather than sideB\n\t\t\t\t\t\t\tvar gNIndex = gNodes.findIndex(y => y.nodeID == x[n].qText); \n\t\t\t\t\t\t\tif (n == 0){\n\t\t\t\t\t\t\t\tgNodes[gNIndex].nodeqElemNumber0 = x[n].qElemNumber; //Overwrite with SideA\n\t\t\t\t\t\t\t\tx[n].qAttrExps.qValues[0].hasOwnProperty('qText') ? gNodes[gNIndex].name = x[n].qAttrExps.qValues[0].qText : gNodes[gNIndex].name = x[n].qText;\n\t\t\t\t\t\t\t\tx[n].qAttrExps.qValues[1].hasOwnProperty('qText') ? gNodes[gNIndex].desc = x[n].qAttrExps.qValues[1].qText : gNodes[gNIndex].desc = '';\n\t\t\t\t\t\t\t\tx[n].qAttrExps.qValues[2].hasOwnProperty('qText') ? gNodes[gNIndex].color = x[n].qAttrExps.qValues[2].qText : gNodes[gNIndex].color = oNodeColor;\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//#1 Special function to handle Exclusive and Non-Exclusive Sets\n\t\t\t\t\t\t//Exclusive Set is a set of nodes where node '1' is either in NodeA or NodeB but not both.\n\t\t\t\t\t\t//Non-Exclusive Set is a set of nodes where node '1' is either in NodeA or NodeB or both.\n\n\t\t\t\t\t\t\n\t\t\t\t\t}", "title": "" }, { "docid": "5f6a050439938a2814c45cbe824593ec", "score": "0.48150745", "text": "function crearNodo(tipo, estado) {//la posicion del raton se detrmino cuando se dio click derecho para visualozar el menu\n rcCreateNode([{name: 'newNodeData', value: tipo + ';' + parseInt(mousePosX - 25) + ';' + parseInt(mousePosY - 25) + \";\" + estado}]);\n}", "title": "" }, { "docid": "3444d2a957b4118187fcc00735ed262d", "score": "0.4809467", "text": "function MealyNodePrompt(func) {\n var nodeFunction = func;\n // Prompt box needs a reference to the function to run upon clicking \"OK\".\n\n // Render function is used to initialize the prompt box in the view.\n this.render = function(value, is, lab) {\n renderBox();\n // Add content to the prompt box, with references to the functions to run within the buttons.\n document.getElementById('dialogueboxhead').innerHTML = \"Edit Node <b>\" + value + \":</b>\";\n document.getElementById('dialogueboxbody').innerHTML = 'Initial State:<input type=\"checkbox\" id=\"initial_state\">';\n document.getElementById('dialogueboxbody').innerHTML += '<br>State Label: <input id=\"label\">';\n document.getElementById('dialogueboxfoot').innerHTML = '<button onclick=\"ok()\">OK</button> <button onclick=\"terminate()\">Cancel</button>';\n // If the node being edited is currently the initial state, check the \"Initial State\" checkbox.\n if (is) {\n document.getElementById('initial_state').checked = true;\n }\n // Note that since this is a Mealy Machine, there is no such thing as a final state.\n // If the node being edited has a state label, display this text in the \"State Label\" text field.\n if (lab) {\n document.getElementById('label').value = lab;\n }\n // Place the cursor in the state label text field by default (since this is the only text field in the prompt box).\n document.getElementById('label').focus();\n }\n\n // Update node on the graph. Called upon clicking \"OK\".\n ok = function() {\n // Check every field in the prompt box and update the node accordingly.\n var initial_state = document.getElementById('initial_state').checked;\n var node_label = document.getElementById('label').value;\n // Call the node function on these values, then exit out of the prompt box.\n nodeFunction(initial_state, node_label);\n terminate();\n }\n}", "title": "" }, { "docid": "80a0e2c1a653956c509fd17c9611efab", "score": "0.47944006", "text": "function runDecisionTheoryModule(location,inputData){\n var graphData={\"links\":[],\"nodes\":[]};\n var data=[];\n var inputNodes=[];\n var listOfPriority=[];\n var colorList = [];\n var orderedData = {}\n function createGraph(){\n createForceDirectedGraph(graphData,\"graph\"+location.parentElement.moduleNumber);\n }\n function processData(){\n var elements = Object.keys(data);\n if(listOfPriority.length>1){\n for(var i = 0;i<elements.length;i++){\n var sum = 0;\n for(var j = 0 ;j<listOfPriority.length;j++){\n sum = sum + data[elements[i]]._data[0][j]*listOfPriority[j];\n }\n orderedData[elements[i]] = sum;\n }\n }else{\n orderedData = data;\n }\n var nodeList = graphData[\"nodes\"];\n var linkList = graphData[\"links\"];\n foundMatch:\n for(var i=0;i<inputNodes.length;i++){\n var a = inputNodes[i];\n for(var j=0;j<inputNodes.length;j++){\n if(i!=j){\n var b = inputNodes[j];\n var result = compareTwoNodes(a,b);\n if(result != 0){\n if(result == 1){\n linkList.push({\"source\": b,\"target\": a});\n nodeList.push({\"name\":b,\"color\" : getRandomColorString()});\n nodeList.push({\"name\":a,\"color\" : getRandomColorString()});\n }else{\n linkList.push({\"source\": a,\"target\": b});\n nodeList.push({\"name\":a,\"color\" : getRandomColorString()});\n nodeList.push({\"name\":b,\"color\" : getRandomColorString()});\n }\n inputNodes.splice(i,1);\n inputNodes.splice(j-1,1);\n break foundMatch;\n }\n }\n }\n }\n for(var i=0;i<inputNodes.length;i++){\n var relationsArray=[];\n for(var j=0;j<nodeList.length;j++){\n relationsArray.push(compareTwoNodes(nodeList[j].name,inputNodes[i]));\n }\n var start = relationsArray.lastIndexOf(-1);\n var end = relationsArray.indexOf(1);\n if(start==-1 && end==-1){\n break;\n }\n var nodesBelow = [];\n var nodesAbove = [];\n if(start!=-1){\n linkList.push({\"source\": nodeList[start].name,\"target\": inputNodes[i]});\n nodesBelow.push(nodeList[start].name);\n for(var j=start;-1<j;j--){\n var secondaryLinks = compareTwoNodes(nodeList[j].name,nodeList[start].name);\n if(secondaryLinks==0 && j!=start){\n linkList.push({\"source\": nodeList[j].name,\"target\": inputNodes[i]});\n nodesBelow.push(nodeList[j].name);\n }\n }\n }\n if(end!=-1){\n linkList.push({\"source\": inputNodes[i],\"target\":nodeList[end].name});\n nodesAbove.push(nodeList[end].name);\n for(var j=end; nodeList.length>j;j++){\n var secondaryLinks = compareTwoNodes(nodeList[end].name,nodeList[j].name);\n if(secondaryLinks==0 && j!=end){\n linkList.push({\"source\": inputNodes[i],\"target\": nodeList[j].name});\n nodesAbove.push(nodeList[j].name);\n }\n }\n }\n for(var j = 0;j<nodesBelow.length;j++){\n for(var k = 0;k<nodesAbove.length;k++){\n for(var l = 0;l<linkList.length;l++){\n if(linkList[l].target === nodesAbove[k] && linkList[l].source === nodesBelow[j]){\n linkList.splice(l,1);\n }\n }\n }\n }\n var node = {\"name\":inputNodes[i]};\n var contains0s = relationsArray.indexOf(0);\n if(relationsArray.indexOf(0) == -1){\n node.color = getRandomColorString();\n }else{\n node.color = nodeList[contains0s].color;\n }\n if(start !=-1){\n nodeList.splice(start+1,0,node);\n }else if(end != -1){\n nodeList.splice(end,0,node);\n }else{\n nodeList.push(node);\n }\n inputNodes.splice(i,1);\n i=i-1;\n }\n }\n //compares node a and b and retruns 1(a), -1(b) or 0(equal)\n function compareTwoNodes(aNode,bNode){\n var a = orderedData[aNode];\n var b = orderedData[bNode];\n var c = math.subtract(a,b);\n if(c>0){\n return 1;\n }else if(c<0){\n return -1;\n }else{\n return 0;\n }\n // priority comparison method\n // var cType =typeof c;\n // if(cType==='number'){\n // c = math.matrix([[c]]);\n // }\n\n // var limit = Math.max(...listOfPriority);\n // for(var k=1;k<limit+1;k++){\n // var list = [];\n // var propertyColumn = listOfPriority.indexOf(k);\n // while(propertyColumn!=-1){\n // var propertyValue = math.subset(c,math.index(0,propertyColumn));\n // if(propertyValue>0){\n // list.push(1);\n // }else if(propertyValue==0){\n // list.push(0);\n // }else if(propertyValue<0){\n // list.push(-1);\n // }\n // propertyColumn = listOfPriority.indexOf(k,propertyColumn+1);\n // }\n // if(list.every(function(value){return value==1})){\n // return 1;\n // }else if(list.every(function(value){return value==-1})){\n // return -1;\n // }\n // }\n // return 0;\n }\n function getRandomColorString(){\n var array = [0,0,0];\n var retVal = \"\";\n var isNotUnique = true;\n while (isNotUnique) {\n for (var i = 0; i < array.length; i++) {\n array[i] = Math.floor(Math.random() * 255)+127;\n }\n retVal=\"rgb(\"+array[0]+\",\"+array[1]+\",\"+array[2]+\")\";\n if(!colorList.includes(retVal)){\n isNotUnique = false;\n }\n }\n return retVal;\n }\n\n function addForm(){\n var div = document.createElement(\"div\");\n var gridTempleteColumnsSet = \"\";\n for(var i=0;i<keys.length*2+1;i++){\n gridTempleteColumnsSet=gridTempleteColumnsSet+\" auto\";\n }\n div.style[\"grid-template-columns\"] = gridTempleteColumnsSet;\n div.style.display = \"grid\";\n div.style.width=\"100%\";\n div.style.height =\"25px\";\n keys.forEach(function(e,i){\n var l1 = document.createElement(\"div\");\n l1.innerHTML = e+\":\";\n l1.class=\"column\";\n l1.style.width=\"100%\";\n l1.style.height =\"100%\";\n l1.style[\"white-space\"] = \"nowrap\";\n l1.style.overflow = \"hidden\";\n div.appendChild(l1);\n var e1 = document.createElement(\"input\");\n e1.type = \"text\";\n e1.class = \"formInput\"\n e1.style.width=\"100%\";\n e1.class=\"column\";\n div.appendChild(e1);\n });\n var button = document.createElement(\"button\");\n button.type = \"submit\";\n button.from = \"form\";\n button.value = \"submit\";\n button.innerHTML = \"Submit\";\n button.style.width =\"100%\";\n button.addEventListener('click', formButtonClicked);\n div.appendChild(button);\n location.appendChild(div);\n }\n\n function formButtonClicked() {\n var listOfInputs = location.getElementsByTagName(\"input\");\n listOfPriority=[]\n for(var i = 0;i<listOfInputs.length;i++){\n if(listOfInputs[i].value ===\"\"){\n listOfPriority.push(0);\n }else{\n listOfPriority.push(parseFloat(listOfInputs[i].value, 10));\n }\n }\n processData();\n createGraph();\n var listOfLinks = [];\n graphData.links.forEach(function(i){\n listOfLinks.push([i.source.name,i.target.name]);\n });\n var result = {data:convertToCsv([\"source\",\"target\"],listOfLinks),\n name:moduleArray[location.parentElement.moduleNumber].moduleName+\".csv\"};\n createDataSlot(result);\n }\n // extractData();\n var dataSet = math.clone(inputData[0]);\n var keys = Object.keys(dataSet[0]);\n keys.splice(0,1);\n inputNodes = convertObjectStringToList(dataSet);\n var tmpData = convertObjectDataToMatrix(dataSet);\n var length = tmpData.size()[1];\n for(var i=0;i<tmpData.size()[0];i++){\n data[inputNodes[i]] = math.subset(tmpData,math.index(i,math.range(0,length)));\n }\n addForm();\n var heightOfParent = location.style.height.substr(0,location.style.height.indexOf(\"p\"))-25;\n var widthOfParent = location.parentElement.style.width.substr(0,location.parentElement.style.width.indexOf(\"p\"));\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute('width', widthOfParent);\n svg.setAttribute('height', heightOfParent);\n svg.id = \"graph\"+location.parentElement.moduleNumber;\n location.appendChild(svg);\n return null;\n}", "title": "" }, { "docid": "dd28e3785482562059a12b0223b27a82", "score": "0.47917122", "text": "function LogicNodeRandom() {\n\t\t\tLogicNode.call(this);\n\t\t\tthis.wantsProcessCall = true;\n\t\t\tthis.logicInterface = LogicNodeRandom.logicInterface;\n\t\t\tthis.type = 'LogicNodeRandom';\n\t\t}", "title": "" }, { "docid": "90ed416d57375985c2b1b01a6b3bd561", "score": "0.47889137", "text": "function SkillNode(time, gfxName, act) \n{\n\treturn SkillNode( time, gfxName, act, 0, 0);\n}", "title": "" }, { "docid": "beaed45612fbec747fa9c8becde133bd", "score": "0.47842282", "text": "function createElementOfType(question, choice, choiceIndex) {\n var element;\n var checkedState = wizardAnswers[questionNr].Answers[choiceIndex].IsChecked;\n var answerText = wizardAnswers[questionNr].Answers[choiceIndex].AnswerText;\n if (answerText == \"No answer\")\n answerText = \"\";\n\n switch (question.QuestionType) {\n case QuestionType.FreeText:\n element = $('<textarea style=\"width: 90%; height: 200px\" id=\"' + choice.ChoiceID + '\"></textarea>');\n element.val(answerText);\n break;\n case QuestionType.MultiChoice:\n element = $('<input type=\"checkbox\" id=\"' + choice.ChoiceID + '\">' + choice.AnswerText + '</input>');\n element.prop('checked', checkedState);\n break;\n case QuestionType.Single:\n element = $('<input type=\"radio\" id=\"' + choice.ChoiceID + '\">' + choice.AnswerText + '</input>');\n $(element).attr('name', question.QuestionID);\n element.prop('checked', checkedState);\n break;\n case QuestionType.TrueFalse:\n var radioTrue = $('<input type=\"radio\" value=\"true\">' + \"True\" + '</input>');\n $(radioTrue).attr('name', 'trueFalse');\n var radioFalse = $('<input type=\"radio\" value=\"false\">' + \"False\" + '</input>');\n $(radioFalse).attr('name', 'trueFalse');\n element = $('<div id=\"' + choice.ChoiceID + '\"></div>');\n $(element).append(radioTrue);\n $(element).append(radioFalse);\n element.find('input[value=\"' + answerText + '\"]').prop('checked', answerText);\n break;\n case QuestionType.Weighted:\n element = $('<input type=\"radio\" id=\"' + choice.ChoiceID + '\">' + choice.AnswerText + '</input>');\n $(element).attr('name', question.QuestionID);\n element.prop('checked', checkedState);\n break;\n }\n return element;\n}", "title": "" }, { "docid": "f28e70a39f70d685cbb371cfd1a07156", "score": "0.47725466", "text": "function getTempFnForChoiceRelationship() {\n var templateFn = function (type) {\n if (type === 'core:relationship')\n return spEntity.fromJSON(choiceRelationshipDefaultObject);\n else\n return null;\n };\n return templateFn;\n }", "title": "" }, { "docid": "17324989b2e92bccdbd3d52eab9b7d31", "score": "0.4764044", "text": "appendAndCreateOpButton(label, value, parent, propName) {\n\n let button = this.p.createButton(label, value)\n button.elt.className = \"button\"\n\n button.elt.onclick = ()=>{\n //selects item\n //check if siblings are selected\n this.removeSelectedClass(parent)\n\n button.elt.classList.add(\"selected\")\n\n this.mech.parameters[propName] = value\n //case for cut\n if(this.mech.parametersChanged()) {\n this.mech.resetOperation()\n } \n //case for sort\n if(this.mech.parametersChanged() && propName==\"condProp\") {\n let vDiv = document.querySelector(\"#valueC\").children[1].children[0]\n let vSlider = document.querySelector(\"#valueC\").children[1].children[1]\n\n let max\n let inV = 1\n let str\n\n if (!this.mech.portIn) {\n max = 1\n str = \"Inget inmatat material\"\n } else if(value == \"sRqueue\") {\n max = this.mech.portIn.matList.length\n str = \"Köplats \"+inV\n } else {\n max = this.mech.portIn.matList.map(m=>m.parts[this.mech.parameters.condProp]).sort((a,b)=>b-a)[0]\n str = inV+\" cm\"\n }\n\n vSlider.max = max\n vSlider.value = inV\n vDiv.innerHTML = str\n this.mech.parameters.condValue = inV\n }\n }\n \n parent.elt.appendChild(button.elt)\n return button\n }", "title": "" }, { "docid": "c1a093948d9fa37b2fdd9801f39437c0", "score": "0.47568753", "text": "createLevel() {\n shuffle(this.nodes);\n for (let i = 0; i < this.nodes.length; i++) {\n let nodeText = this.nodes[i]\n let newNode = document.createElement(\"li\");\n newNode.setAttribute(\"id\", nodeText);\n newNode.innerHTML = nodeText;\n newNode.addEventListener(\"click\", function() {\n if (instructions.style.display !== \"none\") instructions.style.display = \"none\";\n message.innerHTML = \"\";\n if (newNode.parentElement === codeSnippets) {\n codeSnippets.removeChild(newNode);\n puzzleBox.appendChild(newNode);\n } else {\n puzzleBox.removeChild(newNode);\n codeSnippets.appendChild(newNode);\n }\n });\n codeSnippets.appendChild(newNode);\n }\n }", "title": "" }, { "docid": "ed6bd0c96461dc8632630e70c5ddf977", "score": "0.4756138", "text": "function TNode(){}", "title": "" }, { "docid": "ed6bd0c96461dc8632630e70c5ddf977", "score": "0.4756138", "text": "function TNode(){}", "title": "" }, { "docid": "ed6bd0c96461dc8632630e70c5ddf977", "score": "0.4756138", "text": "function TNode(){}", "title": "" }, { "docid": "ed6bd0c96461dc8632630e70c5ddf977", "score": "0.4756138", "text": "function TNode(){}", "title": "" }, { "docid": "33f5c9b81186752eaad14043114cbad2", "score": "0.47445318", "text": "function setupForGenerator(){\n\tnodes.splice(nodes.length - 1, 1);\n\tedges.splice(edges.length - 1, 1);\n\n\tfor (var i = 0; i < edges.length; i++)\n\t\tedges[i].setWeight(1);\n\n\tgetSeedData();\n\n\tnodes_copy = nodeCopy(nodes);\n\tedges_copy = edgeCopy(edges);\n\n\tshowButtons([\"SKIP\\nEDGE\", \"HIDE\\nEDGE\", \"UNDO\", \"LOAD\", \"RESTART\", \"HELP\"]);\n\n\tidx = nodes.length - 1;\n\tcreating_seed = false;\n\tcreating_generator = true;\n}", "title": "" }, { "docid": "4c80240f80462ccef8fc28c79a6e056e", "score": "0.47366437", "text": "function createChoiceUl () {\n\t const lis = story.currentChoices\n\t .map(choice => {\n\t const li = document.createElement('li');\n\t li.innerHTML = choice.text;\n\t createChoiceListener(li, choice.index);\n\t return li;\n\t });\n\t const ul = document.createElement('ul');\n\t Array.from(lis).forEach(li => ul.appendChild(li));\n\t ul.className = \"choices current\";\n\t return ul;\n\t}", "title": "" }, { "docid": "2a333fb83b3d19e1fc1bf21e825eb601", "score": "0.4736501", "text": "initDiagram(props) {\n console.log(\"init called\");\n const $ = go.GraphObject.make;\n const diagram =\n $(go.Diagram,\n {\n 'undoManager.isEnabled': true, // must be set to allow for model change listening\n // 'undoManager.maxHistoryLength': 0, // uncomment disable undo/redo functionality\n 'clickCreatingTool.archetypeNodeData': { text: 'new node', color: 'lightblue' },\n model: $(go.GraphLinksModel,\n {\n linkKeyProperty: 'key' // IMPORTANT! must be defined for merges and data sync when using GraphLinksModel\n })\n });\n\n // define a simple Node template\n diagram.nodeTemplate =\n $(go.Node, 'Auto', // the Shape will go around the TextBlock\n new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),\n $(go.Shape, 'RoundedRectangle',\n { name: 'SHAPE', fill: 'white', strokeWidth: 0 },\n // Shape.fill is bound to Node.data.color\n new go.Binding('fill', 'color')),\n\t\t $(go.Panel, \"Vertical\", { margin: 3 },\n $(go.TextBlock,\n { margin: 8, editable: true }, // some room around the text\n new go.Binding('text').makeTwoWay()\n ))\n\t\t);\n\n\t \t\n\t\t// add diagram listener\n\t diagram.addDiagramListener(\"ObjectSingleClicked\",\n function(e) {\n var part = e.subject.part;\n if (!(part instanceof go.Link)) {\n\t\t\t// hide other divs\n\t\t\tvar i = 0;\n\t\t\tfor (i=0;i<props.nodeDataArray.length;i++) {\n\t\t\t\tdocument.getElementById(props.nodeDataArray[i].text).style.display = \"none\";\n\t\t\t}\n\t\t // expose the hidden div where a user can edit node settings\n\t\t\tconsole.log(part.data.text);\n\t\t\tdocument.getElementById(part.data.text).style.display = \"\";\n\t\t\tif (part.data.text==\"Display Data\") {\n\t\t\t\tdocument.getElementById(\"key\").innerHTML = part.data.key;\n\t\t\t} \n\t\t\tif (part.data.text==\"Remove Selected Words\" || part.data.text==\"Topic Modeling\" || part.data.text==\"Word Embedding\") {\n\t\t\t\tdocument.getElementById(\"allCols\").style.display = \"\";\n\t\t\t} else {\n\t\t\t\tdocument.getElementById(\"allCols\").style.display = \"none\";\n\t\t\t}\n\t\t}\n });\n\t\t \n\t\n\n return diagram;\n }", "title": "" }, { "docid": "e893c68b78796338395823834e2ba248", "score": "0.47343504", "text": "function create_choice(qNum){\n\n //select response are of selected question\n var rArea = $('#response_area_'+qNum);\n rArea.html(\n '<div class=\"form-group\">'\n + '<label class=\"col-sm-2\">Custom Type:</label>'\n + '<div class=\"col-sm-10\">'\n + '<div class=\"btn-group btn-group-justified choice_group\">'\n + '<div class=\"btn-group select\" data-type=\"3\">'\n + '<button type=\"button\" class=\"btn btn-primary active\">Single Choice</button>'\n + '</div>'\n + '<div class=\"btn-group select\" data-type=\"4\">'\n + '<button type=\"button\" class=\"btn btn-primary\">Multiple Choice</button>'\n + '</div>'\n + '</div>'\n + '</div>'\n + '</div>'\n + '<div id=\"answer_area_'+qNum+'\"></div>'\n + '<button class=\"btn btn-success add_answer\">Add Answer</button>'\n );\n }", "title": "" }, { "docid": "db8ab0ac50c09fb8be1a7b2773462326", "score": "0.4733328", "text": "function nodeTemplate(diagram, node) {\n node.labels[0].text = node.Role;\n node.fillColor = node.color;\n}", "title": "" }, { "docid": "24879d30fc7e10baa941a8e519bbf5fd", "score": "0.4730826", "text": "traverse(func) {\n func(this.question);\n // this.children.forEach(child => child.traverse());\n if(this.yes) this.yes.traverse(func);\n if(this.no) this.no.traverse(func);\n }", "title": "" }, { "docid": "04114a524a949ceddf4739a0151248cd", "score": "0.47295305", "text": "function generateInput() {\n var randomNodes = [];\n createCircleArea();\n\n for (var i = 0; i < size; i++) {\n randomNodes[i] = i;\n }\n\n for (var j = 0; j < size; j++) {\n Nodes[j] = new Node(randomNodes[i], random(0, 200), xValues[j], yValues[j]);\n }\n\n drawNodes();\n}", "title": "" }, { "docid": "1631f7b27fcebb9c1bbafad0f3ffa19f", "score": "0.47285837", "text": "renderDefaultPropChoices() {\n return (\n <div>\n <div>\n <Selector\n selected={this.state.lineShape}\n selectionList={lineShapeList}\n handleChange={lineShape => this.setState({lineShape})} />\n <p>Select the \"lineShape\" on the connection</p>\n </div>\n <div>\n <Selector\n selected={this.state.x1}\n selectionList={xyChoiceList}\n handleChange={val => {\n const x1 = parseInt(val, 10);\n this.setState({x1});\n }} />\n <Selector\n selected={this.state.y1}\n selectionList={xyChoiceList}\n handleChange={val => {\n const y1 = parseInt(val, 10);\n this.setState({y1});\n }} />\n <Selector\n selected={this.state.x2}\n selectionList={xyChoiceList}\n handleChange={val => {\n const x2 = parseInt(val, 10);\n this.setState({x2});\n }} />\n <Selector\n selected={this.state.y2}\n selectionList={xyChoiceList}\n handleChange={val => {\n const y2 = parseInt(val, 10);\n this.setState({y2});\n }} />\n <p>Select the \"x1\", \"y1\", \"x2\", \"y2\" position props for the connection</p>\n </div>\n <div>\n <Selector\n selected={this.state.styleType}\n selectionList={styleList}\n handleChange={this.handleStyleTypeChange} />\n <Selector\n selected={this.state.styleModifier}\n selectionList={styleModifierList}\n handleChange={this.handleStyleModChange} />\n <p>Select the line style preset and modifier</p>\n </div>\n <div>\n <Selector\n selected={this.state.labelPosition}\n selectionList={labelPositionChoiceList}\n handleChange={labelPosition => this.setState({labelPosition})} />\n <p>Select the \"labelPosition\" prop</p>\n </div>\n <div>\n <Selector\n selected={this.state.textAnchor}\n selectionList={textAnchorList}\n handleChange={textAnchor => this.setState({textAnchor})} />\n <p>Select the label's \"textAnchor\" prop</p>\n </div>\n <div>\n <Selector\n selected={this.state.labelOffsetX}\n selectionList={positionList}\n handleChange={val => {\n const labelOffsetX = parseInt(val, 10);\n this.setState({labelOffsetX});\n }} />\n <Selector\n selected={this.state.labelOffsetY}\n selectionList={positionList}\n handleChange={val => {\n const labelOffsetY = parseInt(val, 10);\n this.setState({labelOffsetY});\n }} />\n <p>Select the \"labelOffsetX\" and \"labelOffsetY\" label offset</p>\n </div>\n <div>\n <Selector\n selected={this.state.noNavigateChoice}\n selectionList={noNavigateList}\n handleChange={this.handleNoNavigateChange} />\n <p>Select whether to disable navigation</p>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "3b8f433c8118c91f841b8696ba7682f2", "score": "0.47200495", "text": "function createChoiceButtonText() {\r\n\r\n if (choiceParadigmType == ChoiceParadigmEnum.DESCRIPTION) {\r\n $(\".choiceButton\").each(function(index) {\r\n $(this).text(problemDescriptions[choiceSetCounter][index]);\r\n });\r\n } else {\r\n $(\".choiceButton\").each(function() {\r\n $(this).text(\"Box \" + getNextLetter());\r\n });\r\n }\r\n\r\n}", "title": "" }, { "docid": "c7712a38a45e5cdab07e9942db353b66", "score": "0.4716162", "text": "function setNodeTemplate() {\n var canvas = new ej2_react_diagrams_2.StackPanel();\n canvas.children = [];\n canvas.style.strokeWidth = 0;\n canvas.style.fill = \"#e6e0eb\";\n canvas.children.push(getTextElement(\"Events\", \"#a6a1e0\"));\n canvas.children.push(getTextElement(\"Emails\", \"#db8ec9\"));\n canvas.children.push(getTextElement(\"Calls\", \"#db8ec9\"));\n canvas.children.push(getTextElement(\"Smart Contents\", \"#db8ec9\"));\n return canvas;\n}", "title": "" }, { "docid": "9a6cb1a167e8f3ebf72e920a30009245", "score": "0.47159186", "text": "_generateOperands() {\n this.operands.top.value = Math.floor(\n Math.random() *\n (this.operands.top.upperbound - this.operands.top.lowerbound + 1)\n ) + this.operands.top.lowerbound;\n this.operands.bot.value = Math.floor(\n Math.random() *\n (this.operands.bot.upperbound - this.operands.bot.lowerbound + 1)\n ) + this.operands.bot.lowerbound;\n this.operands.top.value = this.operands.top.value.toString();\n this.operands.bot.value = this.operands.bot.value.toString();\n }", "title": "" }, { "docid": "4604dc6499261ad2b265c2925189c196", "score": "0.47142166", "text": "function newNode() {\n var str=\"\";\n str+=`<div class=\"row mt-1\"> <div class=\"col-lg-3 text-center\"><select class=\"form-control subject\" style=\"border-radius: 50px\" onchange=\"checkValues(this.value,`+count+`)\">`;\n for(var i=0;i<classes.length;i++){\n str+=`<option value=\"`+classes[i]+`\">`+classes[i]+`</option>`;\n }\n str+=`<option value=\"other\">Other</option></select><input type=\"text\" id=\"s`+count+`\" placeholder=\"Enter Subject\" class=\"form-control hide\" style=\"border-radius: 50px\"></div><div class=\"col-lg-3 text-center\"><select class=\"form-control predicate\" style=\"border-radius: 50px\">`;\n for(var i=0;i<propertis.length;i++){\n str+=`<option value=\"`+propertis[i]+`\">`+propertis[i]+`</option>`;\n }\n str+=`</select></div><div class=\"col-lg-3 text-center\"><select class=\"form-control object\" style=\"border-radius: 50px\" onchange=\"checkValueo(this.value,`+count+`)\">`;\n\n for(var i=0;i<classes.length;i++){\n str+=`<option value=\"`+classes[i]+`\">`+classes[i]+`</option>`;\n }\n str+=`<option value=\"other\">Other</option></select><input type=\"text\" id=\"o`+count+`\" placeholder=\"Enter Object\" class=\"form-control hide\" style=\"border-radius: 50px\"></div><div class=\"col-lg-3 text-center\"><select class=\"form-control and\" style=\"border-radius: 50px\"><option value=\"AND\">AND</option><option value=\"OR\">OR</option></select></div></div>`;\n if(count===0)\n $('#node').html(str);\n else\n $('#node').append(str);\n count++;\n $('.loader').hide();\n}", "title": "" }, { "docid": "2fd7bc77a7c459c6c320f7ff29903047", "score": "0.47086272", "text": "function factoryAction(action) {\n\n // gets the selected node as object\n var node = getSelectedNodeObj();\n\n if(action != 'create' && (! node || node.parent > 0)) {\n\n $(\".livetree_logo\").notify('Select a Factory node first', { position:\"bottom center\", className: \"warn\" });\n\n formModalClose();\n\n return;\n\n }\n\n switch (action) {\n\n case 'create':\n\n break;\n\n case 'update':\n\n document.getElementById('lbl_update').innerHTML = node.text;\n\n // clear the html from the node text\n var name = node.text;\n name = name.substring(0, name.indexOf('<'));\n name = name.trim();\n document.getElementById('factory_name_update').value = name;\n\n document.getElementById('factory_id_update').value = node.id;\n\n // focus on input\n document.getElementById('factory_name_update').focus();\n\n break;\n\n case 'delete':\n\n document.getElementById('lbl_delete').innerHTML = node.text;\n document.getElementById('factory_id_delete').value = node.id;\n\n break;\n\n case 'generate':\n\n document.getElementById('lbl_generate').innerHTML = node.text;\n document.getElementById('factory_id_generate').value = node.id;\n\n document.getElementById('item_count_generate').value = node.original.item_count;\n document.getElementById('lower_bound_generate').value = node.original.lower_bound;\n document.getElementById('upper_bound_generate').value = node.original.upper_bound;\n\n break;\n\n }\n\n // shows action's modal\n $('#modal_' + action + '_form').modal();\n\n}", "title": "" }, { "docid": "12c86ea2bf81b60e4275a3eecaa5f757", "score": "0.47078037", "text": "fillIntialNodePropertyAnswers() {\n let string = \"\";\n\n for(const nodeProperty of this.requestedNodeProperties) {\n for(const node of this.requiredNodes) {\n string = node.value + \"-\" + node.orderPlaced + \":\";\n \n if(this.propertyAnswers[nodeProperty] === \"\") {\n this.propertyAnswers[nodeProperty] = string;\n }\n else {\n this.propertyAnswers[nodeProperty] += \"#\" + string;\n }\n }\n }\n }", "title": "" }, { "docid": "05613a06b0284c395bbe4f718a9a0554", "score": "0.47003317", "text": "function init() \n{\n choiceData = choices.choices; //Initialize JSON of possible choices\n // Gets the length of data from the JSON object\n dataLength = Object.keys(choiceData).length;\n\t//calls createSelectElement with \"Main\" key from JSON Array\n createSelectElement(\"Main\");\t\n\t//creates a selection drop down with a supplied key from JSON array\n function createSelectElement(dataKey){\t\n\t\n for (var i = 0; i < dataLength; i++){\n // If choice does not match key, skip this data point \n if (choiceData[i].key != dataKey){ \n\t\t\tcontinue;\t\t\t\t\n\t\t\n\t\t\t}//If choice is an endPoint\n\t\t\telse if(choiceData[i].endPoint == true){\n\t\t\t\t\n\t\t\t\t//add choice property to propertys array\n\t\t\t\tpropertys[choiceData[i].depth] = choiceData[i].property;\n\t\t\t\t//add choice selection to selections array\n\t\t\t\tselections[choiceData[i].depth] = dataKey;\n\t\t\t\t\n\t\t\t\t//for each choice selection add a <p> that displays users choice selections and their propertys\n\t\t\t\tfor(var k = 1; k < selections.length; k++){\n\t\t\t\t\tvar para = document.createElement(\"p\");\t\n\t\t\t\t\ttextNode = document.createTextNode(\"You Selected \" + selections[k] + \" as your \" + propertys[k]);\n\t\t\t\t\tpara.appendChild(textNode);\n\t\t\t\t\tresultDiv.appendChild(para);\n\t\t\t\t}\t\n\t\t\t\t//create a <h2> that displays the endPoints resultText and add it to resultDiv\n\t\t\t\tvar textNode = document.createTextNode(choiceData[i].result);\n\t\t\t\tvar result = document.createElement(\"h2\");\t\n\t\t\t\tresult.appendChild(textNode);\n\t\t\t\tresultDiv.appendChild(result);\n\t\t\t\t\n\t\t\t\t//create <img> element that will contain results image and add it to resultDiv\n\t\t\t\tvar img = document.createElement(\"img\");\n\t\t\t\timg.src = choiceData[i].imageSrc;\n\t\t\t\tresultDiv.appendChild(img);\n\t\t\t\tresultDivWrap.className = \"sample-wrapper\";\n\t\t\t}//else continue creating selection drop downs\n\t\t\telse\n\t\t\t{\t//if the choice is not the \"Main\" key\n\t\t\t\tif(choiceData[i] != 0)\n\t\t\t\t{\n\t\t\t\t\t//add choice property to propertys array\n\t\t\t\t\tpropertys[choiceData[i].depth] = choiceData[i].property;\n\t\t\t\t\t//add choice selection to selections array\n\t\t\t\t\tselections[choiceData[i].depth] = dataKey;\n\t\t\t\t}\n\t\t\t\t// Creates a header to label the specific select menu\n\t\t\t\tvar h2 = document.createElement('h2');\n\t\t\t\tvar textNode = document.createTextNode(choiceData[i].description);\n\t\t\t\th2.className = choiceData[i].depth;\n\t\t\t\th2.appendChild(textNode);\n\t\t\t\tselectDiv.appendChild(h2);\n\n\t\t\t\t// Creates the select list element\n\t\t\t\tvar selectList = document.createElement('select');\n\t\t\t\tselectList.id = choiceData[i].key;\n\t\t\t\tselectList.name = choiceData[i].description;\n\t\t\t\tselectList.className = choiceData[i].depth;\n\t\t\t\tselectDiv.appendChild(selectList);\n\n\t\t\t\t// Creates null Select option\n\t\t\t\tvar nullOption = document.createElement('option');\n\t\t\t\tnullOption.text = \"Select an Option\";\n\t\t\t\tnullOption.selected = this;\n\t\t\t\tnullOption.disabled = true;\n\t\t\t\tselectList.appendChild(nullOption);\n\t\t\t\t\n\t\t\t\t//initialize key and value data for choice selection\n\t\t\t\tvar values = Object.values(choiceData[i]);\n\t\t\t\tvar keys = Object.keys(choiceData[i]);\n\t\t\t\tvar oLength = Object.keys(choiceData[i]).length;\n\t\t\t\n\t\t\t\t//for each key-value pair in choice selection\n\t\t\t\tfor (var j = 0; j < oLength; j++)\n\t\t\t\t{\t\n\t\t\t\t\t//if the key-value pair is an \"option\"\n\t\t\t\t\tif(keys[j] != \"key\" && keys[j] != \"description\" && keys[j] != \"property\" && keys[j] != \"depth\" && keys[j] != \"endPoint\")\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//add the option to the selection dropdown\n\t\t\t\t\t\tcreateOption(values[j],selectList);\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// Hooks up an event to reload the choices whenever the select value is changed\n\t\t\t\tselectList.onchange = reloadSelect;\n\t\t\t}\n }\n }\n\t//creates and adds an option to the current selectList\n\tfunction createOption(value,selectList)\n\t{\n\t\tvar newOption = document.createElement('option');\n\t\tnewOption.value = value;\n\t\tnewOption.text = value;\n\t\tselectList.appendChild(newOption);\n\t}\n // Re-creates the select elements based on previous choice\n // Accessing the element: this\n // The value of \"this\" inside a handler is the element. The one which has the handler on it.\n function reloadSelect() {\n console.log(this);\n console.log(\"this.className: \" + this.className);\n console.log(\"this.value: \" + this.value);\n\t\t\n\t\tclearResult();\n\t\tresultDivWrap.className = \"\";\n // removes any elements if necessary\n removeElements(this.className);\n\n // creates new select elements\n createSelectElement(this.value);\n\n // assigns the most recent selection value\n recentSelection = this;\n\t\t\n };\n // Removes all child elements from the select div\n function clearSelect() {\n\n // Checks if a firstChild exists, if so, remove that child\n while (selectDiv.firstChild) {\n selectDiv.removeChild(selectDiv.firstChild);\n }\n };\n\tfunction clearResult() {\n\n // Checks if a firstChild exists, if so, remove that child\n while (resultDiv.firstChild) {\n resultDiv.removeChild(resultDiv.firstChild);\n }\n };\n // Removes elements based on the depth of the question\n function removeElements(elementDepth) {\n\n // gets the current depth from the parameter\n var currentDepth = parseInt(elementDepth);\n\t\tconsole.log(\"DEPTH:\" + elementDepth);\n // Loops through any elements that have a depth deeper than the previously changed select option\n for (var i = 4; i > currentDepth; i--) {\n\n // Gets all elements of a given depth\n var elementsToDelete = document.getElementsByClassName(i);\n\n // Deletes all elements that are the targeted depth\n while (elementsToDelete.length > 0) {\n elementsToDelete[0].parentNode.removeChild(elementsToDelete[0]);\n }\n }\n };\n}", "title": "" }, { "docid": "51b6453c71345257bf35f8f24fd2e6be", "score": "0.46989784", "text": "_generateStrategy() {\n if (this.group.order == 1) {\n this.nodes.push(new Diagram3D.Node(0)); // just draw a single node\n return;\n }\n if (this.group.order == 2) {\n this.setStrategies([[1, 0, 1, 0]]);\n return;\n }\n\n const element_orders = this.group.elementOrders;\n const generators /*: Array<groupElement> */ = this.group.generators[0];\n const ordered_gens = generators.slice().sort( (a,b) => element_orders[b] - element_orders[a] );\n switch (generators.length) {\n case 1:\n this.setStrategies([[generators[0], 1, 2, 0]]); // cyclic group\n break;\n case 2:\n // does the first ordered_gen (generator with largest element order) have order |G|/2?\n // make sure group is big enough -- can't do a circle with only 2 elements\n if (element_orders[ordered_gens[0]] == this.group.order/2 && this.group.order > 4) {\n if (element_orders[ordered_gens[1]] == 2) {\n this.setStrategies([[ordered_gens[1], 0, 0, 0],\n [ordered_gens[0], 2, 2, 1]]); // see D_4\n } else {\n this.setStrategies([[ordered_gens[1], 1, 2, 0],\n [ordered_gens[0], 0, 2, 1]]); // see Q_4\n }\n } else {\n // put greatest # elements in X direction (remember that the 2nd generator will generate\n // all the elements in the group the first one doesn't)\n const first_gen_order = element_orders[ordered_gens[0]];\n const first_gen_dir = (first_gen_order >= this.group.order/first_gen_order) ? 0 : 1;\n this.setStrategies([[ordered_gens[0], 0, first_gen_dir, 0],\n [ordered_gens[1], 0, ((1-first_gen_dir /*: any */) /*: direction */), 1]]); // see S_4\n }\n break;\n case 3:\n this.setStrategies([[generators[0], 0, 0, 0],\n [generators[1], 0, 1, 1],\n [generators[2], 0, 2, 2]]);\n break;\n case 4:\n this.setStrategies([[ordered_gens[0], 0, 0, 0],\n [ordered_gens[1], 0, 0, 1],\n [ordered_gens[2], 0, 1, 2],\n [ordered_gens[3], 0, 2, 3]]);\n break;\n }\n this.emitStateChange();\n }", "title": "" }, { "docid": "7e1ae811d86eb2bb842b45a7010e03d9", "score": "0.46952662", "text": "function add_edge_modal(ecore, manager, relations, aid, source_id, target_id){\n\n // Get a sorted list of known rels.\n var rellist = sorted_relation_list(relations, aid);\n \n // Preamble.\n var mebe = [\n\t// '<h4>Relation selection</h4>',\n\t'<b>Edge source:</b>',\n\tsource_id,\n\t'<br />',\n\t'<b>Edge target:</b>',\n\ttarget_id\n ];\n\n // Randomized radio.\n var radio_name = bbop_core.uuid();\n\n // Hard-code tree from\n // https://github.com/geneontology/noctua/issues/165 as temporary\n // relief.\n function _fuse(rel_name, rel_id, radio_name, lvl, first_p){\n\n\t// Main.\n\tvar str = '<label style=\"margin-bottom: 0px; font-weight: initial; font-size: initial;\"><input type=\"radio\" name=\"' +\n\t radio_name + '\" value=\"' + rel_id +'\"';\n\tif( first_p ){\n\t str += ' checked=\"checked\" />';\n\t}else{\n\t str += ' />';\n\t}\n\tstr += '&nbsp;' + rel_name + ' (' + rel_id + ')</label>';\n\n\tvar total = 5;\n\n\t// Front table buffer.\n\t(function(){\n\t var bffr = [];\n\t for( var i = 0; i < lvl; i++ ){\n\t\tbffr.push('&nbsp;&nbsp;&nbsp;');\n\t }\n\t str = bffr.join('') + str;\n\t})();\n\n\t// // Back table buffer.\n\t// (function(){\n\t// var bffr = [];\n\t// for( var i = lvl; i < total; i++ ){\n\t// \tbffr.push('<td></td>');\n\t// }\n\t// str = str + bffr.join('');\n\t// })();\n\n\treturn '<div>' + str + '</div>';\n }\n \n // \n var str_tree = [\n\t'<div style=\"padding-left: 5px; border-left: 0px solid gray; margin-bottom: 1em;\">',\n\t'<div><em>Common relations</em></div>',\n\t_fuse('enabled by', 'RO:0002333', radio_name, 0, true),\n\t_fuse('occurs in', 'BFO:0000066', radio_name, 0),\n\t_fuse('part of', 'BFO:0000050', radio_name, 0),\n\t_fuse('causally upstream of or within', 'RO:0002418', radio_name, 0),\n\t_fuse('causally upstream of', 'RO:0002411', radio_name, 1),\n\t_fuse('causally upstream of, positive effect', 'RO:0002304', radio_name, 2),\n\t_fuse('causally upstream of, negative effect', 'RO:0002305', radio_name, 2),\n\t_fuse('immediately causally upstream of', 'RO:0002412', radio_name, 2),\n\t_fuse('directly provides input for', 'RO:0002413', radio_name, 3),\n\t_fuse('regulates', 'RO:0002211', radio_name, 2),\n\t_fuse('negatively regulates', 'RO:0002212', radio_name, 3),\n\t_fuse('directly negatively regulates', 'RO:0002630', radio_name, 4),\n\t_fuse('positively regulates', 'RO:0002213', radio_name, 3),\n\t_fuse('directly positively regulates', 'RO:0002629', radio_name, 4),\n\t_fuse('has participant', 'RO:0000057', radio_name, 0),\n\t_fuse('has input', 'RO:0002233', radio_name, 1),\n\t_fuse('has output', 'RO:0002234', radio_name, 1),\n\t_fuse('transports or maintains localization of', 'RO:0002313', radio_name, 1),\n\t'</div>'\n ];\n\n // List.\n var tcache = [\n\tmebe.join(' '),\n\t'<div style=\"height: 25em; overflow-y: scroll; margin-top: 5px;\">',\n\tstr_tree.join(' '),\n\t'<div class=\"well\">',\n\t'<div><em>All relations</em></div>'\n ];\n each(rellist, function(tmp_rel, rel_ind){\n\ttcache.push('<div class=\"radio\"><label>');\n\ttcache.push('<input type=\"radio\" ');\n\ttcache.push('name=\"' + radio_name + '\" ');\n\ttcache.push('value=\"' + tmp_rel[0] +'\"');\n\t// if( rel_ind === 0 ){\n\t// tcache.push('checked>');\n\t// }else{\n\t tcache.push('>');\n\t// }\n\ttcache.push(tmp_rel[1] + ' ');\n\ttcache.push('(' + tmp_rel[0] + ')');\n\ttcache.push('</label></div>');\t \n });\n tcache.push('</div>');\n tcache.push('</div>');\n \n var save_btn_args = {\n\t'generate_id': true,\n\t'type': 'button',\n\t'class': 'btn btn-primary'\n };\n var save_btn = new bbop.html.tag('button', save_btn_args, 'Save');\n\n // Setup base modal.\n var mdl = new contained_modal('dialog', 'Add Relation');\n mdl.add_to_body(tcache.join(''));\n mdl.add_to_footer(save_btn.to_string());\n\n // Add action listener to the save button.\n function _rel_save_button_start(){\n\n\t//\n\t//ll('looks like edge (in cb): ' + eeid);\n\tvar qstr ='input:radio[name=' + radio_name + ']:checked';\n\tvar rval = jQuery(qstr).val();\n\t// ll('rval: ' + rval);\n\t\n\t// // TODO: Should I report this too? Smells a\n\t// // bit like the missing properties with\n\t// // setParameter/s(),\n\t// // Change label.\n\t// //conn.setLabel(rval); // does not work!?\n\t// conn.removeOverlay(\"label\");\n\t// conn.addOverlay([\"Label\", {'label': rval,\n\t// \t\t\t 'location': 0.5,\n\t// \t\t\t 'cssClass': \"aLabel\",\n\t// \t\t\t 'id': 'label' } ]);\n\n\t// Kick off callback.\t\n\tmanager.add_fact(ecore.get_id(), source_id, target_id, rval);\n\n\t// Close modal.\n\tmdl.destroy();\n }\n // And add the new one for this instance.\n jQuery('#' + save_btn.get_id()).click(function(evt){\n\tevt.stopPropagation();\n\t_rel_save_button_start();\n });\n \n // Return our final product.\n return mdl;\n}", "title": "" }, { "docid": "d58432a37b42e10975b0f49451c51a42", "score": "0.46892384", "text": "function MenuOptionState(stateMachine, selectionOptions, selectionLeadStates){\n var currentOption = 0;\n var textGraphics = [];\n var textSpacing = 120;\n var fontSize = 40; \n //TODO\n //Replace this with a function that will actually center the stuff based on the size\n var textXOffset = 100;\n var textYOffset = canvas.height-canvas.height/6\n this.name = \"menuOptionState\";\n this.onEnter = function(){\n for(i = 0; i < selectionOptions.length; i++){\n textGraphics[i] = new createjs.Text(selectionOptions[i], \"bold \"+fontSize+\"px Calibri\", \"white\");\n textGraphics[i].x = (textSpacing*i)+textXOffset;\n textGraphics[i].y = textYOffset;\n renderList.addChild(textGraphics[i]); \n }\n }\n\n this.onExit = function(){\n for(i = 0; i < textGraphics.length; i++){\n renderList.removeChild(textGraphics[i]); \n }\n }\n\n this.update = function(){\n\n Mousetrap.bind(\"z\", function(){\n stateMachine.changeState(selectionLeadStates[currentOption]);\n });\n\n Mousetrap.bind('right', function()\n { \n currentOption++;\n });\n\n Mousetrap.bind('left', function()\n { \n currentOption--;\n });\n\n if(currentOption>textGraphics.length-1){\n currentOption = 0;\n }else if(currentOption<0){\n currentOption = textGraphics.length-1;\n } \n\n selectionText.text = currentOption;\n for(i = 0; i < textGraphics.length; i++){\n if(i == currentOption){\n textGraphics[i].color = \"yellow\";\n }else{\n textGraphics[i].color = \"white\";\n }\n }\n }\n}", "title": "" }, { "docid": "872c59d4a4d0d89570278993687644cb", "score": "0.46833575", "text": "function newPuzzel() {\n var seperator = 1;\n \n switch (choseLevel) {\n case 0: seperator = 10;\n break;\n case 1: seperator = 30;\n break;\n case 2: seperator = 50;\n break;\n default:\n seperator += 5;\n break;\n }\n\n var operand1 = Math.floor(Math.random() * seperator) + 1;\n\n var operand2 = Math.floor(Math.random() * seperator) + 1;\n\n var operand3 = Math.floor(Math.random() * seperator);\n var operand4 = Math.floor(Math.random() * seperator);\n var operand5 = Math.floor(Math.random() * seperator);\n var operatorSelected;\n\n //new operator for every new equation\n var operator = Math.floor(Math.random() * 3);\n equationResult = 0;\n switch (operator) {\n case 0: equationResult = parseInt(operand1) + parseInt(operand2);\n operatorSelected = \"+\";\n break;\n case 1: equationResult = parseInt(operand1) - parseInt(operand2);\n operatorSelected = \"-\";\n break;\n case 2: equationResult = parseInt(operand1) * parseInt(operand2);\n operatorSelected = \"*\";\n break;\n }\n //randomly assigning Result to one of the option\n var assignResult = Math.floor(Math.random() * 4);\n switch (assignResult) {\n case 0: document.getElementById(\"optionResultbtn1\").innerText = equationResult;\n //Assigning random values to rest of the buttons\n document.getElementById(\"optionResultbtn2\").innerText = operand3;\n document.getElementById(\"optionResultbtn3\").innerText = operand4;\n document.getElementById(\"optionResultbtn4\").innerText = operand5;\n break;\n case 1: document.getElementById(\"optionResultbtn2\").innerText = equationResult;\n //Assigning random values to rest of the buttons\n document.getElementById(\"optionResultbtn1\").innerText = operand3;\n document.getElementById(\"optionResultbtn3\").innerText = operand4;\n document.getElementById(\"optionResultbtn4\").innerText = operand5;\n break;\n case 2: document.getElementById(\"optionResultbtn3\").innerText = equationResult;\n //Assigning random values to rest of the buttons\n document.getElementById(\"optionResultbtn2\").innerText = operand3;\n document.getElementById(\"optionResultbtn1\").innerText = operand4;\n document.getElementById(\"optionResultbtn4\").innerText = operand5;\n break;\n case 3:\n document.getElementById(\"optionResultbtn4\").innerText = equationResult;\n //Assigning random values to rest of the buttons\n document.getElementById(\"optionResultbtn2\").innerText = operand3;\n document.getElementById(\"optionResultbtn3\").innerText = operand4;\n document.getElementById(\"optionResultbtn1\").innerText = operand5;\n break;\n }\n\n // set the display values of opeands,operator and one of the option btn\n document.getElementById(\"operand1valueLabel\").innerText = operand1;\n document.getElementById(\"operand1valueLabe2\").innerText = operand2;\n document.getElementById(\"operatorValueLabel\").innerHTML = operatorSelected;\n document.getElementById(\"displayResultLabel\").innerText = \"?\";\n\n\n}", "title": "" }, { "docid": "ca6ca369fdbe00f60f750759736a9c47", "score": "0.4682027", "text": "function generate() {\n\n radios.forEach(x => { x.textContent = \"radio_button_unchecked\";\n x.classList.remove(\"red\");\n x.classList.remove(\"green\");\n });\n\n const element = configuration.services[index];\n\n let originalName = element[\"originalName\"];\n let nOntology = element[\"nOntology\"];\n\n h3.textContent = \"Generating elements for \" + originalName;\n\n index++;\n\n if (element[\"widoco\"]) {\n widoco(originalName, nOntology, element);\n }\n\n else if (element[\"oops\"]) {\n oops(originalName, nOntology, element);\n\n }\n\n else if (element[\"themis\"]) {\n themis(originalName, nOntology, element);\n\n }\n\n else if (element[\"astrea\"]) {\n astrea(originalName, nOntology, element);\n\n }\n\n}", "title": "" }, { "docid": "c3129c9a4f37a79691b241ca1f504e21", "score": "0.46791673", "text": "function initTags(c,a){\n let elem;\n let tags = document.getElementById(\"tags\");\n let tagX = (tags.getBoundingClientRect().left)/1.5;//initial left position\n let tagY = tags.getBoundingClientRect().top; //initial top possition\n let tagXinit = tagX; //inital placement the first tag\n let tagYinit = tagY;//inital placement the first tag\n let i = 1;\n for (z of cousine){ //loop for coursine tags\n elem = document.createElement(\"div\");\n elem.classList.add(\"tag\");\n elem.classList.add(\"btn\");\n elem.classList.add(\"choices\")\n elem.id = z;\n elem.style.left=tagX+10+\"px\";\n elem.style.top=tagY+\"px\";\n elem.setAttribute(\"value\",z);\n elem.style.zIndex=\"10\";\n elem.innerHTML = z;\n addListeners(elem);\n tags.appendChild(elem);\n tagX = tagXinit + 100*(i%3); //placemnet of the current tag- restarts the offset of the \"left\" property each 3 tags\n tagY=tagYinit+100*Math.floor(i/3); //placement of the current tag - incriment the offset of the \"top\" property every 3 tags\n i++;\n }\n tagY=tagYinit+100*Math.floor(i/3);\n tagX = tagXinit;\n for (z of ambiance){\n elem = document.createElement(\"div\");\n elem.classList.add(\"tag\");\n elem.classList.add(\"btn\");\n elem.classList.add(\"choices\")\n elem.id = z;\n elem.style.left=tagX+10+\"px\";\n elem.style.top=tagY+10+\"px\";\n elem.setAttribute(\"value\",z);\n elem.style.zIndex=\"10\";\n elem.innerHTML = z;\n addListeners(elem);\n tags.appendChild(elem);\n tagX = tagXinit + 100*(i%3);\n tagY=tagYinit+100*Math.floor(i/3);\n i++;\n }\n }", "title": "" }, { "docid": "df987a96a23132d2cef18ce7d238a7ad", "score": "0.46753505", "text": "function Node(name, config) {\n config = _.extend({}, config);\n \n this.config = config;\n this.name = name;\n this.description = config.description;\n this.options = {};\n this.optionGroups = {};\n this.parent = null;\n this.plugins = [];\n this.version = config.version;\n this.epilog = config.epilog;\n \n _.forEach(config.options, _.bind(_.rearg(this.addOption, 1, 0), this));\n _.forEach(config.optionGroups, _.bind(_.rearg(this.addOptionGroup, 1, 0), this));\n _.forEach(config.plugins, _.bind(this.addPlugin, this));\n}", "title": "" }, { "docid": "eda1a463044bbb497b93143c29b8710b", "score": "0.46689752", "text": "function setNodeDataAndEnterAndExitSettings(){\n\t\t\tnode.data(nodes);\n\t\t\texitNode();\t\t\t\n\t\t\tenterNode();\n\n\t\t\tlabel.data(nodes);\n\t\t\texitLabel();\t\t\t\n\t\t\tenterLabel();\n\n\t\t\tcorrelationLabel.data(links);\n\t\t\texitCorrelationLabel();\n\t\t\tenterCorrelationLabel();\n\n\t\t\tlink.data(links);\n\t\t\texitLink();\t\t\t\n\t\t\tenterLink();\n\t\t}", "title": "" }, { "docid": "5760bb84bc2bce0335a002e4f2a7a370", "score": "0.46673128", "text": "function values2Node(name, title, time, number, text, post_status) {\n\t/* Define color and margin values. Depends on post status \n\t Replies has margin-left and has bootstrap 'info' color. Topics has 'primary' */\n\tif (post_status == 'topic') {\n\t\tcolor = 'primary'\n\t\tmargin = ' mt-4'\n\t\t// HTML content of Peply|Hide buttons. There is button only on topic posts, on replies there no\n\t\tbuttonNode = '<div class=\"btn-group nav-item\"><button type=\"button\" class=\"btn btn-primary text-light\" onclick=\"openReplyForm(this)\">Reply</button><button type=\"button\" class=\"btn btn-primary text-light reply-button\" onclick=\"checkForHide(this)\">Hide</button></div>'\n\t}\n\telse {\n\t\tcolor = 'info'\n\t\tmargin = ' ml-3 mt-1'\n\t\tbuttonNode = ''\n\t}\n\t// We put values into HTML content string and get node, that could be included into DOM\n\tstringNode = '<div class=\"bg-light border border-' + color + ' rounded' + margin + ' post\"><div class=\"clearfix border-bottom border-' + color + ' post-header\"><nav class=\"navbar navbar-expand p-0 pl-2\"><span class=\"navbar-text mr-2 mb-0\"><h4 class=\"m-0\">' + name + '</h4></span><span class=\"navbar-text mr-2 mb-0 border-left border-' + color +' pl-2\"><h4 class=\"m-0\">' + time +'</h4></span><span class=\"navbar-text mr-2 mb-0 border-left border-primary pl-2 d-none\"><h4 class=\"m-0 post-id\">' + number +'</h4></span>' + buttonNode + '</nav></div><div class=\"post-body\"><h1 class=\"px-2\">' + title + '</h1><h4 class=\"px-2\">' + text + '</h4></div></div>'\n\treturn stringNode\n}", "title": "" }, { "docid": "76285843bfe19df5864375865ccceab9", "score": "0.46659103", "text": "function wortel_optellen_createOneQuestion(level){\n\tvar question ={\n\t\t\ta: 0,\n\t\t\tb: 0,\n\t\t\tc: 0,\n\t\t\td: 0,\n\t\t\tx1: 0,\n\t\t\tx2: 0\n\t}\n\tvar rangeForNumber;\n\tvar rangeX1;\n\tvar rangeX2;\n\t\n\tif(level == 1){\n\t\trangeForNumber = {min:-6,max: 6};\n\t\trangeX1 = {min:1,max: 10};\n\t\trangeX2 = {min:2,max: 10};\n\t}\n\telse if(level == 2){\n\t\trangeForNumber = {min:-16,max:20};\n\t\trangeX1 = {min:1,max: 15};\n\t\trangeX2 = {min:2,max: 10};\n\t}\n\telse if(level == 3){\n\t\trangeForNumber = {min:-16,max:40};\n\t\trangeX1 = {min:1,max: 20};\n\t\trangeX2 = {min:2,max: 15};\n\t}\n\t\n\twhile(question.a === 0 && question.b ===0){\n\t\tquestion.a = createRandom(rangeForNumber.min, rangeForNumber.max);\n\t\tquestion.b = createRandom(rangeForNumber.min, rangeForNumber.max);\n\t}\n\twhile(question.c === 0 && question.d ===0){\n\t\tquestion.c = createRandom(rangeForNumber.min, rangeForNumber.max);\n\t\tquestion.d = createRandom(rangeForNumber.min, rangeForNumber.max);\n\t}\n\tquestion.x1= createRandom(rangeX1.min, rangeX1.max);\n\tquestion.x2= createRandom(rangeX2.min, rangeX2.max);\n\treturn question;\n}", "title": "" }, { "docid": "aa3459e260059015dd4fedd5eb930188", "score": "0.4663981", "text": "function QuestionNode(question, yeschild, nochild) {\n this.Q = question;\n console.assert(yeschild instanceof QuestionNode || typeof yeschild == 'string');\n console.assert(nochild instanceof QuestionNode || typeof nochild == 'string');\n this.Y = yeschild;\n this.N = nochild;\n}", "title": "" }, { "docid": "214e5018dc9f8e97d74b5a21425226fd", "score": "0.46639368", "text": "function generateQuestion() {\n questionTitle.textContent = questions[qIndex].question;\n optionBtn1.textContent = questions[qIndex].options[0];\n optionBtn2.textContent = questions[qIndex].options[1];\n optionBtn3.textContent = questions[qIndex].options[2];\n optionBtn4.textContent = questions[qIndex].options[3];\n}", "title": "" } ]
b1a9bec4d083d53bba3300e2aa8f5ed0
generate food at random
[ { "docid": "613817447fc7d6f168b8bdc0b193f571", "score": "0.74336565", "text": "function generateFood(){\n var flag = false;\n var foodX = Math.ceil(Math.random()*39);\n var foodY = Math.ceil(Math.random()*39);\n for(var i = 0; i < snake.length; i++){\n if(foodX == snake[i].x && foodY == snake[i].y){\n generateFood();\n flag = true;\n }\n }\n if(!flag)\n food = new Food(foodX,foodY);\n}", "title": "" } ]
[ { "docid": "3c1bcb58a1f1ef282daee1de7664b6dc", "score": "0.80855787", "text": "function generateFood() {\n var x = getRandomNumber(\"x\");\n var y = getRandomNumber(\"y\");\n while (foodOnSnake(x, y)) {\n x = getRandomNumber(\"x\");\n y = getRandomNumber(\"y\");\n }\n var food = { position: [x, y] }\n return food;\n }", "title": "" }, { "docid": "75e2ea388283bd7872b44fcda0f8b96a", "score": "0.79609656", "text": "function getRandomFood() {\n return food = {\n x: rand(0, maxX),\n y: rand(0, maxY),\n r: 20,\n color: {\n r: rand(0, 255),\n g: rand(0, 255),\n b: rand(0, 255)\n }\n };\n}", "title": "" }, { "docid": "c9e57094624826a02ded65b028ef651a", "score": "0.7877087", "text": "function get_food(){\n ax= (Math.floor(Math.random()*24))*20;\n ay= (Math.floor(Math.random()*24))*20;\n long++;\n punt++;\n}", "title": "" }, { "docid": "765155f1d79b04888c58252066c4e66e", "score": "0.78411293", "text": "function randomFoodGenerator(){\n var r1 = Math.floor(Math.random() * 19);\n var c1 = Math.floor(Math.random() * 29);\n $('#cell_'+r1+'_'+c1).addClass('food');\n food = '' + r1 + '_' + c1;\n speed-=3; \n}", "title": "" }, { "docid": "5c7057202434246b7b54155d590628e2", "score": "0.7741197", "text": "function randomFood () {\n let randomIndex =Math.floor( Math.random() * favoriteFoods.length);\n console.log(favoriteFoods[randomIndex]);\n}", "title": "" }, { "docid": "481576363c085572863fd1de312c2554", "score": "0.76179415", "text": "function generateFood() \n{\n return {\n x: Math.floor(Math.random() * 17 + 1) * unit,\n y: Math.floor(Math.random() * 15 + 3) * unit\n };\n}", "title": "" }, { "docid": "6243277bf6f08ca81be9ff5f1b6ab4a5", "score": "0.7609554", "text": "function generateFood() {\n foodX = generateFoodRandom(pixelSize, gameBoard.width - (pixelSize * 2));\n foodY = generateFoodRandom(pixelSize, gameBoard.width - (pixelSize * 2));\n snake.forEach(function hasSnakeEaten(part) {\n let snakeEaten = part.x == foodX && part.y == foodY;\n if (snakeEaten) generateFood();\n });\n }", "title": "" }, { "docid": "6a2e2720b29e9753495a30d900425c3e", "score": "0.7570233", "text": "function makeFood(map){\r\n //make a random x coordination depending on map length so map dimensions can be easily changed\r\n var x = Math.round(Math.random()*(map.length-1));\r\n var y = Math.round(Math.random()*(map.length-1));\r\n \r\n //if map value in xy coords is equal to 1 then repeat until it is not\r\n while(map[x][y] == 1){\r\n x = Math.round(Math.random()*(map.length-1));\r\n y = Math.round(Math.random()*(map.length-1));\r\n }\r\n //add value 2 to map[x][y], so basically add food\r\n map[x][y] = 2;\r\n return map;\r\n }", "title": "" }, { "docid": "f978d139b2bf7e926e09c5b0c812e60d", "score": "0.75549006", "text": "function getfood(){\n var randomfood = Math.floor((Math.random() * foodarr.length) + 0);\n return foodarr[randomfood];\n}", "title": "" }, { "docid": "e03e69126c593a1ea00c431516765c3e", "score": "0.7539984", "text": "function randomFood() {\n\n foodRec = restaurants[Math.floor(Math.random() * restaurants.length)];\n //and calls the function that display it to the screen\n displayFood();\n}", "title": "" }, { "docid": "4262bf7b52dd6af3d7b7e868fe334ca1", "score": "0.74958605", "text": "function makeMeal() {\n const numItems = 2 + Math.floor((Math.random() * 5)); //Determine how many food items\n const meal = [];\n for (let i = 0; i < numItems; i++) {\n const itemID = Math.floor(Math.random() * foodsList.length);\n const servings = Math.floor(Math.random() * 4) + 1;\n meal.push({\n foodID: itemID,\n servings\n });\n }\n return meal;\n}", "title": "" }, { "docid": "f742e7e68b768b4a5d573367b082cf92", "score": "0.74882823", "text": "function getfood(){\n var randomfood = Math.floor((Math.random() * foodarr.length));\n return foodarr[randomfood];\n}", "title": "" }, { "docid": "ad32edb60adabceed4070bb4797490df", "score": "0.747516", "text": "function getRandomFood(){\n\n var foodX = Math.floor(Math.random()*(W-cellSize)/cellSize);\n var foodY = Math.floor(Math.random()*(H-cellSize)/cellSize);\n\n // food object\n\n var food = {\n x:foodX,\n y:foodY,\n color:\"red\"\n };\n\n return food;\n}", "title": "" }, { "docid": "918f96b37c62261d09658ffa3b01e684", "score": "0.74731416", "text": "function generateFood(){\n var food_x = Math.floor(Math.random()*map_column_length);\n var food_y = Math.floor(Math.random()*map_row_length);\n\n for(let i = 0; i<snake.length; i++){\n if(snake[i].x==food_x&&snake[i].y==food_y){\n generateFood();\n }\n }\n food = {x:food_x, y:food_y};\n setNewFoodColor();\n\n}", "title": "" }, { "docid": "ab7c8ff2b81f1b411c1909e19804f9da", "score": "0.741491", "text": "function getRandomFood() {\n var foodX = Math.round(Math.random()*(W-cs)/cs);\n var foodY = Math.round(Math.random()*(H-cs)/cs);\n\n //json object for random food coordinate\n var food = {\n x: foodX,\n y: foodY,\n color: \"red\",\n }\n return food;\n}", "title": "" }, { "docid": "093a11b6baca23e0f2f6f6bf41b79c1e", "score": "0.7373541", "text": "function FoodOrPosionRandom() {\n\n var temp = Math.floor(Math.random() * 2) + 1;\n var Choice = (temp == 1) ? \"food-cell\" : \"poison-cell\";\n return temp;\n\n\n\n\n }", "title": "" }, { "docid": "840f42a4993a5d998b9e0b7fe9eb68c6", "score": "0.7357302", "text": "function create_food(){\r\n\t\tfood = {\r\n\t\t\tx:Math.round(Math.random()*(w-cw)/cw),\r\n\t\t\ty:Math.round(Math.random()*(h-cw)/cw)\r\n\t\t}\t\r\n\t}", "title": "" }, { "docid": "9bda38a9727ce26e24943da46036fe72", "score": "0.73548603", "text": "function createFood () {\n const x = Math.floor(Math.random() * WIDTH)\n const y = Math.floor(Math.random() * HEIGHT)\n if (matrix[y][x] === TYPE['empty']) {\n updateCoordinate(x, y, TYPE['food'])\n } else {\n createFood()\n }\n }", "title": "" }, { "docid": "47c68832a001fa75d2f68c71baf3ec4d", "score": "0.7329757", "text": "putFood() {\n let foodIdx;\n do {\n foodIdx = Math.trunc(Math.random() * this.idxMax);\n // console.log('food idx = ' + foodIdx)\n } while (this.getSquareTypeAt(foodIdx) !== Square.TYPE_EMPTY);\n\n this.makeSquare(foodIdx, Square.TYPE_FOOD);\n }", "title": "" }, { "docid": "b5964a4b5da32f58d8c9bef9356f6ece", "score": "0.73293376", "text": "function createFood() {\n\tdo {\n\tfood_x = Math.floor(Math.random() * (canvas_size + 1) / snake_size) * snake_size;\n\tfood_y = Math.floor(Math.random() * (canvas_size + 1) / snake_size) * snake_size;\n\tif (food_y === canvas_size) food_y = canvas_size - snake_size;\n\tif (food_x === canvas_size) food_x = canvas_size - snake_size;\n} while (failFood() === true);\n}", "title": "" }, { "docid": "131b0e9febb0a8b35ff47415cda7e5e8", "score": "0.73287463", "text": "function getRandomFood(){\r\n var foodX=Math.round(Math.random()*(W-cellSize)/cellSize);\r\n var foodY=Math.round(Math.random()*(H-cellSize)/cellSize);\r\n var food={\r\n x:foodX,\r\n y:foodY,\r\n }\r\n return food;\r\n}", "title": "" }, { "docid": "dfc4143639d9a0cae7f41bea469e5895", "score": "0.7320091", "text": "function loadFood(numFood){\n for(var i = 0; i < numFood; i++){\n var min = 1;\n //40 * 20 = 800\n var max = 39;\n var locX = (Math.floor(Math.random() * (max - min + 1) + min)) * 20;\n var locY = (Math.floor(Math.random() * (max - min + 1) + min)) * 20;\n var loc = createVector(locX, locY);\n var f = new Food(loc);\n food.push(f);\n }\n}", "title": "" }, { "docid": "285aaaf726f6e4fea80e061e8561e6e7", "score": "0.73180854", "text": "function generateBonusFood() {\n if (bonusFood) {\n bonusFoodX = generateFoodRandom(pixelSize, gameBoard.width - (pixelSize * 2));\n bonusFoodY = generateFoodRandom(pixelSize, gameBoard.width - (pixelSize * 2));\n snake.forEach(function hasBonusSnakeEaten(part) {\n let bonusSnakeEaten = part.x == bonusFoodX && part.y == bonusFoodX;\n if (bonusSnakeEaten) generateBonusFood();\n });\n } else {\n bonusFoodX = \"\";\n bonusFoodY = \"\";\n }\n }", "title": "" }, { "docid": "211ac1f552798bd3d73ffee819a4944e", "score": "0.7291293", "text": "function spawnFood(){\n // Find and choose empty position\n var index = emptyCells.splice(Math.floor(Math.random() * emptyCells.length), 1);\n\n // Create and position food\n\n arena.addObject(index, [OBJECT_TYPE.FOOD]);\n\n currentFood++;\n}", "title": "" }, { "docid": "72dd101a2aec5bd9c92dc859b778a116", "score": "0.7284208", "text": "function genrate_Food()\r\n\t{\t\t\t\r\n\t\tfood_Snake_Creation();\r\n\t\t//f=randomFI+'_'+randomFJ;\r\n\t\t$('#'+f).css(\"background\",\"red\");\r\n\t\r\n\t}", "title": "" }, { "docid": "871a599b97d0b1d3187930e8e0a86105", "score": "0.7236937", "text": "generateRandomMeal() {\n const appetizer = this.getRandomDishFromCourse('appetizers');\n const main = this.getRandomDishFromCourse('mains');\n const dessert = this.getRandomDishFromCourse('desserts');\n const price = appetizer.price + main.price + dessert.price;\n return `Your meal is ${appetizer.name}, ${main.name}, ${dessert.name}. The price is $${price}.`;\n }", "title": "" }, { "docid": "7f5dc1ea8cc66aa3498fe50f56d8b3e4", "score": "0.7222212", "text": "generateRandomMeal () {\n const appetizer = this.getRandomDishFromCourse('appetizers');\n const main = this.getRandomDishFromCourse('mains');\n const dessert = this.getRandomDishFromCourse('desserts');\n const totalPrice = appetizer.price + main.price + dessert.price;\n\n return 'The total price for ' + appetizer.name + ', ' + main.name + ', ' + dessert.name + ' is ' + totalPrice\n }", "title": "" }, { "docid": "0bb7fd47e5c2a6a172b2318851630e3b", "score": "0.720564", "text": "generateRandomMeal() {\n const appetizer = this.getRandomDishFromCourse('appetizers');\n const main = this.getRandomDishFromCourse('mains');\n const dessert = this.getRandomDishFromCourse('desserts');\n const totalPrice = appetizer.price + main.price + dessert.price;\n return `Appetizer: ${appetizer.name}\\n Main: ${main.name}\\n Dessert: ${dessert.name}\\n Total price: ${totalPrice}`;\n }", "title": "" }, { "docid": "1a44b77374b163a99023d9c2ae3f4a3b", "score": "0.7152406", "text": "function makeFoods() {\n const foods = [];\n for (let i = 0; i < foodsList.length; i++) {\n const calories = Math.floor(Math.random() * 100); //Ranodm calories between 0-100\n const name = foodsList[i]; //Pull name from Food list\n let carbs = Math.round(Math.random() * 100); // carbs as % of calories\n let pro = Math.round(Math.random() * (100 - carbs)); //see carbs\n let fats = 100 - carbs - pro; //see pro\n carbs = Math.round((calories * carbs) / 100 / 4), //converting to grams, 4kcal/1g\n fats = Math.round((calories * fats) / 100 / 9), //converting to grams 9kcal/1g\n pro = Math.round((calories * pro) / 100 / 4) //converting to grams, 4kcal/1g\n foods.push({\n id: i,\n name,\n calories,\n carbs,\n pro,\n fats,\n });\n }\n return foods;\n}", "title": "" }, { "docid": "54eb2b13c9648dade39f3e0352eefc75", "score": "0.71522707", "text": "function makeFood() {\n\n\t/// keep generating food until we get a food location that is not on snake's body\n\tvar food_on_snake = true;\n\twhile (food_on_snake === true) {\n\t\tfood_on_snake = false;\n\t\tvar food_x = Math.round(Math.random() * (canWdt - celldim) / celldim);\n\t\tvar food_y = Math.round(Math.random() * (canHt - celldim) / celldim);\n\n\t\tfor (let i = 0; i < snake.cells.length; i++) {\n\t\t\tif (snake.cells[i].x === food_x && snake.cells[i].y === food_y) {\n\t\t\t\tconsole.log(\"food on snake\");\n\t\t\t\tfood_on_snake = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar food = {\n\t\tx: food_x,\n\t\ty: food_y,\n\t\tcolor: \"red\"\n\t}\n\treturn food;\n}", "title": "" }, { "docid": "05af62d37e347c105ef0fa73196fe4e1", "score": "0.7127328", "text": "generateRandomMeal() {\n const appetizer = this.getRandomDishFromCourse(\"appetizers\");\n const main = this.getRandomDishFromCourse(\"mains\");\n const dessert = this.getRandomDishFromCourse(\"desserts\");\n const totalPrice = appetizer.price + main.price + dessert.price;\n\n return `Your meal is ${appetizer.name}, ${main.name} and ${\n dessert.name\n }. The price is GHS${totalPrice.toFixed(2)}.`;\n }", "title": "" }, { "docid": "dc9e62cabc8ba42d561364564fbd3717", "score": "0.7121756", "text": "generateRandomMeal(){\n const appetizer = this.getRandomDishFromCourse('appetizers');\n const main = this.getRandomDishFromCourse('mains');\n const dessert = this.getRandomDishFromCourse('desserts');\n const totalPrice = appetizer.price + main.price + dessert.price;\n return `The meals are ${appetizer.name} ${main.name} ${dessert.name}. And total price is ${totalPrice}.`;\n }", "title": "" }, { "docid": "27ac5434f77128f8004307c573926f61", "score": "0.7107041", "text": "function getFood(id) {\n let x = Math.floor((Math.random() * 49)) * 2;\n let y = Math.floor((Math.random() * 49)) * 2;\n return {\n id: id,\n x: x,\n y: y\n };\n }", "title": "" }, { "docid": "744d5eb3732f4b2d1b020d4f6bfeed72", "score": "0.71010387", "text": "generateRandomMeal() {\n const appetizer = this.getRandomDishFromCourse('appetizers');\n const main = this.getRandomDishFromCourse('mains');\n const dessert = this.getRandomDishFromCourse('desserts');\n const totalPrice = appetizer.price + main.price + dessert.price;\n \n return `Your meal is going to be ${appetizer.name}, ${main.name}, ${dessert.name} and the total price is ${totalPrice} euros.`;\n }", "title": "" }, { "docid": "a40d94ac71c5d054cd37da4e99e583b7", "score": "0.7005895", "text": "function generateFood()\n{\n let ret;\n //random type\n let seed = Math.floor( Math.random()*7 ) + 1;\n if( possibilityDrop && seed === 5 ) seed = 6;\n\n switch( seed )\n {\n case 1: case 2: case 5:\n ret = new AFood();\n break;\n case 3: case 4: case 7:\n ret = new BFood();\n break;\n case 6:\n ret = new CFood();\n break;\n default:\n console.log(\"Error: At generateFood()\");\n }\n\n //random position (do not appear on the snake or just in front of snake's head)\n let possiblePos = bRows * bCols - snake.length - Foods.length - 1;\n seed = Math.floor( Math.random() * possiblePos );\n\n let improperCol = snake.posHeadC, improperRow = snake.posHeadR;\n switch(snake.heading) {\n case \"up\": improperRow = (improperRow - 1 + bRows) % bRows; break;\n case \"down\": improperRow = (improperRow + 1) % bRows; break;\n case \"left\": improperCol = (improperCol - 1 +bCols) % bCols; break;\n case \"right\": improperCol = (improperCol + 1) % bCols; break;\n }\n\n let r = 0, c = 0;\n while( graph[r][c] !== 0 && (c !== improperCol || r !== improperRow) ) {\n c++;\n if( c >= bCols ) { r++; c = c % bCols; }\n }\n\n while( seed > 0 ){\n c++;\n if( c >= bCols ) { r++; c = c % bCols; }\n seed--;\n\n while( graph[r][c] !== 0 || (c === improperCol && r === improperRow) ) { //unacceptable conditions\n c++;\n if( c >= bCols ) { r++; c = c % bCols; }\n }\n }\n\n ret.row = r;\n ret.col = c;\n ret.appear();\n\n return ret;\n}", "title": "" }, { "docid": "dc3e4288785be41ddf64373c7c5d5023", "score": "0.6992401", "text": "function createNewFood() {\n let randX, randY;\n do {\n randX = Math.round(Math.floor(Math.random() * (canvas.width - size)) / 10) * 10;\n randY = Math.round(Math.floor(Math.random() * (canvas.height - size)) / 10) * 10;\n } while (snake.rects.some(rect => rect.x === randX && rect.y === randY));\n food = new Position(randX, randY);\n context.fillRect(randX, randY, size, size);\n}", "title": "" }, { "docid": "79c7dc3a06431d96ff177831b1385c2e", "score": "0.69787824", "text": "function RandomDish() {\n\twindow.name = \"\" + getRndInteger(0, RecipesArray.length - 1);\n}", "title": "" }, { "docid": "20afac5179aea12df040ff8f016fbe38", "score": "0.69565463", "text": "function pickFood (foodObjects) {\n var result = [];\n for (var i = 0; i < foodReturnCount; i++) {\n result.push(foodObjects[Math.floor(Math.random() * foodObjects.length)]);\n }\n return result;\n}", "title": "" }, { "docid": "90d4c403ecc21c646526cecd09c3a2b2", "score": "0.6956446", "text": "function generateFood() {\n food = []\n for (var i = 0; i < foodAmount; i++) {\n food.push(new Food(i));\n }\n}", "title": "" }, { "docid": "f6e6a042e8589e769d0d9b4ba17a9615", "score": "0.69408196", "text": "function makeFood() {\n setInterval(function(){\n if (foodArray.length < 6) {\n console.log(foodArray.length);\n new Food(randomNumber(400, 1), randomNumber(400, 1) ).newFood(foodArray);\n }\n },randomNumber(1000, 2000));\n}", "title": "" }, { "docid": "37d93201a512207a6ff1817fafc7e07d", "score": "0.693618", "text": "function randomWord() {\n return foods[Math.floor(Math.random() * foods.length)];\n}", "title": "" }, { "docid": "6bff13c815887474d7f4404f23cfe612", "score": "0.6918322", "text": "function Food() {\n\tthis.location = [];\n\tthis.color = getRandomColor();\n\n\tthis.createRandomFood();\n}", "title": "" }, { "docid": "4245db64dd29d316708db720256d7318", "score": "0.68906826", "text": "function rand() {\n return Math.floor(Math.random() * allProducts.length);\n // generate a random number between 0 and allProducts.length\n}", "title": "" }, { "docid": "c7ec3c4b9fd1a5c3ee013d9d884b3522", "score": "0.68809414", "text": "function getRF(){\r\n return \"img/\" + foods[Math.floor(Math.random() * foods.length)];\r\n}", "title": "" }, { "docid": "d5842652b98a9900aaa44e426767f68f", "score": "0.6837126", "text": "function getRandomMeal() {\n const mealsWithReviews = getReviews();\n const randomMeal =\n mealsWithReviews[Math.floor(Math.random() * mealsWithReviews.length)];\n return randomMeal;\n}", "title": "" }, { "docid": "b3ad28ff88b923eb5ad10677f4d8c20f", "score": "0.6834421", "text": "function createFood() {\n FOODX = randomTen(0, gameCanvas.width - 10);\n FOODY = randomTen(0, gameCanvas.height - 10);\n\n snake.forEach(function (snakePart) {\n const isFoodOnSnake = snakePart.x == FOODX || snakePart.y == FOODY;\n if (isFoodOnSnake) {\n createFood();\n }\n });\n}", "title": "" }, { "docid": "430cbe64e66fa30db323747c4602bae2", "score": "0.682675", "text": "function generateSheepgeddon(){\r\n var randNum = Math.floor(Math.random()*5)+5;\r\n for (var i = 0; i < randNum; i++){\r\n generateCollectibles();\r\n }\r\n}", "title": "" }, { "docid": "75905baf9ad75e95e9bff03f229819dd", "score": "0.68232524", "text": "function setfood(food){\n currentfood = food;\n document.getElementById(\"foodbox\").innerHTML = food;\n return currentfood[randomfood]\n}", "title": "" }, { "docid": "086135f997a9f2b012c82d2f8c995c05", "score": "0.6818912", "text": "function placeFoodStart() {\n\n // 10 times, generate a random x,y, place it in the food array.\n for (var count = 0; count < 2; count++) {\n var foodX = getRandomPositionX();\n var foodY = getRandomPositionY();\n food.push({x: foodX, y: foodY});\n createFood(food[count].x, food[count].y);\n //console.log(food[count].x)\n // console.log(food[count].y);\n }\n\n}", "title": "" }, { "docid": "1aca256e872155c14f9184d616268171", "score": "0.67885685", "text": "function getFeast(){\r\n\r\n var allfood = document.getElementsByClassName(\"food\");\r\n\r\n\r\n for( i = 0; i < allfood.length; i++){\r\n allfood[i].src = \"img/\" + foods[Math.floor(Math.random() *\r\n foods.length)];\r\n\r\n\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "ca90799fe49f0792cbf2c84d92130851", "score": "0.67682374", "text": "function pickFoodLocation() {\r\n\tvar cols = floor(width/(gridsize));\r\n\tvar rows = floor(height/(gridsize));\r\n\tfood = createVector(floor(random(cols)), floor(random(rows)));\r\n\tfood.mult(gridsize);\r\n}", "title": "" }, { "docid": "55a533ecd05b0e5c9d1f12e0d895dc21", "score": "0.6721814", "text": "function placeFood() {\n //put food at random coordinates\n var x, y;\n do {\n x = Math.random() * 45|0;\n y = Math.random() * 30|0;\n } while (board[x][y]);\n //mark the spot on the board\n board[x][y] = 1;\n //placing the food on the canvas\n ctx.fillRect(x * 10 + 1, y * 10 + 1, 10 - 2, 10 - 2);\n }", "title": "" }, { "docid": "01f3fec1c803356ecd05deef010edf20", "score": "0.67136157", "text": "function rndmOne() {\n rndmMEXCheese();\n rndmItlSauce();\n rndmItlStarch();\n rndmItlMeat();\n rndmItlVeg();\n}", "title": "" }, { "docid": "3f9bba47d5b978fdef4b13f28a568163", "score": "0.67080104", "text": "function create_food()\n {\n food = {\n x: Math.round(Math.random() * (w - 20) / cw),\n y: Math.round(Math.random() * (h - 20) / cw),\n };\n\n //This will create a cell with x/y between 0-44\n //Because there are 45(450/10) positions accross the rows and columns\n }", "title": "" }, { "docid": "a2727fcc30934b1a86126cca8e2ff394", "score": "0.67077124", "text": "function randomlyGenerateApple(){\n apple.x = getRandomInt(0, 15) * grid;\n apple.y = getRandomInt(0, 15) * grid;\n}", "title": "" }, { "docid": "a2727fcc30934b1a86126cca8e2ff394", "score": "0.67077124", "text": "function randomlyGenerateApple(){\n apple.x = getRandomInt(0, 15) * grid;\n apple.y = getRandomInt(0, 15) * grid;\n}", "title": "" }, { "docid": "a84e1719a75f17f932d9ff1031cd2c12", "score": "0.67036563", "text": "function Food(x,y,unit){\n this.xPos =x;\n this.yPos =y;\n this.size =unit;\n\n this.show = function(){\n fill(255,0,0);\n rect(this.xPos, this.yPos, this.size, this.size);\n }\n\n this.eaten = function( w, h){\n this.xPos = floor(random(0,w/this.size))*this.size;\n this.yPos = floor(random(0,h/this.size))*this.size;\n }\n}", "title": "" }, { "docid": "31af5d719f4fc8682ca8433286524101", "score": "0.67003465", "text": "function food_Snake_Creation()\r\n\t{\r\n\t\trandomFI =Math.floor(Math.random() * (+maxVal_Food - +minVal_Food)) + +minVal_Food; \r\n\t\trandomFJ =Math.floor(Math.random() * (+maxValue_Food - +minVal_Food)) + +minVal_Food;\r\n\t\t\t\t\r\n\t\tf=randomFI+'_'+randomFJ;\r\n\t\tfor(var i=0;i<arr_Dir.length;i++)\r\n\t\t{\r\n\t\t\tif(arr_Dir[i]==f)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tfood_Snake_Creation();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t}", "title": "" }, { "docid": "3ef9502027950fb22d9192f24e30de04", "score": "0.66910696", "text": "function createRandomProduct() {\n var typeArray = ['Electronics', 'Book', 'Clothing', 'Food'];\n var price = (Math.random() * 500).toFixed(2)\n var type = typeArray[Math.floor(Math.random() * 4)];\n\n return { price: price, type: type };\n }", "title": "" }, { "docid": "dd14686eb5bfc7d130491313137a1b6b", "score": "0.6687135", "text": "chooseRandomDish(num, menu) {\n let dish = [];\n let plates = Object.keys(menu);\n for (var i = 1; i <= num; i++) {\n let choice = plates[Math.floor(Math.random() * plates.length)];\n dish.push(menu[choice]);\n }\n return dish;\n }", "title": "" }, { "docid": "37460c1c52060f4c3e25a7969ac34abf", "score": "0.66843927", "text": "function generateDessert() {\n const name = [[\"Fondant au chocolat\",Fondantauchocolat,FondantauchocolatDis], [\"Crêpes\",Crepes,CrepesDis], [\"Mousse au chocolat\",Mousseauchocolat,MousseauchocolatDis], [\"Île flottante\",ileflottante,ileflottanteDis], [\"Tarte aux pommes\",Tarteauxpommes,TarteauxpommesDis], [\"Tiramisu\",Tiramisu,TiramisuDis], [\"Profiteroles\",Profiteroles,ProfiterolesDis],[\"Millefeuille\",Millefeuille,MillefeuilleDis],[\"Tarte aux fraises\",Tarteauxfraises,TarteauxfraisesDis]];\n const random = Math.floor(Math.random() * name.length);\n return name[random];\n\n}", "title": "" }, { "docid": "a9e9aaa7207b1d4f41bfaa1f0f0f6fe8", "score": "0.6673023", "text": "_eat(){\n this._body.push(this._body[this._body.length-1]);\n this._randomFood();\n }", "title": "" }, { "docid": "c7ee0241d6f33445ae8474fd35f88c41", "score": "0.66657877", "text": "function random(){\n\tfor(var i = 0; i < crystal.crystals.length; i++){\n\tcrystal.crystals[i] = crystal.randomNumber(1, 12);\n\t};\n\n}", "title": "" }, { "docid": "4233d80718b715b8726db7c832fd9e71", "score": "0.6661922", "text": "function createFood(board) {\n let row = 0;\n let column = 0;\n while ((board[row][column] === 1) || (board[row][column] === 2)) {\n row = Math.floor(Math.random() * (board.length - 1));\n column = Math.floor(Math.random() * (board[0].length - 1));\n }\n board[row][column] = 2;\n }", "title": "" }, { "docid": "587d2fc434801f6f137d573eb2a6e9e1", "score": "0.66590357", "text": "function dropLoot(){ // 75% chance of dropping weapon, 25% drop potion\n let num = randNum(100);\n if(num < 75){\n generateWeapon();\n lootDropped = true;\n }else{\n generatePotion();\n };\n}", "title": "" }, { "docid": "3455392d97403bc9494487cb15b7653e", "score": "0.6651072", "text": "function foodPosition(){\n var randomX = Math.random() * 800;\n locX = randomX - (randomX%20);\n var randomY = Math.random() * 800;\n locY = randomY - (randomY%20);\n}", "title": "" }, { "docid": "d73a23f6c6e87289f66773da393acd24", "score": "0.6645125", "text": "function generate_random_demo_shop() {\n var rng = random_1.Random.engines.mt19937().autoSeed();\n return create(rng);\n}", "title": "" }, { "docid": "e6014a3bfd1b571d827fef6b4bc466f9", "score": "0.66439766", "text": "function hunt(traveler){\n let food = getRandomIntInclusive(1, 100);\n if (food > 50){\n traveler.food = traveler.food + 100;\n }\n }", "title": "" }, { "docid": "ca85a1a3c41602c93e6b529910f911e5", "score": "0.6632411", "text": "function random () {\n return generator.random();\n}", "title": "" }, { "docid": "0b0b1ad988c6bd4f4216b9c24a079b02", "score": "0.66259825", "text": "_generateFood() {\n var freePos = this._getFreePos()\n this.food_x = freePos[0]\n this.food_y = freePos[1]\n this.map[this.food_x][this.food_y] = 2\n }", "title": "" }, { "docid": "e004f04c56d5a5bebaceb803abe34c31", "score": "0.66196465", "text": "function creatFood(){\n for(const index in foods){\n const food = foods[index];\n if(typeof food !== 'undefined'){\n food.drawFood();\n // VALIDA LA COLISION\n if(hit(food,snake.head)){\n snake.eat();\n removeFood(food);\n }\n }\n }\n }", "title": "" }, { "docid": "dcd866eff9e3424ec1db034da2654853", "score": "0.66180485", "text": "function drawNewFood(){\n food.x = Math.floor(Math.random()*40)*length_width;\n food.y = Math.floor(Math.random()*20)*length_width;\n ctx.fillStyle = \"#FF0000\";\n ctx.strokeStyle = \"#8B0000\";\n ctx.beginPath();\n ctx.fillRect(food.x,food.y,length_width,length_width);\n ctx.strokeRect(food.x,food.y,length_width,length_width);\n ctx.closePath();\n}", "title": "" }, { "docid": "3bed12f11ed5cf9d6782378d39fed5ea", "score": "0.6611477", "text": "function foodPositioning() {\n\n\tvar i,j;\n\n\tdo {\n\t\t i = Math.floor(Math.random() * (m - 2)) + 1;\n\t\t j = Math.floor(Math.random() * (n - 2)) + 1;\n\n\t} while (matrix[i][j].tint !== emptyField_color);\n\n\tmatrix[i][j].tint = food_color;\n\n}", "title": "" }, { "docid": "80fd06a3424cca2efabf66aab9f3e7e1", "score": "0.66086644", "text": "function food() {\n while (true) {\n randX = Math.floor(Math.random() * dx);\n randY = Math.floor(Math.random() * dy);\n if (matrix[randX][randY].v < snake.Tailcount) {\n matrix[randX][randY].f = true\n break;\n }\n }\n snake.Tailcount -= 1 //increases the size of the snake\n}", "title": "" }, { "docid": "606d3b359888e1a921191b5b9eaa5946", "score": "0.6607612", "text": "function getFeast(){\r\n var allfood = document.getElementsByClassName(\"food\");\r\n\r\n for( i = 0; i < allfood.length; i++){\r\n allfood[i].src = \"img/\" + foods[Math.floor(Math.random() * foods.length)];\r\n }\r\n}", "title": "" }, { "docid": "940777e9407ba9f63ad3178c65cd5495", "score": "0.6598652", "text": "function Food() {\n this.x;\n this.y; \n this.pickLocation = function() {\n this.x = (Math.floor(Math.random() *\n columns - 1) + 1) * scale;\n this.y = (Math.floor(Math.random() *\n rows - 1) + 1) * scale;\n } \n this.draw = function() {\n ctx.fillStyle = \"#af4c50\";\n ctx.fillRect(this.x, this.y, scale, scale)\n }\n }", "title": "" }, { "docid": "cdd2333ce7b7b252607c23c0e8871bd7", "score": "0.6585655", "text": "function createFood(foodTypeString, w, h) {\n if (foodTypeString == \"bonusFood\") {\n bonusFood = {\n x: Math.round(Math.random()*(w-cw)/cw),\n y: Math.round(Math.random()*(h-cw)/cw),\n };\n }\n if (foodTypeString == \"food\") {\n food = {\n x: Math.round(Math.random()*(w-cw)/cw),\n y: Math.round(Math.random()*(h-cw)/cw),\n };\n }\n }", "title": "" }, { "docid": "ae8460ecb49edfd0c5b39b78b8a5455f", "score": "0.6585394", "text": "getRandomShoe(shoes) {\n var randomShoe = shoes[Math.floor(Math.random() * shoes.length)];\n return randomShoe;\n }", "title": "" }, { "docid": "21c141338bdb4086ab1ce07c7d91bb04", "score": "0.6571209", "text": "rando() {\n randomNum = Math.floor(Math.random() * 20);\n }", "title": "" }, { "docid": "873af8c4ee60349c2b2aefdef72ea3a6", "score": "0.6568804", "text": "function generate_pizza() {\n do {\n pizzaloc.x = Math.floor(Math.random() * 20) + 1;\n pizzaloc.y = Math.floor(Math.random() * 16) + 4;\n } while (check_collision(pizzaloc.x, pizzaloc.y));\n\n pizzaloc.spritePosition = Math.floor(Math.random() * 4) + 0; // get position from 0-4 \n}", "title": "" }, { "docid": "47eabeb0f21826daa2dea66dba1ff846", "score": "0.65686095", "text": "function numOfPineapples () {\n return parseInt(Math.random() * 20);\n}", "title": "" }, { "docid": "540f26bc26570025381fbf836db5642f", "score": "0.6565394", "text": "function randomNumberGenerator(){\n \n return Math.floor(Math.random() * allProducts.length);\n}", "title": "" }, { "docid": "0127307da5b9daad4c7aa68977df0c09", "score": "0.65613145", "text": "function geraFood(){\n\tfoodX = Math.floor((Math.random() * 98));\n\tfoodY = Math.floor((Math.random() * 48));\n\tfood.style.transform = \"translate(\"+foodX*10 +\"px,\" +foodY*10 + \"px)\";\n\n}", "title": "" }, { "docid": "717d532334e45cddda0a546ac2062ca9", "score": "0.6553597", "text": "function hunt(name) {\n if (randoNum() > 50) {\n name.food = name.food + 100\n return name.food;\n }\n else {\n return this.food\n }\n}", "title": "" }, { "docid": "e4c5d04a8a908f1cd64aa8020285fcb5", "score": "0.6532671", "text": "function addRandomFact() {\n const factsAboutMyself = ['I love tacos!', 'Lofi is my go-to music for studying.', 'I am the youngest sibling of 3', \n 'Real Madrid is my favorite team', 'I am 21 years old.'];\n\n // Pick a random greeting.\n const fact = factsAboutMyself[Math.floor(Math.random() * factsAboutMyself.length)];\n\n // Add it to the page.\n const factContainer = document.getElementById('fact-container');\n factContainer.innerText = fact;\n}", "title": "" }, { "docid": "3240aab252e165be23872f4ca5632693", "score": "0.6530051", "text": "function randomApple() {\n do {\n appleIndex = Math.floor(Math.random() * squares.length);\n } while (squares[appleIndex].classList.contains('snake')); // Las manzanas no aparecen encima clase snake.\n squares[appleIndex].classList.add('apple');\n }", "title": "" }, { "docid": "28ef955f03a5070dab49fc671d48778f", "score": "0.6523678", "text": "function getRandom(animals){\n let friend = animals[Math.floor(Math.random() * animals.length)];\n //add a random animal to the friends array\n return friends.push(friend)\n}", "title": "" }, { "docid": "481b74fe82fc33cffe9db9b0f6f97627", "score": "0.6521198", "text": "function makeRandom() {\n return Math.floor(Math.random() * productNames.length);\n}", "title": "" }, { "docid": "d9e148a2925cd89e2b80db64e14f1ca7", "score": "0.6497132", "text": "function setFood() {\n var empty = [];\n // iterate through the grid and find all empty cells\n for (var x=0; x < ROWS; x++) {\n for (var y=0; y < COLS; y++) {\n if (grid.get(x, y) === 0) {\n empty.push({x:x, y:y});\n }\n }\n }\n // chooses a random cell\n var randpos = empty[Math.round(Math.random()*(empty.length - 1))];\n grid.set(FRUIT, randpos.x, randpos.y);\n}", "title": "" }, { "docid": "62a8e40bb76756a82282e702c6db9ad0", "score": "0.64707136", "text": "function Food() {\n\n // Food position\n this.position = createVector(0, 0);\n\n\n this.draw = function() {\n // Food color\n fill(255);\n\n // Draw food\n rect(this.position.x * gridScale, this.position.y * gridScale, gridScale, gridScale);\n };\n\n this.newLocation = function() {\n this.position = createVector(floor(random(0, gridSize)), floor(random(0, gridSize)));\n };\n\n // Set to random starting position\n this.newLocation();\n}", "title": "" }, { "docid": "0c3e2827730510234cc71195a2ed7a46", "score": "0.646559", "text": "function cookAndDeliverFood(callback){\n var time=1000*Math.random();\n setTimeout(callback,time);\n console.log(time+\" ms\");\n}", "title": "" }, { "docid": "3ad6b2749d480bd5e4a5489ed348dbef", "score": "0.644436", "text": "_spawnFood() {\n var r = -1, c;\n while (r == -1 || this.board[r][c] !== 0) {\n r = Math.floor((Math.random() * this.boardSize));\n c = Math.floor((Math.random() * this.boardSize));\n }\n this.board[r][c] = -1;\n return true;\n }", "title": "" }, { "docid": "5a0429536f9d5256331c73e43f76bfe2", "score": "0.64432466", "text": "function randomPositionFood() {\nxPosFood= Math.floor(Math.random() * 64) *10;\nyPosFood= Math.floor(Math.random() * 44) *10;\n\n\n\tdocument.getElementById('food').style.marginTop = yPosFood+\"px\";\n\tdocument.getElementById('food').style.marginLeft = xPosFood+\"px\";\n\n}", "title": "" }, { "docid": "d93d2b7f3d598f5bd80605cfb7c523d4", "score": "0.6439522", "text": "function PlayerAddRandomItem() {\n\tvar ItemList = [\"BallGag\", \"TapeGag\", \"ClothGag\", \"Cuffs\", \"Rope\", \"Armbinder\", \"ChastityBelt\", \"VibratingEgg\", \"Crop\", \"Collar\", \"SleepingPill\"];\n\tvar Item = ItemList[Math.floor(Math.random() * 11)];\n\tPlayerAddInventory(Item, 1);\n\tif (Item == \"TapeGag\") PlayerAddInventory(Item, 7); // For tape gag, add a bonus + 7 quantity\n\tif ((Item == \"Cuffs\") && (Math.floor(Math.random() * 2) == 1)) PlayerAddInventory(\"CuffsKey\", 1); // For cuffs, can randomly add keys\n}", "title": "" }, { "docid": "28a827f70d1854976351f750bffeec07", "score": "0.6434931", "text": "function dado()\r\n {\r\n var resul = Math.floor(Math.random()*6+1)\r\n return resul;\r\n }", "title": "" }, { "docid": "b9e7b5ebcfee91f7c2679ca4f02298b5", "score": "0.6433055", "text": "function getRandom(animals) {\n return Math.floor(Math.random() * animals.length);\n}", "title": "" }, { "docid": "d545720daf1aa98937272be209e9d91f", "score": "0.6430395", "text": "function randomRestaurantGenerator(selectedDestination){\n \n\n if (selectedDestination == \"Japan\"){\n restaurant = [\"Tokyo Washoku Ichi\", \"Gyopao Gyoza Rappongi\", \"Ise Sueyoshi\", \"Han no Daidokoro Honten\"]\n \n }else if (selectedDestination == \"England\"){\n restaurant = [\"Scarlett Green\", \"Alexander The Great\", \"Grand Trunk Road\", \"The Ledbury\"]\n }else if (selectedDestination == \"Bahamas\"){\n restaurant = [\"Robinson's Seafood Delight\", \"Daddy Brown's Conch Stand\", \"Flying Fish GastroBar\", \"Marco's\"]\n }else if (selectedDestination == \"Hawaii\"){\n restaurant = [\"Maguro Spot\", \"Paia Fish Market\", \"Champs Sports Bar & Restaurant\", \"La Mer\"]\n }else if (selectedDestination == \"Egypt\"){\n restaurant = [\"Restaurant El Dar Darak\", \"The Moghul Room\", \"Pyramids Restaurant\", \"Felfela\"]\n }\n \n let aRestaurant = restaurant[Math.floor(Math.random() * 4)]\n while (aRestaurant == selectedRestaurant){\n aRestaurant = restaurant[Math.floor(Math.random() * 4)]\n \n }\n return aRestaurant;\n\n}", "title": "" }, { "docid": "2dbf13f49514987a51051a4897d0537f", "score": "0.6419299", "text": "function generateRandomFish(length){\n var array = [];\n var n;\n for(var i = 0; i < length; i++)\n {\n // generate unique random numbers from 0 - length of fish array\n n = Math.floor(Math.random()* fish.length);\n while(array.indexOf(n) !== -1){\n n = Math.floor(Math.random()* fish.length);\n }\n // fill an array with unique random numbers\n array[i] = n;\n }\n return array;\n}", "title": "" }, { "docid": "dfc23e2df1fc8cedca6fd64f9d6c4d9f", "score": "0.64177954", "text": "function randomApple() {\n do {\n appleIndex = Math.floor(Math.random() * squares.length)\n } while (squares[appleIndex].classList.contains('snake'))\n squares[appleIndex].classList.add('apple')\n\n }", "title": "" }, { "docid": "53a03678543663e7489e0f38a192460d", "score": "0.6411883", "text": "function random() {\n return allProducts[Math.floor(Math.random() * (allProducts.length))];\n}", "title": "" } ]
561431e4856cab7769f00411fffa0749
jika mau 100 tinggal ubah isi dalam kurung tanpa menguba lagi loopingnya / Ada cara lebih efektif lagi misal aksinya tampil dalam bentuk alert dengan higher order function
[ { "docid": "5428aed1ddd7ab89f17163f4e569ad75", "score": "0.0", "text": "function repeat(n, action) {\n for (let i = 0; i < n; i++) {\n action(i);\n }\n}", "title": "" } ]
[ { "docid": "4ba42df549fe9202b5539891c3e199f7", "score": "0.6650425", "text": "function alhorithm() {\n\n}", "title": "" }, { "docid": "3baae90dd35f220f4573faf381ba3605", "score": "0.607468", "text": "function affiche() {}", "title": "" }, { "docid": "b63eeda33051fb5ef063a2166143d8ff", "score": "0.60075784", "text": "function hitungLuasSegiTiga (alas,tinggi){\r\n luas = 0.5 * alas * tinggi\r\n return luas;\r\n}", "title": "" }, { "docid": "f2d3bda29ac808a85aacc594ada947ce", "score": "0.5935835", "text": "function hitungLuasSegiEmpat (sisi){\r\n var luas = sisi * sisi\r\n return luas\r\n}", "title": "" }, { "docid": "8b56a1fa699011c98862482f32cdcdbf", "score": "0.5925932", "text": "function hitungharga ( jumlah ) {\n\t\tvar hasil;\n\t\tvar total;\n\t\ttotal = jumlah * 2500;\n\t\thasil = total;\n\t\t//hasil = total - (total * 0.1);\n\n\t\treturn hasil;\n\t}", "title": "" }, { "docid": "14dbe233278871e981d9b90c78ede0b0", "score": "0.58787906", "text": "function myLoop() { // create a loop function\r\n setTimeout(function () { // call a 3s setTimeout when the loop is called\r\n element.progress('pb', `${String(currentP)}%`);\r\n currentP += 10; // increment the counter\r\n if (currentP <= 100) { // if the counter < 10, call the loop function\r\n myLoop(); // .. again which will trigger another\r\n } else {\r\n document.getElementById('pb').remove(); layer.msg(\"小区已更新\");\r\n }// .. setTimeout()\r\n }, 1000)\r\n }", "title": "" }, { "docid": "c0aa21033c3f9846fded24e53529d8a9", "score": "0.58614534", "text": "function tugas(mapel, selesai) {\n //function tugas adalah higer order function dan parameter selesai adalah callback\n console.log(`Sedang mengerjakan tugas ${mapel}....`);\n selesai();\n}", "title": "" }, { "docid": "52a9f875d6b1f22d1035cd234e1dab21", "score": "0.5832083", "text": "function juft(arr){\n var soni = arguments[0]\n var narr = []\n var tartiblangan = narr.sort((a, b) => a - b )\n for(x of soni){\n x % 2 ===1 ? 'continue' : narr.push(x)\n }\n var tartiblangan = narr.sort((a, b) => a - b ) \n // console.log(arr+\" arrey sonlari\")\n //console.log(tartiblangan+\" arrey juft sonlari tartiblandi. Elementlar soni\", tartiblangan.length,\"ta\") \n return tartiblangan \n}", "title": "" }, { "docid": "a8ec4ed56029abbda94c5182dbf2509e", "score": "0.5768102", "text": "function pretScrisoare(gramaj) {\n var pret = 0;\n if(gramaj<50) {\n pret = 5;\n //daca conditia este true \n } else {\n pret = 5 + (gramaj - 50) * 0.1;\n //daca conditia este false\n }\n return pret;\n}", "title": "" }, { "docid": "6770753ab366e40c758eca48a2589e8c", "score": "0.57345515", "text": "function taumBday(b, w, bc, wc, z) {\n // Write your code here\n if (bc > wc && (wc + z) < bc) {\n return (b * wc) + (w * wc) + (b * z);\n }\n else if (wc > bc && (bc + z) < wc)//case 2, white is more expensive\n {\n return (b * bc) + (w * bc) + (w * z);\n }\n\n return (b * bc) + (w * wc);\n\n}", "title": "" }, { "docid": "659eee529a7cb94af8add4358913aa2d", "score": "0.57177913", "text": "function getOutcomeMetric() {\n \n // Jumlah total nilai pengukuran\n let sum = 0\n for (let i = 0; i < myData.length; i++) {\n sum += parseInt(myData[i]);\n }\n console.log(sum);\n\n // Rata-rata\n var avg = sum / myData.length;\n console.log(avg);\n myMean = avg.toFixed(2);\n\n // Fungsi untuk menyortir data dari nilai paling kecil hingga nilai paling besar\n let newArray = [...myData];\n\n newArray.sort(function(a, b) {\n return a - b;\n })\n console.log(newArray)\n\n // Jumlah data yang harus diambil ketika menghitung respon paling cepat dan lambat\n let numOfFastSlowData = Math.floor(0.1 * newArray.length);\n console.log(numOfFastSlowData);\n\n // Respon paling cepat\n let fastest = [];\n for (let i = 0; i < numOfFastSlowData; i++) {\n fastest.push(newArray[i]);\n }\n console.log(fastest);\n let sumFastest = 0;\n for (let i = 0; i < fastest.length; i++) {\n sumFastest += parseInt(fastest[i]);\n }\n let avgFastest = sumFastest/fastest.length;\n console.log(avgFastest);\n myFastest = avgFastest.toFixed(1);\n\n // Respon paling lambat\n let slowest = [];\n for (let i = newArray.length - 1; i > ((newArray.length - 1) - numOfFastSlowData); i--) {\n slowest.push(newArray[i]);\n }\n console.log(slowest)\n let sumSlowest = 0;\n for (let i = 0; i < slowest.length; i++) {\n sumSlowest += parseInt(slowest[i]);\n }\n var avgSlowest = sumSlowest/slowest.length;\n console.log(avgSlowest);\n mySlowest = avgSlowest.toFixed(1);\n\n // Banyaknya miss\n let lapse = [];\n for (let i = 0; i < newArray.length; i++) {\n // Ketika nilai timer trial/ respon > 500 maka dihitung sebagai miss\n if (newArray[i] > 500) {\n lapse.push(newArray[i]);\n }\n }\n // Banyaknya miss dihitung dari jumlah data nilai respon yang dianggap sebagai miss\n myNumOfLapse = lapse.length;\n}", "title": "" }, { "docid": "8e7848d732968271031356f105ce8ad3", "score": "0.57082283", "text": "function irrp(salaire){\n let impot = null\n console.log(salaire)\n if(salaire <= 10064){\n impot = 0\n }\n if(salaire >=10065 && salaire<= 25659){\n impot = ((salaire-10065)*11)/100\n }\n if(salaire >= 25660 && salaire <= 73369){\n impot = ((25659 - 10065)*11/100)\n impot += ((salaire - 25660)*30)/100\n }\n if(salaire >=73370 && salaire <= 157806){\n impot = ((25659 - 10065)*11/100)\n impot += ((73369 - 25660)*30)/100\n impot += ((salaire - 73369)*41)/100\n }\n if(salaire >= 157807){\n impot = ((25659 - 10065)*11/100)\n impot += ((73369 - 25660)*30)/100\n impot += ((157806 - 73369)*41)/100\n impot += ((salaire - 157506)*45)/100\n }\n impot= Math.floor(impot)\n return impot\n}", "title": "" }, { "docid": "92ce33d067a3b53cd3c712f5019a3689", "score": "0.5702854", "text": "menghitungKeliling() {\n return 2 * (this.panjang + this.lebar)\n }", "title": "" }, { "docid": "0ad7632e98558536401ef40547c89599", "score": "0.5698394", "text": "function hitungLuasLingkaran(jariJari){\r\n return 3.14 * jariJari ** 2;\r\n}", "title": "" }, { "docid": "36a455e826415ef471a012f763e908a4", "score": "0.568552", "text": "function setBeloebThis2(x,a){\n\n\n\t \n\t\n\tvar valutaKode = document.getElementById(\"FM_valuta_\"+x+\"_\"+a+\"\").options[document.getElementById(\"FM_valuta_\"+x+\"_\"+a+\"\").selectedIndex].text\n var valutaId = document.getElementById(\"FM_valuta_\"+x+\"_\"+a+\"\").value\n var valutaKurs = document.getElementById(\"valutakurs_\"+valutaId+\"\").value.replace(\",\",\".\")\n \n \n if (a == 0) {\n\n \n valutaIdOpr = document.getElementById(\"FM_valuta_opr_\" + x + \"_\" + a + \"\").value\n\n //alert(\"her x:\" + x + \"a:\" + a + \" valutaIdOpr: \" + valutaIdOpr)\n valutaKursOpr = document.getElementById(\"valutakurs_\" + valutaIdOpr + \"\").value.replace(\",\", \".\")\n\n \n\n } else {\n valutaIdOpr = valutaId\n valutaKursOpr = valutaKurs\n }\n\t\n\tvar belobThis = 0;\n\t\n\t\n\t\n\t\n\ttimerThis = document.getElementById(\"FM_timerthis_\"+x+\"_\"+a+\"\").value.replace(\",\",\".\")\n\ttimeprisThis = document.getElementById(\"FM_enhedspris_\"+x+\"_\"+a+\"\").value.replace(\",\",\".\")\n\tthis_mtp = timeprisThis\n\t\n rabat = document.getElementById(\"FM_rabat_\"+x+\"_\"+a+\"\").value\n \n // Bregn timepris ved Valuta ændring //\n\t\t\t if (valutaId != valutaIdOpr) {\n\t\t\t //alert(valutaKode +\"!=\"+ valutaKodeOpr)\n\t\t\t var this_mtp_valutakursberegn = 0;\n\t\t\t this_mtp_valutakursberegn = this_mtp/1 * (valutaKursOpr.replace(\",\",\".\")/1 / valutaKurs.replace(\",\",\".\")/1)\n\t\t\t this_mtp = Math.round(this_mtp_valutakursberegn*100)/ 100\n\t\t\t }\n \n timeprisThis = this_mtp\n \n //alert(timerThis +\" \"+timeprisThis + \" Rb: \"+ rabat)\n\tbelobThis = timerThis * timeprisThis - (timerThis * timeprisThis * rabat)\n\t\n\t//alert(belobThis)\n\t\n\t\t\t\t\t\t\t\t \n\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t //afrunder decimaler\n\t\t\t\t\t\t\ttimerThis = Math.round(timerThis*100)/100\n\t\t\t\t document.getElementById(\"FM_timerthis_\"+x+\"_\"+a+\"\").value = timerThis\n\t\t\t\t document.getElementById(\"FM_timerthis_\"+x+\"_\"+a+\"\").value = document.getElementById(\"FM_timerthis_\"+x+\"_\"+a+\"\").value.replace(\".\",\",\")\n \t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//afrunder decimaler\n\t\t\t\t\t\t\tbelobThis = Math.round(belobThis*100)/100\n\t\t\t\t document.getElementById(\"FM_beloebthis_\"+x+\"_\"+a+\"\").value = belobThis\n\t\t\t\t document.getElementById(\"FM_beloebthis_\"+x+\"_\"+a+\"\").value = document.getElementById(\"FM_beloebthis_\"+x+\"_\"+a+\"\").value.replace(\".\",\",\")\n \t\t\t \n \t\t\t document.getElementById(\"belobdiv_\"+x+\"_\"+a+\"\").innerHTML = \"<b>\"+document.getElementById(\"FM_beloebthis_\"+x+\"_\"+a+\"\").value+\" \"+ valutaKode +\"</b>\"\t\n\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\n\tdocument.getElementById(\"FM_valuta_opr_\"+x+\"_\"+a+\"\").value = valutaId\n\n\n\t\n\n\tsetBeloebTot2(x,1)\t\t\t\t\n\t//opdatervalutAllelinier(1,x)\t\n\t}", "title": "" }, { "docid": "a841b389892bb9ba341c004a186e15b7", "score": "0.564852", "text": "function kaliTerusRekursif(angka) {\n // you can only write your code here!\n var strAngka = String(angka);\n \n if(strAngka.length === 1){\n return angka;\n }\n \n var perkalian = 1;\n for(var i = 0; i < strAngka.length; i++){\n perkalian *= strAngka[i]; \n }\n return kaliTerusRekursif(perkalian);\n\n \n}", "title": "" }, { "docid": "1b666d2b50591018838103c3624a4e5f", "score": "0.5580425", "text": "function funcBiasa(){\n // code here\n}", "title": "" }, { "docid": "5cdd6290b22a1412ef6449c6e68db841", "score": "0.55783033", "text": "function somesome(){\n var sum = 0;\n for (var i = 0; i <= 1000; i++){\n\n if(i % 2 === 0){\n sum += i\n }else{\n if(i < 500){\n sum -= i\n }\n }\n }\n return sum * 12.5;\n}", "title": "" }, { "docid": "45c498fdbb645010643aeb03ced105e5", "score": "0.55660516", "text": "function beregnBelob(x) {\ntimer = document.getElementById(\"FM_timerthis_\"+x+\"_0\").value.replace(\",\",\".\")\nenhpris = document.getElementById(\"FM_enhedspris_\" + x + \"_0\").value.replace(\",\", \".\") \n\n//if (document.getElementById(\"FM_show_akt_\" + x + \"_0\").checked == true) {\n belob = (timer / 1) * (enhpris / 1)\n//} else {\n// belob = 0\n//}\n\nrbt = document.getElementById(\"FM_rabat_\"+x+\"_0\").value\n\nbelob = belob - (belob * (rbt/1))\nbelob = Math.round(belob*100)/100\nbelob = String(belob)\n\ndocument.getElementById(\"FM_beloebthis_\"+x+\"_0\").value = belob.replace(\".\",\",\") \ndocument.getElementById(\"belob_subtotal_akt_\"+x+\"\").value = belob.replace(\".\",\",\") \ndocument.getElementById(\"timer_subtotal_akt_\"+x+\"\").value = document.getElementById(\"FM_timerthis_\"+x+\"_0\").value.replace(\".\",\",\")\n\n//setTimerTot2(x)\nsetBeloebTot2_forkalk(x)\n\n//opdvalAlleForkalk(1,x)\n\n}", "title": "" }, { "docid": "63365980a5a0f17778e632fda3f46c8e", "score": "0.55586284", "text": "function callaback1(){\r\n function print(value){\r\n console.log(value);\r\n }\r\n function adunare(n1,n2,print){\r\n let sum = n1 + n2;\r\n print(sum);\r\n }\r\n adunare(3,7,print);\r\n}", "title": "" }, { "docid": "6268e4a3590afae7d1c22147756673c3", "score": "0.5552637", "text": "dfdvar(a, b, p) {\n let temp = 0;\n\n if(p == 2) {\n return this.speed;\n }\n\n temp = this.function1(a, b);\n temp = Math.pow(temp, -0.5) * (a[p]-b[p]);\n return temp;\n }", "title": "" }, { "docid": "f216677c5f3f7ad75ffac8131173de9b", "score": "0.55474555", "text": "getDelay() {\n return 1;\n //return 1000 * 1 / (5 + (level * 1/3))\n //return 1000 * 1 / 3\n }", "title": "" }, { "docid": "ba1200e80bf69b241cceabeb0ff60ec2", "score": "0.5537213", "text": "function ladedauer_berechnen() {\n// verfügbare Ladestunden berechnen\nconst heute = new Date();\nakt_stunde = heute.getHours();\nakt_minute = heute.getMinutes();\nlade_verfuegbar = (24-akt_stunde+lade_ende)-1;//(0.25*Math.floor((60-akt_minute)/15));\nif (loggen) { log(\"Verfügbare Ladezeit in Stunden: \"+lade_verfuegbar)}\n// Nachladung berechnen\nakku_nachladung=akku_groesse*(100-soc)/100;\nif (loggen) { log(\"Erforderliche Nachladung im Akku: \"+akku_nachladung)}\n// Akku kann mit minimalem Strom beladen werden\nok_min = (ladung_min*230*lade_verfuegbar)>akku_nachladung*1000;\nif (loggen) { log(\"Akku kann mit minimalem Strom beladen werden: \"+ok_min)}\n// Akku kann mit maximalem Strom beladen werden\nok_max = (ladung_max*230*lade_verfuegbar)>akku_nachladung*1000;\nif (loggen) { log(\"Akku kann mit maximalem Strom beladen werden: \"+ok_max)}\n// Notwendiger Ladestrom\nladung_notwendig=akku_nachladung*1000/(lade_verfuegbar*230);\nladung_notwendig=Math.ceil(ladung_notwendig);\nif (ladung_notwendig<6) {ladung_notwendig=6}\nif (ladung_notwendig>32) {ladung_notwendig=32}\nif (loggen) { log(\"Notweniger Ladestrom in A: \"+ladung_notwendig)}\n// Errechnete Dauer\nladung_errechnete_dauer = 1000*akku_nachladung/(ladung_notwendig*230);\nladung_errechnete_dauer = Math.ceil(ladung_errechnete_dauer);\nif (loggen) { log(\"Notwenige Ladestunden: \"+ladung_errechnete_dauer)}\n}", "title": "" }, { "docid": "e09e9e223c1ec15e3ea3f9757103d379", "score": "0.5527881", "text": "function multiplier() {\n let count = arguments[0];\n// let tocheck = arguments[1];\n let tmp = \"\";\n let string1 = \"\";\n/**\n if (fadnimaso(tocheck)){\n tmp = \"cieee. aku udah fix ini kok :). kamu gabisa macam2 beneran lagi. fadni nggabisa maso. kamu aja yang bisa lalalalalalalala\"\n }\n\n else tmp = arguments[1];\n **/\n tmp = arguments[1];\n for (i = 0; i < count; i++){\n string1 = string1 + \"<br>\" + tmp;\n }\n return string1;\n\n}", "title": "" }, { "docid": "4ec28438a4b5ba12a67896bc836c297f", "score": "0.55254287", "text": "function crsmark(a)\r\n{\r\n//It calls function crsmark and parameter a.\r\nlet exm = avg(2)*(a/100)\r\n//It calls variable exm to be equal to the values of avg multipled by a divided by 100.\r\n return exm\r\n}", "title": "" }, { "docid": "e26656e35e4c8cedb2115e94aa1e83c1", "score": "0.5507988", "text": "yf(){\n return this.PNA() == \"Flange\" ? this.Asc()/this.bf : 0\n }", "title": "" }, { "docid": "44431c74bbd600687ddac50057387bbd", "score": "0.5504723", "text": "menghitungLuas() {\n return this.panjang * this.lebar\n }", "title": "" }, { "docid": "56bac51d9b48352727a60a093aee05f4", "score": "0.54923695", "text": "function augmentertuk(){ \n document.getElementById('number_cab_uk').innerHTML =tuk.toFixed(3); \n if(tuk < 22.999){ \n tuk += 0.046; \n\n tukstop = setTimeout(\"augmentertuk()\", 1); \n } \n }", "title": "" }, { "docid": "81f4c5975dc94d19bc7583d7e0343bc3", "score": "0.5490673", "text": "function v17(v18,v19) {\n for (let v23 = 0; v23 < 4; v23 = v23 + 1) {\n let v26 = 0;\n while (v26 < 3) {\n function v27(v28,v29) {\n for (let v33 = 0; v33 < 9; v33 = v33 + 1) {\n async function v34(v35,v36,v37,v38) {\n for (let v41 = v33; v41 < 100; v41 = v41 + 3168844224) {\n }\n }\n const v42 = 0;\n // v42 = .integer\n const v43 = 10;\n // v43 = .integer\n const v44 = 1;\n // v44 = .integer\n }\n const v46 = [13.37,13.37,13.37,13.37];\n // v46 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n const v47 = 0;\n // v47 = .integer\n const v48 = 1337;\n // v48 = .integer\n const v49 = 1;\n // v49 = .integer\n }\n }\n }", "title": "" }, { "docid": "4857164aca4ff591275b2ef52071383d", "score": "0.54837686", "text": "function penalty(){\n for(b = 0; b < 30; b++){\n seconds--;\n }\n showincorrect();\n}", "title": "" }, { "docid": "30dcbd244e5cc44a0351710402bcc601", "score": "0.5481125", "text": "function FADE(t) {return t * t * t * ( t * ( t * 6 - 15 ) + 10 );}", "title": "" }, { "docid": "ed96a8c1ed803d353cab891d9a0e1df2", "score": "0.54760385", "text": "function R0fun_time(t){\n var iPresent=dataGit_istart+t;\n var iTest =iPresent+Math.round(tauTest);\n var iTestPrev=iPresent+Math.round(tauTest-0.5*(tauRstart+tauRend));\n //console.log(\"R0fun_time: t=\",t,\" iTest+2=\",iTest+2,\" dataGit_cumCases[iTest+2]=\",dataGit_cumCases[iTest+2]);\n if(t<0){\n var xtNewnum =1./2.*(dataGit_cumCases[iTest+1]-dataGit_cumCases[iTest-1]);\n var xtNewdenom=1./2.*(dataGit_cumCases[iTestPrev+1]\n\t\t\t -dataGit_cumCases[iTestPrev-1]);\n var R=1.02*xtNewnum/xtNewdenom;\n if(false){\n console.log(\"R0fun_time: t=\",t,\" xtCum(iTest)=\",dataGit_cumCases[iTest],\n\t\t\" xtCum(iTestPrev)=\",dataGit_cumCases[iTestPrev],\n\t\t\" xtNewnum=\",xtNewnum,\n\t\t\"\");\n }\n return R;\n }\n else{\n var iweek=Math.floor(t/7);\n var nxt=dataGit_cumCases[iPresent];\n var index=Math.min(Math.floor((iweek+1)/2),Rtime.length-1);\n //console.log(\"nxt=\",nxt,\" nxtR0=\",nxtR0);\n //console.log(\"iweek=\",iweek,\" index=\",index,\" Rtime=\",Rtime);\n\n //return R0fun(nxt/n0);\n return Rtime[index];\n }\n\n}", "title": "" }, { "docid": "b7561e38fdc9a4413cb7e8ebacecf875", "score": "0.5475043", "text": "function hitungLuasPersegiPanjang(panjang,lebar){\r\n var luas = panjang * lebar\r\n return luas\r\n }", "title": "" }, { "docid": "114a582e1d1adf0477b0679c07fe233d", "score": "0.5470626", "text": "function fun(b) {\nreturn b*2;\n }", "title": "" }, { "docid": "ed0af9eb0eef6dcbafded528d24dfe96", "score": "0.5470277", "text": "function t(e,t,i,n){var a=e+\" \";switch(i){case\"s\":return t||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return a+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||n?\"sekundi\":\"sekundah\":e<5?t||n?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return a+=1===e?t?\"minuta\":\"minuto\":2===e?t||n?\"minuti\":\"minutama\":e<5?t||n?\"minute\":\"minutami\":t||n?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return a+=1===e?t?\"ura\":\"uro\":2===e?t||n?\"uri\":\"urama\":e<5?t||n?\"ure\":\"urami\":t||n?\"ur\":\"urami\";case\"d\":return t||n?\"en dan\":\"enim dnem\";case\"dd\":return a+=1===e?t||n?\"dan\":\"dnem\":2===e?t||n?\"dni\":\"dnevoma\":t||n?\"dni\":\"dnevi\";case\"M\":return t||n?\"en mesec\":\"enim mesecem\";case\"MM\":return a+=1===e?t||n?\"mesec\":\"mesecem\":2===e?t||n?\"meseca\":\"mesecema\":e<5?t||n?\"mesece\":\"meseci\":t||n?\"mesecev\":\"meseci\";case\"y\":return t||n?\"eno leto\":\"enim letom\";case\"yy\":return a+=1===e?t||n?\"leto\":\"letom\":2===e?t||n?\"leti\":\"letoma\":e<5?t||n?\"leta\":\"leti\":t||n?\"let\":\"leti\"}}", "title": "" }, { "docid": "ed9b41e6d9d6c93b2f4ca708fd8aa254", "score": "0.5453789", "text": "function pazymiuVidurkis() {\n console.log(\"vidurkis\", (5 + 10 + 8 + 6 + 8) / 5);\n}", "title": "" }, { "docid": "86ce8959fc8d5d041d7b2a048c9363bf", "score": "0.5448207", "text": "function improved() {}", "title": "" }, { "docid": "840126d1e27515750b888bafc60cce5b", "score": "0.54421383", "text": "function loopingData3() {\n\n}", "title": "" }, { "docid": "5bd7f916ce0729961aac8c55f297fe26", "score": "0.5435505", "text": "function augmenterprixmuke(){ \n document.getElementById('pmuke').innerHTML =\" = \"+pmuke.toFixed(2)+\" €\"; \n if(pmuke < 15.59 ){ \n pmuke += 0.08; \n\n pmukestop = setTimeout(\"augmenterprixmuke()\", 6); \n } \n }", "title": "" }, { "docid": "a443f731ea2e611bd16175a5378e518d", "score": "0.5434357", "text": "function algaPo10Metu(x) {\n let kiekMenesiu = x * 12;\n let menAtlyginimas = 680;\n let algosPokytis = 2;\n let atlyginimasPoXMetu = 680;\n for (var i = 0; i < kiekMenesiu; i++) {\n algosPokytisEurais = atlyginimasPoXMetu * (algosPokytis / 100);\n atlyginimasPoXMetu = atlyginimasPoXMetu + algosPokytisEurais;\n }\n document.querySelector(\"h1\").innerHTML += \"Po \"+ x + \" metu padidejusi alga: \" + atlyginimasPoXMetu + \"<br>\";\n}", "title": "" }, { "docid": "134f064622fc997906c12005966d7f11", "score": "0.54341537", "text": "function\nloop_6400_(a8x1, a8x2, a8x3)\n{\nlet a8y1;\nlet a8y2;\nlet a8y3;\nlet xtmp41;\nlet xtmp42;\nlet xtmp43;\nlet xtmp44;\nlet xtmp45;\nlet xtmp46;\nlet xtmp47;\ndo {\n;\n;\n;\n{\nxtmp42 = 0;\ndo {\ndo {\nif(0!==a8x3[0]) break;\nxtmp42 = 1;\n} while(false);\nif(xtmp42 > 0 ) break;\ndo {\nif(1!==a8x3[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp42 = 2;\n} while(false);\nif(xtmp42 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp42) {\ncase 1:\n{\nxtmp41 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp43 = a8x3[1];\nxtmp44 = a8x3[2];\n// ./../../../../xanadu/prelude/DATS/string.dats: 6596(line=471, offs=1) -- 6635(line=472, offs=31)\n{\n{\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 8867(line=604, offs=1) -- 9021(line=614, offs=25)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 8937(line=610, offs=1) -- 9019(line=613, offs=38)\n;\n// } // val-binding\nconst // implval/fun\nstrtmp_vt_set_at_5715_ = XATS2JS_strtmp_vt_set_at\n;\nxtmp45 = strtmp_vt_set_at_5715_(a8x1, a8x2, xtmp43);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(45)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(45)));\n} // val(H0Pnil())\n;\n{\n{\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 2015(line=148, offs=1) -- 2064(line=149, offs=42)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\ngint_succ_sint_1861_ = XATS2JS_gint_succ_sint\n;\nxtmp47 = gint_succ_sint_1861_(a8x2);\n}\n;\n// tail-recursion:\n// L1CMDapp(tmp(46); L1VALfcst(loop(21)); L1VALtmp(arg[1](38)), L1VALtmp(tmp(47)), L1VALtmp(tmp(44)))\na8y1 = a8x1; a8y2 = xtmp47; a8y3 = xtmp44; a8x1 = a8y1; a8x2 = a8y2; a8x3 = a8y3; continue;\n}\n;\nxtmp41 = xtmp46;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;//return\n} while( true );\nreturn xtmp41;\n}", "title": "" }, { "docid": "3f40789c3157444cf5406cf46796541c", "score": "0.5432522", "text": "function t(e,t,i,n){var o=e+\" \";switch(i){case\"s\":return t||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return o+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||n?\"sekundi\":\"sekundah\":e<5?t||n?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return o+=1===e?t?\"minuta\":\"minuto\":2===e?t||n?\"minuti\":\"minutama\":e<5?t||n?\"minute\":\"minutami\":t||n?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return o+=1===e?t?\"ura\":\"uro\":2===e?t||n?\"uri\":\"urama\":e<5?t||n?\"ure\":\"urami\":t||n?\"ur\":\"urami\";case\"d\":return t||n?\"en dan\":\"enim dnem\";case\"dd\":return o+=1===e?t||n?\"dan\":\"dnem\":2===e?t||n?\"dni\":\"dnevoma\":t||n?\"dni\":\"dnevi\";case\"M\":return t||n?\"en mesec\":\"enim mesecem\";case\"MM\":return o+=1===e?t||n?\"mesec\":\"mesecem\":2===e?t||n?\"meseca\":\"mesecema\":e<5?t||n?\"mesece\":\"meseci\":t||n?\"mesecev\":\"meseci\";case\"y\":return t||n?\"eno leto\":\"enim letom\";case\"yy\":return o+=1===e?t||n?\"leto\":\"letom\":2===e?t||n?\"leti\":\"letoma\":e<5?t||n?\"leta\":\"leti\":t||n?\"let\":\"leti\"}}", "title": "" }, { "docid": "eb8dbdf08b5dfa126a18cde289e35364", "score": "0.54279023", "text": "function hitung(i){\n return (i - 1) * 2\n}", "title": "" }, { "docid": "cb6074a2bb917874b1999e8a8b0e6d4a", "score": "0.54235333", "text": "function timer(aFunction){\n\n if(results.length === SAMPLES - 1){\n array = [];\n }\n for(var i = 0; i < SAMPLES; i++){\n array = returnIncreasedArray(array);\n var startTime = performance.now();\n array[aFunction]();\n var endTime = performance.now();\n var item = [array.length, (endTime - startTime)]\n if(results[i] === undefined){\n results.push(item);\n } else {\n results[i][1] + item[1];\n }\n }\n }", "title": "" }, { "docid": "ad6dfbad71be1c3b3031d4a1e10b3ba7", "score": "0.54226995", "text": "function crsmark(a)\n{\n\n//Declaring variable- exm with the let keyword.\n//exm will will invoke function avg and avg takes on the argument 2.\n//The output of function avg will be multiplied by (a/100)and the result becomes the value of variable -exm.\n\nlet exm = avg(2)*(a/100)\n\n//When invoked, this function will return the value of variable exm and then will it stop executing.\n return exm\n}", "title": "" }, { "docid": "e5c70b70366552230cb9811e22bddf07", "score": "0.54152584", "text": "function t(e,t,i,n){var s=e+\" \";switch(i){case\"s\":return t||n?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return s+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||n?\"sekundi\":\"sekundah\":e<5?t||n?\"sekunde\":\"sekundah\":\"sekund\",s;case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return s+=1===e?t?\"minuta\":\"minuto\":2===e?t||n?\"minuti\":\"minutama\":e<5?t||n?\"minute\":\"minutami\":t||n?\"minut\":\"minutami\",s;case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return s+=1===e?t?\"ura\":\"uro\":2===e?t||n?\"uri\":\"urama\":e<5?t||n?\"ure\":\"urami\":t||n?\"ur\":\"urami\",s;case\"d\":return t||n?\"en dan\":\"enim dnem\";case\"dd\":return s+=1===e?t||n?\"dan\":\"dnem\":2===e?t||n?\"dni\":\"dnevoma\":t||n?\"dni\":\"dnevi\",s;case\"M\":return t||n?\"en mesec\":\"enim mesecem\";case\"MM\":return s+=1===e?t||n?\"mesec\":\"mesecem\":2===e?t||n?\"meseca\":\"mesecema\":e<5?t||n?\"mesece\":\"meseci\":t||n?\"mesecev\":\"meseci\",s;case\"y\":return t||n?\"eno leto\":\"enim letom\";case\"yy\":return s+=1===e?t||n?\"leto\":\"letom\":2===e?t||n?\"leti\":\"letoma\":e<5?t||n?\"leta\":\"leti\":t||n?\"let\":\"leti\",s}}", "title": "" }, { "docid": "0b015fea7990706e14a442f498b61528", "score": "0.5414678", "text": "function loopingData4() {\n\n}", "title": "" }, { "docid": "e37f8210d948154564d59bc4db4403f1", "score": "0.54144454", "text": "function t(e,t,r,a){var n=e+\" \";switch(r){case\"s\":return t||a?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return n+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||a?\"sekundi\":\"sekundah\":e<5?t||a?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return n+=1===e?t?\"minuta\":\"minuto\":2===e?t||a?\"minuti\":\"minutama\":e<5?t||a?\"minute\":\"minutami\":t||a?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return n+=1===e?t?\"ura\":\"uro\":2===e?t||a?\"uri\":\"urama\":e<5?t||a?\"ure\":\"urami\":t||a?\"ur\":\"urami\";case\"d\":return t||a?\"en dan\":\"enim dnem\";case\"dd\":return n+=1===e?t||a?\"dan\":\"dnem\":2===e?t||a?\"dni\":\"dnevoma\":t||a?\"dni\":\"dnevi\";case\"M\":return t||a?\"en mesec\":\"enim mesecem\";case\"MM\":return n+=1===e?t||a?\"mesec\":\"mesecem\":2===e?t||a?\"meseca\":\"mesecema\":e<5?t||a?\"mesece\":\"meseci\":t||a?\"mesecev\":\"meseci\";case\"y\":return t||a?\"eno leto\":\"enim letom\";case\"yy\":return n+=1===e?t||a?\"leto\":\"letom\":2===e?t||a?\"leti\":\"letoma\":e<5?t||a?\"leta\":\"leti\":t||a?\"let\":\"leti\"}}", "title": "" }, { "docid": "0a37e5f7a5fe51b14c555644554b5dff", "score": "0.5413697", "text": "cal1() {\n for (let i = 1; i < 1000000; i += 1) {\n if (100 * (i ** 2) <= 2 ** i) {\n console.log(i);\n return i;\n }\n }\n return 0;\n }", "title": "" }, { "docid": "c84e0fd01a7f6aeaa9f013a3768b40d1", "score": "0.54136825", "text": "function bricPrice(taka) {\n console.log('1 hajar brick 8000hajar taka');\n console.log('2 hajar brick er dam 16000 taka ');\n var brickPerPice = 8;\n var brickMultiple = brickPerPice * taka;\n return brickMultiple;\n\n}", "title": "" }, { "docid": "434b1501ab2d5018db91aadd99f17198", "score": "0.54096484", "text": "function e(e,t,r,i,u,l,o){D=0;const f=(i-r)*l,p=u&&u.length,c=p?(u[0]-r)*l:f;let v,s,h,d,Z,a=n(t,r,i,0,c,l,!0);if(a&&a.next!==a.prev){if(p&&(a=y$3(t,r,i,u,a,l)),f>80*l){v=h=t[0+r*l],s=d=t[1+r*l];for(let e=l;e<c;e+=l){const n=t[e+r*l],x=t[e+1+r*l];v=Math.min(v,n),s=Math.min(s,x),h=Math.max(h,n),d=Math.max(d,x);}Z=Math.max(h-v,d-s),Z=0!==Z?1/Z:0;}x$4(a,e,l,v,s,Z,o,0);}}", "title": "" }, { "docid": "2dda938de5d9b879754f1e126060a60d", "score": "0.5409549", "text": "function hitungJumlahHarga( jumlah ) {\n\n\t\tvar hasil;\n\t\tvar total;\n\t\t\ttotal = jumlah * 2500;\n\t\t\thasil = total - (total*0.1)\n\n\t\t\treturn hasil;\n\n}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "35524ce599d115df3cfb70f13d3503df", "score": "0.5407035", "text": "function t(e,t,n,i){var r=e+\" \";switch(n){case\"s\":return t||i?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return r+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||i?\"sekundi\":\"sekundah\":e<5?t||i?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return r+=1===e?t?\"minuta\":\"minuto\":2===e?t||i?\"minuti\":\"minutama\":e<5?t||i?\"minute\":\"minutami\":t||i?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return r+=1===e?t?\"ura\":\"uro\":2===e?t||i?\"uri\":\"urama\":e<5?t||i?\"ure\":\"urami\":t||i?\"ur\":\"urami\";case\"d\":return t||i?\"en dan\":\"enim dnem\";case\"dd\":return r+=1===e?t||i?\"dan\":\"dnem\":2===e?t||i?\"dni\":\"dnevoma\":t||i?\"dni\":\"dnevi\";case\"M\":return t||i?\"en mesec\":\"enim mesecem\";case\"MM\":return r+=1===e?t||i?\"mesec\":\"mesecem\":2===e?t||i?\"meseca\":\"mesecema\":e<5?t||i?\"mesece\":\"meseci\":t||i?\"mesecev\":\"meseci\";case\"y\":return t||i?\"eno leto\":\"enim letom\";case\"yy\":return r+=1===e?t||i?\"leto\":\"letom\":2===e?t||i?\"leti\":\"letoma\":e<5?t||i?\"leta\":\"leti\":t||i?\"let\":\"leti\"}}", "title": "" }, { "docid": "33167420898d6db76d0cbd3305bb550f", "score": "0.5405399", "text": "function t(e,t,a,r){var n=e+\" \";switch(a){case\"s\":return t||r?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return n+=1===e?t?\"sekundo\":\"sekundi\":2===e?t||r?\"sekundi\":\"sekundah\":e<5?t||r?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return t?\"ena minuta\":\"eno minuto\";case\"mm\":return n+=1===e?t?\"minuta\":\"minuto\":2===e?t||r?\"minuti\":\"minutama\":e<5?t||r?\"minute\":\"minutami\":t||r?\"minut\":\"minutami\";case\"h\":return t?\"ena ura\":\"eno uro\";case\"hh\":return n+=1===e?t?\"ura\":\"uro\":2===e?t||r?\"uri\":\"urama\":e<5?t||r?\"ure\":\"urami\":t||r?\"ur\":\"urami\";case\"d\":return t||r?\"en dan\":\"enim dnem\";case\"dd\":return n+=1===e?t||r?\"dan\":\"dnem\":2===e?t||r?\"dni\":\"dnevoma\":t||r?\"dni\":\"dnevi\";case\"M\":return t||r?\"en mesec\":\"enim mesecem\";case\"MM\":return n+=1===e?t||r?\"mesec\":\"mesecem\":2===e?t||r?\"meseca\":\"mesecema\":e<5?t||r?\"mesece\":\"meseci\":t||r?\"mesecev\":\"meseci\";case\"y\":return t||r?\"eno leto\":\"enim letom\";case\"yy\":return n+=1===e?t||r?\"leto\":\"letom\":2===e?t||r?\"leti\":\"letoma\":e<5?t||r?\"leta\":\"leti\":t||r?\"let\":\"leti\"}}", "title": "" }, { "docid": "d4382f4add82a25e172545b6bad8f763", "score": "0.54049337", "text": "be(){\n return Math.min(this.L/4,this.S)*12\n }", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "f391af89a0a04ff5fae857a1b4667e0a", "score": "0.53970796", "text": "function n(e,t){0}", "title": "" }, { "docid": "9d0a2999b864dc72fade01371857d45e", "score": "0.539664", "text": "function\nloop_1331_(a3x1, a3x2)\n{\nlet a3y1;\nlet a3y2;\nlet xtmp518;\nlet xtmp519;\nlet xtmp520;\nlet xtmp521;\ndo {\n;\n;\n{\nxtmp519 = 0;\ndo {\ndo {\nif(0!==a3x1[0]) break;\nxtmp519 = 1;\n} while(false);\nif(xtmp519 > 0 ) break;\ndo {\nif(1!==a3x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp519 = 2;\n} while(false);\nif(xtmp519 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp519) {\ncase 1:\nxtmp518 = a3x2;\nbreak;\ncase 2:\nxtmp520 = a3x1[2];\n{\n{\n// ./../../../xatsopt/prelude/DATS/CATS/JS/basics.dats: 3428(line=245, offs=1) -- 3485(line=246, offs=50)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\ngint_add_sint_sint_3439_ = XATS2JS_gint_add_sint_sint\n;\nxtmp521 = gint_add_sint_sint_3439_(a3x2, 1);\n}\n;\n// tail-recursion:\n// L1CMDapp(tmp(518); L1VALfcst(loop(135)); L1VALtmp(tmp(520)), L1VALtmp(tmp(521)))\na3y1 = xtmp520; a3y2 = xtmp521; a3x1 = a3y1; a3x2 = a3y2; continue;\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;//return\n} while( true );\nreturn xtmp518;\n}", "title": "" }, { "docid": "2fb3def91b5581aef1be58750665b931", "score": "0.5388187", "text": "function dong(){\n\t\t\t\tvar start = Math.floor(Math.random()*bli.length);\n\t\t\t\tconsole.log(start);\n\t\t\t\tfor (var i=0;i<bsp.length;i++) {\n\t\t\t\t\tbsp[i].style.display = 'none';\n\t\t\t\t}\n\t\t\t\tbsp[start].innerHTML = \"<img src='img/images/dishu.gif'/>\";\n\t\t\t\tbsp[start].style.pointerEvents = 'all';\n\t\t\t\t\n\t\t\t\tbsp[start].style.display = 'block';\n\t\t\t\tbsp[start].onclick = function(){\n\t\t\t\t\t\n\t\t\t\t\tbsp[start].innerHTML = \"<img src='img/images/shang.gif'/>\";\n\t\t\t\t\tf1 += 10;\n//\t\t\t\t\tconsole.log(f1);\n//\t\t\t\t\tclearInterval(ting);\n//\t\t\t\t\t\tdong();\n\t\t\t\t\tbsp[start].style.pointerEvents = 'none';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tf.innerHTML = \"积分:\"+f1;\n\t\t\t}", "title": "" }, { "docid": "58025b71c87f1a44633634e65f13c33b", "score": "0.5386579", "text": "function\nloop_6400_(a6x1, a6x2, a6x3)\n{\nlet a6y1;\nlet a6y2;\nlet a6y3;\nlet xtmp97;\nlet xtmp98;\nlet xtmp99;\nlet xtmp100;\nlet xtmp101;\nlet xtmp102;\nlet xtmp103;\ndo {\n;\n;\n;\n{\nxtmp98 = 0;\ndo {\ndo {\nif(0!==a6x3[0]) break;\nxtmp98 = 1;\n} while(false);\nif(xtmp98 > 0 ) break;\ndo {\nif(1!==a6x3[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp98 = 2;\n} while(false);\nif(xtmp98 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp98) {\ncase 1:\n{\nxtmp97 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp99 = a6x3[1];\nxtmp100 = a6x3[2];\n// ./../../../../xanadu/prelude/DATS/string.dats: 6596(line=471, offs=1) -- 6635(line=472, offs=31)\n{\n{\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 8867(line=604, offs=1) -- 9021(line=614, offs=25)\n// { // val-binding\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 8937(line=610, offs=1) -- 9019(line=613, offs=38)\n;\n// } // val-binding\nconst // implval/fun\nstrtmp_vt_set_at_5715_ = XATS2JS_strtmp_vt_set_at\n;\nxtmp101 = strtmp_vt_set_at_5715_(a6x1, a6x2, xtmp99);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(101)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(101)));\n} // val(H0Pnil())\n;\n{\n{\n// ./../../../../xanadu/prelude/DATS/CATS/JS/basics.dats: 2015(line=148, offs=1) -- 2064(line=149, offs=42)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\ngint_succ_sint_1861_ = XATS2JS_gint_succ_sint\n;\nxtmp103 = gint_succ_sint_1861_(a6x2);\n}\n;\n// tail-recursion:\n// L1CMDapp(tmp(102); L1VALfcst(loop(21)); L1VALtmp(arg[1](94)), L1VALtmp(tmp(103)), L1VALtmp(tmp(100)))\na6y1 = a6x1; a6y2 = xtmp103; a6y3 = xtmp100; a6x1 = a6y1; a6x2 = a6y2; a6x3 = a6y3; continue;\n}\n;\nxtmp97 = xtmp102;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;//return\n} while( true );\nreturn xtmp97;\n}", "title": "" }, { "docid": "d702fe67c5a3bdafe11b39b3c5acffd5", "score": "0.5382636", "text": "function\nloop_7698_(a8x1, a8x2, a8x3)\n{\nlet a8y1;\nlet a8y2;\nlet a8y3;\nlet xtmp348;\nlet xtmp349;\nlet xtmp350;\nlet xtmp351;\nlet xtmp352;\nlet xtmp353;\nlet xtmp354;\ndo {\n;\n;\n;\n{\nxtmp349 = 0;\ndo {\ndo {\nif(0!==a8x3[0]) break;\nxtmp349 = 1;\n} while(false);\nif(xtmp349 > 0 ) break;\ndo {\nif(1!==a8x3[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp349 = 2;\n} while(false);\nif(xtmp349 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp349) {\ncase 1:\n{\nxtmp348 = [-1];;\n}\n;\nbreak;\ncase 2:\nxtmp350 = a8x3[1];\nxtmp351 = a8x3[2];\n// ./../../../xatsopt/prelude/DATS/string.dats: 7894(line=572, offs=1) -- 7933(line=573, offs=31)\n{\n{\n// ./../../../xatsopt/prelude/DATS/CATS/JS/basics.dats: 9297(line=637, offs=1) -- 9451(line=647, offs=25)\n// { // val-binding\n// ./../../../xatsopt/prelude/DATS/CATS/JS/basics.dats: 9367(line=643, offs=1) -- 9449(line=646, offs=38)\n;\n// } // val-binding\nconst // implval/fun\nstrtmp_vt_set_at_5715_ = XATS2JS_strtmp_vt_set_at\n;\nxtmp352 = strtmp_vt_set_at_5715_(a8x1, a8x2, xtmp350);\n}\n;\n//L1PCKxpat(H0Pnil(); L1VALtmp(tmp(352)));\n//L1CMDmatch(H0Pnil(); L1VALtmp(tmp(352)));\n} // val(H0Pnil())\n;\n{\n{\n// ./../../../xatsopt/prelude/DATS/CATS/JS/basics.dats: 2015(line=148, offs=1) -- 2064(line=149, offs=42)\n// { // val-binding\n// } // val-binding\nconst // implval/fun\ngint_succ_sint_1861_ = XATS2JS_gint_succ_sint\n;\nxtmp354 = gint_succ_sint_1861_(a8x2);\n}\n;\n// tail-recursion:\n// L1CMDapp(tmp(353); L1VALfcst(loop(72)); L1VALtmp(arg[1](345)), L1VALtmp(tmp(354)), L1VALtmp(tmp(351)))\na8y1 = a8x1; a8y2 = xtmp354; a8y3 = xtmp351; a8x1 = a8y1; a8x2 = a8y2; a8x3 = a8y3; continue;\n}\n;\nxtmp348 = xtmp353;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;//return\n} while( true );\nreturn xtmp348;\n}", "title": "" } ]
b1ba3a4fc9c4564ec8e449349a0fe1d6
Functions If ranges are not specified, determine ranges from rendered bubble series and render legend again.
[ { "docid": "cc133ba0caae788e8a47dd86a3e9a0c1", "score": "0.0", "text": "function chartDrawChartBox(proceed, options, callback) {\n const chart = this, legend = chart.legend, bubbleSeries = getVisibleBubbleSeriesIndex(chart) >= 0;\n let bubbleLegendOptions, bubbleSizes, legendItem;\n if (legend && legend.options.enabled && legend.bubbleLegend &&\n legend.options.bubbleLegend.autoRanges && bubbleSeries) {\n bubbleLegendOptions = legend.bubbleLegend.options;\n bubbleSizes = legend.bubbleLegend.predictBubbleSizes();\n legend.bubbleLegend.updateRanges(bubbleSizes[0], bubbleSizes[1]);\n // Disable animation on init\n if (!bubbleLegendOptions.placed) {\n legend.group.placed = false;\n legend.allItems.forEach((item) => {\n legendItem = item.legendItem || {};\n if (legendItem.group) {\n legendItem.group.translateY = null;\n }\n });\n }\n // Create legend with bubbleLegend\n legend.render();\n chart.getMargins();\n chart.axes.forEach(function (axis) {\n if (axis.visible) { // #11448\n axis.render();\n }\n if (!bubbleLegendOptions.placed) {\n axis.setScale();\n axis.updateNames();\n // Disable axis animation on init\n objectEach(axis.ticks, function (tick) {\n tick.isNew = true;\n tick.isNewLabel = true;\n });\n }\n });\n bubbleLegendOptions.placed = true;\n // After recalculate axes, calculate margins again.\n chart.getMargins();\n // Call default 'drawChartBox' method.\n proceed.call(chart, options, callback);\n // Check bubble legend sizes and correct them if necessary.\n legend.bubbleLegend.correctSizes();\n // Correct items positions with different dimensions in legend.\n retranslateItems(legend, getLinesHeights(legend));\n }\n else {\n proceed.call(chart, options, callback);\n // Allow color change on static bubble legend after click on legend\n if (legend && legend.options.enabled && legend.bubbleLegend) {\n legend.render();\n retranslateItems(legend, getLinesHeights(legend));\n }\n }\n }", "title": "" } ]
[ { "docid": "7d69bd944e0669020f6e8e7909994abe", "score": "0.71167356", "text": "function createRangedLegend(options) {\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'map':\n {\n switch (chart.type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n }\n break;\n default:\n {\n }\n break;\n }\n }\n break;\n default:\n {\n }\n break;\n }\n\n //create multiples\n if (chart.type === 'multiples') {\n switch (chart.series[0].type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n }\n break;\n }\n }\n\n //set formatted content\n let formattedMax = '';\n\n //reset temp value\n tempTextValueLength = 0;\n\n //iterate all legend values\n chart.legend.rangeList.forEach(function (range, rangeIndex) {\n //retrieve max length text\n if (range.text.length > tempTextValueLength) {\n tempTextValue = range.text;\n tempTextValueLength = range.text.length;\n }\n formattedMax = e.formatNumber(range.maxValue, chart.legend.numberFormat).toString();\n if (formattedMax.length > tempTextValueLength) {\n tempTextValue = formattedMax;\n tempTextValueLength = formattedMax.length;\n }\n });\n\n //calculate automatic legend width\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n //calculate legend dimension\n rangedLegend.width = rangedLegend.dimension + legendIconOffset * 2 + tempTextSVGOffset.width;\n rangedLegend.height = (sizes.maxHeight - plot.top - plot.bottom) - height - (options.legendSpace ? legendIconOffset : 0) - 5;\n rangedLegend.blockHeight = (rangedLegend.height / chart.legend.rangeList.length);\n rangedLegend.blockWidth = rangedLegend.dimension;\n }\n break;\n default:\n {\n //calculate legend widths\n rangedLegend.width = (sizes.maxWidth - plot.right - plot.left) - width - (options.legendSpace ? legendIconOffset : 0) - 5;\n rangedLegend.blockWidth = (rangedLegend.width / chart.legend.rangeList.length);\n\n //get width of the text\n tempTextSVGOffset = getWrappedTempOffset(tempTextValue, rangedLegend.blockWidth);\n\n //calculate legend heights\n rangedLegend.height = rangedLegend.dimension + tempTextSVGOffset.height + legendIconOffset * 2;\n rangedLegend.blockHeight = rangedLegend.dimension;\n }\n break;\n }\n\n //append ranged Legend g\n rangedLegend.svg = legendG\n .append('g');\n\n //append range rects\n rangedLegend.svg.selectAll('.eve-legend-icon')\n .data(chart.legend.rangeList)\n .enter().append('rect')\n .attr('class', function (d, i) { return 'ranged-' + i; })\n .attr('width', rangedLegend.blockWidth)\n .attr('height', rangedLegend.blockHeight)\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .style('fill', function (d, i) {\n if (d.color && d.color !== '') {\n return d.color;\n } else {\n return e.colors[i];\n }\n })\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = i * rangedLegend.blockHeight;\n }\n break;\n default:\n {\n xPos = i * rangedLegend.blockWidth;\n yPos = 0;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n })\n .on('click', function (d, i) {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .on('mouseenter', function (d, i) {\n //check whether the chart legend click has value\n if (chart.onLegendHover && options.onClickEnabled) {\n chart.onLegendHover(d, i, true);\n }\n })\n .on('mouseleave', function (d, i) {\n //check whether the chart legend click has value\n if (chart.onLegendHover && options.onClickEnabled) {\n chart.onLegendHover(d, i, false);\n }\n });\n\n //append range texts\n let texts = rangedLegend.svg.selectAll('.eve-legend-text')\n .data(chart.legend.rangeList)\n .enter().append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .style('text-anchor', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return 'middle';\n }\n })\n .text(function (d) { return d.text; })\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = rangedLegend.blockWidth + legendIconOffset;\n yPos = (i * rangedLegend.blockHeight) + rangedLegend.blockHeight / 2;\n }\n break;\n default:\n {\n xPos = (i * rangedLegend.blockWidth) + rangedLegend.blockWidth / 2;\n yPos = rangedLegend.blockHeight + tempTextSVGOffset.height;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n })\n .on('click', function (d, i) {\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, i);\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n });\n\n //append range boundaries\n rangedLegend.svg.selectAll('.eve-legend-line')\n .data(chart.legend.rangeList)\n .enter().append('rect')\n .attr('width', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return rangedLegend.blockWidth + legendIconOffset;\n default:\n return 2;\n }\n })\n .attr('height', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 2;\n default:\n return rangedLegend.blockHeight + legendIconOffset;\n }\n })\n .style('fill', 'rgb(0,0,0)')\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = i * rangedLegend.blockHeight;\n }\n break;\n default:\n {\n xPos = i * rangedLegend.blockWidth;\n yPos = 0;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //append last range boundary\n rangedLegend.svg.append('rect')\n .attr('width', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return rangedLegend.blockWidth + legendIconOffset;\n default:\n return 2;\n }\n })\n .attr('height', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 2;\n default:\n return rangedLegend.blockHeight + legendIconOffset;\n }\n })\n .style('fill', 'rgb(0,0,0)')\n .attr('transform', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = rangedLegend.blockHeight * chart.legend.rangeList.length - 2;\n }\n break;\n default:\n {\n xPos = rangedLegend.blockWidth * chart.legend.rangeList.length - 2;\n yPos = 0;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //append range boundary texts\n rangedLegend.svg.selectAll('.eve-legend-icon')\n .data(chart.legend.rangeList)\n .enter().append('text')\n .attr('class', 'eve-legend-icon')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return i === 0 ? 'start' : 'middle';\n }\n })\n .text(function (d) { return e.formatNumber(d.minValue, chart.legend.numberFormat); })\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = rangedLegend.blockWidth + legendIconOffset + 1;\n if (i === 0)\n yPos = (i * rangedLegend.blockHeight) + chart.legend.fontSize;\n else\n yPos = (i * rangedLegend.blockHeight) + (chart.legend.fontSize / 2);\n }\n break;\n default:\n {\n xPos = i * rangedLegend.blockWidth;\n yPos = rangedLegend.blockHeight + tempTextSVGOffset.height + 1;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //append last range boundary text\n rangedLegend.svg.append('text')\n .attr('class', 'eve-legend-icon')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return 'end';\n }\n })\n .text(e.formatNumber(chart.legend.rangeList[chart.legend.rangeList.length - 1].maxValue, chart.legend.numberFormat))\n .attr('transform', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = rangedLegend.blockWidth + legendIconOffset + 1;\n yPos = rangedLegend.blockHeight * chart.legend.rangeList.length + chart.legend.fontSize - tempTextSVGOffset.height;\n }\n break;\n default:\n {\n xPos = rangedLegend.blockWidth * chart.legend.rangeList.length + chart.legend.fontSize - tempTextSVGOffset.height;\n yPos = rangedLegend.blockHeight + tempTextSVGOffset.height + 1;\n }\n break;\n }\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //calculate automatic legend width\n switch (chart.legend.position) {\n case 'top':\n case 'bottom':\n {\n let valueTexts = rangedLegend.svg.selectAll('.eve-legend-icon'),\n valueWidths = [];\n\n valueTexts.each(function (d) {\n valueWidths.push(this.getBoundingClientRect().width);\n });\n\n texts.each(function (d, i) {\n let widthtoSubtract = 5;\n\n if (i === 0)\n widthtoSubtract += Math.max(valueWidths[i], valueWidths[i + 1] / 2);\n else if (i + 2 === valueWidths.length)\n widthtoSubtract += Math.max(valueWidths[i] / 2, valueWidths[i + 1]);\n else\n widthtoSubtract += Math.max(valueWidths[i] / 2, valueWidths[i + 1] / 2);\n\n widthtoSubtract *= 2;\n chart.wrapText(d3.select(this), rangedLegend.blockWidth - widthtoSubtract);\n\n });\n }\n break;\n }\n\n //get bbox of the svg\n tempDimensions = rangedLegend.svg.node().getBoundingClientRect();\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set legend size\n rangedLegend.height = tempDimensions.height + (options.legendSpace ? legendIconOffset : 0);\n rangedLegend.width = tempDimensions.width;\n //set overall legend sizes\n width = width < rangedLegend.width ? rangedLegend.width : width;\n height += rangedLegend.height;\n }\n break;\n default:\n {\n //set legend size\n rangedLegend.height = tempDimensions.height;\n rangedLegend.width = tempDimensions.width + (options.legendSpace ? legendIconOffset : 0);\n //set overall legend sizes\n width += rangedLegend.width;\n height = height < rangedLegend.height ? rangedLegend.height : height;\n }\n break;\n }\n }", "title": "" }, { "docid": "40f822bdf5b6ebdeffe2007bd49bfc10", "score": "0.70766693", "text": "updateRanges(min, max) {\n const bubbleLegendOptions = this.legend.options.bubbleLegend;\n bubbleLegendOptions.minSize = min;\n bubbleLegendOptions.maxSize = max;\n bubbleLegendOptions.ranges = this.getRanges();\n }", "title": "" }, { "docid": "40f822bdf5b6ebdeffe2007bd49bfc10", "score": "0.70766693", "text": "updateRanges(min, max) {\n const bubbleLegendOptions = this.legend.options.bubbleLegend;\n bubbleLegendOptions.minSize = min;\n bubbleLegendOptions.maxSize = max;\n bubbleLegendOptions.ranges = this.getRanges();\n }", "title": "" }, { "docid": "8cc48b7aaf723aa9397e619b10d29545", "score": "0.691684", "text": "function updateRangedLegend() {\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < rangedLegend.width ? rangedLegend.width : width;\n height += rangedLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += rangedLegend.width;\n height = height < rangedLegend.height ? rangedLegend.height : height;\n }\n break;\n }\n }", "title": "" }, { "docid": "e43a34c27b5088028854192822105d13", "score": "0.6912405", "text": "setOptions() {\n const ranges = this.ranges, options = this.options, series = this.chart.series[options.seriesIndex], baseline = this.legend.baseline, bubbleAttribs = {\n zIndex: options.zIndex,\n 'stroke-width': options.borderWidth\n }, connectorAttribs = {\n zIndex: options.zIndex,\n 'stroke-width': options.connectorWidth\n }, labelAttribs = {\n align: (this.legend.options.rtl ||\n options.labels.align === 'left') ? 'right' : 'left',\n zIndex: options.zIndex\n }, fillOpacity = series.options.marker.fillOpacity, styledMode = this.chart.styledMode;\n // Allow to parts of styles be used individually for range\n ranges.forEach(function (range, i) {\n if (!styledMode) {\n bubbleAttribs.stroke = pick(range.borderColor, options.borderColor, series.color);\n bubbleAttribs.fill = pick(range.color, options.color, fillOpacity !== 1 ?\n color(series.color).setOpacity(fillOpacity)\n .get('rgba') :\n series.color);\n connectorAttribs.stroke = pick(range.connectorColor, options.connectorColor, series.color);\n }\n // Set options needed for rendering each range\n ranges[i].radius = this.getRangeRadius(range.value);\n ranges[i] = merge(ranges[i], {\n center: (ranges[0].radius - ranges[i].radius +\n baseline)\n });\n if (!styledMode) {\n merge(true, ranges[i], {\n bubbleAttribs: merge(bubbleAttribs),\n connectorAttribs: merge(connectorAttribs),\n labelAttribs: labelAttribs\n });\n }\n }, this);\n }", "title": "" }, { "docid": "e43a34c27b5088028854192822105d13", "score": "0.6912405", "text": "setOptions() {\n const ranges = this.ranges, options = this.options, series = this.chart.series[options.seriesIndex], baseline = this.legend.baseline, bubbleAttribs = {\n zIndex: options.zIndex,\n 'stroke-width': options.borderWidth\n }, connectorAttribs = {\n zIndex: options.zIndex,\n 'stroke-width': options.connectorWidth\n }, labelAttribs = {\n align: (this.legend.options.rtl ||\n options.labels.align === 'left') ? 'right' : 'left',\n zIndex: options.zIndex\n }, fillOpacity = series.options.marker.fillOpacity, styledMode = this.chart.styledMode;\n // Allow to parts of styles be used individually for range\n ranges.forEach(function (range, i) {\n if (!styledMode) {\n bubbleAttribs.stroke = pick(range.borderColor, options.borderColor, series.color);\n bubbleAttribs.fill = pick(range.color, options.color, fillOpacity !== 1 ?\n color(series.color).setOpacity(fillOpacity)\n .get('rgba') :\n series.color);\n connectorAttribs.stroke = pick(range.connectorColor, options.connectorColor, series.color);\n }\n // Set options needed for rendering each range\n ranges[i].radius = this.getRangeRadius(range.value);\n ranges[i] = merge(ranges[i], {\n center: (ranges[0].radius - ranges[i].radius +\n baseline)\n });\n if (!styledMode) {\n merge(true, ranges[i], {\n bubbleAttribs: merge(bubbleAttribs),\n connectorAttribs: merge(connectorAttribs),\n labelAttribs: labelAttribs\n });\n }\n }, this);\n }", "title": "" }, { "docid": "ceb536d68aefd9f43003e5501a910156", "score": "0.62367785", "text": "function updateGradientLegend() {\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'map':\n {\n //switch chart type to process legend values\n switch (chart.type) {\n case 'ddCartogram':\n {\n //if there is no color field need to exit\n if (chart.series[0].colorField === '') return;\n\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value from user entry\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value from user entry\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n }\n break;\n default:\n {\n //set min and max legend values\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n\n //create multiples\n if (chart.type === 'multiples') {\n //check serie vis type\n switch (chart.series[0].type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n if (chart.yAxis.min != null && chart.yAxis.max != null)\n gradientLegend.minMax = [chart.yAxis.min, chart.yAxis.max];\n }\n break;\n }\n }\n\n //set label texts\n gradientLegend.minLabel.text(e.formatNumber(gradientLegend.minMax[0], chart.legend.numberFormat));\n gradientLegend.maxLabel.text(e.formatNumber(gradientLegend.minMax[1], chart.legend.numberFormat));\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < gradientLegend.width ? gradientLegend.width : width;\n height += gradientLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += gradientLegend.width;\n height = height < gradientLegend.height ? gradientLegend.height : height;\n }\n break;\n }\n }", "title": "" }, { "docid": "ec5948db3cc561e7895d9c79d32e1be2", "score": "0.61393404", "text": "render() {\n const legendItem = this.legendItem || {}, renderer = this.chart.renderer, zThreshold = this.options.zThreshold;\n if (!this.symbols) {\n this.symbols = {\n connectors: [],\n bubbleItems: [],\n labels: []\n };\n }\n // Nesting SVG groups to enable handleOverflow\n legendItem.symbol = renderer.g('bubble-legend');\n legendItem.label = renderer.g('bubble-legend-item');\n // To enable default 'hideOverlappingLabels' method\n legendItem.symbol.translateX = 0;\n legendItem.symbol.translateY = 0;\n // To use handleOverflow method\n legendItem.symbol.add(legendItem.label);\n legendItem.label.add(legendItem.group);\n for (const range of this.ranges) {\n if (range.value >= zThreshold) {\n this.renderRange(range);\n }\n }\n this.hideOverlappingLabels();\n }", "title": "" }, { "docid": "ec5948db3cc561e7895d9c79d32e1be2", "score": "0.61393404", "text": "render() {\n const legendItem = this.legendItem || {}, renderer = this.chart.renderer, zThreshold = this.options.zThreshold;\n if (!this.symbols) {\n this.symbols = {\n connectors: [],\n bubbleItems: [],\n labels: []\n };\n }\n // Nesting SVG groups to enable handleOverflow\n legendItem.symbol = renderer.g('bubble-legend');\n legendItem.label = renderer.g('bubble-legend-item');\n // To enable default 'hideOverlappingLabels' method\n legendItem.symbol.translateX = 0;\n legendItem.symbol.translateY = 0;\n // To use handleOverflow method\n legendItem.symbol.add(legendItem.label);\n legendItem.label.add(legendItem.group);\n for (const range of this.ranges) {\n if (range.value >= zThreshold) {\n this.renderRange(range);\n }\n }\n this.hideOverlappingLabels();\n }", "title": "" }, { "docid": "329c0d886f473a36aa1fa06d2d8d5863", "score": "0.60141194", "text": "function drawCircles() {\n\n // const minEl = document.getElementById('min');\n // const maxEl = document.getElementById('max');\n\n if ((prev == 250 && zoomLevel > 12) || (prev == 1000 && zoomLevel > 10)) {\n const countProp = prev == 250 ? 'count250' : 'count1000';\n const values = stationsInBounds.map(o => o[countProp]);\n max = Math.max(...values);\n min = Math.min(...values);\n }\n\n if ((prev == 1000 && zoomLevel > 10 || prev == 250 && zoomLevel > 12) && Math.abs(min) !== Infinity && Math.abs(max) !== Infinity) {\n document.getElementById('legend_Reference').style.display = 'block';\n // minEl.innerHTML = min === max && min !== 0 ? \"&emsp;\" : \"&emsp;\" + min;\n // maxEl.innerHTML = max !== 0 ? \"&emsp;\" + max : \"&emsp;\";\n\n stationsInBounds.forEach(e => {\n const fillColor = setColor(e.count250, e.count1000);\n circleRadii.addLayer(\n new L.circle(e._latlng, {\n className: 'radius',\n radius: prev,\n fillColor:fillColor,\n stroke: true,\n color: fillColor,\n opacity: 1,\n weight: 1,\n fillOpacity: 0.3\n }).bindPopup(popupMaker(e._latlng))\n );\n });\n }\n}", "title": "" }, { "docid": "fadae1e9e7ecc4e8193b12c10ce6105f", "score": "0.6008134", "text": "function createLegends(numero_extent, color, period) {\n\n if (loadAggregateData != 1) {\n d3.selectAll('g.legendEntry').remove();\n }\n let legend = svg.selectAll('g.legendEntry')\n .data(color.range())\n .enter()\n .append('g')\n .attr('class', 'legendEntry');\n\n legend\n .append('rect')\n .attr(\"x\", 20)\n .attr(\"y\", function (d, i) {\n return height - margin - i * 12.5;\n })\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 0.5)\n .style(\"fill\", function (d) {\n return d;\n });\n\n legend\n .append('text')\n .attr('font-size', 12)\n .attr(\"x\", 35)\n .attr(\"y\", function (d, i) {\n return height - margin - i * 12.5;\n })\n .attr(\"dy\", \"0.8em\")\n .text(function (d, i) {\n let extent = color.invertExtent(d);\n let format = d3.format(\".2s\");\n if (i == 0) {\n return 0.0 + \" < \" + format(+extent[1]);\n }\n if (i == d.length + 1) {\n return \"> \" + format(+extent[0]);\n }\n return format(+extent[0]) + \" - \" + format(+extent[1]);\n });\n\n if (loadAggregateData == 1) {\n let year = \"From 1998 to 2017\";\n loadAggregateData = 0;\n let label = d3.select(\"#label_map\");\n label.text(year);\n label = d3.select(\"#legend_map\");\n label.text(\"NUMBER OF FIRES\");\n }\n\n if (period != null) {\n loadAggregateData = 0;\n let label = d3.select(\"#label_map\");\n let from = String(period[0]);\n let to = String(period[1]);\n\n if (from.length < 6) {\n from = \"0\" + from[0] + \"/\" + from.substr(1, 4);\n } else {\n from = from.substr(0, 2) + \"/\" + from.substr(2, 4);\n }\n if (to.length < 6) {\n to = \"0\" + to[0] + \"/\" + to.substr(1, 4);\n } else {\n to = to.substr(0, 2) + \"/\" + to.substr(2, 4);\n }\n label.text(\"From \" + from + \" to \" + to);\n }\n}", "title": "" }, { "docid": "d8be7232ce38c6946144f90fb73d4a52", "score": "0.59868515", "text": "function sliderRanges(){\n\t// js-slider-range-price\n\tif ( $('.js-slider-range-price').length ){\n\t\tvar slider_range_price = $('.js-slider-range-price');\n\n\t\tslider_range_price.slider({\n\t\t\trange: true,\n\t\t\tmin: 1,\n\t\t\tmax: slider_range_price.data('max'),\n\t\t\tvalues: (function() {\t\n\t\t\t\tvar min = slider_range_price.data('start');\n\t\t\t\tvar max = slider_range_price.data('finish');\n\t\t\t\tvar res = [min, max];\n\t\t\t\treturn res;\n\t\t\t}()),\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tvar ui_from = ui.values[0];\n\t\t\t\tvar ui_to = ui.values[1];\n\n\t\t\t\t$('.js-slider-range-price-field-from').html('<span class=\"rub\">o</span> '+ ui_from);\n\t\t\t\t$('.js-slider-range-price-input-from').val(ui_from);\n\n\t\t\t\t$('.js-slider-range-price-field-to').html('<span class=\"rub\">o</span> '+ ui_to);\n\t\t\t\t$('.js-slider-range-price-input-to').val(ui_to);\n\t\t\t},\n\t\t\tchange: function( event, ui ) {\n\t\t\t\tvar ui_from = ui.values[0];\n\t\t\t\tvar ui_to = ui.values[1];\n\n\t\t\t\t$('.js-slider-range-price-field-from').html('<span class=\"rub\">o</span> '+ ui_from);\n\t\t\t\t$('.js-slider-range-price-input-from').val(ui_from);\n\n\t\t\t\t$('.js-slider-range-price-field-to').html('<span class=\"rub\">o</span> '+ ui_to);\n\t\t\t\t$('.js-slider-range-price-input-to').val(ui_to);\n\t\t\t}\n\t\t}).draggable();\n\n\t\t// from\n\t\t$('.js-slider-range-price-field-from').on('click',function(e){\n\t\t\t$(this).addClass('hidden');\n\t\t\t$('.js-slider-range-price-input-from').addClass('active').trigger('focus');\n\t\t});\n\t\t$('.js-slider-range-price-input-from').on('blur',function(){\n\t\t\tvar cur = $(this);\n\t\t\tvar cur_val = cur.val();\n\t\t\t\n\t\t\tcur.removeClass('active');\n\t\t\t$('.js-slider-range-price-field-from').html('<span class=\"rub\">o</span> '+ cur_val);\n\t\t\t$('.js-slider-range-price-field-from').removeClass('hidden');\n\n\t\t\tvar slider_range_price_cur_values = slider_range_price.slider('option','values');\n\t\t\tvar slider_range_price_cur_from = slider_range_price_cur_values[0];\n\t\t\tvar slider_range_price_cur_to = slider_range_price_cur_values[1];\n\n\t\t\tif ( cur_val > slider_range_price_cur_to )\n\t\t\t\tslider_range_price.slider('option','values',[cur_val,cur_val]);\n\t\t\telse\n\t\t\t\tslider_range_price.slider('option','values',[cur_val,slider_range_price_cur_to]);\n\t\t});\n\n\t\t// to\n\t\t$('.js-slider-range-price-field-to').on('click',function(e){\n\t\t\t$(this).addClass('hidden');\n\t\t\t$('.js-slider-range-price-input-to').addClass('active').trigger('focus');\n\t\t});\n\t\t$('.js-slider-range-price-input-to').on('blur',function(){\n\t\t\tvar cur = $(this);\n\t\t\tvar cur_val = cur.val();\n\t\t\t\n\t\t\tcur.removeClass('active');\n\t\t\t$('.js-slider-range-price-field-to').html('<span class=\"rub\">o</span> '+ cur_val);\n\t\t\t$('.js-slider-range-price-field-to').removeClass('hidden');\n\n\t\t\tvar slider_range_price_cur_values = slider_range_price.slider('option','values');\n\t\t\tvar slider_range_price_cur_from = slider_range_price_cur_values[0];\n\t\t\tvar slider_range_price_cur_to = slider_range_price_cur_values[1];\n\n\t\t\tif ( cur_val < slider_range_price_cur_from )\n\t\t\t\tslider_range_price.slider('option','values',[cur_val,cur_val]);\n\t\t\telse\n\t\t\t\tslider_range_price.slider('option','values',[slider_range_price_cur_from,cur_val]);\n\t\t});\n\t}\n\n\t// js-slider-range-time\n\tif ( $('.js-slider-range-time').length ){\n\t\tvar slider_range_time = $('.js-slider-range-time');\n\n\t\tslider_range_time.slider({\n\t\t\trange: true,\n\t\t\tmin: 6,\n\t\t\tmax: 30,\n\t\t\tvalues: [ 8, 20 ],\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tvar ui_from = ui.values[0];\n\t\t\t\tvar ui_to = ui.values[1];\n\n\t\t\t\tif ( ui_from > 23 ){\n\t\t\t\t\tui_from = ui_from - 24;\n\t\t\t\t}\n\t\t\t\tif ( ui_from < 10 )\n\t\t\t\t\tui_from = '0'+ui_from+':00';\n\t\t\t\telse\n\t\t\t\t\tui_from = ui_from+':00';\n\n\t\t\t\tif ( ui_to > 23 ){\n\t\t\t\t\tui_to = ui_to - 24;\n\t\t\t\t}\n\t\t\t\tif ( ui_to < 10 )\n\t\t\t\t\tui_to = '0'+ui_to+':00';\n\t\t\t\telse\n\t\t\t\t\tui_to = ui_to+':00';\n\n\n\t\t\t\t$('.js-slider-range-item-from').html(ui_from);\n\t\t\t\t$('.js-slider-range-item-to').html(ui_to);\n\t\t\t},\n\t\t\tchange: function( event, ui ) {\n\t\t\t\t\n\t\t\t}\n\t\t}).draggable();\n\t}\n}", "title": "" }, { "docid": "59beb210c9a5374bf17f0f0125ac18f4", "score": "0.5941708", "text": "function drawLegend(periods) {\n\n var adjustX = 1230;\n\n var legend = svg.selectAll(\".legend\")\n .data(periods)\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d,i) {\n xOff = (i % 5) * 210\n yOff = Math.floor(i / 5)\n return \"translate(\" + xOff + \",\" + yOff + \")\"});\n\n legend.append(\"rect\")\n .attr(\"x\", width-adjustX-59)\n .attr(\"y\", -65)\n .attr(\"width\", 24)\n .attr(\"height\", 24)\n .style(\"fill\", function(d, i) {return color(i)});\n\n legend.append(\"text\")\n .attr(\"x\", width-adjustX-29)\n .attr(\"y\", -47)\n .style(\"text-anchor\", \"start\")\n .style(\"font-size\",\"1.5em\")\n .text(function(d, i) { return periods[i]});\n\n }", "title": "" }, { "docid": "a70a46bf4a108687ee18097f18b0062a", "score": "0.5894459", "text": "function createGradientLegend(options) {\n //declare needed variables\n let textColors = [chart.legend.fontColor, chart.legend.fontColor];\n\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'map':\n {\n //switch chart type to process legend values\n switch (chart.type) {\n case 'ddCartogram':\n {\n //if there is no color field need to exit\n if (chart.series[0].colorField === '') return;\n\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value from user entry\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value from user entry\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n }\n break;\n default:\n {\n //set min and max legend values\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n\n //create multiples\n if (chart.type === 'multiples') {\n //check serie vis type\n switch (chart.series[0].type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n if (chart.yAxis.min != null && chart.yAxis.max != null)\n gradientLegend.minMax = [chart.yAxis.min, chart.yAxis.max];\n }\n break;\n }\n }\n\n //handle min max\n if (chart.type === 'multiples') {\n //update legend values\n updateMultipleDataForLegend();\n\n //extract min max from multiple data content\n gradientLegend.minMax = [minMeasure, maxMeasure];\n }\n\n //set temp text value\n tempTextValue = e.formatNumber(gradientLegend.minMax[1], chart.legend.numberFormat);\n gradientLegend.percentage = Math.ceil(100 / (chart.legend.gradientColors.length - 1));\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //append gradient Legend g\n gradientLegend.svg = legendG.append('g');\n\n //calculate automatic legend width\n //switch legend position to setup the min and max stops\n //determine text colors\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //calculate legend dimension\n gradientLegend.width = gradientLegend.dimension + legendIconOffset * 2 + tempTextSVGOffset.width;\n gradientLegend.height = (sizes.maxHeight - plot.top - plot.bottom) - height - (options.legendSpace ? legendIconOffset : 0) - 5;\n gradientLegend.blockHeight = gradientLegend.height;\n gradientLegend.blockWidth = gradientLegend.dimension;\n //create legend gradient\n gradientLegend.gradient = legendSvg\n .append('defs')\n .append('linearGradient')\n .attr('x1', '0%')\n .attr('y1', '0%')\n .attr('x2', '0%')\n .attr('y2', '100%')\n .attr('id', 'gradient' + chart.container);\n }\n break;\n default:\n {\n //calculate legend dimension\n gradientLegend.width = (sizes.maxWidth - plot.right - plot.left) - width - (options.legendSpace ? legendIconOffset : 0) - 5;\n gradientLegend.height = Math.max(gradientLegend.dimension, tempTextSVGOffset.height) + legendIconOffset * 2;\n gradientLegend.blockHeight = Math.max(gradientLegend.dimension, tempTextSVGOffset.height);\n gradientLegend.blockWidth = gradientLegend.width;\n //create legend gradient\n gradientLegend.gradient = legendSvg\n .append('defs')\n .append('linearGradient')\n .attr('x1', '0%')\n .attr('y1', '0%')\n .attr('x2', '100%')\n .attr('y2', '0%')\n .attr('id', 'gradient' + chart.container);\n if (chart.legend.smartLabels) {\n //set autoColor if applicable\n textColors[0] = chart.getAutoColor(chart.legend.gradientColors[0]);\n textColors[1] = chart.getAutoColor(chart.legend.gradientColors[chart.legend.gradientColors.length - 1]);\n }\n }\n break;\n }\n\n //add color stops to gradient\n gradientLegend.gradient.selectAll('stop')\n .data(chart.legend.gradientColors)\n .enter().append('stop')\n .attr('offset', function (d, i) {\n if (i === chart.legend.gradientColors.length - 1)\n return '100%';\n else\n return (i * gradientLegend.percentage) + '%';\n })\n .attr('stop-color', function (d) {\n return d;\n });\n\n //append gradient rect\n gradientLegend.svg.append('rect')\n .attr('width', gradientLegend.blockWidth)\n .attr('height', gradientLegend.blockHeight)\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .style('fill', 'url(#gradient' + chart.container + ')');\n\n //add minimum text\n gradientLegend.minLabel = gradientLegend.svg.append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', textColors[0])\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', 'start')\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .text(e.formatNumber(gradientLegend.minMax[0], chart.legend.numberFormat))\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = gradientLegend.blockWidth + legendIconOffset;\n yPos = tempTextSVGOffset.height;\n }\n break;\n default:\n {\n xPos = 3;\n yPos = gradientLegend.blockHeight - 3;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //add maximum text\n gradientLegend.maxLabel = gradientLegend.svg.append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', textColors[1])\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return 'end';\n }\n })\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .text(e.formatNumber(gradientLegend.minMax[1], chart.legend.numberFormat))\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = gradientLegend.blockWidth + legendIconOffset;\n yPos = gradientLegend.blockHeight + chart.legend.fontSize - tempTextSVGOffset.height;\n }\n break;\n default:\n {\n xPos = gradientLegend.blockWidth - 3;\n yPos = gradientLegend.blockHeight - 3;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //get bbox of the svg\n tempDimensions = gradientLegend.svg.node().getBoundingClientRect();\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set legend size\n gradientLegend.height = tempDimensions.height + (options.legendSpace ? legendIconOffset : 0);\n gradientLegend.width = tempDimensions.width;\n\n //set overall legend sizes\n width = width < gradientLegend.width ? gradientLegend.width : width;\n height += gradientLegend.height;\n }\n break;\n default:\n {\n //set legend size\n gradientLegend.height = tempDimensions.height;\n gradientLegend.width = tempDimensions.width + (options.legendSpace ? legendIconOffset : 0);\n\n //set overall legend sizes\n width += gradientLegend.width;\n height = height < gradientLegend.height ? gradientLegend.height : height;\n }\n break;\n }\n }", "title": "" }, { "docid": "ffe4d5c4aa8acb9c405cb34a23dca65b", "score": "0.58348197", "text": "function updateLegend(){\n\tmagnitude = [0, 0.1, 0.5, 1, 5, 10, 20, 50, 100, 500, 1000];\n\tmagnitudeRanges = [\"0-0.1\", \">0.1-0.5\", \">0.5-1\", \">1-5\", \">5-10\", \">10-20\", \">20-50\", \">50-100\", \">100-500\", \">500-1000\", \"1000+\"]\n\tlabels = [];\n\n\t// add magnitude color and magnitudeRanges to the 'labels' array\n\tmagnitude.forEach(function(mag, index){\n\t\tlabels.push(\"<li style=\\\"background:\"\n\t\t\t+ ChooseColor(mag) + \"\\\"></li><text> \" + magnitudeRanges[index]\n\t\t\t+ \"</text><br>\");\n\t});\n\n\t// div.innerHTML += \"<ul>\" + labels.join(\"\") + \"</ul>\";\n\tdocument.querySelector('.legend').innerHTML += \"<ul>\" + labels.join(\"\") + \"</ul>\";\n}", "title": "" }, { "docid": "289a5d6b949b704b3e2046531905fb7a", "score": "0.5808293", "text": "function handleRange(element) {\n var onAction;\n var containerEl = document.getElementById(element.getAttribute('data-container'));\n var startAtEl = document.getElementById(element.getAttribute('data-start'));\n var endAtEl = document.getElementById(element.getAttribute('data-end'));\n var rangeEls = containerEl.querySelectorAll('.opening-form');\n\n function onAction(element) {\n var startAt = $(startAtEl).data('DateTimePicker').date();\n var endAt = $(endAtEl).data('DateTimePicker').date();\n\n for (var i = 0; i < rangeEls.length; i++) {\n if (rangeEls[i].classList.contains('hide') === false) {\n rangeEls[i].classList.add('hide'); // Hide all ranges\n }\n }\n\n if (endAt >= startAt) {\n var x = 7; // Useless to loop more than 7 times\n var showRangeEls = [];\n\n for (var dayIterator = moment(startAt); dayIterator <= endAt; dayIterator.add(1, 'days')) {\n if (x === 0) break;\n for (var i = 0; i < rangeEls.length; i++) {\n if (rangeEls[i].classList.contains('range-' + dayIterator.day())) {\n rangeEls[i].classList.remove('hide');\n showRangeEls.push(rangeEls[i]); // Build array of showed elements\n }\n }\n x--;\n }\n\n $.each($(rangeEls).not(showRangeEls).get(), function () {\n $(this).find('select').each(function () { // Reset ONLY old ranges\n $(this).val('');\n }\n );\n });\n }\n };\n\n $(startAtEl).on('dp.change', function (event) { onAction(this); });\n $(endAtEl).on('dp.change', function (event) { onAction(this); });\n onAction(element);\n }", "title": "" }, { "docid": "812829b0664016005bef157d4a283e80", "score": "0.57957137", "text": "correctSizes() {\n const legend = this.legend, chart = this.chart, bubbleSeries = chart.series[this.options.seriesIndex], pxSizes = bubbleSeries.getPxExtremes(), bubbleSeriesSize = pxSizes.maxPxSize, bubbleLegendSize = this.options.maxSize;\n if (Math.abs(Math.ceil(bubbleSeriesSize) - bubbleLegendSize) >\n 1) {\n this.updateRanges(this.options.minSize, pxSizes.maxPxSize);\n legend.render();\n }\n }", "title": "" }, { "docid": "812829b0664016005bef157d4a283e80", "score": "0.57957137", "text": "correctSizes() {\n const legend = this.legend, chart = this.chart, bubbleSeries = chart.series[this.options.seriesIndex], pxSizes = bubbleSeries.getPxExtremes(), bubbleSeriesSize = pxSizes.maxPxSize, bubbleLegendSize = this.options.maxSize;\n if (Math.abs(Math.ceil(bubbleSeriesSize) - bubbleLegendSize) >\n 1) {\n this.updateRanges(this.options.minSize, pxSizes.maxPxSize);\n legend.render();\n }\n }", "title": "" }, { "docid": "87ca52ef670b16d13c026f8377f7904a", "score": "0.57949984", "text": "function initializeRangeSliders() {\n $.each( $(\"div.slider-range-container\"), function() {\n var low_min = $(this).data(\"low-min\");\n var low_max = $(this).data(\"low-max\");\n var high_min = $(this).data(\"high-min\");\n var high_max = $(this).data(\"high-max\");\n var uom = $(this).data(\"uom\");\n var secondary_uom = $(this).data(\"secondary-uom\");\n var secondary_uom_formula = $(this).data(\"secondary-uom-formula\");\n var slider_low = $(this).children(\"div.slider-range-low\");\n var slider_high = $(this).children(\"div.slider-range-high\");\n var range_label = $(this).children(\"div.range-label\");\n var filter_name = $(this).attr(\"data-filtername\");\n var stepsize = $(this).attr(\"data-stepsize\");\n var slider_value_low = low_max;\n var alt_slider_value_low = \"\";\n var slider_value_high = high_min;\n var alt_slider_value_high = \"\";\n\n var session_filter_data = JSON.parse(sessionStorage.getItem('range_filter_data'));\n if (session_filter_data && session_filter_data[filter_name]) {\n range_filter_data[filter_name] = session_filter_data[filter_name];\n } else {\n range_filter_data[filter_name] = {\n default_low: low_max,\n selected_low: low_max,\n default_high: high_min,\n selected_high: high_min\n };\n }\n\n slider_low.slider({\n range: false,\n min: low_min,\n max: low_max,\n value: range_filter_data[filter_name][\"selected_low\"],\n step: parseInt(stepsize),\n slide: function(event, ui) {\n slider_value_low = ui.value;\n slider_values = slider_value_low + \" - \" + slider_value_high + \" \" + uom;\n if (secondary_uom.length && secondary_uom_formula.length) {\n alt_slider_value_low = eval(ui.value + secondary_uom_formula).toFixed(1);\n slider_values += \" / \" + alt_slider_value_low + \" - \" + alt_slider_value_high + \" \" + secondary_uom;\n }\n range_label.html(slider_values);\n },\n change: function(event, ui) {\n range_filter_data[filter_name][\"selected_low\"] = ui.value;\n sessionStorage.setItem('range_filter_data', JSON.stringify(range_filter_data));\n performFilter();\n }\n });\n\n slider_high.slider({\n range: false,\n min: high_min,\n max: high_max,\n value: range_filter_data[filter_name][\"selected_high\"],\n step: parseInt(stepsize),\n slide: function(event, ui) {\n slider_value_high = ui.value;\n slider_values = slider_value_low + \" - \" + slider_value_high + \" \" + uom;\n if (secondary_uom.length && secondary_uom_formula.length) {\n alt_slider_value_high = eval(ui.value + secondary_uom_formula).toFixed(1);\n slider_values += \" / \" + alt_slider_value_low + \" - \" + alt_slider_value_high + \" \" + secondary_uom;\n }\n range_label.html(slider_values);\n },\n change: function(event, ui) {\n range_filter_data[filter_name][\"selected_high\"] = ui.value;\n sessionStorage.setItem('range_filter_data', JSON.stringify(range_filter_data));\n performFilter();\n }\n });\n\n // Setting the labels on initialize\n range_label_value = slider_low.slider(\"value\") + \" - \" + slider_high.slider(\"value\") + \" \" + uom\n if (secondary_uom.length && secondary_uom_formula.length) {\n alt_slider_value_low = eval(slider_low.slider(\"value\") + secondary_uom_formula).toFixed(1);\n alt_slider_value_high = eval(slider_high.slider(\"value\") + secondary_uom_formula).toFixed(1);\n range_label_value += \" / \" + alt_slider_value_low + \" - \" + alt_slider_value_high + \" \" + secondary_uom;\n }\n range_label.html(range_label_value);\n\n });\n sessionStorage.setItem('range_filter_data', JSON.stringify(range_filter_data));\n}", "title": "" }, { "docid": "950265fd3aa59c46e3f9d5afcd4ff633", "score": "0.57814074", "text": "function handleRangeData(){\n sendLabelRed.value = sendInputRangeRed.value;\n sendLabelGreen.value = sendInputRangeGreen.value;\n sendLabelBlue.value = sendInputRangeBlue.value;\n getData();\n}", "title": "" }, { "docid": "85b572188aaf882e208c69d843fba3b8", "score": "0.57588476", "text": "function filterRangeGeoUnits(nullCheck, num, fromVal, toVal)\r\n\t\t\t{\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t// create local variables\t\r\n\t\t\t\tvar legendPolygon;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t// for each GEOUNIT element listed in data.js\r\n\t\t\t\tfor(var i=0; i<numElements; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t// certain conditions arise\r\n\t\t\t\t\tif ( /*( nullCheck == -1 && ukData.features[i].properties.datavalues[selectedDatasetIndex][selectedYearIndex] == null ) ||*/\r\n\t\t\t\t\t\t ( nullCheck != -1 && ukData.features[i].properties.datavalues[selectedDatasetIndex][selectedYearIndex] != null ) &&\r\n\t\t\t\t\t\t ( nullCheck == 0 && ukData.features[i].properties.datavalues[selectedDatasetIndex][selectedYearIndex] >= fromVal &&\r\n\t\t\t\t\t\t \tukData.features[i].properties.datavalues[selectedDatasetIndex][selectedYearIndex] < toVal ) )\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\t// pick out geometry information from data.js for GEOUNIT selected through iteration\r\n\t\t\t\t\t\tgeomType = ukData.features[i].geometry;\r\n\t\t\t\t\t\t\r\n\t\r\n\t\t\t\t\t\t // define new polygon and CSS attribution for highlight polygon\r\n\t\t\t\t\t\t // solid fill, no outline. Used to highlight polygons in the grade range over which user has hovered in LOWER RIGHT legend ...\r\n\t\t\t\t\t\tlegendPolygon = new L.GeoJSON(geomType);\r\n\t\t\t\t\t\tlegendPolygon.setStyle({\r\n\t\t\t\t\t\t\tweight: 0,\r\n\t\t\t\t\t\t\tcolor: compColour,\r\n\t\t\t\t\t\t\tdashArray: '',\r\n\t\t\t\t\t\t\tfillOpacity: 0.75,\r\n\t\t\t\t\t\t\topacity: 1.0\r\n\t\t\t\t\t\t});\r\n\t\r\n\t\r\n\t\t\t\t\t\t// if sub array of markedPolys array is not yet defined\r\n\t\t\t\t\t\tif ( typeof markedPolys[num] === 'undefined' ) { markedPolys[num] = new Array(); }\r\n\t\r\n\t\r\n\t\t\t\t\t\t// push new polygon onto markedPolys subu array\r\n\t\t\t\t\t\tmarkedPolys[num].push(legendPolygon);\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// else if user hovers over null band in legend \r\n\t\t\t\t\telse if ( ( nullCheck == -1 && ukData.features[i].properties.datavalues[selectedDatasetIndex][selectedYearIndex] == null ) ) \r\n\t\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t// pick out geometry information from data.js for GEOUNIT selected through iteration\r\n\t\t\t\t\t\tgeomType = ukData.features[i].geometry;\r\n\t\t\t\t\t\t\r\n\t\r\n\t\t\t\t\t\t // define new polygon and CSS attribution for highlight polygon\r\n\t\t\t\t\t\t // solid fill, no outline. Used to highlight polygons in the grade range over which user has hovered in LOWER RIGHT legend ...\r\n\t\t\t\t\t\tlegendPolygon = new L.GeoJSON(geomType);\r\n\t\t\t\t\t\tlegendPolygon.setStyle({\r\n\t\t\t\t\t\t\tweight: 0,\r\n\t\t\t\t\t\t\tcolor: compColour,\r\n\t\t\t\t\t\t\tdashArray: '',\r\n\t\t\t\t\t\t\tfillOpacity: 0.75,\r\n\t\t\t\t\t\t\topacity: 1.0\r\n\t\t\t\t\t\t});\r\n\t\r\n\t\r\n\t\t\t\t\t\t// if sub array of markedPolys array is not yet defined\r\n\t\t\t\t\t\tif ( typeof markedPolys[num] === 'undefined' ) { markedPolys[num] = new Array(); }\r\n\t\r\n\t\r\n\t\t\t\t\t\t// push new polygon onto markedPolys subu array\r\n\t\t\t\t\t\tmarkedPolys[num].push(legendPolygon);\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\t\r\n\t\t\t\t\t// else do nothing\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t// else do nothing\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}", "title": "" }, { "docid": "670d75a388ce2c8aff2bce4e6f4ede59", "score": "0.5725124", "text": "function erzeugeRange(anzahl, minVal, maxVal){\r\n for(let i = 0; i < anzahl; i++){\r\n let div = document.createElement(\"div\");\r\n let range = document.createElement(\"input\");\r\n range.type = \"range\";\r\n range.min = minVal;\r\n range.max = maxVal;\r\n range.step = 1;\r\n if(i == 0) range.value = parseInt(min);\r\n else range.value = parseInt(max);\r\n let rangeAusgabe = document.createElement(\"span\");\r\n rangeAusgabe.textContent = range.value;\r\n div.appendChild(range);\r\n div.appendChild(rangeAusgabe);\r\n rangeContainer.appendChild(div);\r\n range.addEventListener(\"change\", function(){\r\n updateRange(anzahl);\r\n });\r\n }\r\n } //Ende erzeuge Ranges", "title": "" }, { "docid": "b0d98da74aaeef30be69a2fd69c6f7fc", "score": "0.56922925", "text": "render() {\n const legend = this, chart = legend.chart, renderer = chart.renderer, options = legend.options, padding = legend.padding, \n // add each series or point\n allItems = legend.getAllItems();\n let display, legendWidth, legendHeight, legendGroup = legend.group, allowedWidth, box = legend.box;\n legend.itemX = padding;\n legend.itemY = legend.initialItemY;\n legend.offsetWidth = 0;\n legend.lastItemY = 0;\n legend.widthOption = relativeLength(options.width, chart.spacingBox.width - padding);\n // Compute how wide the legend is allowed to be\n allowedWidth = chart.spacingBox.width - 2 * padding - options.x;\n if (['rm', 'lm'].indexOf(legend.getAlignment().substring(0, 2)) > -1) {\n allowedWidth /= 2;\n }\n legend.maxLegendWidth = legend.widthOption || allowedWidth;\n if (!legendGroup) {\n /**\n * SVG group of the legend.\n *\n * @readonly\n * @name Highcharts.Legend#group\n * @type {Highcharts.SVGElement}\n */\n legend.group = legendGroup = renderer\n .g('legend')\n .addClass(options.className || '')\n .attr({ zIndex: 7 })\n .add();\n legend.contentGroup = renderer\n .g()\n .attr({ zIndex: 1 }) // above background\n .add(legendGroup);\n legend.scrollGroup = renderer\n .g()\n .add(legend.contentGroup);\n }\n legend.renderTitle();\n // sort by legendIndex\n stableSort(allItems, (a, b) => ((a.options && a.options.legendIndex) || 0) -\n ((b.options && b.options.legendIndex) || 0));\n // reversed legend\n if (options.reversed) {\n allItems.reverse();\n }\n /**\n * All items for the legend, which is an array of series for most series\n * and an array of points for pie series and its derivatives.\n *\n * @readonly\n * @name Highcharts.Legend#allItems\n * @type {Array<(Highcharts.Point|Highcharts.Series)>}\n */\n legend.allItems = allItems;\n legend.display = display = !!allItems.length;\n // Render the items. First we run a loop to set the text and properties\n // and read all the bounding boxes. The next loop computes the item\n // positions based on the bounding boxes.\n legend.lastLineHeight = 0;\n legend.maxItemWidth = 0;\n legend.totalItemWidth = 0;\n legend.itemHeight = 0;\n allItems.forEach(legend.renderItem, legend);\n allItems.forEach(legend.layoutItem, legend);\n // Get the box\n legendWidth = (legend.widthOption || legend.offsetWidth) + padding;\n legendHeight = legend.lastItemY + legend.lastLineHeight +\n legend.titleHeight;\n legendHeight = legend.handleOverflow(legendHeight);\n legendHeight += padding;\n // Draw the border and/or background\n if (!box) {\n /**\n * SVG element of the legend box.\n *\n * @readonly\n * @name Highcharts.Legend#box\n * @type {Highcharts.SVGElement}\n */\n legend.box = box = renderer.rect()\n .addClass('highcharts-legend-box')\n .attr({\n r: options.borderRadius\n })\n .add(legendGroup);\n }\n // Presentational\n if (!chart.styledMode) {\n box\n .attr({\n stroke: options.borderColor,\n 'stroke-width': options.borderWidth || 0,\n fill: options.backgroundColor || 'none'\n })\n .shadow(options.shadow);\n }\n if (legendWidth > 0 && legendHeight > 0) {\n box[box.placed ? 'animate' : 'attr'](box.crisp.call({}, {\n x: 0,\n y: 0,\n width: legendWidth,\n height: legendHeight\n }, box.strokeWidth()));\n }\n // hide the border if no items\n legendGroup[display ? 'show' : 'hide']();\n // Open for responsiveness\n if (chart.styledMode && legendGroup.getStyle('display') === 'none') {\n legendWidth = legendHeight = 0;\n }\n legend.legendWidth = legendWidth;\n legend.legendHeight = legendHeight;\n if (display) {\n legend.align();\n }\n if (!this.proximate) {\n this.positionItems();\n }\n fireEvent(this, 'afterRender');\n }", "title": "" }, { "docid": "042281183b6dc8ae94fc533d1e457258", "score": "0.56484514", "text": "function createLegend(color, countMin, countMax) {\n var legendX1 = 600,\n legendWidth = 30,\n lengendY1 = 100,\n legendHeight = 200;\n var svg = d3.select('#headmapsvg');\n svg.append(\"g\")\n .append(\"defs\")\n .append(\"linearGradient\")\n .attr(\"id\",\"linearGradient\")\n .attr(\"x1\",\"0%\")\n .attr(\"x2\",\"0%\")\n .attr(\"y2\",\"0%\")\n .attr(\"y1\",\"100%\"); \n var stopvalGenerator = d3.interpolateNumber(countMin, countMax); \n var stopColors = []; \n for (var i = 0; i <=1.01; i +=0.01) {\n stopColors.push({perc: i, stopColorVal: stopvalGenerator(i)});\n } \n console.log(stopColors.length);\n var stops = d3.select('#linearGradient')\n .selectAll('stop')\n .data(stopColors)\n .enter()\n .append('stop')\n .attr('offset',function(d) {\n return d.perc;\n })\n .attr('stop-color', function(d) {\n return color(d.stopColorVal);\n });\n // lengend bar \n var legend = svg.append(\"g\").attr(\"id\", \"legend\");\n legend.append(\"rect\")\n .attr(\"fill\",\"url(#linearGradient)\")\n .attr(\"x\",legendX1)\n .attr(\"y\",lengendY1)\n .attr(\"width\",legendWidth)\n .attr(\"height\",legendHeight);\n //add text on either side of the bar\n var p = d3.precisionFixed(1);\n var intFormat = d3.format(\".\" + p + \"f\");\n for (var i = 0; i<=100; i += 25 ){\n legend.append(\"text\")\n .attr(\"class\",\"legendText\")\n .attr(\"class\",\"legendText\")\n .attr(\"text-anchor\", \"left\")\n .attr(\"x\",legendX1 + legendWidth + 15)\n .attr(\"y\",lengendY1 + legendHeight * (100-i) / 100)\n .attr(\"dy\",0)\n .text(intFormat(stopColors[i].stopColorVal));\n }\n}", "title": "" }, { "docid": "db6dfa67e9dfd5cd58d678ff2f02570b", "score": "0.56280327", "text": "function setRangeLabels() {\n minValue.innerText = sliderInput.min;\n maxValue.innerText = sliderInput.max;\n }", "title": "" }, { "docid": "9bcf0ae5b02ddfa3cefe9b75072b4279", "score": "0.56182015", "text": "function makeLegend (select, color, min, max, ticks, start, stop) {\r\n var width = 200;\r\n var height = 550;\r\n var defs = d3.select(select)\r\n .append('defs');\r\n\r\n var svg = defs.append('svg')\r\n .attr('width', width)\r\n .attr('height', height)\r\n .append('g')\r\n .attr('class', 'legend');\r\n\r\n\r\n var linearGradient = svg.append('linearGradient')\r\n .attr('id', 'linear-gradient' + stop);\r\n\r\n // chosen horizontal gradient\r\n linearGradient\r\n .attr(\"x1\", \"0%\")\r\n .attr(\"y1\", \"0%\")\r\n .attr(\"x2\", \"0%\")\r\n .attr(\"y2\", \"100%\");\r\n\r\n // set the color for the start\r\n linearGradient.append('stop')\r\n .attr('offset', '0%')\r\n .attr('stop-color', start);\r\n\r\n // set the color for the end\r\n linearGradient.append('stop')\r\n .attr('offset', '100%')\r\n .attr('stop-color', stop);\r\n\r\n // draw the rectangle and fill with gradient\r\n svg.append('rect')\r\n .attr('width', 20)\r\n .attr('x', 50)\r\n .attr('y', 15)\r\n .attr('height', height)\r\n .style('fill', 'url(#linear-gradient' + stop + ')');\r\n\r\n //Set scale for x-axis\r\n var xScale = d3.scaleLinear()\r\n \t .range([0, height - 10])\r\n \t .domain([Math.round(min), Math.round(max)]);\r\n\r\n // make xAxis\r\n var xAxis = d3.axisLeft(xScale)\r\n .ticks(ticks);\r\n\r\n svg.append('g')\r\n .attr('class', 'x axis')\r\n .attr('transform', 'translate('+ 50 + ',' + 15 + ')')\r\n .call(xAxis);\r\n}", "title": "" }, { "docid": "bd521897ebccc85dcbe76d4d576b44e3", "score": "0.5582729", "text": "function addListenersToSliderRanges(){\n document.querySelector('#singleband-value-lower').addEventListener(\n 'change',\n function(){STATE.current_singleband_stretch[0] = parseFloat(this.value);}\n );\n document.querySelector('#singleband-value-upper').addEventListener(\n 'change',\n function(){STATE.current_singleband_stretch[1] = parseFloat(this.value);}\n );\n\n const rgbIds = ['R', 'G', 'B'];\n const handles = ['lower', 'upper'];\n for (let i = 0; i < rgbIds.length; i++) {\n for (let j = 0; j < handles.length; j++) {\n let rgbInput = document.querySelector(`.rgb-value-${handles[j]}#${rgbIds[i]}`);\n rgbInput.addEventListener(\n 'change',\n function () { STATE.current_rgb_stretch[i][j] = parseFloat(this.value); }\n );\n }\n }\n}", "title": "" }, { "docid": "381123a78d5553aec961ba4ef3783e5c", "score": "0.55740166", "text": "function setDeltaColorRange(delta_option){\n\n if(delta_option == \"DeltaTimeDelta\"){\n delta_MIN_threshold = -0.05;\n delta_MAX_threshold = 0.05;\n animation_track_color = d3.scaleLinear().domain([delta_MIN_threshold , 0, delta_MAX_threshold]).range(['green', 'rgba(255,255,255, 0.7)', 'red']);\n\n }else if(delta_option == \"DeltaGPS_Speed\"){\n delta_MIN_threshold = -5;\n delta_MAX_threshold = 5;\n animation_track_color = d3.scaleLinear().domain([delta_MIN_threshold, 0, delta_MAX_threshold]).range(['red', 'rgba(255,255,255, 0.7)', 'green']);\n }else if(delta_option == \"DeltaGripUsage\"){\n delta_MIN_threshold = -5;\n delta_MAX_threshold = 5;\n animation_track_color = d3.scaleLinear().domain([delta_MIN_threshold, 0, delta_MAX_threshold]).range(['red', 'rgba(255,255,255, 0.7)', 'green']);\n } else if(delta_option == \"GripUsageA\" || delta_option == \"GripUsageB\"){\n delta_MIN_threshold = 20;\n delta_MAX_threshold = 100;\n animation_track_color = d3.scaleLinear().domain([0, 100]).range(['yellow', 'red']);\n // animation_track_color = d3.scaleLinear().domain([0, 100]).range(['WhiteSmoke', 'red']);\n }\n else if(delta_option == \"OFF\"){\n // nothing;\n }\n\n}", "title": "" }, { "docid": "fe7b0364635a21e9e3e1b7d13fb6a3eb", "score": "0.5556206", "text": "function legendGradient (svg, ref) {\n\n var width = 160,\n height = 12;\n // append a defs (for definition) element to your SVG\n var defs = svg.append('defs');\n\n // append a linearGradient element to the defs and give it a unique id\n var linearGradient = defs.append('linearGradient').attr('id', 'linear-gradient');\n\n // horizontal gradient\n linearGradient.attr({\n x1: '0%',\n y1: '0%',\n x2: '100%',\n y2: '0%'\n });\n\n // set the color for the start (0%)\n linearGradient.append('stop').attr('offset', '0%').attr('stop-color', ref.colourRange[0]);\n\n // set the color for the mid (50%)\n linearGradient.append('stop').attr('offset', '50%').attr('stop-color', ref.colourRange[1]);\n\n // set the color for the end (100%)\n linearGradient.append('stop').attr('offset', '100%').attr('stop-color', ref.colourRange[2]);\n\n // draw the rectangle and fill with gradient\n // color Legend container\n var legendsvg = svg.selectAll('.legend-gradient').data([0]);\n\n legendsvg.enter().append('g').attr({\n class: 'legend-gradient',\n transform: 'translate(' + 30 + ',' + (ref.svgHeight - 30) + ')'\n }).append('rect').attr({\n class: 'legendRect',\n width: width,\n height: height,\n x: 0,\n y: 0\n }).style('fill', 'url(#linear-gradient)');\n\n // append title\n // legendsvg.append('text')\n // .attr('class', 'legendTitle')\n // .attr('x', 0)\n // .attr('y', -10)\n // .style('text-anchor', 'middle')\n // .text('Range');\n\n console.log('colourRange[2]', ref.colorDomain[2]);\n\n // set scale for x-axis\n var xScale = d3.scale.linear().domain([0, ref.colorDomain[2]]).range([0, width]);\n\n // define x-axis\n var xAxis = d3.svg.axis().orient('bottom').ticks(4).scale(xScale);\n\n // set up X axis\n var applyAxis = legendsvg.selectAll('.axis').data([0]);\n\n applyAxis.enter().append('g').attr('class', 'axis').attr('transform', 'translate(0,' + 12 + ')');\n // update\n applyAxis.call(xAxis);\n }", "title": "" }, { "docid": "9fba9f8f1b7594f5c4d5933ee6573e5f", "score": "0.55343693", "text": "function setRange(values, scale) {\n return ([d3.min(values) * scale, d3.max(values) * scale]);\n}", "title": "" }, { "docid": "374e13118ccd33e7265704394439622a", "score": "0.55321676", "text": "getDataClassLegendSymbols() {\n const axis = this, chart = axis.chart, legendItems = (axis.legendItem &&\n axis.legendItem.labels ||\n []), legendOptions = chart.options.legend, valueDecimals = pick(legendOptions.valueDecimals, -1), valueSuffix = pick(legendOptions.valueSuffix, '');\n const getPointsInDataClass = (i) => axis.series.reduce((points, s) => {\n points.push(...s.points.filter((point) => point.dataClass === i));\n return points;\n }, []);\n let name;\n if (!legendItems.length) {\n axis.dataClasses.forEach((dataClass, i) => {\n const from = dataClass.from, to = dataClass.to, { numberFormatter } = chart;\n let vis = true;\n // Assemble the default name. This can be overridden\n // by legend.options.labelFormatter\n name = '';\n if (typeof from === 'undefined') {\n name = '< ';\n }\n else if (typeof to === 'undefined') {\n name = '> ';\n }\n if (typeof from !== 'undefined') {\n name += numberFormatter(from, valueDecimals) + valueSuffix;\n }\n if (typeof from !== 'undefined' && typeof to !== 'undefined') {\n name += ' - ';\n }\n if (typeof to !== 'undefined') {\n name += numberFormatter(to, valueDecimals) + valueSuffix;\n }\n // Add a mock object to the legend items\n legendItems.push(extend({\n chart,\n name,\n options: {},\n drawLegendSymbol: LegendSymbol.rectangle,\n visible: true,\n isDataClass: true,\n // Override setState to set either normal or inactive\n // state to all points in this data class\n setState: (state) => {\n for (const point of getPointsInDataClass(i)) {\n point.setState(state);\n }\n },\n // Override setState to show or hide all points in this\n // data class\n setVisible: function () {\n this.visible = vis = axis.visible = !vis;\n for (const point of getPointsInDataClass(i)) {\n point.setVisible(vis);\n }\n chart.legend.colorizeItem(this, vis);\n }\n }, dataClass));\n });\n }\n return legendItems;\n }", "title": "" }, { "docid": "1b8ec3b555bb02a8e552b118687aded2", "score": "0.5518323", "text": "function setZoomAxisRanges(chart) {\r\n if (runtimeData.zoomPanAxisRanges) {\r\n for (var axisName in runtimeData.zoomPanAxisRanges) {\r\n var axis = runtimeData.zoomPanAxisRanges[axisName];\r\n var min = axis.min;\r\n var max = axis.max;\r\n\r\n if (axisName === 'XAxis') {\r\n chart.options.xAxis.labels.format = getScaleFormat(min, max);\r\n chart.options.xAxis.min = min;\r\n chart.options.xAxis.max = max;\r\n }\r\n else {\r\n var index = axisName.replace(':YAxis', '');\r\n if (!isNaN(index) && !isNaN(chart.options.yAxis.length)) {\r\n chart.options.yAxis[index].min = min;\r\n chart.options.yAxis[index].max = max;\r\n chart.options.yAxis[index].visible = true;\r\n }\r\n else {\r\n chart.options.yAxis.min = min;\r\n chart.options.yAxis.max = max;\r\n chart.options.yAxis.visible = true;\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "3f785f6f0c7a73a82076ab8d49553116", "score": "0.54906404", "text": "function computeRange (_sets) {\n let arr = Array.prototype.concat.apply([], _sets);\n\n if (type === 'bar' || isStacked()) {\n arr.push(0);\n }\n\n return [Math.min.apply(null, arr), Math.max.apply(null, arr)];\n}", "title": "" }, { "docid": "df540c41ad0200323b2ee6b5ddac123b", "score": "0.54743963", "text": "function setRange(radius, thickness, start, end, color)\n{\n demoGauge1.range.radius = radius;\n demoGauge1.range.thickness = thickness;\n demoGauge1.range.start = start;\n demoGauge1.range.end = end;\n demoGauge1.range.color = color;\n demoGauge1.updateRange();\n \n demoGauge2.range.radius = radius;\n demoGauge2.range.thickness = thickness;\n demoGauge2.range.start = start;\n demoGauge2.range.end = end;\n demoGauge2.range.color = color;\n demoGauge2.updateRange();\n}", "title": "" }, { "docid": "4f0ce5b22a0a3d4635cccfd0f7051fd0", "score": "0.547422", "text": "function createLegend(breaks){\n\tvar legendControl = L.control({\n\t\tposition: 'bottomright'\n });\n\n // When the legend is added to the map\n legendControl.onAdd = function () {\n\n // Create a new HTML <div> element and give it a class name of \"legend\"\n var div = L.DomUtil.create('div', 'legend');\n\n // First append an <h3> heading tag to the div holding the current attribute\n div.innerHTML = \"<h3><b>Nitrate Concentration (parts per million)</b></h3>\";\n\n // For each of our breaks\n for (var i = 0; i < breaks.length; i++) {\n\n // Determine the color associated with each break value, including the lower range value\n var color = nitrateColorBreaks(breaks[i][0], breaks);\n\n // Concatenate a <span> tag styled with the color and the range values of that class and include a label with the low and high ends of that class range\n div.innerHTML +=\n '<span style=\"background:' + color + '\"></span> ' +\n '<label>' + parseFloat(breaks[i][0]).toFixed(2).toLocaleString() + ' &mdash; ' +\n parseFloat(breaks[i][1]).toFixed(2).toLocaleString() + ' ppm' + '</label>';\n\n }\n\n // Return the populated legend div to be added to the map \n return div;\n\n }; // end onAdd method\n\n // Add the legend to the map\nlegendControl.addTo(map);\n}", "title": "" }, { "docid": "4110a4a65f45bf89f8b9a09fc9f44ac3", "score": "0.5463022", "text": "function setLegend () {\n // Set dimensions for legend\n legendWidth = 320;\n legendHeight = 180;\n\n // Define the size of the color block rectangle\n rectSize = (legendHeight) / (legendData.length * 1.5);\n\n // Append box for legend\n var legend = svg.append('svg')\n .attr('class', 'legend')\n .attr('width', legendWidth)\n .attr('height', legendHeight)\n .attr('transform', 'translate(' + (width + margin.left + margin.right\n - legendWidth) + ',' + 25 + ')');\n\n // Add a g element for every legend item\n var item = legend.selectAll('.legend')\n .data(legendData)\n .enter()\n .append('g')\n .attr('transform', function(d, i) {\n var x = 0;\n var y = (i * rectSize * 1.5);\n return 'translate('+ x + ',' + y + ')'; });\n\n // Add colobox for legend item and add listeners for interactivity\n item.append('rect')\n .attr('width', rectSize)\n .attr('height', rectSize)\n .attr('transform', 'translate(0,0)')\n .attr('class', function(d, i) { return legendData[i]; })\n .style('fill', function(d, i) {return colorScheme[i]; })\n .on('mouseover', legendMouseOverListener)\n .on('mouseout', legendMouseOutListener);\n\n // Add corresponding text for legend item\n item.append('text')\n .attr('transform', function(d, i) {\n var x = margin.legend;\n var y = rectSize * (3/4);\n return 'translate('+ x + ',' + y + ')'; })\n .text(function(d) { return d; });\n\n // Add title to legend\n svg.append(\"text\")\n .attr(\"class\",\"legend label\")\n .attr(\"transform\", \"translate(\" + (width + (legendWidth / 2) + \" , 0)\"))\n .style(\"text-anchor\", \"middle\")\n .text(\"Region\");\n}", "title": "" }, { "docid": "9d396d6bbc96fe5338d27a488df6cdcd", "score": "0.54577607", "text": "function createLegend(opts){\n var ticks = d3.svg.axis()\n .scale(opts.scale)\n .tickSize(24, 25, 19)\n .ticks(opts.ticks)\n .orient(\"top\");\n\n var legend = d3.select(opts.element)\n .append(\"svg\")\n //.attr(\"class\", \"legendCLcolor\")\n .attr(\"width\", 230)\n .attr(\"height\", 45)\n .append(\"g\")\n .attr(\"transform\", \"translate(10, 40)\")\n .call(ticks);\n\n legend.append(\"rect\")\n .attr(\"height\", 15)\n .attr(\"width\", 200)\n .attr(\"y\", -17)\n .style(\"fill\", \"url(\"+opts.gradient+\")\");\n\n legend.append(\"line\")\n .attr(\"x1\", 0)\n .attr(\"x2\", 0)\n .attr(\"y1\", -24)\n .attr(\"y2\", 0)\n .style(\"stroke\", \"#000000\");\n\n legend.append(\"text\")\n .attr(\"x\", -3)\n .attr(\"y\", -27)\n .text(\"0\");\n\n legend.append(\"line\")\n .attr(\"x1\", 200)\n .attr(\"x2\", 200)\n .attr(\"y1\", -24)\n .attr(\"y2\", 0)\n .style(\"stroke\", \"#000000\");\n\n legend.append(\"text\")\n .attr(\"x\", 193)\n .attr(\"y\", -27)\n .text(d3.round(d3.max(opts.indData)));\n }", "title": "" }, { "docid": "30b3a20c5c7eba6f559d0eee0aea6140", "score": "0.54536754", "text": "function changeRangeNumVal() {\n redNumVal.addEventListener(\"change\", () => {\n // make sure numbers are entered between 0 to 255\n if (redNumVal.value > 255) {\n alert(\"cannot enter numbers greater than 255\");\n redNumVal.value = red.value;\n } else if (redNumVal.value < 0) {\n alert(\"cannot enter numbers less than 0\");\n redNumVal.value = red.value;\n } else {\n red.value = redNumVal.value;\n initSliderColors();\n displayColors();\n }\n });\n greenNumVal.addEventListener(\"change\", () => {\n // make sure numbers are entered between 0 to 255\n if (greenNumVal.value > 255) {\n alert(\"cannot enter numbers greater than 255\");\n greenNumVal.value = green.value;\n } else if (greenNumVal.value < 0) {\n alert(\"cannot enter numbers less than 0\");\n greenNumVal.value = green.value;\n } else {\n green.value = greenNumVal.value;\n initSliderColors();\n displayColors();\n }\n });\n \n blueNumVal.addEventListener(\"change\", () => {\n // make sure numbers are entered between 0 to 255\n if (blueNumVal.value > 255) {\n alert(\"cannot enter numbers greater than 255\");\n blueNumVal.value = blue.value;\n } else if (blueNumVal.value < 0) {\n alert(\"cannot enter numbers less than 0\");\n blueNumVal.value = blue.value;\n } else {\n blue.value = blueNumVal.value;\n initSliderColors();\n displayColors();\n }\n });\n }", "title": "" }, { "docid": "811dcbc1db675f47f5f7c9ad6b4df8a3", "score": "0.54526556", "text": "function isValidBoundRange(currentBound, currentBoundValue) {\n var isValid = true;\n max = currentBoundValue[0];\n if (currentBoundValue[1] > max || currentBoundValue[1] <= currentBoundValue[2]) {\n currentBound[1].focus();\n currentBound[1].style.backgroundColor = 'red';\n isValid = false;\n }\n for (var i = 2; i < 11; i++) {\n if (currentBoundValue[i] <= currentBoundValue[i+1] || currentBoundValue[i] >= currentBoundValue[i-1]) {\n currentBound[i].focus();\n currentBound[i].style.backgroundColor = 'red';\n isValid = false;\n }\n }\n if (isValid == false) {\n alert(\"Bounds range is overlapped!\");\n }\n return isValid;\n}", "title": "" }, { "docid": "26c958c946d62b564f0e615e47b719db", "score": "0.545154", "text": "function doLimits() {\n var\n start = chart.range.start,\n stop = chart.range.stop,\n numOfPts = chart.range.numOfPts,\n timer = (new Date()).getTime(),\n indepVarData = dataStore.getVarData(vars.indep) || [],\n indepVarLength = indepVarData.length,\n depVarNames = vars.deps || [],\n numDepVars = vars.deps.length,\n depVarData,\n plt_i,\n pnt_i,\n minLimit,\n maxLimit,\n pltMax,\n pltMin;\n\n if (!flags.limits) {\n //user has not defined limits, so take the max and of the data set\n\n //create an array of max and mins for each subset\n pltMax = [];\n pltMin = [];\n\n for (plt_i = 0; plt_i < numDepVars; plt_i++) {\n depVarData = dataStore.getVarData(depVarNames[plt_i]);\n\n //find first real data point for initial min/max\n for (pnt_i = 0; pnt_i < numOfPts; pnt_i++) {\n if (!isNaN(depVarData[pnt_i + start])) {\n pltMin[plt_i] = pltMax[plt_i] =\n parseFloat(depVarData[pnt_i + start]);\n break;\n }\n }\n \n //go through the rest of the data points looking for min/max\n for (pnt_i; pnt_i < numOfPts; pnt_i++) {\n if (isNaN(depVarData[pnt_i + start])) {\n continue;\n }\n\n pltMin[plt_i] =\n Math.min(depVarData[pnt_i + start], pltMin[plt_i]);\n\n pltMax[plt_i] =\n Math.max(depVarData[pnt_i + start], pltMax[plt_i]);\n }\n }\n\n //select the extremes from the max and min arrays\n minLimit = Math.min.apply(null, pltMin);\n maxLimit = Math.max.apply(null, pltMax);\n } else {\n minLimit = +chart.limits.ymin || 0;\n maxLimit = +chart.limits.ymax || 0;\n\n //the user has predefined data limits, so apply to each subset\n for (plt_i = 0; plt_i < numDepVars; plt_i++) {\n depVarData = dataStore.getVarData(depVarNames[plt_i]);\n\n for (pnt_i = 0; pnt_i < numOfPts; pnt_i++) {\n depVarData[pnt_i] =\n Math.min( depVarData[pnt_i + start], maxLimit );\n\n depVarData[pnt_i] =\n Math.max( depVarData[pnt_i + start], minLimit );\n }\n }\n }\n\n //Make sure the ymax and min are not the same value\n if (minLimit == maxLimit) {\n minLimit -= chart.sizes.height / 2;\n maxLimit += chart.sizes.height / 2;\n }\n \n //if we have a log plot, make the y axis start and end at an integer \n if (flags.scaled && chart.scale.type == \"log\") {\n minLimit = Math.floor(minLimit);\n maxLimit = Math.ceil(maxLimit);\n }\n \n chart.limits.ymin = minLimit;\n chart.limits.ymax = maxLimit;\n\n timer = (new Date()).getTime() - timer;\n console.log(\"Limits Calculated = \" + timer / 1000);\n }", "title": "" }, { "docid": "f53098c866a3575744d4a6b4b5918c7e", "score": "0.5451011", "text": "function drawOverviewLegend(min, max){\r\n \r\n var range;\r\n \r\n // find range for normalization\r\n if(min == max){\r\n range = 1;\r\n }\r\n else{\r\n range = max-min;\r\n }\r\n \r\n var legGrad = ctx.createLinearGradient(0,0,200,0);\r\n legGrad.addColorStop(0,\"blue\");\r\n legGrad.addColorStop(1,\"red\");\r\n ctx.fillStyle = legGrad;\r\n ctx.fillRect(10, myCanvasProt.height - 40,210, 15);\r\n ctx.fillStyle = '#000000';\r\n ctx.font = \"14px Arial\";\r\n ctx.fillText(Math.round(min), 10, myCanvasProt.height - 45);\r\n ctx.fillText(\"PID\", 105, myCanvasProt.height - 45);\r\n ctx.fillText(Math.round(max), 205, myCanvasProt.height - 45);\r\n\r\n}", "title": "" }, { "docid": "9bb61fb6ebb0247c78be777ff4b82aa9", "score": "0.54496706", "text": "drawLegend(min, max) {\n let scale = d3.scaleSqrt().range([3, 20]).domain([min, max]);\n\n let circleData = [min, max];\n\n let svg = d3.select('.circle-legend').select('svg').select('g');\n\n let circleGroup = svg.selectAll('g').data(circleData);\n circleGroup.exit().remove();\n\n let circleEnter = circleGroup.enter().append('g');\n circleEnter.append('circle').classed('neutral', true);\n circleEnter.append('text').classed('circle-size-text', true);\n\n circleGroup = circleEnter.merge(circleGroup);\n\n circleGroup.attr('transform', (d, i) => 'translate(' + ((i * (5 * scale(d))) + 20) + ', 25)');\n\n circleGroup.select('circle').attr('r', (d) => scale(d));\n circleGroup.select('circle').attr('cx', '0');\n circleGroup.select('circle').attr('cy', '0');\n let numText = circleGroup.select('text').text(d => new Intl.NumberFormat().format(d));\n\n numText.attr('transform', (d) => 'translate(' + ((scale(d)) + 10) + ', 0)');\n }", "title": "" }, { "docid": "930db25c33035b6e29202df5e13dda87", "score": "0.5428248", "text": "function mpchart05a(graphDiv, seriesData1, dateRange1) {\n\n var option = null;\n\n var colors = ['#5D8B41', '#0A4DF2', '#B55C4F'];\n var dateRange = dateRange1;\n\n var seriesName = ['440 Volts', '220/110 Volts'];\n var seriesData = seriesData1;\n //var seriesData = [\n // ['At Port', 'At Port', 'At Port', 'At Sea', 'At Sea', 'At Sea', 'At Sea'], // Vessel Status\n // ['Ballast', 'Ballast', 'Ballast', 'Laden', 'Laden', 'Laden', 'Laden'], // Vessel Condition\n // [2.15, 2.30, 2.25, 2.15, 1.97, 1.90, 1.96], // new field in DNR R L1 (2)\n // [1.96, 1.26, 0.86, 2.00, 1.90, 1.96, 1.93], // new field in DNR S L2 (3)\n //];\n\n let maxResLimit = Math.max(Math.max(...seriesData[2]), Math.max(...seriesData[3]));\n let maxResLimitData = maxResLimit + maxResLimit * 0.1;\n\n\n option = {\n\n title: {\n text: 'Main Switchboard 3Phase Earth Fault Monitor Readings',\n textStyle: {\n color: '#C2417C'\n },\n subtext: '440 Volts - 220/110 Volts',\n subtextStyle: {\n color: '#bf6d92',\n fontSize: 15\n },\n left: 'center'\n\n },\n legend: {\n data: seriesName,\n bottom: 0\n },\n color: colors,\n grid: [{\n top: 80,\n bottom: 100,\n left: 80,\n right: 80\n }],\n tooltip: {\n trigger: 'axis',\n triggerOn: \"click\",\n axisPointer: {\n type: 'shadow'\n },\n formatter: function (params) {\n\n var insrt = [];\n var result = params[0].dataIndex;\n\n for (var i in seriesData) {\n var obj = seriesData[i];\n insrt[i] = obj[result];\n }\n\n var tip = \"\";\n tip = '<table class=\"tooltipTable\" style=\"width: 100%\"><tr><td class=\"tooltpstyle\" align=\"center\" width=\"40%\"><b>' + insrt[0] + '</b></td><td class=\"tooltpstyle\" align=\"center\" width=\"30 %\">' + insrt[1] + '</td></tr></table><table class=\"tooltipTable\" style=\"margin - bottom:10px; width: 200px\"><tr><td class=\"tooltpStyle\" align=\"left\" style=\"background: #555; color: #fff\" width=\"\">Earth Fault Monitor</td><td class=\"tooltpStyle\" align=\"left\" style=\"background: #555; color: #fff\" width=\"\"> Resistance </td></tr><tr><td class=\"tooltpStyle\" align=\"left\">440 Volts </td><td align=\"left\"><span style=\"color: #fff; background: ' + colors[0] + '; padding: 0 5px\">' + insrt[2] + '</span> MΩ</td></tr><tr><td class=\"tooltpStyle\" align=\"left\">220/110 Volts</td><td align=\"left\"><span style=\"color: #fff; background:' + colors[1] + '; padding: 0 5px\">' + insrt[3] + '</span> MΩ</td></tr></table>';\n\n return tip;\n },\n\n backgroundColor: '#ecf0f1',\n borderColor: 'black',\n padding: 5,\n backgroundColor: 'rgba(245, 245, 245, 0.9)',\n borderWidth: 2,\n borderColor: '#999',\n textStyle: {\n color: '#000'\n },\n\n position: function (pos, params, el, elRect, size) {\n var obj = {\n top: 60\n };\n obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 160;\n return obj;\n },\n\n shared: true,\n extraCssText: 'width: auto; height: auto'\n },\n toolbox: {\n feature: {\n restore: {\n show: true,\n title: 'Refresh'\n },\n saveAsImage: {\n show: true,\n title: 'Save'\n }\n }\n },\n dataZoom: [{\n bottom: 30,\n type: 'slider',\n show: 'true',\n start: 0,\n end: 100,\n dataBackground: {\n areaStyle: {\n color: '#7ECFF2'\n }\n },\n fillerColor: 'rgba(78,119,166,0.2)',\n handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',\n handleSize: '70%',\n handleStyle: {\n color: '#3D7C7F'\n }\n }],\n xAxis: [\n\n {\n type: 'category',\n data: dateRange,\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed'\n }\n },\n axisPointer: {\n show: true,\n label: {\n show: true\n }\n },\n }\n\n ],\n\n yAxis: [{\n name: 'Resistance (MΩ)',\n nameLocation: 'center',\n min: 0,\n max: maxResLimitData,\n nameRotate: 90,\n nameTextStyle: {\n padding: 30,\n fontWeight: 700,\n fontSize: 14\n },\n axisPointer: {\n show: true,\n label: {\n show: true\n }\n },\n type: 'value'\n }],\n series: [{\n name: seriesName[0],\n type: 'bar',\n label: {\n normal: {\n //show: true,\n distance: 15,\n align: 'center',\n verticalAlign: 'middle',\n position: 'insideBottom',\n formatter: '{c}'\n // formatter: '{c} MΩ'\n }\n },\n barGap: '0%',\n data: seriesData[2]\n },\n {\n name: seriesName[1],\n type: 'bar',\n label: {\n normal: {\n //show: true,\n distance: 15,\n align: 'center',\n verticalAlign: 'middle',\n position: 'insideBottom',\n formatter: '{c}'\n }\n },\n barGap: '0%',\n data: seriesData[3]\n },\n {\n type: 'line',\n itemStyle: {\n normal: {\n opacity: 0\n }\n },\n lineStyle: {\n normal: {\n opacity: 0\n }\n },\n markLine: {\n data: [{\n name: 'Markline between two points',\n yAxis: resLimitVal // resistance limit applied to the marker line.\n }],\n label: {\n normal: {\n show: true,\n formatter: ' \\n{c} MΩ\\nResistance\\nLimit'\n }\n },\n lineStyle: {\n normal: {\n color: 'red'\n }\n }\n }\n }\n ]\n };\n\n\n\n require.config({\n paths: {\n echarts3: '../js/echartsAll3'\n }\n });\n\n require(\n ['echarts3'],\n function (ec) {\n var graphFilDivName = graphDiv + \"Graph\";\n var graphFilDiv = document.getElementById(graphFilDivName);\n var myChartPerf = ec.init(graphFilDiv);\n myChartPerf.setOption(option);\n cpGraphState5a = myChartPerf;\n }\n );\n}", "title": "" }, { "docid": "93ccc792b1638f00331d083875c84ff0", "score": "0.54028773", "text": "function createDefaultLegend(options) {\n currentItem = null;\n\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'sliced':\n {\n //if chart type is multiples then we need to extract the values from sets\n if (chart.type === \"multiples\") {\n let legendNames = [];\n chart.data.forEach(function (cd) {\n if (cd.values && cd.values.length) {\n cd.values.forEach(function (d) {\n let xValue = d[chart.series[0].xField];\n\n if (legendNames.indexOf(xValue) === -1) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d[chart.series[0].xField]);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n } else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d[chart.xField] ? d[chart.xField].toString() : '',\n length: d[chart.xField] ? d[chart.xField].toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n legendNames.push(xValue);\n }\n });\n }\n });\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if(valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n } else {\n //iterate all chart data to set legend values\n chart.data.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d[chart.xField]);\n if (d[chart.series[0].valueField] != null) {\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n } else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d[chart.xField] ? d[chart.xField].toString() : '',\n length: d[chart.xField] ? d[chart.xField].toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if (valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n }\n\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n }\n break;\n case 'grouped':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //check whether the chart has legend values\n if (chart.legend.legendColors && chart.legend.legendColors.length)\n defaultLegend.legendValues = chart.legend.legendColors;\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n }\n break;\n case 'sourced':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].sourceField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n });\n\n //sort defaultLegend.legendValues\n defaultLegend.legendValues.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n case 'map':\n {\n //check whether the legend has animation\n if (chart.legend.animLegend) {\n groupValues = chart.legend.animLegend;\n } else {\n switch (chart.type) {\n case 'standardMap':\n case 'tileMap':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].valueField);\n }\n break;\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].colorField);\n }\n break;\n default:\n {\n if (chart.series[0].groupField === '') return;\n\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n }\n }\n }\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n }\n break;\n case 'manual':\n {\n //iterate all group values\n if (chart.manualLegendValues) {\n chart.manualLegendValues.forEach(function (d, i) {\n //add current value into the legend values\n if (d) {\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (filteredList.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: filteredList[0].value ? filteredList[0].value : '',\n length: filteredList[0].value ? filteredList[0].value.toString().length : 0,\n color: filteredList[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d.toString(),\n length: d.toString().length,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n }\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n default:\n {\n //if chart type is mirrored bars we need to make a different approach\n if (chart.type === 'mirroredBars') {\n //declare an index to limit colors\n let legendColorIndex = 0;\n\n //iterate legend colors\n chart.legend.legendColors.forEach(function (d, i) {\n //limit to two selections\n if (legendColorIndex < 2) {\n let legendValue = d.text || d.value;\n\n defaultLegend.legendValues.push({\n value: legendValue ? legendValue.toString() : '',\n length: legendValue ? legendValue.toString().length : 0,\n color: d.color\n });\n }\n\n //increase indexer\n legendColorIndex++;\n });\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if (valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n } else if (chart.type === 'bubbleForce') {\n if (chart.series[0].groupField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n\n } else if (chart.manualLegendValues) {\n chart.manualLegendValues.forEach(function (d, i) {\n //add current value into the legend values\n if (d) {\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (filteredList.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: filteredList[0].value ? filteredList[0].value : '',\n length: filteredList[0].value ? filteredList[0].value.toString().length : 0,\n color: filteredList[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d.toString(),\n length: d.toString().length,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n } else {\n //check whether the legend colors has set\n if (chart.legend.legendColors && chart.legend.legendColors.length) {\n //set default legend values\n defaultLegend.legendValues = chart.legend.legendColors;\n }\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if (valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n }\n\n //don't create legend if there are less than 2 items in it\n if (defaultLegend.legendValues.length < 2) {\n if (chart.series.length < 2)\n return;\n }\n }\n break;\n }\n\n //don't create legend if there aren't any items\n if (defaultLegend.legendValues.length === 0) return;\n\n //set legend values\n chart.legendValues = defaultLegend.legendValues;\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //get type and nan state for the value\n let vType = e.getType(a.value);\n let nanState = isNaN(a.value);\n if (nanState) {\n if (vType === \"string\") {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n } else if (vType === \"date\") {\n return new Date(a.value) - new Date(b.value);\n } else {\n return a.value - b.value;\n }\n } else {\n return parseFloat(a.value) - parseFloat(b.value);\n }\n });\n\n //iterate all legend values\n defaultLegend.legendValues.forEach(function (currentLegend) {\n\n //get width of the text\n currentLegend.width = getTempOffset(currentLegend.value).width + chart.legend.fontSize + legendIconOffset * 2;\n \n //retrieve max length text\n if (currentLegend.width > tempTextValueLength) {\n tempTextValue = currentLegend.value;\n tempTextValueLength = currentLegend.length;\n }\n });\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //set single height and width\n defaultLegend.singleHeight = tempTextSVGOffset.height + legendIconOffset;\n\n //append ranged Legend g\n defaultLegend.svg = legendG\n .append('g');\n\n //append legend icons\n defaultLegend.icons = defaultLegend.svg.selectAll('.eve-legend-icon')\n .data(defaultLegend.legendValues)\n .enter().append('rect')\n .attr('class', 'eve-legend-icon')\n .attr('width', chart.legend.fontSize)\n .attr('height', chart.legend.fontSize)\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .style('fill', function (d, i) { return d.color; })\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, (d.serieIndex ? d.serieIndex : i));\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n });\n\n //append legend texts\n defaultLegend.texts = defaultLegend.svg.selectAll('.eve-legend-text')\n .data(defaultLegend.legendValues)\n .enter().append('text')\n .attr('class', 'eve-legend-text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .text(function (d, i) { return d.value; })\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, (d.serieIndex ? d.serieIndex : i));\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n });\n\n //transform legend icons\n defaultLegend.icons\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = (i * defaultLegend.singleHeight);\n }\n break;\n default:\n {\n yPos = 0;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; });\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //transform legend texts\n defaultLegend.texts\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = chart.legend.fontSize + legendIconOffset;\n yPos = (i * defaultLegend.singleHeight) + defaultLegend.singleHeight / 2;\n }\n break;\n default:\n {\n yPos = defaultLegend.singleHeight / 2;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; }) + chart.legend.fontSize + legendIconOffset;\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //get bbox of the svg\n tempDimensions = defaultLegend.svg.node().getBoundingClientRect();\n\n //set legend size\n defaultLegend.height = tempDimensions.height;\n defaultLegend.width = tempDimensions.width + 15;\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < defaultLegend.width ? defaultLegend.width : width;\n height += defaultLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += defaultLegend.width;\n height = height < defaultLegend.height ? defaultLegend.height : height;\n }\n break;\n }\n }", "title": "" }, { "docid": "c11584ced48f05df315e877197da4657", "score": "0.5379499", "text": "function userChangesLegend(text, isMin, color) {\n var domain = color.domain();\n if (!isNaN(text)) {\n var newMin;\n var newMax;\n if (isMin) {\n newMin = parseFloat(text);\n newMax = domain[1];\n } else {\n newMin = domain[0];\n newMax = parseFloat(text);\n }\n\n // Don't change domain if max <= min\n if (newMax > newMin) {\n domain = [newMin, newMax];\n\n color.domain(domain);\n\n successfulChange = true;\n }\n }\n\n if (isMin) {\n d3.select(\".legendmin\").text(domain[0]);\n } else {\n d3.select(\".legendmax\").text(domain[1]);\n }\n\n return successfulChange;\n}", "title": "" }, { "docid": "c12a4c4f5c36cdd0a8a9562ec6d76679", "score": "0.5360188", "text": "function createHistogramChart() {\n\n // e.g: 20:30_50:70_12:34_[....]_[....]_[....]\n var tmp = histogramData.split(\"_\");\n\n var newMinBand1 = parseInt(tmp[0].split(\":\")[0]);\n var newMaxBand1 = parseInt(tmp[0].split(\":\")[1]);\n // Change slider values\n $( \"#sliderBand1Histogram\" ).slider( \"option\", \"values\", [ newMinBand1, newMaxBand1 ] );\n\n\n var newMinBand2 = parseInt(tmp[1].split(\":\")[0]);\n var newMaxBand2 = parseInt(tmp[1].split(\":\")[1]);\n // Change slider values\n $( \"#sliderBand2Histogram\" ).slider( \"option\", \"values\", [ newMinBand2, newMaxBand2 ] );\n\n var newMinBand3 = parseInt(tmp[2].split(\":\")[0]);\n var newMaxBand3 = parseInt(tmp[2].split(\":\")[1]);\n\n // Change slider values\n $( \"#sliderBand3Histogram\" ).slider( \"option\", \"values\", [ newMinBand3, newMaxBand3 ] );\n\n var band1Values = extractValuesFromArray(tmp[3]);\n var band1Array = band1Values.split(', ').map(Number);\n\n var band2Values = extractValuesFromArray(tmp[4]);\n var band2Array = band2Values.split(', ').map(Number);\n\n var band3Values = extractValuesFromArray(tmp[5]);\n var band3Array = band3Values.split(', ').map(Number);\n\n // Values of 0 and 255 are nonsense to display in chart\n band1Array[0] = null;\n band1Array[255] = null;\n\n band2Array[0] = null;\n band2Array[255] = null;\n\n band3Array[0] = null;\n band3Array[255] = null;\n\n\n // Value for the highest histogram index from all 3 bands \n var maxHistogramIndex = 0;\n\n for (var i = 0; i < 256; i++) {\n // find the highest histogram index of 3 bands\n if (maxHistogramIndex < band1Array[i]) {\n maxHistogramIndex = band1Array[i];\n }\n if (maxHistogramIndex < band2Array[i]) {\n maxHistogramIndex = band2Array[i];\n }\n if (maxHistogramIndex < band3Array[i]) {\n maxHistogramIndex = band3Array[i];\n }\n }\n\n\n var chartDivID = \"HistogramChartDiv\";\n\n\n var combinedArray = [];\n\n for (var i = 0; i < 256; i++) {\n var obj = {};\n for (var j = 0; j < 3; j++) { \n var histogramIndex = \"histogram\"; \n if (j == 0) {\n obj[histogramIndex + \"0\"] = band1Array[i]; \n if (i == newMinBand1 || i == newMaxBand1) {\n obj[histogramIndex + \"1\"] = maxHistogramIndex;\n } else {\n obj[histogramIndex + \"1\"] = null;\n }\n } else if (j == 1) {\n obj[histogramIndex + \"2\"] = band2Array[i]; \n if (i == newMinBand2 || i == newMaxBand2) {\n obj[histogramIndex + \"3\"] = maxHistogramIndex;\n } else {\n obj[histogramIndex + \"3\"] = null;\n }\n } else if (j == 2) {\n obj[histogramIndex + \"4\"] = band3Array[i]; \n if (i == newMinBand3 || i == newMaxBand3) {\n obj[histogramIndex + \"5\"] = maxHistogramIndex;\n } else {\n obj[histogramIndex + \"5\"] = null;\n }\n }\n \n obj[\"pixelValue\"] = i;\n }\n combinedArray.push(obj); \n }\n\n // after that, create 3 empty charts with each chart contains 2 vertical bars for new min and new max\n\n \n\n\n //alert(\"Line charts: \" + lineChartsCount);\n\n // graphs from clicked value charts\n var rgbColors = ['#f90909', '#f90909', '#02e515', '#02e515', '#6ebcff', '#6ebcff'];\n // the configuration for all 3 line charts\n var chartsArray = [];\n for (var i = 0; i < 6; i++) {\n var obj = {};\n obj[\"id\"] = \"g\" + i;\n var histogramIndex = \"histogram\" + i; \n if (i % 2 == 0) {\n obj[\"balloonText\"] = \"<span style='font-size:12px;'>\" + i + \". Histogram Index: [[\" + histogramIndex + \"]]\" + \"</span>\";\n } \n obj[\"dashLength\"] = 0;\n obj[\"lineThickness\"] = 2;\n obj[\"valueField\"] = histogramIndex; \n obj[\"connect\"] = true;\n obj[\"lineColor\"] = rgbColors[i];\n\n // draw vertical bars for min, max of RGB histogram chart\n if (i % 2 == 1) {\n obj[\"type\"] = \"column\";\n }\n\n // the chart lines\n chartsArray.push(obj);\n }\n\n var chart = AmCharts.makeChart(\"#\" + chartDivID, {\n \"type\": \"serial\",\n \"theme\": \"light\",\n \"marginRight\": 10,\n \"marginLeft\": 10,\n \"columnWidth\": 1,\n \"backgroundColor\": \"#2F5597\",\n \"backgroundAlpha\": 1,\n \"autoMarginOffset\": 20,\n \"mouseWheelZoomEnabled\": true,\n \"dataProvider\": combinedArray,\n \"fontSize\": 14,\n \"color\": \"#ffffff\",\n \"marginTop\": 50,\n \"valueAxes\": [{\n \"axisAlpha\": 0,\n \"guides\": [{\n \"fillAlpha\": 0.1,\n \"fillColor\": \"#888888\",\n \"lineAlpha\": 0,\n \"toValue\": 16,\n \"value\": 10\n }],\n \"position\": \"left\",\n \"tickLength\": 0,\n \"title\": \"Histogram\"\n }],\n \"categoryAxis\": {\n \"title\": \"Histogram Index\"\n },\n \"graphs\": chartsArray,\n \"chartCursor\": {\n \"pan\": true,\n \"valueLineEnabled\": true,\n \"valueLineBalloonEnabled\": false,\n \"cursorAlpha\": 1,\n \"cursorColor\": \"#258cbb\",\n \"limitToGraph\": \"g1\",\n \"valueLineAlpha\": 0.2,\n \"valueZoomable\": true,\n \"valueBalloonsEnabled\": true,\n \"categoryBalloonEnabled\": true\n },\n \"categoryField\": \"pixelValue\",\n \"categoryAxis\": {\n //\"parseDates\": true,\n \"axisAlpha\": 0,\n \"gridAlpha\": 0.1,\n \"minorGridAlpha\": 0.1,\n \"minorGridEnabled\": true,\n \"title\": \"Pixel Values (0 - 255)\"\n },\n \"export\": {\n \"enabled\": true,\n \"fileName\": \"ps2_\" + drawCoverageID\n }\n });\n\n // it needs to resize the chart and write it when it is hidden\n //chart.invalidateSize();\n chart.write(chartDivID);\n\n $(\".histogram-dock\").css(\"background\", \"#2F5597\");\n}", "title": "" }, { "docid": "ccb64eb526f59e110f7fb814b6e33552", "score": "0.53555524", "text": "function getRangeColor(value, ranges, color) {\n var min = 0;\n var max = 0;\n var currentRange = ranges.filter(function (range) {\n min = Math.min(range.start, range.end);\n max = Math.max(range.start, range.end);\n return (value >= min && max >= value);\n });\n return currentRange.length ? currentRange[0].rangeColor : color;\n}", "title": "" }, { "docid": "3139de46d12f811262f43d1eca975ef1", "score": "0.5355306", "text": "handleMatchDomain() {\n const { domain, range, onChange } = this.props;\n\n if (domain.length === range.length) {\n return;\n }\n\n const rangeMin = range[0];\n const rangeMax = range[range.length - 1];\n const step = Math.round(1000 * ((rangeMax - rangeMin) / (domain.length - 1))) / 1000;\n\n let matched;\n // non-number solution - just copy the last element or truncate the array\n if (isNaN(step)) {\n const numToAdd = domain.length - range.length;\n if (numToAdd > 0) { // adding elements\n matched = [...range, ...d3Range(numToAdd).map(() => range[range.length - 1])];\n } else { // removing elements\n matched = range.slice(0, domain.length);\n }\n } else {\n matched = d3Range(rangeMin, rangeMax, step).concat(rangeMax);\n }\n\n onChange(matched);\n }", "title": "" }, { "docid": "9e70e04b0e05ee22cf2242e8e105ac70", "score": "0.5353025", "text": "function extractRange(ranges, coord) {\n var axis, from, to, key, axes = plot.getAxes();\n\n for (var k in axes) {\n axis = axes[k];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? plot.getXAxes()[0] : plot.getYAxes()[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n \n return { from: from, to: to, axis: axis };\n }", "title": "" }, { "docid": "9e70e04b0e05ee22cf2242e8e105ac70", "score": "0.5353025", "text": "function extractRange(ranges, coord) {\n var axis, from, to, key, axes = plot.getAxes();\n\n for (var k in axes) {\n axis = axes[k];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? plot.getXAxes()[0] : plot.getYAxes()[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n \n return { from: from, to: to, axis: axis };\n }", "title": "" }, { "docid": "9e70e04b0e05ee22cf2242e8e105ac70", "score": "0.5353025", "text": "function extractRange(ranges, coord) {\n var axis, from, to, key, axes = plot.getAxes();\n\n for (var k in axes) {\n axis = axes[k];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? plot.getXAxes()[0] : plot.getYAxes()[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n \n return { from: from, to: to, axis: axis };\n }", "title": "" }, { "docid": "2d7a1309220c5017b87e51d292592be0", "score": "0.53456694", "text": "function updateColourScale(scale, thresholds) {\n // create colour scale\n var colorScale = d3.scaleLinear()\n .domain(linspace(d3.min(thresholds), d3.max(thresholds), scale.length))\n .range(scale);\n \n // style points\n d3.selectAll('circle')\n .attr('fill', function(d) {\n return colorScale(d.z);\n });\n\n // clear current legend\n legendSvg.selectAll('*').remove();\n\n // append gradient bar\n var gradient = legendSvg.append('defs')\n .append('linearGradient')\n .attr('id', 'gradient')\n .attr('x1', '0%') // bottom\n .attr('y1', '100%')\n .attr('x2', '0%') // to top\n .attr('y2', '0%')\n .attr('spreadMethod', 'pad');\n\n // programatically generate the gradient for the legend\n // this creates an array of [pct, colour] pairs as stop\n // values for legend\n var pct = linspace(0, 100, scale.length).map(function(d) {\n return Math.round(d) + '%';\n });\n\n var colourPct = d3.zip(pct, scale);\n\n colourPct.forEach(function(d) {\n gradient.append('stop')\n .attr('offset', d[0])\n .attr('stop-color', d[1])\n .attr('stop-opacity', 1);\n });\n\n legendSvg.append('rect')\n .attr('x1', 0)\n .attr('y1', 0)\n .attr('width', legendWidth)\n .attr('height', legendHeight)\n .style('fill', 'url(#gradient)');\n\n // create a scale and axis for the legend\n var legendScale = d3.scaleLinear()\n .domain(d3.extent(thresholds))\n .range([legendHeight, 0]);\n\n var legendAxis = d3.axisRight(legendScale)\n .tickValues(thresholds)\n .tickFormat(d3.format(\"f\"));\n\n legendSvg.append(\"g\")\n .attr(\"id\", \"legendAxis\")\n .attr(\"class\", \"legend axis\")\n .attr(\"transform\", \"translate(\" + legendWidth + \", 0)\")\n .call(legendAxis);\n }", "title": "" }, { "docid": "01131f49f1d0ace8a94d024daaf70be1", "score": "0.5344448", "text": "showPriceRangeValues() {\n\t\t$('#price-min').text(this.getPriceRange()[0]);\n\t\t$('#price-max').text(this.getPriceRange()[1]);\n\t}", "title": "" }, { "docid": "de28db94619d024c6a641d84e163f61b", "score": "0.5332546", "text": "bindSeriesInLegend() {\n for (let i = Object.values(this.series).length - 1; i >= 0; i--) {\n const mapSeries = Object.values(this.series)[i].map;\n const timeSeries = Object.values(this.series)[i].time;\n\n mapSeries.events.on(\"hidden\", () => {\n timeSeries.hide();\n });\n\n mapSeries.events.on(\"shown\", () => {\n timeSeries.show();\n });\n }\n }", "title": "" }, { "docid": "1a79e77a400218bad9e3ddbe8c159d0e", "score": "0.5330834", "text": "function createScaledLegend() {\n let lastRadius = 0;\n scaledLegend.rScale = d3.scalePow().exponent(0.5).domain([chart.domains.minY, chart.domains.maxY]).range([(chart.domains.minY === chart.domains.maxY ? chart.series[0].maxBulletSize : chart.series[0].minBulletSize), chart.series[0].maxBulletSize]);\n scaledLegend.band = (chart.domains.maxY - chart.domains.minY) / (chart.legend.circleCount - 1);\n\n //create scaled legend data\n lastRadius = scaledLegend.rScale(chart.domains.maxY);\n scaledLegend.legendValues.push({\n value: e.formatNumber(chart.domains.maxY, chart.legend.numberFormat),\n radius: lastRadius\n });\n\n for (i = 1; i < chart.legend.circleCount; i++) {\n if (lastRadius - scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i) > chart.legend.fontSize / 2) {\n lastRadius = scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i);\n scaledLegend.legendValues.push({\n value: e.formatNumber(chart.domains.maxY - scaledLegend.band * i, chart.legend.numberFormat),\n radius: scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i)\n });\n } else {\n scaledLegend.legendValues.push({\n value: '',\n radius: 0\n });\n }\n }\n if (lastRadius === scaledLegend.rScale(chart.domains.maxY)) {\n scaledLegend.legendValues[0].value = '';\n scaledLegend.legendValues[0].radius = 0;\n }\n\n //set start values for comparison\n tempTextValue = '';\n tempTextValueLength = 0;\n\n //iterate all legend values\n scaledLegend.legendValues.forEach(function (currentLegend) {\n //retrieve max length text\n if (currentLegend.value.toString().length > tempTextValueLength) {\n tempTextValue = currentLegend.value.toString();\n tempTextValueLength = currentLegend.value.toString().length;\n }\n });\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //get scaled legend size\n scaledLegend.width = tempTextSVGOffset.width + chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n scaledLegend.height = chart.series[0].maxBulletSize * 2 + chart.legend.fontSize / 2;\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < scaledLegend.width ? scaledLegend.width : width;\n height += scaledLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += scaledLegend.width;\n height = height < scaledLegend.height ? scaledLegend.height : height;\n }\n break;\n }\n\n //append gradient Legend g\n scaledLegend.svg = legendG\n .append('g');\n\n //switch legend icons\n switch (chart.series[0].tileIcon) {\n case 'circle':\n {\n //append legend circles\n scaledLegend.icons = scaledLegend.svg.selectAll('.eve-legend-scaled-circle')\n .data(scaledLegend.legendValues)\n .enter().append('circle')\n .attr('class', 'eve-legend-scaled-circle')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1)\n .attr(\"r\", function (d) { return d.radius; });\n }\n break;\n case 'square':\n {\n //append legend circles\n scaledLegend.icons = scaledLegend.svg.selectAll('.eve-legend-scaled-circle')\n .data(scaledLegend.legendValues)\n .enter().append('rect')\n .attr('class', 'eve-legend-scaled-circle')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1)\n .attr('width', function (d) { return d.radius * 2; })\n .attr('height', function (d) { return d.radius * 2; });\n }\n break;\n default:\n {\n //append legend circles\n scaledLegend.icons = scaledLegend.svg.selectAll('.eve-legend-scaled-circle')\n .data(scaledLegend.legendValues)\n .enter().append('circle')\n .attr('class', 'eve-legend-scaled-circle')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1)\n .attr(\"r\", function (d) { return d.radius; });\n }\n }\n\n //append legend lines\n scaledLegend.lines = scaledLegend.svg.selectAll('.eve-legend-scaled-line')\n .data(scaledLegend.legendValues)\n .enter().append('line')\n .attr('class', 'eve-legend-scaled-line')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1);\n\n //append legend text\n scaledLegend.texts = scaledLegend.svg.selectAll('.eve-legend-scaled-text')\n .data(scaledLegend.legendValues)\n .enter().append('text')\n .attr('class', 'eve-legend-scaled-text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', 'pointer')\n .text(function (d) { return d.value; });\n\n //transform legend circles\n scaledLegend.icons\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = (chart.series[0].tileIcon === 'square' ? chart.series[0].maxBulletSize - d.radius * 2 : chart.series[0].maxBulletSize - d.radius);\n xPos = (chart.series[0].tileIcon === 'square' ? ((chart.series[0].maxBulletSize - d.radius) * 2) : chart.series[0].maxBulletSize);\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //transform legend lines\n scaledLegend.lines\n .attr('x1', function (d) { return d.value === '' ? 0 : (chart.series[0].tileIcon === 'square' ? chart.series[0].maxBulletSize * 2 : chart.series[0].maxBulletSize); })\n .attr('y1', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; })\n .attr('x2', function (d) { return d.value === '' ? 0 : chart.series[0].maxBulletSize * 2 + legendIconOffset; })\n .attr('y2', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; });\n\n //transform legend text\n scaledLegend.texts\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .attr('transform', function (d, i) {\n //set x and y position\n xPos = chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n yPos = chart.series[0].maxBulletSize - d.radius * 2 + chart.legend.fontSize / 2;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }", "title": "" }, { "docid": "7123b72bac0b0a64dc3850b8d6990c25", "score": "0.5324415", "text": "function onBrush(dateFromTo){\n dateRange = dateFromTo;\n //console.log(dateRange);\n render1();\n }", "title": "" }, { "docid": "5397700dc918dcd973c6e2e0b6cdfe5f", "score": "0.5307497", "text": "function redrawMap(_dataSeries) { // selectionDataValue\n\n // update the title\n chartTitleMap = document.getElementById(\"map_title\");\n chartTitleMap.innerHTML = '';\n var chartTitleMapText = document.createTextNode(\"Data series: \" + _dataSeries);\n chartTitleMap.appendChild(chartTitleMapText);\n\n // create new colour scales, given data series\n var colourScale1Update = d3.scaleQuantile()\n .range(colourSet1)\n\n var colourScale2Update = d3.scaleQuantile()\n .range(colourSet2)\n\n colourScale1Update.domain(d3.extent(area_data, function(d) {\n return +d[_dataSeries];\n }));\n\n colourScale2Update.domain(d3.extent(area_data, function(d) {\n return +d[_dataSeries];\n }));\n\n areas\n .transition()\n .duration(500)\n .style('fill', function(d) {\n for (var i = 0; i < area_data.length; i++) {\n if (area_data[i].oslaua === d.properties.lad15cd) {\n // vote_outcome\n // console.log(i)\n // console.log(area_data[i].vote_outcome);\n if (area_data[i].vote_outcome === \"2\") {\n return colourScale1Update(parseFloat(area_data[i][_dataSeries]));\n }\n if (area_data[i].vote_outcome === \"1\") {\n return colourScale2Update(parseFloat(area_data[i][_dataSeries]));\n }\n }\n }\n // If we don't find a colour, return white\n return \"white\";\n });\n\n // Re-populate the text of the legend with new ranges\n // Legend\n\n // Get every area name\n legend_text = [];\n\n // change formatting for some data series\n if (_dataSeries === \"threesixty_blf_proportion\" || _dataSeries === \"perhead_charity_count\" || _dataSeries === \"perhead_charity_count_local\" || _dataSeries === \"IMD_extent\" || _dataSeries === \"Pct_Rejected\") {\n formatText = d3.format(\",.3f\");\n } else {\n formatText = d3.format(\",.0f\");\n };\n\n for (var i = 0; i < colourSet1.length; i++) {\n legend_text.push(formatText(colourScale1Update.invertExtent(colourSet1[i])[0]) + \" - \" + formatText(colourScale1Update.invertExtent(colourSet1[i])[1]));\n };\n\n legend = svg_map.selectAll('.legend')\n .data(colourSet1);\n\n // add a ‘g’ element for each colour in the data,\n var new_legend = legend\n .enter()\n .append('g')\n .attr('class', 'legend');\n\n // append a ‘rect’ element to each group\n new_legend.merge(legend)\n .append('rect')\n .attr('width', 20)\n .attr('height', 20)\n .attr('x', 0.1 * width_map)\n .attr('y', function(d, i) {\n return 0.8 * height_map - (i * 20);\n })\n .attr('fill', function(d) {\n return d\n })\n .attr('stroke', 'black')\n .attr('stroke-width', '0.5px');\n\n d3.selectAll('.legend_text').text(\n function(d, i) {\n return legend_text[i];\n }\n );\n\n} // End of redraw function", "title": "" }, { "docid": "e8b477653eae3725c899050be47f345e", "score": "0.5304508", "text": "function validatePaletteRange(){\n\tvar fMin = parseFloat($('#minPal').val());\n var fMax = parseFloat($('#maxPal').val());\n\t\n if (isNaN(fMin)) {\n alert('Value ranges can only be numbers');\n $('#minPal').val( minPalVal );\n } else if (isNaN(fMax)) {\n alert('Value ranges can only be numbers');\n $('#maxPal').val( maxPalVal );\n } else if (fMin > fMax) {\n alert('Minimum scale val() must be less than the maximum');\n $('#minPal').val( minPalVal );\n $('#maxPal').val( maxPalVal );\n } else {\n $('#minPal').val( fMin );\n $('#maxPal').val( fMax );\n minPalVal= fMin;\n maxPalVal= fMax;\n\t\treturn true;\n }\n\treturn false;\n}", "title": "" }, { "docid": "b71307d673b665fcbc560f682ac7cfc9", "score": "0.52927047", "text": "function range () {\n\t\tvar args = [], len = arguments.length;\n\t\twhile ( len-- ) args[ len ] = arguments[ len ];\n\n\t\tvar options\n\n\t\tif (isObj(args[args.length - 1])) {\n\t\t\tvar arg = args.pop()\n\n\t\t\t// detect if that was a rect object\n\t\t\tif (!args.length && (arg.x != null || arg.l != null || arg.left != null)) {\n\t\t\t\targs = [arg]\n\t\t\t\toptions = {}\n\t\t\t}\n\n\t\t\toptions = pick(arg, {\n\t\t\t\tlevel: 'level maxLevel',\n\t\t\t\td: 'd diam diameter r radius px pxSize pixel pixelSize maxD size minSize',\n\t\t\t\tlod: 'lod details ranges offsets'\n\t\t\t})\n\t\t}\n\t\telse {\n\t\t\toptions = {}\n\t\t}\n\n\t\tif (!args.length) { args = bounds }\n\n\t\tvar box = rect.apply( void 0, args )\n\n\t\tvar ref = [\n\t\t\tMath.min(box.x, box.x + box.width),\n\t\t\tMath.min(box.y, box.y + box.height),\n\t\t\tMath.max(box.x, box.x + box.width),\n\t\t\tMath.max(box.y, box.y + box.height)\n\t\t];\n\t\tvar minX = ref[0];\n\t\tvar minY = ref[1];\n\t\tvar maxX = ref[2];\n\t\tvar maxY = ref[3];\n\n\t\tvar ref$1 = normalize([minX, minY, maxX, maxY], bounds );\n\t\tvar nminX = ref$1[0];\n\t\tvar nminY = ref$1[1];\n\t\tvar nmaxX = ref$1[2];\n\t\tvar nmaxY = ref$1[3];\n\n\t\tvar maxLevel = defined(options.level, levels.length)\n\n\t\t// limit maxLevel by px size\n\t\tif (options.d != null) {\n\t\t\tvar d\n\t\t\tif (typeof options.d === 'number') { d = [options.d, options.d] }\n\t\t\telse if (options.d.length) { d = options.d }\n\n\t\t\tmaxLevel = Math.min(\n\t\t\t\tMath.max(\n\t\t\t\t\tMath.ceil(-log2(Math.abs(d[0]) / (bounds[2] - bounds[0]))),\n\t\t\t\t\tMath.ceil(-log2(Math.abs(d[1]) / (bounds[3] - bounds[1])))\n\t\t\t\t),\n\t\t\t\tmaxLevel\n\t\t\t)\n\t\t}\n\t\tmaxLevel = Math.min(maxLevel, levels.length)\n\n\t\t// return levels of details\n\t\tif (options.lod) {\n\t\t\treturn lod(nminX, nminY, nmaxX, nmaxY, maxLevel)\n\t\t}\n\n\n\n\t\t// do selection ids\n\t\tvar selection = []\n\n\t\t// FIXME: probably we can do LOD here beforehead\n\t\tselect( 0, 0, 1, 0, 0, 1)\n\n\t\tfunction select ( lox, loy, d, level, from, to ) {\n\t\t\tif (from === null || to === null) { return }\n\n\t\t\tvar hix = lox + d\n\t\t\tvar hiy = loy + d\n\n\t\t\t// if box does not intersect level - ignore\n\t\t\tif ( nminX > hix || nminY > hiy || nmaxX < lox || nmaxY < loy ) { return }\n\t\t\tif ( level >= maxLevel ) { return }\n\t\t\tif ( from === to ) { return }\n\n\t\t\t// if points fall into box range - take it\n\t\t\tvar levelItems = levels[level]\n\n\t\t\tif (to === undefined) { to = levelItems.length }\n\n\t\t\tfor (var i = from; i < to; i++) {\n\t\t\t\tvar id = levelItems[i]\n\n\t\t\t\tvar px = srcPoints[ id * 2 ]\n\t\t\t\tvar py = srcPoints[ id * 2 + 1 ]\n\n\t\t\t\tif ( px >= minX && px <= maxX && py >= minY && py <= maxY ) {selection.push(id)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for every subsection do select\n\t\t\tvar offsets = sublevels[ level ]\n\t\t\tvar off0 = offsets[ from * 4 + 0 ]\n\t\t\tvar off1 = offsets[ from * 4 + 1 ]\n\t\t\tvar off2 = offsets[ from * 4 + 2 ]\n\t\t\tvar off3 = offsets[ from * 4 + 3 ]\n\t\t\tvar end = nextOffset(offsets, from + 1)\n\n\t\t\tvar d2 = d * .5\n\t\t\tvar nextLevel = level + 1\n\t\t\tselect( lox, loy, d2, nextLevel, off0, off1 || off2 || off3 || end)\n\t\t\tselect( lox, loy + d2, d2, nextLevel, off1, off2 || off3 || end)\n\t\t\tselect( lox + d2, loy, d2, nextLevel, off2, off3 || end)\n\t\t\tselect( lox + d2, loy + d2, d2, nextLevel, off3, end)\n\t\t}\n\n\t\tfunction nextOffset(offsets, from) {\n\t\t\tvar offset = null, i = 0\n\t\t\twhile(offset === null) {\n\t\t\t\toffset = offsets[ from * 4 + i ]\n\t\t\t\ti++\n\t\t\t\tif (i > offsets.length) { return null }\n\t\t\t}\n\t\t\treturn offset\n\t\t}\n\n\t\treturn selection\n\t}", "title": "" }, { "docid": "9321c4a56e0e015c7d73ff76031b3a72", "score": "0.52892053", "text": "function chartLegend(chart) {\n //declare needed variables\n let legendContainer = null,\n legendSvg = null,\n legendG = null,\n width = 0,\n height = 0,\n plot = {\n width: 0,\n height: 0,\n left: chart.margin.left,\n top: chart.margin.top,\n right: chart.margin.right,\n bottom: chart.margin.bottom\n },\n sizes = {\n maxWidth: chart.plot.width / 4,\n maxHeight: chart.plot.height / 4,\n minWidth: chart.plot.width / 15,\n minHeight: chart.plot.height / 15,\n containerWidth: 0,\n containerHeight: 0,\n svgWidth: 0,\n svgHeight: 0\n },\n rangedLegend = {\n width: 0,\n height: 0,\n blockWidth: 0,\n blockHeight: 0,\n dimension: 20,\n svg: null\n },\n defaultLegend = {\n width: 0,\n height: 0,\n singleHeight: 0,\n legendValues: [],\n icons: null,\n texts: null,\n svg: null\n },\n gradientLegend = {\n width: 0,\n height: 0,\n percentage: 0,\n dimension: 20,\n blockWidth: 0,\n blockHeight: 0,\n minMax: [],\n minLabel: null,\n maxLabel: null,\n gradient: null,\n svg: null\n },\n scaledLegend = {\n width: 0,\n height: 0,\n band: 0,\n legendValues: [],\n rScale: null,\n icons: null,\n lines: null,\n texts: null,\n svg: null\n },\n tempTextValue = '',\n tempTextValueLength = 0,\n tempTextSVG = null,\n tempTextSVGOffset = null,\n legendIconOffset = 5,\n currentItem = null,\n filteredList = null,\n groupValues = [],\n newChartSeries = [],\n xPos = 0,\n yPos = 0,\n tempOffset = null,\n tempDimensions = null,\n twoLegends = false,\n that = this;\n\n //declare range and measure variables to calculate legend\n let minMeasure = 0;\n let maxMeasure = 0;\n let minX = 0;\n let maxX = 0;\n let updateMultipleDataForLegend = function () {\n //iterate data set to create actual data\n let actualData = [];\n let currentSerie = chart.series[0];\n chart.data.forEach(function (d) {\n if (e.getType(d.values) === 'array') {\n if (d.values.length && d.values.length > 0)\n actualData.push(e.clone(d));\n } else {\n if (d.values && d.values.baseData && d.values.baseData.length && d.values.baseData.length > 0)\n actualData.push(e.clone(d));\n }\n });\n\n //declare a stack to store min and max values\n let minValueSets = [],\n maxValueSets = [];\n\n //switch serie type\n switch (currentSerie.type) {\n case 'circlePacking':\n case 'circlepacking':\n case 'dendrogram':\n case 'force':\n case 'sunburst':\n case 'treemap':\n {\n //iterate all actual data to calculate min max values\n actualData.forEach(function (currentSet) {\n //get current data aray\n currentDataArray = currentSet.values.dataArray || currentSet.values;\n\n //get current min and max\n let currentMinMax = chart.getMinMaxValueForTree(currentSerie, currentDataArray);\n\n //push min and max value sets\n minValueSets.push(currentMinMax.min);\n maxValueSets.push(currentMinMax.max);\n });\n\n //set min and max measure\n minMeasure = d3.min(minValueSets);\n maxMeasure = d3.max(maxValueSets);\n }\n break;\n default:\n {\n //calculate min and max values\n minMeasure = chart.domains.minY;\n maxMeasure = chart.domains.maxY;\n minX = chart.domains.minX;\n maxX = chart.domains.maxX;\n }\n break;\n }\n };\n\n //creates legend container\n function createLegendContainer() {\n //switch legend position to set translation\n switch (chart.legend.position) {\n case 'left':\n {\n //create legend container\n legendContainer = d3.select('#' + chart.container)\n .insert('div', '#' + chart.innerContainer)\n .attr('id', chart.container + '_legend')\n .style('float', 'left');\n\n //update inner container style\n d3.select('#' + chart.innerContainer)\n .style('float', 'right');\n\n //set max legend size\n sizes.maxHeight = chart.plot.height;\n }\n break;\n case 'right':\n {\n //create legend container\n legendContainer = d3.select('#' + chart.container)\n .insert('div', '#' + chart.innerContainer)\n .attr('id', chart.container + '_legend')\n .style('float', 'right');\n\n //update inner container style\n d3.select('#' + chart.innerContainer)\n .style('float', 'left');\n\n //set max legend size\n sizes.maxHeight = chart.plot.height;\n }\n break;\n case 'bottom':\n {\n //create legend container\n legendContainer = d3.select('#' + chart.container)\n .append('div')\n .attr('id', chart.container + '_legend');\n //set max legend size\n sizes.maxWidth = chart.plot.width;\n }\n break;\n case 'top':\n {\n //create legend container\n legendContainer = d3.select('#' + chart.container)\n .insert('div', '#' + chart.innerContainer)\n .attr('id', chart.container + '_legend');\n\n //set max legend size\n sizes.maxWidth = chart.plot.width;\n }\n break;\n }\n\n //create legend svg\n legendSvg = legendContainer\n .append('svg')\n .attr('class', 'legend_svg')\n .attr('id', chart.container + '_legend_svg')\n .attr('fill', chart.backColor)\n .attr('stroke', 'none');\n\n //set legend g\n legendG = legendSvg\n .append('g')\n .attr('transform', 'translate(' + plot.left + ',' + plot.top + ')');\n }\n\n //sets the legend size\n function setSizes() {\n //set dimension\n width += plot.left + plot.right;\n height += plot.top + plot.bottom;\n legendContainer.style('overflow', 'hidden');\n\n //switch legend position to adjust chart plot\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set container and svg heights\n if (height > sizes.maxHeight) {\n sizes.containerHeight = sizes.maxHeight;\n sizes.svgHeight = height;\n legendContainer.style('overflow-y', 'auto');\n sizes.containerWidth += 10;\n } else {\n sizes.containerHeight = sizes.maxHeight;\n sizes.svgHeight = sizes.maxHeight;\n }\n\n //set container and svg widths\n if (width < sizes.minWidth) {\n sizes.containerWidth = sizes.minWidth;\n sizes.svgWidth = sizes.minWidth;\n } else if (width > sizes.maxWidth) {\n sizes.containerWidth = sizes.maxWidth;\n sizes.svgWidth = width;\n legendContainer.style('overflow-x', 'auto');\n sizes.containerHeight += 10;\n } else {\n sizes.containerWidth = width;\n sizes.svgWidth = width;\n }\n\n //decrease width\n chart.plot.width -= sizes.containerWidth;\n //chart.legendSize.width = sizes.containerWidth;\n }\n break;\n case 'bottom':\n case 'top':\n {\n //set container and svg heights\n if (height < sizes.minHeight) {\n sizes.containerHeight = sizes.minHeight;\n sizes.svgHeight = sizes.minHeight;\n } else if (height > sizes.maxHeight + 3) {\n sizes.containerHeight = sizes.maxHeight;\n sizes.svgHeight = height;\n legendContainer.style('overflow-y', 'auto');\n sizes.containerWidth += 15;\n } else {\n sizes.containerHeight = height;\n sizes.svgHeight = height;\n }\n\n //set container and svg widths\n if (width > sizes.maxWidth + 3) {\n sizes.containerWidth = sizes.maxWidth;\n sizes.svgWidth = width;\n legendContainer.style('overflow-x', 'auto');\n sizes.containerHeight += 15;\n } else {\n sizes.containerWidth = sizes.maxWidth;\n sizes.svgWidth = sizes.maxWidth;\n }\n\n //decrease height\n chart.plot.height -= sizes.containerHeight;\n //chart.legendSize.height = sizes.containerHeight;\n }\n break;\n }\n\n //update chart svg if exists\n if (chart.svg) {\n //update canvas\n chart.svg\n .attr('viewBox', '0 0 ' + chart.plot.width + ' ' + (chart.plot.height - chart.plot.top))\n .attr('width', chart.plot.width)\n .attr('height', (chart.plot.height - chart.plot.top));\n\n //handle css dimensions\n if (e.mobile)\n $('#' + chart.container + '_svg').css(\"width\", chart.plot.width).css(\"height\", (chart.plot.height - chart.plot.top));\n }\n\n //set container and svg sizes\n legendContainer\n .style('width', sizes.containerWidth + 'px')\n .style('height', sizes.containerHeight + 'px');\n\n //set svg size\n legendSvg\n .attr('width', sizes.svgWidth)\n .attr('height', sizes.svgHeight);\n\n //set svg positions\n setPositions();\n }\n\n //adjusts legend position\n function updateSizes() {\n width += plot.left + plot.right;\n height += plot.top + plot.bottom;\n legendContainer.style('overflow', 'hidden');\n\n //set container and svg heights\n if (height > sizes.containerHeight) {\n sizes.svgHeight = height;\n legendContainer.style('overflow-y', 'auto');\n } else {\n sizes.svgHeight = sizes.containerHeight;\n }\n //set container and svg widths\n if (width > sizes.containerWidth) {\n sizes.svgWidth = width;\n legendContainer.style('overflow-x', 'auto');\n } else {\n sizes.svgWidth = sizes.containerWidth;\n }\n\n //set svg size\n legendSvg\n .attr('width', sizes.svgWidth)\n .attr('height', sizes.svgHeight);\n\n //set svg positions\n setPositions();\n }\n\n //sets legend position\n function setPositions() {\n //if its a default legend\n if (defaultLegend.svg) {\n //switch legend position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = (sizes.svgWidth - (defaultLegend.width + plot.left + plot.right)) / 2;\n yPos = Math.max((sizes.svgHeight - height) / 2, 0);\n }\n break;\n case 'bottom':\n case 'top':\n {\n xPos = Math.max((sizes.svgWidth - width) / 2, 0);\n yPos = (sizes.svgHeight - (defaultLegend.height + plot.top + plot.bottom)) / 2;\n }\n break;\n }\n\n //set position\n defaultLegend.svg\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr('transform', 'translate(' + xPos + ',' + yPos + ')');\n }\n\n //gradient legend positions\n if (gradientLegend.svg) {\n //switch legend position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = (sizes.svgWidth - (gradientLegend.width + plot.left + plot.right)) / 2;\n yPos = 0;\n }\n break;\n case 'bottom':\n case 'top':\n {\n xPos = 0;\n yPos = (sizes.svgHeight - (gradientLegend.height + plot.top + plot.bottom)) / 2;\n }\n break;\n }\n\n //set position\n gradientLegend.svg\n .attr('transform', 'translate(' + xPos + ',' + yPos + ')');\n }\n\n //ranged legend positions\n if (rangedLegend.svg) {\n //switch legend position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = (sizes.svgWidth - (rangedLegend.width + plot.left + plot.right)) / 2;\n yPos = 0;\n }\n break;\n case 'bottom':\n case 'top':\n {\n xPos = 0;\n yPos = (sizes.svgHeight - (rangedLegend.height + plot.top + plot.bottom)) / 2;\n }\n break;\n }\n rangedLegend.svg\n .attr('transform', 'translate(' + xPos + ',' + yPos + ')');\n }\n\n //scaled legend positions\n if (scaledLegend.svg) {\n //switch legend position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = (sizes.svgWidth - scaledLegend.width - plot.left - plot.right) / 2;\n yPos = (height - scaledLegend.height - plot.top) + Math.max((sizes.svgHeight - height) / 2, 0) + scaledLegend.height / 2;\n }\n break;\n case 'bottom':\n case 'top':\n {\n xPos = (width - scaledLegend.width - plot.left) + Math.max((sizes.svgWidth - width) / 2, 0);\n yPos = (sizes.svgHeight - scaledLegend.height - plot.top - plot.bottom) / 2 + scaledLegend.height / 2;\n }\n break;\n }\n scaledLegend.svg\n .attr('transform', 'translate(' + xPos + ',' + yPos + ')');\n }\n }\n\n //updates ranged type legend\n function createDefaultLegend(options) {\n currentItem = null;\n\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'sliced':\n {\n //if chart type is multiples then we need to extract the values from sets\n if (chart.type === \"multiples\") {\n let legendNames = [];\n chart.data.forEach(function (cd) {\n if (cd.values && cd.values.length) {\n cd.values.forEach(function (d) {\n let xValue = d[chart.series[0].xField];\n\n if (legendNames.indexOf(xValue) === -1) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d[chart.series[0].xField]);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n } else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d[chart.xField] ? d[chart.xField].toString() : '',\n length: d[chart.xField] ? d[chart.xField].toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n legendNames.push(xValue);\n }\n });\n }\n });\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if(valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n } else {\n //iterate all chart data to set legend values\n chart.data.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d[chart.xField]);\n if (d[chart.series[0].valueField] != null) {\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n } else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d[chart.xField] ? d[chart.xField].toString() : '',\n length: d[chart.xField] ? d[chart.xField].toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if (valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n }\n\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n }\n break;\n case 'grouped':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //check whether the chart has legend values\n if (chart.legend.legendColors && chart.legend.legendColors.length)\n defaultLegend.legendValues = chart.legend.legendColors;\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n }\n break;\n case 'sourced':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].sourceField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n });\n\n //sort defaultLegend.legendValues\n defaultLegend.legendValues.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n case 'map':\n {\n //check whether the legend has animation\n if (chart.legend.animLegend) {\n groupValues = chart.legend.animLegend;\n } else {\n switch (chart.type) {\n case 'standardMap':\n case 'tileMap':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].valueField);\n }\n break;\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].colorField);\n }\n break;\n default:\n {\n if (chart.series[0].groupField === '') return;\n\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n }\n }\n }\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n }\n break;\n case 'manual':\n {\n //iterate all group values\n if (chart.manualLegendValues) {\n chart.manualLegendValues.forEach(function (d, i) {\n //add current value into the legend values\n if (d) {\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (filteredList.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: filteredList[0].value ? filteredList[0].value : '',\n length: filteredList[0].value ? filteredList[0].value.toString().length : 0,\n color: filteredList[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d.toString(),\n length: d.toString().length,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n }\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n default:\n {\n //if chart type is mirrored bars we need to make a different approach\n if (chart.type === 'mirroredBars') {\n //declare an index to limit colors\n let legendColorIndex = 0;\n\n //iterate legend colors\n chart.legend.legendColors.forEach(function (d, i) {\n //limit to two selections\n if (legendColorIndex < 2) {\n let legendValue = d.text || d.value;\n\n defaultLegend.legendValues.push({\n value: legendValue ? legendValue.toString() : '',\n length: legendValue ? legendValue.toString().length : 0,\n color: d.color\n });\n }\n\n //increase indexer\n legendColorIndex++;\n });\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if (valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n } else if (chart.type === 'bubbleForce') {\n if (chart.series[0].groupField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort legendValues\n defaultLegend.legendValues.sort(function (a, b) {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n\n } else if (chart.manualLegendValues) {\n chart.manualLegendValues.forEach(function (d, i) {\n //add current value into the legend values\n if (d) {\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (filteredList.length > 0) {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: filteredList[0].value ? filteredList[0].value : '',\n length: filteredList[0].value ? filteredList[0].value.toString().length : 0,\n color: filteredList[0].color\n });\n }\n else {\n //add current value into the legend values\n defaultLegend.legendValues.push({\n value: d.toString(),\n length: d.toString().length,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n defaultLegend.legendValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n } else {\n //check whether the legend colors has set\n if (chart.legend.legendColors && chart.legend.legendColors.length) {\n //set default legend values\n defaultLegend.legendValues = chart.legend.legendColors;\n }\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //extract the type of the value\n let valueType = typeof a.value;\n if (valueType === \"string\") {\n if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0;\n } else if (valueType === \"number\") {\n return a.value - b.value;\n } else {\n return new Date(a.value) - new Date(b.value);\n }\n });\n }\n\n //don't create legend if there are less than 2 items in it\n if (defaultLegend.legendValues.length < 2) {\n if (chart.series.length < 2)\n return;\n }\n }\n break;\n }\n\n //don't create legend if there aren't any items\n if (defaultLegend.legendValues.length === 0) return;\n\n //set legend values\n chart.legendValues = defaultLegend.legendValues;\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //get type and nan state for the value\n let vType = e.getType(a.value);\n let nanState = isNaN(a.value);\n if (nanState) {\n if (vType === \"string\") {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n } else if (vType === \"date\") {\n return new Date(a.value) - new Date(b.value);\n } else {\n return a.value - b.value;\n }\n } else {\n return parseFloat(a.value) - parseFloat(b.value);\n }\n });\n\n //iterate all legend values\n defaultLegend.legendValues.forEach(function (currentLegend) {\n\n //get width of the text\n currentLegend.width = getTempOffset(currentLegend.value).width + chart.legend.fontSize + legendIconOffset * 2;\n \n //retrieve max length text\n if (currentLegend.width > tempTextValueLength) {\n tempTextValue = currentLegend.value;\n tempTextValueLength = currentLegend.length;\n }\n });\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //set single height and width\n defaultLegend.singleHeight = tempTextSVGOffset.height + legendIconOffset;\n\n //append ranged Legend g\n defaultLegend.svg = legendG\n .append('g');\n\n //append legend icons\n defaultLegend.icons = defaultLegend.svg.selectAll('.eve-legend-icon')\n .data(defaultLegend.legendValues)\n .enter().append('rect')\n .attr('class', 'eve-legend-icon')\n .attr('width', chart.legend.fontSize)\n .attr('height', chart.legend.fontSize)\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .style('fill', function (d, i) { return d.color; })\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, (d.serieIndex ? d.serieIndex : i));\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n });\n\n //append legend texts\n defaultLegend.texts = defaultLegend.svg.selectAll('.eve-legend-text')\n .data(defaultLegend.legendValues)\n .enter().append('text')\n .attr('class', 'eve-legend-text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .text(function (d, i) { return d.value; })\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie((d.serieIndex ? d.serieIndex : i), null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, (d.serieIndex ? d.serieIndex : i));\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n });\n\n //transform legend icons\n defaultLegend.icons\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = (i * defaultLegend.singleHeight);\n }\n break;\n default:\n {\n yPos = 0;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; });\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //transform legend texts\n defaultLegend.texts\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = chart.legend.fontSize + legendIconOffset;\n yPos = (i * defaultLegend.singleHeight) + defaultLegend.singleHeight / 2;\n }\n break;\n default:\n {\n yPos = defaultLegend.singleHeight / 2;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; }) + chart.legend.fontSize + legendIconOffset;\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //get bbox of the svg\n tempDimensions = defaultLegend.svg.node().getBoundingClientRect();\n\n //set legend size\n defaultLegend.height = tempDimensions.height;\n defaultLegend.width = tempDimensions.width + 15;\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < defaultLegend.width ? defaultLegend.width : width;\n height += defaultLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += defaultLegend.width;\n height = height < defaultLegend.height ? defaultLegend.height : height;\n }\n break;\n }\n }\n\n //updates ranged type legend\n function updateDefaultLegend(options) {\n //set new chart series\n newChartSeries = [];\n currentItem = null;\n\n //switch chart type\n switch (chart.masterType) {\n case 'sliced':\n {\n //iterate all chart data to set legend values\n chart.data.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d[chart.xField]);\n\n if (d[chart.series[0].valueField] != null) {\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n } else {\n //add current value into the legend values\n newChartSeries.push({\n value: d[chart.xField] ? d[chart.xField].toString() : '',\n length: d[chart.xField] ? d[chart.xField].toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n }\n break;\n case 'grouped':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort chartSeries\n newChartSeries.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n case 'manual':\n {\n //iterate all group values\n chart.manualLegendValues.forEach(function (d, i) {\n //add current value into the legend values\n if (d) {\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (filteredList.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: filteredList[0].value ? filteredList[0].value : '',\n length: filteredList[0].value ? filteredList[0].value.length : 0,\n color: filteredList[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d.toString(),\n length: d.toString().length,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n\n //sort legendValues\n newChartSeries.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n case 'map':\n {\n //check whether the legend has animation\n if (chart.legend.animLegend) {\n groupValues = chart.legend.animLegend;\n } else {\n switch (chart.type) {\n case 'standardMap':\n case 'tileMap':\n case 'contCartogram':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].valueField);\n }\n break;\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].colorField);\n }\n break;\n default:\n {\n if (chart.series[0].groupField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n }\n }\n }\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort chartSeries\n newChartSeries.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n default:\n {\n if (chart.type === 'bubbleForce') {\n if (chart.series[0].groupField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort legendValues\n newChartSeries.sort(function (a, b) {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n });\n newChartSeries.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n\n } else {\n //sort data\n chart.data.sort(function (a, b) {\n return ((a[chart.xField] < b[chart.xField]) ? -1 : ((a[chart.xField] > b[chart.xField]) ? 1 : 0));\n });\n\n //extract serie names from the updated data\n let newSeries = chart.extractSerieNamesFromData();\n\n //iterate all series\n newSeries.forEach(function (newSerie) {\n if (newSerie.serie) {\n //check wheter the title is not empty\n if (newSerie.serie.title && newSerie.serie.title !== '') {\n currentItem = newSerie.serie.title;\n } else {\n //set related field content as legend text\n if (newSerie.serie.yField && newSerie.serie.yField !== '')\n currentItem = newSerie.serie.yField;\n else if (newSerie.serie.valueField && newSerie.serie.valueField !== '')\n currentItem = newSerie.serie.valueField;\n else if (newSerie.serie.measureField && newSerie.serie.measureField !== '')\n currentItem = newSerie.serie.measureField;\n }\n\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', currentItem);\n if (filteredList.length > 0) {\n let legendValue = filteredList[0].text || filteredList[0].value;\n\n newChartSeries.push({\n value: legendValue ? legendValue.toString() : '',\n length: legendValue ? legendValue.toString().length : 0,\n color: newSerie.serie.color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem ? currentItem.toString() : '',\n length: currentItem ? currentItem.toString().length : 0,\n color: newSerie.serie.color\n });\n }\n }\n });\n }\n }\n break;\n }\n\n //assign updated values\n chart.legendValues = newChartSeries;\n defaultLegend.legendValues = newChartSeries;\n\n //set start values for comparison\n tempTextValue = '';\n tempTextValueLength = 0;\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //get type and nan state for the value\n let vType = e.getType(a.value);\n let nanState = isNaN(a.value);\n if (nanState) {\n if (vType === \"string\") {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n } else if (vType === \"date\") {\n return new Date(a.value) - new Date(b.value);\n } else {\n return a.value - b.value;\n }\n } else {\n return parseFloat(a.value) - parseFloat(b.value);\n }\n });\n\n //iterate all legend values\n defaultLegend.legendValues.forEach(function (currentLegend) {\n\n //get width of the text\n currentLegend.width = getTempOffset(currentLegend.value).width + chart.legend.fontSize + legendIconOffset * 2;\n\n //retrieve max length text\n if (currentLegend.length > tempTextValueLength) {\n tempTextValue = currentLegend.value;\n tempTextValueLength = currentLegend.length;\n }\n });\n\n //update icon svgs\n let iconBase = defaultLegend.svg.selectAll('.eve-legend-icon')\n .data(defaultLegend.legendValues);\n\n //set class\n iconBase\n .attr('class', 'eve-legend-icon update');\n\n //set animation removal\n iconBase\n .exit().remove();\n\n //set icons\n defaultLegend.icons = iconBase\n .enter().append('rect')\n .attr('class', 'eve-legend-icon')\n .attr('width', chart.legend.fontSize)\n .attr('height', chart.legend.fontSize)\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie(i, true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie(i, null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, i);\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .merge(iconBase)\n .style('fill', function (d, i) { return d.color; });\n\n //update text svgs\n let textBase = defaultLegend.svg.selectAll('.eve-legend-text')\n .data(defaultLegend.legendValues);\n\n //set class\n textBase\n .attr('class', 'eve-legend-text update');\n\n //animation removal\n textBase\n .exit().remove();\n\n //set texts\n defaultLegend.texts = textBase\n .enter().append('text')\n .attr('class', 'eve-legend-text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie(i, true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie(i, null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, i);\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .merge(textBase)\n .text(function (d, i) { return d.value; });\n\n //transform legend icons\n defaultLegend.icons\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = (i * defaultLegend.singleHeight);\n }\n break;\n default:\n {\n yPos = 0;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; });\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //transform legend texts\n defaultLegend.texts\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = chart.legend.fontSize + legendIconOffset;\n yPos = (i * defaultLegend.singleHeight) + defaultLegend.singleHeight / 2;\n }\n break;\n default:\n {\n yPos = defaultLegend.singleHeight / 2;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; }) + chart.legend.fontSize + legendIconOffset;\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //get bbox of the svg\n tempDimensions = defaultLegend.svg.node().getBoundingClientRect();\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < tempDimensions.width ? tempDimensions.width : width;\n height += tempDimensions.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += tempDimensions.width;\n height = height < tempDimensions.height ? tempDimensions.height : height;\n }\n break;\n }\n\n //set legend size\n defaultLegend.height = tempDimensions.height;\n defaultLegend.width = tempDimensions.width;\n }\n\n //creates ranged type legend\n function createRangedLegend(options) {\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'map':\n {\n switch (chart.type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n }\n break;\n default:\n {\n }\n break;\n }\n }\n break;\n default:\n {\n }\n break;\n }\n\n //create multiples\n if (chart.type === 'multiples') {\n switch (chart.series[0].type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n }\n break;\n }\n }\n\n //set formatted content\n let formattedMax = '';\n\n //reset temp value\n tempTextValueLength = 0;\n\n //iterate all legend values\n chart.legend.rangeList.forEach(function (range, rangeIndex) {\n //retrieve max length text\n if (range.text.length > tempTextValueLength) {\n tempTextValue = range.text;\n tempTextValueLength = range.text.length;\n }\n formattedMax = e.formatNumber(range.maxValue, chart.legend.numberFormat).toString();\n if (formattedMax.length > tempTextValueLength) {\n tempTextValue = formattedMax;\n tempTextValueLength = formattedMax.length;\n }\n });\n\n //calculate automatic legend width\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n //calculate legend dimension\n rangedLegend.width = rangedLegend.dimension + legendIconOffset * 2 + tempTextSVGOffset.width;\n rangedLegend.height = (sizes.maxHeight - plot.top - plot.bottom) - height - (options.legendSpace ? legendIconOffset : 0) - 5;\n rangedLegend.blockHeight = (rangedLegend.height / chart.legend.rangeList.length);\n rangedLegend.blockWidth = rangedLegend.dimension;\n }\n break;\n default:\n {\n //calculate legend widths\n rangedLegend.width = (sizes.maxWidth - plot.right - plot.left) - width - (options.legendSpace ? legendIconOffset : 0) - 5;\n rangedLegend.blockWidth = (rangedLegend.width / chart.legend.rangeList.length);\n\n //get width of the text\n tempTextSVGOffset = getWrappedTempOffset(tempTextValue, rangedLegend.blockWidth);\n\n //calculate legend heights\n rangedLegend.height = rangedLegend.dimension + tempTextSVGOffset.height + legendIconOffset * 2;\n rangedLegend.blockHeight = rangedLegend.dimension;\n }\n break;\n }\n\n //append ranged Legend g\n rangedLegend.svg = legendG\n .append('g');\n\n //append range rects\n rangedLegend.svg.selectAll('.eve-legend-icon')\n .data(chart.legend.rangeList)\n .enter().append('rect')\n .attr('class', function (d, i) { return 'ranged-' + i; })\n .attr('width', rangedLegend.blockWidth)\n .attr('height', rangedLegend.blockHeight)\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .style('fill', function (d, i) {\n if (d.color && d.color !== '') {\n return d.color;\n } else {\n return e.colors[i];\n }\n })\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = i * rangedLegend.blockHeight;\n }\n break;\n default:\n {\n xPos = i * rangedLegend.blockWidth;\n yPos = 0;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n })\n .on('click', function (d, i) {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .on('mouseenter', function (d, i) {\n //check whether the chart legend click has value\n if (chart.onLegendHover && options.onClickEnabled) {\n chart.onLegendHover(d, i, true);\n }\n })\n .on('mouseleave', function (d, i) {\n //check whether the chart legend click has value\n if (chart.onLegendHover && options.onClickEnabled) {\n chart.onLegendHover(d, i, false);\n }\n });\n\n //append range texts\n let texts = rangedLegend.svg.selectAll('.eve-legend-text')\n .data(chart.legend.rangeList)\n .enter().append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .style('text-anchor', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return 'middle';\n }\n })\n .text(function (d) { return d.text; })\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = rangedLegend.blockWidth + legendIconOffset;\n yPos = (i * rangedLegend.blockHeight) + rangedLegend.blockHeight / 2;\n }\n break;\n default:\n {\n xPos = (i * rangedLegend.blockWidth) + rangedLegend.blockWidth / 2;\n yPos = rangedLegend.blockHeight + tempTextSVGOffset.height;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n })\n .on('click', function (d, i) {\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, i);\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n });\n\n //append range boundaries\n rangedLegend.svg.selectAll('.eve-legend-line')\n .data(chart.legend.rangeList)\n .enter().append('rect')\n .attr('width', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return rangedLegend.blockWidth + legendIconOffset;\n default:\n return 2;\n }\n })\n .attr('height', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 2;\n default:\n return rangedLegend.blockHeight + legendIconOffset;\n }\n })\n .style('fill', 'rgb(0,0,0)')\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = i * rangedLegend.blockHeight;\n }\n break;\n default:\n {\n xPos = i * rangedLegend.blockWidth;\n yPos = 0;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //append last range boundary\n rangedLegend.svg.append('rect')\n .attr('width', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return rangedLegend.blockWidth + legendIconOffset;\n default:\n return 2;\n }\n })\n .attr('height', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 2;\n default:\n return rangedLegend.blockHeight + legendIconOffset;\n }\n })\n .style('fill', 'rgb(0,0,0)')\n .attr('transform', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = rangedLegend.blockHeight * chart.legend.rangeList.length - 2;\n }\n break;\n default:\n {\n xPos = rangedLegend.blockWidth * chart.legend.rangeList.length - 2;\n yPos = 0;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //append range boundary texts\n rangedLegend.svg.selectAll('.eve-legend-icon')\n .data(chart.legend.rangeList)\n .enter().append('text')\n .attr('class', 'eve-legend-icon')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return i === 0 ? 'start' : 'middle';\n }\n })\n .text(function (d) { return e.formatNumber(d.minValue, chart.legend.numberFormat); })\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = rangedLegend.blockWidth + legendIconOffset + 1;\n if (i === 0)\n yPos = (i * rangedLegend.blockHeight) + chart.legend.fontSize;\n else\n yPos = (i * rangedLegend.blockHeight) + (chart.legend.fontSize / 2);\n }\n break;\n default:\n {\n xPos = i * rangedLegend.blockWidth;\n yPos = rangedLegend.blockHeight + tempTextSVGOffset.height + 1;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //append last range boundary text\n rangedLegend.svg.append('text')\n .attr('class', 'eve-legend-icon')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', function () {\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return 'end';\n }\n })\n .text(e.formatNumber(chart.legend.rangeList[chart.legend.rangeList.length - 1].maxValue, chart.legend.numberFormat))\n .attr('transform', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = rangedLegend.blockWidth + legendIconOffset + 1;\n yPos = rangedLegend.blockHeight * chart.legend.rangeList.length + chart.legend.fontSize - tempTextSVGOffset.height;\n }\n break;\n default:\n {\n xPos = rangedLegend.blockWidth * chart.legend.rangeList.length + chart.legend.fontSize - tempTextSVGOffset.height;\n yPos = rangedLegend.blockHeight + tempTextSVGOffset.height + 1;\n }\n break;\n }\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //calculate automatic legend width\n switch (chart.legend.position) {\n case 'top':\n case 'bottom':\n {\n let valueTexts = rangedLegend.svg.selectAll('.eve-legend-icon'),\n valueWidths = [];\n\n valueTexts.each(function (d) {\n valueWidths.push(this.getBoundingClientRect().width);\n });\n\n texts.each(function (d, i) {\n let widthtoSubtract = 5;\n\n if (i === 0)\n widthtoSubtract += Math.max(valueWidths[i], valueWidths[i + 1] / 2);\n else if (i + 2 === valueWidths.length)\n widthtoSubtract += Math.max(valueWidths[i] / 2, valueWidths[i + 1]);\n else\n widthtoSubtract += Math.max(valueWidths[i] / 2, valueWidths[i + 1] / 2);\n\n widthtoSubtract *= 2;\n chart.wrapText(d3.select(this), rangedLegend.blockWidth - widthtoSubtract);\n\n });\n }\n break;\n }\n\n //get bbox of the svg\n tempDimensions = rangedLegend.svg.node().getBoundingClientRect();\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set legend size\n rangedLegend.height = tempDimensions.height + (options.legendSpace ? legendIconOffset : 0);\n rangedLegend.width = tempDimensions.width;\n //set overall legend sizes\n width = width < rangedLegend.width ? rangedLegend.width : width;\n height += rangedLegend.height;\n }\n break;\n default:\n {\n //set legend size\n rangedLegend.height = tempDimensions.height;\n rangedLegend.width = tempDimensions.width + (options.legendSpace ? legendIconOffset : 0);\n //set overall legend sizes\n width += rangedLegend.width;\n height = height < rangedLegend.height ? rangedLegend.height : height;\n }\n break;\n }\n }\n\n //updates ranged type legend\n function updateRangedLegend() {\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < rangedLegend.width ? rangedLegend.width : width;\n height += rangedLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += rangedLegend.width;\n height = height < rangedLegend.height ? rangedLegend.height : height;\n }\n break;\n }\n }\n\n //creates gradient type legend\n function createGradientLegend(options) {\n //declare needed variables\n let textColors = [chart.legend.fontColor, chart.legend.fontColor];\n\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'map':\n {\n //switch chart type to process legend values\n switch (chart.type) {\n case 'ddCartogram':\n {\n //if there is no color field need to exit\n if (chart.series[0].colorField === '') return;\n\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value from user entry\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value from user entry\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n }\n break;\n default:\n {\n //set min and max legend values\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n\n //create multiples\n if (chart.type === 'multiples') {\n //check serie vis type\n switch (chart.series[0].type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n if (chart.yAxis.min != null && chart.yAxis.max != null)\n gradientLegend.minMax = [chart.yAxis.min, chart.yAxis.max];\n }\n break;\n }\n }\n\n //handle min max\n if (chart.type === 'multiples') {\n //update legend values\n updateMultipleDataForLegend();\n\n //extract min max from multiple data content\n gradientLegend.minMax = [minMeasure, maxMeasure];\n }\n\n //set temp text value\n tempTextValue = e.formatNumber(gradientLegend.minMax[1], chart.legend.numberFormat);\n gradientLegend.percentage = Math.ceil(100 / (chart.legend.gradientColors.length - 1));\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //append gradient Legend g\n gradientLegend.svg = legendG.append('g');\n\n //calculate automatic legend width\n //switch legend position to setup the min and max stops\n //determine text colors\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //calculate legend dimension\n gradientLegend.width = gradientLegend.dimension + legendIconOffset * 2 + tempTextSVGOffset.width;\n gradientLegend.height = (sizes.maxHeight - plot.top - plot.bottom) - height - (options.legendSpace ? legendIconOffset : 0) - 5;\n gradientLegend.blockHeight = gradientLegend.height;\n gradientLegend.blockWidth = gradientLegend.dimension;\n //create legend gradient\n gradientLegend.gradient = legendSvg\n .append('defs')\n .append('linearGradient')\n .attr('x1', '0%')\n .attr('y1', '0%')\n .attr('x2', '0%')\n .attr('y2', '100%')\n .attr('id', 'gradient' + chart.container);\n }\n break;\n default:\n {\n //calculate legend dimension\n gradientLegend.width = (sizes.maxWidth - plot.right - plot.left) - width - (options.legendSpace ? legendIconOffset : 0) - 5;\n gradientLegend.height = Math.max(gradientLegend.dimension, tempTextSVGOffset.height) + legendIconOffset * 2;\n gradientLegend.blockHeight = Math.max(gradientLegend.dimension, tempTextSVGOffset.height);\n gradientLegend.blockWidth = gradientLegend.width;\n //create legend gradient\n gradientLegend.gradient = legendSvg\n .append('defs')\n .append('linearGradient')\n .attr('x1', '0%')\n .attr('y1', '0%')\n .attr('x2', '100%')\n .attr('y2', '0%')\n .attr('id', 'gradient' + chart.container);\n if (chart.legend.smartLabels) {\n //set autoColor if applicable\n textColors[0] = chart.getAutoColor(chart.legend.gradientColors[0]);\n textColors[1] = chart.getAutoColor(chart.legend.gradientColors[chart.legend.gradientColors.length - 1]);\n }\n }\n break;\n }\n\n //add color stops to gradient\n gradientLegend.gradient.selectAll('stop')\n .data(chart.legend.gradientColors)\n .enter().append('stop')\n .attr('offset', function (d, i) {\n if (i === chart.legend.gradientColors.length - 1)\n return '100%';\n else\n return (i * gradientLegend.percentage) + '%';\n })\n .attr('stop-color', function (d) {\n return d;\n });\n\n //append gradient rect\n gradientLegend.svg.append('rect')\n .attr('width', gradientLegend.blockWidth)\n .attr('height', gradientLegend.blockHeight)\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .style('fill', 'url(#gradient' + chart.container + ')');\n\n //add minimum text\n gradientLegend.minLabel = gradientLegend.svg.append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', textColors[0])\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', 'start')\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .text(e.formatNumber(gradientLegend.minMax[0], chart.legend.numberFormat))\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = gradientLegend.blockWidth + legendIconOffset;\n yPos = tempTextSVGOffset.height;\n }\n break;\n default:\n {\n xPos = 3;\n yPos = gradientLegend.blockHeight - 3;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //add maximum text\n gradientLegend.maxLabel = gradientLegend.svg.append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', textColors[1])\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('text-anchor', function () {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n return 'start';\n default:\n return 'end';\n }\n })\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .text(e.formatNumber(gradientLegend.minMax[1], chart.legend.numberFormat))\n .attr('transform', function (d, i) {\n //calculate x and y pos\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = gradientLegend.blockWidth + legendIconOffset;\n yPos = gradientLegend.blockHeight + chart.legend.fontSize - tempTextSVGOffset.height;\n }\n break;\n default:\n {\n xPos = gradientLegend.blockWidth - 3;\n yPos = gradientLegend.blockHeight - 3;\n }\n break;\n }\n\n //return translation\n return 'translate(' + xPos + ',' + yPos + ')';\n });\n\n //get bbox of the svg\n tempDimensions = gradientLegend.svg.node().getBoundingClientRect();\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set legend size\n gradientLegend.height = tempDimensions.height + (options.legendSpace ? legendIconOffset : 0);\n gradientLegend.width = tempDimensions.width;\n\n //set overall legend sizes\n width = width < gradientLegend.width ? gradientLegend.width : width;\n height += gradientLegend.height;\n }\n break;\n default:\n {\n //set legend size\n gradientLegend.height = tempDimensions.height;\n gradientLegend.width = tempDimensions.width + (options.legendSpace ? legendIconOffset : 0);\n\n //set overall legend sizes\n width += gradientLegend.width;\n height = height < gradientLegend.height ? gradientLegend.height : height;\n }\n break;\n }\n }\n\n //updates gradient type legend\n function updateGradientLegend() {\n //switch chart type to process legend values\n switch (chart.masterType) {\n case 'map':\n {\n //switch chart type to process legend values\n switch (chart.type) {\n case 'ddCartogram':\n {\n //if there is no color field need to exit\n if (chart.series[0].colorField === '') return;\n\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value from user entry\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value from user entry\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n }\n break;\n default:\n {\n //set min and max legend values\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n\n //set min value\n if (chart.yAxis.min)\n gradientLegend.minMax[0] = chart.yAxis.min;\n\n //set max value\n if (chart.yAxis.max)\n gradientLegend.minMax[1] = chart.yAxis.max;\n }\n break;\n }\n\n //create multiples\n if (chart.type === 'multiples') {\n //check serie vis type\n switch (chart.series[0].type) {\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'contCartogram':\n {\n //set gradient min and max\n if (chart.series[0].colorField === '')\n gradientLegend.minMax = [chart.domains.minY, chart.domains.maxY];\n else\n gradientLegend.minMax = [chart.domains.minColor, chart.domains.maxColor];\n }\n break;\n case 'densityMap':\n {\n //set gradient min and max\n gradientLegend.minMax = ['', ''];\n }\n break;\n default:\n {\n //set gradient min and max\n if (chart.yAxis.min != null && chart.yAxis.max != null)\n gradientLegend.minMax = [chart.yAxis.min, chart.yAxis.max];\n }\n break;\n }\n }\n\n //set label texts\n gradientLegend.minLabel.text(e.formatNumber(gradientLegend.minMax[0], chart.legend.numberFormat));\n gradientLegend.maxLabel.text(e.formatNumber(gradientLegend.minMax[1], chart.legend.numberFormat));\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < gradientLegend.width ? gradientLegend.width : width;\n height += gradientLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += gradientLegend.width;\n height = height < gradientLegend.height ? gradientLegend.height : height;\n }\n break;\n }\n }\n\n //creates scaled type legend\n function createScaledLegend() {\n let lastRadius = 0;\n scaledLegend.rScale = d3.scalePow().exponent(0.5).domain([chart.domains.minY, chart.domains.maxY]).range([(chart.domains.minY === chart.domains.maxY ? chart.series[0].maxBulletSize : chart.series[0].minBulletSize), chart.series[0].maxBulletSize]);\n scaledLegend.band = (chart.domains.maxY - chart.domains.minY) / (chart.legend.circleCount - 1);\n\n //create scaled legend data\n lastRadius = scaledLegend.rScale(chart.domains.maxY);\n scaledLegend.legendValues.push({\n value: e.formatNumber(chart.domains.maxY, chart.legend.numberFormat),\n radius: lastRadius\n });\n\n for (i = 1; i < chart.legend.circleCount; i++) {\n if (lastRadius - scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i) > chart.legend.fontSize / 2) {\n lastRadius = scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i);\n scaledLegend.legendValues.push({\n value: e.formatNumber(chart.domains.maxY - scaledLegend.band * i, chart.legend.numberFormat),\n radius: scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i)\n });\n } else {\n scaledLegend.legendValues.push({\n value: '',\n radius: 0\n });\n }\n }\n if (lastRadius === scaledLegend.rScale(chart.domains.maxY)) {\n scaledLegend.legendValues[0].value = '';\n scaledLegend.legendValues[0].radius = 0;\n }\n\n //set start values for comparison\n tempTextValue = '';\n tempTextValueLength = 0;\n\n //iterate all legend values\n scaledLegend.legendValues.forEach(function (currentLegend) {\n //retrieve max length text\n if (currentLegend.value.toString().length > tempTextValueLength) {\n tempTextValue = currentLegend.value.toString();\n tempTextValueLength = currentLegend.value.toString().length;\n }\n });\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //get scaled legend size\n scaledLegend.width = tempTextSVGOffset.width + chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n scaledLegend.height = chart.series[0].maxBulletSize * 2 + chart.legend.fontSize / 2;\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < scaledLegend.width ? scaledLegend.width : width;\n height += scaledLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += scaledLegend.width;\n height = height < scaledLegend.height ? scaledLegend.height : height;\n }\n break;\n }\n\n //append gradient Legend g\n scaledLegend.svg = legendG\n .append('g');\n\n //switch legend icons\n switch (chart.series[0].tileIcon) {\n case 'circle':\n {\n //append legend circles\n scaledLegend.icons = scaledLegend.svg.selectAll('.eve-legend-scaled-circle')\n .data(scaledLegend.legendValues)\n .enter().append('circle')\n .attr('class', 'eve-legend-scaled-circle')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1)\n .attr(\"r\", function (d) { return d.radius; });\n }\n break;\n case 'square':\n {\n //append legend circles\n scaledLegend.icons = scaledLegend.svg.selectAll('.eve-legend-scaled-circle')\n .data(scaledLegend.legendValues)\n .enter().append('rect')\n .attr('class', 'eve-legend-scaled-circle')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1)\n .attr('width', function (d) { return d.radius * 2; })\n .attr('height', function (d) { return d.radius * 2; });\n }\n break;\n default:\n {\n //append legend circles\n scaledLegend.icons = scaledLegend.svg.selectAll('.eve-legend-scaled-circle')\n .data(scaledLegend.legendValues)\n .enter().append('circle')\n .attr('class', 'eve-legend-scaled-circle')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1)\n .attr(\"r\", function (d) { return d.radius; });\n }\n }\n\n //append legend lines\n scaledLegend.lines = scaledLegend.svg.selectAll('.eve-legend-scaled-line')\n .data(scaledLegend.legendValues)\n .enter().append('line')\n .attr('class', 'eve-legend-scaled-line')\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 1);\n\n //append legend text\n scaledLegend.texts = scaledLegend.svg.selectAll('.eve-legend-scaled-text')\n .data(scaledLegend.legendValues)\n .enter().append('text')\n .attr('class', 'eve-legend-scaled-text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', 'pointer')\n .text(function (d) { return d.value; });\n\n //transform legend circles\n scaledLegend.icons\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = (chart.series[0].tileIcon === 'square' ? chart.series[0].maxBulletSize - d.radius * 2 : chart.series[0].maxBulletSize - d.radius);\n xPos = (chart.series[0].tileIcon === 'square' ? ((chart.series[0].maxBulletSize - d.radius) * 2) : chart.series[0].maxBulletSize);\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //transform legend lines\n scaledLegend.lines\n .attr('x1', function (d) { return d.value === '' ? 0 : (chart.series[0].tileIcon === 'square' ? chart.series[0].maxBulletSize * 2 : chart.series[0].maxBulletSize); })\n .attr('y1', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; })\n .attr('x2', function (d) { return d.value === '' ? 0 : chart.series[0].maxBulletSize * 2 + legendIconOffset; })\n .attr('y2', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; });\n\n //transform legend text\n scaledLegend.texts\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .attr('transform', function (d, i) {\n //set x and y position\n xPos = chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n yPos = chart.series[0].maxBulletSize - d.radius * 2 + chart.legend.fontSize / 2;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n\n //updates scaled type legend\n function updateScaledLegend() {\n let lastRadius = 0;\n scaledLegend.rScale = d3.scalePow().exponent(0.5).domain([chart.domains.minY, chart.domains.maxY]).range([(chart.domains.minY === chart.domains.maxY ? chart.series[0].maxBulletSize : chart.series[0].minBulletSize), chart.series[0].maxBulletSize]);\n scaledLegend.band = (chart.domains.maxY - chart.domains.minY) / (chart.legend.circleCount - 1);\n\n //create scaled legend data\n lastRadius = scaledLegend.rScale(chart.domains.maxY);\n scaledLegend.legendValues[0].value = e.formatNumber(chart.domains.maxY, chart.legend.numberFormat);\n scaledLegend.legendValues[0].radius = lastRadius;\n\n for (i = 1; i < chart.legend.circleCount; i++) {\n if (lastRadius - scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i) > chart.legend.fontSize / 2) {\n lastRadius = scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i);\n scaledLegend.legendValues[i].value = e.formatNumber(chart.domains.maxY - scaledLegend.band * i, chart.legend.numberFormat);\n scaledLegend.legendValues[i].radius = scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i);\n } else {\n scaledLegend.legendValues[i].value = '';\n scaledLegend.legendValues[i].radius = 0;\n }\n }\n if (lastRadius === scaledLegend.rScale(chart.domains.maxY)) {\n scaledLegend.legendValues[0].value = '';\n scaledLegend.legendValues[0].radius = 0;\n }\n //set start values for comparison\n tempTextValue = '';\n tempTextValueLength = 0;\n\n //iterate all legend values\n scaledLegend.legendValues.forEach(function (currentLegend) {\n //retrieve max length text\n if (currentLegend.value.toString().length > tempTextValueLength) {\n tempTextValue = currentLegend.value.toString();\n tempTextValueLength = currentLegend.value.toString().length;\n }\n });\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //get scaled legend size\n scaledLegend.width = tempTextSVGOffset.width + chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n scaledLegend.height = chart.series[0].maxBulletSize * 2 + chart.legend.fontSize / 2;\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < scaledLegend.width ? scaledLegend.width : width;\n height += scaledLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += scaledLegend.width;\n height = height < scaledLegend.height ? scaledLegend.height : height;\n }\n break;\n }\n\n //update legend icon data\n scaledLegend.icons\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .data(scaledLegend.legendValues);\n\n //switch legend icons\n switch (chart.series[0].tileIcon) {\n case 'circle':\n {\n //transform legend circles\n scaledLegend.icons\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr(\"r\", function (d) { return d.radius; })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = chart.series[0].maxBulletSize - d.radius;\n xPos = chart.series[0].maxBulletSize;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n break;\n case 'square':\n {\n //transform legend circles\n scaledLegend.icons\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr('width', function (d) { return d.radius * 2; })\n .attr('height', function (d) { return d.radius * 2; })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = chart.series[0].maxBulletSize - d.radius * 2;\n xPos = (chart.series[0].maxBulletSize - d.radius) * 2;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n break;\n default:\n {\n //transform legend circles\n scaledLegend.icons\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr(\"r\", function (d) { return d.radius; })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = chart.series[0].maxBulletSize - d.radius;\n xPos = chart.series[0].maxBulletSize;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n }\n\n //update legend line data\n scaledLegend.lines\n .data(scaledLegend.legendValues);\n\n //transform legend lines\n scaledLegend.lines\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr('x1', function (d) { return d.value === '' ? 0 : (chart.series[0].tileIcon === 'square' ? chart.series[0].maxBulletSize * 2 : chart.series[0].maxBulletSize); })\n .attr('y1', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; })\n .attr('x2', function (d) { return d.value === '' ? 0 : chart.series[0].maxBulletSize * 2 + legendIconOffset; })\n .attr('y2', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; });\n\n //update legend text data\n scaledLegend.texts\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .data(scaledLegend.legendValues);\n\n //transform legend text\n scaledLegend.texts\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .text(function (d) { return d.value; })\n .attr('transform', function (d, i) {\n //set x and y position\n xPos = chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n yPos = chart.series[0].maxBulletSize - d.radius * 2 + chart.legend.fontSize / 2;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n\n //helper function for getting text svg size\n function getTempOffset(text) {\n //attach the text svg\n tempTextSVG = legendG\n .append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .text(text);\n\n //get bbox of the text svg\n tempOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remove temp text svg\n tempTextSVG.remove();\n\n //return offset\n return tempOffset;\n }\n\n //helper function for getting text svg size\n function getWrappedTempOffset(text, width) {\n //attach the text svg\n tempTextSVG = legendG\n .append('text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .text(text);\n\n chart.wrapText(tempTextSVG, width);\n\n //get bbox of the text svg\n tempOffset = tempTextSVG.node().getBoundingClientRect();\n\n //remove temp text svg\n tempTextSVG.remove();\n\n //return offset\n return tempOffset;\n }\n\n //check whether the legend is enabled\n if (chart.legend.enabled) {\n //create the container\n createLegendContainer();\n\n //switch legend type to set it\n switch (chart.legend.type.trim()) {\n case 'default':\n {\n //create the legend\n createDefaultLegend({ onClickEnabled: true });\n\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n //throw Error('Legend type and secondary type cannot be same!');\n }\n break;\n case 'ranged':\n {\n createRangedLegend({ onClickEnabled: true, legendSpace: true });\n }\n break;\n case 'gradient':\n {\n createGradientLegend({ legendSpace: true });\n }\n break;\n case 'scaled':\n {\n createScaledLegend();\n }\n break;\n }\n }\n break;\n case 'ranged':\n {\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n createDefaultLegend({ onClickEnabled: false });\n twoLegends = true;\n }\n break;\n case 'ranged':\n {\n //throw Error('Legend type and secondary type cannot be same!');\n }\n break;\n case 'gradient':\n {\n //throw Error('Ranged and Gradient types cannot be combined!');\n }\n break;\n case 'scaled':\n {\n createScaledLegend();\n twoLegends = true;\n }\n break;\n }\n createRangedLegend({ onClickEnabled: true, legendSpace: twoLegends });\n }\n break;\n case 'gradient':\n {\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n createDefaultLegend({ onClickEnabled: false });\n twoLegends = true;\n }\n break;\n case 'ranged':\n {\n //throw Error('Ranged and Gradient types cannot be combined!');\n }\n break;\n case 'gradient':\n {\n //throw Error('Legend type and secondary type cannot be same!');\n }\n break;\n case 'scaled':\n {\n createScaledLegend();\n twoLegends = true;\n }\n break;\n }\n //create the gradient legend\n createGradientLegend({ legendSpace: twoLegends });\n }\n break;\n case 'scaled':\n {\n createScaledLegend();\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n createDefaultLegend({ onClickEnabled: false });\n }\n break;\n case 'ranged':\n {\n createRangedLegend({ onClickEnabled: true, legendSpace: true });\n }\n break;\n case 'gradient':\n {\n createGradientLegend({ legendSpace: true });\n }\n break;\n case 'scaled':\n {\n //throw Error('Legend type and secondary type cannot be same!');\n }\n break;\n }\n }\n }\n\n //set legend sizes\n if (defaultLegend.svg || rangedLegend.svg || gradientLegend.svg || scaledLegend.svg) {\n setSizes();\n } else {\n legendContainer.remove();\n\n //update inner container style\n d3.select('#' + chart.innerContainer)\n .style('float', null);\n }\n }\n\n //attach update method to legned\n that.update = function () {\n twoLegends = false;\n width = 0;\n height = 0;\n\n //check whether the legend is enabled\n if (chart.legend.enabled) {\n //switch legend type to set it\n switch (chart.legend.type) {\n case 'default':\n {\n if (defaultLegend.svg)\n updateDefaultLegend({ onClickEnabled: true });\n\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'ranged':\n {\n twoLegends = true;\n //to do --> update gradient size based on new default\n if (rangedLegend.svg)\n updateRangedLegend();\n }\n break;\n case 'gradient':\n {\n twoLegends = true;\n //to do --> update gradient size based on new default\n if (gradientLegend.svg)\n updateGradientLegend();\n }\n break;\n case 'scaled':\n {\n if (scaledLegend.svg)\n updateScaledLegend();\n }\n break;\n }\n }\n break;\n case 'ranged':\n {\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n createDefaultLegend({ onClickEnabled: false });\n twoLegends = true;\n //to do --> update ranged size based on new default\n }\n break;\n case 'scaled':\n {\n if (scaledLegend.svg)\n updateScaledLegend();\n }\n break;\n }\n if (rangedLegend.svg)\n updateRangedLegend();\n }\n break;\n case 'gradient':\n {\n if (chart.type !== 'streamGraph') {\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n if (defaultLegend.svg)\n updateDefaultLegend({ onClickEnabled: false });\n twoLegends = true;\n //to do --> update gradient size based on new default\n }\n break;\n case 'scaled':\n {\n if (scaledLegend.svg)\n updateScaledLegend();\n }\n break;\n }\n\n if (gradientLegend.svg)\n updateGradientLegend();\n }\n }\n break;\n case 'scaled':\n {\n if (scaledLegend.svg)\n updateScaledLegend();\n //switch legend type to set it\n switch (chart.legend.secondaryType) {\n case 'default':\n {\n if (defaultLegend.svg)\n updateDefaultLegend({ onClickEnabled: false });\n }\n break;\n case 'ranged':\n {\n if (rangedLegend.svg)\n updateRangedLegend();\n }\n break;\n case 'gradient':\n {\n if (gradientLegend.svg)\n updateGradientLegend();\n }\n break;\n }\n }\n break;\n }\n if (defaultLegend.svg || rangedLegend.svg || gradientLegend.svg || scaledLegend.svg) {\n updateSizes();\n }\n }\n };\n }", "title": "" }, { "docid": "79ab537d512b57b101700c13fa68eea0", "score": "0.52860254", "text": "_configureRange(start, end, width)\n {\n let sequenceLength = null;\n let desiredScaling = 17 ; // most optimal for ~50bp in the view.\n let rangeWidth = 0;\n let range = [0, 0];\n\n // We have entered with a variant position\n // create our sequence 'padding'\n // ex. position 20, we want total 100 nucelotides\n // (20 - 49) & (50 + 20)\n // definitely in scrollable\n if(start === end)\n {\n sequenceLength = 300; // hardcode 150 to each end.\n rangeWidth = desiredScaling * sequenceLength;\n start = start - (sequenceLength / 2) - 1;\n end = end + (sequenceLength / 2);\n // Plus 100 for the label offset.\n let middleOfView = (d3.select('#clip-rect').node().getBoundingClientRect().width / 2) + 100;\n range = [middleOfView - (rangeWidth/2), middleOfView + (rangeWidth / 2)];\n }else{\n // This statement will not work with scrollable setting and a defined range\n // TODO: FIX THIS\n return {\"range\":[0, width], \"start\": start, \"end\": end};\n }\n\n return {\"range\": range, \"start\": start, \"end\": end};\n }", "title": "" }, { "docid": "b9280631715ba34a7e189db8536741af", "score": "0.52852064", "text": "function makeRangeSelectors(data) {\n const div = select('.checkbox-div');\n\n const labels = yearRanges.map((year) => {\n const rangeStr = getRangeString(year);\n const i = getRangeIndex(year);\n return rangeStr + ` (n=${data[i]['total']}) `; \n });\n\n div.selectAll('.label')\n .data(labels)\n .enter()\n .append('label')\n .attr('class', 'label')\n .attr('for', (d, i) => i)\n .text(d => d)\n .append('input')\n .attr('class', 'checkboxes')\n .attr('type', 'checkbox')\n .attr('id', (d, i) => i)\n .property('checked', (d, i) => i === yearRanges.length - 1)\n .on('change', () => {\n select('.vis3Chart').selectAll('*').remove();\n drawChart(data);\n });\n}", "title": "" }, { "docid": "38c42a52cd897254e130f8235f5aa74b", "score": "0.5271672", "text": "function updateDefaultLegend(options) {\n //set new chart series\n newChartSeries = [];\n currentItem = null;\n\n //switch chart type\n switch (chart.masterType) {\n case 'sliced':\n {\n //iterate all chart data to set legend values\n chart.data.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d[chart.xField]);\n\n if (d[chart.series[0].valueField] != null) {\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n } else {\n //add current value into the legend values\n newChartSeries.push({\n value: d[chart.xField] ? d[chart.xField].toString() : '',\n length: d[chart.xField] ? d[chart.xField].toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n }\n break;\n case 'grouped':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort chartSeries\n newChartSeries.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n case 'manual':\n {\n //iterate all group values\n chart.manualLegendValues.forEach(function (d, i) {\n //add current value into the legend values\n if (d) {\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (filteredList.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: filteredList[0].value ? filteredList[0].value : '',\n length: filteredList[0].value ? filteredList[0].value.length : 0,\n color: filteredList[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d.toString(),\n length: d.toString().length,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n }\n });\n\n //sort legendValues\n newChartSeries.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n case 'map':\n {\n //check whether the legend has animation\n if (chart.legend.animLegend) {\n groupValues = chart.legend.animLegend;\n } else {\n switch (chart.type) {\n case 'standardMap':\n case 'tileMap':\n case 'contCartogram':\n {\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].valueField);\n }\n break;\n case 'ddCartogram':\n {\n if (chart.series[0].colorField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].colorField);\n }\n break;\n default:\n {\n if (chart.series[0].groupField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n }\n }\n }\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort chartSeries\n newChartSeries.sort(function (a, b) { if (a.value < b.value) { return -1; } if (a.value > b.value) { return 1; } return 0; });\n }\n break;\n default:\n {\n if (chart.type === 'bubbleForce') {\n if (chart.series[0].groupField === '') return;\n //declare group values\n groupValues = e.getUniqueValues(chart.data, chart.series[0].groupField);\n\n //iterate all chart data to set legend values\n groupValues.forEach(function (d, i) {\n\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d);\n if (currentItem.length > 0) {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem[0].value ? currentItem[0].value : '',\n length: currentItem[0].value ? currentItem[0].value.toString().length : 0,\n color: currentItem[0].color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: d ? d.toString() : '',\n length: d ? d.toString().length : 0,\n color: i > e.colors.length ? e.randColor() : e.colors[i]\n });\n }\n });\n\n //sort legendValues\n newChartSeries.sort(function (a, b) {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n });\n newChartSeries.forEach(function (d, i) {\n //check whether group value is assigned\n currentItem = e.filterSensitive(chart.legend.legendColors, 'value', d.value);\n if (currentItem.length === 0) {\n //add current value into the legend values\n chart.legend.legendColors.push(d);\n }\n });\n\n } else {\n //sort data\n chart.data.sort(function (a, b) {\n return ((a[chart.xField] < b[chart.xField]) ? -1 : ((a[chart.xField] > b[chart.xField]) ? 1 : 0));\n });\n\n //extract serie names from the updated data\n let newSeries = chart.extractSerieNamesFromData();\n\n //iterate all series\n newSeries.forEach(function (newSerie) {\n if (newSerie.serie) {\n //check wheter the title is not empty\n if (newSerie.serie.title && newSerie.serie.title !== '') {\n currentItem = newSerie.serie.title;\n } else {\n //set related field content as legend text\n if (newSerie.serie.yField && newSerie.serie.yField !== '')\n currentItem = newSerie.serie.yField;\n else if (newSerie.serie.valueField && newSerie.serie.valueField !== '')\n currentItem = newSerie.serie.valueField;\n else if (newSerie.serie.measureField && newSerie.serie.measureField !== '')\n currentItem = newSerie.serie.measureField;\n }\n\n //check whether group value is assigned\n filteredList = e.filterSensitive(chart.legend.legendColors, 'value', currentItem);\n if (filteredList.length > 0) {\n let legendValue = filteredList[0].text || filteredList[0].value;\n\n newChartSeries.push({\n value: legendValue ? legendValue.toString() : '',\n length: legendValue ? legendValue.toString().length : 0,\n color: newSerie.serie.color\n });\n }\n else {\n //add current value into the legend values\n newChartSeries.push({\n value: currentItem ? currentItem.toString() : '',\n length: currentItem ? currentItem.toString().length : 0,\n color: newSerie.serie.color\n });\n }\n }\n });\n }\n }\n break;\n }\n\n //assign updated values\n chart.legendValues = newChartSeries;\n defaultLegend.legendValues = newChartSeries;\n\n //set start values for comparison\n tempTextValue = '';\n tempTextValueLength = 0;\n\n //sort legend values\n defaultLegend.legendValues.sort(function (a, b) {\n //get type and nan state for the value\n let vType = e.getType(a.value);\n let nanState = isNaN(a.value);\n if (nanState) {\n if (vType === \"string\") {\n if (a.value < b.value) { return -1; }\n if (a.value > b.value) { return 1; }\n return 0;\n } else if (vType === \"date\") {\n return new Date(a.value) - new Date(b.value);\n } else {\n return a.value - b.value;\n }\n } else {\n return parseFloat(a.value) - parseFloat(b.value);\n }\n });\n\n //iterate all legend values\n defaultLegend.legendValues.forEach(function (currentLegend) {\n\n //get width of the text\n currentLegend.width = getTempOffset(currentLegend.value).width + chart.legend.fontSize + legendIconOffset * 2;\n\n //retrieve max length text\n if (currentLegend.length > tempTextValueLength) {\n tempTextValue = currentLegend.value;\n tempTextValueLength = currentLegend.length;\n }\n });\n\n //update icon svgs\n let iconBase = defaultLegend.svg.selectAll('.eve-legend-icon')\n .data(defaultLegend.legendValues);\n\n //set class\n iconBase\n .attr('class', 'eve-legend-icon update');\n\n //set animation removal\n iconBase\n .exit().remove();\n\n //set icons\n defaultLegend.icons = iconBase\n .enter().append('rect')\n .attr('class', 'eve-legend-icon')\n .attr('width', chart.legend.fontSize)\n .attr('height', chart.legend.fontSize)\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie(i, true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie(i, null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, i);\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .merge(iconBase)\n .style('fill', function (d, i) { return d.color; });\n\n //update text svgs\n let textBase = defaultLegend.svg.selectAll('.eve-legend-text')\n .data(defaultLegend.legendValues);\n\n //set class\n textBase\n .attr('class', 'eve-legend-text update');\n\n //animation removal\n textBase\n .exit().remove();\n\n //set texts\n defaultLegend.texts = textBase\n .enter().append('text')\n .attr('class', 'eve-legend-text')\n .style('font-size', chart.legend.fontSize + 'px')\n .style('fill', chart.legend.fontColor)\n .style('font-family', chart.legend.fontFamily + ', Arial, Helvetica, Ubuntu')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('cursor', options.onClickEnabled ? 'pointer' : 'auto')\n .on('click', function (d, i) {\n //set whether the sliced clicked\n if (!d.clicked) {\n d.clicked = true;\n chart.interactSerie(i, true, 1, d);\n } else {\n d.clicked = null;\n chart.interactSerie(i, null, 1, d);\n }\n\n //check whether the chart legend click has value\n if (chart.legendClick && options.onClickEnabled)\n chart.legendClick(d, i);\n\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .merge(textBase)\n .text(function (d, i) { return d.value; });\n\n //transform legend icons\n defaultLegend.icons\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = 0;\n yPos = (i * defaultLegend.singleHeight);\n }\n break;\n default:\n {\n yPos = 0;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; });\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //transform legend texts\n defaultLegend.texts\n .attr('transform', function (d, i) {\n //set x and y position\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n xPos = chart.legend.fontSize + legendIconOffset;\n yPos = (i * defaultLegend.singleHeight) + defaultLegend.singleHeight / 2;\n }\n break;\n default:\n {\n yPos = defaultLegend.singleHeight / 2;\n xPos = d3.sum(defaultLegend.legendValues, function (l, j) { return j < i ? l.width : 0; }) + chart.legend.fontSize + legendIconOffset;\n }\n break;\n }\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n\n //get bbox of the svg\n tempDimensions = defaultLegend.svg.node().getBoundingClientRect();\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < tempDimensions.width ? tempDimensions.width : width;\n height += tempDimensions.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += tempDimensions.width;\n height = height < tempDimensions.height ? tempDimensions.height : height;\n }\n break;\n }\n\n //set legend size\n defaultLegend.height = tempDimensions.height;\n defaultLegend.width = tempDimensions.width;\n }", "title": "" }, { "docid": "f9f9c248074e658a52a477a54ab46405", "score": "0.52588445", "text": "function axRangeSupplyDefaultsByPass(gd, flags, specs) {\n var fullLayout = gd._fullLayout;\n\n if(!flags.axrange) return false;\n\n for(var k in flags) {\n if(k !== 'axrange' && flags[k]) return false;\n }\n\n for(var axId in specs.rangesAltered) {\n var axName = Axes.id2name(axId);\n var axIn = gd.layout[axName];\n var axOut = fullLayout[axName];\n axOut.autorange = axIn.autorange;\n axOut.range = axIn.range.slice();\n axOut.cleanRange();\n\n if(axOut._matchGroup) {\n for(var axId2 in axOut._matchGroup) {\n if(axId2 !== axId) {\n var ax2 = fullLayout[Axes.id2name(axId2)];\n ax2.autorange = axOut.autorange;\n ax2.range = axOut.range.slice();\n ax2._input.range = axOut.range.slice();\n }\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "5543e9c8a1bea9b544bff457e2bb4529", "score": "0.5255564", "text": "function updateScaledLegend() {\n let lastRadius = 0;\n scaledLegend.rScale = d3.scalePow().exponent(0.5).domain([chart.domains.minY, chart.domains.maxY]).range([(chart.domains.minY === chart.domains.maxY ? chart.series[0].maxBulletSize : chart.series[0].minBulletSize), chart.series[0].maxBulletSize]);\n scaledLegend.band = (chart.domains.maxY - chart.domains.minY) / (chart.legend.circleCount - 1);\n\n //create scaled legend data\n lastRadius = scaledLegend.rScale(chart.domains.maxY);\n scaledLegend.legendValues[0].value = e.formatNumber(chart.domains.maxY, chart.legend.numberFormat);\n scaledLegend.legendValues[0].radius = lastRadius;\n\n for (i = 1; i < chart.legend.circleCount; i++) {\n if (lastRadius - scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i) > chart.legend.fontSize / 2) {\n lastRadius = scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i);\n scaledLegend.legendValues[i].value = e.formatNumber(chart.domains.maxY - scaledLegend.band * i, chart.legend.numberFormat);\n scaledLegend.legendValues[i].radius = scaledLegend.rScale(chart.domains.maxY - scaledLegend.band * i);\n } else {\n scaledLegend.legendValues[i].value = '';\n scaledLegend.legendValues[i].radius = 0;\n }\n }\n if (lastRadius === scaledLegend.rScale(chart.domains.maxY)) {\n scaledLegend.legendValues[0].value = '';\n scaledLegend.legendValues[0].radius = 0;\n }\n //set start values for comparison\n tempTextValue = '';\n tempTextValueLength = 0;\n\n //iterate all legend values\n scaledLegend.legendValues.forEach(function (currentLegend) {\n //retrieve max length text\n if (currentLegend.value.toString().length > tempTextValueLength) {\n tempTextValue = currentLegend.value.toString();\n tempTextValueLength = currentLegend.value.toString().length;\n }\n });\n\n //get width of the text\n tempTextSVGOffset = getTempOffset(tempTextValue);\n\n //get scaled legend size\n scaledLegend.width = tempTextSVGOffset.width + chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n scaledLegend.height = chart.series[0].maxBulletSize * 2 + chart.legend.fontSize / 2;\n\n //calculate legend width and height\n switch (chart.legend.position) {\n case 'left':\n case 'right':\n {\n //set overall legend sizes\n width = width < scaledLegend.width ? scaledLegend.width : width;\n height += scaledLegend.height;\n }\n break;\n default:\n {\n //set overall legend sizes\n width += scaledLegend.width;\n height = height < scaledLegend.height ? scaledLegend.height : height;\n }\n break;\n }\n\n //update legend icon data\n scaledLegend.icons\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .data(scaledLegend.legendValues);\n\n //switch legend icons\n switch (chart.series[0].tileIcon) {\n case 'circle':\n {\n //transform legend circles\n scaledLegend.icons\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr(\"r\", function (d) { return d.radius; })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = chart.series[0].maxBulletSize - d.radius;\n xPos = chart.series[0].maxBulletSize;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n break;\n case 'square':\n {\n //transform legend circles\n scaledLegend.icons\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr('width', function (d) { return d.radius * 2; })\n .attr('height', function (d) { return d.radius * 2; })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = chart.series[0].maxBulletSize - d.radius * 2;\n xPos = (chart.series[0].maxBulletSize - d.radius) * 2;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n break;\n default:\n {\n //transform legend circles\n scaledLegend.icons\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr(\"r\", function (d) { return d.radius; })\n .attr('transform', function (d, i) {\n //set x and y position\n yPos = chart.series[0].maxBulletSize - d.radius;\n xPos = chart.series[0].maxBulletSize;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }\n }\n\n //update legend line data\n scaledLegend.lines\n .data(scaledLegend.legendValues);\n\n //transform legend lines\n scaledLegend.lines\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .attr('x1', function (d) { return d.value === '' ? 0 : (chart.series[0].tileIcon === 'square' ? chart.series[0].maxBulletSize * 2 : chart.series[0].maxBulletSize); })\n .attr('y1', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; })\n .attr('x2', function (d) { return d.value === '' ? 0 : chart.series[0].maxBulletSize * 2 + legendIconOffset; })\n .attr('y2', function (d) { return chart.series[0].maxBulletSize - d.radius * 2; });\n\n //update legend text data\n scaledLegend.texts\n .on('click', function () {\n //check whether the chart legend click has value\n if (chart.onLegendClick)\n chart.onLegendClick('legend');\n })\n .data(scaledLegend.legendValues);\n\n //transform legend text\n scaledLegend.texts\n .transition().duration(chart.animation.duration)\n .ease(chart.animation.easing.toEasing())\n .text(function (d) { return d.value; })\n .attr('transform', function (d, i) {\n //set x and y position\n xPos = chart.series[0].maxBulletSize * 2 + legendIconOffset * 2;\n yPos = chart.series[0].maxBulletSize - d.radius * 2 + chart.legend.fontSize / 2;\n\n //return translation for the current icon\n return 'translate(' + xPos + ', ' + yPos + ')';\n });\n }", "title": "" }, { "docid": "e58cae8127f86a2b9c72fb9ce6f30832", "score": "0.52503484", "text": "function onBrushRange(dateRange) {\n\tfilterRange = dateRange;\n\tlet filtered = filterCategoryData(filterCategory, filterRange);\n\td3.select('#stacked-area-chart')\n\t\t.datum(filtered)\n\t\t.call(stackChart);\n}", "title": "" }, { "docid": "04418b7d65a2a33a4512cb8497fe90f4", "score": "0.52499086", "text": "function adjustDataRange(plot, s, range) {\n if (s.datapoints.points) {\n range.xmin = s.datapoints.points[0];\n }\n }", "title": "" }, { "docid": "6e578bce0d3d3e9bebf451540ded35fc", "score": "0.52375287", "text": "function createMultiRangeSlider(inputRange) {\n\tvar data4Slider = [], maxRange = 0, inputRangeLen = inputRange.length;\n\t// Generate data for slider\n\tfor (var i = 0; i < inputRangeLen; i++) {\n\t\tmaxRange += inputRange[i];\n\t\tdata4Slider.push(maxRange);\n\t}\n\tif (rangeSlider != 0) {\n\t\t// slider already created\n\t\trangeSlider.noUiSlider.updateOptions({\n\t\t\tstart: data4Slider\n\t\t});\n\t} else {\n\t\t// create multi range slider\n\t\trangeSlider = document.getElementById('range-slider');\n\t\tnoUiSlider.create(rangeSlider, {\n\t\t\tstart: data4Slider,\n\t\t\tconnect: [true, true, true, true, true, true, true, true, true, true],\n\t\t\ttooltips: [true, true, true, true, true, true, true, true, true],\n\t\t\trange: {\n\t\t\t\t'min': 0,\n\t\t\t\t'max': maxRange\n\t\t\t}\n\t\t}).on('update', function (values, handle) {\n\t\t\tvar handles = values.length;\n\t\t\tfor (var i = 0; i < handles; i++) {\n\t\t\t\t$('.noUi-handle[data-handle=\"' + i + '\"] .noUi-tooltip').text('').html('<p class=\"noUi-tooltip-text\">' + dataRangeLabel[i] + '</p>');\n\t\t\t\t$('.noUi-handle[data-handle=\"' + i + '\"]').attr('data-before', getHandleValue(values, i, true));\n\t\t\t}\n\t\t\tupdateRangeSlider(values, handle);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "4f1620f16deb399badbff43f3530745a", "score": "0.5211155", "text": "function brush_parallel_chart() { \n for(var i=0;i<dimensions.length;++i){\n if(d3.event.target==y[dimensions[i]].brush) {\n extents[i]=d3.event.selection.map(y[dimensions[i]].invert,y[dimensions[i]]);\n\n }\n }\n\n foreground.style(\"display\", function(d) {\n return dimensions.every(function(p, i) {\n if(extents[i][0]==0 && extents[i][0]==0) {\n return true;\n }\n return extents[i][1] <= d[p] && d[p] <= extents[i][0];\n }) ? null : \"none\";\n });\n}", "title": "" }, { "docid": "986d00c520b11a6cbea13f67972af4d8", "score": "0.5205959", "text": "render() {\n return (\n <div>\n <label>LowerBound: </label>\n <input\n type=\"number\"\n value={this.state.lowerBound}\n onChange={this.onLowerBoundChange}\n />\n <br />\n <label>UpperBound: </label>\n <input\n type=\"number\"\n value={this.state.upperBound}\n onChange={this.onUpperBoundChange}\n />\n <br />\n <button onClick={this.handleApply}>Apply</button>\n <br />\n <br />\n <Range\n allowCross={false}\n value={this.state.value}\n onChange={this.compareDate}\n style={this.state.style}\n max={this.state.maxValue}\n tipFormatter={value => `${value}`}\n />\n </div>\n );\n }", "title": "" }, { "docid": "6a38e514afcc783e8c10e3e3f3c798e3", "score": "0.5203882", "text": "function drawAxes(limits, x, y, svg, rangeX, rangeY) {\r\n // return x value from a row of data\r\n let xValue = function(d) { return +d[x]; }\r\n \r\n // function to scale x value\r\n let xScale = d3.scaleLinear()\r\n .domain([limits.xMin, limits.xMax]) // give domain buffer room\r\n .range([rangeX.min, rangeX.max]);\r\n\r\n // xMap returns a scaled x value from a row of data\r\n let xMap = function(d) { return xScale(xValue(d)); };\r\n\r\n // plot x-axis at bottom of SVG with formatted years\r\n let xAxis = d3.axisBottom().ticks(25).tickFormat(d3.format(\"d\")).scale(xScale);\r\n svg.append(\"g\")\r\n .attr('transform', 'translate(0, ' + rangeY.max + ')')\r\n .call(xAxis);\r\n\r\n // return y value from a row of data\r\n let yValue = function(d) { return +d[y]}\r\n\r\n // function to scale y\r\n let yScale = d3.scaleLinear()\r\n .domain([limits.yMax, limits.yMin]) // give domain buffer\r\n .range([rangeY.min, rangeY.max]);\r\n\r\n // yMap returns a scaled y value from a row of data\r\n let yMap = function (d) { return yScale(yValue(d)); };\r\n\r\n // plot y-axis at the left of SVG\r\n let yAxis = d3.axisLeft().scale(yScale);\r\n svg.append('g')\r\n .attr('transform', 'translate(' + rangeX.min + ', 0)')\r\n .call(yAxis);\r\n\r\n // return mapping and scaling functions\r\n return {\r\n x: xMap,\r\n y: yMap,\r\n xScale: xScale,\r\n yScale: yScale\r\n };\r\n }", "title": "" }, { "docid": "4943ef830b66e28d81413a22c08041f5", "score": "0.52038616", "text": "function bindRangeSlider(){\n Array.from(document.getElementsByClassName('rangeSlider')).map((v) => {\n\n // Reference the track (thumb).\n const track = v.getElementsByClassName('rangeSliderTrack')[0]\n\n // Set the initial slider value.\n const value = v.getAttribute('value')\n const sliderMeta = calculateRangeSliderMeta(v)\n\n updateRangedSlider(v, value, ((value-sliderMeta.min)/sliderMeta.step)*sliderMeta.inc)\n\n // The magic happens when we click on the track.\n track.onmousedown = (e) => {\n\n // Stop moving the track on mouse up.\n document.onmouseup = (e) => {\n document.onmousemove = null\n document.onmouseup = null\n }\n\n // Move slider according to the mouse position.\n document.onmousemove = (e) => {\n\n // Distance from the beginning of the bar in pixels.\n const diff = e.pageX - v.offsetLeft - track.offsetWidth/2\n\n // Don't move the track off the bar.\n if(diff >= 0 && diff <= v.offsetWidth-track.offsetWidth/2){\n\n // Convert the difference to a percentage.\n const perc = (diff/v.offsetWidth)*100\n // Calculate the percentage of the closest notch.\n const notch = Number(perc/sliderMeta.inc).toFixed(0)*sliderMeta.inc\n\n // If we're close to that notch, stick to it.\n if(Math.abs(perc-notch) < sliderMeta.inc/2){\n updateRangedSlider(v, sliderMeta.min+(sliderMeta.step*(notch/sliderMeta.inc)), notch)\n }\n }\n }\n }\n })\n}", "title": "" }, { "docid": "310acbe70626a10afc03c96eec4ed905", "score": "0.5202966", "text": "setChartOptions() {\n const chartOptions = {\n scaleShowGridLines : false,\n pointDot : false,\n datasetFill: false,\n scaleShowVerticalLines: false,\n responsive: true,\n legendTemplate : \"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<this.props.sales.length; i++){%><li><span style=\\\"background-color:<%=this.props.sales[i].strokeColor%>\\\"><%if(this.props.sales[i].label){%><%=this.props.sales[i].label%><%}%></span></li><%}%></ul>\"\n \n }\n return chartOptions;\n }", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5199647", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" } ]
52073b48d79ae033a90b6a76906dafd8
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
[ { "docid": "8a008919bbdf2a183ebcd812ba707461", "score": "0.0", "text": "function shallowEqual(objA,objB){if(objectIs(objA,objB)){return true;}if(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "title": "" } ]
[ { "docid": "4d0133939e4b784bf72b19df67815ca0", "score": "0.74394655", "text": "function equalityOnKeys(...keysToCompare) {\n return function (aObject, anotherObject) {\n return keysToCompare.every(key => aObject[key] === anotherObject[key]);\n };\n}", "title": "" }, { "docid": "6909b86bcac4de816fa98872f0fe0cdf", "score": "0.66728157", "text": "function equalForKeys(a, b, keys) {\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n }\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n }\n return true;\n }", "title": "" }, { "docid": "e8e763842cc0ea9da9c3474077ec1795", "score": "0.66413045", "text": "function equalValues(obj1, obj2) {\n var props1 = Object.getOwnPropertyNames(obj1)\n var props2 = Object.getOwnPropertyNames(obj2)\n if (props1.length != props2.length) {\n console.log(\"Comparing objects with different keys\")\n return false\n }\n return props1.every(name => obj1[name] == obj2[name])\n}", "title": "" }, { "docid": "3ff98871c255e39e1b3bd3be42f0f0f2", "score": "0.6591911", "text": "function equalForKeys(a, b, keys) {\n\t if (!angular.isArray(keys) && angular.isObject(keys)) {\n\t keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n\t }\n\t if (!keys) {\n\t keys = [];\n\t for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n\t }\n\n\t for (var i = 0; i < keys.length; i++) {\n\t var k = keys[i];\n\t if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "403c8271d6549b73e4542f9cca7e44dd", "score": "0.64859647", "text": "async allEqualWith(key) {\n const firstItem = await this.next();\n if (firstItem.done) {\n return true;\n }\n const first = await key(firstItem.value);\n while (true) {\n const item = await this.next();\n if (item.done) {\n return true;\n }\n const eq = (await key(item.value)) === first;\n if (!eq) {\n return false;\n }\n }\n }", "title": "" }, { "docid": "35ae300a25d1772ab1ac09348a20ae78", "score": "0.645775", "text": "function isEqual(obj1, obj2) {\n\n var objKey1 = Object.keys(obj1)\n var objKey2 = Object.keys(obj2)\n\n if (objKey1.length !== objKey2.length) {\n return false\n } else {\n\n for (var objKey of objKey1) {\n\n if (obj1[objKey] !== obj2[objKey])\n\n return false\n\n }\n\n\n\n }\n\n return true\n}", "title": "" }, { "docid": "641a87794fd3e688326602edb5bfe030", "score": "0.63389164", "text": "static objectsEqual(map1, map2) {\n let keys1 = Object.keys(map1);\n if (keys1.length !== Object.keys(map2).length) return false;\n for (let i = 0; i < keys1.length; i++) {\n let key = Object.keys(map1)[i];\n if (!GenUtils.equals(map1[key], map2[key])) return false;\n }\n return true;\n }", "title": "" }, { "docid": "b4773cf26df0680a9b7b81dc2299af8c", "score": "0.63315326", "text": "function isEqual(left, right) {\n const OBJECT_STRING = '[object Object]';\n if (typeof left !== 'object' || typeof right !== 'object') {\n return left === right;\n }\n if (left === null || right === null) {\n return left === right;\n }\n const leftArray = Array.isArray(left);\n const rightArray = Array.isArray(right);\n if (leftArray !== rightArray) {\n return false;\n }\n const leftPlainObject = Object.prototype.toString.call(left) === OBJECT_STRING;\n const rightPlainObject = Object.prototype.toString.call(right) === OBJECT_STRING;\n if (leftPlainObject !== rightPlainObject) {\n return false;\n }\n if (!leftPlainObject && !leftArray) {\n return false;\n }\n const leftKeys = Object.keys(left);\n const rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n const keySet = {};\n for (const key of leftKeys) {\n keySet[key] = true;\n }\n for (const key of rightKeys) {\n keySet[key] = true;\n }\n const allKeys = Object.keys(keySet);\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n const l = left;\n const r = right;\n const pred = (key) => {\n return isEqual(l[key], r[key]);\n };\n return allKeys.every(pred);\n}", "title": "" }, { "docid": "f55b497a596b177e2e9b410ba14ba8a3", "score": "0.6311683", "text": "function sameValues(object1, object2){\n for(var key in object1){\n if (object1['name'] == object2['name'] || object1['age'] == object2['age']){\n return true;\n }else{\n return false;\n }\n }\n}", "title": "" }, { "docid": "4a48a9a38c43813c4a347a453ae703db", "score": "0.6203778", "text": "function assertEqual(obj1, obj2) {\n let keys1 = Object.keys(obj1);\n let values1 = Object.values(obj1);\n let keys2 = Object.keys(obj2);\n let values2 = Object.values(obj2);\n for (let i = 0; i < keys1.length; i++) {\n if (keys1[i] !== keys2[i]) return false;\n if (values1[i] !== values2[i]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "a4141bf85ab5b0704874b8fb6779018e", "score": "0.6202764", "text": "function gtt_hasAllKeys(dict, keys) {\n const size_k = keys.length;\n for (let iter = 0; iter < size_k; iter++) {\n if (!dict.hasOwnProperty(keys[iter]) || dict[keys[iter]].length < 1) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "8dae39f04661fce0ddf781f8485eca21", "score": "0.61714405", "text": "compareValues(a, b) {\n if (this.isObject(a) && this.isObject(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n\n for (const key of aKeys) {\n const aVal = a[key];\n const bVal = b[key];\n const bothObjects = this.isObject(aVal) && this.isObject(bVal);\n if (bothObjects && !this.compareValues(aVal, bVal) || (!bothObjects && aVal !== bVal)) {\n return false;\n }\n }\n return true;\n } else {\n return a === b;\n }\n }", "title": "" }, { "docid": "0ffb1ffbf9f62667207ad93240ec7c94", "score": "0.6158076", "text": "function Object$prototype$equals(other) {\n var self = this;\n var keys = sortedKeys (this);\n return equals (keys, sortedKeys (other)) &&\n keys.every (function(k) { return equals (self[k], other[k]); });\n }", "title": "" }, { "docid": "bb9c3223025d95ea7eb5fb28e3650798", "score": "0.6089245", "text": "function keyValueSame(object1, object2) {\n var isSame = false;\n for (var obj1Key in object1) {\n if (object2.hasOwnProperty(obj1Key)) {\n if (object1[obj1Key] === object2[obj1Key]) {\n isSame = true;\n };\n };\n };\nconsole.log(isSame);\n}", "title": "" }, { "docid": "6771ea5249630e0dcf122ce02dbca775", "score": "0.606045", "text": "function compareKeyValues(obj1, obj2) {\n compareKeys(getKeys(obj1), getKeys(obj2))\n compareValues(obj1, obj2, matchedKeys)\n return hasMatch(matchedValues)\n}", "title": "" }, { "docid": "43a1130f20ba49ac2e5e76237ce73ac2", "score": "0.6058463", "text": "isSameObject (a, b) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n for (let k in a) {\n if (b[k] === undefined) {\n return false\n }\n if (a[k] !== b[k]) {\n return false\n }\n }\n return true\n }", "title": "" }, { "docid": "993ec4e5abec10fc5a88bf77fad60b7e", "score": "0.60517555", "text": "function equalKeysAssert() {\n for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {\n keys[_key] = arguments[_key];\n }\n\n /**\n * Class name.\n */\n\n this.__class__ = 'EqualKeys';\n\n if (keys.length === 1 && (0, _lodash.isArray)(keys[0])) {\n keys = keys[0];\n }\n\n /**\n * Keys.\n */\n\n this.keys = keys;\n\n /**\n * Validation algorithm.\n */\n\n this.validate = value => {\n if (!(0, _lodash.isPlainObject)(value)) {\n throw new _validator.Violation(this, value, { value: 'must_be_a_plain_object' });\n }\n\n const keys = Object.keys(value);\n\n if (keys.length === 0 && this.keys.length > 0 || this.keys.length > keys.length) {\n throw new _validator.Violation(this, value, { difference: (0, _lodash.difference)(this.keys, keys) });\n }\n\n const intersects = (0, _lodash.intersection)(this.keys, keys);\n\n if (keys.length > this.keys.length || intersects.length !== keys.length) {\n throw new _validator.Violation(this, value, { difference: (0, _lodash.difference)(keys, this.keys) });\n }\n\n return true;\n };\n\n return this;\n}", "title": "" }, { "docid": "7030cdd3ad834658346c30bc7943d8af", "score": "0.60278445", "text": "function isEqual(obj1,obj2){\n if (Object.keys(obj1).length !== Object.keys(obj2).length){\n return false;\n }\n else{\n for (let key in obj1){\n if (!(key in obj2)) return false;\n else if (typeof obj1[key] === 'object'){\n isEqual(obj1[key], obj2[key])\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "0249481a51938ff67a1c0c8830250ad0", "score": "0.60195017", "text": "function keyvaluematch(object1, object2) {\n var is_match = false;\n var i = 0\n while (i < Object.keys(object1).length) //Iterating over all keys for\n {\n if (object1[Object.keys(object1)[i]] == object2[Object.keys(object1)[i]]) //If the values for any corresponding keys are equivalent for the two objects\n {\n is_match = true;\n }\n i++\n }\n return is_match;\n}", "title": "" }, { "docid": "4a772fb62cf680d5d4425e83900c7e68", "score": "0.5990968", "text": "function assertEqual(original, cloned) {\n let keys = Object.keys(original);\n return keys.every(key => original[key]===cloned[key]);/*for(let i=0; i<keys.length;i++){if(original[keys[i]] !== clone[keys[i]]) return false;}return true;*/\n}", "title": "" }, { "docid": "b3d8795c5b5c8d19e2ed5da7af600e08", "score": "0.59561586", "text": "function objectsEqual(obj1, obj2) {\n let k1 = Object.keys(obj1).sort();\n let k2 = Object.keys(obj2).sort();\n let keyMatch = k1.every((value, idx) => value === k2[idx]);\n\n let v1 = Object.values(obj1).sort();\n let v2 = Object.values(obj2).sort();\n let valueMatch = v1.every((value, idx) => value === v2[idx]);\n\n return keyMatch && valueMatch;\n}", "title": "" }, { "docid": "12aceb13d45ae6351680104b6a681d29", "score": "0.5949941", "text": "function compareObjects(left, right) {\n var left_keys = Object.keys(left);\n var right_keys = Object.keys(right);\n if (!compareArrays(left_keys, right_keys)) {\n return false;\n }return left_keys.every(function (key) {\n return compare(left[key], right[key]);\n });\n}", "title": "" }, { "docid": "5607e4205d680f4d46aa7e5008e79ec1", "score": "0.59360266", "text": "function anyKeyValueMatch(obj1, obj2) {\n for (var key in obj1) {\n if(obj2[key] != null) {\n if (obj1[key] == obj2[key]) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "9067b040ba183d09b8de130c5870977a", "score": "0.5925767", "text": "function equalObjects(a, b) {\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a !== 'object') {\n return a === b;\n }\n if (a === b) {\n return true;\n }\n if (toString.call(a) === '[object Date]') {\n if (toString.call(b) === '[object Date]') {\n return +a === +b;\n }\n return false;\n }\n if (Array.isArray(a)) {\n if (Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i < a.length; i++) {\n if (!equalObjects(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (var key in a) {\n if (!equalObjects(a[key], b[key])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "60d6a59d09ba1635fa79d16051404869", "score": "0.59160256", "text": "function _compareObjects(left, right) {\n var left_keys = Object.keys(left);\n var right_keys = Object.keys(right);\n if (!_compareArrays(left_keys, right_keys)) return false;\n\n return left_keys.every(function (key) {\n return compare(left[key], right[key]);\n });\n}", "title": "" }, { "docid": "348a5b31e5a3f4fb46aaea3e36cfb7f2", "score": "0.59136564", "text": "function isSame(obj1,obj2){\n if (Object.keys(obj1).length !== Object.keys(obj2).length){\n return false;\n }\n else{\n if (obj1 === obj2) return true;\n else return false;\n }\n}", "title": "" }, { "docid": "7d432fac94419b7c7d7d158e4805495d", "score": "0.58884186", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "770b68f0a18f5e4abec4c84617fd2b8e", "score": "0.58552325", "text": "deepEqual(obj1, obj2) {\n if (obj1 === null || obj2 === null || obj1 === undefined || obj2 === undefined) {\n return obj1 === obj2;\n }\n if (typeof (obj1) === typeof (obj1) && typeof (obj1) === \"object\") {\n let keys1 = Object.keys(obj1);\n let keys2 = Object.keys(obj2);\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (let k of keys1) {\n if (!keys2.includes(k) || !this.deepEqual(obj1[k], obj2[k])) {\n return false;\n }\n }\n return true;\n }\n return obj1 === obj2;\n }", "title": "" }, { "docid": "12c13b2e4d9af81fc317e43f5fcc455d", "score": "0.5851907", "text": "function _areEquals(a, b) {\n if (a === b) return true;\n\n if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!_areEquals(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!b.hasOwnProperty(keys[i])) return false;\n }\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n }", "title": "" }, { "docid": "217bbd0281e9ae8f932d7a708eb63ba1", "score": "0.5837667", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (isObject(a) && isObject(b)) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3['return']) {\n _iterator3['return']();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return true;\n }\n return a === b;\n}", "title": "" }, { "docid": "f0ed99e1f41c9637485cabb7d1ee9bbd", "score": "0.5836397", "text": "function looseEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n var aValidType = isDate(a);\n var bValidType = isDate(b);\n\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\n }\n\n aValidType = (0, _array.isArray)(a);\n bValidType = (0, _array.isArray)(b);\n\n if (aValidType || bValidType) {\n return aValidType && bValidType ? a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i]);\n }) : false;\n }\n\n aValidType = (0, _object.isObject)(a);\n bValidType = (0, _object.isObject)(b);\n\n if (aValidType || bValidType) {\n /* istanbul ignore if: this if will probably never be called */\n if (!aValidType || !bValidType) {\n return false;\n }\n\n var aKeysCount = (0, _object.keys)(a).length;\n var bKeysCount = (0, _object.keys)(b).length;\n\n if (aKeysCount !== bKeysCount) {\n return false;\n }\n\n for (var key in a) {\n var aHasKey = a.hasOwnProperty(key);\n var bHasKey = b.hasOwnProperty(key);\n\n if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {\n return false;\n }\n }\n }\n\n return String(a) === String(b);\n}", "title": "" }, { "docid": "f34713973ad4bb91edfaabf73e2acde6", "score": "0.5832113", "text": "function _areEquals(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a),\n arrB = Array.isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) if (!_areEquals(a[i], b[i])) return false;\n\n return true;\n }\n\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) if (!b.hasOwnProperty(keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "805e64f975068417da9893a94c4f4a4b", "score": "0.5815669", "text": "function deepEquals(a, b) {\n if (a === b) {\n return true;\n }\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length != b.length) return false;\n\n for (var i = 0; i < a.length; i++) {\n if (!deepEquals(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (Array.isArray(a) != Array.isArray(b)) {\n return false;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n var keys = Object.keys(a);\n\n if (keys.length !== Object.keys(b).length) {\n return false;\n }\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (a instanceof Date != b instanceof Date) {\n return false;\n }\n\n if (a instanceof RegExp && b instanceof RegExp) {\n return a.toString() == b.toString();\n }\n\n if (a instanceof RegExp != b instanceof RegExp) {\n return false;\n }\n\n for (var _i = 0; _i < keys.length; _i++) {\n if (keys[_i] === '_key') {\n continue;\n }\n\n if (!Object.prototype.hasOwnProperty.call(b, keys[_i])) {\n return false;\n }\n }\n\n for (var _i2 = 0; _i2 < keys.length; _i2++) {\n var key = keys[_i2];\n\n if (key === '_key') {\n continue;\n }\n\n if (!deepEquals(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "d06f797fb45abd80df8064b07c4abf7d", "score": "0.58113813", "text": "function isEqual(dict, other) {\n const dictKeys = keys(dict);\n const otherKeys = keys(other);\n\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n\n for (const key of dictKeys) {\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "ce62a3b0478b49475295a4d39abcab97", "score": "0.58059525", "text": "function objectsEqual(e1, e2){\n\tif(Object.keys(e1).length != Object.keys(e2).length){\n\t\treturn false;\n\t}\n\tfor(var key in e1){\n\t\tif(!((e1.hasOwnProperty(key) && e2.hasOwnProperty(key)) && (e1[key] == e2[key]))){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.58006006", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.58006006", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.58006006", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.58006006", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.58006006", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "ae95561277325675ed44bbf8d5f1aa50", "score": "0.5797312", "text": "function objEquiv(a, b) {\n if (a == null || b == null) {\n return false;\n }\n if (a.prototype !== b.prototype) {\n return false;\n }\n if (typeOf(a) == 'arguments') {\n if (!typeOf(b) != 'arguments') {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b);\n }\n try {\n var ka = Object.keys(a);\n var kb = Object.keys(b);\n } catch (e) {\n return false;\n }\n if (ka.length != kb.length) {\n return false;\n }\n ka.sort();\n kb.sort();\n var key, i;\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) {\n return false;\n }\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "2ef317756e04e501036bb0f0a62612e3", "score": "0.57892954", "text": "function equal(a, b) {\n\n if (sameValue(a, b))\n return true;\n\n\t// Dates must have equal time values\n\tif (isDate(a) && isDate(b))\n\t\treturn a.getTime() === b.getTime();\n\n\t// Non-objects must be strictly equal (types must be equal)\n\tif (!isObject(a) || !isObject(b))\n\t\treturn a === b;\n\n\t// Prototypes must be identical. getPrototypeOf may throw on\n\t// ES3 engines that don't provide access to the prototype.\n\ttry {\n\n\t if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n\t\t return false;\n\n\t} catch (err) {}\n\n\tlet aKeys = Object.keys(a),\n\t\tbKeys = Object.keys(b);\n\n\t// Number of own properties must be identical\n\tif (aKeys.length !== bKeys.length)\n\t\treturn false;\n\n\tfor (let i = 0; i < aKeys.length; ++i) {\n\n\t\t// Names of own properties must be identical\n\t\tif (!OP_hasOwnProperty.call(b, aKeys[i]))\n\t\t\treturn false;\n\n\t\t// Values of own properties must be equal\n\t\tif (!equal(a[aKeys[i]], b[aKeys[i]]))\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "01c272fe7d16fd1837ff849e60ab51b4", "score": "0.578513", "text": "function looseEqual(a,b){\nif(a===b){return true;}\nvar isObjectA=isObject(a);\nvar isObjectB=isObject(b);\nif(isObjectA&&isObjectB){\ntry{\nvar isArrayA=Array.isArray(a);\nvar isArrayB=Array.isArray(b);\nif(isArrayA&&isArrayB){\nreturn a.length===b.length&&a.every(function(e,i){\nreturn looseEqual(e,b[i]);\n});\n}else if(a instanceof Date&&b instanceof Date){\nreturn a.getTime()===b.getTime();\n}else if(!isArrayA&&!isArrayB){\nvar keysA=Object.keys(a);\nvar keysB=Object.keys(b);\nreturn keysA.length===keysB.length&&keysA.every(function(key){\nreturn looseEqual(a[key],b[key]);\n});\n}else {\n/* istanbul ignore next */\nreturn false;\n}\n}catch(e){\n/* istanbul ignore next */\nreturn false;\n}\n}else if(!isObjectA&&!isObjectB){\nreturn String(a)===String(b);\n}else {\nreturn false;\n}\n}", "title": "" }, { "docid": "edb05d5358bf3924c8a86b168e4d4d59", "score": "0.57696646", "text": "function deepCompareKeysImpl(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "94b81a0cd27f1375f2cb0a0eaa6d0d4f", "score": "0.57657385", "text": "function isEqual(dict, other) {\n var dictKeys = keys(dict);\n var otherKeys = keys(other);\n\n if (dictKeys.length !== otherKeys.length) {\n return false;\n }\n\n for (var _i = 0, dictKeys_1 = dictKeys; _i < dictKeys_1.length; _i++) {\n var key = dictKeys_1[_i];\n\n if (dict[key] !== other[key]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "0bae799eb8fd95aa4e54eb3920eba279", "score": "0.5752842", "text": "function key_value_match(first_object, second_object) {\n for (var key_from_first in first_object) {\n \tfor (var key_from_second in second_object) {\n \t if ((key_from_first == key_from_second) && (first_object[key_from_first] == second_object[key_from_second])) {\n \t \treturn true;\n \t }\n \t}\n }\n return false;\n}", "title": "" }, { "docid": "ea7a515efd543616b4b0ca4b8d9d2656", "score": "0.57519823", "text": "function areObjectsEqual(a, b, isEqual, meta) {\n var keysA = Object.keys(a);\n var index = keysA.length;\n if (Object.keys(b).length !== index) {\n return false;\n }\n var key;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n key = keysA[index];\n if (key === OWNER) {\n var reactElementA = !!a.$$typeof;\n var reactElementB = !!b.$$typeof;\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n if (!hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5665375dea50de9e67b458f904adbe92", "score": "0.5745332", "text": "function deepEqual(x, y) {\n const ok = Object.keys, tx = typeof x, ty = typeof y;\n return x && y && tx === 'object' && tx === ty ? (\n ok(x).length === ok(y).length &&\n ok(x).every(key => deepEqual(x[key], y[key]))\n ) : (x === y);\n}", "title": "" }, { "docid": "337e1bdf34428883a03061320f19323c", "score": "0.57395315", "text": "function areObjectsEqual(a, b, isEqual, meta) {\r\n var keysA = Object.keys(a);\r\n var index = keysA.length;\r\n if (Object.keys(b).length !== index) {\r\n return false;\r\n }\r\n var key;\r\n // Decrementing `while` showed faster results than either incrementing or\r\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\r\n // methods like `some` / `every` were not used to avoid incurring the garbage\r\n // cost of anonymous callbacks.\r\n while (index-- > 0) {\r\n key = keysA[index];\r\n if (key === OWNER) {\r\n var reactElementA = !!a.$$typeof;\r\n var reactElementB = !!b.$$typeof;\r\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\r\n return false;\r\n }\r\n }\r\n if (!hasOwnProperty.call(b, key) ||\r\n !isEqual(a[key], b[key], key, key, a, b, meta)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "b8575aeacdfd2639fb08dede90ba184b", "score": "0.5732144", "text": "function key_value_match(object1, object2){\n\tif ((object1['name'] == undefined) || (object1['age'] == undefined)) {\n\t\treturn false;\n\t}\n\n\telse if\t(\n\t\t\t(object1['name'] == object2['name']) || \n\t\t\t(object1['age'] == object2['age'])) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "dddb40e031711f680c6d4080aad369c9", "score": "0.57308173", "text": "function equal(a,b) {\n if(a instanceof Array) {\n if(!(b instanceof Array))\n return false\n if(a.length !== b.length) {\n return false\n } else {\n for(var n=0; n<a.length; n++) {\n if(!equal(a[n],b[n])) {\n return false\n }\n }\n // else\n return true\n }\n } else if(a instanceof Object) {\n if(!(b instanceof Object))\n return false\n\n var aKeys = Object.keys(a)\n var bKeys = Object.keys(b)\n\n if(aKeys.length !== bKeys.length) {\n return false\n } else {\n for(var n=0; n<aKeys.length; n++) {\n var key = aKeys[n]\n var aVal = a[key]\n var bVal = b[key]\n\n if(!equal(aVal,bVal)) {\n return false\n }\n }\n // else\n return true\n }\n } else {\n return a===b || Number.isNaN(a) && Number.isNaN(b)\n }\n}", "title": "" }, { "docid": "9b9247532dbb957f91e27e95ecaba464", "score": "0.57250506", "text": "function hasKeys(o /*: {...} */) /*: boolean */ {\n for (const k in o) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "1e8fe3cbe8a42ff67e34a4f9cfdef5a8", "score": "0.5718813", "text": "function deepEqual(a,b){\n if (a === b) return true;\n if ( a == null || typeof a != \"object\" || \n b == null || typeof b != \"object\") return false;\n let keysA = Object.keys(a), \n keysB = Object.keys(b);\n if (keysA.length != keysB.length) return false;\n\n for(let key of keysA) {\n if (!keysB.includes(key) || !deepEqual(a[key], b[key])) return false;\n }\n return true;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.57151777", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.57151777", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.57151777", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "624a16d638aee90bb84a32edf53a6c77", "score": "0.5703912", "text": "function equalState(obj1, obj2) {\n if (obj1.length !== obj2.length) return false\n\n for (let prop in obj1) {\n if (obj1[prop] !== obj2[prop]) return false;\n }\n\n return true\n}", "title": "" }, { "docid": "640a5c869bce6a4345c39f3b4e03f7ff", "score": "0.57018226", "text": "function deepEqual(actual, expected, opts) {\n let pSlice = Array.prototype.slice;\n \n function objectKeys(obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n };\n \n function isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n };\n \n function isUndefinedOrNull(value) {\n return value === null || value === undefined;\n }\n \n function isBuffer(x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n }\n \n function objEquiv(a, b, opts) {\n let i, key, ka, kb;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n ka = objectKeys(a);\n kb = objectKeys(b);\n } catch (e) { //happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length) {\n return false;\n }\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i]) {\n return false;\n }\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) {\n return false;\n }\n }\n return typeof a === typeof b;\n }\n \n return (() => {\n if (!opts) opts = {};\n \n if (actual === expected) {\n return true;\n \n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n \n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n \n } else {\n return objEquiv(actual, expected, opts);\n }\n })();\n}", "title": "" }, { "docid": "fd9d6bb0eb4d95c191069f341cf5fff5", "score": "0.5698209", "text": "function checkForObjectsEquality(obj1,obj2){\n if((Object.keys(obj1)).length == 0 && (Object.keys(obj2)).length == 0){\n //console.log(\"checkForObjectsEquality\",true);\n return true;\n }\n if((Object.keys(obj1)).length == 0 || (Object.keys(obj2)).length == 0){\n //console.log(\"checkForObjectsEquality\",false);\n return false;\n }\n else{\n //console.log(\"checkForObjectsEquality\",(JSON.stringify(obj1) === JSON.stringify(obj2)));\n return (JSON.stringify(obj1) === JSON.stringify(obj2));\n }\n}", "title": "" }, { "docid": "e06f1172e64d5c7c65fd615ce81f684a", "score": "0.56972337", "text": "function shallowCompareKeysImpl(objA, objB, keys) {\n return filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "91adb7e57eb496baad6f7fff5c549f42", "score": "0.568041", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "91adb7e57eb496baad6f7fff5c549f42", "score": "0.568041", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "486c5a68b42caba7a180969b36954562", "score": "0.56778675", "text": "async allEqual() {\n const firstItem = await this.next();\n if (firstItem.done) {\n return true;\n }\n const first = firstItem.value;\n while (true) {\n const item = await this.next();\n if (item.done) {\n return true;\n }\n const eq = item.value === first;\n if (!eq) {\n return false;\n }\n }\n }", "title": "" }, { "docid": "cc6f795b97a61377895f9fc9eded5836", "score": "0.5665374", "text": "function _shallowCompareKeys(objA, objB, keys) {\n\t return _filterKeys(objA, objB, keys).every(function (key) {\n\t return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n\t });\n\t}", "title": "" }, { "docid": "ce1bd4c20f9636cd99cffe25001f69de", "score": "0.5663204", "text": "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(a instanceof Date&&b instanceof Date){return a.getTime()===b.getTime();}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.56597966", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "99bede20a460f3ddd6c44ad4e24dd697", "score": "0.5652212", "text": "function pointsEqual() {\r for (var i=0; i<arguments.length; i++) {\r for (var k=0; k<arguments.length; k++) {\r if (arguments[i][0] != arguments[k][0] || arguments[i][1] != arguments[k][1]) return false;\r }\r }\r\r return true;\r}", "title": "" }, { "docid": "46cedbcad9a368df5ee6103e8864d670", "score": "0.56491286", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "46cedbcad9a368df5ee6103e8864d670", "score": "0.56491286", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "7b65f0a358b1cc988378880dfa34bed6", "score": "0.5648361", "text": "function shallowEqual(objA,objB){\nif(objectIs(objA,objB)){\nreturn true;\n}\n\nif(typeof objA!=='object'||objA===null||typeof objB!=='object'||objB===null){\nreturn false;\n}\n\nvar keysA=Object.keys(objA);\nvar keysB=Object.keys(objB);\n\nif(keysA.length!==keysB.length){\nreturn false;\n}// Test for A's keys different from B.\n\n\nfor(var i=0;i<keysA.length;i++){\nif(!hasOwnProperty$2.call(objB,keysA[i])||!objectIs(objA[keysA[i]],objB[keysA[i]])){\nreturn false;\n}\n}\n\nreturn true;\n}", "title": "" }, { "docid": "00b7decd1e007109ba2f419a235dece2", "score": "0.56471276", "text": "function _deepCompareKeys(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "00b7decd1e007109ba2f419a235dece2", "score": "0.56471276", "text": "function _deepCompareKeys(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "898945822202801854a6cc4f0d22cf8c", "score": "0.56360906", "text": "function keyValueMatch(obj1, obj2) {\n for (var prop in obj1) {\n if (obj1[prop] === obj2[prop]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "ae5f441a5dbcb3aaf6996b833d49797d", "score": "0.5631631", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var _i3 = 0, _Object$keys = Object.keys(a); _i3 < _Object$keys.length; _i3++) {\n var key = _Object$keys[_i3];\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return a === b;\n}", "title": "" }, { "docid": "0c8d5c8f208700c95e709f67f36915aa", "score": "0.5631548", "text": "function commonPair(obj1, obj2){\r\n\r\n\tvar keysA = Object.keys(obj1);\r\n\tvar keysB = Object.keys(obj2);\r\n\r\n\tfor(var i = 0; i < keysA.length; i++){\r\n\r\n\t\tvar a_key = keysA[i];\r\n\t\tvar a_value = obj1[a_key];\r\n\r\n\t\tfor(var j = 0; j < keysB.length; j++){\r\n\r\n\t\t\tvar b_key = keysB[j];\r\n\t\t\tvar b_value = obj2[b_key];\r\n\r\n\t\t\tif(a_key==b_key && a_value==b_value){\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n\r\n}", "title": "" }, { "docid": "deebbf5f45ff5ed7996a329d947bb895", "score": "0.56307507", "text": "function looseEqual(a, b) {\n if (a === b)\n return true;\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i]);\n });\n }\n else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key]);\n });\n }\n else {\n /* istanbul ignore next */\n return false;\n }\n }\n catch (e) {\n /* istanbul ignore next */\n return false;\n }\n }\n else if (!isObjectA && !isObjectB) {\n return String(a) === String(b);\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "e2907ba42db211fb277a0dca3f43f536", "score": "0.562028", "text": "function deepEqual(object1, object2) {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n const val1 = object1[key];\n const val2 = object2[key];\n const areObjects = isObject(val1) && isObject(val2);\n if (\n areObjects && !deepEqual(val1, val2) ||\n !areObjects && val1 !== val2\n ) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "b05c7c27f62a39b7b5a828ed28bfab9f", "score": "0.56168157", "text": "static equals(firstValue,secondValue,properties=null,deep=-1,exceptionPrefixes=[],ignoreFunctions=true){if(ignoreFunctions&&Tools.isFunction(firstValue)&&Tools.isFunction(secondValue)||firstValue===secondValue||Tools.numberIsNotANumber(firstValue)&&Tools.numberIsNotANumber(secondValue)||firstValue instanceof RegExp&&secondValue instanceof RegExp&&firstValue.toString()===secondValue.toString()||firstValue instanceof Date&&secondValue instanceof Date&&(isNaN(firstValue.getTime())&&isNaN(secondValue.getTime())||!isNaN(firstValue.getTime())&&!isNaN(secondValue.getTime())&&firstValue.getTime()===secondValue.getTime()))return true;if(Tools.isPlainObject(firstValue)&&Tools.isPlainObject(secondValue)&&!(firstValue instanceof RegExp||secondValue instanceof RegExp)||Array.isArray(firstValue)&&Array.isArray(secondValue)&&firstValue.length===secondValue.length||(Tools.determineType(firstValue)==='map'&&Tools.determineType(secondValue)==='map'||Tools.determineType(firstValue)==='set'&&Tools.determineType(secondValue)==='set')&&firstValue.size===secondValue.size){for(const[first,second]of[[firstValue,secondValue],[secondValue,firstValue]]){const firstIsArray=Array.isArray(first);if(firstIsArray&&(!Array.isArray(second)||first.length!==second.length))return false;const firstIsMap=Tools.determineType(first)==='map';if(firstIsMap&&(Tools.determineType(second)!=='map'||first.size!==second.size))return false;const firstIsSet=Tools.determineType(first)==='set';if(firstIsSet&&(Tools.determineType(second)!=='set'||first.size!==second.size))return false;let equal=true;if(firstIsArray){let index=0;for(const value of first){if(deep!==0&&!Tools.equals(value,second[index],properties,deep-1,exceptionPrefixes))equal=false;index+=1}}else if(firstIsMap)for(const[key,value]of first){if(deep!==0&&!Tools.equals(value,second.get(key),properties,deep-1,exceptionPrefixes))equal=false}else if(firstIsSet){for(const value of first){if(deep!==0){equal=false;for(const secondValue of second)if(Tools.equals(value,secondValue,properties,deep-1,exceptionPrefixes)){equal=true;break}if(!equal)break}}}else for(const key in first)if(first.hasOwnProperty(key)){if(!equal||properties&&!properties.includes(key))break;let doBreak=false;for(const exceptionPrefix of exceptionPrefixes)if(key.toString().startsWith(exceptionPrefix)){doBreak=true;break}if(doBreak)break;if(deep!==0&&!Tools.equals(first[key],second[key],properties,deep-1,exceptionPrefixes))equal=false}if(!equal)return false}return true}return false}", "title": "" }, { "docid": "eda1426ee1f22933ad5e95ed8ded5cc8", "score": "0.56133586", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n }\n else if (objA == null || objB == null) {\n return false;\n }\n else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n }\n else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n }\n else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n }\n}", "title": "" }, { "docid": "eda1426ee1f22933ad5e95ed8ded5cc8", "score": "0.56133586", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n }\n else if (objA == null || objB == null) {\n return false;\n }\n else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n }\n else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n }\n else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n }\n}", "title": "" }, { "docid": "697c21a77e15783405df6a08f5550436", "score": "0.5604802", "text": "function objectShallowEquals(a, b) {\n var entriesInA = Object.entries(Object(a));\n\n if (entriesInA.length !== Object.keys(b).length) {\n return false;\n }\n\n return entriesInA.every(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n return b.hasOwnProperty(key) && b[key] === value;\n });\n}", "title": "" }, { "docid": "45877399679f9b96a86963b9addcadb1", "score": "0.5604347", "text": "function isEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (generalType(a) != generalType(b)) {\n return false;\n }\n\n if (a == b) {\n return true;\n }\n\n if (typeof a != 'object') {\n return false;\n }\n\n // null != {}\n if (a instanceof Object != b instanceof Object) {\n return false;\n }\n\n if (a instanceof Date || b instanceof Date) {\n if (a instanceof Date != b instanceof Date ||\n a.getTime() != b.getTime()) {\n return false;\n }\n }\n\n var allKeys = [].concat(keys(a), keys(b));\n uniqueArray(allKeys);\n\n for (var i = 0; i < allKeys.length; i++) {\n var prop = allKeys[i];\n if (!isEqual(a[prop], b[prop])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "67ee0d0cbc501bcd13793ce5e0b83fe1", "score": "0.5602602", "text": "function shallowCompareKeys(objA, objB, keys) {\n\t // treat `null` and `undefined` as the same\n\t if (objA == null && objB == null) {\n\t return true;\n\t }\n\t else if (objA == null || objB == null) {\n\t return false;\n\t }\n\t else if (Array.isArray(objA) || Array.isArray(objB)) {\n\t return false;\n\t }\n\t else if (keys != null) {\n\t return _shallowCompareKeys(objA, objB, keys);\n\t }\n\t else {\n\t // shallowly compare all keys from both objects\n\t var keysA = Object.keys(objA);\n\t var keysB = Object.keys(objB);\n\t return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n\t }\n\t}", "title": "" }, { "docid": "35c70b6fafdfac826589c3bf0f7b3975", "score": "0.5598619", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n } else if (objA == null || objB == null) {\n return false;\n } else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n } else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n } else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return _shallowCompareKeys(objA, objB, {\n include: keysA\n }) && _shallowCompareKeys(objA, objB, {\n include: keysB\n });\n }\n}", "title": "" }, { "docid": "35c70b6fafdfac826589c3bf0f7b3975", "score": "0.5598619", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n } else if (objA == null || objB == null) {\n return false;\n } else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n } else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n } else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return _shallowCompareKeys(objA, objB, {\n include: keysA\n }) && _shallowCompareKeys(objA, objB, {\n include: keysB\n });\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5592423", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" } ]
c9136e14df4de11022f26229499e88ca
Same as previous except only multiples of three or five are considered in the sum, e.g. 3, 5, 6, 9, 10, 12, 15 for n=17
[ { "docid": "58e814a002607a4c22e1968a4f2d9936", "score": "0.0", "text": "function two() {\n var x = prompt(\"Enter a number, any number.\");\n x = parseInt(x);\n var answer = 0;\n for (var i = x; i > 0; i--) {\n if (i % 3 == 0 || i % 5 == 0) {\n answer = answer + i;\n } else {\n answer = answer;\n console.log(answer);\n } \n }\n document.getElementById('answer').innerHTML = \"The total sum is \" +answer;\n}", "title": "" } ]
[ { "docid": "69a6d0fa40ce5a24b962d0074a2d9e1e", "score": "0.80886096", "text": "function threeAndFiveMultiplesSumBelowN (n) {\n let count = 5\n let sum = 0\n while (count < n) {\n sum += count\n count += 5\n }\n count = 3\n while (count < n) {\n if (count % 5 !== 0) {\n sum += count\n }\n count += 3\n }\n return sum\n}", "title": "" }, { "docid": "7dd61c3343add87812e27b3dfe20b634", "score": "0.7872905", "text": "function sumMultiples(n){\n let sum = 0;\n for(let i = 3; i < n; i++){\n if(i%3 === 0){\n sum += i;\n }\n if(i%3 === 0 && i%5 === 0){\n continue;\n }\n if(i%5 === 0){\n sum += i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "7ee678c68fee4be7c124f8467c184500", "score": "0.77941495", "text": "function findSum(n) {\n let sum = 0\n for(let i = 0; i <= n; i++){\n if((i % 3 == 0) || (i % 5 == 0)){\n sum += i\n }\n }\n return sum\n }", "title": "" }, { "docid": "d2859bb2d0e8fa71389acaca95433ca5", "score": "0.7793802", "text": "function multiplesOf3and5(number) {\n let sumArr = [];\n let three = Math.floor(number / 3);\n let five = Math.floor(number / 5);\n let prevNum1 = 0;\n let prevNum2 = 0;\n for (let i = 0; i < three; i++) {\n prevNum1 += 3;\n if (prevNum1 < number) {\n sumArr.push(prevNum1);\n }\n };\n for (let i = 0; i < five; i++) {\n prevNum2 += 5;\n if (!sumArr.includes(prevNum2) && prevNum2 < number) {\n sumArr.push(prevNum2);\n }\n };\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n const sum = sumArr.reduce(reducer);\n return sum;\n}", "title": "" }, { "docid": "90b75270aa8dd6a0937b9d14ae498493", "score": "0.776321", "text": "function findSum(n) {\nlet sum =0\n for (let i=0;i<=n;i++){\n if(i % 3 ===0 || i % 5===0){\n sum+=i\n }\n }\n return sum\n}", "title": "" }, { "docid": "7131ecd37332b837b0ba696f5dd0d6ea", "score": "0.772092", "text": "function findSum(n) {\n sum = 0;\n for (i = 0; i <= n; i++) {\n (i % 3 === 0 || i % 5 === 0) ? sum += i : sum;\n }\n return sum;\n}", "title": "" }, { "docid": "d38d0f926ed8bf26e9d4107973169518", "score": "0.767306", "text": "function findSum(n) {\n let num = 0;\n for(let i = 3; i <= n; i+=1)\n if(i % 3 === 0 || i % 5 === 0)\n num += i; \n return num;\n}", "title": "" }, { "docid": "1908e961271bc3821b27f4e95741a1a8", "score": "0.76355994", "text": "function findSum(n) {\n let result = 0;\n for (let i = 0; i <= n; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n result += i;\n }\n }\n return result;\n}", "title": "" }, { "docid": "ac12d6417b1500a841f0d4ed21fdb219", "score": "0.7607911", "text": "function findSum(n) {\n const arr = [];\n for (i = 1; i <= n; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n arr.push(i);\n }\n }\n return arr.reduce((acc, current) => acc + current);\n}", "title": "" }, { "docid": "369b35751d3f21ea825463c5d147c5de", "score": "0.7559921", "text": "function multiplesOf3and5(number){\n let sum = 0;\n for(let i = 0; i < number; i++){\n if(i%3===0 || i%5===0){\n sum += i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "c438a04e535de14c7f8c957cdbc89cf2", "score": "0.7537455", "text": "function findSum(n) {\n let count = 0;\n for (let i = 3; i <= n; i++) {\n if (i % 3 === 0 || i % 5 === 0) count += i;\n }\n return count;\n}", "title": "" }, { "docid": "dc7805c6028e0e1913db2abd8ad1428d", "score": "0.7534394", "text": "function multiplesOf3and5(number) {\n var sum = 0;\n var i;\n for(i=1; i<number; i++){\n if(i%3 == 0 || i%5 == 0){\n sum+=i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "2989a620a4cdda2c8bad78590319f9a1", "score": "0.74922836", "text": "function three_and_five (n) {\n sol = 0;\n for (var i = 1; i < n; i ++) {\n if (i % 3 === 0 || i % 5 === 0 ) {\n sol += i\n }\n }\n return sol\n}", "title": "" }, { "docid": "3e33a00cd8fdcd50b0c5221b6b58eedb", "score": "0.7434183", "text": "function solution(number){\n count = 0\n let sum = 0\n \n for (let i=0 ; i<number ; i++) {\n if (count % 3 === 0 || count % 5 === 0 ) {\n sum += count\n }\n count ++\n }\n return sum\n}", "title": "" }, { "docid": "b6d9692f753458936ea4e7ecbb195083", "score": "0.741084", "text": "function multiples3And5(num) {\n let res = 0;\n for (let i = 1; i < num; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n res += i;\n }\n }\n\n return res;\n}", "title": "" }, { "docid": "6e1af0564efb4ccf454e7f9c4e0be88b", "score": "0.74079305", "text": "function findSum(n) {\n var sum=0;\n for(i=0; i <= Math.floor(n/3); i++){\n sum += i * 3;\n }\n for(i=0; i <= Math.floor(n/5); i++){\n sum += i * 5;\n }\n for(i=0; i <= Math.floor(n/15); i++){\n sum -= i * 15;\n } \n return sum\n}", "title": "" }, { "docid": "4bf4ec4002b1da3a8f553ca3adbdd402", "score": "0.73813486", "text": "function multiplesOf3And5(num){\n var result = 0;\n for (var i = 3; i < num; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n result += i;\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "f2734cb53e909b9026efcc7686d988f7", "score": "0.73795086", "text": "function ThreeFiveMultiples(num) {\n var total = 0;\n\n for (var i = 0; i < num; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n total += i;\n }\n }\n \n return total;\n}", "title": "" }, { "docid": "7c8aa6db391827d8664dffdfa6eef536", "score": "0.73543763", "text": "function solution(number){\n let count = 0;\n let sum = 0;\n for(let i=0; i<number; i++){\n let index = count++;\n if (index % 3 === 0 || index % 5 === 0){\n sum = sum + index;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "eb4f0920391b27da31b86d38b9a9279a", "score": "0.73419344", "text": "function multiplesOf3And5(number){\n let i=0,sum=0,sum1=0,final=0,sumBoth=0;\n while (i<number){\n if (i%3===0 && i%5===0){\n // console.log(i)\n sumBoth+=i;\n }else if (i%3===0){\n sum+=i;\n }else if (i%5===0){\n sum1+=i;\n console.log(i)\n }\n ++i;\n }\n final=sum+sum1+sumBoth;\n console.log(`Summation of multiples of 3 and 5 in range ${number} is ${final}`)\n return final\n}", "title": "" }, { "docid": "020f91154e020f62eed2eaf60833a652", "score": "0.7339237", "text": "function solution(number){\n\nlet total = 0;\n\nfor (var i = 0; i < number; i++){\n\n if(i % 3 === 0 || i % 5 === 0){\n total += i\n }\n}\n\nreturn total; \n}", "title": "" }, { "docid": "d8f146289e0de86cba58877e96bd6bd3", "score": "0.7335931", "text": "function sumOfMultiplesOf3Or5(inputNumber){\n let result = 0;\n \n if (inputNumber===0) {\n return result;\n }\n for (let i = 0; i < inputNumber; i++) {\n if (i %3 == 0 || i %5 ==0) {\n result+=i;\n }\n \n }\n\n return result;\n}", "title": "" }, { "docid": "c4f519d0f75627199e8184093a02f425", "score": "0.73339546", "text": "function multiplesOf3and5(number) {\n let result = 0;\n for (let i = 0; i < number; i++) {\n if (i % 3 === 0 || i % 5 === 0)\n result += i;\n }\n return result;\n}", "title": "" }, { "docid": "d3c690224b97291f9ae1db782906940f", "score": "0.7310807", "text": "function solution(number) {\n let multiples = []\n for (let i = 3; i < number; i++) {\n if (i % 3 === 0 || i % 5 === 0) multiples.push(i)\n }\n return multiples.reduce((acc, cur) => acc += cur, 0)\n}", "title": "" }, { "docid": "37a739d612d38f28211872d5a3b89fc8", "score": "0.7285959", "text": "function solution(number){\n let arr = [];\n\n for (let i = 3; i < number; i++) {\n if (i % 3 == 0 && i % 5 == 0) arr.push(i)\n else if (i % 3 == 0) arr.push(i);\n else if (i % 5 == 0) arr.push(i);\n }\n return arr.length ? arr.reduce((prev, item) => prev += item) : 0;\n\n}", "title": "" }, { "docid": "1e7951c2a478064eb2ab9dbd49797112", "score": "0.726102", "text": "function solution(number) {\n let sum = 0;\n for (let i = 0; i < number; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "6cdd03018ccce6a9d6955371de3d564b", "score": "0.72331953", "text": "function solution(number){\n let result = 0; //start counter\n for(let i = 0; i < number; i++) { //check positive numbers below given number\n if(i % 3 === 0 || i % 5 === 0) { //if divisible by 3 or 5\n result += i; //add that number to running total\n }\n }\n return result; //return the sum\n }", "title": "" }, { "docid": "a52106cac1ea95fd97163dba76e824fc", "score": "0.72218525", "text": "function solution(number) {\n let n = 0;\n for (let i = 1; i < number; i++) {\n if (i % 3 == 0 && i % 5 == 0) { n += i; } \n else if (i % 3 == 0) { n += i; } \n else if (i % 5 == 0) { n += i; }\n }\n return n;\n}", "title": "" }, { "docid": "2b1ba34c25266cd5fe2b903f55626f5c", "score": "0.72007126", "text": "function f(n) {\n return n < 3\n ? n\n : f(n - 1) + (2 * f(n - 2)) + (3 * f(n - 3));\n}", "title": "" }, { "docid": "aa29c8290eefd606db620cf9c4d769d5", "score": "0.71854687", "text": "function sumMultiples (limit){\n let sum = 0;\n\n for(let num = 0; num<=limit; num++)\n if (num %3 === 0 || num % 5 ===0)\n sum += num;\n \n return sum;\n}", "title": "" }, { "docid": "aaa8a0806e8858fd62af6a0ebb4314f8", "score": "0.7181566", "text": "function sum(limit){\r\n let sum=0;\r\n for(let i=0;i<=limit;i++)\r\n if(i%3===0||i%5===0)\r\n sum+=i;\r\n\r\n return sum;\r\n}", "title": "" }, { "docid": "f7506559f3f73ff3a30010f83f87ab10", "score": "0.7168705", "text": "function sumMultiples(num) {\r\n let numArr = [];\r\n for (let i = 0; i < num; i++) {\r\n if (i < 0) {\r\n return 0;\r\n }\r\n numArr.push(i);\r\n }\r\n let multiplesArr = numArr\r\n .filter(\r\n (item) =>\r\n item % 3 == 0 || item % 5 == 0 || (item % 3 == 0 && item % 5 == 0)\r\n )\r\n .reduce((sum, value) => sum + value, 0);\r\n return multiplesArr;\r\n}", "title": "" }, { "docid": "db16dfa55d99e58a89ef9adf7d13ed76", "score": "0.7089362", "text": "function ThreeFiveMultiples(num) {\n var sum=0; // Create a variable to keep track of our sum. We'll be adding the sum of all multiples of 3 and 5 up to (num)\n for (var i = 3;i < num; i++){ // FOR-LOOP: Starting at 3, incrementing by 1 each iteration, and until num is reached...\n if (i % 3 == 0 || i % 5 == 0){ // -> IF: the current number is divisible by 3 w/ no remainder or divisible by 5 w/ no remainder (aka the number is a multiple of 3 or 5)...\n sum += i; // -> Add the value of the current number to sum\n }\n }\n return sum; // Return sum\n}", "title": "" }, { "docid": "7eb79dadfe6cfc38add7b1838cc7a971", "score": "0.7082277", "text": "function solution(number){\n var multiples = 0;\n \n for(var i = 1;i< number; i++){\n if(i % 3 == 0 || i % 5 == 0){\n multiples += i\n }\n }\n return multiples;\n}", "title": "" }, { "docid": "d1fc5354f0186d89de4f7451f49f977b", "score": "0.7036846", "text": "function solution ( n ) {\n\tvar ar = [], sum = 0;\n\tfor ( var i = 1; i < n; i++ ) {\n\t\tif ( i % 3 === 0 || i % 5 === 0 ) {\n\t\t\tconsole.log(i)\n\t\t\tar.push( i );\n\t\t}\n\t}\n\t// ar.forEach(item => {\n\t// \tsum += item;\n\t// });\n\t// return sum;\n\t// \n\t// there is a function named 'reduce' to reduce program code\n\t// \n\treturn ar.reduce( (total, currentValue, currentIndex, arr) => {\n\t\treturn total + currentValue;\n\t} );\n\t\n}", "title": "" }, { "docid": "aca5029050d5d49b4955aac0c0da634e", "score": "0.701549", "text": "function solution(number){\n var threeCounter = 3;\n var fiveCounter = 5;\n var arr = [];\n while (threeCounter < number){\n arr.push(threeCounter);\n threeCounter += 3;\n }\n while (fiveCounter < number) {\n arr.push(fiveCounter);\n fiveCounter += 5;\n }\n return arr.reduce(function(prev, curr){\n return prev + curr;\n })\n}", "title": "" }, { "docid": "fcf81867c03b57b9c73ff1bb3eef3899", "score": "0.70082676", "text": "function multiples(){\n let sum3 = 0,sum5 = 0,sumAll = 0;\n //const arr = [];\n for(let i=0; i < 10; i++){\n if(i%3 === 0){\n sum3 = sum3 + i;\n }\n if(i%5 === 0){\n sum5 = sum5 + i;\n }\n }\n sumAll = sum3 + sum5;\n return sumAll;\n}", "title": "" }, { "docid": "0e00780084c3355c8e179ee5a120be79", "score": "0.70060843", "text": "function multiples(max) {\n var sum = 0;\n for (i = 1; i < max; i++) {\n if (i % 3 == 0 || i % 5 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "8647f69a0f9a9e96b8d68c2bab7b86f1", "score": "0.69785213", "text": "function sumOfDivisibleNumFiveSeven(n){\n var sum = 0;\n for (i = 1; i <= n; i++){\n if (i % 5 === 0 || i % 7 === 0) {\n sum = i + sum;\n }\n }return sum;\n}", "title": "" }, { "docid": "b3561c073878fce5fd82209cb21de90e", "score": "0.687029", "text": "function sum(limit) {\n let sum = 0;\n for (let i = 0; i <= limit; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n return sum\n}", "title": "" }, { "docid": "732bb0feae9ce01f113eb602fda7cf62", "score": "0.6868553", "text": "function threeandFive() {\n\tvar sum = 0;\n\tvar sumArr = []\n\tfor(var i=100; i<=500; i++)\t{\n\t\tif(i % 3 == 0 && i % 5 == 1){\n\t\t\tsum += i\n\t\t\tsumArr.push(i)\n\t\t}\n\t\telse if(i % 5 == 0 && i % 3 == 1){\n\t\t\tsum += i\n\t\t\tsumArr.push(i)\n\t\t}\n\t}\n\tconsole.log(sum)\n\tconsole.log(sumArr)\n}", "title": "" }, { "docid": "ba8133f2ca15fc85e64444d048743980", "score": "0.6866233", "text": "function sumofLimit(limit){\n let sum=0;\n for(let i=0; i<=limit; i++){\n if(i%3==0 || i%5==0){\n sum+=i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "4e3fb4a2f1bb8fbd8a8523417ee93f41", "score": "0.6856662", "text": "function sum(limit) {\n let total = 0;\n for (let i = 0; i <= limit; i++) {\n if ((i % 3 === 0) || (i % 5 === 0)) total += i;\n }\n return total;\n}", "title": "" }, { "docid": "b190aaba9730843c9c050841e278c01a", "score": "0.6821241", "text": "function sumMultiples3Or5Below1000() {\n let sum = 0;\n for (i = 0; i < 1000; i++) {\n if (i % 3 === 0 || i % 5 === 0) sum += i;\n }\n return sum;\n}", "title": "" }, { "docid": "2b28d30a3cbb51f5eb0f412d8e87f64b", "score": "0.6817685", "text": "function multiples() {\n return (SumDivisibleBy(3, 1000) + SumDivisibleBy(5, 1000) - SumDivisibleBy(3 * 5, 1000))\n}", "title": "" }, { "docid": "82a48447252e718fb084b856a2cd2469", "score": "0.68038535", "text": "function solution() {\n\n let total = 3 + 5;\n for (let i = 6; i < 1000; i++) {\n \n if ((i % 3 === 0) || (i % 5 === 0)) {\n total = total + i;\n }\n }\n\n console.log(total);\n\n}", "title": "" }, { "docid": "e5c082b5caa2fd1270948503c7b154d4", "score": "0.6784518", "text": "function solution(number) {\n // Check if number is negative. If so, we can return 0, because the problem\n // stipulates that we add up multiples of 3 or 5 BELOW the given number\n if (number < 0) {\n return 0;\n }\n\n // Create an array with a range of numbers from 0 to x; x is exclusive.\n const emptyArr = new Array(number);\n const range = [...emptyArr.keys()];\n console.log({ range });\n\n const multiples = [];\n\n // Add multiples of 3 to array\n range.forEach(curr => {\n if (curr % 3 === 0) {\n multiples.push(curr);\n }\n });\n console.log({ multiples });\n\n // Add multiples of 5 to array if that multiple isn't already in the array\n range.forEach(curr => {\n if (curr % 5 === 0 && multiples.includes(curr) === false) {\n multiples.push(curr);\n }\n });\n console.log({ multiples });\n\n // Sum up array\n const total = multiples.reduce((acc, curr) => acc + curr, 0);\n console.log({ total });\n\n return total;\n}", "title": "" }, { "docid": "cdbd592900c099c05e1fcbe6eb634d29", "score": "0.6759022", "text": "function multisum(num) {\n let sum = 0;\n\n for (let i = 1; i <= num; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n\n return sum;\n}", "title": "" }, { "docid": "bffe57de7e3ddb1c1ed95e130bb39298", "score": "0.67509985", "text": "function GetSumOfMultiples(limit=1000){\n\tlet sum = 0;\n\tfor(let i=0;i<limit;i++){\n\t\tif( i%3==0 || i%5==0 ) sum+=i;\n\t}\n\treturn sum;\n}", "title": "" }, { "docid": "30808cdd36cddbc28a8e9cf2801792b1", "score": "0.67486626", "text": "function sum(limit) {\n let sum = 0;\n for (let i = 0; i <= limit; i++) {\n if (1 % 3 === 0 || 1 % 5 === 0) sum += 1;\n return sum;\n }\n}", "title": "" }, { "docid": "a33c8fe843f5998103db678e639b06de", "score": "0.6706442", "text": "function findSummands(n) {\n let cube = n * n * n;\n for (let i = 0; i < cube; i++) {\n if (i + (i + 2) + (i + 4) === cube) {\n return [i, i + 2, i + 4];\n }\n }\n return [1];\n}", "title": "" }, { "docid": "0fcbf633fd700a3a710c4587501ef752", "score": "0.667408", "text": "function sumTo(n) {\n\n}", "title": "" }, { "docid": "ba64453f4239ed0af92f47d96664ff7a", "score": "0.6665795", "text": "function solution(number){\n return number < 1 ? 0 : [...new Array(number).keys()].filter(n => n % 3 == 0 || n % 5 == 0).reduce((a, b) => a + b);\n }", "title": "" }, { "docid": "33df6f74f5c10d09d5378bce65e6fcde", "score": "0.6662183", "text": "function sumAll(num){\n\tvar sumNums = 0;\n\n\tfor(var i = 0; i < num; i++){\n\t\tif(i % 3 === 0 && i % 5 === 0){\n\t\t\tsumNums = sumNums + i;\n\t\t}\n\t}\n\n\treturn sumNums;\n}", "title": "" }, { "docid": "313a679773d292b0c0ab4f91da56712f", "score": "0.6656254", "text": "function sum(n){\n return n.reduce(function(previousValue, currentValue){\n return previousValue + currentValue;\n })\n }", "title": "" }, { "docid": "8d24689267ccd7ad8a7422e190d9a17a", "score": "0.66513216", "text": "function multiplesOf3and5(number) {\n // First of all, we create a method that will generate an array \n // starting and ending with the numbers that we specified as arguments to this method:\n let range = (start, end) => {\n return [...Array(end).keys()].map(el => el + start)\n }\n // We must test this method. I suggest just outputting an array from 1 to 10 to the console:\n // console.log(range(1, 10))\n // console.log(range(1, 100))\n // console.log(range(10, 20))\n // It's OK, range() is working! So, we can use it:\n let arr = range(1, number-1)\n // In next step we must filter the array to get only members that are divisible by 3 or 5\n // To do this, we need to write a method that will filter the array.\n // But first, I suggest creating a method that allows us to dynamically determine the divisor in our filter:\n let divisibleBy = divisor => num => num % divisor === 0;\n // It was easy enough! Now we use this method in our filter:\n let filteredArr = arr.filter(i => divisibleBy(3)(i) || divisibleBy(5)(i))\n // As you can see, now we can set an arbitrary number of divisors in the filter! That's cool!\n // The last step remained - to calculate the sum of all elements of the array:\n // console.log(filteredArr)\n return filteredArr.reduce((result, num) => result + num)\n}", "title": "" }, { "docid": "dd3113479bc69b6b174fe82e70364fa5", "score": "0.6645148", "text": "function solution(number){\n var count = 0;\n for(var i = 0; i < number; i++) {\n if( i%3===0 || i %5 === 0){\n count+=i;\n }\n }\n return count;\n}", "title": "" }, { "docid": "9c8a790bd2c7519a417cd672938edc83", "score": "0.6635851", "text": "function totalOfMultiplesOf(range) {\n // create an empty array\n var multiples = []\n for (var i = 0; i < range; i++) {\n if ((i % 3 === 0) || (i % 5 === 0)) {\n // push multiples to the array\n multiples.push(i);\n }\n }\n const total = multiples.reduce((a, b) => a + b, 0);\n return total;\n }", "title": "" }, { "docid": "75404250dc2d79443a4f2796de531d9f", "score": "0.66356194", "text": "function thirt(n) {\n let result = n;\n function calc(source) {\n // 1, 10, 9, 12, 3, 4\n let mult = [1, 10, 9, 12, 3, 4];\n let nString = source.toString().split('').map(Number).reverse();\n let results = nString.map((v, i) => {\n return v * mult[i % 6];\n });\n let red = results.reduce((a, b) => a + b);\n if (red.toString().length > 2) {\n calc(red);\n }\n else {\n result = red;\n }\n }\n calc(result);\n return result;\n}", "title": "" }, { "docid": "5092f0492fa064fc94171d09096cd29a", "score": "0.65642554", "text": "function NextFiveMultiple(number) {\n var toNextFiveMultiple = 5 - number%5\n\n if (number%5 == 0){\n return number\n }else {\n return number + toNextFiveMultiple\n }\n}", "title": "" }, { "docid": "bd26d0ef2f6fbd9e1d1214b29c7fb477", "score": "0.6543407", "text": "function sum(n) {\n return n.reduce(function(previousValue, currentValue) {\n return previousValue + currentValue;\n })\n }", "title": "" }, { "docid": "9f3d46d9980658d4c9c19e90059aebe1", "score": "0.65380424", "text": "function onlyDivisiblebyThree(){\n numbers.forEach(function(number){\n var sum = 0;\n if(number % 3 == 0){\n sum+=number;\n }\n });\n return sum;\n}", "title": "" }, { "docid": "1caeede236929dda450c8a329a131be7", "score": "0.6516938", "text": "function solution(number){\n // 1. Get an integer from user, number\n // 2. Set the number of multiples 3, 5, and 15\n var num3 = 0;\n var num5 = 0;\n var num15 = 0;\n // 3. from i = 1 to i less than number using for statement\n for(var i = 1; i < number; i++) {\n if((i % 3 === 0) && (i % 5 !== 0)) {\n num3 += 1;\n } else if((i % 5 === 0) && (i % 3 !== 0)) {\n num5 += 1;\n } else if(i % 15 === 0) {\n num15 += 1;\n }\n }\n var result = [num3, num5, num15];\n return result;\n}", "title": "" }, { "docid": "ea8305c8b2ad23599a2dcc00ae7f1f5c", "score": "0.6476738", "text": "function calculateSum(min, max) {\n var total = 0;\n var i = min;\n while(i<max){\n if(i % 3 === 0 || i % 5 === 0)\n total = total + i;\n i ++;\n }\n return total;\n }", "title": "" }, { "docid": "c477d4a5c600174cde1d0b46922edcce", "score": "0.64574623", "text": "function sum(a,b,c) {\n return (a + b + c) % 3 \n \n}", "title": "" }, { "docid": "c3fc9086c0d0b25a7543bec84263a6e5", "score": "0.64511204", "text": "function solution(number) {\n // create empty array to fill with qualified numbers\n let newArray = [0]\n // loop through all values between 1 and number, grabbing only those that fit the instructions\n for (let i = 1; i < number; i++) {\n if (i % 3 === 0 && i % 5 === 0\n || i % 3 === 0\n || i % 5 === 0) {\n // add each qualified number to newArray\n newArray.push(i)\n }\n }\n // make a quick anonymous function to reduce array to its sum\n let sum = newArray.reduce((num, a) => (num + a))\n return(sum)\n }", "title": "" }, { "docid": "6edc0d98b669c68b70612e18f26d091c", "score": "0.6434887", "text": "function threesFives(num){\n var addednum = 0;\n\n for (var i= 1; i < num; i++){\n if(i % 3 !== 0 && i % 5 !==0 ){\n addednum += i;\n }\n console.log(addednum)\n }\n return addednum\n}", "title": "" }, { "docid": "49453f62a424bf873180da3a22f6c615", "score": "0.6423666", "text": "function calculateSum(n) {\n let result = 0;\n for (let i = 0; i <= n; i++) {\n result += i; //result = result + i; 0+1; 1+2; 3+3; 6+4; 10+5; 15+6; 21+7; 28+8=36;\n }\n return result;\n}", "title": "" }, { "docid": "2ff379669b89fc4b41a2f9f3c6fed248", "score": "0.64179224", "text": "function summation(n){\n var sum = 0;\n for (i=1; i<(n+1); i++){\n sum += i;\n }\n return sum;\n }", "title": "" }, { "docid": "55c98ca8582ae5b56c06cab28387cfdf", "score": "0.6410579", "text": "function sumOfMultiples(range, multiples) {\n let sum = 0;\n\n for(let i = 1; i < range; i++) {\n let isMultiple = false;\n multiples.forEach(multiple => {\n if(i % multiple === 0) {\n isMultiple = true;\n }\n })\n sum += isMultiple ? i : 0;\n }\n\n return sum;\n}", "title": "" }, { "docid": "63b3fc2b09a58b9469eaad6b5477a0e4", "score": "0.6408408", "text": "function sum2() {\n for (let i = 10; i <= 90; i++) {\n if (i % 3 == 0 && i % 5 == 0) {\n console.log(i);\n }\n }\n}", "title": "" }, { "docid": "92a4447d7d458b398d608d63b89fe569", "score": "0.63884", "text": "function sumEvens(n){\n\tif(n===0){\n\t\treturn n;\n\t}else if(n%2!==0){\n\t\treturn sumEvens(n-1);\n\t}else{\n\t\treturn n+sumEvens(n-2);\n\t}\n}", "title": "" }, { "docid": "8fdb50717661968d3b49f7deb7d77322", "score": "0.63762474", "text": "function evenlydivisibleBy(maxNum){\n //start at max if sum is not divisible by the next nubmer multiply\n // this straggey does not work it duplicates factors \n maxNum = 10;\n // var sum = maxNum;\n // for (var i = maxNum -1 ; i > 2 ; i--){\n // var remainder = sum % i;\n // console.log(i , sum);\n // console.log(sum % i);\n // if( remainder !== 0 ){\n\n // sum *= i;\n // // console.log(sum % (sum % i ));\n\n // // console.log( i , sum)\n // }\n // } \n // return sum\n\n // start with 1 \n var sum = 2; \n for ( var i = 3 ; i <= maxNum; i++ ){\n // if( sum % i )\n // console.log(sum % i)\n console.log( 'old sum', sum)\n console.log( 'i ', i);\n var remainder = sum % i;\n console.log('remainder ', remainder)\n if(remainder !== 0){\n\n console.log( i % remainder)\n if( i % remainder === 0 ){\n sum *= remainder\n } else {\n sum *= i\n\n }\n\n }\n console.log('new sum ', sum)\n }\n\n return sum\n\n}", "title": "" }, { "docid": "b46412edc50a1676698155d4261e519b", "score": "0.63474274", "text": "function sumCubes(n) {\n let sum = 0;\n for (let i = 1; i <= n; i ++) {\n sum += i ** 3;\n } return sum;\n}", "title": "" }, { "docid": "eb530c177bb7eb96af0c99c6a00dfbcd", "score": "0.6330311", "text": "function messyMath(num){\n var sum = 0;\n for(var i=0; i<= num; i++){\n if(i === num/3){\n sum = -1;\n return sum;\n }\n else{\n if(i%3 == 0){\n continue;\n }\n else if(i%7 == 0){\n sum += i*2\n }\n else{\n sum += i\n }\n }\n }\nreturn sum;\n}", "title": "" }, { "docid": "6b05156c74e04149db2aa2a910b079cd", "score": "0.63207424", "text": "function addUpTotwo(n) {\n return n * (n + 1) / 2;\n}", "title": "" }, { "docid": "1d882c37bc7ad09d188e6760c10562c2", "score": "0.63045347", "text": "function sumHalves(n){\n\n}", "title": "" }, { "docid": "b70b8b4cfad7f88b0265a9d11993c17e", "score": "0.6297586", "text": "function sumOfNumbers(n)\n{\n return (n*(n+1))/2\n}", "title": "" }, { "docid": "f92aba8fddabdee06e3d5eed76c5eb8d", "score": "0.6290343", "text": "function sumMathematically(n) {\n return (n * (n + 1)) / 2; // 3 operations\n}", "title": "" }, { "docid": "e6e7807110c8c6205af9f37255e78bb1", "score": "0.62816423", "text": "function sumOfHandshakes(n) {\n return (n * (n - 1)) / 2\n}", "title": "" }, { "docid": "89a6a94192bd221dc1f087fed1d87cff", "score": "0.6277871", "text": "function SeriesSum(n) {\n let result = 0;\n let reverage = 1;\n for (let i = 0; i < n; i++) {\n if (i === 0) {\n result = 1;\n } else {\n reverage += 3;\n result = result + (1 / reverage);\n }\n }\n return result.toFixed(2);\n}", "title": "" }, { "docid": "27c6bb4f213372ac032da13f358fa442", "score": "0.6269772", "text": "function medium(n1, n2, n3){\n return ((n1 + n2) % n3)\n}", "title": "" }, { "docid": "ac1648ea370ce79488121fc80321fe28", "score": "0.62594247", "text": "function fav(n) {\n return n < 2 ? n : fav(n - 1) + fav(n - 2);\n }", "title": "" }, { "docid": "4bc200385c880906e31d95bd5fd95d54", "score": "0.6252949", "text": "function optimizedSum (start,end,multiple1, multiple2){\n let sum = 0;\n /** since the start could be an arbitrary number\n * we need to find the next multiple of both numbers*/\n var nextNumber1 = start + multiple1 - 1;\n nextNumber1 -= (multiple1 % multiple1); //\n\n var nextNumber2 = end + multiple2 - 1;\n nextNumber2 -= (multiple2 % multiple2); //\n\n // We can then find the sum from start-End for multiple1 and multiple2\n //then subtract repeated numbers which are factors of multiple1 and multiple2\n // finally subtract []\n // [3, 6 .. end] + [5, 10 ...end] - [15, 30, ..end]\n\n}", "title": "" }, { "docid": "bdb884f166c3ffe50183a19d98ad63d9", "score": "0.6247482", "text": "function old35(n){\n a = n % 3;\n b = n % 5;\n if(a === 0 || b === 0)\n if(a !== b)\n return true;\n else \n return false;\n else\n return false;\n}", "title": "" }, { "docid": "bfc201134531069fcb2894f48442cdda", "score": "0.62434626", "text": "function sumAll(n) {\r\n\tif (n == 1) return 1;\r\n\treturn n + sumAll(n - 1);\r\n}", "title": "" }, { "docid": "fade7d3508030e601a4102a97da206e7", "score": "0.62353206", "text": "function nstepsIterMemo(n){\n\tif(n <= 0){\n\t\treturn;\n\t}\n\tconst results = [0,1,2,4];\n\n\tfor(let i = 4; i <= n; i++){\n\t\tresults[i] = results[i-1] + results[i-2] + results[i-3];\n\t}\n\n\treturn results[n];\n\n}", "title": "" }, { "docid": "aa06909a3dc0c14fa03512f20dcf1bb1", "score": "0.6226409", "text": "function viralAdvertising(n) {\n let recipients = Math.floor(5/2)\n // 2\n // console.log(\"recipients: \",recipients)\n let sum = recipients\n // 2\n // console.log(sum)\n for (let i=2; i<=n; i++) {\n let shared = recipients*3\n recipients = Math.floor(shared/2)\n // console.log(\"recipients: \",recipients)\n // console.log(\"shared: \",shared)\n sum += recipients\n // console.log(\"recipients: \",recipients)\n // console.log(\"sum: \",sum)\n }\n return sum\n}", "title": "" }, { "docid": "252168145760afc9a7db9e6996929938", "score": "0.62102675", "text": "function computeSummationToN(n) {\n return n * (n + 1) / 2;\n}", "title": "" }, { "docid": "128963fa7127e1acbed08cdc30440061", "score": "0.6202067", "text": "function euler1(){\n for(var i = 0; i < 1000; i++){\n if((i % 3 == 0)||(i % 5 == 0)){\n total += i;\n }\n }\n return total;\n}", "title": "" }, { "docid": "bba4950333886b9065eb44983219ab88", "score": "0.61981183", "text": "function SeriesSum(n)\n{\n let seriesSum = 0\n \n // Happy Coding ^_^\n for (let i = 0; i < n; i++) {\n let currentSeriesNum = 1/(1 + i * 3)\n seriesSum += currentSeriesNum\n }\n return seriesSum.toFixed(2)\n}", "title": "" }, { "docid": "73415eed3c309d18eacbba5341c8450b", "score": "0.6196841", "text": "function SeriesSum(n)\n{\n var x =1;\n totalSum = 1;\n if(n == 0)\n {\n \treturn \"0.00\";\n }\n if(n == 1)\n {\n \treturn \"1.00\";\n }\n\n while(x < n)\n {\n \tvar divisor = 1 / (x * 3 + 1);\n \tconsole.log(divisor);\n \ttotalSum = totalSum + divisor;\n \tx++;\n }\n totalSum = String(Math.round(totalSum * 100) / 100);\n\n if(totalSum.length != 4)\n {\n \ttotalSum = totalSum + \"0\";\n }\n\n return totalSum\n}", "title": "" }, { "docid": "423d53f9cfd7e33c9ccd8e86e0ba58ce", "score": "0.6184283", "text": "function rowSumOddNumbers(n){\n return Math.pow(n, 3);\n}", "title": "" }, { "docid": "0f6f5df7b3b56f39f205aee30e1d2a56", "score": "0.61784554", "text": "function addUpTo(n) {\n\tlet total = 0;\n\tfor (let i = 1; i <= n; i++) {\n\t\ttotal += i;\n\t}\n\treturn total;\n}", "title": "" }, { "docid": "409176458d76a989e44bb1878352aa47", "score": "0.61761975", "text": "function sumMultiplesBelowNum(num) {\n\n return function(numArray) {\n var multiples = [];\n numArray.sort(function(a, b) { return a - b; }); // to get the lower boundary\n for(var i = numArray[0]; i < num; i++) {\n for(var j = 0; j < numArray.length; j++) {\n if(i % numArray[j] === 0) {\n if(multiples.indexOf(i) === -1) {\n multiples.push(i);\n }\n }\n }\n }\n var sum = 0;\n for(var i = 0; i < multiples.length; i++) {\n sum += multiples[i];\n }\n return sum;\n }\n}", "title": "" }, { "docid": "e2d9a69090b6cf41675f42b053dc9fed", "score": "0.61630356", "text": "function compute(n){\n \n // N must be an odd number. greater than equal to 3 \n \n if(n % 2 == 0 || n < 3){\n return false; \n }\n var num = 0;\n for(var i=3; i<=n; i+=2){\n\t num+= 1/(Math.pow(i,2));\n }\n num+= 1;\n return num;\n\n\n\n}", "title": "" }, { "docid": "b17906b3a4c2fe7a39605f5cd1dffbb7", "score": "0.615465", "text": "function circleOfNumbers(n, firstNumber) {\n return (firstNumber + n/2) % n;\n}", "title": "" }, { "docid": "a1e1bfa4df917f17ffe2d6204deeff79", "score": "0.6141792", "text": "function fivePoints(num_of){\n var points = 0;\n if (num_of >= 3){ points += 500; num_of -= 3; }\n if (num_of === 2) points += 100;\n else if (num_of == 1) points +=50;\n return points;\n}", "title": "" }, { "docid": "08fbbdd04b18533836c7075806e6fef3", "score": "0.6137198", "text": "function threeNumberSum(array, targetSum) {\n // array.sort();\n array.sort((a, b) => a - b);\n\n const triplets = [];\n\n for (let i = 0; i < array.length - 2; i++) {\n let left = i + 1;\n let right = array.length - 1;\n // let currentNum = array[i];\n\n while (left < right) {\n let currentSum = array[i] + array[left] + array[right];\n\n if (currentSum === targetSum) {\n triplets.push([array[i], array[left], array[right]]);\n left++;\n right--;\n } else if (currentSum < targetSum) {\n left++;\n } else if (currentSum > targetSum) {\n right--;\n }\n }\n }\n\n return triplets;\n}", "title": "" }, { "docid": "e2c6a91a280b30cc52714f8b7a28b4f7", "score": "0.6134959", "text": "function sumN(n) {\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot += 1 + 2 *i;\n }\n return tot;\n}", "title": "" }, { "docid": "3bfc1d1b05ca7e5d1dcd39e1f6f8fe60", "score": "0.6134666", "text": "function rowSumOddNumbers(n) {\n return Math.pow(n, 3);\n}", "title": "" } ]
74331108efb948932e7cd939b70f2d45
1] Configuration Handles the user (re)configuring Elasticsearch
[ { "docid": "9ff39eea9ee02e0987d00a9c9cd6cad7", "score": "0.6695924", "text": "function configureElasticsearch(esConfig) {\n if (!ManagementService_.isManagementServiceCreated()) {\n ManagementService_.createManagementService(esConfig)\n } else {\n ManagementService_.setEsMeta(esConfig)\n }\n }", "title": "" } ]
[ { "docid": "0ab7a00f85e96027b0cf270c5ea416a3", "score": "0.6832582", "text": "function configureElasticsearch (next) {\n var esUrl = 'http://localhost:' + config.elasticsearch.port\n var indexUrl = urljoin(esUrl, 'binder-logs')\n request.get({\n url: indexUrl,\n json: true\n }, function (err, json) {\n if (err) return next(err)\n // we need to be able to do exact string search on the app name\n var mappings = json.body['binder-logs']\n var indexPath = 'mappings.logs.properties.app.index'\n // do not recreate the index unless necessary (only the first time Binder is initialized)\n if (_.get(mappings, indexPath) === 'not_analyzed') {\n return next(null)\n }\n _.set(mappings, indexPath, 'not_analyzed')\n request({\n url: indexUrl,\n method: 'DELETE'\n }, function (err, rsp) {\n if (err) return next(err)\n request({\n url: indexUrl,\n method: 'PUT',\n json: true,\n body: mappings\n }, function (err, rsp) {\n return next(err)\n })\n })\n })\n}", "title": "" }, { "docid": "470dad2a032efe06631bd570f4ac050d", "score": "0.63098997", "text": "function getConfig(callback) {\n elasticClient.search({\n index: 'sys_conf',\n type: 'sys_conf',\n body: {\n query: {\n \"match_all\": {}\n }\n }\n }, callback);\n}", "title": "" }, { "docid": "8e7db1cb2e8f85bfe3f469a41a2175c7", "score": "0.6154939", "text": "function initConfigurationIndex() {\r\n return elasticClient.indices.create({\r\n index: configuration\r\n });\r\n}", "title": "" }, { "docid": "70e3fd86602f1142423ff7d4f23160d3", "score": "0.5982404", "text": "configuring() {\n this.config.set(this.configuration);\n }", "title": "" }, { "docid": "0de3ae4efdcc0e9d0e40928d07e219c0", "score": "0.59226906", "text": "function init() {\n var options = new Object();\n\n // first get the config\n try {\n let config = yaml.load(fs.readFileSync('../config/glutton.yml', 'utf8'));\n options.indexName = config['elastic']['index'];\n options.batchSize = config['indexBatchSize'];\n options.elastic_host = config['elastic']['host'];\n if (!options.elastic_host.startsWith(\"http\"))\n options.elastic_host = \"http://\" + options.elastic_host;\n } catch (e) {\n console.error(\"the yaml configuration file could not be read, please check: ../config/glutton.yml\");\n }\n\n client = new elasticsearch.Client( {\n node: options.elastic_host,\n keepAlive: false,\n log: \"error\",\n requestTimeout: 1000000, //to give more time for indexing\n sniffOnStart: true //discover the rest of the cluster at startup\n // sniffOnConnectionFault: true,\n // sniffInterval: 300,\n //suggestCompression: true\n });\n\n options.action = \"health\";\n var attribute; // name of the passed parameter\n\n for (var i = 2, len = process.argv.length; i < len; i++) {\n if (process.argv[i - 1] === \"-dump\") {\n options.dump = process.argv[i];\n } else if (!process.argv[i].startsWith(\"-\")) {\n options.action = process.argv[i];\n }\n }\n\n // check the dump path, if present\n if (options.dump) {\n const stats = fs.lstatSync(options.dump);\n if (stats.isDirectory()) {\n options.dumpType = \"directory\"\n } else if (stats.isFile()) {\n if (options.dump.endsWith(\".json\")) {\n options.dumpType = \"json\"\n } else if (options.dump.endsWith(\".tar.gz\")) {\n options.dumpType = \"tar\"\n } else if (options.dump.endsWith(\".gz\")) {\n options.dumpType = \"gz\"\n } else if (options.dump.endsWith(\".xz\")) {\n options.dumpType = \"xz\"\n } else {\n throw new Error(\"The dump format is not recognised \");\n }\n } else {\n throw new Error(\"CrossRef dump path must be a valid file or directory\");\n }\n }\n\n return options;\n}", "title": "" }, { "docid": "7a6fe2a6fd6bef9da1fdc5010f3c5dbe", "score": "0.58396965", "text": "configure() {}", "title": "" }, { "docid": "ff1456dbc5b4987263b1d294030767c4", "score": "0.58237773", "text": "configure() {\n //\n }", "title": "" }, { "docid": "ff1456dbc5b4987263b1d294030767c4", "score": "0.58237773", "text": "configure() {\n //\n }", "title": "" }, { "docid": "bab77c79b2b3c5265dfc6cb786b8fde0", "score": "0.5799352", "text": "configure(config) {\n this._config = config;\n }", "title": "" }, { "docid": "99b370268478bce4ba0391bc36ca25ec", "score": "0.5754927", "text": "function elClient(config) {\r\n events.call(this);\r\n this.options = config;\r\n //this.options.connection_url = process.env.AWS_EC2_MASTER_NODE;\r\n this.options.connection_url = 'http://ec2-54-69-72-231.us-west-2.compute.amazonaws.com:9200';\r\n //= 'localhost:9200'; || 'https://woygrxy:[email protected]' || ;\r\n if (this.isReady()) {\r\n const elasticClient = new elasticsearch.Client({\r\n host: this.options.connection_url,\r\n log: 'info',\r\n keepAlive: true\r\n });\r\n elasticClient.ping({\r\n requestTimeout: 30000,\r\n hello: \"elasticsearch\"\r\n },\r\n function (error) {\r\n if (error) {\r\n console.error('elasticsearch cluster is down!');\r\n } else {\r\n console.log('EL is all well');\r\n }\r\n }\r\n );\r\n this.esclient = elasticClient;\r\n } else {\r\n console.log(\"Elasticsearch is not connected.\")\r\n }\r\n}", "title": "" }, { "docid": "7d678a908387d6a25904c3fc4e17f5f5", "score": "0.57064956", "text": "configuring() {}", "title": "" }, { "docid": "4fb018c96768e0338e6d87631f9d1c5e", "score": "0.5651554", "text": "configure() {\n \n }", "title": "" }, { "docid": "cf0a0268fe1f82bc3234cb132ed2bf6a", "score": "0.5499978", "text": "init(server, options) {\n server.route({\n path: '/api/elasticsearch_status/index/{name}',\n method: 'GET',\n handler(req, reply) {\n // more to come here in the next step\n reply(\"Hello World\");\n server.plugins.elasticsearch.callWithRequest(req, 'cluster.state', {\n metric: 'metadata',\n index: req.params.name\n}).\n then(function (response) {\n reply(response.metadata.indices[req.params.name]);\n});\n }\n});\n // Just call the api module that we imported above (the server/routes.js file)\n // and pass the server to it, so it can register several API interfaces at the server.\n api(server);\n }", "title": "" }, { "docid": "b5bd49e0a66b14f8a9dfe94fddec1fd8", "score": "0.54042494", "text": "function Configuration() {\n}", "title": "" }, { "docid": "764e5f0bb172285a6d3b33f1c33ce595", "score": "0.54035145", "text": "function initMapping() {\n return client.indices.putMapping({\n index: 'product',\n type: 'products',\n body: {\n properties: {\n \t \tasin: { type: \"string\", \"index\" : \"keyword\" },\n \t title: { type: \"string\", \"analyzer\": \"simple\"},\n \t categories: { type: \"string\", \"index\" : \"keyword\"},\n \t description: { type: \"string\", \"analyzer\": \"simple\"}\n }\n }\n });\n}", "title": "" }, { "docid": "7072e98a17114519215b85d91c3081b3", "score": "0.53928435", "text": "config() {}", "title": "" }, { "docid": "9b94fca58ffaf60ce9eadc52c775b51e", "score": "0.53817344", "text": "configure () {\n\n }", "title": "" }, { "docid": "c2556b5cd9902814e20851574d5b4b15", "score": "0.53255147", "text": "configure() {\n this.app.config.set('stores.orm', 'sequelize')\n _.merge(this.app.config, lib.FailsafeConfig)\n }", "title": "" }, { "docid": "e5236f759de1af1bc5e0975f00d46634", "score": "0.532101", "text": "function initMapping() { \n return elasticClient.indices.putMapping({\n index: indexName,\n type: \"restaurant\",\n body: {\n properties: {\n id: { type: \"long\" },\n name_en: { type: \"string\"},\n name_ar: { type: \"string\"},\n opening_hr: {\n type: \"date\",\n format: \"hour_minute_second\"\n },\n closing_hr: {\n type: \"date\",\n format: \"hour_minute_second\"\n },\n opening_hr_in_seconds: { type: \"long\" },\n closing_hr_in_seconds: { type: \"long\" },\n photos_count: { type: \"long\" },\n branches_count: { type: \"long\" },\n reviews_count: { type: \"long\" },\n menus_count: { type: \"long\" },\n description_ar: { type: \"long\" },\n description_en: { type: \"long\" },\n delivery_charge: { type: \"long\"},\n created_at: { type: \"long\" },\n updated_at: { type: \"long\" },\n city_id: { type: \"long\"}\n }\n }\n });\n}", "title": "" }, { "docid": "aa47478f420d5e1c8d080dd156c2a5c8", "score": "0.5299992", "text": "function configure(conf) {\n\t if (isObject(conf)) {\n\t merge(configuration, conf);\n\t }\n\t}", "title": "" }, { "docid": "45e1bbceb78d2731508f485f2aae21a8", "score": "0.52756125", "text": "constructor() { \n \n OrgApacheJackrabbitOakPluginsIndexSolrOsgiRemoteSolrServerConfigurationProviderProperties.initialize(this);\n }", "title": "" }, { "docid": "34eab39e8c89ac74ff95d3c0262830c4", "score": "0.5227808", "text": "validate() {\n if (!_.isObject(this.app.config.elasticsearch))\n return Promise.reject(new Error('No configuration found at config.elasticsearch !'))\n\n if (!_.isObject(this.app.config.elasticsearch.connection))\n return Promise.reject(new Error('No connection configuration defined !'))\n }", "title": "" }, { "docid": "41387d3e8ba02513b036d58f60a19156", "score": "0.5216887", "text": "function config(configuration)\n {\n fuseConfiguration = angular.extend({}, fuseConfiguration, configuration);\n }", "title": "" }, { "docid": "b365f8227ca60bf319ef203583a9d4d8", "score": "0.5205537", "text": "async function createElasticSearchIndex() {\n await createEsIndex();\n await updateEsTypeMapping();\n}", "title": "" }, { "docid": "6fe6dd9b0482463353cdade6c98dec4d", "score": "0.5174643", "text": "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "title": "" }, { "docid": "6fe6dd9b0482463353cdade6c98dec4d", "score": "0.5174643", "text": "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "title": "" }, { "docid": "6fe6dd9b0482463353cdade6c98dec4d", "score": "0.5174643", "text": "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "title": "" }, { "docid": "056f96ab94718d3770069c71d7e0e5b5", "score": "0.5173558", "text": "configure (name, config = {}) {\n // set default configuration\n const defaultConfig = {\n async: true,\n cType: 'application/json',\n resType: 'json',\n callback: function (data) {\n console.log(data);\n }\n };\n\n for (let prop in defaultConfig) {\n if (config[prop] === undefined) {\n config[prop] = defaultConfig[prop];\n }\n }\n\n this.config[name] = config;\n return this.config[name];\n }", "title": "" }, { "docid": "d931f0db4686bf1744b28a2c04952f66", "score": "0.51613754", "text": "_configure() {\n let rawConfig = fs.readFileSync(this.file, 'utf-8');\n let serviceConfig = JSON.parse(rawConfig);\n\n this.service_list = [];\n for (let service of serviceConfig.services) {\n this.service_list.push({name: service.name, url: service.url})\n }\n\n }", "title": "" }, { "docid": "1d87b6fb5e9aa5cb47c1d431ebb735d4", "score": "0.51467615", "text": "function indexData() {\n //create elastic client\n let client = elastic.Client({\n host: 'ss_elastic:9200'\n });\n\n // do indexing\n client.bulk({\n body: bulkArr\n }, (err, resp) => {\n if(err){\n console.error('AN ERROR HAS OCCURRED\\n', err);\n process.exit(-1);\n } else{\n console.info(logInfo);\n console.info('BULK INDEXING SUCCESSFULL');\n }\n });\n}", "title": "" }, { "docid": "ea8b08790044def1441e6282d72394e3", "score": "0.5116213", "text": "function configurePlugins(fastify, envConfig) {\n\n\n // Configure Swagger\n fastify.register(require('fastify-swagger-ui'), {\n swagger: {\n info: {\n title: 'Test swagger',\n description: 'testing the fastify swagger api',\n version: '0.1.0'\n },\n host: 'localhost',\n schemes: ['http'],\n consumes: ['application/json'],\n produces: ['application/json']\n }\n }); \n\n\n // Configure Blipp \n fastify.register(require(\"fastify-blipp\")); \n // Configure Boom\n fastify.register(require('fastify-boom'));\n // COnfigure Helmet\n fastify.register(require('fastify-helmet'));\n\n /*fastify.register(require('fastify-mongodb'), {\n url : envConfig.get('db.url') || (\"mongodb:\"\n });*/\n\n\n fastify.register(require('./../routes'));\n\n\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "28b93d511c130b39b04319a9c71742d7", "score": "0.5102309", "text": "function IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null;\n\n // make sure every index instance has it's own cache\n this.cache = {};\n}", "title": "" }, { "docid": "fcfd77acb62aacb24ea8184b4c05c642", "score": "0.5099004", "text": "config () {\n return extend({}, defaults, {\n apihost: this.getBase(),\n meta: this.getSiteURL()\n });\n }", "title": "" }, { "docid": "0e13a90e6306656795612c9115b4399c", "score": "0.5069198", "text": "function es() {\n throw new Error('Looks like you are expecting the previous \"elasticsearch\" module. ' + 'It is now the \"es\" module. To create a client with this module use ' + '`new es.Client(params)`.');\n}", "title": "" }, { "docid": "734967c90d1241ae43ae6216a028408d", "score": "0.5059628", "text": "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "title": "" }, { "docid": "734967c90d1241ae43ae6216a028408d", "score": "0.5059628", "text": "setConfig(config) {\n super.setConfig(this.processConfig(config));\n }", "title": "" }, { "docid": "63b7a0d34894c6d512579b409ecdd318", "score": "0.50340337", "text": "loadConfig() {\n\n }", "title": "" }, { "docid": "e60a97423d0e255fac7222eea39fbbcc", "score": "0.5023893", "text": "_configure() {\n // Internal hooks\n this.hooks = {\n \"internal:pluginManager:loadAllPlugins\": this._onLoadAllPlugins.bind(this),\n \"internal:serverless:set:instanceId\": this._onSetInstanceId.bind(this)\n };\n // Core/internal objects\n this.config = {\n core: _.get(this, \"sls.service.custom.coreHooks.objects\", []),\n internal: [\"serverless\", \"pluginManager\"]\n };\n this.objects = { core: [], internal: [] };\n }", "title": "" }, { "docid": "10b05779288043eda12905e0fef031dd", "score": "0.50207794", "text": "function configure(config) {\n // Clone the config object, to allow multiple instantiations\n // without picking up prior ideogram's settings\n this.config = JSON.parse(JSON.stringify(config));\n\n configureMiscellaneous(this);\n configurePloidy(this);\n configureBands(this);\n configureHeight(this);\n configureWidth(this);\n configureMargin(this);\n configureCallbacks(config, this);\n configureOrganisms(config, this);\n configureBump(this);\n configureSingleChromosome(config, this);\n configureTextStyle(this);\n this.initAnnotSettings();\n if (!this.config.geometry || this.config.geometry === 'parallel') {\n this.config.chrMargin += this.config.chrWidth;\n if (this.config.annotationsLayout === 'heatmap') {\n this.config.chrMargin += this.config.annotTracksHeight;\n } else {\n this.config.chrMargin += this.config.annotTracksHeight * 2;\n }\n }\n this.init();\n}", "title": "" }, { "docid": "7bd719b1ea01b8ffaed552fe9012f5ee", "score": "0.500914", "text": "config() {\n this.router.get('/', jerarquiasController_1.jerarquiasController.list);\n this.router.get('/:id', jerarquiasController_1.jerarquiasController.getOne);\n this.router.post('/', jerarquiasController_1.jerarquiasController.create);\n this.router.delete('/:id', jerarquiasController_1.jerarquiasController.delete);\n this.router.put('/:id', jerarquiasController_1.jerarquiasController.update);\n }", "title": "" }, { "docid": "2ce0455dbc9ec10528311b511b3c6ab8", "score": "0.50062865", "text": "function Configuration() {\n _classCallCheck(this, Configuration);\n\n Configuration.initialize(this);\n }", "title": "" }, { "docid": "3046222e909782357aaa3d5ea34cbf51", "score": "0.50028276", "text": "function _configure(obj, cfg) {\n obj.configure(cfg);\n}", "title": "" }, { "docid": "a13f047e82599a69e4ab491f14d35407", "score": "0.49902278", "text": "function RecordsetIndexer(config) {\n RecordsetIndexer.superclass.constructor.apply(this, arguments);\n}", "title": "" }, { "docid": "c6c965dc92e6b698cccdfa578d0b3690", "score": "0.49822074", "text": "function Config() {}", "title": "" }, { "docid": "5da2d1566c15c3f7ec6b7f79f18801f9", "score": "0.49810883", "text": "function AS(config, definitions) {\n\tconsole.log('as:index.js definition begin'.help);\n\t//load config\n\t// config.environment = process.env.NODE_ENV || config.environment || 'production';\n\n\t// overlay environment over config\n\t// function applyOverlay(dest,src) {\n\t// \tif(!src) { return; }\n\t// \tfor(var i in src) {\n\t// \t\tif(dest[i] && typeof dest[i] === 'object' && src[i] && typeof src[i] === 'object' && dest[i].splice !== Array.prototype.splice) {\n\t// \t\t\tapplyOverlay(dest[i],src[i]);\n\t// \t\t} else {\n\t// \t\t\tdest[i] = src[i];\n\t// \t\t}\n\t// \t}\n\t// }\n\t// applyOverlay(config,config[config.environment]);\n\n\t// apply defaults\n\t// config.serverName = process.env.NODE_NAME || process.env.HOSTNAME || 'UNKNOWN';\n\t// if(config.serverName === 'UNKNOWN') {\n\t// \ttry {\n\t// \t\t// read hostname from /etc/hostname file if still unknown\n\t// \t\tconfig.serverName = require('fs').readFileSync('/etc/hostname','utf8')\n\t// \t\t\t.replace(/[\\n\\r\\0]+/g,'')\n\t// \t\t\t.replace(/[^a-zA-Z0-9]/g,'-');\n\t// \t}catch(e) {}\n\t// }\n\n\t// config.apiLevel = config.apiLevel || '0.0.0';\n\t// config.port = +process.env.NODE_PORT || +config.port || 80;\n\t// config.statsPort = +process.env.NODE_STATSPORT || +config.statsPort || (+config.port + 1);\n\n\t// redirect logs to files as specified in the config\n\t// require('./log').init(config);\n\n\t// initialise auth methods\n\t// var Auth = require('./auth');\n\t// config.authManager = new Auth();\n\t// config.authManager.init(config);\n\n\t// load and configure other modules\n\t// var Stats = require('./stats');\n\t// config.statsManager = new Stats();\n\t// config.statsManager.init(config);\n\n\t// load transport\n\tvar Transport = require('./transport');\n\tconfig.transportManager = new Transport();\n\tconfig.transportManager.init(config);\n\n\t// load sources\n\tvar SourceManager = require('./sourcemanager');\n\tconfig.sourceManager = new SourceManager();\n\tconfig.sourceManager.init(config, definitions);\n\n\n\t// init api server\n\tvar APIServer = require('./apiserver');\n\tconfig.apiServer = new APIServer(config, function(){\n\t\t// if(process.getuid() === 0 && config.webUser) {\n\t\t// \tconsole.log(\"Dropping privs\");\n\t\t// \tprocess.setgroups([config.webGroup || config.webUser]);\n\t\t// \tprocess.setgid(config.webGroup || config.webUser);\n\t\t// \tprocess.setuid(config.webUser);\n\t\t// }\n\t});\n\n\n\t// precache some sources specified in the config\n\t// if(config.precache) {\n\t// \tfor(var i=0; i<config.precache.length; i++){\n\t// \t\tconfig.sourceManager.precache(config.precache[i]);\n\t// \t}\n\t// }\n\n\n\t// add uncaught exception handler\n\t// process.on('uncaughtException', function(e){\n\t// \te.kind = e.kind || 'uncaught';\n\t// \tconsole.error('Uncaught Exception, shutting down...');\n\t// \tconsole.error('Uncaught Exception:', e);\n\t// \ttry{\n\t// \t\t// try server shutdown\n\t// \t\tconfig.apiServer.shutdown(function(){\n\t// \t\t\t// when done or on timeout exit the process\n\t// \t\t\tconsole.error('Server terminating!');\n\t// \t\t\tconsole.error('Uncaught Exception:', e);\n\t// \t\t\tconsole.original.error('Uncaught Exception:', e);\n\t// \t\t\tsetTimeout(function(){\n\t// \t\t\t\tprocess.exit(-1);\n\t// \t\t\t},2000);\n\t// \t\t}, 20000);\n\t// \t} catch(se) {\n\t// \t\tse.kind = se.kind || 'uncaught';\n\t// \t\tconsole.error('Server terminating!');\n\t// \t\tconsole.error('Uncaught Exception:', e);\n\t// \t\tconsole.original.error('Uncaught Exception:', e);\n\t// \t\tconsole.error('Shutdown error:', se);\n\t// \t\tconsole.original.error('Shutdown error:', se);\n\t// \t\tsetTimeout(function(){\n\t// \t\t\tprocess.exit(-1);\n\t// \t\t},2000);\n\t// \t}\n\t// });\n\tconsole.log('as:index.js definition end'.help);\n\n}", "title": "" }, { "docid": "5440485154a517e85df8205a4afe5e1f", "score": "0.49615338", "text": "function es() {\n throw new Error('Looks like you are expecting the previous \"elasticsearch\" module. ' +\n 'It is now the \"es\" module. To create a client with this module use ' +\n '`new es.Client(params)`.');\n}", "title": "" }, { "docid": "5440485154a517e85df8205a4afe5e1f", "score": "0.49615338", "text": "function es() {\n throw new Error('Looks like you are expecting the previous \"elasticsearch\" module. ' +\n 'It is now the \"es\" module. To create a client with this module use ' +\n '`new es.Client(params)`.');\n}", "title": "" }, { "docid": "5440485154a517e85df8205a4afe5e1f", "score": "0.49615338", "text": "function es() {\n throw new Error('Looks like you are expecting the previous \"elasticsearch\" module. ' +\n 'It is now the \"es\" module. To create a client with this module use ' +\n '`new es.Client(params)`.');\n}", "title": "" }, { "docid": "5440485154a517e85df8205a4afe5e1f", "score": "0.49615338", "text": "function es() {\n throw new Error('Looks like you are expecting the previous \"elasticsearch\" module. ' +\n 'It is now the \"es\" module. To create a client with this module use ' +\n '`new es.Client(params)`.');\n}", "title": "" }, { "docid": "e8a3f553a9e71ffbe41306dcc729211e", "score": "0.49431106", "text": "function config () {\n return {}\n}", "title": "" }, { "docid": "b5592bfb0289d465bd0a1b6082ee177d", "score": "0.49383157", "text": "configuring() {\n\n\n }", "title": "" }, { "docid": "024570e82d874430708b3c408ba1344f", "score": "0.4935245", "text": "function config(conf) {\n angular.extend(configuration, {\n hostName:\"\",\n pathName:\"/rpc2\",\n 500:function(){},\n 401:function(){},\n 404:function(){}\n }, conf);\n }", "title": "" }, { "docid": "9494a115b1c3cf439bbd78ad5dd5564a", "score": "0.49251625", "text": "function Config() { }", "title": "" }, { "docid": "9494a115b1c3cf439bbd78ad5dd5564a", "score": "0.49251625", "text": "function Config() { }", "title": "" }, { "docid": "e6c14734043d8e3048e2d8f394806701", "score": "0.48899975", "text": "constructor (config) {\n this.config = config;\n }", "title": "" }, { "docid": "b1ec8f518a51d66a9d86c17506b66c94", "score": "0.48672068", "text": "startConfigure() {}", "title": "" }, { "docid": "7a94e4e97cc393e1fbf0cc0dc7398c53", "score": "0.48630622", "text": "updateConfig(config) {\n return; /*\n this.settings.value = config;\n this.emit(\"config\", config);\n if (this.config.tslint.useLint) this.linter = new Linter(this);\n this.settings.store();\n this.iSense.setSettings(this.config.compiler, this.config.codeFormat);\n */\n }", "title": "" }, { "docid": "4b655ef9f5f1645ec9034d1558ef5ae4", "score": "0.48480308", "text": "set configuration (value) {\n this._configuration = _.defaultsDeep(value, defaultConfiguration)\n this._axios = axios.create({\n baseURL: this._configuration.backendURL,\n timeout: this._configuration.timeout,\n withCredentials: true\n })\n }", "title": "" }, { "docid": "9fbadd6cad576523b46e3a9902ed1f3f", "score": "0.4827566", "text": "onConfiguring(){\n this.debug(\"AD_Configuring\");\n this.adService.configureAd(this);\n this.resolve(\"configured\");\n }", "title": "" }, { "docid": "7dce0a4438925c589c7316b5a113c5b0", "score": "0.48219216", "text": "constructor (config) {\n this._config = config;\n }", "title": "" }, { "docid": "b9359b45bd02826eddbd1b1a6733dcf2", "score": "0.48122323", "text": "constructor(config){ super(config) }", "title": "" }, { "docid": "b9359b45bd02826eddbd1b1a6733dcf2", "score": "0.48122323", "text": "constructor(config){ super(config) }", "title": "" }, { "docid": "dce5ba30fa7a9587b1f181859c1507a2", "score": "0.48113298", "text": "setConfig(config) {\r\n this.config = config\r\n }", "title": "" }, { "docid": "8487ddf03820f6b8c51dc696f117b6d0", "score": "0.48042423", "text": "function indexConfigurationExists() {\r\n return elasticClient.indices.exists({\r\n index: configuration\r\n });\r\n}", "title": "" }, { "docid": "f9f8dc7bf897824e6868ac46ba7dbba8", "score": "0.4801494", "text": "set config(configArray) {\n this._configObject = {};\n\n // build config object for faster checks\n configArray.forEach(config => {\n this._configObject[config[0] + config[1]] = { target: config[2], mapping: config[3] };\n });\n }", "title": "" }, { "docid": "e2e08c897e8340b96fd422701969401d", "score": "0.4782304", "text": "function config(configuration)\n {\n defaultConfiguration = angular.extend({}, defaultConfiguration, configuration);\n }", "title": "" }, { "docid": "2f83a8d8ad6f3e19cf2a8df736f7c75e", "score": "0.47722727", "text": "function Config() {\n}", "title": "" }, { "docid": "01708591eba88ac7d3695c0417acb832", "score": "0.476566", "text": "function configure(){\n config = (config === undefined)?{}:config;\n // for now we're limited to single-order markov chains\n config.order = 1\n\n }", "title": "" }, { "docid": "919e36e0d491327c7f8d49c9a941284e", "score": "0.47378516", "text": "function addingToElastic(sourceFilePath, handleError, done){\n\tvar elasticClient = new elasticDB.Client({\n\t\thost: process.env.ELASTIC_DB_HOST,\n\t\tlog: 'trace'\n\t});\n\n\t// ping Elastic server before sending data\n\telasticClient.ping({\n\t\t// ping usually has a 3000ms timeout\n\t\trequestTimeout: 1000\n\t}, function (error) {\n\t\tif (error) {handleError(new Error('ElasticSearch cluster is down @' + process.env.ELASTIC_DB_HOST));}\n\t\telse {\n\n\t\t\tvar myIndex = \"my_index-\" + Date.now();\n\n\t\t\t// Creating Index in DB\n\t\t\telasticClient.create({\tindex: myIndex, \n\t\t\t\t\t\t\t\t\ttype: \"myType\", \n\t\t\t\t\t\t\t\t\tid: 0, \n\t\t\t\t\t\t\t\t\tbody:{}\n\t\t\t\t\t\t\t\t} , function(error) {\n\t\t\t\tif (error){handleError(new Error('Index creation faild'));}\n\t\t\t\telse {\n\t\t\t\t\t// Configuring DB mapping for Grafana to link with @timeStamp\n\t\t\t\t\telasticClient.indices.putMapping({index: myIndex, type:\"myType\", body:ElasticMapping} , function(error){\n\t\t\t\t\t\tif (error){handleError(new Error('Mapping configuration faild'));}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Read JSON bulk file\n\t\t\t\t\t\t\tfs.readFile(sourceFilePath, 'utf8', function (error, data) {\n\t\t\t\t\t\t\t\tif (error) {handleError(new Error('Reading JSON file faild'));}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t// Adding bulk to DB\n\t\t\t\t\t\t\t\t\telasticClient.bulk({index: myIndex, type:\"myType\", body:data} , function(error){\n\t\t\t\t\t\t\t\t\t\tif (error){handleError(new Error('Mapping configuration faild'));}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t//Delete temporary file after reading it.\n\t\t\t\t\t\t\t\t\t\t\tfs.unlinkSync(sourceFilePath);\n\t\t\t\t\t\t\t\t\t\t\tdone('All is well\\n' + sourceFilePath);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "72627125373dee3ea8cbbeca6a3c4cbb", "score": "0.47240642", "text": "configure() {\n this.log('configure')\n this.addRouteMethods()\n return this\n }", "title": "" }, { "docid": "52a491ddc2c8ed416ca23b4ba017b731", "score": "0.47207674", "text": "function configurePackage(p) {\n // append services\n p.factory(require('./services/transforms/errorTagTransform'))\n\n // build navigation\n .processor(require('./processors/structuredParam'))\n\n // generate website\n .config(function(generateWebsiteProcessor) {\n generateWebsiteProcessor\n .locals('version', pkg.version)\n .locals('title', pkg.title)\n .locals('url', pkg.homepage);\n })\n\n // add filters\n .config(function(templateEngine, getInjectables) {\n templateEngine.filters = templateEngine.filters.concat(getInjectables([\n require('./rendering/filters/keys')\n ]));\n })\n\n // add more templates location\n .config(function(templateFinder) {\n templateFinder.templateFolders.unshift(path.resolve(__dirname, 'templates'));\n })\n\n // do not assume links to be absolute\n .config(function(checkAnchorLinksProcessor) {\n checkAnchorLinksProcessor.base = '/';\n })\n\n // \n .config(function(parseTagsProcessor, getInjectables) {\n getInjectables(require('./tag-defs')).forEach(function(v) {\n parseTagsProcessor.tagDefinitions.push(v);\n });\n })\n\n // setting readFilesProcessor configuration\n .config(function(computePathsProcessor, computeIdsProcessor, createDocMessage, getAliases) {\n\n computeIdsProcessor.idTemplates.push({\n docTypes: ['overview'],\n idTemplate: '${area}:${name}',\n getAliases: getAliases\n });\n\n computeIdsProcessor.idTemplates.push({\n docTypes: ['area'],\n idTemplate: '${docType}:${area}',\n getAliases: getAliases\n });\n\n computeIdsProcessor.idTemplates.push({\n docTypes: ['controller'],\n idTemplate: 'module:${module}.${docType}:${name}',\n getAliases: getAliases\n });\n\n computeIdsProcessor.idTemplates.push({\n docTypes: ['error'],\n idTemplate: 'module:${module}.${docType}:${name}',\n getAliases: getAliases\n });\n\n computeIdsProcessor.idTemplates.push({\n docTypes: ['factory'],\n idTemplate: 'module:${module}.${docType}:${name}',\n getAliases: getAliases\n });\n \n computeIdsProcessor.idTemplates.push({\n docTypes: ['component'],\n idTemplate: 'module:${module}.${docType}:${name}',\n getAliases: getAliases\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['component'],\n pathTemplate: '${area}/${module}/${docType}/${name}',\n outputPathTemplate: 'partials/${area}/${module}/${docType}/${name}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['area'],\n pathTemplate: '${area}',\n outputPathTemplate: 'partials/${area}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['controller'],\n pathTemplate: '${area}/${module}/${docType}/${name}',\n outputPathTemplate: 'partials/${area}/${module}/${docType}/${name}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['factory'],\n pathTemplate: '${area}/${module}/${docType}/${name}',\n outputPathTemplate: 'partials/${area}/${module}/${docType}/${name}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['error'],\n pathTemplate: '${area}/${module}/${name}',\n outputPathTemplate: 'partials/error/${module}/${name}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['module'],\n pathTemplate: '${area}/${name}',\n outputPathTemplate: 'partials/${path}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['overview'],\n pathTemplate: '${area}/${name}',\n/*\n getPath: function(doc) {\n var docPath = path.dirname(doc.fileInfo.relativePath);\n if (doc.fileInfo.baseName !== 'index') {\n docPath = path.join(docPath,\n doc.fileInfo.baseName);\n } else {\n return 'index';\n }\n return docPath;\n },\n*/\n// outputPathTemplate: 'partials/${path}.html'\n outputPathTemplate: 'partials/${area}/${name}.html'\n });\n\n computePathsProcessor.pathTemplates.push({\n docTypes: ['componentGroup'],\n pathTemplate: '${area}/${moduleName}/${groupType}',\n outputPathTemplate: 'partials/${area}/${moduleName}/${groupType}.html'\n });\n })\n // workaround for https://github.com/angular/dgeni-packages/issues/185\n .config(function (extractAccessTransform) {\n extractAccessTransform.allowedDocTypes.add(\"js\");\n });\n\n return p;\n}", "title": "" }, { "docid": "6201379df904303091b5de3294b6fe55", "score": "0.47204313", "text": "function swsElasticEmitter() {\n\n // Options\n this.options = null;\n\n this.es7 = false;\n this.es8 = true;\n\n this.indexBuffer = '';\n this.bufferCount = 0;\n this.lastFlush = 0;\n\n this.elasticURL = null;\n this.elasticURLBulk = null;\n this.elasticProto = null;\n this.elasticHostname = null;\n this.elasticPort = null;\n\n this.elasticUsername = null;\n this.elasticPassword = null;\n\n this.elasticsearchCert = null;\n this.elasticsearchKey = null\n\n this.indexPrefix = \"api-\";\n\n this.enabled = false;\n}", "title": "" }, { "docid": "9100aa9b5c6ec3b4a15731361a5052b5", "score": "0.47143346", "text": "function initConfig(config){config=config||{};// Do NOT use configMerge() for the data object because this method merges arrays\n// and so would change references to labels and datasets, preventing data updates.\nvar data=config.data=config.data||{};data.datasets=data.datasets||[];data.labels=data.labels||[];config.options=helpers.configMerge(defaults.global,defaults[config.type],config.options||{});return config;}", "title": "" }, { "docid": "9b533e317d6b2cb883bc31c1b1f1a765", "score": "0.4711516", "text": "configure(config) {\n this._level = LogLevelConverter_1.LogLevelConverter.toLogLevel(config.getAsObject(\"level\"), this._level);\n this._source = config.getAsStringWithDefault(\"source\", this._source);\n }", "title": "" }, { "docid": "18969203a311269d2dc2f5cf5258d296", "score": "0.4704447", "text": "setConfig(config) {\r\n Object.assign(this.config, config);\r\n // Set keys and username incase they have changed\r\n this.username = this.config.USERNAME;\r\n this.postingKey = this.config.POSTING_KEY;\r\n this.activeKey = this.config.ACTIVE_KEY;\r\n }", "title": "" }, { "docid": "d6f39c06418c6370a06b9dc39b1abc5a", "score": "0.46889362", "text": "set config(value) {\n this._config = value;\n }", "title": "" }, { "docid": "4d2ae13f48bbe15983153511c7c20dff", "score": "0.46697983", "text": "constructor(config) {\n this.config = config\n }", "title": "" }, { "docid": "f6a57a5e129cce1d8b5309b39e245ab9", "score": "0.4668982", "text": "configuration(index) {\n return new DataAwsMqBrokerConfiguration(this, 'configuration', index);\n }", "title": "" }, { "docid": "9e3e6c24318fc8997dd3a3ecf2f108f4", "score": "0.46621203", "text": "function setupSearch(lunrData) {\n console.log('Creating search index.');\n // Set up the index, store it and the map in two vars defined up top.\n // The index is used to make searches, the map is used to retrieve information\n // about a result. This information is what's specified as \"stored\" in\n // config.rb's `activate :search` block.\n lunrIndex = lunr.Index.load(lunrData.index);\n lunrMap = lunrData.docs;\n\n // We move the element with id `search` up in its DOM hierarchy and remove the\n // search result group, a bootstrap element that shows the user the index is\n // still being downloaded.\n // $('#search').unwrap();\n // $('#search-result-group').remove();\n\n // We now bind the keyup event to an anonymous function, invoked whenever the\n // user presses a key. We also trigger `keyup()` immediately, in case the user\n // has typed a query before the index download has completed (see .keyup() at\n // the end of this function call).\n // $(\".search__input\")\n $(\"#search\")\n .bind(\"keyup\", function() {\n // Every time, we clear the div with class `search-results`.\n $(\".search-results\").empty();\n\n var query = $(this).val();\n\n // We only want to search for queries that are more than two characters long.\n if (query.length <= 2) {\n return;\n }\n\n // Peform the search.\n var results = lunrIndex.search(query);\n\n // Show 'no results' if the results are empty.\n if (results.length == 0) {\n $(\".search-results\").append('<p id=\"noresult\">No results.</p>');\n } else {\n // For each result, execute this anyonymous function.\n $.each(results, function(index, result) {\n // Retrieve the page that is represented by the result.\n page = lunrMap[result.ref];\n\n // Extract the date using a regular expression and format according to\n // the following date format options.\n var dateOptions = { year: \"numeric\", month: \"long\", day: \"numeric\" };\n date = new Date(page.date.match(/\\d{4}-\\d{2}-\\d{2}/)).toLocaleDateString(\"en-US\", dateOptions);\n\n // Find the `search-results` div and append the following DOM elements.\n // Ideally this would use Handlebars or some other client-side template\n // library instead of raw string concatenation.\n $(\".search-results\").append('<div class=\"result\">' + '<a href=\"' + page.url + '\">' + page.title + \"</a> &nbsp; \" + '<div class=\"post-meta\">' + date + \"</div>\" + \"</div>\");\n });\n }\n })\n .keyup();\n}", "title": "" }, { "docid": "4a1f41f1a097b5ff437376106308d8a2", "score": "0.46563536", "text": "setConfig(config) {\n this.config = config\n }", "title": "" }, { "docid": "aa219013ee7631994d9e01a534545405", "score": "0.46482927", "text": "function updateSettingsWithAnalyzers(settings){\n\t \tanalyzers.forEach(function(analyzer){\n\t \t\tanalyzer.getSettings(settings);\n\t \t});\n\t }", "title": "" }, { "docid": "7e4d6e97f137f97a6ff911a65d771a6e", "score": "0.46470565", "text": "async loadConfig() {\n const configLoader = new config_1.default(this.logger);\n const userConfig = await configLoader.loadConfig();\n this.logger.verbose.success(\"Loaded `auto` with config:\", userConfig);\n // Allow plugins to be overriden for testing\n this.config = Object.assign(Object.assign({}, userConfig), { plugins: this.options.plugins || userConfig.plugins });\n this.loadPlugins(this.config);\n this.loadDefaultBehavior();\n this.config = this.hooks.modifyConfig.call(this.config);\n this.labels = this.config.labels;\n this.semVerLabels = release_1.getVersionMap(this.config.labels);\n await this.hooks.beforeRun.promise(this.config);\n const errors = [\n ...(await validate_config_1.validateAutoRc(this.config)),\n ...(await validate_config_1.validatePlugins(this.hooks.validateConfig, this.config)),\n ];\n if (errors.length) {\n this.logger.log.error(endent_1.default `\n Found configuration errors:\n \n ${errors.map(validate_config_1.formatError).join(\"\\n\")}\n `, \"\\n\");\n this.logger.log.warn(\"These errors are for the fully loaded configuration (this is why some paths might seem off).\");\n if (this.config.extends) {\n this.logger.log.warn(\"Some errors might originate from an extend config.\");\n }\n process.exit(1);\n }\n const config = Object.assign(Object.assign(Object.assign({}, this.config), omit_1.omit(this.options, [\"_command\", \"_all\", \"main\"])), { baseBranch: this.config.baseBranch || this.baseBranch });\n this.config = config;\n this.baseBranch = config.baseBranch;\n const repository = await this.getRepo(config);\n const token = (repository === null || repository === void 0 ? void 0 : repository.token) || process.env.GH_TOKEN || process.env.GITHUB_TOKEN;\n if (!token || token === \"undefined\") {\n this.logger.log.error(\"No GitHub was found. Make sure it is available on process.env.GH_TOKEN.\");\n throw new Error(\"GitHub token not found!\");\n }\n const githubOptions = Object.assign(Object.assign({ owner: config.owner, repo: config.repo }, repository), { token, agent: proxyUrl ? https_proxy_agent_1.default(proxyUrl) : undefined, baseUrl: config.githubApi, graphqlBaseUrl: config.githubGraphqlApi });\n this.git = this.startGit(githubOptions);\n this.release = new release_1.default(this.git, config, this.logger);\n this.remote = await this.getRemote();\n this.logger.verbose.info(`Using remote: ${this.remote.replace(token, `****${token.slice(-4)}`)}`);\n this.hooks.onCreateRelease.call(this.release);\n return config;\n }", "title": "" }, { "docid": "dc1767f8bf97aea5bb27d1ff29170406", "score": "0.46467865", "text": "function configure(type, settings) {\n\t\tif (typeof settings === 'object') {\n\t\t\t// process both objects and arrays\n\t\t\t(settings instanceof Array ? settings : Object.keys(settings))\n\t\t\t\t.forEach(function(key) {\n\t\t\t\t\tregister(type, key, key in settings ? settings[key] : undefined);\n\t\t\t\t});\n\t\t}\n\t\telse {\n\t\t\t// process simple strings\n\t\t\tregister(type, settings);\n\t\t}\n\t}", "title": "" }, { "docid": "f7d404a18c9788f498e8b998f564ae2c", "score": "0.4623902", "text": "config() {\n this.router.get('/', medicosDomiciliosController_1.medicosDomiciliosController.list);\n this.router.get('/:id', medicosDomiciliosController_1.medicosDomiciliosController.getOne);\n this.router.post('/', medicosDomiciliosController_1.medicosDomiciliosController.create);\n this.router.delete('/:id', medicosDomiciliosController_1.medicosDomiciliosController.delete);\n this.router.put('/:id', medicosDomiciliosController_1.medicosDomiciliosController.update);\n }", "title": "" }, { "docid": "7b2ad5e26d7d45d44e086f9390dd0279", "score": "0.46191567", "text": "init (config) {\n\t\tif (typeof config === 'function' && config.name === \"knex\") {\n\t\t\tconfig.client.config.postProcessResponse = this.processResponse;\n\t\t\tthis.knex = config;\n\t\t} else {\n\t\t\tthis.knex = require('knex')({\n\t\t\t\t...config,\n\t\t\t \tpostProcessResponse: this.processResponse\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e61a40d9106e3407d12b87b965fafefd", "score": "0.46136537", "text": "constructor() {\n \tthis.config = config.api;\n }", "title": "" }, { "docid": "be191cc0a6b9d45f40da3e7858c9c3b6", "score": "0.4609559", "text": "function ArticleTypeIndex() {}", "title": "" }, { "docid": "8e6eb9aa5789fa570d6b819971dff70d", "score": "0.4608969", "text": "function config() {\n\tvar internalConfig = {};\n\n\tvar service = {\n\t\tget: get,\n\t\tset: set,\n\t};\n\n\t// -------------\n\n\tfunction get( key ) {\n\t\treturn internalConfig[ key ];\n\t}\n\n\tfunction set( key, value ) {\n\t\tinternalConfig[ key ] = value;\n\t}\n}", "title": "" }, { "docid": "27a23bde8592b4b02124b54ff18771c5", "score": "0.46083426", "text": "function deleteConfigurationIndex() {\r\n return elasticClient.indices.delete({\r\n index: configuration\r\n });\r\n}", "title": "" }, { "docid": "68af56c04a7c952dc464dc64a50e9883", "score": "0.4606982", "text": "function initSponsoredContentIndex() {\r\n return elasticClient.indices.create({\r\n index: sponsoredContent\r\n });\r\n}", "title": "" }, { "docid": "234306aab595589645c0321f6d5b33f1", "score": "0.46066138", "text": "constructor(config) {\n\n this.config = config;\n\n }", "title": "" }, { "docid": "234306aab595589645c0321f6d5b33f1", "score": "0.46066138", "text": "constructor(config) {\n\n this.config = config;\n\n }", "title": "" }, { "docid": "da9fcc457508ef599b28c7cc93d38003", "score": "0.4600824", "text": "function _configLoggers() {\n for (var name in _loggers) {\n _configLogger(_loggers[name])\n }\n}", "title": "" } ]
e4e971c8809169bac391d7c9ebb2256b
closeServer(): Stops the listening thread.
[ { "docid": "3835c99eee37a4c5945b436965a96d9e", "score": "0.8234668", "text": "closeServer() {\n this.server.close();\n this.isListening = false;\n }", "title": "" } ]
[ { "docid": "eda4eadda8310309ba487c1f55fd5ae0", "score": "0.8252692", "text": "stopServer() {\n if (this.server) {\n this.server.close();\n }\n }", "title": "" }, { "docid": "204f38698a3388446a1c80e99195970c", "score": "0.8014057", "text": "stop()\n {\n this.server.close();\n }", "title": "" }, { "docid": "0aab51611b255d88b4a27bcfd838ace3", "score": "0.7886322", "text": "stopServer() {\n this.server && this.server.close();\n }", "title": "" }, { "docid": "70aac13f8f26d7c33d7db197deebd44a", "score": "0.76480764", "text": "stopServer()\n {\n if(this.server)\n {\n this.server.close();\n for (var key in this.peers)\n {\n this.peers[key].close();\n }\n this.peers = {};\n }\n }", "title": "" }, { "docid": "f8869902f6c522cf41ff00346a7bc561", "score": "0.7168149", "text": "stop(){\n for(let socket of this._sockets){\n socket.end();\n }\n this._sockets.clear();\n this._server.close();\n }", "title": "" }, { "docid": "e23b1f70817489d49a090c947442cae0", "score": "0.7114083", "text": "shutdown() {\n this.server.close();\n }", "title": "" }, { "docid": "87d675a1f81cc30b79496b6cdf500cdc", "score": "0.7052981", "text": "stop() {\n if (this.isRunning) {\n this.isRunning = false;\n Object.entries(this.connections).forEach(([id, connection]) => {\n connection[SOCKET_SYMBOL].close();\n delete this.connections[id];\n });\n this.server.close();\n }\n }", "title": "" }, { "docid": "9dcaa22288331b85a3cebd5ea6e59965", "score": "0.67391855", "text": "function stop(exec) {\n server.close(exec());\n}", "title": "" }, { "docid": "faa59b95f97da46641ac803d84ba8060", "score": "0.67054737", "text": "async stop() {\n if (!this.hModule.server) {\n throw Error('Failed to get server hModule');\n }\n await this.hModule.server.close();\n logger.info('Just closed express server');\n }", "title": "" }, { "docid": "868b53d9ead4200f3d852e519072b082", "score": "0.66880107", "text": "function shutdownLocalServer() {\n for (const socket of localServerSockets) {\n socket.destroy();\n }\n localServer.close(() => log.debug(\"Local server closed\"));\n}", "title": "" }, { "docid": "cc941c2c6e5f3634ee3c553cd77fcd5c", "score": "0.66516334", "text": "stop() {\n if (this._connection) {\n this._connection.close(1000);\n }\n this._webSocketServer = null;\n }", "title": "" }, { "docid": "2243121b886aaa2ec8ec1cc4e42dac15", "score": "0.65853584", "text": "function closeHandler() {\n server.send( 'closed' );\n}", "title": "" }, { "docid": "0c3d9ffb12390c9945fef86bb3cbf0f8", "score": "0.6576267", "text": "function stopServer(done) {\n instance.browser.exit()\n done()\n}", "title": "" }, { "docid": "263a8027b059a9b90d94ec9f1b93dfa4", "score": "0.65716", "text": "stop() {\n this.socket.close();\n }", "title": "" }, { "docid": "577b526e9d469b15098e6638ea1ee8f3", "score": "0.64750224", "text": "shutdown () {\n if (this.server) {\n debug('Shutting down...')\n this.server.close()\n } else {\n debug('Unable to shutdown... server not started?')\n }\n }", "title": "" }, { "docid": "b8ea28a8a118a957495c5fa1678c03b8", "score": "0.645747", "text": "stop() {\n this._logger.info(`worker ${this.worker} shutting down`);\n this.server.close();\n process.exit(0);\n }", "title": "" }, { "docid": "9d0f9f8e3eae0193a0f07dd1276ed7ea", "score": "0.64199865", "text": "stop() {\n\t\tthis.ws.close((err) => this.sendStatus({\n\t\t\tstatudID: 1,\n\t\t\tmessage: 'Server stopped',\n\t\t\terror: err\n\t\t}))\n\t}", "title": "" }, { "docid": "a52e5f3c1f479ec9a2724d19c253c9e3", "score": "0.6272035", "text": "function stopServer (err) {\n console.log(\"Server Error:\\n\" + err);\n process.exit(1);\n}", "title": "" }, { "docid": "348959f669149532b5bb48f85d45efc5", "score": "0.622629", "text": "stop() {\n this.ready = false;\n this.wsServer.clients.forEach((websocket) => {\n websocket.close();\n });\n\n this.wsServer.close();\n }", "title": "" }, { "docid": "be73782ce4b03fd0b46d155eaea4dd4c", "score": "0.61937875", "text": "stop() {\n this.servers.forEach(server => server.destroy());\n }", "title": "" }, { "docid": "72ec95ef8119cbb75dec71002311f3f4", "score": "0.6153179", "text": "function stopPythonServer() {\n $.get(\"assets/python/server/close_server.php\");\n }", "title": "" }, { "docid": "08fcc2206529bae06d5e4e0295349307", "score": "0.612747", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n this._closing = true;\n\n let closeMethod = 'end';\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "b8802040c75d241551bde56d617130da", "score": "0.6097918", "text": "async function exitHandler(options = {}) {\n await server\n .close()\n .then(() => {\n console.log('Server successfully closed')\n })\n .catch((e) => {\n console.error('Something went wrong closing the server', e.stack)\n })\n if (options.exit) process.exit()\n }", "title": "" }, { "docid": "fbb98d509e51589db73343fd77d37e3b", "score": "0.60762334", "text": "close() {\n this.sock.destroy()\n }", "title": "" }, { "docid": "be0ee38cc4ade888a57c77ab5b18d5dc", "score": "0.6071137", "text": "shutdown() {\n console.info('Closing the web server...');\n\n // Unsubscribe the SIGINT handler.\n process.removeListener('SIGINT', this._boundSigintHandler);\n\n // Clean-up the server.\n return Promise.all([\n this._stopServer(),\n this._stopDB()\n ])\n .then(() => {\n console.info('Web server shutdown complete.');\n process.exit(0);\n })\n .catch(err => {\n console.error('Shutdown error:', err);\n throw err;\n });\n }", "title": "" }, { "docid": "7788f9a3ed0f1e148e527807868414b0", "score": "0.60675216", "text": "function gracefulShutdown() {\n logger.log('Clean shutdown in progress...');\n server.close();\n}", "title": "" }, { "docid": "16ab4003a85c81f96b00800644b700dc", "score": "0.6041439", "text": "function closeServer() {\n\treturn new Promise((resolve, reject) => {\n\t\tconsole.log('Closing server');\n\t\tserver.close(err => {\n\t\t\tif (err) {\n\t\t\t\t//so we don't also call `resolve()`\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "3b2ddf0f8130c9b136c234563e8715da", "score": "0.60397273", "text": "async close() {\n this.server.close();\n await this.loggger.info(\"The application has been closed\");\n }", "title": "" }, { "docid": "5c1ba5021bb8f3bf1e9e7136c3d5e983", "score": "0.6034288", "text": "async deactivate() {\n this._disposable.dispose();\n this._serverManager.stopListening();\n await this._serverManager.stopAllServers();\n }", "title": "" }, { "docid": "a66e577033e2285311195b52e11f1a01", "score": "0.6010063", "text": "async function exitHandler(options = {}) {\n await server\n .close()\n .then(() => {\n logger.info('Server successfully closed');\n })\n .catch((e) => {\n logger.warn('Something went wrong closing the server', e.stack);\n });\n if (options.exit) process.exit();\n }", "title": "" }, { "docid": "4b5533d89c753bc8aed21fd5c5ebc551", "score": "0.5980003", "text": "stopListening () {\n\t}", "title": "" }, { "docid": "467930544f1e0fd35678ae50a78c7b24", "score": "0.5978745", "text": "stop() {\n this.client.end();\n }", "title": "" }, { "docid": "f626d35e2f6dd88a2e0ec11670924828", "score": "0.5967047", "text": "_closeControlSocket() {\n this._removeSocketListeners(this._socket);\n this._socket.on(\"error\", doNothing);\n this.send(\"QUIT\");\n this._closeSocket(this._socket);\n }", "title": "" }, { "docid": "0d6bc121a8810c881ac659ef95e56ca3", "score": "0.59510165", "text": "stopped() {\n this.connection.end();\n this.connection = null;\n }", "title": "" }, { "docid": "dd0dabc6d22c70bb1864856e2a05bc05", "score": "0.5938468", "text": "stop(cb) {\n\t\tif (this.isPaused || this.isRunning) {\n\t\t\tthis.client.quit(cb);\n\t\t\tthis.status = 'stopping';\n\t\t}\n\t\telse {\n\t\t\tthrow new Error('connection is already closing');\n\t\t}\n\t}", "title": "" }, { "docid": "518cf92492746dd4b4498b9cd6be8943", "score": "0.5934702", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n reject(err);\n // so we don't also call `resolve()`\n return;\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "518cf92492746dd4b4498b9cd6be8943", "score": "0.5934702", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n reject(err);\n // so we don't also call `resolve()`\n return;\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "b507b79444fdf53f58e0cbad563683f3", "score": "0.5929493", "text": "stop() {\n\t\tif (this.connection) {\n\t\t\tthis.connection.close();\n\t\t}\n\t}", "title": "" }, { "docid": "e1b8fb56fd6a34b0b6e5527d22e85bf8", "score": "0.5921425", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n reject(err);\n // so we don't also call `resolve()`\n return;\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "a913209c0928fcaf30c7811969de4331", "score": "0.5919832", "text": "function _shutdownServer(server) {\n debug('_shutdownServer');\n return new Promise((resolve, reject) => {\n server.close(err => {\n if (err) return reject(err);\n resolve();\n });\n })\n}", "title": "" }, { "docid": "917e99670198cc4b721383ebba78fc17", "score": "0.59035105", "text": "close() {\n debug('closing');\n clearInterval(this.intervalHandler);\n this.server && this.server.close();\n for(let sse of this.monitors) {\n sse.end();\n }\n }", "title": "" }, { "docid": "9a2990ab498e72d3a6e00f5a45436127", "score": "0.58985066", "text": "destroy () {\n if (this._socket !== null) {\n this._socket.removeAllListeners();\n this._socket.destroy();\n this._socket = null;\n }\n if (!this._end_emitted) {\n this.emit('end', this._close_code, this._close_reason);\n this._end_emitted = true;\n }\n }", "title": "" }, { "docid": "ddae5900309281085204bbc0234b1623", "score": "0.58736116", "text": "stopServer(host, port) {\n if (this.runAsNode) {\n if (!host) {\n host = 'http://127.0.0.1';\n }\n if (!port) {\n port = this.port;\n }\n const stopUrl = host + ':' + port + '/extra/LifecycleServlet?action=shutdown';\n const options = http_utils_1.initOptions(stopUrl, {});\n log.info(http_utils_1.curlCommand(options));\n return new Promise((resolve, _) => {\n const req = request(options);\n req.on('response', response => {\n response.on('end', () => {\n resolve();\n });\n });\n });\n }\n else if (this.seleniumProcess) {\n process.kill(this.seleniumProcess.pid);\n return Promise.resolve();\n }\n else {\n return Promise.reject('Could not stop the server, server is not running.');\n }\n }", "title": "" }, { "docid": "8cf666af537734727b1aed78e85d4261", "score": "0.5840634", "text": "close() {\n this._sock.close()\n }", "title": "" }, { "docid": "720858a05a8840d0cdbefb64febaedd0", "score": "0.57941276", "text": "function closeServer() {\n\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n })\n\n}", "title": "" }, { "docid": "fec46886594527fa3a19d9626961a06c", "score": "0.57920283", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "3291b8fd435f1b6ef9d132cf504fbf86", "score": "0.5790576", "text": "function stopListening() {\n clearInterval(timer);\n timer = null;\n pfio.deinit();\n }", "title": "" }, { "docid": "fc2f22df59780ff20b7e109b1ffe3b78", "score": "0.5775944", "text": "async function terminateServer(options) {\n const config = {\n headers: {\n 'Content-Type': 'application/json',\n }\n };\n const url = `http://localhost:${options.port}/api/app/close`;\n\n console.log(`Terminate server: ${url}`);\n await promiseExecution(axios.post(url, null, config));\n}", "title": "" }, { "docid": "3db27135d4a333b5b72a063f7a35942c", "score": "0.5762659", "text": "stop() {\n return Promise.all([\n super.stop(),\n this.transport.destroy(_values(this._connections)),\n new Promise(resolve => {\n this._httpServer.close(() => {\n resolve();\n });\n })\n ]);\n }", "title": "" }, { "docid": "66e29eee2602517152ae277c68c0557f", "score": "0.5754422", "text": "onClose()\n\t{\n\t\tconsole.log('AGI Server is closing. Stopping application.');\n\t\t// this shuts down the application\n\t\tprocess.exit();\n\t}", "title": "" }, { "docid": "0356f4e785a58aab9831fd8694e3af8e", "score": "0.5753673", "text": "stop() {\n storage.setStore(this.store);\n this.setState(HathorWallet.CLOSED);\n this.removeAllListeners();\n\n wallet.cleanWallet({ endConnection: false, connection: this.conn });\n\n this.serverInfo = null;\n this.firstConnection = true;\n this.walletStopped = true;\n\n // TODO Double check that we are properly cleaning things up.\n // See: https://github.com/HathorNetwork/hathor-wallet-headless/pull/1#discussion_r369859701\n this.conn.stop()\n }", "title": "" }, { "docid": "1ff69197423d3e906f0983ed4fd2ffdd", "score": "0.5744056", "text": "async stop() {\n log.info(\"stopping web server\");\n if (!httpHandle) {\n log.info(\"koa server is already stopped\");\n return;\n }\n return new Promise(function(resolve) {\n httpHandle.close(function() {\n log.info(\"koa server is stopped\");\n resolve();\n });\n });\n }", "title": "" }, { "docid": "f470eaeea9ebfd259196f715faba39bc", "score": "0.57329386", "text": "function close() {\n if (!client) {\n return;\n }\n if (client.connected) {\n client.end(true);\n }\n}", "title": "" }, { "docid": "1a0ae6410e885f2e71fbd3f92a99eadd", "score": "0.57268625", "text": "stopDiscovery() {\n this.log.debug('client.stopDiscovery()');\n clearInterval(this.discoveryTimer);\n this.discoveryTimer = null;\n if (this.isSocketBound) {\n this.isSocketBound = false;\n this.socket.close();\n }\n }", "title": "" }, { "docid": "53e7499180824eab52df5770b3626e16", "score": "0.57267255", "text": "function onExit() {\n console.log();\n app.get('hub').emit('destroy');\n var server = app.get('server');\n try{\n server.close();\n } catch(e) {}\n}", "title": "" }, { "docid": "ab34701d9eaafca6ffa1ce4bfe10d21d", "score": "0.57233673", "text": "function stop() {\n http.close();\n isRunning = false;\n }", "title": "" }, { "docid": "3b85fee5917101f928708b4bea060427", "score": "0.5714427", "text": "close() {\n\n if (this.heartbeatTimer) {\n clearInterval(this.heartbeatTimer)\n this.heartbeatTimer = null\n }\n \n if (this.socket) {\n this.socket.close()\n this.socket = null\n }\n\n }", "title": "" }, { "docid": "729a036ff3de8ee90d101bc2720f5323", "score": "0.5707091", "text": "function stopListening() {\n\tif (!state.listening) return EjsElectron // we're not listening; nothing to stop here\n\n\tprotocol.uninterceptProtocol('file')\n\tstate.listening = false\n\treturn EjsElectron\n}", "title": "" }, { "docid": "e0512979b8950dfdbc39d56256049004", "score": "0.5693327", "text": "function disconnectFromServer() {\n\t\n}", "title": "" }, { "docid": "cec3d7d0f73d3594a15e8ad9ea1154a3", "score": "0.56889147", "text": "function endSocket(thisSocket) {\n serverLog(`Ending socket connection on remote port: ${thisSocket.remotePort}\\ngoodbye ${thisSocket.userName}`);\n let index = activeSockets.findIndex ( socket => socket.remotePort === thisSocket.remotePort );\n thisSocket.end;\n activeSockets.splice ( index, 1 );\n}", "title": "" }, { "docid": "e9ef58972c0af1dad066555b55b52992", "score": "0.5683605", "text": "stop() {\n this.log('client called stop()');\n RNFMAudioPlayer.stop();\n }", "title": "" }, { "docid": "7578da2dbbfd448d90b408e7baf90772", "score": "0.5676557", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "7578da2dbbfd448d90b408e7baf90772", "score": "0.5676557", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "7578da2dbbfd448d90b408e7baf90772", "score": "0.5676557", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "92a3992b799a15d0164572371893ca90", "score": "0.56721973", "text": "function EndListening() {\n myDB.off(\"data\", HandleListening);\n isSyncing = false;\n isListening = false;\n }", "title": "" }, { "docid": "d9c121004c8d05903471b5549729a2a0", "score": "0.5668079", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "bb8b61c657f0b8ad2c232636099beed1", "score": "0.5667382", "text": "function closeServer() {\n\treturn new Promise((resolve, reject) => {\n\t\tmongoose.disconnect();\n\t\t//console.log('Closing server');\n\t\tserver.close(err => {\n\t\t\tconsole.error(err);\n\t\t\tif (err) {\n\t\t\t\treturn reject(err);\n\t\t\t}\n\t\t\tresolve();\n\t\t});\n\t})\n\t\t.catch(err =>{\n\t\t\treturn //console.log(err);\n\t\t});\n}", "title": "" }, { "docid": "1130a6cfbdaa30c35de108b9476c0733", "score": "0.56530017", "text": "function stop(force) {\n var options = getOptions();\n server.stop(force, options);\n }", "title": "" }, { "docid": "b1e773e087bbf5c19fcc030737f1e678", "score": "0.56518424", "text": "function exitHandler(options, err) {\n\tif(websocket && ws_opened) {\n\t\tvar message = { 'action': 'stop' };\n\t\twebsocket.send(JSON.stringify(message), function(){\n\t\t\twebsocket.close();\n\t\t});\n\t}\n\n\tif(micInstance) {\n\t\tmicInstance.stop();\n\t}\n\n if (options.cleanup) console.log('clean');\n if (err) console.log(err.stack);\n if (options.exit) process.exit();\n}", "title": "" }, { "docid": "ae217b4e53e1662ce823557794ae057d", "score": "0.564139", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "ae217b4e53e1662ce823557794ae057d", "score": "0.564139", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "ae217b4e53e1662ce823557794ae057d", "score": "0.564139", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "ae217b4e53e1662ce823557794ae057d", "score": "0.564139", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "821fc99c19fa9bed8654cc3ec1129e56", "score": "0.56383413", "text": "function closeConnection(socket) {\n _serverCurrentRequests--;\n socket.end();\n }", "title": "" }, { "docid": "c9a37495f3524fed44b1736c90402fc5", "score": "0.56254756", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "2c0b033a66d438de1ca0502dfa19a3ec", "score": "0.56235343", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if(err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "2c0b033a66d438de1ca0502dfa19a3ec", "score": "0.56235343", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if(err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "b96340b1c23f57e919de7701f75b7ee7", "score": "0.5617553", "text": "close() {\n this.socket.end();\n }", "title": "" }, { "docid": "138176c3e89b5cdf6183aa68340e254e", "score": "0.56095093", "text": "_IH_Socket_Close()\n {\n // Prevent any more writes to the socket\n this._Socket = undefined;\n // Emit a socked fatality event\n this._Event.emit(\"fatal\", (this._UUID != \"\") ? this._UUID : \"Socket has been terminated\");\n // [Debug]\n console.info(\"[Socket] Socket Connection has terminated\")\n }", "title": "" }, { "docid": "a993bc6ca0e09348f53c8cbb9c0899b1", "score": "0.56084275", "text": "function gracefulShutdown() {\n console.log('Received kill signal, shutting down gracefully.');\n server.close(() => {\n console.log('Closed out remaining connections.');\n process.exit();\n });\n // if after\n setTimeout(() => {\n console.error('Could not close connections in time, forcefully shutting down');\n process.exit();\n }, 10 * 1000);\n }", "title": "" }, { "docid": "5ccf3bfc98f731579ae295b67f593a6c", "score": "0.5604973", "text": "disconnect() {\n this._sock.close();\n }", "title": "" }, { "docid": "fb28b468c26e47ae447ba232e35cb446", "score": "0.5601053", "text": "socketClose() {\n debug('socket closed');\n this.socket = null;\n }", "title": "" }, { "docid": "37e701f67b780aa4c07de01e810374b4", "score": "0.5598375", "text": "quit() {\n this.transport.end();\n process.exit();\n }", "title": "" }, { "docid": "f171db0517c805a67b64559716bf13ea", "score": "0.5582903", "text": "disconnectServer() {\n let quitHandler = function(data) {\n if (data.target.response == 'goodbye') {\n console.log('Disconnected from the Prolog server');\n this.interface.connected = false;\n this.orchestrator.state.updateState(\"Server Disconnected\");\n }\n else {\n console.log('Could not disconnect to prolog server');\n }\n }\n\n if (this.connected) {\n this.getPrologRequest('quit', quitHandler);\n }\n else {\n console.log(\"Not connected to the server\");\n }\n }", "title": "" }, { "docid": "790e7e5c4e6cb3d222790f0489304036", "score": "0.55748093", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "790e7e5c4e6cb3d222790f0489304036", "score": "0.55748093", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "130629ab722b99352978a90e2eb78db9", "score": "0.55671495", "text": "stop() {\n\n if (this.socket) {\n\n const frames = ['', MDP.WORKER, MDP.DISCONNECT]\n\n this.log('Worker stopping, send disconnect', frames)\n\n this.socket.send(frames, 0, this.close.bind(this))\n\n }\n\n }", "title": "" }, { "docid": "c342636334da799ff1383cc821bff84a", "score": "0.5549976", "text": "destroy () {\n this.serv.close()\n for (let socket of this.sockets) {\n socket.destroy()\n }\n this.sockets = []\n }", "title": "" }, { "docid": "f6b6b47e2ec1b45981f554c8e32e20ee", "score": "0.55419445", "text": "function onServer( error, server ) {\n\t\t\tif ( error ) {\n\t\t\t\tassert.ok( false );\n\t\t\t}\n\t\t\tassert.ok( true );\n\t\t\tserver.close();\n\t\t\tdone();\n\t\t}", "title": "" }, { "docid": "d990947e1fd6f902b1285384c3784062", "score": "0.55313194", "text": "function onSocketFinish() {\n debug('onSocketFinish');\n if (this._readableState.ended) {\n debug('oSF: ended, destroy', this._readableState);\n return this.destroy();\n }\n\n debug('oSF: not ended, call shutdown()');\n\n // otherwise, just shutdown, or destroy() if not possible\n if (!this._handle || !this._handle.shutdown)\n return this.destroy();\n\n var shutdownReq = this._handle.shutdown();\n\n if (!shutdownReq)\n return this._destroy(errnoException(errno, 'shutdown'));\n\n shutdownReq.oncomplete = afterShutdown;\n}", "title": "" }, { "docid": "e48a1d0123190e510223c6b984dba028", "score": "0.55310136", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "ea99a522e9a1197d89bb01b1598df543", "score": "0.55263376", "text": "async stop () {\n await this.browser.close();\n await showroomServer.server().close();\n }", "title": "" }, { "docid": "c4b524785b4ff1be06d9e1e5987fdac6", "score": "0.55089444", "text": "function commandStopClientSide() {\r\n if (!clientSide) {\r\n logger.error(`Client Side server isn't running.`);\r\n return;\r\n }\r\n\r\n logger.log(`Stopping Client Side server...`);\r\n\r\n clientSide.stop(() => {\r\n clientSide = null;\r\n });\r\n}", "title": "" }, { "docid": "fbb7c495dd2febddabe27cd76ade1755", "score": "0.54977477", "text": "function deactivate(callback) {\n contextServer.stop(callback);\n}", "title": "" }, { "docid": "d2227476aceda97c752a9196b5bd1c0a", "score": "0.54966444", "text": "close() {\n localTunnelService.close(this._socket);\n }", "title": "" }, { "docid": "0043b9b2581be5421f1c800c6dc3c309", "score": "0.54868835", "text": "function shutDown() {\n app.database.close();\n console.log(\"Closing db connection\")\n app.server.close(() => {\n console.log('Terminating server');\n process.exit(0);\n });\n}", "title": "" }, { "docid": "78759df53463c6c1925209a02dfa969c", "score": "0.54759264", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n /* console.log('Closing server');*/\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n\n}", "title": "" }, { "docid": "4f51339994b82eff78dee92381669715", "score": "0.54657847", "text": "function closeTCPSocket() {\n console.log('Sending \"Close\" command to TCP server and closing TCP socket.');\n let msg = new DataContainer.DataContainer();\n msg.commandID = ServerCommandID.Close;\n sendMessage(msg, socket);\n socket.end();\n }", "title": "" }, { "docid": "b9ce2d86074fedd390be54a846b9d11d", "score": "0.5429651", "text": "async stop() {\n debug('Perform close connection');\n\n this.eioClient.close();\n delete this.eioClient;\n }", "title": "" }, { "docid": "ff3bd2b3d68d134593f0659619a460d7", "score": "0.54237026", "text": "function exitHandler(options, exitCode) {\n socket.end();\n if (options.cleanup) console.log('clean');\n if (exitCode || exitCode === 0) console.log(exitCode);\n if (options.exit) process.exit();\n }", "title": "" } ]
601ebd436a0674e07237b013e954b539
Called when a cell (td) is clicked
[ { "docid": "c18409aee35b493b2556466bd0cc6147", "score": "0.0", "text": "function cellClicked(elCell, i, j) {\n var currentCell = gBoard[i][j]\n if (currentCell.isShown || currentCell.isMarked) return\n\n var posI = i;\n var posJ = j;\n\n\n //first game\n if (!gGame.isOn) {\n //start game!\n gGame.isOn = true;\n gStartTime = Date.now();\n gTimerInterval = setInterval(gameTimer, 100);\n locateRndMinesOnBoard(i, j);\n checkMinePerCell();\n renderBoard();\n }\n\n currentCell.isShown = true;\n\n if (currentCell.isMine) {\n gGame.markedCount++\n gLevel.life -= 1\n }\n\n if (gLevel.life === 0) {\n gameOver();\n //show all mines\n for (var i = 0; i < gMines.length; i++) {\n gMines[i].isShown = true;\n }\n renderBoard();\n }\n\n //collect hints for future undo\n var hintCells = []\n\n //checking what cells it should present\n if ((currentCell.minesAroundCount === 0 || gIsHint) && (!currentCell.isMine)) {\n for (var i = posI - 1; i <= posI + 1; i++) {\n if (i < 0 || i >= gBoard.length) continue;\n for (var j = posJ - 1; j <= posJ + 1; j++) {\n if (j < 0 || j >= gBoard[0].length) continue;\n if (i === posI && j === posJ) continue;\n //if its a regular click\n if (!gBoard[i][j].isMine && !gIsHint && !gBoard[i][j].isMarked) {\n gBoard[i][j].isShown = true\n }\n //if its a hint click\n if (gIsHint && gBoard[i][j].isShown === false) {\n gBoard[i][j].isShown = true\n hintCells.push(gBoard[i][j])\n }\n\n }\n }\n\n }\n\n //Undo the hints\n if (gIsHint) {\n hintCells.push(currentCell)\n setTimeout(function () {\n undoHints(hintCells);\n }, 1000)\n }\n renderBoard();\n}", "title": "" } ]
[ { "docid": "4f17405dc8b9f1680e3c1475ec960b19", "score": "0.75839293", "text": "function handleHTMLCellClick(e) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget\n let idArray = e.currentTarget.id.split(\"-\");\n let row = Number(idArray[1]);\n let col = Number(idArray[2]);\n\n chess.handleCellSelected(row, col);\n}", "title": "" }, { "docid": "c515de701251e128e20d512d733205f2", "score": "0.74047476", "text": "function cellClicked(event){\n event.preventDefault(); // prevent right-click context menu\n $.get(\"/cellClicked\", {pid: window.pid, row: this.r, col: this.c, clickType: event.which}, function(response){\n var data = JSON.parse(response);\n if(data[\"groupClear\"]){ //If cell clicked == 0 cell, update all cells\n updateGrid(window.pid);\n }\n else if (data[\"value\"]!==void(0)) { // else update single cell if given a value\n var value = data[\"value\"]; //0-8 = num, 10 == bomb, flag == 10\n var r = data[\"row\"];\n var c = data[\"col\"];\n // set cell value\n var id = r.toString() + \"-\" + c.toString();\n $(\"#\"+id).text(value).removeClass().addClass(\"value\"+value)\n }\n });\n}", "title": "" }, { "docid": "771076d0acfbfe8c9d15581c2d0b0f04", "score": "0.73006314", "text": "function handleCellClick(clickedCellEvent) {\n //clicked html saved in a variable\n const clickedCell = clickedCellEvent.target;\n\n //grabbing 'data-cell-index' attribute from the clicked cell to identify where that cell is in our table.\n //**getAttribute will return a string value.We will parse it to an integer(number)\n const clickedCellIndex = parseInt(\n clickedCell.getAttribute(\"data-cell-index\")\n );\n\n //to ignore the click if cell has been clicked and game is paused\n if (gameState[clickedCellIndex] !== \"\" || !gameActive) {\n return;\n }\n //to proceed with the game\n handleCellPlayed(clickedCell, clickedCellIndex);\n handleResultValidation();\n}", "title": "" }, { "docid": "36d1b80b93ff48fb3aa979ed62e16064", "score": "0.71915716", "text": "function cellDblClicked() {\n changeColor()\n}", "title": "" }, { "docid": "3a8e52800df9e5bbcde459a7b09dfe13", "score": "0.716442", "text": "function tdDblClick(e) {\n self.onCellDblClick(e.target);\n }", "title": "" }, { "docid": "6f0cbc2b34d0783897f194275e45d3e8", "score": "0.71374965", "text": "_cellClicked(cell, event) {\n if (cell.enabled) {\n this.selectedValueChange.emit({ value: cell.value, event });\n }\n }", "title": "" }, { "docid": "6f0cbc2b34d0783897f194275e45d3e8", "score": "0.71374965", "text": "_cellClicked(cell, event) {\n if (cell.enabled) {\n this.selectedValueChange.emit({ value: cell.value, event });\n }\n }", "title": "" }, { "docid": "7f9cfa1a3e8735099a926bfc8a3af3cd", "score": "0.6993643", "text": "function cell_click(evt) {\n let cell_id = evt.srcElement.id;\n let id = cell_id.split(\"_\");\n let x = parseInt(id[0]);\n let y = parseInt(id[1]);\n\n switch (evt.which) {\n case LEFT:\n cell_on(x, y);\n break;\n case MIDDLE:\n cell_toggle(x, y);\n break;\n case RIGHT:\n cell_off(x, y);\n break;\n }\n return false;\n}", "title": "" }, { "docid": "f923345d029fde68bca4833e25603168", "score": "0.6924766", "text": "function clickOnCell() {\n const clickedCell = event.target;\n const clickedCellIndex = clickedCell.dataset.index;\n cellPlayed(clickedCell, clickedCellIndex);\n resultValidation();\n \n clickedCell.removeEventListener('click', clickOnCell);\n return;\n}", "title": "" }, { "docid": "b201c32cee981597ecef5c8d588ebb1e", "score": "0.6912576", "text": "function clickTable(tr, td, e) {\n\t\n\tif (td.attr('type') != null) {\n\t\n\t\t// COLOR\n\t\t$('#table tr td').css('color', '');\n\t\ttd.css('color', 'red');\n\t\t\n\t\t// OPEN INFO WINDOW\n\t\t//$('#floatWindow').fadeOut('fast');\n\t\t$('#floatWindow').css({top:e.pageY+20,left:e.pageX});\n\t\t$('#floatWindow').fadeIn('fast');\n\t\t\n\t\t// CLEAR INFO\n\t\t$('#textInfo').html('');\n\t\t\n\t\t// SHOW INFO\n\t\tshowInfo(td.attr('type'), td.attr('id'));\n\t}\n}", "title": "" }, { "docid": "79f707d88b094ad7630f741c10c9352a", "score": "0.6894365", "text": "function cellClick(clickedCellEvent) {\n\n const clickedCell = clickedCellEvent.target; // saves clicked html in a variable for future use\n\n const clickedCellIndex = parseInt(clickedCell.getAttribute('data-cell-index')); // grabs the 'data-cell-index' attribute from clicked cell\n if (board[clickedCellIndex] !== \"\" || !gameActive) { //checks if the cell has been clicked before or if the game has been paused. If true will ignore the click\n return;\n }\n cellPlayed(clickedCell, clickedCellIndex);\n resultValidation();\n}", "title": "" }, { "docid": "b90e481c6b19f1c783bdb57d561d98ab", "score": "0.6883354", "text": "function cellChange( row, col ) {\n var editing = editingCellInfo();\n if ( ! editing )\n return true;\n row += editing.row;\n if ( row >= 1 && row <= editing.rows )\n editing.row = row;\n col += editing.col;\n if ( col >= 1 && col <= editing.cols )\n editing.col = col;\n $(self.util.svgRoot).find('#'+editing.tabid+'_'+editing.row+'_'+editing.col).click();\n return false;\n }", "title": "" }, { "docid": "bd9d5891dd37cf5523404b0431d947c1", "score": "0.6872181", "text": "onElementClick(event) {\n const me = this,\n cellData = me.getEventData(event);\n\n // There is a cell\n if (cellData) {\n me.triggerCellMouseEvent('click', event);\n\n // Clear hover styling when clicking in a row to avoid having it stick around if you keyboard navigate\n // away from it\n // https://app.assembla.com/spaces/bryntum/tickets/5848\n DomDataStore.get(cellData.cellElement).row.removeCls('b-hover');\n }\n }", "title": "" }, { "docid": "8b77160ffcc9716bf4e322b1aede7dab", "score": "0.6867508", "text": "function ClickCell(ref) \n{\n _rcArray = ref.id.split('_');\n _currentCell = ref.id;\n ref.style.borderColor = \"#000\";\n document.getElementById(\"txtFilter\").value = _tblArray[_rcArray[0]][_rcArray[1]];\n document.getElementById(\"span\").innerHTML = \"Current Cell: \" + String.fromCharCode(64 + parseInt(_rcArray[1])) + _rcArray[0];\n}", "title": "" }, { "docid": "3a97ced7d573b2f8fa31206e28564020", "score": "0.6835114", "text": "cellClicked(event) {\n const target = event.target;\n if (target.classList.contains('cell')) {\n const col = parseInt(target.dataset.column);\n const row = parseInt(target.dataset.row);\n this.history[this.step][col][row] = !this.history[this.step][col][row];\n if (this.history[this.step][col][row]) {\n this.gridItems[col + (row * this.cols)].classList.add('alive');\n }\n else {\n this.gridItems[col + (row * this.cols)].classList.remove('alive');\n }\n }\n }", "title": "" }, { "docid": "060b6bed8e00c0879581cd090f37cef0", "score": "0.6803824", "text": "function handleCellClick(clickedCellEvent) {\n\n const clickedCell = clickedCellEvent.target;\n // below gives corresponding cell index\n const clickedCellIndex = parseInt(clickedCell.getAttribute('data-cell-index'));\n // delete this line to let the game decide if final clicked cell is a winner or draw?...\n\n if (gameState[clickedCellIndex] !== '') /* !== \"\" || !gameActive) */ {\n return;\n } \n\n // clickedCell = html, clickedCellIndex for the gameState[]\n handleCellPlayed(clickedCell, clickedCellIndex);\n handleResultValidation();\n}", "title": "" }, { "docid": "7d9dfd2a10e89e0cf8f9cf92c15f8625", "score": "0.6748462", "text": "function addClickHandlers(){\n var cells = document.getElementsByTagName(\"td\");\n var gridTable = document.getElementById(\"genGrid\");\n var cordDisp = document.getElementById(\"clickedCell\");\n \n\n for (i = 0; i < cells.length; i++){\n cells[i].onclick = function(){\n var html = '';\n var col = this.cellIndex;\n var row = this.parentNode.rowIndex;\n cell = gridTable.rows[row].cells[col];\n cell.style.backgroundColor = \"orange\";\n html += \"You clicked a cell! \"\n html += \"In programming notation the coordinates are: Column: \" + col + \" Row: \" + row;\n var engCol = col + 1;\n var engRow = row + 1;\n html += \" In english the coordinates are: Column: \" + engCol + \" Row: \" + engRow;\n cordDisp.innerHTML = html;\n }\n }\n}", "title": "" }, { "docid": "1342f51146f9291adcc0fb0df099fbf1", "score": "0.6740206", "text": "function clickCell(e) {\n // find cell that was clicked\n var clickedCell= $(e.target).closest(\"td\");\n\n // set starting cell if not set\n if (!start) {\n start = new Node(null, parseInt(clickedCell.attr(\"data-col\"), 10), parseInt(clickedCell.attr(\"data-row\"), 10), 0);\n\n // mark the starting cell with a green color\n clickedCell.addClass(\"start\");\n }\n // set ending cell if start has been set but not end\n else if (!end) {\n end = new Node(null, parseInt(clickedCell.attr(\"data-col\"), 10), parseInt(clickedCell.attr(\"data-row\"), 10), 0);\n\n // mark the ending cell with a red color\n clickedCell.addClass(\"end\");\n\n // calculate and display the shortest path\n $(\"#output\").html('Minimum hops required is: ' + findShortestPath());\n }\n}", "title": "" }, { "docid": "cfdbadb5faf66b5aed4e1ba1b3247310", "score": "0.6733116", "text": "function clickable(){\n var table = document.getElementById(\"table\"); // select the table\n var columns = table.getElementsByTagName('td'); // select al the `td` children of `table`\n for (i = 0; i < columns.length; i++) { // for each column\n if(columns[i].className == \"W\"){ // for each row, if the class is W (white)\n columns[i].addEventListener('click', mark); // set the event `addEventListener`\n // if the are others class inside the cell\n // (if the cell is already filled)\n // the click is denied\n }\n }\n}", "title": "" }, { "docid": "2bdf8fe4d0c1f68c55625250fe648010", "score": "0.6709072", "text": "function handleCellClick(clickedCellEvent) {\n const clickedCell = clickedCellEvent.target;\n // below gives corresponding cell index\n const clickedCellIndex = parseInt(clickedCell.getAttribute('data-cell-index'));\n\n\n // delete this line to make code run?...\n if (gameState[clickedCellIndex] !== '') /*|| !gameActive)*/ {\n return;\n } \n\n // clickedCell = html, clickedCellIndex for the gameState[]\n handleCellPlayed(clickedCell, clickedCellIndex);\n handleResultValidation();\n}", "title": "" }, { "docid": "551c03840a0ec6503a4b11df60441a10", "score": "0.6693162", "text": "onCellClick({\n grid,\n column,\n record,\n target\n }) {\n if (!target.classList.contains('b-action-item') || grid.readOnly) {\n return;\n }\n\n let actionIndex = target.dataset.index; // index may be set in a parent node if user used an html string in his custom renderer\n // and we take care to set this property to support onClick handler\n\n if (!actionIndex) {\n actionIndex = target.parentElement.dataset && target.parentElement.dataset.index;\n }\n\n const action = column.actions[actionIndex],\n actionHandler = action && action.onClick;\n\n if (actionHandler) {\n this.callback(actionHandler, column, [{\n record,\n action\n }]);\n }\n }", "title": "" }, { "docid": "722082686abae59e63e3ea9bea3259ee", "score": "0.6679315", "text": "onCellClick({ source: grid, record, cellSelector, cellElement, target, event }) {\n const selected = grid.focusedCell || {},\n column = grid.columns.getById(cellSelector.columnId);\n\n // Columns may provide their own handling of cell editing\n if (column.onCellClick) {\n column.onCellClick({ grid, column, record, cellSelector, cellElement, target, event });\n } else if (target.matches('.b-tree-expander')) {\n this.cancelEditing();\n return false;\n } else if (DomHelper.isTouchEvent && cellSelector.id == selected.id && cellSelector.columnId == selected.columnId) {\n this.startEditing(cellSelector);\n }\n }", "title": "" }, { "docid": "1866dc167fb255295e3cf1298a9ff472", "score": "0.6674625", "text": "function handleClickOnCell(event) {\n let cell = event.target;\n \n currentOnTurn = circleTurn ? CIRCLE : X;\n \n placeMark(cell, currentOnTurn); \n\n // check if have a winner Game is over!\n if (checkForWin(currentOnTurn)) { \n return endGame(false);\n } else if (isDraw()) {\n return endGame(true);\n } \n switchTurns();\n setHoverClass(); \n}", "title": "" }, { "docid": "3970ba962d8b20086439bc6e3bbfa4b5", "score": "0.6645886", "text": "cellOnClick(event) {\n console.log(\"Click on Cell: \", event.target.id);\n this.setState({\n sensorObject: rows[event.target.id]\n });\n this.handleOpen();\n }", "title": "" }, { "docid": "051ccdc94097c2128195c30917c6c722", "score": "0.6635341", "text": "onElementClick(event) {\n const me = this,\n cellData = me.getCellDataFromEvent(event); // There is a cell\n\n if (cellData) {\n me.triggerCellMouseEvent('click', event); // Clear hover styling when clicking in a row to avoid having it stick around if you keyboard navigate\n // away from it\n // https://app.assembla.com/spaces/bryntum/tickets/5848\n\n DomDataStore.get(cellData.cellElement).row.removeCls('b-hover');\n }\n }", "title": "" }, { "docid": "fdfe45d247f43648df353891d23e4736", "score": "0.65243137", "text": "function cellClicked(elCell, i, j) {\r\n if (!gGame.isOn) return;\r\n if (gGame.isFirstClick) {\r\n gGame.isOn = true;\r\n setMinesRand(gBoard, { i, j })\r\n setMinesNegsCount(gBoard)\r\n gGame.isFirstClick = false\r\n }\r\n if (gBoard[i][j].isShown) return;\r\n\r\n gBoard[i][j].isShown = true;\r\n elCell.innerText = gBoard[i][j].type;\r\n}", "title": "" }, { "docid": "155bc02a06e697cd3ac9eeb772411390", "score": "0.651006", "text": "onCellClick({\n source: grid,\n record,\n cellSelector,\n cellElement,\n target,\n event\n }) {\n const selected = grid.focusedCell || {},\n column = grid.columns.getById(cellSelector.columnId); // Columns may provide their own handling of cell editing\n\n if (column.onCellClick) {\n column.onCellClick({\n grid,\n column,\n record,\n cellSelector,\n cellElement,\n target,\n event\n });\n } else if (target.closest('.b-tree-expander')) {\n this.cancelEditing();\n return false;\n } else if (DomHelper.isTouchEvent && cellSelector.id == selected.id && cellSelector.columnId == selected.columnId) {\n this.startEditing(cellSelector);\n } else if (this.triggerEvent === 'cellclick') {\n this.onTriggerEditEvent({\n cellSelector\n });\n }\n }", "title": "" }, { "docid": "353b87ad8ac7f31efb4d879f6501494f", "score": "0.64713275", "text": "function handleCellClick(x, y, e) {\n console.log(`Cell clicked X: ${x}, Y: ${y}`);\n fetch(`${API_URL}/shoot`, {\n method: \"POST\", // *GET, POST, PUT, DELETE, etc.\n mode: \"cors\", // no-cors, cors, *same-origin\n cache: \"no-cache\", // *default, no-cache, reload, force-cache, only-if-cached\n credentials: \"same-origin\", // include, *same-origin, omit\n headers: {\n \"Content-Type\": \"application/json\",\n // \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n redirect: \"follow\", // manual, *follow, error\n referrer: \"no-referrer\", // no-referrer, *client\n body: JSON.stringify({x, y}),\n })\n .then(res => res.json())\n .then(data => {\n props.onUserDataUpdate(data);\n })\n .catch(e => {\n console.log('Error ' + e);\n })\n }", "title": "" }, { "docid": "3036a874831e1d2406cf92fe99b9db9c", "score": "0.6469569", "text": "_onClick(e){if(e.defaultPrevented){// Something has handled this click already, e. g., <vaadin-grid-sorter>\nreturn}const path=e.composedPath(),cell=path[path.indexOf(this.$.table)-3];if(!cell||-1<cell.getAttribute(\"part\").indexOf(\"details-cell\")){return}const cellContent=cell._content,activeElement=this.getRootNode().activeElement,cellContentHasFocus=cellContent.contains(activeElement)&&(// MSIE bug: flex children receive focus. Make type & attributes check.\n!this._ie||this._isFocusable(activeElement));if(!cellContentHasFocus&&!this._isFocusable(e.target)){this.dispatchEvent(new CustomEvent(\"cell-activate\",{detail:{model:this.__getRowModel(cell.parentElement)}}))}}", "title": "" }, { "docid": "0a77af0fce647ba48b2fe3af665d91f0", "score": "0.64444536", "text": "onRightClick( event ) {\r\n var cell = event.target.dataMine;\r\n this.flagCell(cell);\r\n event.preventDefault();\r\n }", "title": "" }, { "docid": "f847efae11428bf4654043f68586c1ca", "score": "0.64390886", "text": "function addCellEvents() {\n cells.forEach(function (cell) {\n cell.addEventListener(\"click\", cellEventListener);\n });\n}", "title": "" }, { "docid": "5e2ad2f4189ebdadaa3bcc575fc2b482", "score": "0.6414474", "text": "function getRowAndColumnIndex() {\n var td = document.getElementsByTagName(\"td\");\n for(var i = 0;i<td.length;i++){\n td[i].style.background = 'white';\n }\n rowindex = event.target.parentElement.rowIndex;\n columnindex = event.target.cellIndex;\n\n // show difference when a cell is selected, when clicking on a row title or a column title, the whole row or column will be different\n if(rowindex === 0){ // clicking on column title\n // event.target.style.background = 'lightgrey';\n var tchild = document.getElementById(\"tbody\").children;\n for(var i = 0; i < tchild.length; i++){\n tchild[i].children[columnindex].style.background = 'lightgrey';\n }\n } else if( columnindex === 0 ){ // clicking on row title\n var tchild = document.getElementById(\"tbody\").children[rowindex];\n for(var i = 0; i < tchild.children.length; i++){\n tchild.children[i].style.background = 'lightgrey';\n }\n } else {\n // event.target.style.background = 'lightgrey';\n\n }\n console.log(\"rowindex is \" + rowindex + \"; columnindex is \" + columnindex);\n}", "title": "" }, { "docid": "c1b335dbc1148b92b157deb91d0bfd69", "score": "0.63783705", "text": "clickHandler () {\n this.props.cellClick(this.props.keyy, this.props.turn);\n }", "title": "" }, { "docid": "7483f412a8bcac223f70355515d0179c", "score": "0.6364553", "text": "function clickme(){\n\t\t//pop up with a message when the table is clicked\n\t\talert('Hey, you clicked me!');\n\t}", "title": "" }, { "docid": "af92bcc53820daf77d2d06a124831fb1", "score": "0.6322789", "text": "function tableOnClick(x, y) {\n var newLife = !grid[y][x];\n grid[y][x] = newLife;\n var $td = $(\"#\" + x + \"x\" + y);\n if (newLife)\n $td.attr('class', 'live');\n else\n $td.attr('class', 'dead');\n }", "title": "" }, { "docid": "a3ef5a317810dff42e2b95570010e50f", "score": "0.63108253", "text": "function delegatedCellClick ( event ) {\n\n\t\t\tif ( ACTIVE_CELL && event.target === ACTIVE_CELL ) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tinterfaceClear();\n\t\t\t}\n\n\t\t\telse if ( isValidCellTarget(event.target) ) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\thandleClickOnValidCell(event.target);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7aef8222b7eed8b367befee1033889fe", "score": "0.63107294", "text": "function getCellPosition(){\r\n\tfor (var i = 0; i < squres.rows.length; i++) {\r\n\t\tfor (var j = 0; j < squres.rows[i].cells.length; j++) {\r\n\t\t\tsqures.rows[i].cells[j].onclick = function(){\r\n\t\t\t\tcurrentRow = this.parentElement.rowIndex;\r\n\t\t\t\tcurrentCol = this.cellIndex;\r\n\t\t\t\tprevCol = colPosition(currentCol);\r\n\t\t\t\tprevRow = rowPosition(currentRow);\r\n\t\t\t};\r\n\t\t\tconsole.log(\"click not working\");\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "cfc69154d97dcc5ff1eb1be264bf5add", "score": "0.62971854", "text": "function addClickEventToCells() {\n var cells = document.getElementsByClassName('cell');\n for (var i = 0; i < cells.length; i++) {\n cells[i].addEventListener(\"click\", function(event) {\n var chosenCell = event.target;\n chosenCell.style.backgroundColor = chosenColor;\n });\n }\n}", "title": "" }, { "docid": "68fbf6f67fdf1b7da75ef398b1e715d8", "score": "0.62681395", "text": "function cellClicked(elCell, i, j) {\n // doesn't let you click when game isn't active i.e when you win or get a game over\n if (!gGame.isOn) return;\n\n // starting timer on first click\n if (gFirstClicked === true) {\n // makes sure first click is not a bomb\n while (gBoard[i][j].isBomb) {\n init(gSize, gBombAmount);\n }\n // starts running the timer\n timer();\n\n gFirstClicked = false;\n }\n\n // stops user from unmarking a flagged cell\n if (gBoard[i][j].isFlagged) return;\n\n // In the case a hint was requested\n if (gIsHint) {\n hints(i, j); // displays the hint in this location\n gIsHint = false;\n elHintButton.style.removeProperty('background-color');\n return;\n }\n\n // when clicked an empty cell opens an expansion\n if (gBoard[i][j].neighBombs === EMPTY && !gBoard[i][j].isBomb) expandShown(gBoard, i, j);\n else revealCell(gBoard, i, j);\n\n // finishes game when bomb is clicked\n if (gBoard[i][j].isBomb) {\n var elBombs = document.querySelectorAll('.bomb.hide');\n for (let k = 0; k < elBombs.length; k++) {\n elBombs[k].classList.remove('hide');\n elBombs[k].innerHTML = BOMB;\n }\n gameOver(gBoard);\n }\n isWin(); // checks if game was won\n}", "title": "" }, { "docid": "15301fe1cd6d3cf12141b44596b26beb", "score": "0.6261663", "text": "function click(cell, col){\n //console.log(\"clicked cell # \"+cell.id);\n if(cell.hasValue)\n {\n alert(\"Cannot click here.\");\n return;\n }\n\n if(playerRed==true) //player red\n {\n\n let cellSelected=selectCell(cell, col); //finds next available cell at bottom of column and adds emoji to the board\n\n if(winChoice())\n {\n printWinner();\n return;\n }\n }\n else //player yellow\n {\n let cellSelected=selectCell(cell, col);\n\n if(winChoice())\n {\n printWinner();\n return;\n }\n }\n switchPlayer();\n}", "title": "" }, { "docid": "a3da5010713c769d67736ce856f455e8", "score": "0.6260869", "text": "clickEvent(event) {\n if (!event.target.classList.contains(\"cell\")) return;\n const cellElement = event.target;\n console.log(cellElement);\n console.log(\"Row Index:\", cellElement.dataset.rowIndex, \"| Column Index:\", cellElement.dataset.colIndex);\n const rowIndex = Number(cellElement.dataset.rowIndex);\n const colIndex = Number(cellElement.dataset.colIndex);\n const clickedCell = this.findCellByIndexes(rowIndex, colIndex);\n const neighborCells = this.findSurroundingCells(rowIndex, colIndex);\n\n // const clickedCellBelow = this.findCellByIndexes(rowIndex + 1, colIndex);\n // const clickedCellBelowLeft = this.findCellByIndexes(rowIndex + 1, colIndex - 1);\n // const clickedCellBelowRight = this.findCellByIndexes(rowIndex + 1, colIndex + 1);\n // const clickedCellLeft = this.findCellByIndexes(rowIndex, colIndex - 1);\n // const clickedCellTopLeft = this.findCellByIndexes(rowIndex - 1, colIndex - 1);\n // const clickedCellTopRight = this.findCellByIndexes(rowIndex - 1, colIndex + 1);\n // const clickedCellTop = this.findCellByIndexes(rowIndex - 1, colIndex);\n console.log(neighborCells, \"yeah\");\n console.log(\"index\", clickedCell);\n // console.log(\"index below\", clickedCellBelow);\n // console.log(\"index below right\", clickedCellBelowRight);\n // console.log(\"index top left\", clickedCellTopLeft);\n // console.log(\"index top\", clickedCellTop);\n }", "title": "" }, { "docid": "e63fd7a872314a7361dd8fa5780db17c", "score": "0.62541765", "text": "function toggleCell (e) {\n var xy = d3.mouse(this);\n var cell = [scaleDown(xy[0]), scaleDown(xy[1])];\n settings.population.toggleCell(cell);\n displayCells(settings.population.liveCells(), settings);\n\n function scaleDown (n) {\n return Math.floor(n / settings.cellSize);\n }\n }", "title": "" }, { "docid": "d727a5dd0467862952ce34d22af82781", "score": "0.6248227", "text": "function click() {\n\t// If clicking on a cell with your piece in it, highlight the cell\n\tif (!selectedBox) { // 1st click\n\t\tif ((!blueTurn && this.hasClassName(\"red\")) || (blueTurn && this.hasClassName(\"blue\"))) {\n\t\t\tthis.addClassName(\"selected\");\n\t\t\tselectedBox = this;\n\t\t}\n\t}\n\t\n\t// Player is trying to move a piece\n\telse { // 2nd click\n\t\tselectedBox.removeClassName(\"selected\");\n\t\tthis.onmouseout();\n\t\t\n\t\t// If there are forced jumps and player is not jumping, highlight forced jumps\n\t\tif (forcedJumps != false) {\n\t\t\tif (!jump(this)) {\n\t\t\t\thighlightForcedJumps(forcedJumps);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Try moving, then try jumping\n\t\telse if (!move(this))\n\t\t\tjump(this);\n\t\t\t\n\t\tselectedBox = null;\n\t\tcheckVictory();\n\t}\n}", "title": "" }, { "docid": "1ada0d0ed5506028a23864c2f46ff56f", "score": "0.62461406", "text": "function OnClick (event)\n{\n if (currSelCell == null)\n {\n currSelCell = event.target;\n event.target.style.backgroundColor = selectedColour;\n event.target.style.color = givenColour;\n }\n else\n {\n if (event.target == currSelCell)\n {\n if (currSelCell.getAttribute ('CellState') == 'error')\n event.target.style.backgroundColor = currSelCell.getAttribute ('ErrorBGColour');\n else\n event.target.style.backgroundColor = currSelCell.getAttribute ('OriginalBGColour');\n\n currSelCell = null;\n }\n else\n {\n if (currSelCell.getAttribute ('CellState') == 'error')\n currSelCell.style.backgroundColor = currSelCell.getAttribute ('ErrorBGColour');\n else\n currSelCell.style.backgroundColor = currSelCell.getAttribute ('OriginalBGColour');\n\n event.target.style.backgroundColor = selectedColour;\n currSelCell = event.target;\n } \n }\n}", "title": "" }, { "docid": "68fec9952465cbb481423e6ce0016540", "score": "0.6237175", "text": "function clickme(){\n //alert when the table is clicked\n\t\t alert('Hey, you clicked me!');\n\t ;\n\n\t $('table').on('click', clickme);\n\n }", "title": "" }, { "docid": "b04441a8b385aa5f88475368defc0c66", "score": "0.62263536", "text": "function HandleTblRowClicked(tr_clicked) {\n //console.log(\"=== HandleTblRowClicked\");\n //console.log( \"tr_clicked: \", tr_clicked, typeof tr_clicked);\n //console.log( \"tr_clicked.id: \", tr_clicked, typeof tr_clicked.id);\n\n// --- deselect all highlighted rows, select clicked row\n t_td_selected_toggle(tr_clicked, true); // select_single = True\n\n //const data_dicts = get_datadicts_from_selectedBtn();\n //const data_dict = (tr_clicked && tr_clicked.id && tr_clicked.id in data_dicts) ? data_dicts[tr_clicked.id]: null;\n //console.log( \" data_dict: \", data_dict);\n\n }", "title": "" }, { "docid": "c8b6b5e49ed03a4f543d2d70c14efcc7", "score": "0.62226653", "text": "function changeCell() {\n var clicked = document.getElementById(\"box\").click;\n if (clicked == true) {\n alert(\"box clicked\")\n document.getElementById(\"box\").background = colorSelected;\n }\n // mouse clicks on cell change to colorSelecetd value\n}", "title": "" }, { "docid": "7b064895d14d89fa989219212f9d7822", "score": "0.6218592", "text": "function onClick(event) {\n /* La variable t contient l'élément HTML sur lequel le clic a été\n fait. Notez qu'il ne s'agit pas forcément d'une case <td> du\n tableau */\n var t = event.target;\n\n // Attribut id de l'élément sur lequel le clic a été fait\n var id = \"\";\n\n // Si l'utilisateur clique sur un element qui n'est pas une case <td>,\n // ne rien faire\n if(t.nodeName.toLocaleLowerCase() == \"td\"){\n id = t.id;\n t.innerHTML = t.innerHTML == \"\" ? \"&#10004;\" : \"\";\n }\n}", "title": "" }, { "docid": "dbd648bbdc1fd48ac118e9fb059ffcd2", "score": "0.6215734", "text": "triggerCellMouseEvent(name, event) {\n const me = this,\n cellData = me.getCellDataFromEvent(event); // There is a cell\n\n if (cellData) {\n const column = me.columns.getById(cellData.columnId);\n me.trigger('cell' + StringHelper.capitalize(name), {\n grid: this,\n record: cellData.record,\n column,\n cellSelector: cellData.cellSelector,\n cellElement: cellData.cellElement,\n target: event.target,\n event\n });\n }\n }", "title": "" }, { "docid": "538d5f252bf94b6463481bc0180c225d", "score": "0.6211131", "text": "function cellClicked(elCell, i, j) {\r\n if (!gGameBoardCreated) {\r\n if (gManualModeOn && gManualMinesLeft > 0) {\r\n return positionMine(elCell, i, j);\r\n } else {\r\n gElManualSpan.innerText = ``;\r\n createGameBoard(i, j)\r\n }\r\n }\r\n if (!gStartTime) startGame();\r\n if (!gGame.isOn) return\r\n var cell = gBoard[i][j]\r\n if (cell.isMarked || cell.isShown) return\r\n if (gGame.isHintOn) {\r\n handleHint(i, j);\r\n return\r\n }\r\n if (cell.isMine) {\r\n cell.isShown = true;\r\n elCell.innerHTML = MINE;\r\n elCell.classList.add('shown');\r\n gGame.shownCount++;\r\n gGame.lives--;\r\n gElLives.innerText = gGame.lives;\r\n gMovesHistory.push({ location: { i, j }, isShown: true, userClicked: true });\r\n if (gGame.lives < 1) {\r\n revealAllMines();\r\n gameOver();\r\n }\r\n } else {\r\n expandShown(gBoard, elCell, i, j, userClicked = true)\r\n if (checkGameOver()) gameOver(WIN);\r\n }\r\n}", "title": "" }, { "docid": "2fce10edb600a9641bb02f2a141603ed", "score": "0.61918324", "text": "function cellRightClick() {\n\tcellClick(pointingAtX,pointingAtY, null);\n}", "title": "" }, { "docid": "bc0d8abcd729cf6f8a0738ff4581ec82", "score": "0.6185015", "text": "function onClickTableRow(event)\n{\n resetTableHighlights();\n var rowElement = event.currentTarget;\n document.selectedIndex = event.currentTarget.rowIndex;\n addRowHighlight(event);\n\n $(\"first_name_element\").value =rowElement.cells[FIRST_NAME_INDEX].innerHTML;\n $(\"last_name_element\").value =rowElement.cells[LAST_NAME_INDEX].innerHTML;\n $(\"phone_number_element\").value =rowElement.cells[PHONE_INDEX].innerHTML;\n $(\"email_element\").value =rowElement.cells[EMAIL_INDEX].innerHTML;\n $(\"age_element\").value =rowElement.cells[AGE_INDEX].innerHTML;\n $(\"id_element\").value =rowElement.cells[ID_INDEX].innerHTML;\n $(\"gender_element\").selectedIndex = getGender(rowElement.cells[GENDER_INDEX].innerHTML);\n\n disableDeleteButton(false);\n disableSaveButton(true);\n disableClearButton(false);\n document.selectedRow = rowElement;\n}", "title": "" }, { "docid": "d4288d3630cea11dd814550e451fd32e", "score": "0.61793333", "text": "triggerCellMouseEvent(name, event) {\n const me = this,\n cellData = me.getEventData(event);\n\n // There is a cell\n if (cellData) {\n const column = me.columns.getById(cellData.columnId);\n\n me.trigger('cell' + StringHelper.capitalizeFirstLetter(name), {\n grid: this,\n record: cellData.record,\n column,\n cellSelector: cellData.cellSelector,\n cellElement: cellData.cellElement,\n target: event.target,\n event\n });\n }\n }", "title": "" }, { "docid": "d1e343c5f09c4ff8ce6ef1a7194338a2", "score": "0.61788976", "text": "function checkSquare() {\n $(document).ready(function( ) {\n $(\"td\").bind(\"click\", function(){\n if ($(this).text() == \"X\"){\n alert(\"It has been selected!\");\n }\n if ($(this).text() == \"O\"){\n alert(\"It has been selected!\");\n }\n });\n });\n }", "title": "" }, { "docid": "3f68702fb9cf279f3e82f98fecef74e8", "score": "0.6167451", "text": "function cellClick(event) {\n // getting position of empty cell\n const emptyCell = getEmptyCell();\n const { target } = event;\n const targetClasses = target.className.split(' ');\n const position = targetClasses.find(name => /(x[1-4]y[1-4])/.test(name));\n // if block was not empty cell himself (empty cell don't have positioning class)\n if (position) {\n // position is string (e.g. x1y1) so we take x and y values from it and convert to number\n const x = Number(position[1]);\n const y = Number(position[3]);\n\n // check if clicked block is nearby empty cell\n if (\n ((x - 1 === emptyCell.x || x + 1 === emptyCell.x) && y === emptyCell.y)\n || ((y - 1 === emptyCell.y || y + 1 === emptyCell.y) && x === emptyCell.x)\n ) {\n // increase score and move clicked block to empty cell, check if game was won\n setScore(score + 1);\n target.classList.remove(position);\n target.classList.add(`x${emptyCell.x}y${emptyCell.y}`);\n checkWin();\n }\n }\n}", "title": "" }, { "docid": "6845d8784c466dccda0e56a3ed62c763", "score": "0.615442", "text": "function tabCell() {\n\tremoveHighlight(TABLE);\t\n\tif (CELL) {\n\t\thighlightCell(CELL);\n\t}\n}", "title": "" }, { "docid": "debdf4a5e072ba084c15cfb53c3b1ba2", "score": "0.6132137", "text": "function setTableCellElement(e){\n var iFld = (e.target)?e.target:e.srcElement;\n var cVal = iFld.value;\n var td = iFld.parentNode\n td.innerHTML= cVal\n}", "title": "" }, { "docid": "481da8a9b279afd1ace3ef7b561ded53", "score": "0.61296886", "text": "function handleCellClick(e, args){\n e.preventDefault();\n selctedCell = args;\n \tvar model = window.multiview.model;\n \tvar fields = model.fields;\n var fieldID = grid.getColumns()[selctedCell.cell].field;\n var model = window.multiview.model;\n selectedField = model.fields.get(fieldID); \n \n \tif(selectedField.get(\"hostsInterlinkingResults\")){\n \t\t// A context menu is loaded containing other alternatives\n \t\t//TODO: getting results with an AJAX call\n \t\t\n \t\tvar originalFieldId = fields.at(fields.indexOf(selectedField) - 1).id;\n var ul = $(\"#termsMenu\");\n ul.empty();\n var originalValue = model.records.at(selctedCell.row).get(similarityResults[originalFieldId].field)\n var bestResults = JSON.parse(similarityResults[originalFieldId].results[selctedCell.row].terms);\n\n ul.append('<b>Choices:</b>')\n ul.append('<li id=\"originalOption\">Original Value: ' + originalValue + '</li> <hr />')\n $.each(bestResults, function (idx, item){\n \tul.append('<li id=\"termOption\" term=\"' + item.term + '\" score=\"' + item.score + '\">' +\n \t\t item.term + \" (score: \"+ (item.score*100) +\"%)\" + \"</li>\");\n })\n ul.append('<hr /><li id=\"finalizeOption\">Finalize interlinking</li>');\n ul.append('<hr /><li id=\"abortOption\" class=\"abort\">Abort interlinking</li>');\n \n $(\"#termsMenu\")\n \t.css(\"top\", e.pageY)\n \t.css(\"left\", e.pageX)\n \t.show();\n \n \t$(\"body\").click(function(e) {\n \t if (!$(e.target).hasClass(\"slick-cell\")){\n \t \t$(\"#termsMenu\").hide();\n \t }\n \t});\n \n \t} else{\n $(\"body\").one(\"click\", function () {\n $(\"#termsMenu\").hide();\n });\n \t}\n \t\n }", "title": "" }, { "docid": "d904740adc078bef44ce251f1265beac", "score": "0.6129281", "text": "function onCanvasMouseDown(event) {\n window.mouseDown = true;\n clickCell(event.pageX, event.pageY);\n}", "title": "" }, { "docid": "f1f65ed1ffa15e1012017cd59061af31", "score": "0.6128908", "text": "addCellClickListener(callback) {\n this.cellClickListeners.push(callback);\n }", "title": "" }, { "docid": "0c74fe3d0c0632e783d154cfeda80ff1", "score": "0.61138046", "text": "function setCell(cell){\n cell.style.backgroundColor = \"white\"; //default white background\n\n //add eventlistener of click & change color\n cell.addEventListener(\"click\", function(evt){\n targetCell = evt.target;\n colorSelected = document.getElementById(\"selectedID\").value;\n targetCell.style.backgroundColor = colorSelected;\n });\n}", "title": "" }, { "docid": "15c25115894df1704290cf10193c8b63", "score": "0.6112082", "text": "function clickedCourse(){\n\t $(\"#course_table #rows\").click(function(e){\n\t \tvar course_id = $(this).find('td:eq(0)').text();\n\t \tcourseInfo(course_id);\n\t });\t\n\t}", "title": "" }, { "docid": "bf85e6d5eb1c0bd8317e981f2eeb38d2", "score": "0.6108039", "text": "function cellClicked(elCell) {\n if (!gGame.isOn) return; // Died / won? return\n\n let cellCoords = getCellCoord(elCell.id);\n let currCell = gBoard[cellCoords.i][cellCoords.j];\n if (currCell.isShown) return; // If already shown - do nothing\n\n // If hint mode is on, show hint\n if (gGame.isHintOn) {\n showHint(gBoard, cellCoords);\n return;\n }\n\n // If marked, do nothing (placed here to allow hint for marked cells)\n if (currCell.isMarked) return;\n\n // If clicked on a mine, end game and return\n if (gBoard[cellCoords.i][cellCoords.j].isMine) {\n clickedOnMine();\n return;\n }\n\n // If a cell is legit, reveal and expand it, check for victory\n if (gGame.revealedCount === 0) gameStart(cellCoords); // If first click, start the game!\n expandShown(gBoard, cellCoords);\n checkVictory();\n}", "title": "" }, { "docid": "321e9cad252f0edcd529d77b9812d91d", "score": "0.6099608", "text": "function cellClicked(elCell, i, j) {\n if (gState.isGameOn) {\n // build board data on first click\n if (!gState.markedCount){\n initMines(gBoard,i,j);\n setMinesNegsCount(gBoard); \n }\n if (!gBoard[i][j].isFlagged) {\n if (gBoard[i][j].isMine) {\n elCell.classList.add('mine','mark');\n } else {\n elCell.classList.add(getNumClass(gBoard[i][j].MineNegCnt));\n if (!elCell.classList.contains('mark')) {\n elCell.classList.add('mark');\n if (gState.markedCount === 0) gGameInterval = setInterval(updTime, 1000);\n gState.markedCount++;\n expandShown(gBoard, i, j);\n }\n }\n checkGameOver(i, j);\n }\n }\n}", "title": "" }, { "docid": "9f2e89658cc6fe1fa08e7751b35f9512", "score": "0.609337", "text": "handleClick(evt) {\n // get x from ID of clicked cell\n const x = +evt.target.id;\n\n // get next spot in column (if none, ignore click)\n const y = this.findSpotForCol(x);\n if (y === null) {\n return;\n }\n\n // place piece in board and add to HTML table\n this.board[y][x] = this.currPlayer;\n this.placeInTable(y, x);\n\n // check for win\n if (this.checkForWin()) {\n this.gameOver = true;\n return this.endGame(`${this.currPlayer.name} won!`);\n }\n\n // check for tie\n if (this.board.every(row => row.every(cell => cell))) {\n return this.endGame('Tie!');\n }\n\n // switch players\n this.currPlayer = this.currPlayer === this.players[0] ? this.players[1] : this.players[0];\n }", "title": "" }, { "docid": "6e7786eba54eb31ecf5bb9b1994f613a", "score": "0.60913736", "text": "function clickyClick (evt) {\n // get mouse coordinates relative to canvas\n var rect = canv.getBoundingClientRect();\n let x = evt.clientX - rect.left;\n let y = evt.clientY - rect.top;\n \n if (x >= 0 && x <= canvWidth && y >= 0 && y <= canvHeight) {\n \n let cellNumber;\n cellX = x + (cellSize - x % cellSize);\n cellY = y + (cellSize - y % cellSize);\n cellNumber = ((cellX / cellSize) - 1) + (((cellY / cellSize) - 1) * xCells);\n \n switch (input) {\n case 'click':\n singleClick (cellNumber);\n break;\n case 'glider':\n glider(cellNumber);\n break;\n case 'pulsar':\n pulsar(cellNumber);\n break;\n }\n\n fillCanvas();\n\n displayCells();\n }\n}", "title": "" }, { "docid": "ce9a738c37422bd4c2272aed6edf9255", "score": "0.6079096", "text": "function cellClicked(i, j) {\n if (gGame.isManualOn) {\n addMinesManually(i, j);\n return;\n }\n if (!gGame.shownCount && !gGame.isManualOn && !gManualMode) {\n gGame.isOn = true;\n beginGame(i, j);\n }\n if (gGame.isHintOn) {\n revealHint({ i: i, j: j });\n return;\n }\n updateState();\n if (!gBoard[i][j].isShown && gGame.isOn) {\n // gBoard[i][j].isShown = true;\n // gGame.shownCount++;\n recursiveOpenCells(i, j);\n }\n renderBoard(gBoard);\n if (gBoard[i][j].isMine) {\n gGame.lives--;\n document.querySelector('.lives').innerText = 'Lives: ' + gGame.lives;\n renderSmiley(false);\n if (!gGame.lives) {\n renderSmiley(false);\n finishGame(false);\n }\n }\n}", "title": "" }, { "docid": "d8c42d4888945cdac69b1bd3d49f0245", "score": "0.6078028", "text": "function addClickEventToCells() {\n var box = document.getElementsByClassName('cell');\n for (x = 0; x < box.length; x++) {\n box[x].addEventListener(\"click\", function(event) {\n var selectedBox = event.target;\n selectedBox.style.backgroundColor = selectedColor;\n });\n }\n}", "title": "" }, { "docid": "e41aef5d48b65a210424c8b64a973429", "score": "0.6073174", "text": "function attachCellClickListeners() {\n $.each(grid[0].rows, function(i, row) {\n $.each(row.cells, function(j, cell) {\n $(cell).click(function changeColor() {\n var color = color_input();\n $(this).css({backgroundColor: color});\n });\n });\n });\n}", "title": "" }, { "docid": "7c845d55ffd4e9db3b4717dfa1b23d24", "score": "0.6072611", "text": "function setCellClickHandlers(){\r\n\r\n\tvar cells = document.getElementsByTagName(\"td\");\r\n\r\n\tfor(var i = 0; i < cells.length; i++){\r\n\r\n\t\tcells[i].onclick = function(){\r\n\r\n\t\t\tvar row = this.dataset.row;\r\n\t\t\tvar col = this.dataset.column;\r\n\t\t\tvar gridTable = document.getElementsByTagName(\"table\")[0];\r\n\t\t\tvar cell = gridTable.rows[row].cells[col];\r\n\t\t\tdocument.getElementById(\"errorDiv\").innerHTML = \"\";\r\n\r\n\t\t\t//First click\r\n\t\t\tif(chipSelected == false){\r\n\r\n\t\t\t\t//Black turn\r\n\t\t\t\tif(gameState.turn == BLACK){\r\n\r\n\t\t\t\t\tif(this.dataset.checkChip == BLACK || this.dataset.checkChip == BLACKKING){\r\n\r\n\t\t\t\t\t\tprevColor = this.style.background;\r\n\t\t\t\t\t\tprevRow = row;\r\n\t\t\t\t\t\tprevCol = col;\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tprevChip = this.dataset.checkChip;\r\n\t\t\t\t\t\tthis.style.background = selectedColor;\r\n\t\t\t\t\t\tchipSelected = true;\r\n\t\t\t\t\t\t//Call chipPossMoves and store in firstClickPossMovesArr\r\n\t\t\t\t\t\tvar selectedChip = gameState.checkArr[this.dataset.row][this.dataset.column];\r\n\t\t\t\t\t\tfirstClickMovesArr = chipPossMoves(selectedChip, cell);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t//Error message\r\n\t\t\t\t\t\tdocument.getElementById(\"errorDiv\").innerHTML = \"ERROR: Please select a Black Chip\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Grey turn\r\n\t\t\t\telse{\r\n\r\n\t\t\t\t\tif(this.dataset.checkChip == GREY || this.dataset.checkChip == GREYKING){\r\n\r\n\t\t\t\t\t\tprevColor = this.style.background;\r\n\t\t\t\t\t\tprevRow = row;\r\n\t\t\t\t\t\tprevCol = col;\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tprevChip = this.dataset.checkChip;\r\n\t\t\t\t\t\tthis.style.background = selectedColor;\r\n\t\t\t\t\t\tchipSelected = true;\r\n\t\t\t\t\t\t//Call chipPossMoves and store in firstClickPossMovesArr\r\n\t\t\t\t\t\tvar selectedChip = gameState.checkArr[this.dataset.row][this.dataset.column];\r\n\t\t\t\t\t\tfirstClickMovesArr = chipPossMoves(selectedChip, cell);\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdocument.getElementById(\"errorDiv\").innerHTML = \"ERROR: Please select a Grey Chip\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Second click\r\n\t\t\telse{\r\n\r\n\t\t\t\t//Check to see if selected cell is in the firstClickPossMovesArr[]\r\n\t\t\t\tvar validMove = false;\r\n\t\t\t\tvar normMovesLength = firstClickMovesArr[0].length;\r\n\t\t\t\tvar jumpMovesLength = firstClickMovesArr[1].length;\r\n\r\n\t\t\t\tfor(var i = 0; i < normMovesLength; i++){\r\n\r\n\t\t\t\t\tif(firstClickMovesArr[0][i] == cell){\r\n\r\n\t\t\t\t\t\tvalidMove = true;\r\n\r\n\t\t\t\t\t\t//Black chip hitting King row\r\n\t\t\t\t\t\tif(cell.dataset.row == 7 && prevCell.dataset.checkChip == 1){\r\n\r\n\t\t\t\t\t\t\tcell.innerHTML = BLACKKINGDIV;\r\n\t\t\t\t\t\t\tprevCell.innerHTML = \"\";\r\n\t\t\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\t\t\tprevCell.dataset.checkChip = 0;\r\n\t\t\t\t\t\t\tthis.dataset.checkChip = BLACKKING;\r\n\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column] =\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column];\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column] = 0;\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column].king = true;\r\n\r\n\r\n\r\n\t\t\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t\t\t\tif(gameState.turn == BLACK) gameState.turn = GREY;\r\n\t\t\t\t\t\t\telse gameState.turn = BLACK;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Grey chip hitting King row\r\n\t\t\t\t\t\telse if(cell.dataset.row == 0 && prevCell.dataset.checkChip == 2){\r\n\r\n\t\t\t\t\t\t\tcell.innerHTML = GREYKINGDIV;\r\n\t\t\t\t\t\t\tprevCell.innerHTML = \"\";\r\n\t\t\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\t\t\tprevCell.dataset.checkChip = 0;\r\n\t\t\t\t\t\t\tthis.dataset.checkChip = GREYKING;\r\n\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column] =\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column];\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column] = 0;\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column].king = true;\r\n\r\n\r\n\t\t\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t\t\t\tif(gameState.turn == BLACK) gameState.turn = GREY;\r\n\t\t\t\t\t\t\telse gameState.turn = BLACK;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Normal movement\r\n\t\t\t\t\t\telse{\r\n\r\n\t\t\t\t\t\tcell.innerHTML = prevCell.innerHTML;\r\n\t\t\t\t\t\tprevCell.innerHTML = \"\";\r\n\t\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\t\tprevCell.dataset.checkChip = 0;\r\n\t\t\t\t\t\tthis.dataset.checkChip = prevChip;\r\n\r\n\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column] =\r\n\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column];\r\n\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column] = 0;\r\n\r\n\t\t\t\t\t\t//Need to update chipSelected no matter where they click\r\n\t\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t\t\tif(gameState.turn == BLACK) gameState.turn = GREY;\r\n\t\t\t\t\t\telse gameState.turn = BLACK;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//End for\r\n\r\n\t\t\t\t//Second for-loop to test jump cells\r\n\t\t\t\tfor(var i = 1; i < jumpMovesLength; i++){\r\n\r\n\t\t\t\t\tif(firstClickMovesArr[1][i] == cell){\r\n\r\n\t\t\t\t\t\tvalidMove = true;\r\n\r\n\t\t\t\t\t\t//Black chip jumping and hitting King row\r\n\t\t\t\t\t\tif(cell.dataset.row == 7 && prevCell.dataset.checkChip == 1){\r\n\r\n\t\t\t\t\t\t\tcell.innerHTML = BLACKKINGDIV;\r\n\t\t\t\t\t\t\tprevCell.innerHTML = \"\";\r\n\t\t\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\t\t\tprevCell.dataset.checkChip = 0;\r\n\t\t\t\t\t\t\tthis.dataset.checkChip = BLACKKING;\r\n\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column] =\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column];\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column] = 0;\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column].king = true;\r\n\r\n\t\t\t\t\t\t var currChip = gameState.checkArr[this.dataset.row][this.dataset.column];\r\n\t\t\t\t\t\t jump(firstClickMovesArr[1][i], firstClickMovesArr[1][i-1], currChip);\r\n\r\n\r\n\t\t\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t\t\t\tif(gameState.turn == BLACK) gameState.turn = GREY;\r\n\t\t\t\t\t\t\telse gameState.turn = BLACK;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Grey chip hitting King row\r\n\t\t\t\t\t\telse if(cell.dataset.row == 0 && prevCell.dataset.checkChip == 2){\r\n\r\n\t\t\t\t\t\t\tcell.innerHTML = GREYKINGDIV;\r\n\t\t\t\t\t\t\tprevCell.innerHTML = \"\";\r\n\t\t\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\t\t\tprevCell.dataset.checkChip = 0;\r\n\t\t\t\t\t\t\tthis.dataset.checkChip = GREYKING;\r\n\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column] =\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column];\r\n\t\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column] = 0;\r\n\t\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column].king = true;\r\n\r\n\t\t\t\t\t\t var currChip = gameState.checkArr[this.dataset.row][this.dataset.column];\r\n\t\t\t\t\t\t jump(firstClickMovesArr[1][i], firstClickMovesArr[1][i-1], currChip);\r\n\r\n\r\n\t\t\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t\t\t\tif(gameState.turn == BLACK) gameState.turn = GREY;\r\n\t\t\t\t\t\t\telse gameState.turn = BLACK;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Normal jump movement\r\n\t\t\t\t\t\telse{\r\n\r\n\t\t\t\t\t\tcell.innerHTML = prevCell.innerHTML;\r\n\t\t\t\t\t\tprevCell.innerHTML = \"\";\r\n\t\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\t\tprevCell.dataset.checkChip = 0;\r\n\t\t\t\t\t\tthis.dataset.checkChip = prevChip;\r\n\r\n\t\t\t\t\t\tgameState.checkArr[this.dataset.row][this.dataset.column] =\r\n\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column];\r\n\t\t\t\t\t\tgameState.checkArr[prevCell.dataset.row][prevCell.dataset.column] = 0;\r\n\r\n\t\t\t\t\t\tvar currChip = gameState.checkArr[this.dataset.row][this.dataset.column];\r\n\t\t\t\t\t\tjump(firstClickMovesArr[1][i], firstClickMovesArr[1][i-1], currChip);\r\n\r\n\t\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t\t\tif(gameState.turn == BLACK) gameState.turn = GREY;\r\n\t\t\t\t\t\telse gameState.turn = BLACK;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}//End for\r\n\r\n\t\t\t\tif(validMove == false){\r\n\t\t\t\t\tdocument.getElementById(\"errorDiv\").innerHTML = \"ERROR: Invalid move\";\r\n\t\t\t\t\tprevCell.style.background = prevColor;\r\n\t\t\t\t\tchipSelected = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfirstClickMovesArr = null;\r\n\r\n endGame();\r\n\r\n\t\t\t}//End Second Click\r\n\r\n\t\t}//End onclick\r\n\r\n\t}//End for\r\n\r\n}", "title": "" }, { "docid": "24d34b1f1da4a3b00a3ae36bd7e2bf5c", "score": "0.6068849", "text": "selectCell() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableCell();\n }", "title": "" }, { "docid": "46c7742b9449605c766fbd6e8178a4b4", "score": "0.6066911", "text": "function tableClick(e) {\n\n\tconsole.log(\"clicked\");\n\tvar dataId = e.rowData.dataId;\n\n\tvar w = Alloy.createController('lecture_detail_teacher', {\n\t\tdataId : dataId\n\t});\n\tw.openWindow();\n\t$.list.close();\n}", "title": "" }, { "docid": "4fc5e3b0f0b66408b5e0b4bc10216519", "score": "0.60579515", "text": "rowClicked(event){\n event.preventDefault();\n let currentRow = event.currentTarget\n window.open(currentRow.children[0].innerHTML, \"_blank\");\n }", "title": "" }, { "docid": "b6558c5e6e37db9a1d3286d33cae851a", "score": "0.60568255", "text": "function handleClick(evt) {\n // get x from ID of clicked cell\n let x = +evt.target.id[6];\n\n // get next spot in column (if none, ignore click)\n let y = findSpotForCol(x);\n if (y === null) {\n return;\n }\n\n // place piece in board and add to HTML table\n // TODO: add line to update in-memory board\n placeInTable(y, x);\n\n // check for win\n if (checkForWin()) {\n return endGame(`Player ${currPlayer} won!`);\n }\n\n // check for tie\n // TODO: check if all cells in board are filled; if so call, call endGame\n if (board[0].every(cell => cell !== null)){\n endGame();\n }\n\n // switch players\n currPlayer = currPlayer === 1 ? 2 : 1;\n}", "title": "" }, { "docid": "c8e9214b8072fc494a1cd97604f5a522", "score": "0.6049258", "text": "function hoverClick() {\n\n\tvar pixelTable = $('#pixel_canvas');\n\t\n\t// Change color when clicked.\n\tpixelTable.find('td').click(function() {\n\t\t$(this).css('background-color', myGrid.color);\n\t});\n\n\t// Hover function.\n\tpixelTable.find(\"td\").hover(function() {\n \t\t$(this).fadeTo(10, 0.6);\n \t},function() {\n \t\t$(this).fadeTo(10,1);\n \t\t}\t\n\t);\n}", "title": "" }, { "docid": "5a4a1e3bf07a37ba230292a08a5ce135", "score": "0.6047976", "text": "function strikethrough (){\r\n for (var i = 1; i< table.rows.length; i++){\r\n table.rows[i].onclick = function (){\r\n //get the selected row index\r\n rIndex= this.rowIndex;\r\n //console.log(rIndex)\r\n //get the cell from selected rInde\r\n table.rows[rIndex].cells[0].classList.toggle(\"stroke\")\r\n }; \r\n }\r\n }", "title": "" }, { "docid": "df2921457290514d0291501e5ed2da51", "score": "0.6042729", "text": "function clickCell(ref) {\n //var rcArray = ref.id.split('_'); \n // alert(\"You selected row \" + rcArray[0] + \" and column \" + rcArray[1]);\n\n //Set Colour of previous id back to the rest of the grid\n document.getElementById(prevSelect).style.background = \"#C3DAF9\";\n\n //Set Colour of selected id\n document.getElementById(ref.id).style.background = \"#00FFFF\";\n prevSelect = ref.id;\n currSelect = ref.id;\n\n var selecVal = document.getElementById(currSelect).innerHTML;\n var selecDivVal = document.getElementById(\"div\" + currSelect).innerHTML;\n\n document.getElementById(\"formulaBox\").focus();\n\n //if div contains a formula, update formula box to show the formula.\n if (document.getElementById(\"div\" + currSelect).innerHTML.substring(0, 5) == \"SUM=(\") {\n document.getElementById(\"formulaBox\").value = selecDivVal;\n }\n else {\n document.getElementById(\"formulaBox\").value = selecVal;\n }\n\n\n}", "title": "" }, { "docid": "d0190fe4658598c053989b612d1f2dcb", "score": "0.6032414", "text": "function cellClick(cell) {\r\n\t\r\n\t\t//check if there is a winner\r\n\t\t//decrease the number of cells to click\r\n\t\tif (!gameOver && cell.innerHTML == \" \") {\r\n\t\t\tcell.innerHTML = player;\r\n\t\t\tcleanBgColor();\r\n\t\t\tcell.style.backgroundColor = 'lightBlue';\r\n\t\t\tif (player == \"X\") {\r\n\t\t\t\tplayer = \"O\";\r\n\t\t\t\tsetMessage(\"It's \" + player +\"'s turn\");\r\n\t\t\t}else{\r\n\t\t\t\tplayer = \"X\";\r\n\t\t\t\tsetMessage(\"It's \" + player +\"'s turn\");\r\n\t\t\t}empty--;\r\n\t\t\tcheckWinner();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tsetMessage(\"Wrong move\");\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7062e0aa6ce9eadb1424f8b937d0c341", "score": "0.60309505", "text": "clickCell(cell, event, leftClick = true) {\n if (this.parent.currMark == \"vertices\") {\n cell.toggleEdge(cell.eventDirection(event), leftClick);\n } else {\n cell.toggleShading(leftClick);\n }\n this.update();\n\n // Linked boards:\n // Copy edges/crosses to Slitherlink\n // Copy shading status to Corralsyu\n cell.transfer(this.parent.slitherlink, \"edges\");\n cell.transfer(this.parent.slitherlink, \"crosses\");\n this.parent.slitherlink.update();\n\n this.parent.corralsyu.board[cell.row][cell.column].shaded = cell.shaded;\n this.parent.corralsyu.board[cell.row][cell.column].unshaded = cell.unshaded;\n this.parent.corralsyu.update();\n }", "title": "" }, { "docid": "401a0af1e068300750cd8fcacecc6459", "score": "0.6022365", "text": "squareClick(){\n this.props.boardClick(this.props.rowIndex, this.props.columnIndex);\n }", "title": "" }, { "docid": "2a803357e0293085b9dab9695d3c4884", "score": "0.60106945", "text": "function tableClickEvent(id) {\n // console.log(id);\n window.location = \"/entry?id=\" + id;\n}", "title": "" }, { "docid": "b7cb617ec9f8d423116943e8d21c03cf", "score": "0.6010371", "text": "function notifyClick(event) {\n var $cell = $(this);\n var numberOnCell = parseInt($cell.text(), 10);\n\n // Ignore the invalid click\n if(! isValidClick(numberOnCell))\n return;\n\n // Move the cells\n moveCell(getRowNumber(numberOnCell), getColumnNumber(numberOnCell));\n var isBoardSolved = isSolvedFn();\n\n if(isBoardSolved) {\n if (confirm('Yay! You solved the puzzle. \\n Want to play another game?')) {\n initializeboard();\n drawBoard();\n } else {\n return;\n }\n }\n\n }", "title": "" }, { "docid": "0a30d607629a684051209c60cc8fe00c", "score": "0.60044307", "text": "function clickHandlerForGrid() {\n\n $('[bind=activity] > [bind=grid] > table > tbody > tr').click(function () {\n $(this).siblings().each(function () {\n $(this).removeClass('selected');\n });\n $(this).addClass('selected');\n });\n\n}", "title": "" }, { "docid": "11a7d15f8edba78032f5f00aab875ceb", "score": "0.60042214", "text": "function handleClick(evt) {\n\t// get \"x\" coordinate from ID of clicked cell\n\tconst x = +evt.target.id;\n\n\t// get next spot in column (if none, ignore click)\n\tlet y = findSpotForCol(x);\n\tif (y === null) {\n\t\treturn;\n\t}\n\n\t// place piece in board and add to HTML table\n\t// TODO: add line to update in-memory board\n\tboard[y][x] = currPlayer;\n\tplaceInTable(y, x);\n\n\t// check for win\n\tif (checkForWin()) {\n\t\treturn endGame(`Player ${currPlayer} won!`);\n\t}\n\n\t// check for tie\n\t// TODO: check if all cells in board are filled; if so call, call endGame\n\tlet tie = board.every(function(val) {\n\t\treturn val > 0;\n\t});\n\tif (tie) {\n\t\tendGame('Game is a TIE! Play again.');\n\t}\n\n\tswitchPlayers();\n}", "title": "" }, { "docid": "a94f351e30438ffeabd993a732fa666e", "score": "0.5999557", "text": "function selectTD(elem) {\n\tlet selectedTd;\n\telem.addEventListener('click', function(event) {\n\t\tlet target = event.target;\n\t\tif (target.tagName != 'TD') return;\n\t\thighlight(target);\n\t});\n\tfunction highlight(node) {\n\t\tif (selectedTd) {\n\t\t\tselectedTd.classList.remove('highlight');\n\t\t}\n\t\tselectedTd = node;\n\t\tselectedTd.classList.add('highlight');\n\t} \n}", "title": "" }, { "docid": "529c7eb4293b19830ed802cbf0585168", "score": "0.5994604", "text": "handleClick(evt) {\n // get x from ID of clicked cell\n const x = +evt.target.id;\n\n // get next spot in column (if none, ignore click)\n const y = this.findSpotForCol(x);\n if (y === null) {\n return;\n }\n\n // place piece in board and add to HTML table\n this.board[y][x] = this.currPlayer;\n this.placeInTable(y, x);\n\n // check for tie\n if (this.board.every(row => row.every(cell => cell))) {\n return this.endGame('Tie!');\n }\n\n // check for win\n if (this.checkForWin()) {\n this.gameOver = true;\n return this.endGame(`The ${this.currPlayer.color} player won!`);\n }\n\n // switch players\n this.currPlayer =\n this.currPlayer === this.players[0] ? this.players[1] : this.players[0];\n }", "title": "" }, { "docid": "ef1d19f14295a72773100472f981153a", "score": "0.5991509", "text": "function handleCell(e) {\n //this.style.backgroundColor = colour;\n this.innerHTML = fill;\n}", "title": "" }, { "docid": "65ed4077dd22579b7dd7dde7d4778de2", "score": "0.59787875", "text": "function tableChangehandler(args) {\n //check out all the values you can get, see below how we use it to display the selected cell value...\n // console.log(\"selection changed!\" + args.startRow + \" \" + args.startColumn + \" \" + args.rowCount + \" \" + args.columnCount);\n var row;\n if (args.startRow == undefined) {\n //menas the selection is in the header!\n row = 0;\n } else {\n //selection not in the header...\n row = args.startRow + 1;\n }\n // the other thing you can try here is to get the table, and print the selected cell value..\n Word.run(function(context) {\n //this instruction selected cell of the table within the content control named \"myTableTite\"\n var mySelectedCellBody = context.document.contentControls\n .getByTitle(\"Requirement_t_01\")\n .getFirst()\n .tables.getFirst()\n .getCell(row, args.startColumn).body;\n context.load(mySelectedCellBody);\n return context.sync().then(function() {\n //lets write the value of the cell (assumes single cell selected.)\n console.log(mySelectedCellBody.text);\n });\n }).catch(function(e) {\n console.log(\"handler:\" + e.message);\n });\n }", "title": "" }, { "docid": "f3d9b7906ec56c9fddc8cd76e4a76a99", "score": "0.59760064", "text": "function renderCell(col, celldata, cellid, rowdata, colnames) {\n let t = \"\";\n if (col == \"del\") {\n t = \"<span class='btn btn-primary btn-sm' onclick='deleteTeacher(\" + celldata + \")'>Delete</span>\";\n } else {\n t += celldata;\n }\n return t;\n}", "title": "" }, { "docid": "1bbafa05cd8d989f4bd4971af4931a11", "score": "0.5971865", "text": "function col4_onClick(e, obj){\n this.cell.childNodes[0].innerHTML = this.cell.previousSibling.childNodes[0].innerHTML;\n var a=this.cell.id.split(/_/);\n var l=a.length;\n var r=parseInt(a[l-2]);\n var c=parseInt(a[l-1]);\n// oPreciosProv.rowHighlight(r+oPreciosProv.headerRowCnt);\n oPreciosProv.rowIdx = r;\n oPreciosProvEd.rowIdx = r;\n if (oPreciosProv.lastEditedRow <0) {\n oPreciosProvEd.grid.lastEditedRow=r;\n oPreciosProvEd.editRecord();\n }\n}", "title": "" }, { "docid": "73b4385af12f903fba998ba2723ef636", "score": "0.5970328", "text": "function handleClick(evt) {\n\t// get x from ID of clicked cell\n\tconst x = +evt.target.id;\n\n\t// keep track of number of times click event occurs at position 'x'\n\tif (keyframeObj[x]) {\n\t\tkeyframeObj[x]++;\n\t} else {\n\t\tkeyframeObj[x] = 1;\n\t}\n\n\t// get next spot in column (if none, ignore click)\n\tconst y = findSpotForCol(x);\n\tif (y === null) {\n\t\treturn;\n\t}\n\n\t// place piece in board and add to HTML table\n\t// TODO: add line to update in-memory board\n\tplaceInTable(y, x);\n\tboard[y][x] = currPlayer;\n\n\t// check for a win or a tie\n\tconst foundTD = document.getElementById(`${y}-${x}`);\n\tif (checkForWin()) {\n\t\tconst top = document.querySelector('#column-top');\n\t\ttop.removeEventListener('click', handleClick, false);\n\n\t\tfoundTD.firstChild.addEventListener('animationend', function() {\n\t\t\treturn endGame(`Player ${currPlayer} won!`);\n\t\t});\n\t} else if (board.every((row) => row.every((cell) => cell))) {\n\t\tfoundTD.firstChild.addEventListener('animationend', function() {\n\t\t\treturn endGame(`It is a tie!`);\n\t\t});\n\t} else {\n\t\t// switch players\n\t\t// TODO: switch currPlayer 1 <-> 2\n\t\tcurrPlayer = currPlayer === 1 ? 2 : 1;\n\t}\n}", "title": "" }, { "docid": "4b503c6b74cb3dfff3f37be4bab426ed", "score": "0.59700763", "text": "function fevent() {\n let e = d3.event;\n if (e.type in table.options.callbacks) { // handle it\n let target = e.target;\n if (target.tagName == 'TD') {\n target = target.parentElement; // events are on rows (for now)\n }\n // retrieve the data (TODO: there should be a quicker way...)\n let i = target.id.substr(1), //get tr #id\n d = table.data().find(function (d) {\n return table.rowid(d) == i\n });\n return table.options.callbacks[e.type](d, i);\n }\n }", "title": "" }, { "docid": "8bc0da7d29ba243b99fb20dea2ce0787", "score": "0.5969501", "text": "function clickRowHandler() {\n $('#servicetable tbody tr').bind('dblclick', function () {\n var aData = oTable.fnGetData( this );\n showEditDialog( aData['id'] );\n });\n }", "title": "" }, { "docid": "57574b3fb2ead1c71e773ef2728ae268", "score": "0.59516126", "text": "function coloring(color) {\n $(tableCanva).css(\"background-color\", \"white\");\n\n tableCanva.on(\"click\", \"td\", function() {\n $(this).css(\"background-color\", color);\n });\n tableCanva.on(\"dblclick\", \"td\", function() {\n $(this).css(\"background-color\", \"white\");\n });\n\n}", "title": "" }, { "docid": "9e2027acd04472d83a871be02806c323", "score": "0.5950291", "text": "function handleClick(evt) {\n // get x from ID of clicked cell\n let x = +evt.target.id;\n\n // get next spot in column (if none, ignore click)\n let y = findSpotForCol(x);\n if (y === null) {\n return;\n }\n\n // place piece in board and add to HTML table\n // TODO: add line to update in-memory board\n BOARD[y][x] = currPlayer;\n placeInTable(y, x);\n\n // check for win\n if (checkForWin()) {\n return endGame(`Player ${currPlayer} won!`);\n }\n\n // check for tie\n // TODO: check if all cells in board are filled; if so call, call endGame\n if (BOARD[0].every(ele => ele)) {\n return endGame('Tie game!')\n }\n \n\n // switch players\n // TODO: switch currPlayer 1 <-> 2\n (currPlayer === 1) ? currPlayer = 2 : currPlayer = 1;\n}", "title": "" }, { "docid": "fa8ba109c77c4c7c9601c6ee959e81da", "score": "0.59502906", "text": "function onHeadigClick(that, cellIndex) {\n return function () {\n that.sortColumn(this, cellIndex);\n return false;\n };\n}", "title": "" }, { "docid": "be5fe1d9bad61dedfe28b9dad053b1d8", "score": "0.5947681", "text": "onCellDblClick({ cellSelector }) {\n const me = this;\n\n if (me.editorContext && !me.finishEditing()) {\n return;\n }\n me.startEditing(cellSelector);\n }", "title": "" }, { "docid": "c5173004a668bd0307815ed7bf890341", "score": "0.59462637", "text": "function click_tile_callback(tile_info){\n console.log('tile callback');\n console.log('clicking on ' + tile_info.row + ' row and ' + tile_info.col + ' col with value ' + String(tile_info.value))\n }", "title": "" }, { "docid": "014f360f2975cd98d0aafeca2ac64f5a", "score": "0.5944762", "text": "onElementClick(event) {\n const\n me = this,\n target = event.target,\n cellData = me.grid.getCellDataFromEvent(event),\n clickedExpander = target.closest('.b-tree-expander');\n\n // Checks if click is on node expander icon, then toggles expand/collapse. Also toggles on entire cell if expandOnCellClick is true\n if (clickedExpander || (me.expandOnCellClick && cellData && cellData.record.isParent)) {\n clickedExpander && event.preventDefault();\n\n me.toggleCollapse(cellData.record);\n }\n }", "title": "" }, { "docid": "673ab52bceab24668da2a27cb3367637", "score": "0.59416026", "text": "function setEventsToTable() {\n\n\n //Event for click at button\n $(\"button.add-col-button\").click(function () {\n \n ShowCreateMarkFieldWind();\n });\n\n //Event for click at cell with presence\n $(\".presence-cell.editable\").click(function () {\n var studentId = $(this).parent().children().first().next().attr(\"data-id\");\n var classId = $(this).attr(\"data-id\");\n\n if ($(this).css(\"background-color\") == \"rgb(194, 255, 10)\") { //if student is absent\n $(this).css(\"background\", \"rgb(255, 218, 6)\");\n $(this).html(\"н\");\n $.ajax({\n url: \"NoteStudentAbsence?\" +\n \"&classId=\" + classId +\n \"&studentId=\" + studentId\n });\n } else { //if - precent\n $(this).css(\"background\", \"rgb(194, 255, 10)\");\n $(this).html(\"\");\n $.ajax({\n url: \"NoteStudentPresence?\" +\n \"&classId=\" + classId +\n \"&studentId=\" + studentId\n });\n }\n });\n\n //event for edit conent of cell with marks\n $(\".mark-cell.editable\").click(function (e) {\n //alert(this.className);\n\n e = e || window.event;\n var t = e.target || e.srcElement;\n var elm_name = t.tagName.toLowerCase();\n if (elm_name == 'input') {\n return false;\n }\n // alert(elm_name);\n\n var val = $(this).html();\n var code = '<input type=\"text\" class=\"edit\" value=\"' + val + '\"/>';\n $(this).html(code);\n $(\".edit\").focus();\n\n $(\".edit\").blur(function () {\n var val = $(\".edit\").val();\n var parent = $(\".edit\").parent();\n var data_id = parent.attr(\"data-id\");\n var data_type = parent.attr(\"data-type\");\n //////Нужна другая проверка в!!!!!\n if (isNaN(val))\n val=\"\";\n parent.html(val);\n $.ajax({\n url: \"SaveMarkServlet?id=\" + data_id +\n \"&type=\" + data_type +\n \"&value=\" + val\n });\n });\n });\n ////event function for click at cell whith student name\n $(\"td.cell-ui.stud-name.data-cell\").click(function () {\n clickAtCellWithStudName(event);\n });\n $(\"#stud-inf-wind\").mouseleave(function () {\n HideStudentInformationWind();\n });\n\n ////////////Редактируй. Нерабочий кусок кода. Для склика поя чейке таблице редактирования\n $(\".cell-ui.info-cell-editable\").click(function (event) {\n showPopupFormEditStudent(event);\n });\n}", "title": "" }, { "docid": "a401d63a8ef775df27448387d8015033", "score": "0.5927136", "text": "function handleClick(evt) {\n // get x from ID of clicked cell\n let x = +evt.target.id;\n\n // get next spot in column (if none, ignore click)\n let y = findSpotForCol(x);\n if (y === null) {\n return;\n }\n\n // place piece in board and add to HTML table\n // adds line to update in-memory board\n // y,x coordinates at the current player's selection\n board[y][x] = currPlayer;\n // adds selection to the board as current player\n placeInTable(y, x);\n\n // check for win\n if (checkForWin()) {\n // runs end game function w/ message\n return endGame(`Player ${currPlayer} won!`);\n }\n\n // check for tie\n // checks if all cells in board are filled; if so call, call endGame\n if (board.every(row => row.every(cell => cell))) {\n return endGame('Tie!');\n }\n // switch players\n // switch currPlayer 1 <-> 2\n currPlayer = currPlayer === 1 ? 2 : 1;\n\n}", "title": "" } ]
ad932477cc91f9f0ccf56eae3d132ced
helpers help connect to database (Mongo)
[ { "docid": "85891afc75bf2e67a4fa5c00e01758f4", "score": "0.0", "text": "branches(){\n return Branches.find({}, {\n sort : this.getReactively('sort') // sorting collection data for PAGINATION\n });\n }", "title": "" } ]
[ { "docid": "a3dc35b7dd59f4c53c434b3df3072502", "score": "0.8247655", "text": "function connect() {\n mongoose.connect(settings.config.getEnv().mongodb);\n}", "title": "" }, { "docid": "5b2057221d6b8e10d99f583d0ca5efd2", "score": "0.8113677", "text": "function connectMongo() {\n return _connectMongo.apply(this, arguments);\n}", "title": "" }, { "docid": "28347cd7154de07cf1550afec0ec7af4", "score": "0.7769914", "text": "mongo() {\n this.mongoConnection = mongoose.connect(process.env.MONGO_URL, {\n useNewUrlParser: true,\n useFindAndModify: true,\n });\n\n // DO NOT FORGET to execute it in this.init()\n }", "title": "" }, { "docid": "3b79acfe8b55e614becec3b0acff8c52", "score": "0.77494735", "text": "function connectToDatabase() {\n\tmongoClient.connect( process.env.couchrp_db || 'mongodb://localhost:27017/couchrp', function( error, database ) {\n\t\tif ( error ) {\n\t\t\treturn console.log( error.stackTrace );\n\t\t} else {\n\t\t\tusers = database.collection( 'users' );\n\t\t\tmaster = database.collection( 'master' );\n\t\t}\n\t} );\n}", "title": "" }, { "docid": "367a44ad7ebfaeafd9da9c170da913d4", "score": "0.76921624", "text": "async connect () {\n try {\n const client = await _client.connect()\n _client = client\n _db = this.dbName ? _client.db(this.dbName) : _client.db()\n\n if (this.collectionName && _db) {\n _collection = await _db.collection(_options.collectionName)\n }\n\n debug(\n `mongo client connected to: db:${_options.dbName} with collection:${_options.collectionName}`\n )\n } catch (err) {\n throw new FerretError(\n 'ConnectionError',\n 'Unable to connect to MongoDB resource.',\n 'mongo::connect',\n err\n )\n }\n }", "title": "" }, { "docid": "15f16fbb7091b7743491eda425a94bb8", "score": "0.7636512", "text": "function setUpMongo() {\n const db = process.env.MONGODB_URI || 'mongodb://localhost/meetupdb';\n mongoose.connect(db, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true });\n const mongodb = mongoose.connection;\n\n mongodb.on('error', console.error.bind(console, 'connection error:'));\n mongodb.once('open', () => console.log('Database connected successfully!'));\n return mongodb;\n}", "title": "" }, { "docid": "b798d9773bf02353b0053b8d0bd77f07", "score": "0.7614349", "text": "async init() {\n //TODO\n client = await mongo.connect(this.dbUrl);\n db = client.db(dbName);\n }", "title": "" }, { "docid": "a567f7177238d88daeee2fd9ec72577d", "score": "0.7591837", "text": "function connectAndValidate() {\n\tconnect(mongoPath);\n\n\tif (mongoUser !== \"\" && mongoUser !== \"DBUSERNAME\"){\n\t\tprint(\"Authentication is required\");\n\t\tdb = db.getSiblingDB(mongoAuthenticateDB);\n\t\tdb.auth(mongoUser,mongoPass);\n\t\tdb = db.getSiblingDB(mongoQueryDB);\n\t}\n\telse{\n\t\tdb = db.getSiblingDB(mongoQueryDB);\n\t}\n\t\n\treturn db;\n}", "title": "" }, { "docid": "e0dd1e5789632bc1ee762f5f59ee621e", "score": "0.754436", "text": "async openMongoClient () {\n\t\tthis.mongoClient = new MongoClient({ collections: COLLECTIONS });\n\t\ttry {\n\t\t\tawait this.mongoClient.openMongoClient(ApiConfig.getPreferredConfig().storage.mongo);\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow `unable to open mongo client: ${JSON.stringify(error)}`;\n\t\t}\n\t}", "title": "" }, { "docid": "e0dd1e5789632bc1ee762f5f59ee621e", "score": "0.754436", "text": "async openMongoClient () {\n\t\tthis.mongoClient = new MongoClient({ collections: COLLECTIONS });\n\t\ttry {\n\t\t\tawait this.mongoClient.openMongoClient(ApiConfig.getPreferredConfig().storage.mongo);\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow `unable to open mongo client: ${JSON.stringify(error)}`;\n\t\t}\n\t}", "title": "" }, { "docid": "e0dd1e5789632bc1ee762f5f59ee621e", "score": "0.754436", "text": "async openMongoClient () {\n\t\tthis.mongoClient = new MongoClient({ collections: COLLECTIONS });\n\t\ttry {\n\t\t\tawait this.mongoClient.openMongoClient(ApiConfig.getPreferredConfig().storage.mongo);\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow `unable to open mongo client: ${JSON.stringify(error)}`;\n\t\t}\n\t}", "title": "" }, { "docid": "bde06bc2c8c0b88dd40390e69f038806", "score": "0.7515778", "text": "async openMongoClient () {\n\t\tthis.mongoClient = new MongoClient({ collections: ['__all'] });\n\t\ttry {\n\t\t\tawait this.mongoClient.openMongoClient(ApiConfig.getPreferredConfig().storage.mongo);\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow `unable to open mongo client: ${JSON.stringify(error)}`;\n\t\t}\n\t}", "title": "" }, { "docid": "924dad606500fd989018f1d71ac15305", "score": "0.7512642", "text": "async connect () {\n try {\n const client = await MongoClient.connect(\n // `mongodb+srv://${ database_user }: ${ database_password }@cluster0.fxels.mongodb.net/${ database_name }?retryWrites=true&w=majority`,\n CONFIG.DB_HOST,\n { useUnifiedTopology: true },\n { useNewUrlParser: true } \n )\n this.database = client.db(CONFIG.DB_NAME);\n return this.database;\n } catch (e) {\n console.log(e);\n return null;\n }\n }", "title": "" }, { "docid": "d3d60e24f691f66ccabd009720665700", "score": "0.7506272", "text": "async function connectMongoDB() {\n try {\n //connect to database server\n app.locals.dbConnection = await mongodb.MongoClient.connect(\"mongodb://mongo:27017\",\n { useNewUrlParser: true });\n //connect do database \"itemdb\"\n app.locals.db = await app.locals.dbConnection.db(\"itemdb\");\n console.log(\"Using db: \" + app.locals.db.databaseName);\n }\n catch (error) {\n console.dir(error)\n setTimeout(connectMongoDb, 3000)\n }\n}", "title": "" }, { "docid": "2fab99e3e586bc351e678c85e441c714", "score": "0.7476945", "text": "function connect() {\n\tmongoose\n\t\t.connect(\n\t\t\tprocess.env.cfg_db_server,\n\t\t\t// 'mongodb://localhost:27017/test',\n\n\t\t\t{\n\t\t\t\tuseNewUrlParser: true,\n\t\t\t\tuseUnifiedTopology: true,\n\t\t\t}\n\t\t)\n\t\t.then(() => console.log('Database connected!'))\n\t\t.catch((err) => console.log(err));\n}", "title": "" }, { "docid": "846be0bb98abedcda8e639cec6ee797e", "score": "0.7476874", "text": "function setupDatabase() {\r\n // Connect to MongoDB\r\n let mongoose = require('mongoose');\r\n\r\n mongoose.connect('mongodb://localhost:27017/agar_io');\r\n\r\n // Handle MongoDB error\r\n let db = mongoose.connection;\r\n\r\n db.on('error', console.error.bind(console, 'connection error:'));\r\n db.once('open', function () {\r\n console.log(\"connected to MongoDB\");\r\n });\r\n}", "title": "" }, { "docid": "4feebe79e73a85c709558d5973da02f1", "score": "0.7476393", "text": "function connectToMongo() {\n const uri = process.env.MONGODB_URI;\n if (!uri)\n throw new Error('Env-variable \"MONGODB_URI\" should be defined first');\n\n return new Promise((res, rej) => {\n MongoClient.connect(uri, (e, cli) => e ? rej(e) : res(cli));\n });\n}", "title": "" }, { "docid": "8b7e6576d9bbfa37a4b3e9d7ebeed097", "score": "0.74247456", "text": "async openMongoClient () {\n\t\tconst logQueries = !!Commander.verbose;\n\t\tthis.mongoClient = new MongoClient({\n\t\t\tcollections: ['__all'],\n\t\t\tdryRunMode: !!Commander.dryrun,\n\t\t\tqueryLogging: logQueries,\n\t\t\tlogger: logQueries ? console : undefined\n\t\t});\n\t\ttry {\n\t\t\tthis.config = ApiConfig.getPreferredConfig();\n\t\t\tawait this.mongoClient.openMongoClient({ ...this.config.storage.mongo });\n\t\t\tthis.data = this.mongoClient.mongoCollections;\n\t\t}\n\t\tcatch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : JSON.stringify(error);\n\t\t\tthrow `unable to open mongo client: ${message}`;\n\t\t}\n\t}", "title": "" }, { "docid": "877a8d52c6e7877b3c7c6645a12d4616", "score": "0.74028456", "text": "async function connect()\n{\n\tlet url = \"mongodb://\" + DB_USER + \":\" + DB_PASSWORD + \"@\" + DB_DOMAIN + \"/\" + DB_NAME;\n\t\n\tlet client = await MongoClient.connect( url, { useNewUrlParser: true } ); // Added the useNewUrlParser option to suppress warning about it.\n\t\n\treturn client;\n}", "title": "" }, { "docid": "186dcdcfc638bde62485cbebe9efc7b1", "score": "0.73911226", "text": "function connectDatabase(){\n mongoose.connect('mongodb://127.0.0.1:27017/radmin', { useNewUrlParser: true , useUnifiedTopology: true})\n .then( () => {\n console.log('connected to radmin') \n })\n .catch( (err) => {\n console.log('error while conecting') \n }) \n}", "title": "" }, { "docid": "b04ef1cdb997dc97e37530ffcc83fe33", "score": "0.73886645", "text": "function connect() {\n logger.info('Trying to connect mongodb ...')\n mongoose.Promise = global.Promise\n mongoose.connect(process.env.EMM_DB || 'mongodb://localhost/emmab', { useMongoClient: true, config: { autoIndex: true } })\n return mongoose.connection\n}", "title": "" }, { "docid": "87a95a320b57ffb7e46a7c2120e086f5", "score": "0.73285776", "text": "function connectDB() {\n\n mongoose.connect('mongodb://admin:[email protected]:39073/landmark');\n db = mongoose.connection;\n\n\n db.on('error', console.error.bind(console, 'connection error:'));\n\n db.on('open', function (callback) {\n\n console.log('Open monogodb');\n getFirebaseData(new Firebase('https://tainanlandmark.firebaseio.com/'));\n });\n}", "title": "" }, { "docid": "7b25e53a85192b66a263dcb9ca11cc52", "score": "0.72829115", "text": "function connect() {\r\n mongoose\r\n .connect(`${process.env.COSMOSDB_CONNSTR}`, {\r\n useNewUrlParser: true\r\n })\r\n .then(() => console.log(\"Connection to CosmosDB successful\"))\r\n .catch(err => console.error(err));\r\n}", "title": "" }, { "docid": "8a8ea14842462ce979dbdf6f195054a5", "score": "0.7264266", "text": "function connectMongo(){ \n mongodb.MongoClient.connect(mongoURL, function(err, database) {\n if(err){log.error(\"Failed to connect to MongoDB! \", err); throw \"Error Re/Connecting to MongoDB\";}\n log.info(\"Connected successfully to mongoDB\");\n\n //Set the db active\n db = database;\n\n //Deal with pending onconnect function requests\n for(let i in onConnect){\n onConnect[i].fn(onConnect[i].cb);\n }\n onConnect = [];\n\n //Add listener for disconnect so that the db active variable can be unset\n db.addListener(\"disconnect\", function(){\n db = null;\n //Try reconnect\n connect();\n });\n });\n}", "title": "" }, { "docid": "3082af1be0de5d75a2a133ce597f802d", "score": "0.7247614", "text": "function connectToDb() {\n mongoose.connect(database); \n return mongoose;\n}", "title": "" }, { "docid": "12339d3ce1b3376cccfdb7f93f327cc5", "score": "0.7220052", "text": "connect() {\n mongoose.connect(\n `mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_HOST}/${\n this.dbName\n }?retryWrites=true`,\n { useNewUrlParser: true }\n );\n this.connected = true;\n }", "title": "" }, { "docid": "ada15795f9287d59ef07699082677661", "score": "0.72033376", "text": "function setupInstance(){\n\t\tMongoClient.connect(\"mongodb://ordertrackinguser:[email protected]:31812/heroku_app36432204\", function(err, db) {\n\t\t\t\tif (err) {\n\t\t\t\t\t logger.error('unable to open mongo client instance');\n\n\t\t\t\t}\n\t\t\t\telse {\n\t \t\t\t\t_db = db;\n\t\t\t\t}\n\t \t\t});\n\t}", "title": "" }, { "docid": "247cf9ad9d95c4159446cad390dc7c72", "score": "0.71943766", "text": "async function connectToMongo() {\n try {\n await mongoose.connect(mongoUrl, { useNewUrlParser: true });\n console.log(\"Successfully connected to AtlasDB!\");\n } catch (err) {\n console.log(\"Error connecting to AtlasDB: \" + err);\n }\n}", "title": "" }, { "docid": "f78d04bb1c0e6fb721bdeef25c3a0513", "score": "0.71835047", "text": "async dbConnect(dbName = \"bnzzp8d394kena7\") {\n const client = new MongoClient(\n \"mongodb://uq6uyt020a3iwte4amvc:EP2YZPueMLVHWrnAdcuu@bnzzp8d394kena7-mongodb.services.clever-cloud.com:27017/bnzzp8d394kena7\"\n );\n await client.connect(); // connexion au serveur mongo\n return client.db(dbName); // use our database\n }", "title": "" }, { "docid": "3a5ee83fe69f7660f30a414c0d998b55", "score": "0.71739966", "text": "_connectToMongo() {\n // connect to database\n mongoose.connect(this._DBURI, {useMongoClient: true});\n // throw Error in case of connection failure\n mongoose.connection.on('error', (err) => {\n console.error('Connection error: ' + err);\n throw new Error('Failed to connect to MongoDB');\n });\n mongoose.connection.on('open', () => {console.log('connection established to database'); });\n // set Grid storage to mongoose connection\n Grid.mongo = mongoose.mongo;\n }", "title": "" }, { "docid": "c1a2f5a29590e71703ff27d4e663694d", "score": "0.7170492", "text": "constructor(){\n this.client = new MongoClient(MONGO_URI,{useNewUrlParser: true});\n this.dbName = DB_NAME;\n }", "title": "" }, { "docid": "24662da64fa45952f6824c845a38dbf0", "score": "0.7165572", "text": "connect() {\n this.mongoClient.connect((err,mongodb) => {\n if (err) throw err;\n console.log(\"Connessione al database avvenuta!\");\n MongoConnect.blogDB = mongodb.db('blog'); //memoriziamo il riferimento al database blog\n this.emit('dbConnection'); //solleviamo l'evento dbConnection\n })\n }", "title": "" }, { "docid": "c781ce75ad0f3cec17b0a9a48fc78b14", "score": "0.7157461", "text": "function connect(options) {\n var defaultOptions = {\n host: \"localhost\"\n };\n\n options = _.defaults(options || {}, defaultOptions);\n\n mongoose.connect(\"mongodb://\"+options.host+\"/notepad\");\n}", "title": "" }, { "docid": "4e4642ff5f61da13bf1aaea5068b6fc3", "score": "0.7137612", "text": "function dbconnect() {\n \n const db = config.get('db');\n mongoose.connect(db, { useNewUrlParser: true })\n .then( () => {\n debug(`DB config: Connected to the ${db}...`);\n })\n .catch( (err) => {\n debug('DB config: Could not connect to the DB.');\n logger.error('Could not connect to the DB.', err);\n process.exit(1);\n });\n \n}", "title": "" }, { "docid": "a5ea722c5aefb599aa8bd82a39909814", "score": "0.7126362", "text": "function getDB() {\n mongode.connect(databaseURL);\n var dbcon = mongode.hungryp_mongo;\n\n return dbcon;\n}", "title": "" }, { "docid": "668ba9c3834ed0490f33768e8d62dbb0", "score": "0.7108902", "text": "async function conn() {\n logger.info(`Connecting to ${config.MONGODB_URI}`);\n try{\n await mongoose.connect(config.MONGODB_URI, { useNewUrlParser: true, useFindAndModify: false })\n logger.info('DB connected succesfully');\n\n } catch(error){\n logger.error('Error connecting to db', error.message);\n }\n}", "title": "" }, { "docid": "24d9625a88125ffd1ef948f64dbeb0b8", "score": "0.71039575", "text": "function mongoConnect(onSuccessCallback){\n mongoDb.connect(connectionString, function(err, db) {\n if (err){\n console.log(\"Error de conexion a la DB: \" + err.message); \n }\n onSuccessCallback(db);\n });\n}", "title": "" }, { "docid": "d6f3cb2e2e72753e2cc50cc766a7021d", "score": "0.708436", "text": "async function connectToDb(str) {\n const client = new MongoClient(str,\n {\n useUnifiedTopology: true,\n useNewUrlParser: true\n }\n );\n\n try{\n await client.connect();\n return client.db();\n } catch (error) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "027f7e4daf6d7a1f38d8c4ada5110f5f", "score": "0.70733124", "text": "async db() {\n if(this._db) {\n // console.log(\"Already connected, returning this.db\")\n return this._db\n }\n // console.log(\"this.url: \", this.url)\n const conn = await MongoClient.connect(this.url, { \n useNewUrlParser: true,\n autoReconnect: true,\n reconnectTries: Number.MAX_VALUE,\n bufferMaxEntries: 0,\n })\n assert.ok(conn, \"Could not establish connection to MongoDB\")\n // console.log(\"Mongodb connection established\")\n this._db = conn.db(this.dbName)\n return this._db\n }", "title": "" }, { "docid": "495c74b7addf1e5be56c3f9abbf64a5e", "score": "0.7069538", "text": "function connect(callback){\n //the actual connection.\n mongodb.MongoClient.connect(CONNECTION, function(err, db_obj){ //Connects to the database and returns the connection as an object.\n if(err){\n console.log(\"Error: failed to connect to the database\")\n callback(err)\n } else{\n database = db_obj\n callback(null)\n }\n })\n}", "title": "" }, { "docid": "b5279b25024505d2a8d62b7907584b92", "score": "0.7065516", "text": "function connect_db(db_uri) {\n console.log(db_uri);\n mongoose.connect(db_uri);\n var db = mongoose.connection;\n db.on('error', console.error.bind(console, 'connection error:'));\n db.on('connecting', function() {\n console.log(colors.green('Connecting to mongodb... '));\n });\n db.on('connected', function() {\n console.log(colors.green('Connected'));\n });\n db.on('open', function() {\n console.log(colors.green('Connection opened!'));\n });\n db.on('close', function() {\n console.log(colors.green('Connection has been closed!'));\n });\n db.on('disconnecting', function() {\n console.log(colors.green('Disconnecting db... '));\n });\n db.on('disconnected', function() {\n console.log(colors.green('Disconnected '));\n });\n return db;\n}", "title": "" }, { "docid": "d3d4e916f6e957265fe72e68ae856125", "score": "0.70586854", "text": "function getDB() {\n\n let MongoClient = require('mongodb').MongoClient;\n // let MongoClient = mongodb.MongoClient;\n let url = 'mongodb://localhost:27017/admin';\n\n return MongoClient.connect(url, function(err, db) {\n console.log(123456);\n let DB = db.db('boysAndGirls');\n let connection = DB.collection(\"identities\");\n connection.insert(\n [\n {\"identity\":\"boy\",\"name\":\"三十好汉\"},\n {\"identity\":\"girl\",\"name\":\"十八美少女\"},\n {\"identity\":\"children\",\"name\":\"乳臭未干\"}\n ]\n );\n console.log(DB,connection)\n });\n}", "title": "" }, { "docid": "bf7143eb31eaf45f8889854f961ae63e", "score": "0.70235586", "text": "connect(){\n //CONSULTO SI NO EXISTE UNA CONEXION INSTANCIADA LA CREO POR MEDIO DE UNA PROMESA\n if(!MongoLib.connection){\n MongoLib.connection = new Promise((resolve,reject)=>{\n //CLIENT USA ERROR FIRST CALLBACK\n this.client.connect(err =>{\n if(err){\n reject(err);\n }\n //CREO LA CONEXION \n console.log('La conexión con MongoDB se estableció')\n resolve(this.client.db(this.dbName));\n })\n })\n }\n return MongoLib.connection;\n }", "title": "" }, { "docid": "9653b1dd5ed66e63fea951eac687cbc0", "score": "0.70188093", "text": "function setupMongo() {\n exec('docker inspect --format \\'{{ .NetworkSettings.IPAddress }}\\' $(docker ps -aqf \"name=mongo-test\")', (err, out) => {\n mongoose.connect(`mongodb://${out}`);\n });\n}", "title": "" }, { "docid": "32568b707468768ab38f7c5ecf3448a3", "score": "0.70166874", "text": "async function mongodb() {\n mongoose.connect(process.env.MONGO_URL,\n { useNewUrlParser: true });\n await mongoose.connection.on('connected',\n ()=> console.info('mongodb connected')); \n\n app.listen(port,\n ()=>console.info(`App is listening on port ${port}`));\n }", "title": "" }, { "docid": "e37a21d7fd0a59a4b2ea590d469ed933", "score": "0.7012739", "text": "function initDatabaseConnection() {\n if (appHelper.isProd()) {\n options.user = process.env.MONGODB_ADDON_USER;\n options.pass = process.env.MONGODB_ADDON_PASSWORD;\n }\n\n mongoose.connect(process.env.MONGODB_ADDON_URI, options);\n\n // Use native promises\n mongoose.Promise = global.Promise;\n\n db = mongoose.connection;\n db.on('error', (err) => {\n log.error('Database connection error', err);\n });\n\n db.once('open', () => {\n log.info('Connection with database succeeded.');\n });\n}", "title": "" }, { "docid": "0685e748aef0d51344c03a895820cd15", "score": "0.7010154", "text": "function Mongo(db) {\n if (!db) {\n throw new Error('Cannot initialize mongo wrapper without a database');\n }\n this.mongo = db;\n}", "title": "" }, { "docid": "1901e6e3ff108a041239cd88588a5518", "score": "0.7000384", "text": "function dbConnection () {\n\n // env\n\tif (!(process.env.MONGODB_USER && process.env.MONGODB_PASSWD)) {\n console.log('MONGODB CONNECTION USER/PASSWD environment variables required.');\n process.exit(1);\n\t}\n\n\tconst username = process.env.MONGODB_USER.trim(),\n\t\tpassword = process.env.MONGODB_PASSWD.trim(),\n\t\tserver = config.get('mongo.server'),\n\t\tport = config.get('mongo.port'),\n\t\tdatabase = config.get('mongo.database'),\n\t\tssl = config.get('mongo.ssl'),\n\t\treplicaset = config.get('mongo.replicaset'),\n\t\tauth = username ? username + ':' + password + '@' : '';\n\n\tconst temp = 'mongodb://' + auth + server + ':' + port + replicaset + '/' + database + ssl;\n\tdebug(`Connection: ${ temp }`);\n\n\treturn temp;\n}", "title": "" }, { "docid": "47a37baa5da51f35b0e293381c8ef586", "score": "0.6984371", "text": "function _connect(cb) {\n // Configure link information\n MongoClient.connect(dbUrl, function (err, client) {\n if (err) throw err;\n cb(client);\n console.log(\"Connect successfully to server\");\n })\n}", "title": "" }, { "docid": "f106259643f21f529402648517d7c131", "score": "0.697179", "text": "async function connectToDatabase(_url, _collection) {\n options = { useNewUrlParser: true, useUnifiedTopology: true };\n mongoClient = new Mongo.MongoClient(_url, options);\n await mongoClient.connect();\n console.log(\"Verbindung zur Datenbank mit Kollekion: \" + _collection);\n mongoDaten = mongoClient.db(\"Chat\").collection(_collection);\n }", "title": "" }, { "docid": "9779be9cd8d2aa875998992ab31632b3", "score": "0.6971645", "text": "function connection(){\r\n // A funcao connect do mongoose recebe como parametro o host com a porta e o nome do banco.\r\n // useNewUrlParser: true | Eh um novo formato em que ele vai analisar esta string de conexao.\r\n // useUnifiedTopology: true | Isso deixa o monitoramento do nosso banco de dados ativo.\r\n mongoose.connect(\"mongodb://localhost:27017/escolarecode\", {useNewUrlParser: true, useUnifiedTopology: true})\r\n // Um parametro de connect e o .then() que pode se assimilar ao Try do try-catch, e ele eh executado qunado a conexao foi bem sucedida.\r\n .then(() => {\r\n // Dentro do .then() tenho uma funcao de callback que me retonar no console uma string com \"1\"\r\n console.log(\"1\")\r\n })\r\n // catch eh caso ocorra um erro na conexao com o banco ele executa o catch, e ele possui um parametro que e o erro do porque a conexao nao foi bem sucedida.\r\n .catch((error) => {\r\n console.log(error)\r\n })\r\n}", "title": "" }, { "docid": "6fd8be4f2f4913262a53ef6903056064", "score": "0.6958458", "text": "connectToMongo (callback) {\n\t\tif (this.mockMode) {\n\t\t\treturn callback();\t// not applicable in mock mode\n\t\t}\n\n\t\t// set up the mongo client, and open it against the versionMatrix collection\n\t\tthis.mongoClientFactory = new MongoClient({ collections: ['versionMatrix'] });\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tthis.mongoClient = await this.mongoClientFactory.openMongoClient(this.apiConfig.mongo);\n\t\t\t}\n\t\t\tcatch (error) {\n\t\t\t\treturn callback(error);\n\t\t\t}\n\t\t\tthis.mongoData = this.mongoClient.mongoCollections;\n\t\t\tcallback();\n\t\t})();\n\t}", "title": "" }, { "docid": "3b45207c9cbc759906daadd416ec55c1", "score": "0.69396114", "text": "function buildMongoUrl() {\n var mongoUrl = 'mongodb://' + c.db.username + ':' + c.db.password + '@' + c.db.host + ':' + c.db.port + '/' + c.db.database + '?auto_reconnect=true&safe=true';\n return mongoUrl;\n }", "title": "" }, { "docid": "671cc0c2374a25eb593166dbdfb961a1", "score": "0.69171333", "text": "function connect(connUrl) { mongoose.connect(connUrl); }", "title": "" }, { "docid": "91d1466314e1819c408da5c7eac1cc31", "score": "0.6908065", "text": "setupConnection(dbName) {\n\n if (mongoose.connection.readyState != 0)\n return\n\n mongoose.connect(\n `mongodb://localhost:27017/${dbName}`,\n { useNewUrlParser: true }\n )\n .then(success => {\n mongoose.set(\"useCreateIndex\", true)\n mongoose.set('useFindAndModify', false)\n console.log(`Succesfully conntected to mongodb on port ${27017}`)\n mongoose.connection.on(\"close\", () => {this.connection = false})\n })\n .catch(error => {\n console.error(\"Unable to connect to mondodb. Perhaps mongo isn't installed?\")\n console.log(error)\n })\n }", "title": "" }, { "docid": "b5849eb6319d9579ffe11016e632f595", "score": "0.690648", "text": "constructor() {\n this.collection = 'news'\n this.mongoDB = new MongoLib()\n }", "title": "" }, { "docid": "341159220a569ac436184a1bdd2c62ca", "score": "0.688957", "text": "function connect() {\n return new Promise((resolve, reject) => {\n MongoClient.connect(dbUrl, { useUnifiedTopology: true })\n .then((data) => {\n client = data;\n db = client.db(dbName);\n debug('Connected to MongoDB');\n return resolve(db);\n })\n .catch((error) => {\n debug('Error connecting to MongoDB');\n return reject(error);\n });\n });\n }", "title": "" }, { "docid": "d0f8c120177c90fd6ba038a0a8764f0c", "score": "0.6886194", "text": "function startDB() {\n console.log(\"Trying to connect to \" + connectionString);\n mongoose.connect(connectionString);\n}", "title": "" }, { "docid": "7c1dee1cff6a45555bc85bdf1edfb76c", "score": "0.68780005", "text": "async initMongo() {\n return new Promise(async (resolve, reject) => {\n try {\n HealthManager.addHealthCheckHook(this.mongoHealthHook.bind(this), 'mongo');\n Logger.trace('Server : initMongo');\n this.app.locals.db = await mongoose.createConnection(Config.env.MONGO_URI, {promiseLibrary: global.Promise});\n this.app.locals.models = {\n Voter: require('../db/models/Voter'),\n };\n resolve();\n } catch(err) {\n reject(err);\n }\n });\n }", "title": "" }, { "docid": "ba4a74c5d34ff727bf8ed6da1fb7ae5f", "score": "0.68678343", "text": "function DB() {\n\treturn new Promise(function(resolve, reject) {\n\t\tMongoClient.connect(url, function(err, db) {\n\t\t\tresolve(db);\n\t\t\treject(err);\n\t\t});\n\t})\n\n}", "title": "" }, { "docid": "af97044ea14e64b56e418bfb07a50f61", "score": "0.6867661", "text": "constructor(mongodb_uri) {\n mongoose.connect(mongodb_uri);\n mongoose.Promise = bluebird;\n const db = mongoose.connection;\n db.on('error', (err) => {\n throw new Error('MongoDB Connection Error: ' + err);\n });\n db.once('open', () => {\n debug('MongoDB Connection Established.');\n });\n }", "title": "" }, { "docid": "f9d2204c6b94b72dae9da8f028779567", "score": "0.6863164", "text": "async function connectToDatabase() {\n \n // If already connected, return \n if (cachedDb) {\n return cachedDb;\n }\n\n // Connect\n const [ mongoUri, mongoUser, mongoPass ] = await getMongoCredentials();\n const uri = `mongodb+srv://${mongoUser}:${mongoPass}${mongoUri}`;\n const client = new MongoClient(uri);\n await client.connect();\n \n // Select database, cache, and return\n const db = await client.db(\"data\");\n cachedDb = db;\n return db;\n\n}", "title": "" }, { "docid": "85400aedbbca070a7afe7cdcc562e664", "score": "0.68596387", "text": "function connectDB(cb, res){\n MongoClient.connect(connect.uri, (err, db) => {\n console.log(\"Connecting to jobs DB...\");\n assert.equal(null, err);\n db.db('jobs').collection(coll).find().toArray( (err, data) => cb(data, db, res) );\n });\n }", "title": "" }, { "docid": "96b36c8be89e735bc0f7829e9ba1f360", "score": "0.68438953", "text": "handleCon() {\n if (!Store.connection) {\n Store.connection = mongoose\n .connect(MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true })\n .then(() => {\n console.log('[DB] Success contected');\n })\n .catch((reject) => {\n console.log(`[DB] fail contected ${reject}`);\n });\n mongoose.set('useFindAndModify', false);\n }\n return Store.connection;\n }", "title": "" }, { "docid": "d78ff30c8c10a338c5da31b63990214c", "score": "0.68394405", "text": "connect() {\n // Como .connection no lo definimos dentro de la clase, esta funciona como una variable estatica.\n if (!MongoLib.connection) {\n // Con promesas hacemos la peticion de conneccion y esperamos que connecte.\n MongoLib.connection = new Promise((resolve, reject) => {\n this.client.connect(err => {\n if (err) {\n reject(err); // Manejamos el error si lo hay.\n }\n\n // Dejamos un mensaje si conecta.\n console.log('Connected succesfully to mongo.');\n // Retornamos la coneccion.\n resolve(this.client.db(this.dbName));\n });\n });\n }\n\n // Retornamos la coneccion si existe o si esta es creada.\n return MongoLib.connection;\n }", "title": "" }, { "docid": "c2e5fc11a017ec5a58f6152c7049ac42", "score": "0.68348396", "text": "function connect(callback) {\n client.connect(function(err) {\n if(err){\n console.log('err connection to mongo', err)\n } else {\n console.log(\"Connected successfully to server\");\n db = client.db(dbName)\n }\n callback(err);\n });\n}", "title": "" }, { "docid": "ecd19bd073981c2a00ab7adf5976f444", "score": "0.6831182", "text": "async function connect(url) {\n await mongoose.connect(url, { useMongoClient: true });\n}", "title": "" }, { "docid": "648fc6c76c9cc5b830ec196e90118f99", "score": "0.68310934", "text": "async function main() {\n\n const uri = \"mongodb+srv://thisIsMark:[email protected]/ems?retryWrites=true&w=majority\";\n \n const client = new MongoClient(uri);\n\n try {\n\n await client.connect();\n await listDatabases(client);\n } catch (e) {\n console.error(e);\n }\n finally {\n await client.close();\n }\n \n}", "title": "" }, { "docid": "91b7997a3a301d4a524695a8dd7c6f5c", "score": "0.68243825", "text": "async connect() {\n this.client = await mongoose.connect(this.dsn, { useNewUrlParser: true });\n this.schemas.forEach(schema => {\n this.client.model(schema.name, schema.schema);\n });\n }", "title": "" }, { "docid": "85c68984154b955336298e3ed612576f", "score": "0.6818905", "text": "async function connect() {\n await db.connect(process.env.NODE_ENV === 'test' ? process.env.MONGODB_URL_TEST : process.env.MONGODB_URL, {\n useNewUrlParser: true,\n useUnifiedTopology: true,\n useCreateIndex: true,\n });\n console.log(`[db] DB ${process.env.NODE_ENV === 'test'?'test':'production'} is connected`);\n}", "title": "" }, { "docid": "431874d6a9207eac963b33e2e75df2ce", "score": "0.68016917", "text": "function getConnection() {\n return new Promise((resolve, reject) => {\n if(db) {\n return resolve(db);\n }\n\n MongoClient.connect('mongodb://localhost:27017/todo_app', (err, db_instance) => {\n if(err) {\n return reject(err);\n }\n\n db = db_instance;\n resolve(db_instance);\n })\n })\n}", "title": "" }, { "docid": "11fdd3480dfee2cd92d4463fded7590b", "score": "0.67955405", "text": "constructor() {\n this.init(); // metodo init\n this.mongo();\n }", "title": "" }, { "docid": "d13f854d81ad9d1b55220fd568a39da0", "score": "0.67782766", "text": "constructor() {\n this.collection = 'questionBank';\n this.mongoDB = new MongoLib();\n }", "title": "" }, { "docid": "3401c9961fec7c3f34009dd52f2f6150", "score": "0.673381", "text": "function initMongo() {\n if (!(mongoose.connection.readyState === 1)) {\n logger.info('Connecting offchain db connection', config.db.MONGO_URL_SERVICE);\n\n return mongoose.connect(config.db.MONGO_URL_SERVICE, config.db.MONGO_CONFIG, function(err) {\n if (err) {\n logger.error('Could not connect offchain db', err);\n }\n });\n }\n return true;\n}", "title": "" }, { "docid": "6b35051b4f1f99be5ab3fcc4183fa886", "score": "0.6729485", "text": "static async connect() {\n try { \n let status = await mongoose.connect(connectionString) // try to connect to db with a mongoose method called connect(). We use mongoose for db connection\n // once connection is done, log this info \n console.log(\"CONNECTED TO DB\")\n return status\n } catch (error) {\n console.log(error)\n }\n }", "title": "" }, { "docid": "422dc8e157e7379224cd42b7afc4c73c", "score": "0.6727511", "text": "function connect(callback) {\n Mongo.connect(url,function (err,client) {\n if(err){\n console.log(\"连接出现错误\",err)\n }else{\n var db=client.db(dbName)\n console.log(\"连接成功到mongodb://47.94.108.20:27017/?readPreference=primary&appname=MongoDB%20Compass&directConnection=true&ssl=false\\n\")\n callback && callback(db,client)\n }\n })\n}", "title": "" }, { "docid": "232bfaf7fc5ecc691402e1aeffe14a35", "score": "0.6720976", "text": "constructor() {\r\n debug( 'DB created' );\r\n /**\r\n * @property {MongoDatabase} db The actual db returned after calling\r\n * `connect`\r\n */\r\n this.db = null;\r\n /**\r\n * @property {Map<string,string>} collectionMapping The mapping of the\r\n * aliases\r\n */\r\n this.collectionMapping = new Map();\r\n\r\n\r\n\r\n /**\r\n * Alias for {@link DB#connect}\r\n * @memberof DB#\r\n * @method open\r\n * @alias connect\r\n */\r\n this.open = this.connect.bind( this );\r\n /**\r\n * Alias for {@link DB#disconnect}\r\n * @memberof DB#\r\n * @method close\r\n * @alias disconnect\r\n */\r\n this.close = this.disconnect.bind( this );\r\n /**\r\n * Alias for {@link DB#remove}\r\n * @memberof DB#\r\n * @method delete\r\n * @alias remove\r\n */\r\n this.delete = this.remove.bind( this );\r\n /**\r\n * Alias for {@link DB#dropDatabase}\r\n * @memberof DB#\r\n * @method dropDB\r\n * @alias dropDatabase\r\n */\r\n this.dropDB = this.dropDatabase.bind( this );\r\n /**\r\n * Alias for {@link DB#getCollection}\r\n * @memberof DB#\r\n * @method get\r\n * @alias getCollection\r\n */\r\n this.get = this.getCollection.bind( this );\r\n /**\r\n * Alias for {@link DB#getCollection}\r\n * @memberof DB#\r\n * @method g\r\n * @alias getCollection\r\n */\r\n this.g = this.getCollection.bind( this ); // Moar getCollection alias\r\n /**\r\n * Alias for {@link DB#getCollection}\r\n * @memberof DB#\r\n * @method c\r\n * @alias getCollection\r\n */\r\n this.c = this.getCollection.bind( this ); // Even mooooar\r\n }", "title": "" }, { "docid": "dfc5fd15f30c95dbe14a8721ff25a81e", "score": "0.6706322", "text": "connectToServer(callback) {\n MongoClient.connect(DB_URL, (err, client) => {\n if (err) {\n console.log(err);\n process.exit(1);\n }\n db = client.db(DB_NAME);\n });\n }", "title": "" }, { "docid": "9bd75768eb859b2b7d20320e2849024f", "score": "0.6698571", "text": "constructor(uri) {\n this.db = connect(`mongodb://${uri}`, { promiseLibrary: bluebird });\n this.collection = null;\n }", "title": "" }, { "docid": "778053cc2fa64d233f4f264cfc9c4952", "score": "0.6698457", "text": "function connect() {\n return new Promise((resolve, reject) => {\n MongoClient.connect(\n process.env.DB_URI,\n (err, res) => {\n if (err) {\n reject(err);\n }\n client = res.db();\n\n resolve(client);\n },\n );\n });\n}", "title": "" }, { "docid": "7f6b1a4316beb3ed7d5e837df0cfd04f", "score": "0.66911745", "text": "async initialize() {\n \n super.initialize(); \n if (this.status.sqlTrace) {\n this.status.sqlTrace.write(`mongoURL ${this.getMongoURL()}\\n`) \n }\n this.client = new MongoClient(this.getMongoURL(),typeof this.connectionProperties.options === 'object' ? this.connectionProperties.options : {});\n await this.client.connect();\n if (this.status.sqlTrace) {\n this.status.sqlTrace.write(`use ${this.connectionProperties.database}\\n`) \n }\n this.db = this.client.db(this.connectionProperties.database);\n \n }", "title": "" }, { "docid": "b1bf57b483d781a10f0a707ff0f90fb5", "score": "0.66909605", "text": "async function connectDB() {\n try {\n await mongoose.connect(url, {\n useNewUrlParser: true,\n useUnifiedTopology: true,\n useFindAndModify: false,\n useCreateIndex: true,\n });\n } catch (error) {\n console.log(error);\n }\n}", "title": "" }, { "docid": "109a1c8ddb826de63d131efb4af065b1", "score": "0.6681654", "text": "function connectDB(cb) {\n return MongoClient.connect(url, { useUnifiedTopology: true })\n .then((client) => { \n console.log('MongoDB connected');\n currentClient = client;\n db = client.db();\n\n if (typeof cb === 'function') {\n cb();\n }\n })\n .catch((err) => console.log(err));\n}", "title": "" }, { "docid": "44e883ecb0299d09fe3235fb30388246", "score": "0.66730404", "text": "async function Conectar(){\n try{\n await mongoose.connect(URI,{\n useNewUrlParser:true,\n useUnifiedTopology:true\n });\n console.log(\"Conectado a MongoDB\");\n }catch(e){\n console.log(\"No se pudo conectar a MongoDB\");\n }\n}", "title": "" }, { "docid": "d0bc5c8fb995ea5ed54315b378719868", "score": "0.667039", "text": "async function connect() {\n mongoose.Promise = global.Promise;\n\n // establish Connection\n mongoose.connect(process.env.DATABASE, { \n useUnifiedTopology: true,\n useNewUrlParser: true\n });\n mongoose.set('useCreateIndex', true);\n //Mongoose events\n //Successfull Connection\n mongoose.connection.on(\"connected\", function() {\n console.log(\"Mongoose Connected to \" + process.env.DATABASE);\n })\n}", "title": "" }, { "docid": "df05722a01c6231339d2e67138634a5e", "score": "0.6651105", "text": "constructor() {\n super();\n this.mongoClient = new MongoClient(\n 'mongodb+srv://antonio:[email protected]/blog?retryWrites=true&w=majority',\n { useUnifiedTopology: true }\n );\n }", "title": "" }, { "docid": "5c3f080a8ae50f22f9ff00a97eef4160", "score": "0.6648979", "text": "constructor() {\n //instanciar el nombre de la colleccion de este schema\n this.collection = 'users';\n //instancia de mongolib para utilizar sus funcionalidades\n this.mongoDB = new MongoLib();\n }", "title": "" }, { "docid": "03eb81a8fea79cf9d10c597a7256779a", "score": "0.6629477", "text": "function connect() {\n var options = {server: {socketOptions: {keepAlive: 1}}};\n return mongoose.connect(mongoconnection, options).connection;\n}", "title": "" }, { "docid": "de95cf720340f530f81ce06f3db301a1", "score": "0.661631", "text": "async function loadClient() {\n client = await mongodb.MongoClient.connect(url, { useNewUrlParser: true })\n}", "title": "" }, { "docid": "f7a6ba9233c26ac0eda6f7eacbd59c75", "score": "0.66119516", "text": "async function establishConnection() {\n await mongo.connectToMongo()\n .then(()=>{\n console.log(\"boostrap complete\")\n })\n}", "title": "" }, { "docid": "f160a6355731d1125cbc1a47d6ed0f6f", "score": "0.6611853", "text": "function connect() {\n return new Promise((resolve, reject) => {\n mongoose.connect(DB_URI,\n { useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true,useFindAndModify:false })\n .then((res, err) => {\n if (err) return reject(err);\n resolve(res);\n })\n });\n }", "title": "" }, { "docid": "1194a5c6d7fd414365af78b1a2b1193e", "score": "0.66081023", "text": "function dbConnectAndExecute(callback){\n\tvar mongoConnectionString = process.env.MongodbConnectionString;\n\tvar db = mongoose.connection;\n\t//check if we are already connected to the db\n if(db.readyState == 1){\n callback();\n } else{\n\t\t//we aren't connected to the database\n db.connect(null);\n mongoose.connect(mongoConnectionString);\n \n db.on('connect', function(){\n callback(null);\n });\n db.on('error', function(){\n callback('Could not connect to database');\n });\n \n }\n}", "title": "" }, { "docid": "5eebd6cbe841525bade11ff3bb11d967", "score": "0.6594203", "text": "async function loadPostsCollection(){\n const client = await mongodb.MongoClient.connect('mongodb+srv://root:[email protected]/classGrader?retryWrites=true&w=majority', { useNewUrlParser: true, useUnifiedTopology: true });\n return client.db('classGrader').collection('grades');\n\n}", "title": "" }, { "docid": "ba52e7dd81ddd98e61d96efee999ec8a", "score": "0.6587434", "text": "async function createClient() {\n const rootUser = process.env.MONGO_ROOT_USERNAME;\n const rootPass = process.env.MONGO_ROOT_PASSWORD;\n const hostName = process.env.MONGO_HOSTNAME;\n const uri = `mongodb://${rootUser}:${rootPass}@${hostName}:27017/?retryWrites=true&w=majority`;\n console.log('URI is: ' + uri)\n\n const client = new MongoClient(uri);\n\n try {\n await client.connect();\n return client;\n } catch (e) {\n console.error(e);\n }\n return null;\n}", "title": "" }, { "docid": "21770f04a20ca99f630845700ea34a45", "score": "0.6577785", "text": "function getDBConnectionString() {\n return `mongodb+srv://${encodeURIComponent(process.env.DB_USER)}:${encodeURIComponent(process.env.DB_PASS)}@${encodeURIComponent(process.env.DB_LOCATION)}/${encodeURIComponent(process.env.DB_Name_Saves)}?retryWrites=true&w=majority`;\n}", "title": "" }, { "docid": "cb77e24051fc93be905e6c71832be5f8", "score": "0.656655", "text": "function get_DB(\n mongoLab_URI//: str\n ,MongoClient//: MongoClient obj <- explicit\n) {// => Promise(db)\n \"use strict\";\n\n var connection = MongoClient.connect(mongoLab_URI);//, function(err, db) {\n\n // Promise <pending> -> thanble\n //return Promise.resolve(connection.then((db) => {return db;}));\n return connection.then((db) => {return db;});\n}", "title": "" }, { "docid": "129543565fc6bb746fbdc85f6cb83c3f", "score": "0.6562607", "text": "async function run() {\n await mongoose.connect('mongodb://localhost/dev_database', {\n useNewUrlParser: true,\n useUnifiedTopology: true,\n useCreateIndex: true\n })\n .then(db => console.log('conectado a la base de datos'))\n .catch(err => console.log(err));\n\n console.log('Conexion Lista');\n}", "title": "" }, { "docid": "112d8f7caf9c163cb610bc826726227c", "score": "0.65588945", "text": "connect() {\n this.connection = db.createConnection({\n host: 'localhost',\n user: 'root',\n password: '',\n database: 'hr'\n })\n }", "title": "" }, { "docid": "c6adc785a38394a6a1636502f427345b", "score": "0.6556249", "text": "async function init () {\n await initMongo(process.env.MONGO_USER, process.env.MONGO_PWD, process.env.MONGO_HOST)\n await initHTTPServer()\n}", "title": "" }, { "docid": "fb002d2293884ff35dc806244f44fc9d", "score": "0.65381587", "text": "connect(){\r\n\t\t// Initiate connection w/parameters\r\n\t\tthis.db_connection = mysql.createConnection({\r\n host : 'localhost',\r\n user : 'root',\r\n password : 'sqlPW123!',\r\n database : this.db_name,\r\n\t\t\t dateStrings : true\r\n\t\t});\r\n\t\t\r\n\t\t// Execute connection\r\n\t\tthis.db_connection.connect(function(err){\r\n\t\t\tif (err) throw err;\r\n\t\t\tconsole.log(\"Successfully connected to SQL server\");\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "37bc52ffe89654bafd9a96dfaeb6bf6b", "score": "0.65286136", "text": "function connectDatabase() {\n return mongoose\n .connect(databaseUrl, {\n useNewUrlParser: true,\n useCreateIndex: true\n })\n .then(() => logger.info('connected to database'))\n .catch(error => {\n logger.error(error);\n process.exit(1);\n });\n}", "title": "" } ]
91e09287c5cf450a70c2b7b8bf7d366d
When the StateManager removes a state we want to remove the event listener
[ { "docid": "ccc97daa99872c07d2f3454f89856524", "score": "0.0", "text": "destroy() {\n this.test.removeListener(this.listener);\n }", "title": "" } ]
[ { "docid": "7bbd974eb3f62c23d5557b0147cb2321", "score": "0.6956169", "text": "off (event) {\n delete listeners[event];\n }", "title": "" }, { "docid": "127aa3bb93501f23ebfc04bb5f06c881", "score": "0.6872112", "text": "clearState() {\n this.events = null;\n }", "title": "" }, { "docid": "b56ab84235c3924ec368dc5e26ddd73d", "score": "0.6837216", "text": "off(eventName, cb) {\n this._events.removeListener(eventName, cb);\n }", "title": "" }, { "docid": "b56ab84235c3924ec368dc5e26ddd73d", "score": "0.6837216", "text": "off(eventName, cb) {\n this._events.removeListener(eventName, cb);\n }", "title": "" }, { "docid": "b162128c2c32038e96b2537e4e20b777", "score": "0.67744946", "text": "disconnectedCallback() {\n this.removeEventListener('tk.switcher.toggle', this.toggle, true);\n this.removeEventListener('click', this.switch, true);\n this.removeEventListener('keydown', this.keydown, true);\n }", "title": "" }, { "docid": "759aa0032ebbf6e5c8f17bc1ca6b0d6b", "score": "0.6750611", "text": "off(eventName) {\n delete this.events[eventName];\n}", "title": "" }, { "docid": "0802db99c113436373182ca3b9f95872", "score": "0.67344016", "text": "removeChangeListener( callback ){\n this.removeListener( CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "b842bf8a9ae7de343f6ea6909fcbf171", "score": "0.67270577", "text": "dispose() {\n this.__navigationHandler.removeListener(\n \"changeState\",\n this.__onChangeHash,\n this\n );\n }", "title": "" }, { "docid": "f93620eda63ad8a407ad2e2ce7968efb", "score": "0.6705097", "text": "disconnectedCallback() {\n this.removeEventListener('click', this._onClick)\n this.removeEventListener('keydown', this._onKeyDown)\n }", "title": "" }, { "docid": "7d1cf34e4dfdf5f0705a92dbf27411b4", "score": "0.667697", "text": "removeEventListener( type, listener ) { }", "title": "" }, { "docid": "90930953d4d06c8f141ebc65c4872b57", "score": "0.6664593", "text": "off(event, listener) {\n const listeners = this._listeners.get(event);\n if (listeners) {\n const index = listeners.findIndex((lo) => lo.listener === listener);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n }\n }", "title": "" }, { "docid": "aa04fc56cac92a56f0733933da1fa05e", "score": "0.6622138", "text": "removeListener(onChange) {\n const index = this._onChange.indexOf(onChange);\n if (index !== -1) {\n this._onChange.splice(index, 1);\n }\n }", "title": "" }, { "docid": "ff77e05bd3e1af0bb61dcd740ddeafe9", "score": "0.66174", "text": "removeListener(listener) {\r\n this.listeners = this.listeners.filter((l) => l !== listener);\r\n }", "title": "" }, { "docid": "5e70fc27a84af782beabeb5905bf8af5", "score": "0.6598526", "text": "off (eventName, callback) {\n _EventBus.$off(eventName, callback)\n }", "title": "" }, { "docid": "e934bb5d0248873109c7048d707f30b3", "score": "0.65505326", "text": "removeEventListeners(event) {\r\n delete listeners[event]\r\n }", "title": "" }, { "docid": "4f205edd6d3f9a67e87fa524239ae15c", "score": "0.65237665", "text": "removeEventListener(eventName, _function) {\n this.listener.removeEventListener(eventName, _function)\n }", "title": "" }, { "docid": "97cc0d7a5853cbb5d5f620ac5352590b", "score": "0.65122974", "text": "disconnectedCallback () {\n this.removeEventListener(\"click\", this.handleClick);\n this.clearTimer();\n }", "title": "" }, { "docid": "9d6d50dba2753aa0a6787b1072d973d4", "score": "0.65037096", "text": "unregisterEvents () {}", "title": "" }, { "docid": "fc9472356b81d4717873ac8f4481cbf3", "score": "0.6492043", "text": "removeListener(){\n if( this.listener != null ){\n this.node.vector1.dom.removeEventListener(\"pointerup\",this.listener);\n this.node.vector2.dom.removeEventListener(\"pointerup\",this.listener);\n }\n }", "title": "" }, { "docid": "dcaa4c7c83c148fbde1e39699939761b", "score": "0.64823484", "text": "function removeEventListener(handle) {\n GEvent.removeListener(handle);\n }", "title": "" }, { "docid": "a3fd19e1c602845ae20d99759a2bca20", "score": "0.64723426", "text": "function removeEventListeners(reference, state) {\r\n // Remove resize event listener on window\r\n window.removeEventListener('resize', state.updateBound);\r\n\r\n // Remove scroll event listener on scroll parents\r\n state.scrollParents.forEach(function (target) {\r\n target.removeEventListener('scroll', state.updateBound);\r\n });\r\n\r\n // Reset state\r\n state.updateBound = null;\r\n state.scrollParents = [];\r\n state.scrollElement = null;\r\n state.eventsEnabled = false;\r\n return state;\r\n}", "title": "" }, { "docid": "a3fd19e1c602845ae20d99759a2bca20", "score": "0.64723426", "text": "function removeEventListeners(reference, state) {\r\n // Remove resize event listener on window\r\n window.removeEventListener('resize', state.updateBound);\r\n\r\n // Remove scroll event listener on scroll parents\r\n state.scrollParents.forEach(function (target) {\r\n target.removeEventListener('scroll', state.updateBound);\r\n });\r\n\r\n // Reset state\r\n state.updateBound = null;\r\n state.scrollParents = [];\r\n state.scrollElement = null;\r\n state.eventsEnabled = false;\r\n return state;\r\n}", "title": "" }, { "docid": "23bc967c32cc91a07b43b24f36c7eaac", "score": "0.6467591", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n window.removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "23bc967c32cc91a07b43b24f36c7eaac", "score": "0.6467591", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n window.removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "23bc967c32cc91a07b43b24f36c7eaac", "score": "0.6467591", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n window.removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "09f06ce47046aee285af935f12366260", "score": "0.64446735", "text": "removeListener(eventType, listenerFunc) {\n let listenerList = this.onListeners.get(eventType);\n\n if (listenerList) {\n listenerList.removeListener(listenerFunc);\n }\n }", "title": "" }, { "docid": "2303498e126de2b27c29c00444ba296c", "score": "0.64371353", "text": "removeChangeListener(callback) {\n this.removeListener(CHANGE, callback);\n }", "title": "" }, { "docid": "0b5e30aaa58e474f7661d00a9992866a", "score": "0.642899", "text": "unbind() {\n Object.keys(this.events).forEach(event => {\n this.events[event].forEach(callback => {\n this.socket.removeListener(event, callback);\n });\n delete this.events[event];\n });\n }", "title": "" }, { "docid": "050c92dcf5437ca0bb912f75d8d0e044", "score": "0.64268345", "text": "onDestroyEvent() {\n // cancel the callback\n Melon.Events.unsubscribe(this.loaderHdlr);\n Melon.Events.unsubscribe(this.resizeHdlr);\n this.loaderHdlr = this.resizeHdlr = null;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.6422823", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.6422823", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.6422823", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.6422823", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.6422823", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "895454ccb32e086d18576f9f91386bf4", "score": "0.64156073", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n \n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n \n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "51f3538be3486b3cebd5fab29230b493", "score": "0.6413821", "text": "function removeEventListeners(reference, state) {\n\t // Remove resize event listener on window\n\t getWindow(reference).removeEventListener('resize', state.updateBound);\n\n\t // Remove scroll event listener on scroll parents\n\t state.scrollParents.forEach(function (target) {\n\t target.removeEventListener('scroll', state.updateBound);\n\t });\n\n\t // Reset state\n\t state.updateBound = null;\n\t state.scrollParents = [];\n\t state.scrollElement = null;\n\t state.eventsEnabled = false;\n\t return state;\n\t}", "title": "" }, { "docid": "0b8feafacd5c1baa08d23be2e9684a14", "score": "0.6400999", "text": "removeListener(eventType, callback) {\n if (this.listeners[eventType]) {\n const index = this.listeners[eventType].indexOf(callback);\n if (index > -1) {\n this.listeners[eventType].splice(index, 1);\n }\n }\n }", "title": "" }, { "docid": "cd0ba84c98d3f404a0ffaecbec7e8bfb", "score": "0.63992304", "text": "_unbindEvents() {\n this._internalPlayer.removeEventListener('onReady', this._playerReadyHandle);\n this._internalPlayer.removeEventListener('onError', this._playerErrorHandle);\n this._internalPlayer.removeEventListener('onStateChange', this._stateChangeHandle);\n }", "title": "" }, { "docid": "c49e484bda545f0f50ba823e69a957da", "score": "0.63922215", "text": "remove() {\n this.undelegateEvents();\n super.remove();\n }", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.63911986", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.63911986", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "b933057b500711366625b84c6130d27e", "score": "0.63900685", "text": "disconnectedCallback () {\n this._memoryGameBoard.removeEventListener('tileflipped', this._tileFlipped)\n this.removeEventListener('dragstart', this._onDragStart)\n this.removeEventListener('gameover', this._gameover)\n this._playAgainButton.removeEventListener('click', this._resetGame)\n this._picknameButton.removeEventListener(('click'), this._pickName)\n this._sizeButtons.forEach((sb) => sb.removeEventListener('click', this._pickNewGameBoardSize))\n this._pickNewNicknameButton.removeEventListener(('click'), this._openNickNameModal)\n this._settingsIcon.removeEventListener(('click'), this._toggleSettingsMenu)\n }", "title": "" }, { "docid": "970ccadf8958635555e387a6c52dbbf6", "score": "0.63798964", "text": "deregisterListeners() {\n this.eventManager.clearEvents(true);\n }", "title": "" }, { "docid": "4fb3303cf944a48084491144b2b4034f", "score": "0.63770604", "text": "unbind(eventName, listener) {\n const listeners = this.events[eventName]\n if (listeners) {\n listeners = listeners.filter(fn => fn !== listener)\n }\n }", "title": "" }, { "docid": "9119fa5732af020dcf9c22b20af2fbe5", "score": "0.6373853", "text": "unbindEvents() {\n window.removeEventListener('message', this.registerEventMessage, false);\n window.removeEventListener('hashchange', this.registerEventHashchange, false);\n }", "title": "" }, { "docid": "f58f872e249bea0be0e981cb6381593c", "score": "0.63518417", "text": "destroy()\n\t\t{\n\t\t\tthis.container.removeEventListener(\"click\", this.boundClickHandler);\n\t\t}", "title": "" }, { "docid": "f5a9fc5c1e0cb93a53d1cc032e379b41", "score": "0.6349339", "text": "reset() {\n this.resetState();\n window.removeEventListener('keydown', this.processEvent);\n window.removeEventListener('keyup', this.cleanCombo);\n }", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.6348326", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" } ]
bcb069108e45f2498aec582a9598363e
Disposes of the component. Calls `exitDocument`, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
[ { "docid": "89badf10e46a1015cc7753e746bd5a4d", "score": "0.7855092", "text": "disposeInternal() {\n\n if (this.isInDocument) {\n this.exitDocument();\n }\n\n // Disposes of the component's children, if any.\n if (this.children_) {\n [...this.children_.values()].forEach(child => child.disposeInternal());\n }\n\n this.outOfTreeElements.forEach(removeNode);\n\n // Detach the component's element from the DOM, unless it was decorated.\n this.element_ && removeNode(this.element_);\n this.placeholderDom_ && removeNode(this.placeholderDom_);\n\n this.children_ = null;\n this.element_ = void 0;\n this.model_ = null;\n this.parent_ = null;\n\n super.disposeInternal();\n }", "title": "" } ]
[ { "docid": "134ba2f64ab398c1eb5216a27f1c61e8", "score": "0.80584234", "text": "exitDocument() {\n // Propagate exitDocument to child components that have been rendered, if any.\n\n [...this.children_.values()].forEach(child => {\n if (child.isInDocument) {\n child.exitDocument();\n }\n });\n\n this.stopBeingListenedTo();\n this.removeAllListener();\n this.isInDocument = false;\n removeNode(this.getElement());\n this.placeholderDom_ && removeNode(this.placeholderDom_);\n }", "title": "" }, { "docid": "f1effba6efe0405379eb0db4fc975a57", "score": "0.6453899", "text": "dispose() {\n this._removeRootElementListeners(this._rootElement);\n // Do this check before removing from the registry since it'll\n // stop being considered as dragged once it is removed.\n if (this.isDragging()) {\n // Since we move out the element to the end of the body while it's being\n // dragged, we have to make sure that it's removed if it gets destroyed.\n removeNode(this._rootElement);\n }\n removeNode(this._anchor);\n this._destroyPreview();\n this._destroyPlaceholder();\n this._dragDropRegistry.removeDragItem(this);\n this._removeSubscriptions();\n this.beforeStarted.complete();\n this.started.complete();\n this.released.complete();\n this.ended.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this._moveEvents.complete();\n this._handles = [];\n this._disabledHandles.clear();\n this._dropContainer = undefined;\n this._resizeSubscription.unsubscribe();\n this._parentPositions.clear();\n this._boundaryElement = this._rootElement = this._ownerSVGElement = this._placeholderTemplate =\n this._previewTemplate = this._anchor = null;\n }", "title": "" }, { "docid": "66c8b243de95c0d1adb5b7a0a583ecef", "score": "0.6340793", "text": "dispose() {\n document.body.removeEventListener('click', this._onClick);\n this.expandables.forEach(item => item.dispose());\n }", "title": "" }, { "docid": "7f88a5d780e8616ad4c9bcdc191709b9", "score": "0.6222339", "text": "dispose() {\n this._stopScrolling();\n this._stopScrollTimers.complete();\n this._viewportScrollSubscription.unsubscribe();\n this.beforeStarted.complete();\n this.entered.complete();\n this.exited.complete();\n this.dropped.complete();\n this.sorted.complete();\n this._activeSiblings.clear();\n this._scrollNode = null;\n this._parentPositions.clear();\n this._dragDropRegistry.removeDropContainer(this);\n }", "title": "" }, { "docid": "27d5bc310089865be7ff967780f7a9c4", "score": "0.617881", "text": "close()\n\t{\n\t\tif (!this._renderer)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis._rootContainer.destroy();\n\t\t\n\t\tif (document.body.contains(this._renderer.view))\n\t\t{\n\t\t\tdocument.body.removeChild(this._renderer.view);\n\t\t}\n\n\t\t// destroy the renderer and the WebGL context:\n\t\tif (typeof this._renderer.gl !== \"undefined\")\n\t\t{\n\t\t\tconst extension = this._renderer.gl.getExtension(\"WEBGL_lose_context\");\n\t\t\textension.loseContext();\n\t\t}\n\n\t\tthis._renderer.destroy();\n\n\t\twindow.removeEventListener(\"resize\", this._resizeCallback);\n\t\twindow.removeEventListener(\"orientationchange\", this._resizeCallback);\n\n\t\tthis._renderer = null;\n\t}", "title": "" }, { "docid": "1fca54bc3ab08f5a5cf6965e9e028e81", "score": "0.61353165", "text": "destroy () {\n this.__component.__destroy()\n this.__htmlWatcher.disconnect()\n }", "title": "" }, { "docid": "7d4937ad3a2ed1b81cf7cea3313b6522", "score": "0.6131746", "text": "dispose() {\n super.dispose();\n if (this.outletElement.parentNode != null) {\n this.outletElement.parentNode.removeChild(this.outletElement);\n }\n }", "title": "" }, { "docid": "7d4937ad3a2ed1b81cf7cea3313b6522", "score": "0.6131746", "text": "dispose() {\n super.dispose();\n if (this.outletElement.parentNode != null) {\n this.outletElement.parentNode.removeChild(this.outletElement);\n }\n }", "title": "" }, { "docid": "79288bc9e198ff0de44580c72345e8c9", "score": "0.61305964", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.TextComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "c7652a1d52ec8b08f535b0f93fca3254", "score": "0.60299367", "text": "destroy() {\n if (!this.initialized) {\n return;\n }\n if (elm(this.contElTgtId)) {\n elm(this.contElTgtId).innerHTML = '';\n } else {\n this.contEl.innerHTML = '';\n removeElm(this.contEl);\n this.contEl = null;\n }\n this.btnEl.innerHTML = '';\n removeElm(this.btnEl);\n this.btnEl = null;\n\n this.emitter.off(['hide-column'],\n (tf, colIndex) => this.hideCol(colIndex));\n\n this.boundMouseup = null;\n\n this.initialized = false;\n }", "title": "" }, { "docid": "5e3bbfce6b7400beea9f545c571b8308", "score": "0.6000948", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.DeltaComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "f2421e0fd1fcad015d1c5d532dbc31e3", "score": "0.599442", "text": "dispose() {\n if (this.svgGroup_) {\n Blockly.utils.dom.removeNode(this.svgGroup_);\n }\n if (this.onChangeWrapper_) {\n Blockly.unbindEvent_(this.onChangeWrapper_);\n }\n }", "title": "" }, { "docid": "22633f61b643c087bf613dbb343227d6", "score": "0.598922", "text": "componentWillUnmount() {\n\t\tdocument.removeEventListener('click', this.handleDocumentClick);\n\t}", "title": "" }, { "docid": "9cbb322716d58e6f201e7485f901cf6e", "score": "0.59861296", "text": "componentWillUnmount() {\n document.removeEventListener('click', this.onDocClickHandler);\n }", "title": "" }, { "docid": "45d97f65dc78ca0608200a2f8fd054fc", "score": "0.5984739", "text": "dispose() {\n super.dispose();\n this.outletElement.remove();\n }", "title": "" }, { "docid": "8b2cccc0143322546564e511bc755c00", "score": "0.5983928", "text": "onDOMNodeRemoved() {\n this.destroy();\n }", "title": "" }, { "docid": "8aa8efc26b321ce9b812f850343eea7d", "score": "0.596952", "text": "destroy() {\n this._unbindEvents();\n this._listeners.length = 0;\n delete this.el;\n }", "title": "" }, { "docid": "bb0b2b09cd2a69f98055535298835254", "score": "0.59633195", "text": "destroy() {\n if (!this.isDestroying) {\n this.close();\n return;\n }\n\n this.dispatch('destroy');\n\n this.listeners = null;\n\n this.scrollWrap.ontouchmove = null;\n this.scrollWrap.ontouchend = null;\n\n this.template.remove();\n this.events.removeAll();\n }", "title": "" }, { "docid": "577f34875054edf198a4aed4e2ccf002", "score": "0.59615695", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.Component_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "234678638c6d1c902af986f453c5721a", "score": "0.596062", "text": "dispose() {\n let node = this.props.node\n node.off(this)\n }", "title": "" }, { "docid": "b99e027628f0b679a59a0b2d0d468877", "score": "0.5958956", "text": "_clean() {\n for (var i = 0; i < this.domElements.length; i++) {\n this.wrapper.removeChild(this.domElements[i]);\n }\n\n if (this.wrapper !== undefined) {\n this.container.removeChild(this.wrapper);\n this.wrapper = undefined;\n }\n this.domElements = [];\n\n this._removePopup();\n }", "title": "" }, { "docid": "017507cb552ae3b138a88319d1b8ddf8", "score": "0.5937171", "text": "dispose() {\n const isAttached = this.hasAttached();\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._disposeScrollStrategy();\n this.detachBackdrop();\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n this._outsidePointerEvents.complete();\n this._outsideClickDispatcher.remove(this);\n if (this._host && this._host.parentNode) {\n this._host.parentNode.removeChild(this._host);\n this._host = null;\n }\n this._previousHostParent = this._pane = null;\n if (isAttached) {\n this._detachments.next();\n }\n this._detachments.complete();\n }", "title": "" }, { "docid": "ac1d84c80bb014a76005fc34da5b3c12", "score": "0.59357435", "text": "dispose() {\n const isAttached = this.hasAttached();\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._disposeScrollStrategy();\n this.detachBackdrop();\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n this._outsidePointerEvents.complete();\n // @breaking-change 9.0.0 remove the null check for `_outsideClickDispatcher`\n if (this._outsideClickDispatcher) {\n this._outsideClickDispatcher.remove(this);\n }\n if (this._host && this._host.parentNode) {\n this._host.parentNode.removeChild(this._host);\n this._host = null;\n }\n this._previousHostParent = this._pane = null;\n if (isAttached) {\n this._detachments.next();\n }\n this._detachments.complete();\n }", "title": "" }, { "docid": "ac1d84c80bb014a76005fc34da5b3c12", "score": "0.59357435", "text": "dispose() {\n const isAttached = this.hasAttached();\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n this._disposeScrollStrategy();\n this.detachBackdrop();\n this._locationChanges.unsubscribe();\n this._keyboardDispatcher.remove(this);\n this._portalOutlet.dispose();\n this._attachments.complete();\n this._backdropClick.complete();\n this._keydownEvents.complete();\n this._outsidePointerEvents.complete();\n // @breaking-change 9.0.0 remove the null check for `_outsideClickDispatcher`\n if (this._outsideClickDispatcher) {\n this._outsideClickDispatcher.remove(this);\n }\n if (this._host && this._host.parentNode) {\n this._host.parentNode.removeChild(this._host);\n this._host = null;\n }\n this._previousHostParent = this._pane = null;\n if (isAttached) {\n this._detachments.next();\n }\n this._detachments.complete();\n }", "title": "" }, { "docid": "75d84e8645556b44beb697529147a486", "score": "0.5921888", "text": "dispose() {\n const self = this;\n toggleCollapseHandler(self);\n\n super.dispose();\n }", "title": "" }, { "docid": "a3679231baefbd296bb227757eb2f83c", "score": "0.59203494", "text": "function doCloseDocument() {\n var doc = mindmapModel.getDocument();\n if (doc) {\n // TODO for now simply publish events, should be intercepted by\n // someone\n mindmapModel.setDocument(null);\n }\n }", "title": "" }, { "docid": "e1c9479852411d48119397128fba049a", "score": "0.59091127", "text": "destroy() {\n this.rootElement.remove()\n }", "title": "" }, { "docid": "d2cc69bf58046af3376bbfb915a22043", "score": "0.59063286", "text": "_onDestroy() {\n if (this._renderArgs) {\n this._renderArgs.reject(\"render_canceled_by_update\");\n this._renderArgs = undefined;\n }\n this._rejectOnDone();\n const extender = this._extenderInstance;\n if (extender && typeof extender.beforeDestroy === \"function\") {\n extender.beforeDestroy(this);\n }\n if (this._resizeObserver !== undefined) {\n this._resizeObserver.disconnect();\n }\n this.tryWithMonaco(monaco => monaco.dispose(), undefined);\n if (extender && typeof extender.afterDestroy === \"function\") {\n extender.afterDestroy(this);\n }\n }", "title": "" }, { "docid": "eb86c8319541556c601349e7c3ee4d40", "score": "0.5904151", "text": "dispose() {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =\n styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';\n this._overlayRef = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "eb86c8319541556c601349e7c3ee4d40", "score": "0.5904151", "text": "dispose() {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =\n styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';\n this._overlayRef = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "eb86c8319541556c601349e7c3ee4d40", "score": "0.5904151", "text": "dispose() {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =\n styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';\n this._overlayRef = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "c35f4a55340f253d2f35dd10a64f8878", "score": "0.5893946", "text": "dispose() {\n if (this._isDisposed || !this._overlayRef) {\n return;\n }\n\n const styles = this._overlayRef.overlayElement.style;\n const parent = this._overlayRef.hostElement;\n const parentStyles = parent.style;\n parent.classList.remove(wrapperClass);\n parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop = styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';\n this._overlayRef = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "18f51cf62d64688acce37cf6ee992ec0", "score": "0.58903867", "text": "function dispose() {\n /*jshint validthis: true */\n forEach(listeners, disposeAllListeners.bind(this));\n listeners = undefined;\n delete this.element;\n }", "title": "" }, { "docid": "7428ccc005d72b0f618e24b84c94de03", "score": "0.58799475", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.GraphComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "a023bbb4f43568add9390a6f56e91009", "score": "0.58781856", "text": "dispose() {\n const isAttached = this.hasAttached();\n\n if (this._positionStrategy) {\n this._positionStrategy.dispose();\n }\n\n this._disposeScrollStrategy();\n\n this._disposeBackdrop(this._backdropElement);\n\n this._locationChanges.unsubscribe();\n\n this._keyboardDispatcher.remove(this);\n\n this._portalOutlet.dispose();\n\n this._attachments.complete();\n\n this._backdropClick.complete();\n\n this._keydownEvents.complete();\n\n this._outsidePointerEvents.complete();\n\n this._outsideClickDispatcher.remove(this);\n\n this._host?.remove();\n this._previousHostParent = this._pane = this._host = null;\n\n if (isAttached) {\n this._detachments.next();\n }\n\n this._detachments.complete();\n }", "title": "" }, { "docid": "e63aca53c2c1d515d9773c78926a1966", "score": "0.5873313", "text": "cleanUp() {\n if (!this._element) {\n return;\n }\n for (const prop in this.props) {\n if (!this.props.hasOwnProperty(prop)) {\n continue;\n }\n if (this.isEventProp(prop, this.props)) {\n this._element.removeEventListener(prop[2].toLowerCase() + prop.substring(3), this.props[prop]);\n }\n }\n this._element = null;\n }", "title": "" }, { "docid": "2bf1273a77abde9b118474ff12a26217", "score": "0.5864532", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.TextComponentState_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "e0f0c7c491bf9bb1d9352593479eb415", "score": "0.5861971", "text": "componentWillUnmount() {\n document.removeEventListener('click', this.docClickHandler);\n }", "title": "" }, { "docid": "c7c5c5bca057b79aa29c43287857d6a5", "score": "0.5858993", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.Layout_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "6aff13db220f92cbde856087bebf03d8", "score": "0.58568066", "text": "dispose() {\n try {\n this._decoration.dispose();\n this.disposed = true;\n }\n catch (error) {\n // do something\n }\n }", "title": "" }, { "docid": "fa69a2be6b891a969478492122f48260", "score": "0.58441675", "text": "dispose() {\n const parent = this.firstChild.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n while (current !== end) {\n next = current.nextSibling;\n parent.removeChild(current);\n current = next;\n }\n parent.removeChild(end);\n const behaviors = this.behaviors;\n const oldSource = this.source;\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n behaviors[i].unbind(oldSource);\n }\n }", "title": "" }, { "docid": "26cdfe87bdcf206816ac19f4d0df555d", "score": "0.5840274", "text": "destroy() {\n this.setTargetElement(null), this.renderer = null;\n }", "title": "" }, { "docid": "91a596343cdd1f008ce70be49b165cbc", "score": "0.5834186", "text": "dispose() {\n super.dispose();\n\n if (this.onStartWrapper_) {\n browserEvents.unbind(this.onStartWrapper_);\n }\n }", "title": "" }, { "docid": "e383563cfd06d690328c1471a0a01dc0", "score": "0.58341175", "text": "detachFromDom() {\n\t\tsuper.destroy();\n\n\t\tif ( this._bodyCollectionContainer ) {\n\t\t\tthis._bodyCollectionContainer.remove();\n\t\t}\n\n\t\tconst wrapper = document.querySelector( '.ck-body-wrapper' );\n\n\t\tif ( wrapper && wrapper.childElementCount == 0 ) {\n\t\t\twrapper.remove();\n\t\t}\n\t}", "title": "" }, { "docid": "c40472d770d1cbb537c8fac1c4bec70c", "score": "0.5830031", "text": "destroy() {\n document.body.removeChild(this.element);\n }", "title": "" }, { "docid": "72bbd956ffd908fa11e2ce5656c76c22", "score": "0.5824139", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.SumOfBestComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "ab1aa0aa9c42931028ea7c8d982000e9", "score": "0.5819219", "text": "destroy () {\n this.editor = null\n this.dom.container.removeChild(this.dom.wrapper)\n this.dom = null\n\n this.results = null\n this.activeResult = null\n\n this._clearDelay()\n }", "title": "" }, { "docid": "853f7b87c37d00bd61781e2437ac64ef", "score": "0.58106714", "text": "clean() {\n // remove the listeners of this component in the eventBus\n this.eventBus?.clear(this.name, (k) => k !== Component.LOAD)\n // clean the children\n this.removeChildren()\n this.empty()\n }", "title": "" }, { "docid": "868d867eedcfe6da117b318f0714e561", "score": "0.580145", "text": "close() {\n if (this.isOpen()) {\n this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView));\n this._cRef = null;\n this.closed.emit();\n this._changeDetector.markForCheck();\n // restore focus\n let elementToFocus = this._elWithFocus;\n if (isString(this.restoreFocus)) {\n elementToFocus = this._document.querySelector(this.restoreFocus);\n }\n else if (this.restoreFocus !== undefined) {\n elementToFocus = this.restoreFocus;\n }\n // in IE document.activeElement can contain an object without 'focus()' sometimes\n if (elementToFocus && elementToFocus['focus']) {\n elementToFocus.focus();\n }\n else {\n this._document.body.focus();\n }\n }\n }", "title": "" }, { "docid": "023f2a570a8381a593cd034233fbe2e9", "score": "0.58001965", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.PotentialCleanUp_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "e3bf40de18afb8e55043586c43f1d3e3", "score": "0.5790821", "text": "dispose() {\n const parent = this.firstChild.parentNode;\n const end = this.lastChild;\n let current = this.firstChild;\n let next;\n\n while (current !== end) {\n next = current.nextSibling;\n parent.removeChild(current);\n current = next;\n }\n\n parent.removeChild(end);\n const behaviors = this.behaviors;\n const oldSource = this.source;\n\n for (let i = 0, ii = behaviors.length; i < ii; ++i) {\n behaviors[i].unbind(oldSource);\n }\n }", "title": "" }, { "docid": "98630d93b131c622492231ec57ea6d81", "score": "0.5781573", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.BlankSpaceComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "d9239f1bc1c003c3aa070a47458992e9", "score": "0.5776787", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.DeltaComponentState_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "bce417463d3748a01dbc0158c9c1912d", "score": "0.5769329", "text": "dispose() {\n if (this._isDisposed) {\n return;\n }\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "bce417463d3748a01dbc0158c9c1912d", "score": "0.5769329", "text": "dispose() {\n if (this._isDisposed) {\n return;\n }\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "bce417463d3748a01dbc0158c9c1912d", "score": "0.5769329", "text": "dispose() {\n if (this._isDisposed) {\n return;\n }\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "bce417463d3748a01dbc0158c9c1912d", "score": "0.5769329", "text": "dispose() {\n if (this._isDisposed) {\n return;\n }\n // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n this.detach();\n this._positionChanges.complete();\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "c9a8ddef3568c012cfdbbd2d3e978e70", "score": "0.57648283", "text": "_removeClickToDocument(){\n document.removeEventListener('click', this._clickOnDoc)\n }", "title": "" }, { "docid": "4028ef332788fa0677aa342e0ba42bcb", "score": "0.5762179", "text": "destroy() {\n this.disable();\n\n if (this.container.domNavigator) {\n delete this.container.domNavigator;\n }\n }", "title": "" }, { "docid": "9544bcc4562e926811b6b99c6b4b33a7", "score": "0.57552797", "text": "destroy() {\n this.destroyTouchHook(), this.div = null, globalThis.document.removeEventListener(\"mousemove\", this._onMouseMove, !0), globalThis.removeEventListener(\"keydown\", this._onKeyDown), this.pool = null, this.children = null, this.renderer = null;\n }", "title": "" }, { "docid": "f102d9dfb3586862e2ae9c21d9bf0f88", "score": "0.5741288", "text": "dispose() {\n this.renderTargets.forEach(renderTarget => renderTarget.dispose());\n }", "title": "" }, { "docid": "5894a33667c526153b2c5e9333a94a9a", "score": "0.57343787", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.SeparatorComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "610752fcfbdcd2519fe404675299d32d", "score": "0.57311344", "text": "destroy() {\n let instance = this;\n instance.eventHandlers.forEach(({el, handlers}) => {\n Object.keys(handlers).forEach(event => el.removeEventListener(event, handlers[event], false));\n });\n instance.widget.parentNode.removeChild(instance.widget);\n instance.eventHandlers = instance.widget = instance.container = instance.scrollBody = null;\n }", "title": "" }, { "docid": "19b85a1ef71d7c33a5700eaa89b1da64", "score": "0.5729042", "text": "dispose() {\n this.handleMouseOut();\n super.dispose();\n }", "title": "" }, { "docid": "bc903c26e9a911fabe830b68d48ffedb", "score": "0.57266253", "text": "dispose() {\n if (this.isDisposed) {\n return;\n }\n super.dispose();\n if (this._view) {\n this._view.remove();\n }\n this._view = null;\n }", "title": "" }, { "docid": "1bd9503cb04b9093f451dd9dac350604", "score": "0.57144827", "text": "dispose() {\n this.renderTargets_.forEach(renderTarget => {\n renderTarget.dispose();\n });\n }", "title": "" }, { "docid": "3204c5ca3266c71a5600eaa231ed5419", "score": "0.5701055", "text": "unload(){this.document=void 0,this.contents=void 0,this.output=void 0}", "title": "" }, { "docid": "b199178b6fdf217502c29f8a45a34914", "score": "0.5690946", "text": "function finishedRenderingComponent_() {\n\t\trenderingComponents_.pop();\n\t\tif (renderingComponents_.length === 0) {\n\t\t\t(0, _unused.disposeUnused)();\n\t\t}\n\t}", "title": "" }, { "docid": "3e3541e3e2dfe5d6a3b773b5cb228ab9", "score": "0.56882966", "text": "function detachDocumentEvent() {\n $document.off('click', hideSubtemplate);\n }", "title": "" }, { "docid": "3e3541e3e2dfe5d6a3b773b5cb228ab9", "score": "0.56882966", "text": "function detachDocumentEvent() {\n $document.off('click', hideSubtemplate);\n }", "title": "" }, { "docid": "3e3541e3e2dfe5d6a3b773b5cb228ab9", "score": "0.56882966", "text": "function detachDocumentEvent() {\n $document.off('click', hideSubtemplate);\n }", "title": "" }, { "docid": "b1002e3ac41b9f3b27fa469327be0ad1", "score": "0.56829894", "text": "removeComponent() {\n if (this.ptr == 0) {\n throw \"this is disposed\";\n }\n instance().exports.LayoutEditor_remove_component(this.ptr);\n }", "title": "" }, { "docid": "11b28f31a620c0424ca075ca7fce80f1", "score": "0.567437", "text": "dispose() {\n const self = this;\n const { parentElement } = self;\n\n if (hasClass(parentElement, showClass) && self.open) self.hide();\n\n toggleDropdownHandler(self);\n\n super.dispose();\n }", "title": "" }, { "docid": "76ee63b7a657fc65278546f021b3d68b", "score": "0.56660706", "text": "dispose() {\n\n\t\tif ( this._animationId != - 1 ) {\n\n\t\t\twindow.cancelAnimationFrame( this._animationId );\n\n\t\t}\n\n\t\tthis.domElement.removeEventListener( 'pointerdown', this._onPointerDown );\n\t\tthis.domElement.removeEventListener( 'pointercancel', this._onPointerCancel );\n\t\tthis.domElement.removeEventListener( 'wheel', this._onWheel );\n\t\tthis.domElement.removeEventListener( 'contextmenu', this._onContextMenu );\n\n\t\twindow.removeEventListener( 'pointermove', this._onPointerMove );\n\t\twindow.removeEventListener( 'pointerup', this._onPointerUp );\n\n\t\twindow.removeEventListener( 'resize', this._onWindowResize );\n\n\t\tif ( this.scene !== null ) this.scene.remove( this._gizmos );\n\t\tthis.disposeGrid();\n\n\t}", "title": "" }, { "docid": "4c2b644d2af1c24ddb913788ac8b0093", "score": "0.5655139", "text": "destroy() {\n\t\tfor ( const observer of this._observers.values() ) {\n\t\t\tobserver.destroy();\n\t\t}\n\n\t\tthis.document.destroy();\n\n\t\tthis.stopListening();\n\t}", "title": "" }, { "docid": "4c2b644d2af1c24ddb913788ac8b0093", "score": "0.5655139", "text": "destroy() {\n\t\tfor ( const observer of this._observers.values() ) {\n\t\t\tobserver.destroy();\n\t\t}\n\n\t\tthis.document.destroy();\n\n\t\tthis.stopListening();\n\t}", "title": "" }, { "docid": "970b9f101bd7b27c35ee63fcc2af342c", "score": "0.5654989", "text": "dispose() {\n if (this._isDisposed) {\n return;\n } // We can't use `_resetBoundingBoxStyles` here, because it resets\n // some properties to zero, rather than removing them.\n\n\n if (this._boundingBox) {\n extendStyles(this._boundingBox.style, {\n top: '',\n left: '',\n right: '',\n bottom: '',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: ''\n });\n }\n\n if (this._pane) {\n this._resetOverlayElementStyles();\n }\n\n if (this._overlayRef) {\n this._overlayRef.hostElement.classList.remove(boundingBoxClass);\n }\n\n this.detach();\n\n this._positionChanges.complete();\n\n this._overlayRef = this._boundingBox = null;\n this._isDisposed = true;\n }", "title": "" }, { "docid": "8a5876853ace22c19f0425727e93960e", "score": "0.56528604", "text": "enterDocument() {\n\n // First check if I am disposed. If so, don't enter the document.\n // This may happen on slow networks where the user clicks multiple times\n // and multiple queries are in flight...\n if (this.disposed) {\n removeNode(this.getElement());\n } else {\n\n this.isInDocument = true;\n\n // Propagate enterDocument to child components that have a DOM, if any.\n // If a child was decorated before entering the document its enterDocument\n // will be called here.\n [...this.children_.values()].forEach(child => {\n if (!child.isInDocument && child.getElement()) {\n child.enterDocument();\n }\n });\n\n this.executeBeforeReady();\n this.dispatchCompEvent(UiEventType.READY);\n }\n\n }", "title": "" }, { "docid": "4863a0b8ad5325aa6092b1d7c56572a5", "score": "0.5650591", "text": "close(e) {\n e.preventDefault();\n this.element.classList.add('fadeOut');\n enableBodyScroll(this.element);\n document.removeEventListener('keyup', this.onKeyUp);\n }", "title": "" }, { "docid": "2480a66784b9d891dfca6c3bb2fc5ff3", "score": "0.5649468", "text": "_destroy() {\n this._destroySearchTerms();\n this._deleteImg.removeEventListener('click', this._boundDestroy);\n this._invField.clearEvents();\n\n this._parentElem.remove();\n\n this.__dispatchEvent(EVENT_OBJECT_DESTROYED, new ObjectDestroyedEventArgs(this));\n }", "title": "" }, { "docid": "298bd563450cb84b8c212cb990a71da7", "score": "0.56413066", "text": "close() {\n this.unregisterAllEventListeners();\n }", "title": "" }, { "docid": "6fa7390e13e9e7849276feab4d0c6e75", "score": "0.5633866", "text": "componentWillUnmount() {\n document.removeEventListener('keydown', this.handleClose, true);\n document.removeEventListener('focus', this.handleFocus, true);\n this.lastActive && this.lastActive.focus();\n document.getElementsByClassName('i3-ww-popups')[0].removeChild(this.node);\n }", "title": "" }, { "docid": "8b2cfb49f939498b64a1fe919fdbd1a5", "score": "0.5627076", "text": "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "title": "" }, { "docid": "8b2cfb49f939498b64a1fe919fdbd1a5", "score": "0.5627076", "text": "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "title": "" }, { "docid": "8b2cfb49f939498b64a1fe919fdbd1a5", "score": "0.5627076", "text": "destroy() {\n this.teardown();\n $.removeData(this.element[0], COMPONENT_NAME);\n }", "title": "" }, { "docid": "bd3eabaf16effb4967f8064c8991cab2", "score": "0.56133157", "text": "function detachDocumentEvent() {\n $document.off('click', onDocumentClick);\n }", "title": "" }, { "docid": "09e523fb2184aab0942564a20e5cb9e5", "score": "0.5612199", "text": "function finishedRenderingComponent_() {\n\t\trenderingComponents_.pop();\n\t\tif (renderingComponents_.length === 0) {\n\t\t\tdisposeUnused();\n\t\t}\n\t}", "title": "" }, { "docid": "94acc17604c3d922dd823690934a948f", "score": "0.56061465", "text": "destroy() {\n this.removeDOMListeners();\n this.unsubsribers.forEach(unsub => unsub());\n }", "title": "" }, { "docid": "727a5cad113b95b7e7b8bf538f79c09e", "score": "0.56010145", "text": "remove() {\n\t\tthis._rootElement.remove();\n\t}", "title": "" }, { "docid": "a6931e92f6cb6dfbb774b57d8faa2cb8", "score": "0.56005806", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.GraphComponentState_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "2ca614324c5a141a03194cb82b11f436", "score": "0.55883414", "text": "dispose() {\n const self = this;\n self.hide(true);\n toggleOffcanvasEvents(self);\n super.dispose();\n }", "title": "" }, { "docid": "1800717547e1f1ba89241e186674c948", "score": "0.55860424", "text": "dispose() {\n if (this.hasAttached()) {\n this.detach();\n }\n\n this._invokeDisposeFn();\n\n this._isDisposed = true;\n }", "title": "" }, { "docid": "c7e3e5d986d23862b492dcae0715b409", "score": "0.5580745", "text": "dispose() {\n clearTimeout(this.scrollTimeout);\n clearTimeout(this.wheelTimeout);\n this.disable();\n this.element = null;\n }", "title": "" }, { "docid": "d7d2d5f73949a9d67a94e747f03bb359", "score": "0.55804145", "text": "destroy() {\n if (this.disposables) {\n this.disposables.dispose();\n }\n }", "title": "" }, { "docid": "d7d2d5f73949a9d67a94e747f03bb359", "score": "0.55804145", "text": "destroy() {\n if (this.disposables) {\n this.disposables.dispose();\n }\n }", "title": "" }, { "docid": "cb658f74d2529864365a777bcffec323", "score": "0.55701977", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.CurrentPaceComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "de803bc2507ad89399ffcfc1ebc24cf3", "score": "0.55612177", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.SumOfBestComponentState_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "4496ec744e83e2200cb5575067e41e0d", "score": "0.5561113", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.TitleComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "be1c75767284629053b5345df7578049", "score": "0.5558411", "text": "unload() {\n this.document = undefined;\n this.contents = undefined;\n this.output = undefined;\n }", "title": "" }, { "docid": "4eb7cc7a2d433da1b2c4b2273152d449", "score": "0.5555346", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.Run_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" } ]
ddc454a643cfb3628b50f99e414ad67e
Handles sales interaction with the backend.
[ { "docid": "89fd9ee5074959fe5d9086d85cfafd39", "score": "0.52877307", "text": "function salesAPI($http) {\n\t'use strict';\n\n\t/**\n\t * Get the initial supply quantities for the day.\n\t **/\n\tvar getSalesRecords = function() {\n\t \treturn $http({\n\t \t\t\tmethod: 'GET', \n\t \t\t\turl: '/data/sales'\n\t \t\t});\n\t};\t\n\n\t//API\n\treturn {\n\t\tgetSalesRecords: getSalesRecords\n\t};\n\n}", "title": "" } ]
[ { "docid": "851ed0fc9d650c14d1d37ce591f8d518", "score": "0.68831146", "text": "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "title": "" }, { "docid": "14efe4fad5a2b74d69df8f40a2c5bdcf", "score": "0.6615057", "text": "function processDailySales(currentStore){\n currentStore.initializeCustomers();\n currentStore.calculateCookies();\n currentStore.calculateTotalSale();\n\n\n}", "title": "" }, { "docid": "ac0c25fe0956817381f1c3ba0867cfa3", "score": "0.6302544", "text": "salesCreate(event, data) {\n event.preventDefault();\n axios.post('/api/orders', data)\n .then((res) => {\n if (res.status === 200) {\n // add newest order id as new key/value into data\n data.latestOrderId = res.data.last_order.order_id;\n\n // trigger modal pop up to notify that sales has created\n this.salesCreatedToggle('success');\n this.getOrders();\n this.getInventoryCosts()\n\n // axios call to update useditem table and in inventory table in database\n axios.post('/api/useditems', data)\n\n } else {\n this.salesCreatedToggle('failed');\n }\n })\n\n }", "title": "" }, { "docid": "eb9484a92e769cad63ffed0b453a02ad", "score": "0.61571145", "text": "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7973997346ffce876bf9fd0ec793ad26", "score": "0.6145359", "text": "async addSale() {\n\t\t\tif(this.addedName == ''){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.calcCommission();\n\t\t\tthis.oldDate = this.addedDate;\n\t\t\ttry {\n\t\t\t\tlet r1 = await axios.post(\"/api/sales\",{\n\t\t\t\t\tname: this.addedName,\n\t\t\t\t\tdate: this.addedDate,\n\t\t\t\t\tcontractValue: this.totalContractValue,\n\t\t\t\t\tcommission: this.commission,\n\t\t\t\t\tpaid: false,\n\t\t\t\t});\n\t\t\t\t//call functions that incriment local variables. \n\t\t\t\tthis.salescount += 1;\n\t\t\t\tthis.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\tthis.clearValues();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "cd5f7b2697811966250c20d103ca0e29", "score": "0.608894", "text": "async updateSale(saleID, storeID) {\n\n}", "title": "" }, { "docid": "b663004144cee64e5866ff40b14a7018", "score": "0.5879455", "text": "function handleSales(currentSalesDtls) {\n var line = salesArray[currentSalesDtls];\n var sales = {\n \"region\": line[0]\n , \"country\": line[1]\n , \"itemType\": line[2]\n , \"orderId\": line[6]\n , \"totalRevenue\": line[11]\n , \"totalCost\": line[12]\n , \"totalProfit\": line[13]\n };\n // produce sales message to Kafka\n produceSalesMessage(sales)\n // schedule this function to process next sales record after a random delay of between averageDelay plus or minus spreadInDelay )\n var delay = averageDelay + (Math.random() - 0.5) * spreadInDelay;\n //note: use bind to pass in the value for the input parameter currentSalesDtls\n setTimeout(handleSales.bind(null, currentSalesDtls + 1), delay);\n}", "title": "" }, { "docid": "a2410a107ad4ede5bea611c4edc714c9", "score": "0.58768916", "text": "function productsForSale() {\n // console.log(\"Here are the items in stock: \");\n connection.query(\"SELECT * FROM products\", function(err, response) {\n //if there is an error, console log the error\n if (err) {throw err;\n } else {\n // if no error log all results of the SELECT statement\n console.table(response);\n }\n //calls function that prompts customer request\n likeToBuy();\n });\n}", "title": "" }, { "docid": "b2ff8f50fdcc9eacb5ee14d23d36bc96", "score": "0.58696234", "text": "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "title": "" }, { "docid": "f087f7b62bd4c4ef768eb811154ff5fe", "score": "0.58658546", "text": "function forSale() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n table(res);\n shop();\n });\n}", "title": "" }, { "docid": "93bce8b772453c0f8ccad1e574a98dc8", "score": "0.5852119", "text": "function updateProductSale() {\n // select the item in database\n connection.query(\"SELECT price, id FROM products WHERE id =?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // update sales of item in database\n connection.query(\"UPDATE products SET product_sales=product_sales + ? WHERE id=?\",\n [\n (parseFloat(res[0].price) * quantityToBuy),\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n viewAll();\n })\n }\n )\n}", "title": "" }, { "docid": "e8062d2fedf8fed12a3120fec85f9384", "score": "0.5811273", "text": "function viewDeptSales() {\n salesByDept();\n}", "title": "" }, { "docid": "4e0cde9224e963da5f8cbe9c82df34c5", "score": "0.580883", "text": "function viewProductsForSale(runMgrView, cb) {\n\n // console.log(\"Inside viewProductsForSale()\");\n\n let queryString = \"SELECT * FROM products\";\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n console.log(\"\\t\\t\\t\\t---- Products for sale ---- \\n\");\n\n console.log(\"\\tITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"ITEM PRICE\" + \"\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\t-------\" + \"\\t\\t|\\t\" + \"---------\" + \"\\t\\t|\\t\" + \"----------\" + \"\\t|\\t\" + \"--------\");\n\n res.forEach(item =>\n console.log(\"\\t\" + item.item_id + \"\\t\\t|\\t\" + item.product_name + \"\\t\\t|\\t\" + item.price.toFixed(2) + \"\\t\\t|\\t\" + item.stock_quantity)\n );\n\n if (runMgrView) {\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n } else {\n cb();\n }\n\n });\n\n\n}", "title": "" }, { "docid": "83f6a2dabaf0b55287f797351b86b3b4", "score": "0.5804602", "text": "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 }", "title": "" }, { "docid": "f19e395ae6dd7e96adcd0194d8d92cd6", "score": "0.5802161", "text": "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "title": "" }, { "docid": "bcb199be9796ef4360abe6436c2bd70d", "score": "0.58007336", "text": "constructor(){\r\n this.sales = [] // set property of sale and set it to an empty array\r\n\r\n this.adapter = new SalesAdapter() // create adapter\r\n // this.bindEventListeners()\r\n this.fetchAndLoadSales()\r\n this.createSales()\r\n // this.clearCommission()\r\n }", "title": "" }, { "docid": "43528357029294da0226b6f276e5b8a5", "score": "0.5789316", "text": "async function manageSales(account) {\n try {\n let Ids = await EventsModule.GetSoldRefs(account);\n\n let IdsFinished = await EventsModule.WithdrawFundsEventGeneral() // Ids for which funds have been withdrawn\n\n let IdsToShow_id = await EventsModule.ComputeLeft(EventsModule.EventsToIds(Ids), EventsModule.EventsToIds(IdsFinished))\n\n let IdsToShowEventForm = await EventsModule.GetRefs(IdsToShow_id);\n\n return IdsToShowEventForm;\n } catch (e) {\n throw e;\n }\n}", "title": "" }, { "docid": "85b9d62a392f8d605f2b1fe4575d18be", "score": "0.57754016", "text": "function convertToSale(itemID) {\n $('#AllOpps').hide();\n $('#OppDetails').hide();\n clearEditOppForm();\n\n currentItem.set_item(\"_Status\", \"Sale\");\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n clearEditOppForm();\n showSales();\n }\n ,\n function (sender, args) {\n var errArea = document.getElementById(\"errAllLeads\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n}", "title": "" }, { "docid": "8db15155a5bd4887302abbf27e4855df", "score": "0.57570374", "text": "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "title": "" }, { "docid": "9cc354a46e5bc3c6687aceee3641a465", "score": "0.57301855", "text": "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "title": "" }, { "docid": "7f163d052cd60b4787fd00f419f1df7e", "score": "0.56949407", "text": "function handle(event) { \n //用户订单支付成功,对应服务端的 order.pay\n let tradeNo = event.data.trade_no;\n let total_fee = event.data.price;\n\n let item = this.GetObject(EntityType.BuyLog, tradeNo, IndexType.Domain);\n if (!item || item.getAttr('trade_no') != tradeNo || item.getAttr('total_fee') != total_fee || item.getAttr('result') == PurchaseStatus.cancel) {\n console.log('[trade not exist]');\n return {code: ReturnCode.illegalData};\n }\n\n if(item.getAttr('result') == PurchaseStatus.commit) { //已经处理完毕的重复订单, 直接返回\n return {code: ReturnCode.Success};\n }\n\n let pUser = this.GetObject(EntityType.User, item.getAttr('domainid'), IndexType.Domain);\n if(!pUser) {\n return {code: ReturnCode.userIllegal};\n }\n\n //设置首充标记,单笔金额必须大于等于60\n if(total_fee >= 60) {\n if(!pUser.baseMgr.info.CheckStatus(UserStatus.isFirstPurchase)){\n pUser.baseMgr.info.SetStatus(UserStatus.isFirstPurchase);\n pUser.baseMgr.info.UnsetStatus(UserStatus.isFirstPurchaseBonus);\n }\n }\n\n pUser.getBonus(item.getAttr('product'));\n item.setAttr('result', PurchaseStatus.commit);\n\n //向客户端下行购买成功通知\n pUser.notify({type: NotifyType.buyItem, info:{tradeNo: item.getAttr('trade_no'), product: item.getAttr('product')}});\n\n return {code: ReturnCode.Success, data: {domainid: item.getAttr('domainid')}};\n}", "title": "" }, { "docid": "98d8701fe728999e56d31e1b492eeede", "score": "0.5685271", "text": "function updateTotalSales() {\n\n // Query to update total sales based on product id\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n\n // parseFloat is required to make sure the math is handled with decimal values, not string\n var grandTotalSales = parseFloat(newSales) + parseFloat(totalSales);\n\n connection.query(queryTerms,\n [\n {product_sales: grandTotalSales},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n });\n\n // Back to the start of the program\n start();\n} // End updateTotalSales function", "title": "" }, { "docid": "f8002cb69a909ef3ba56d8ec0687e4b2", "score": "0.56755924", "text": "function totalSales(products, lineItems){\n //TODO\n\n}", "title": "" }, { "docid": "c891757cf59809e12fc301087f2cc2d8", "score": "0.5663202", "text": "function ProductsForSale() {\n console.log(\"Items up for sale\");\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 + \" | \" + res[i].quantity);\n console.log(\"------------------\");\n }\n MainMenu();\n });\n }", "title": "" }, { "docid": "def80caa6ed600a15a1c27744c678447", "score": "0.56063336", "text": "function customerView () {\n common.openConnection(connection);\n let querySQL = 'SELECT item_id, product_name, stock_quantity, price FROM products where stock_quantity > 0'; // exclude from \"where\" to premit out-of-stock items\n connection.query(querySQL, (error, result) => {\n if (error) throw error;\n let msg = ''; \n let title = 'LIST OF PRODUCTS FOR SALE';\n common.displayProductTable(title, result) // pass title and queryset to function that will print out information\n console.log('\\n');\n customerSelect();\n });\n \n}", "title": "" }, { "docid": "60e257d5790ea1f0cb209f458df604a3", "score": "0.56012756", "text": "function salesByDep() {\n // console.log(\"loading product sales...\");\n\n // join department and products \n // table needs to have depid, depName, overhead, productSales and totalProfits \n\n\nconnection.query(`SELECT departments.department_id AS 'Department ID', \ndepartments.department_name AS 'Department Name', \ndepartments.over_head_costs as 'Overhead Costs', \nSUM(products.product_sales) AS 'Product Sales', \n(SUM(products.product_sales) - departments.over_head_costs) AS 'Total Profit' \nFROM departments\nLEFT JOIN products on products.department_name=departments.department_name\nGROUP BY departments.department_name, departments.department_id, departments.over_head_costs\nORDER BY departments.department_id ASC`, (err, res) => {\n if (err) throw err;\n console.log('\\n ----------------------------------------------------- \\n');\n console.table(res);\n\n startSuper();\n\n });\n\n\n}", "title": "" }, { "docid": "b678213a5686fa6342e0738dac49cc60", "score": "0.55926293", "text": "function salesReport(req, res) {\n let db = req.app.get('db');\n let limit = req.body.limit || 50;\n let offset = req.body.offset || 0;\n let baseQuery = `SELECT * from items where sold = true`;\n\n // if sortAttr is provided, add sort command to the query\n let sortAttr = req.body.sortAttr;\n let sortOrder = req.body.sortOrder || 'asc';\n if (sortAttr) baseQuery += ` order by ${sortAttr} ${sortOrder}`\n\n // add limit and offset to the query\n baseQuery += ` limit $1 offset $2`\n\n return db.query(baseQuery, [limit, offset])\n .then(items => {\n let numResults = items.length;\n let offsetForNextPage = offset + numResults;\n let offsetForPrevPage = offset - limit;\n if (offsetForPrevPage < 0) offsetForPrevPage = 0;\n // If we dont get a full set of results back, we're at the end of the data\n if (numResults < limit) offsetForNextPage = null;\n let data = {\n items,\n offsetForPrevPage: offsetForPrevPage,\n offsetForNextPage, offsetForNextPage\n }\n return sendSuccess(res, data);\n })\n .catch(e => sendError(res, e, 'salesReport'))\n}", "title": "" }, { "docid": "a9e5a5f529599d8e41e9d44381848c22", "score": "0.55891937", "text": "handleSave() {\n callBackendAPI('/api/transactions/updateItems', 'post', {\n itemType: 'SHOP',\n updatedItems: this.state.products\n }).then(response => {\n this.setState({\n redirect: '/shop'\n });\n });\n }", "title": "" }, { "docid": "2cae8f9dd462ae90ac50436a50bc8950", "score": "0.5583015", "text": "function processAllDailySales(){\n for (var index = 0; index < allStores.length; index++){\n processDailySales(allStores[index]);\n }\n\n}", "title": "" }, { "docid": "df3dad762f45fe948d0f1b8f02da166d", "score": "0.5577811", "text": "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}", "title": "" }, { "docid": "443df6e6feb1228cbcdd581e330126a2", "score": "0.55761564", "text": "function viewSales() {\n var URL=\"select d.department_id,d.department_name,d.over_head_costs,sum(p.product_sales)as product_sales,d.over_head_costs-p.product_sales as total_profit \";\n URL+=\"from departments d ,products p \";\n URL+=\"where d.department_name=p.department_name Group by p.department_name;\";\n connection.query(URL, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "title": "" }, { "docid": "e248b38c900be37fd5715c5f94653af5", "score": "0.55571544", "text": "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "title": "" }, { "docid": "9f1287bdca8aaffe99abe58c270d7883", "score": "0.5557102", "text": "function onSaveSale() {\n var recieved_amount = $('input#recieved').val();\n var recieveable_amount = $('input#payable').val();\n var pntType = $('#payment_type').val();\n var transCode = $('#transCode').val();\n var custId = $('#select_customer').val();\n var tax = $('input.tax_value').val();\n \n $.ajax({\n type: \"POST\",\n url: \"sale\",\n dataType: \"json\",\n // data: {'_token': $('input[name=_token]').val()},\n data: {'custID': custId, 'payment': pntType, 'recieved': recieved_amount, 'recieveable': recieveable_amount, 'transCode': transCode, 'tax': tax, '_token': $('input[name=_token]').val() },\n success: function (response) {\n $('#inv_message').css('display', 'block');\n $('#inv_message').attr('style', response.style);\n $('#inv_message').html(response.sale_msg);\n $('#inv_message').fadeOut(4000);\n // $('#sale_section').load(' #sale_section');\n setTimeout(function () { location.reload(); }, 5000);\n },\n error: function (error) { \n console.log(error);\n }\n });\n \n }", "title": "" }, { "docid": "376a8af2ca6db934f74ddc75aede6561", "score": "0.55447274", "text": "function getAllSales() {\n if (!sessionStorage.current_user) {\n window.location.href = \"index.html\";\n }\n var init = {\n method : 'GET',\n headers : header\n \n };\n\n req = new Request(sales_url,init)\n\n fetch(req)\n .then((res)=>{\n console.log(res);\n status = res.status\n return res.json();\n })\n .then((data)=>{\n if (status==401){\n window.location.href = \"index.html\";\n }\n\n rowNum = 1; //the row id\n data['Sales Record'].forEach(sale => {\n\n // save the queried data in a list for ease of retrieving\n\n sales_record[sale['sales_id']] = {\n \"user_id\": sale['user_id'],\n \"product_id\": sale['product_id'],\n \"quantity\": sale['quantity'],\n \"sales_amount\": sale['sales_amount'],\n \"sales_date\": sale['sales_date']\n };\n console.log(sales_record)\n sales_table = document.getElementById('tbl-products')\n let tr = createNode('tr'),\n td = createNode('td');\n \n\n // table data\n t_data=[\n rowNum,sale['product_name'],\n sale['username'],\n sale['sales_date'],\n sale['sales_amount']\n ];\n console.log(t_data)\n\n tr = addTableData(tr,td,t_data);\n console.log(tr);\n\n\n // add the view edit and delete buttons\n td = createNode('td')\n td.innerHTML=` <i id=\"${sale['sales_id']}\" onclick=\"showProductPane(this)\" class=\"fas fa-eye\"> </i>`;\n td.className=\"text-green\";\n appendNode(tr,td);\n console.log(\"here\")\n\n \n \n\n appendNode(sales_table,tr);\n rowNum +=1\n });\n\n });\n}", "title": "" }, { "docid": "3dc1fc8eb68a0bcd7845392df4ee3242", "score": "0.5540081", "text": "function viewProductsSaleDepartment() {\n console.log(\"======================\")\n console.log(chalk.green(\"View Product Sales by Department\"));\n\n connection.query(\"DROP TABLE bamazon.departments\", function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"CREATE TABLE departments (department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(100) NULL, over_head_costs INT(10) NULL,product_sales INT(10) NULL, PRIMARY KEY(department_id));\",\n function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"SELECT * FROM products\", function (err, results) {\n\n for (var i = 0; i < results.length; i++) {\n\n var sale_quantity = results[i].product_sales / results[i].price;\n // console.log(`[${i}] || ${sale_quantity}`);\n var profit = results[i].product_sales * 0.20;\n var overheadcosts = results[i].product_sales - profit;\n // console.log(`[${i}] || ${profit}`);\n\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: results[i].department_name,\n over_head_costs: overheadcosts,\n product_sales: results[i].product_sales\n },\n function (err, res) {\n if (err) throw err;\n // console.log(res.affectedRows + \" product inserted!\\n\");\n\n }\n );\n }\n connection.query(\"SELECT department_name, sum(over_head_costs) as over_head_costs, sum(product_sales) as product_sales FROM Bamazon.departments GROUP BY department_name;\",\n function (err, results) {\n if (err) throw err;\n\n var values = [];\n for (var i = 0; i < results.length; i++) {\n var totalprofit = results[i].product_sales - results[i].over_head_costs;\n // console.log(totalprofit);\n values.push([i + 1, results[i].department_name, results[i].over_head_costs, results[i].product_sales, totalprofit]);\n // console.log([i+1]+\"\\t\"+results[i].department_name + \"\\t\" + results[i].over_head_costs + \"\\t\" + results[i].product_sales + \"\\t\" + totalprofit);\n }\n // console.log(values);\n console.log(\"\\n-------------------------------------------------------------------------\");\n console.table(['ID', 'Department Name', 'Over Head Costs', 'Product Sales', 'Profit'], values);\n\n Start();\n });\n\n console.log(\"===================\");\n // Start();\n });\n\n}", "title": "" }, { "docid": "dd5c73ebc1574c354b3bebe17877d267", "score": "0.5530495", "text": "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 }", "title": "" }, { "docid": "ae5c12815ca7af0c6e297d74b1a320a1", "score": "0.55208313", "text": "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "title": "" }, { "docid": "12cdecb8c16a3a0550f17b4574f7446a", "score": "0.5506961", "text": "function handleNewStoreSubmit(event){\n // Prevent the page from reloading\n event.preventDefault();\n // Reset the sum of all hourly total sales (a Store will be added or changed, so this value will change)\n allStoreTotals = [];\n // Input validation\n if (!event.target.getStoreName.value || !event.target.getMinCusts.value || !event.target.getMaxCusts.value || !event.target.getAvgSales.value ) {\n return alert('Please fill in all fields!');\n }\n // Wipe the table data clean\n storeTable.innerHTML = '';\n\n // Re-render the table (unchanged data will remain in memory)\n makeHeaderRow();\n renderAllTable();\n callFooterFunctions();\n}", "title": "" }, { "docid": "842c7866f23bb0d55f91be21f471845d", "score": "0.55056894", "text": "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "title": "" }, { "docid": "d98de5b664a4569661a73c8ded253dc3", "score": "0.55010694", "text": "function setSalesOrder() {\r\n\r\n\t// console.log('setSalesOrder');\r\n\r\n\tif (validateForm() == true) {\r\n\t\tif (validateLength() == true) {\r\n\t\t\t\r\n\t\t\tvar data = saveSalesOrder();\r\n\t\t\tconsole.log(data);\r\n\t\t\t\tif (data == \"\") {\r\n\t\t\t\t\tbootstarpAlert('', 'Error while saving Sales order', true,\r\n\t\t\t\t\t'danger',3000);\r\n\t\t\t\t}\r\n\t\t\t\t// for data saved successfully\r\n\t\t\t\telse {\r\n\t\t\t\t\tbootstarpAlert('', 'Data saved successfully for Sales order Id '+data+' please use save and process button to process order at WMS', true,\r\n\t\t\t\t\t'success',6000);\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "500bd0c3e3c8a0306ba83dadf4e63b9c", "score": "0.54941106", "text": "function soldItems(){\n reportInfo.style.display = \"block\";\n\n $.ajax({\n url:\"/getSold\",\n type:\"post\", //\"post\" is behind the scenes (invisible) versus \"get\" (hijackable)\n success:function(resp){\n //loop through the select\n for(var i = 0; i<resp.length; i++){\n var tr = reportInfo.insertRow();\n var name = document.createElement(\"td\");\n var price = document.createElement(\"td\");\n var qty = document.createElement(\"td\");\n var type = document.createElement(\"td\");\n var revenue = document.createElement(\"td\");\n \n var soldQty = startQty - resp[i].qty;\n var revenueEarned = soldQty * resp[i].price;\n \n name.textContent = resp[i].itemname;\n price.textContent = resp[i].price;\n qty.textContent = soldQty;\n type.textContent = resp[i].type;\n revenue.textContent = \"$\" + revenueEarned;\n\n tr.appendChild(name);\n tr.appendChild(price);\n tr.appendChild(qty);\n tr.appendChild(type);\n tr.appendChild(revenue);\n \n if(resp[i].type == \"main\"){\n mainPrice += revenueEarned;\n } else if(resp[i].type == \"sides\") {\n sidePrice += revenueEarned;\n } else if(resp[i].type == \"dessert\") {\n dessPrice += revenueEarned;\n } else if(resp[i].type == \"beverage\") {\n bevPrice += revenueEarned;\n }\n \n revenueTotalPrice = revenueTotalPrice + revenueEarned;\n }\n revenueTotal.innerHTML = \"Total price of earned revenue: $\" + revenueTotalPrice;\n }\n });\n }", "title": "" }, { "docid": "514e86ae900a71087ed966d70d8d1959", "score": "0.5489496", "text": "function submitSupplierOrder() {\n fetch(`http://localhost:8080/api/purchase/delivered/${purchaseNumber}`, {\n method: 'POST',\n headers: {'Authorization': `bearer ${localStorage.getItem('access_token')}`,\n 'Content-Type': 'application/json'}\n })\n .catch(console.error());\n }", "title": "" }, { "docid": "bd1f3ea3ff505cef8c98d8b9711aea03", "score": "0.54501456", "text": "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "title": "" }, { "docid": "cd1c32232f5ea166b4a0e17756b151ce", "score": "0.5445089", "text": "function enterStore(event){\n event.preventDefault();\n\n var name = event.target.store.value; // this is targeting the value of the input\n var maxCust = parseInt(event.target.max.value);\n var minCust = parseInt(event.target.min.value);\n var avgCookies = parseInt(event.target.avgSold.value);\n var newStore = new createStore(name, maxCust, minCust, avgCookies);\n\n newStore.cookiesPurchased();\n totalByStore(newStore);\n rowRow(newStore);\n \n console.log('did it work?', storeArr);\n}", "title": "" }, { "docid": "179763fab89f5a96816b1288ce4edbaf", "score": "0.54200786", "text": "async index({ params: { companyId }, request, response, view }) {\n const company = await Company.find(companyId);\n //const user = await auth.getUser()\n\n const inventory = new Inventory();\n inventory = await company.inventory().fetch();\n\n response.status(200).json({\n message: 'Inventario',\n data: inventory,\n });\n }", "title": "" }, { "docid": "46ec94d7b2fb3c30793de7c8fb6a3437", "score": "0.54148525", "text": "async function orderPlaced(spendgo_id, store_code, orderSource, orderSubtotal, orderTotal, orderBasket) {\n // Spendgo API path\n var path = `/loyalty/accounts/${spendgo_id}/orders`;\n\n // create request data\n let jsonData = JSON.stringify({\n status: 'placed',\n vendor: store_code,\n brand: SPENDGO_ACCOUNT_ID,\n source: orderSource,\n subtotal: orderSubtotal,\n total: orderTotal,\n basket: orderBasket\n });\n\n // create request config\n let config = {\n method: 'post',\n url: SPENDGO_URL + path,\n headers: createHeaders(path, jsonData),\n data: jsonData\n }\n \n // request data, return data\n return await axiosRequest(config);\n}", "title": "" }, { "docid": "e3a20fe3f47c048c7909a02750c68c86", "score": "0.54143727", "text": "function viewSales() {\n\tvar joinQuery = \"SELECT department_id, departments.department_name, over_head_costs,\"\n\t\t+ \" SUM(product_sales) AS product_sales,\" \n\t\t+ \" SUM(product_sales) - over_head_costs AS total_profit \";\n\tjoinQuery += \"FROM departments INNER JOIN products \";\n\tjoinQuery += \"ON departments.department_name = products.department_name \";\n\tjoinQuery += \"GROUP BY department_id \";\n\n\tconnection.query(joinQuery, function(error, results) {\n\t\tif (error) throw error;\n\t\tconsoleTableProfit(\"\\nDepartmental Profit\", results);\n\t\twelcome();\n\t});\n}", "title": "" }, { "docid": "c15ea4299520c3fa2523dbd378f219fd", "score": "0.5406272", "text": "function main(){\n // Display the products available for purchase\n getProducts()\n \n }", "title": "" }, { "docid": "ea4d6f27ddeded2b2ad7d248b3dad2b9", "score": "0.5404288", "text": "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "title": "" }, { "docid": "c97ad7849bd5ee1667760f32bab05b9e", "score": "0.5400241", "text": "async function purchase() {\n\n // SHOW LOADING SCREEN\n dispatch({\n type: 'show-prompt',\n payload: 'loading'\n })\n\n // FETCH THE TOKEN PRICE\n const token_price = await read({\n contract: 'token',\n func: 'price',\n }, state)\n\n // ATTEMPT TO BUY TOKENS\n const result = await write({\n contract: 'token',\n func: 'purchase',\n args: [input.amount.value],\n payable: input.amount.value * token_price\n }, state)\n\n // SLEEP FOR 2 SECONDS TO SMOOTHEN TRANSITION\n await sleep(2)\n\n // EVERYTHING WENT FINE\n if (result.success) {\n\n // CREATE TOAST MESSAGE\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'good',\n msg: 'tokens purchased'\n }\n })\n\n // OTHERWISE, SHOW ERROR\n } else {\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'bad',\n msg: result.reason\n }\n })\n }\n\n // HIDE THE PROMPT WINDOW\n dispatch({ type: 'hide-prompt' })\n }", "title": "" }, { "docid": "9480654e0e697cd3f260ba8e24e677dd", "score": "0.5386066", "text": "function insertData(event) {\t\n\tvar json = {\n\t\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"add\",\n\t\t\t\t\"records\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"product\": Number(document.getElementById(\"product\").value),\n\t\t\t\t\t\t\"quantity\": Number(document.getElementById(\"quantity\").value),\n\t\t\t\t\t\t\"dateTime\": getDateAndTime()\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t};\n\t\n\t// UPDATED CALL SIGNATURE (return false event value)\n\treturn sendAPIRequest(json,event,displaySalesRecords);\n}", "title": "" }, { "docid": "7dc0cb504dee3afe8df44d5b6a09b5c5", "score": "0.53819394", "text": "handleCurrencyConversion() {\n let endpointURL = 'http://data.fixer.io/api/latest?access_key=b831ee4392d4f2acf242d71c8e9c0755&base=' \n + this.sellCurrencyValue + '&symbols=' + this.buyCurrencyValue;\n \n // calling apex class method to make callout\n getCurrencyData({strEndPointURL : endpointURL})\n .then(data => {\n\n window.console.log('jsonResponse ===> '+JSON.stringify(data));\n\n // retriving the response data\n let exchangeData = data['rates'];\n \n this.rate = exchangeData[this.buyCurrencyValue];\n\n if(this.rate && this.sellAmountValue){\n this.buyAmountValue = (this.sellAmountValue * this.rate).toFixed(2);\n } else {\n this.buyAmountValue = null;\n }\n\n })\n .catch(error => {\n window.console.log('callout error ===> '+JSON.stringify(error));\n })\n }", "title": "" }, { "docid": "70912a556ad2be2f2d204fa44bbb0314", "score": "0.5375832", "text": "async function orderVoided(spendgo_id, store_code, orderId, orderSource, orderSubtotal, orderTotal, orderBasket) {\n // Spendgo API path\n var path = `/loyalty/accounts/${spendgo_id}/orders`;\n\n // create request data\n let jsonData = JSON.stringify({\n status: 'voided',\n vendor: store_code,\n brand: SPENDGO_ACCOUNT_ID,\n id: orderId,\n source: orderSource,\n subtotal: orderSubtotal,\n total: orderTotal,\n basket: orderBasket\n });\n\n // create request config\n let config = {\n method: 'post',\n url: SPENDGO_URL + path,\n headers: createHeaders(path, jsonData),\n data: jsonData\n }\n \n // request data, return data\n return await axiosRequest(config);\n}", "title": "" }, { "docid": "6fae4225227f877f59b1b36ba516df0a", "score": "0.53714037", "text": "function salesByProduct(products, lineItems){\n //TODO\n}", "title": "" }, { "docid": "cf49cf746a22e4b5dc571ae5366a8e43", "score": "0.5348973", "text": "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to read the Account Type Amounts by Company Code\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Calculate Values\n\t\t\t\tvar records = getEntries();\n\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\tdata: records\n\t\t\t\t}));\n\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "bb5b5a6bd9b048ff820e48adcba0f933", "score": "0.5343856", "text": "function handleTransaction(event){\n event.preventDefault();\n var formData = new FormData(event.target);\n var transactionObject = new TransactionObject(formData.get('title'),\n formData.get('amount'),\n formData.get('transaction-type'))\n event.target.reset()\n if(transactionObject.amount <= 0){\n alert('Enter Amount greater than zero')\n }\n if(transactionObject.type === 'debit'){\n if(transactionObject.amount > balance){\n alert('Insufficient Balance');\n return\n }\n }\n\n storeTransactionData(transactionObject)\n createRow(updateTransaction(transactionObject))\n}", "title": "" }, { "docid": "5db08131c4cb4306948e77e3ab123349", "score": "0.53327334", "text": "function call_POST_API(employee, date, sale){\n $.ajax({\n url: apiURL,\n method: \"POST\",\n contentType: 'application/json',\n data: JSON.stringify({\n salesman: employee,\n amount: parseInt(sale),\n date: date\n }),\n success: function(obj){\n dataSalesPerMonth(obj);\n dataSalesPerEmployee(obj);\n dataSalesPerQuarter(obj);\n console.log(obj);\n drawLineChart(labelTotalSales, dataTotalSales);\n drawDoughnutChart(labelSingleSales, dataSingleSales);\n drawBarChart(labelQuarterSales, dataQuarterSales);\n location.reload();\n },\n error: function() {\n alert(\"errore\");\n }\n });\n}", "title": "" }, { "docid": "df6835913c85a9e7dde368d394ef73f1", "score": "0.53269845", "text": "saleList() {\n axios.get(`Sales/GetSales`)\n .then(({data}) => {\n this.setState({\n sales: data\n });\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "3e7260e67ccdaca32449dc86c5db483e", "score": "0.53268886", "text": "handleSubmit (e){\n e.preventDefault();\n AdminUserAction.userLogin(this.refs.userName.value, this.refs.password.value);\n salesStore.getSales();\n }", "title": "" }, { "docid": "766962926873ed3826073548849793e6", "score": "0.5326383", "text": "async function storeOrdersPage(req, res) {\n const treatboxDates = await getTreatBoxDates();\n const orders = await getStoreOrders();\n\n return res.render('storeOrders', {\n user: req.user,\n treatboxDates,\n orders,\n dateFormat\n });\n }", "title": "" }, { "docid": "f40540f955889236139171bc362cb7bb", "score": "0.53244346", "text": "function viewSaleProducts(callback){\n //create a query to select all the products\n var allprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n //if call back exists call that function\n if(callback){\n callback();\n }\n //else display the products\n else{\n managerMenu();\n }\n }\n });\n}", "title": "" }, { "docid": "cce3947473413935225a11879949d232", "score": "0.53229797", "text": "function forSale() {\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(\"ID: \" + res[i].id + \"; Product: \" + res[i].product_name + \"; Department: \" + res[i].department_name + \"; Price: $\" + res[i].price + \"; Quantity Available: \" + res[i].stock_quantity);\n };\n nextToDo();\n });\n}", "title": "" }, { "docid": "411905447886a6df0476f3fc321820c8", "score": "0.5320946", "text": "handleSalesAccessorydata(businessAreaType) {\n this.isSpinnerShow = true;\n let oppId;\n let optyid = this.valuesObj.enquiryId;\n if (Array.isArray(optyid)) {\n oppId = this.valuesObj.enquiryId ? this.valuesObj.enquiryId[0] : '';\n } else {\n oppId = optyid;\n }\n fetchSalesAccessoryOwner({\n enquiryRecId: oppId,\n dealerId: this.valuesObj.dealerOutletName,\n businessArea: this.valuesObj.businessArea\n }).then(result => {\n this.salesAccessoryData = result;\n var arr = [];\n if (result) {\n if (businessAreaType === 'Sales') {\n if (this.salesAccessoryData.enquiryOwner && this.salesAccessoryData.enquiryOwner.OwnerId) {\n this.caseOwnerId = this.salesAccessoryData.enquiryOwner.OwnerId;\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n } else if (this.salesAccessoryData.dealerdata && (this.salesAccessoryData.dealerdata.Sales_SPOC_1__c ||\n this.salesAccessoryData.dealerdata.Sales_SPOC_2__c || this.salesAccessoryData.dealerdata.Sales_SPOC_3__c ||\n this.salesAccessoryData.dealerdata.Sales_SPOC_4__c || this.salesAccessoryData.dealerdata.Sales_SPOC_5__c)) {\n if (this.salesAccessoryData.dealerdata.Sales_SPOC_1__c) {\n arr.push(this.salesAccessoryData.dealerdata.Sales_SPOC_1__c);\n }\n if (this.salesAccessoryData.dealerdata.Sales_SPOC_2__c) {\n arr.push(this.salesAccessoryData.dealerdata.Sales_SPOC_2__c);\n }\n if (this.salesAccessoryData.dealerdata.Sales_SPOC_3__c) {\n arr.push(this.salesAccessoryData.dealerdata.Sales_SPOC_3__c);\n }\n if (this.salesAccessoryData.dealerdata.Sales_SPOC_4__c) {\n arr.push(this.salesAccessoryData.dealerdata.Sales_SPOC_4__c);\n }\n if (this.salesAccessoryData.dealerdata.Sales_SPOC_5__c) {\n arr.push(this.salesAccessoryData.dealerdata.Sales_SPOC_5__c);\n }\n if (arr.length > 0) {\n this.caseOwnerId = arr[Math.floor(Math.random() * arr.length)];\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n }\n\n } else {\n this.showErrorMessage(salesSPOCMissing);\n }\n } else if (businessAreaType === 'Accessories') {\n if (this.salesAccessoryData.dealerdata && (this.salesAccessoryData.dealerdata.Accessories_SPOC_1__c || this.salesAccessoryData.dealerdata.Accessories_SPOC_2__c)) {\n if (this.salesAccessoryData.dealerdata.Accessories_SPOC_1__c) {\n arr.push(this.salesAccessoryData.dealerdata.Accessories_SPOC_1__c);\n }\n if (this.salesAccessoryData.dealerdata.Accessories_SPOC_2__c) {\n arr.push(this.salesAccessoryData.dealerdata.Accessories_SPOC_2__c);\n }\n if (arr.length > 0) {\n this.caseOwnerId = arr[Math.floor(Math.random() * arr.length)];\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n }\n } else {\n this.showErrorMessage(accessorySPOCMissing);\n }\n } else if (businessAreaType === 'MIBPL (Insurance)') {\n if (this.salesAccessoryData.dealerdata && (this.salesAccessoryData.dealerdata.Insurance_SPOC_1__c || this.salesAccessoryData.dealerdata.Insurance_SPOC_2__c)) {\n if (this.salesAccessoryData.dealerdata.Insurance_SPOC_1__c) {\n arr.push(this.salesAccessoryData.dealerdata.Insurance_SPOC_1__c);\n }\n if (this.salesAccessoryData.dealerdata.Insurance_SPOC_2__c) {\n arr.push(this.salesAccessoryData.dealerdata.Insurance_SPOC_2__c);\n }\n if (arr.length > 0) {\n this.caseOwnerId = arr[Math.floor(Math.random() * arr.length)];\n const submitBtn = this.template.querySelector('.submit-btn');\n submitBtn.click();\n }\n } else {\n this.manulOwnerAssign = true;\n this.showErrorMessage('Please select Case Owner');\n }\n }\n } else {\n this.showErrorMessage('Error occured Please try after sometime');\n }\n }).catch(error => {\n this.isSpinnerShow = false;\n })\n }", "title": "" }, { "docid": "675c4b30d16cda01eb9d77962be71718", "score": "0.53190655", "text": "onApprove(data, actions) {\n\n const { _id, newTier, selectedListing, amount } = this.props;\n\n return actions.order\n .capture()\n .then((details) => {\n if (this.props.onSuccess) { //If the transaction was successful, update the subscriptionTier in the DB\n axios.get('/api/userPortal')\n .then(res => {\n console.log(res);\n res.data.find((info) => {\n if (info._id === _id) {\n let id = info._id; \n \n let myListings = info.listings\n\n myListings.find((target) => {\n if (target._id === selectedListing) {\n target.subscriptionTier = newTier\n\n }\n })\n\n\n\n axios.put('/api/userPortal/' + id, {\n \"name\": info.name,\n \"phone\": info.phone,\n \"emailAddress\": info.emailAddress,\n \"address\": info.address,\n \"service\": info.service,\n \"accessibility\": info.accessibility,\n \"password\": info.password,\n \"listings\": myListings\n })\n }\n })\n });\n\n\n return this.props.onSuccess(details, data);\n }\n })\n .catch((err) => {\n if (this.props.catchError) {\n return this.props.catchError(err);\n }\n });\n }", "title": "" }, { "docid": "63f87d60875d6a44b679fd598c33cec4", "score": "0.53185135", "text": "handleOnViewPrice(){\n const xApiKey = 'mcOtxKkyOR4OwrbGK0Czq8HRmlMcsQ2G1Er2jfy7'\n //const accountKey = acctKey //'58cf2a3d-4e73-48c6-a7d1-437e8d70e181'\n const axiosConfig = {\n headers: {\n 'x-api-key': xApiKey,\n }\n }\n const body = {\n }\n \n axios.post('https://849rs099m3.execute-api.ap-southeast-1.amazonaws.com/techtrek/pricing/current', {}, axiosConfig)\n .then( ({data}) => {\n console.log('CHECK currentPrice',data)\n })\n .then(data =>\n this.setState({\n assetSymbol: data.assetSymbol,\n timestamp: data.timestamp,\n assetPrice: data.assetPrice,\n })\n )\n }", "title": "" }, { "docid": "e901631c93b68a75c03ff3a4c184b28a", "score": "0.53111744", "text": "function getTotalProductSales(dept, newOHC) {\n connection.query(\"SELECT SUM(product_sales) AS totalProductSales FROM products WHERE department_name = ?\", [dept], function (err, res) {\n if (err) throw err;\n let totalProductSales;\n for (let i = 0; i < res.length; i++) {\n totalProductSales = res[i].totalProductSales;\n }\n console.log(\"Total product sales for \" + dept + \" is: \" + totalProductSales);\n updateProductSales(dept,newOHC, totalProductSales)\n })\n}", "title": "" }, { "docid": "40849a26f1cb1c06815e3420461ec970", "score": "0.53088385", "text": "function write_sell_toDB(){\n keystone.list('Voucher Codes').model.findOne()\n .where({voucheramount : seller_voucher_amount_, voucherstate : 'new'})\n .exec( function(error, response){\n if(error){\n return res.jsonp({status: 'sorry Please try again, later', new_credit : 'no_value_change'});\n }\n if(response == null){\n return res.jsonp({status : 'error Selling voucher, Please try different amount, or try again later', new_credit : 'no_value_change'});\n } \n // console.log(response);\n \n \n \n // res.jsonp('voucher sold for R'+seller_voucher_amount_); \n \n response.voucherstate = 'used';\n response.soldby = req.query.seller_id;\n response.soldto = seach_code_;\n response.save();\n \n var seller_id = req.query.seller_id;\n // var seller_voucher_amount = seller_voucher_amount_;\n voucher_sell_subtract_amount(seller_id, seller_voucher_amount_, res); \n });\n //on error throw error\n \n //on sucess, create voucher on the front\n \n \n }", "title": "" }, { "docid": "51be26c1cfd7d9ab618669b4cf9b4d04", "score": "0.5295402", "text": "handleActions(action){\n\n switch(action.type){\n case \"DISPATCH_SALE\":\n this.dispatchSale(action.id);\n break;\n\n default: break;\n }\n }", "title": "" }, { "docid": "84079f9d3e041acd81be28d8c729eeb8", "score": "0.5286216", "text": "async function refreshStoreContent () {\n\tlet storeData = await $.post('/sales');\n\tif (storeData.status === 'SUCCESS') {\n\t\tlet updatedStoreList = $('<ul id=\"itemsOnSale\" style=\"list-style-type:circle\"></ul>');\n\t\tlet storeItems = storeData.offers;\n\t\tif (storeItems.length > 0) {\n\t\t\t$('#itemsInStock').html('The following items are on sale:');\n\t\t}\n\t\tfor (let i = 0; i < storeItems.length; i++) {\n\t\t\tlet item = storeItems[i];\n\t\t\tlet serviceId = item.serviceId;\n\t\t\tlet availableForSale = item.availableForSale;\n\t\t\tlet itemId = item.itemId;\n\t\t\tlet itemName = item.name;\n\t\t\tlet itemDescription = item.description;\n\t\t\tlet itemAmount = item.amount;\n\t\t\tlet itemCost = item.cost;\n\n\t\t\t// Update the actual list for display.\n\t\t\tupdatedStoreList.append('<li>' + itemAmount + ' x (' + itemId + ') ' + itemName + ': ' + itemDescription + ' for $' + itemCost + '\\t\\t<input id=\"amount-' + serviceId + '\" class=\"input\" serviceId=\"' + serviceId + '\" type=\"number\" value=\"0\" min=\"0\" max=\"' + availableForSale + '\" step=\"1\" style=\"float: right\"/></li>');\n\t\t}\n\n\t\t// Update our store and remove the loading indicator.\n\t\t$('#itemsOnSale').html(updatedStoreList.html());\n\t\t$('#itemSaleSpinner').remove();\n\n\t// Otherwise, display an error from the server.\n\t} else if (storeData.status === 'ERROR') {\n\t\tlet errorBox = $('#errorBox');\n\t\terrorBox.html(storeData.message);\n\t\terrorBox.show();\n\n\t// Otherwise, display an error about an unknown status.\n\t} else {\n\t\tlet errorBox = $('#errorBox');\n\t\terrorBox.html('Received unknown message status from the server.');\n\t\terrorBox.show();\n\t}\n}", "title": "" }, { "docid": "9f0af20d74e4c0b512ea1735da9ff8d0", "score": "0.52849543", "text": "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}", "title": "" }, { "docid": "1039db5041d71b81ad5a9cd332687187", "score": "0.5277375", "text": "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "title": "" }, { "docid": "9cfd95cc0c7e7acce36c1e2be4e4958b", "score": "0.526492", "text": "purchaseBook() {\n const Purchase = {\n user_email: this.state.myEmail,\n book_id: this.state.bookID,\n quantity: 1 \n };\n API.addPurchase(Purchase)\n .then(() => alert(\"Book Purchased!\"))\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "cf3d60df60637ca9e73f3b1970112d8b", "score": "0.5263743", "text": "function storeFront() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item # \" + res[i].item_id + \n \" \" + res[i].product_name +\n \" Qty: \" + res[i].stock_quantity + \n \" Price: $\" + res[i].price \n );\n }\n purchaseReqeust();\n });\n}", "title": "" }, { "docid": "34be5a0def8b65ca6da409d14755f7b0", "score": "0.526046", "text": "function getTotalSalesChart() {\n fetch('https://inlupp-fa.azurewebsites.net/api/total-sales-chart')\n .then(res => res.json()) \n .then(data => {\n document.getElementById('revenue').innerHTML = data.revenue;\n document.getElementById('returns').innerHTML = data.returns;\n document.getElementById('queries').innerHTML = data.queries;\n document.getElementById('invoices').innerHTML = data.invoices;\n // Resten ligger i dashboard.js!\n })\n}", "title": "" }, { "docid": "95df9acdf13bd025fa139fa533aba8ec", "score": "0.52587324", "text": "function sale(item, quantity) {\n\n // Pull the item specified by the user, from the database.\n connection.query (\"SELECT * FROM products WHERE ?\", \n { item_id : item }, function(err, res){\n\n if (err) throw err;\n\n // Compare the specified quantity to the number of items in inventory. If the quantity is\n // greater than the user specified quantity\n if (res[0].stock_quantity >= quantity) {\n\n // Subtract the specified quantity from the stock\n newQuantity = res[0].stock_quantity - quantity;\n var totalPrice = (res[0].price * quantity).toFixed(2);\n\n // update the database with new quantity\n connection.query (\"UPDATE products SET ? WHERE ?\", \n [\n { stock_quantity : newQuantity},\n { item_id: item }\n ], function (err, res){\n\n if (err) throw err;\n\n else {\n\n // Print the total price for the user\n console.log (\"The grand total will be $\" + totalPrice + \".\" + \" Thank you for shopping at Amazone!\");\n \n \n process.exit();\n }\n\n }); // Callback for Update query ends here\n\n }\n\n else {\n\n // Inform the user that there is not enough of the item in stock to fulfill the order\n console.log(\"Sorry! We don't have enough quantity\");\n process.exit();\n\n } \n }); // Initial query for the item ends here\n\n} // Sale function ends here.", "title": "" }, { "docid": "341c3c57a2636f63d8321330f5453031", "score": "0.5254657", "text": "process({ getState, action }) {\n return api.fetchSpendings()\n \n }", "title": "" }, { "docid": "e77760d2dade7f38b855c7d217a283f3", "score": "0.5254649", "text": "ontocartHandler(evt) {\n this.toCartId = this.toCartId.concat(evt.detail);\n this.totalPrice = this.totalPrice + evt.detail.Price__c;\n }", "title": "" }, { "docid": "70ac372539cfbe7d442e11593ba2bc3c", "score": "0.52473205", "text": "function ProcessServicesRevenue( Entities )\n{ \n\ttry\n\t{\t\n\t\tif ( DebugModeProjectMilestone )\n\t\t\twindow.alert( \"function ProcessServicesRevenue\\nEntities = \" + Entities );\t\t\n\t\tif( Entities != null )\n\t\t{\n\t\t\tvar getServicesRevenue = RetrieveAttribute( Entities, \"cust_ServicesRevenue\" );\n\t\t\tif ( DebugModeProjectMilestone )\n\t\t\t\twindow.alert( \"function ProcessServicesRevenue\\ngetServicesRevenue = \" + getServicesRevenue );\n\t\t\tif( getServicesRevenue != null )\n\t\t\t\tmyForceSubmitSetValue( \"cust_revenue\", getServicesRevenue * getPercentage / 100.0 ); \n\t\t} \t\n\t}\n\tcatch( err )\n\t{\n\t\twindow.alert( \"function ProcessServicesRevenue error code \" + err );\n\t}\n}", "title": "" }, { "docid": "2779c2efad8e55eb1fbf40f076c1cdcf", "score": "0.5246041", "text": "function saveEditSale() {\n\n if ($('#editSaleAmount').val() == \"\" || $('#editSale').val() == \"\") {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(\"Organization Name or amount field is empty.\"));\n errArea.appendChild(divMessage);\n }\n else {\n currentItem.set_item(\"Title\", $('#editSale').val());\n currentItem.set_item(\"ContactPerson\", $('#editSalePerson').val());\n currentItem.set_item(\"ContactNumber\", $('#editSaleNumber').val());\n currentItem.set_item(\"Email\", $('#editSaleEmail').val());\n currentItem.set_item(\"DealAmount\", $('#editSaleAmount').val());\n currentItem.update();\n context.load(currentItem);\n context.executeQueryAsync(function () {\n showSales();\n },\n function (sender, args) {\n var errArea = document.getElementById(\"errAllSales\");\n // Remove all nodes from the error <DIV> so we have a clean space to write to\n while (errArea.hasChildNodes()) {\n errArea.removeChild(errArea.lastChild);\n }\n var divMessage = document.createElement(\"DIV\");\n divMessage.setAttribute(\"style\", \"padding:5px;\");\n divMessage.appendChild(document.createTextNode(args.get_message()));\n errArea.appendChild(divMessage);\n });\n }\n}", "title": "" }, { "docid": "ac85ae406d64c346b6d65448f21496db", "score": "0.52456635", "text": "function getAmount() {\n $(\"#wonLostDrillDown\").hide();\n $(\"#pipeDrillDown\").hide();\n $(\"#drillTable\").hide();\n leadAmount = 0;\n oppAmount = 0;\n saleAmount = 0;\n\n var lostSaleAmount = 0;\n var allProspect = 0;\n list = web.get_lists().getByTitle('Prospects');\n var camlQuery = SP.CamlQuery.createAllItemsQuery();\n var listItems = list.getItems(camlQuery);\n context.load(listItems);\n context.executeQueryAsync(\n function () {\n // Iterate through the list items in the Invoice list\n var listItemEnumerator = listItems.getEnumerator();\n\n while (listItemEnumerator.moveNext()) {\n var listItem = listItemEnumerator.get_current();\n\n // Sum up all deal amounts\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lead\") {\n leadAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Opportunity\") {\n oppAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Sale\") {\n saleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()[\"_Status\"] == \"Lost Sale\") {\n lostSaleAmount += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n if (listItem.get_fieldValues()) {\n allProspect += parseFloat(listItem.get_fieldValues()[\"DealAmount\"]);\n }\n var pipelineAmount = allProspect - lostSaleAmount;\n }\n showLeadAmount(leadAmount);\n showOppAmount(oppAmount);\n showSaleAmount(saleAmount);\n showLostAmount(lostSaleAmount);\n $('#chartArea').fadeIn(500, null);\n createGraph(allProspect, leadAmount, oppAmount, saleAmount, pipelineAmount, lostSaleAmount);\n }, function () { alert(\"failure in get amount\"); });\n}", "title": "" }, { "docid": "2f5586df2b892f588847873841b85e33", "score": "0.5227226", "text": "function viewProductSales() {\n connection.query(\n 'SELECT department_id, departments.department_name, over_head_costs, sum(product_sales) as product_sales, sum(product_sales) - over_head_costs as total_profit FROM products right join departments on products.department_name=departments.department_name group by department_id, products.department_name, over_head_costs',\n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "title": "" }, { "docid": "4a80a2d5acf22168ffeb82b418fff576", "score": "0.522699", "text": "salesSearch(e){\n e.preventDefault();\n var _this = e.data.context,\n query = $.trim($(this).val()).toLowerCase(),\n wh_id = $.trim($(this).attr('data-warehouse'));\n\n _this.errors.clearErrors();\n\n if(e.which == 13){\n if(query.length){\n _this.getReceipts(wh_id, query);\n }else{\n _this.errors.add('Product name required!');\n _this.errors.appendErrorsToDOM();\n _this.errors.showErrorDOM();\n _this.showTransactionTable();\n _this.clearReceiptSearchResults();\n }\n }\n\n if(e.which == 27){\n $(this).val('');\n $(this).blur();\n _this.clearReceiptSearchResults();\n _this.errors.hideErrorDOM();\n _this.showReceiptsTable();\n }\n }", "title": "" }, { "docid": "4e11cbfd0b8bdd56f0b893629d018ab7", "score": "0.52231073", "text": "function getOrder(){\n\n // This function requests order details from the user, using the npm inquirer package \n // variable to hold the item id\n var item_id = 0;\n // update query to update stock when order is placed\n var updateQuery = \"UPDATE products SET stock_quantity = ?, product_sales =? WHERE item_id = ?\";\n // variable to hold the unit price\n var unit_price = 0;\n // variable to hold the stock quantity \n var stock_quantity = 0;\n // variable to hold the no of units that customer is purchasing \n var noOfUnits = 0;\n // variable to hold the product sales amount\n var product_sales = 0;\n\n // prompt user to enter an order\n inquire.prompt([{\n type:\"input\",\n name :\"itemId\",\n message:\"Please enter the id of the item to purchase\"\n }\n ]).then(answer =>{\n \n\n item_id=answer.itemId;\n \n var itemQuery = \"SELECT stock_quantity,unit_price, product_sales FROM products WHERE item_id = \" + item_id;\n\n connection.query(itemQuery,function(err,results){\n if(err) throw err;\n\n unit_price = results[0].unit_price;\n stock_quantity = results[0].stock_quantity;\n product_sales = results[0].product_sales;\n\n // if stock not availabel \n if(stock_quantity === 0 ){ \n \n console.log(\"Insufficient quantity!\");\n getAllProducts();\n\n }\n else{\n inquire.prompt([{\n type:\"input\",\n name :\"noOfUnits\",\n message:\"Please enter the no of units\"\n }\n ]).then(answer =>{\n noOfUnits = parseInt(answer.noOfUnits);\n\n if (noOfUnits > stock_quantity){\n // if availble stocks less than the amount that the customer wants to buy\n console.log(\"Insufficient quantity!\");\n getAllProducts();\n }\n\n var totalCost = parseFloat(answer.noOfUnits * unit_price);\n var newQuantity = stock_quantity - answer.noOfUnits\n var newSales = product_sales + totalCost;\n \n connection.query(updateQuery,[newQuantity,newSales,item_id],\n (err,results)=>{\n if (err) throw err;\n\n console.log(\"\\nTotal cost :\" + totalCost.toFixed(2)+\"\\n\");\n\n getAllProducts();\n });\n\n });\n }\n\n \n\n }\n )\n\n });\n // connection.end();\n}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.52151227", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.52151227", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.52151227", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.52151227", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.52151227", "text": "function purchaseItem() {}", "title": "" }, { "docid": "4c6c0c7b8f87309fa63a7339cc08ba82", "score": "0.52151227", "text": "function purchaseItem() {}", "title": "" }, { "docid": "2e1f0fb68a1fdfd4de4fef2072cb1d8d", "score": "0.52129513", "text": "checkPriceChange(currentQuotePrice) {\n console.log('in checkPriceChange');\n\n // pull out the targetPrice for the Order and make it a number\n let target = Number(this.model.get('targetPrice'));\n // make the currentQuotePrice (which was passed via the bus from the QuoteView render function) into a number\n currentQuotePrice = Number(currentQuotePrice);\n\n console.log(`target = ${target}`);\n console.log(`currentQuotePrice is : ${currentQuotePrice}`);\n\n // check if it is time to buy the quote the order is for\n // only proccess the order and buy the quote if the price of the quote is low enough\n if (this.model.get('action') === 'Buy' && (target >= currentQuotePrice) ) {\n console.log('target < currentQuotePrice -- time to buy! ');\n\n // If it is time to buy the order you need to destroy the model and remove it from the DOM so that nothing is listening for ecents from it anymore and it will only be bought once\n this.model.destroy();\n this.remove();\n\n // trigger the quote the order is associated with to be bought via the bus. The event will trigger the buyStock() function in QuoteView that then triggers the buy() method in the Quote model\n this.bus.trigger(`buy${this.model.get('symbol')}`)\n } // if for buy\n // only proccess the order and sell the Quote if the price of the Quote is low enough\n else if (this.model.get('action') === 'Sell' && (target <= currentQuotePrice) ) {\n console.log('target > currentQuotePrice -- time to sell!');\n\n // If it is time to sell the order you need to destroy the model and remove it from the DOM so that nothing is listening for ecents from it anymore and it will only be bought once\n this.model.destroy();\n this.remove();\n\n // trigger the quote the order is associated with to be sold via the bus. The event will trigger the sellStock() function in QuoteView that then triggers the sell() method in the Quote model\n this.bus.trigger(`sell${this.model.get('symbol')}`)\n\n } // else for sell\n }", "title": "" }, { "docid": "6e8ac3c8c70ca36d9d8eda5a095d2a73", "score": "0.52080035", "text": "function purchase() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer.prompt([{\n name: \"itemId\",\n type: \"number\",\n message: \"Enter the item ID of the item you want to buy.\".brightYellow\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"Excellent Choice! How many would you like?\".brightYellow\n }]).then(function (answer) {\n saleItem = answer.itemId - 1;\n saleQuantity = answer.itemQuantity;\n checkInv()\n\n });\n\n });\n\n}", "title": "" }, { "docid": "72ca0b9d8373dc68d3959a5e779a52de", "score": "0.52073336", "text": "function getSalesTaxesResult(event) {\n if (event != null) {\n if (event.result == \"OK\") {\n // Update the total amount\n var amt = $.formatNumber(event.data.totalAmount, {format: \"#,###.00\", locale: \"us\"});\n $('#totalAmount').html(amt);\n // Update each sale tax item amount\n for (var i = 0; i < event.data.saleTaxes.length; i++) {\n saleTax = event.data.saleTaxes[i];\n var taxAmt = $.formatNumber(saleTax.amount, {format: \"#,###.00\", locale: \"us\"});\n var taxTypeSelector = \"#\" + saleTax.type + \"_AMT\";\n $(taxTypeSelector).html(taxAmt);\n }\n\n } else {\n var errMess = SERVER_ERROR.replace(\"{0}\", event.message);\n\n $.blockUI({\n message: errMess,\n css: {zIndex: 11000},\n overlayCSS: {backgroundColor: '#E5F3FF'}\n });\n }\n }\n}", "title": "" }, { "docid": "3aea4850781d27cbb4ff19b73caea25e", "score": "0.5193338", "text": "function purchase(){\n\tlocation.href = base_url + \"purchase\";\n}", "title": "" }, { "docid": "ff056634d4d9dfc9230e89e76c230975", "score": "0.51906765", "text": "function PurchaseSimilarInventory() {\n const { setTopHeading } = useContext(TopBarContext);\n const [flow, setFlow] = useState(\"basic\");\n const [calculate, setCalculate] = useState(false);\n const [datecalculate, setDateCalculate] = useState(false);\n const [calnum, setCalnum] = useState(-1);\n\n const thebval = {\n purchtype: \"\",\n vendor: \"\",\n invnumber: \"\",\n invdate: \"\",\n location: \"Trivandrum\",\n invtype: \"\",\n gstno: \"\",\n panno: \"\",\n aadharno: \"\",\n purchlocation: \"Local\",\n };\n const [basevalues, setBaseValues] = useState(thebval);\n\n const invdetails = {\n type: \"\",\n name: \"\",\n // assetsIdHistory: \"\",\n // assetId: \"\",\n sno: \"\",\n condition: \"Good\",\n taxcategory: \"\",\n taxperc: \"\",\n rate: \"\",\n igst: \"0\",\n cgst: \"0\",\n sgst: \"0\",\n nettax: \"0\",\n amount: \"0\",\n tcs: \"0\",\n invamount: \"0\",\n wty: \"\",\n expirydate: \"\",\n //-------------------------\n purchtype: \"\",\n vendor: \"\",\n invnumber: \"\",\n invdate: \"\",\n location: \"\",\n invtype: \"\",\n gstno: \"\",\n panno: \"\",\n aadharno: \"\",\n purchlocation: \"\",\n\n brand:\"\",\n model:\"\",\n systype:\"part\",\n\n //-------\n caseId:\"\",\n };\n const [values, setValues] = useState([invdetails]);\n\n const [err, setErr] = useState({\n type: \"\",\n name: \"\",\n sno: \"\",\n condition: \"\",\n location: \"\",\n invnumber: \"\",\n });\n\n const submitItems = async () => {\n if (values.name === \"\" || values.sno === \"\" || values.invnumber === \"\") {\n // setIsReqFieldModal(true);\n console.log(\"missing inputs\");\n return;\n }\n console.log(\"Submission Start\");\n const newitems = [...values];\n newitems.map((item) => {\n item.purchtype = basevalues.purchtype;\n item.vendor = basevalues.vendor;\n item.invnumber = basevalues.invnumber;\n item.invdate = basevalues.invdate;\n item.location = basevalues.location;\n item.invtype = basevalues.invtype;\n item.gstno = basevalues.gstno;\n item.panno = basevalues.panno;\n item.aadharno = basevalues.aadharno;\n item.purchlocation = basevalues.purchtype;\n });\n console.log(newitems);\n await Axios({\n url: `${API}/inventory/${Emp.getId()}/createitems`,\n method: \"POST\",\n data: newitems,\n })\n .then((data) => {\n console.log(\"Added\", data._id);\n // setIsReviewModalOpen(true);\n setValues([invdetails]);\n setBaseValues(thebval);\n setErr({\n type: \"\",\n name: \"\",\n sno: \"\",\n condition: \"\",\n location: \"\",\n invnumber: \"\",\n });\n })\n .catch((err) => {\n console.log(\"err\", err);\n setErr({ ...err });\n });\n };\n\n // ----------------------Heading Use Effect-------------\n\n useEffect(() => {\n setTopHeading(\"Purchase Similar Inventory\");\n return () => {\n setTopHeading(\"\");\n };\n }, []);\n // ------------------- Calculations----------------------------------\n useEffect(() => {\n // console.log(\"hello\");\n // console.log(calnum);\n let newlist = [...values];\n\n if (basevalues.purchlocation == \"Local\" && calnum != -1) {\n newlist[calnum].sgst =\n parseInt(newlist[calnum].rate) *\n (parseInt(newlist[calnum].taxperc) / 200);\n newlist[calnum].cgst =\n parseInt(newlist[calnum].rate) *\n (parseInt(newlist[calnum].taxperc) / 200);\n newlist[calnum].nettax =\n parseInt(newlist[calnum].sgst) + parseInt(newlist[calnum].cgst);\n newlist[calnum].amount =\n parseFloat(newlist[calnum].rate) + parseFloat(newlist[calnum].nettax);\n\n // setValues(newlist);\n } else if (calnum != -1) {\n newlist[calnum].igst =\n parseInt(newlist[calnum].rate) *\n (parseInt(newlist[calnum].taxperc) / 100);\n newlist[calnum].nettax = newlist[calnum].igst;\n\n newlist[calnum].sgst = 0;\n newlist[calnum].cgst = 0;\n newlist[calnum].amount =\n parseFloat(newlist[calnum].rate) + parseFloat(newlist[calnum].nettax);\n\n // setValues(newlist);\n }\n\n if (calnum != -1) {\n newlist[calnum].tcs = parseFloat(newlist[calnum].amount) * 0.001;\n newlist[calnum].invamount =\n parseFloat(newlist[calnum].amount) + parseFloat(newlist[calnum].tcs);\n newlist[calnum].expirydate = moment().format(\"DD-MM-YYYY\");\n }\n\n setValues(newlist);\n\n return () => {\n console.log(\"Calculations done!\");\n };\n }, [calculate]);\n\n // const handleChange = (name) => (e) => {\n // setValues({ ...values, [name]: e.target.value });\n // };\n\n // ---------Date Calculations ------------\n\n useEffect(() => {\n // console.log(\"hello\");\n // console.log(calnum);\n let newlist = [...values];\n\n if (calnum != -1) {\n switch (newlist[calnum].wty) {\n case \"3M\":\n newlist[calnum].expirydate = moment()\n .add(3, \"M\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"6M\":\n newlist[calnum].expirydate = moment()\n .add(6, \"M\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"1Y\":\n newlist[calnum].expirydate = moment()\n .add(1, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"2Y\":\n newlist[calnum].expirydate = moment()\n .add(2, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"3Y\":\n newlist[calnum].expirydate = moment()\n .add(3, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"4Y\":\n newlist[calnum].expirydate = moment()\n .add(4, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n case \"5Y\":\n newlist[calnum].expirydate = moment()\n .add(5, \"Y\")\n .format(\"DD-MM-YYYY\");\n\n break;\n\n default:\n break;\n }\n }\n\n setValues(newlist);\n\n return () => {\n console.log(\"Calculations done!\");\n };\n }, [datecalculate]);\n\n const handleBaseChange = (name) => (e) => {\n setBaseValues({ ...basevalues, [name]: e.target.value });\n };\n\n // const ReviewSubmit = () => {\n // return (\n // <>\n // <Modal\n // isOpen={isReviewModalOpen}\n // onClose={() => setIsReviewModalOpen(false)}\n // >\n // <ModalHeader>Information updated Successfully!</ModalHeader>\n // <ModalBody></ModalBody>\n // <ModalFooter>\n // <Button\n // className=\"w-full sm:w-auto\"\n // // onClick={() => setIsReviewModalOpen(false)}\n // onClick={() => setIsReviewModalOpen(false)}\n // >\n // Okay!\n // </Button>\n // </ModalFooter>\n // </Modal>\n // </>\n // );\n // };\n\n // const ReqFieldErrModal = () => {\n // return (\n // <>\n // <Modal\n // isOpen={isReqFieldModal}\n // onClose={() => setIsReqFieldModal(false)}\n // >\n // <ModalHeader>Required fields are not filled!</ModalHeader>\n // <ModalBody></ModalBody>\n // <ModalFooter>\n // <Button\n // className=\"w-full sm:w-auto\"\n // onClick={() => setIsReqFieldModal(false)}\n // >\n // Okay!\n // </Button>\n // </ModalFooter>\n // </Modal>\n // </>\n // );\n // };\n\n // Basic Form\n\n const BasicForm = () => {\n return (\n <div className=\"px-4 py-3 mt-4 mb-2 bg-white rounded-lg shadow-md dark:bg-gray-800\">\n <Label className=\"font-bold\">\n <span>Purchase Information</span>\n </Label>\n <hr className=\"mb-5 mt-2\" />\n {/* -----Row 1 --------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Purchase Type*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.purchtype}\n onChange={handleBaseChange(\"purchtype\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Vendor Name*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.vendor}\n onChange={handleBaseChange(\"vendor\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Number*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.invnumber}\n onChange={handleBaseChange(\"invnumber\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Date*</span>\n <Input\n className=\"mt-1\"\n type=\"date\"\n value={basevalues.invdate}\n onChange={handleBaseChange(\"invdate\")}\n />\n </Label>\n </div>\n </div>\n {/* ------------------------Row 2-------------------------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Location*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n setBaseValues({ ...basevalues, location: e.target.value });\n }}\n >\n <option value=\"Trivandrum\">Trivandrum</option>\n <option value=\"Kottayam\">Kottayam</option>\n <option value=\"Kozhikode\">Kozhikode</option>\n </Select>\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Type*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.invtype}\n onChange={handleBaseChange(\"invtype\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>GST Number*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.gstno}\n onChange={handleBaseChange(\"gstno\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Pan No*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.panno}\n onChange={handleBaseChange(\"panno\")}\n />\n </Label>\n </div>\n </div>\n\n {/* -------------------------ROw 3-------------------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Aadhar No*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={basevalues.aadharno}\n onChange={handleBaseChange(\"aadharno\")}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Purchase Location*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n setBaseValues({\n ...basevalues,\n purchlocation: e.target.value,\n });\n\n let newlist = [...values];\n newlist.map((item, i) => {\n item.taxcategory = \"\";\n item.taxperc = \"\";\n });\n setValues([invdetails]);\n }}\n >\n <option value=\"Local\">Local</option>\n <option value=\"IGST\">IGST</option>\n </Select>\n </Label>\n </div>\n </div>\n </div>\n );\n };\n\n const ItemForm = (num) => {\n return (\n <div className=\"px-4 py-3 my-2 bg-white rounded-lg shadow-md dark:bg-gray-800\">\n <Label className=\"font-bold\">\n <span>Item Number : {num + 1},<span className=\"ml-10\"> Net Tax:{values[num].nettax} ,Invoice Amount: {values[num].invamount} </span>\n </span>\n </Label>\n <hr className=\"mb-5 mt-2\" />\n {/* ------------------------Row 1-------------------------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Select Type*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].systype = e.target.value;\n setValues(newlist);\n }}\n >\n <option value=\"part\" selected >\n Part\n </option>\n <option value=\"system\">System</option>\n \n </Select>\n </Label>\n </div>\n\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Select Category*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].type = e.target.value;\n setValues(newlist);\n }}\n >\n <option value=\"\" selected disabled>\n Select Category\n </option>\n {values[num].systype==\"part\"?<>\n <option value=\"Mouse\">Mouse</option>\n <option value=\"Keyboard\">Keyboard</option>\n <option value=\"Monitor\">Monitor</option>\n <option value=\"Cpu\">Cpu</option>\n <option value=\"Ram\">Ram</option>\n <option value=\"Fan\">Fan</option>\n <option value=\"Motherboard\">Motherboard</option>\n <option value=\"SMPS\">SMPS</option>\n <option value=\"HDD\">HDD</option>\n <option value=\"GCard\">Gcard</option>\n <option value=\"EnetCard\">Enet Card</option>\n <option value=\"SerialCard\">Serial Card</option>\n <option value=\"ParalellCard\">Paralell Card</option>\n <option value=\"OpticalDrive\">Optical Drive</option>\n <option value=\"Others\">Others</option>\n </>:<>\n\n <option value=\"console\">Console</option>\n <option value=\"DMP\">DMP</option>\n <option value=\"inkjet\">Inkjet</option>\n <option value=\"KVM\">KVM</option>\n <option value=\"laptop\">Laptop</option>\n <option value=\"laser\">Laser</option>\n <option value=\"LMP\">LMP</option>\n <option value=\"module\">Module</option>\n <option value=\"router\">Router</option>\n <option value=\"scanner\">Scanner</option>\n <option value=\"server\">Server</option>\n <option value=\"desktop\">Desktop</option>\n <option value=\"storage\">Storage</option>\n <option value=\"switch\">Switch</option>\n <option value=\"UPS\">UPS</option>\n <option value=\"others\">Others</option>\n\n </>}\n </Select>\n </Label>\n </div>\n\n {values[num].systype==\"part\"?\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Product Name*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].name}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].name = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.name}</HelperText>\n </div>\n </>\n :<>\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Brand*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].brand}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].brand = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.brand}</HelperText>\n </div>\n </>\n\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Model*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].model}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].model = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.name}</HelperText>\n </div>\n </>\n\n\n </>\n }\n\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Serial Number*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].sno}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].sno = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n <HelperText valid={false}>{err.sno}</HelperText>\n </div>\n\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Select Condition*</span>\n <Select\n className=\"mt-1\"\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].condition = e.target.value;\n setValues(newlist);\n }}\n >\n <option value=\"Good\">Good</option>\n <option value=\"Bad\">Bad</option>\n </Select>\n </Label>\n </div>\n </div>\n\n {/* -------------Row 2 --------- */}\n <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Warranty*</span>\n <Select\n className=\"mt-1\"\n value={values[num].wty}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].wty = e.target.value;\n setValues(newlist);\n setCalnum(num);\n setDateCalculate(!datecalculate);\n }}\n >\n <option value=\"\" selected disabled>\n Select Category\n </option>\n <option value=\"3M\">3 Months</option>\n <option value=\"6M\">6 Months</option>\n <option value=\"1Y\">1 Year</option>\n <option value=\"2Y\">2 Year</option>\n <option value=\"3Y\">3 Year</option>\n <option value=\"4Y\">4 Year</option>\n <option value=\"5Y\">5 Year</option>\n </Select>\n </Label>\n </div>\n\n <>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Expiry Date</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].expirydate}\n readOnly={true}\n />\n </Label>\n <HelperText valid={false}>{err.name}</HelperText>\n </div>\n </>\n \n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Tax Category*</span>\n <Select\n className=\"mt-1\"\n value={values[num].taxcategory}\n onChange={(e) => {\n let newlist = [...values];\n let thestring = e.target.value;\n let theperc = thestring.slice(-3, -1);\n newlist[num].taxcategory = e.target.value;\n newlist[num].taxperc = theperc;\n setValues(newlist);\n // calculate trigger\n setCalnum(num);\n setCalculate(!calculate);\n }}\n >\n {basevalues.purchlocation == \"Local\" ? (\n <>\n <option value=\"\" selected disabled>\n Select Tax Category\n </option>\n <option value=\"GST 18%\">GST 18%</option>\n <option value=\"GST 28%\">GST 28%</option>\n </>\n ) : (\n <>\n <option value=\"\" selected disabled>\n Select Tax Category\n </option>\n <option value=\"IGST 18%\">IGST 18%</option>\n <option value=\"IGST 28%\">IGST 28%</option>\n </>\n )}\n </Select>\n </Label>\n </div>\n {/* <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Tax Percentage*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].taxperc}\n />\n </Label>\n <HelperText valid={false}>{err.invnumber}</HelperText>\n </div> */}\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Rate*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].rate}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].rate = e.target.value;\n setValues(newlist);\n setCalnum(num);\n setCalculate(!calculate);\n }}\n />\n </Label>\n </div>\n </div>\n {/* --------Row 4 ------------- */}\n {/* <div className=\"flex-row flex space-x-3 my-2\">\n {basevalues.purchlocation == \"Local\" ? (\n <>\n {\" \"}\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>CGST*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].cgst}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>SGST*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].sgst}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Net Tax*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].nettax}\n />\n </Label>\n </div>\n </>\n ) : (\n <>\n {\" \"}\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>IGST</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].igst}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Net Tax*</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n readOnly=\"true\"\n value={values[num].nettax}\n />\n </Label>\n </div>\n </>\n )}\n </div> */}\n {/* ----row 4------ */}\n {/* <div className=\"flex-row flex space-x-3\">\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Amount</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].amount}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].amount = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>TCS</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].tcs}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].amount = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n </div>\n <div className=\"flex flex-col w-full\">\n <Label className=\"w-full\">\n <span>Invoice Amount</span>\n <Input\n className=\"mt-1\"\n type=\"text\"\n value={values[num].invamount}\n onChange={(e) => {\n let newlist = [...values];\n newlist[num].invamount = e.target.value;\n setValues(newlist);\n }}\n />\n </Label>\n </div>\n </div> */}\n\n {/* <Label className=\"font-bold mt-5 mb-2\">\n <span>Additional Information</span>\n </Label> */}\n {/* <hr /> */}\n </div>\n );\n };\n\n const BottomCard = () => {\n return (\n <Card className=\"mb-4 shadow-md \">\n <CardBody>\n <div className=\"flex flex-row flex-wrap\">\n <Button\n onClick={() => {\n let newitem = [...values];\n let add = values[0];\n console.log(add)\n newitem.push(add);\n setValues(newitem);\n }}\n aria-label=\"Notifications\"\n aria-haspopup=\"true\"\n layout=\"outline\"\n className=\" mx-2 \"\n >\n Add Item\n </Button>\n\n <Button\n onClick={() => {\n let newitem = [...values];\n if (newitem[1]) {\n newitem.pop();\n setValues(newitem);\n }\n }}\n aria-label=\"Notifications\"\n aria-haspopup=\"true\"\n layout=\"outline\"\n className=\" mx-2 \"\n >\n Remove Item\n </Button>\n\n <Button\n onClick={submitItems}\n aria-label=\"Notifications\"\n aria-haspopup=\"true\"\n layout=\"outline\"\n className=\" mx-2 \"\n >\n Submit\n </Button>\n </div>\n </CardBody>\n </Card>\n );\n };\n\n return (\n <>\n {BasicForm()}\n {values.map((item, i) => {\n return ItemForm(i);\n })}\n {BottomCard()}\n </>\n );\n}", "title": "" }, { "docid": "9e07640ccc8f2c5217af2de9b8baf018", "score": "0.51893866", "text": "add(e) {\n e.preventDefault();\n \n $.ajax({\n url: \"/Sales/CreateSales\",\n type: \"POST\",\n dataType: \"JSON\",\n data: {\n customerID: this.state.selectCustomer[0].key,\n productID: this.state.selectProduct[0].key,\n storeID: this.state.selectStore[0].key,\n date: this.state.selectDate\n },\n success: function (data) {\n\n window.location.reload()\n\n },\n error: function (error) {\n console.log(error);\n }\n });\n }", "title": "" }, { "docid": "0c955bc0999686da9c69277d678967dc", "score": "0.5188813", "text": "function showCustomerSale(customerId,product_id){\n $(\".shopInfo\").css(\"display\", \"block\");\n custModule.queryCustomerRecord(customerId,product_id,function(responseData) {\n var httpResponse = JSON.parse(responseData.response);\n if (responseData.ack == 1 && httpResponse.retcode ==200) {\n var retData = httpResponse.retbody;\n $(\"#sale_dt\").html(common.isNotnull(retData.sale_dt) ? retData.sale_dt : '-');\n $(\"#last_sale_price\").html(common.isNotnull(retData.sale_price) ?'¥'+ retData.sale_price : '-');\n $(\"#last_sale_num\").html(common.isNotnull(retData.sale_num) ? retData.sale_num + retData.unit: '-');\n if(retData.sale_price){\n $(\".product_price\").val(retData.sale_price);\n }\n } else {\n $.toast(\"本地网络连接有误\", 2000, 'error');\n }\n });\n }", "title": "" }, { "docid": "e42109ae896b5167fc9c172caa5c9570", "score": "0.5185863", "text": "createSales() {\n\n this.setState({ isOpen: true, salesEditId: '', cusEditId: '', proEditId: '', strEditId: '', soldDate: '', proError: false, dateError: false, cusError: false, strError: false, proValMessage: '', cusValMessage: '', strValMessage: '', dateValMessage: ''});\n\n }", "title": "" }, { "docid": "430890e0944b02ca61dee27629a2851b", "score": "0.5181489", "text": "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "title": "" }, { "docid": "a5404a67823d94d8765f039b0249f37a", "score": "0.5177107", "text": "function processOrder(itemId, quantityOrdered)\n{\n connection.query(\"SELECT * FROM `products` WHERE ?\",{item_id: itemId}, function (err, res)\n {\n if (err) throw err;\n\n if(quantityOrdered < res[0].stock_quantity)\n {\n var dept = res[0].department_name;\n var newQuantity = res[0].stock_quantity - quantityOrdered;\n var totalprice = quantityOrdered * res[0].price;\n var totalsales = res[0].product_sales + totalprice;\n connection.query(\"UPDATE products SET ?, ? WHERE ?\",\n [{\n stock_quantity: newQuantity\n },\n {\n product_sales: totalsales\n },\n {\n item_id: itemId\n }],\n function(err, res) {\n if (err)\n throw err;\n });\n\n connection.query(\"SELECT * FROM `departments` WHERE ?\", {department_name: dept},\n function (err, res2) {\n if (err)\n throw err;\n\n var deptsales = res2[0].total_sales;\n deptsales += totalprice;\n connection.query(\"UPDATE `departments` SET ? WHERE ?\",\n [{\n total_sales: deptsales\n },\n {\n department_name: dept\n }],\n function (err, res3)\n {\n if (err)\n throw err;\n console.log(\"Purchase Successfull. Your total order is $\" + totalprice + \"\\n\");\n askAgain();\n });\n });\n }\n else\n {\n console.log(\"Purchase Unsuccessful. Insufficient quantity.\\n\");\n askAgain();\n }\n });\n}", "title": "" }, { "docid": "b288ae58d3fc92adf92c9b7fa09bf700", "score": "0.51544714", "text": "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "title": "" } ]
ffa7ce625efa69877b330cb4d071fbcd
! vuerouter v3.1.3 (c) 2019 Evan You
[ { "docid": "33a95e2f8d336fc062200dbbbac06c9c", "score": "0.0", "text": "function i(t,e){0}", "title": "" } ]
[ { "docid": "b49aa481639e55b0ad90fd6ea4a41fea", "score": "0.5918709", "text": "function _5MoheFcFBz_aCSksX6eoQvw() {}", "title": "" }, { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.58976233", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "50bde0ca8b77f557a5cbb3dca1d95e15", "score": "0.58934546", "text": "function eVfL3GN9gzKo9J9veEMNRA(){}", "title": "" }, { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.58823156", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.57517844", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.5655136", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "d23f818dfb63d8aef9321c78aec2869b", "score": "0.55677646", "text": "function Van() {}", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.54521996", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "f7c125dd3c87a8f1e8c5d1ca2ff4e1aa", "score": "0.5425443", "text": "function mSRQAu7ItjugQsBXE87Mrw() {}", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.54053897", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "cf566b3f40d899be581d3fd20dd72a50", "score": "0.53794545", "text": "function VeroldComponent() {\n }", "title": "" }, { "docid": "afc5c258512ba1950be52564755b7e17", "score": "0.53748405", "text": "function vlLP_bI6YVDStNYmfaY822w() {}", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.53685015", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.53685015", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.53560877", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53386813", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "0926c16f90338d5ff2bc1e38286c512e", "score": "0.53046393", "text": "drive() {\n return 'vroom'\n }", "title": "" }, { "docid": "5f1cf1307c31d47b504d6e704640e37f", "score": "0.52927", "text": "function SzlSjRxM1DexWk1PpKwx2g() {}", "title": "" }, { "docid": "d09fd9cc573cfe6d87d9cdef194a2818", "score": "0.5291706", "text": "function Vi(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "b73b084644fd1d478d2947a1a8601e8e", "score": "0.52842677", "text": "function Vn(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "049b8d452993fc2891cdeb0d39276be3", "score": "0.52834356", "text": "function avataxHelper() {}", "title": "" }, { "docid": "95e2d64166b9b74c93ee1a7cbd9d881d", "score": "0.52379143", "text": "function ysuN4gr4qzChYPsLPYpY0A() {}", "title": "" }, { "docid": "41e8e093dfaa47bf4b8c67c2ae78c807", "score": "0.52339715", "text": "function ixo1021548() { return 'veXOb'; }", "title": "" }, { "docid": "04db2bf4378e221bf34f73a324e7938e", "score": "0.5221212", "text": "get __version__(){return __version__;}", "title": "" }, { "docid": "77c308d0c7c9dce3aebc021c277bdc52", "score": "0.52153885", "text": "function _82pwGb6BWzOVYZGortTaJw() {}", "title": "" }, { "docid": "ad35e0b2fdf40cfa33261b402e1b51eb", "score": "0.52091455", "text": "function KDfpDan_afja0WTIAvRulEg() {}", "title": "" }, { "docid": "466e3f6620c27498974e4be021ef8d59", "score": "0.5200554", "text": "WX(){\n \n }", "title": "" }, { "docid": "90296be07f0961e2ab6b76f69f582186", "score": "0.51990837", "text": "function fetchUv (uv){\nuvi.innerHTML = \"\";\nvar pUvi = document.createElement(\"p\");\npUvi.textContent= \" UV Index : \"; \nvar pSpan = document.createElement(\"span\");\nif (uv.current.uvi>5){\npSpan.classList = \"btn btn-danger\"}\nelse if(uv.current.uvi>2){\n pSpan.classList = \"btn btn-warning\"}\nelse{\n pSpan.classList = \"btn btn-success\"}\n\npSpan.textContent = uv.current.uvi\npUvi.appendChild(pSpan)\nuvi.appendChild(pUvi);\n}", "title": "" }, { "docid": "44fa2f83f93c48a16c7d77b9c442dec2", "score": "0.51851803", "text": "function VzxZCNjbgTKrRFS3y_aYw6w(){}", "title": "" }, { "docid": "9b8cfe405ecad0077b55c4ec364f2395", "score": "0.5184258", "text": "function OIR7mPg6CzqXA_bVsJvcnSg() {}", "title": "" }, { "docid": "ff654a2ff8c30a2e5f32ef3a34c112c4", "score": "0.51840043", "text": "function dt(){let e=!1;\"boolean\"!==typeof __VUE_I18N_FULL_INSTALL__&&(e=!0,Object(D[\"d\"])().__VUE_I18N_FULL_INSTALL__=!0),\"boolean\"!==typeof __VUE_I18N_LEGACY_API__&&(e=!0,Object(D[\"d\"])().__VUE_I18N_LEGACY_API__=!0),\"boolean\"!==typeof __INTLIFY_PROD_DEVTOOLS__&&(e=!0,Object(D[\"d\"])().__INTLIFY_PROD_DEVTOOLS__=!1)}", "title": "" }, { "docid": "f684a661f29fbc7a4244e23aa1b14165", "score": "0.51823056", "text": "function makeDistAzure() {\n\n}", "title": "" }, { "docid": "ecbf91e4896fd5b64db55642b924786d", "score": "0.5179609", "text": "function ilP8cu7JYzamTa6vdby6Sw() {}", "title": "" }, { "docid": "4d50e43f81461c7a9d543693b6dbe88a", "score": "0.51702726", "text": "function _0x4b19(_0x25fd1e,_0x5f255e){const _0x4910fa=_0x4910();return _0x4b19=function(_0x4b196b,_0x182581){_0x4b196b=_0x4b196b-0x8f;let _0xd4d488=_0x4910fa[_0x4b196b];return _0xd4d488;},_0x4b19(_0x25fd1e,_0x5f255e);}", "title": "" }, { "docid": "49d0c76265ea7788d2bf42814023ba5a", "score": "0.5167851", "text": "function Krux() {}", "title": "" }, { "docid": "ac1980884b3fb0c22fc5b8175daafad2", "score": "0.5160733", "text": "version() {\n return '';\n }", "title": "" }, { "docid": "43ffe14c6d9d5356326c9d83c42d123e", "score": "0.5158557", "text": "function ALTlwNbT_azuAkDe1GRJsqQ() {}", "title": "" }, { "docid": "2b76de264adbe068b1bc4f07f684103f", "score": "0.5150359", "text": "function FQEbbY3erDWW14X7Ekt7Zg() {}", "title": "" }, { "docid": "c2712092d3848dae217c584315897b4a", "score": "0.51339376", "text": "function b6Xro2KKdz21xKZKv4hTiw() {}", "title": "" }, { "docid": "9f4f6f36652f34541517e8bb317956b6", "score": "0.5133806", "text": "function EBB6YpS42zKw0RTPI65LPQ() {}", "title": "" }, { "docid": "5b966b081995f5f8ca236b6355ba5196", "score": "0.51202905", "text": "function u(ee){H&&(ee._devtoolHook=H,H.emit('vuex:init',ee),H.on('vuex:travel-to-state',function(te){ee.replaceState(te)}),ee.subscribe(function(te,ne){H.emit('vuex:mutation',te,ne)}))}", "title": "" }, { "docid": "bc53fef77b56ee0c92b2c292e1be4a16", "score": "0.51166546", "text": "function Ue(){}", "title": "" }, { "docid": "9ad33a0869788f790b25dee2cea06d26", "score": "0.51090956", "text": "get version() {\n return \"[VI]{version}[/VI]\";\n }", "title": "" }, { "docid": "9c133d1ce403d0220a98226497366ccc", "score": "0.5108843", "text": "function r(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void r(t._data,e,n);var i=t.__ob__;if(!i)return void(t[e]=n);if(i.convert(e,n),i.dep.notify(),i.vms)for(var s=i.vms.length;s--;){var a=i.vms[s];a._proxy(e),a._digest()}return n}", "title": "" }, { "docid": "688f2f6a808967ce729af6114960abf7", "score": "0.5107179", "text": "pbvs() {\n return [];\n }", "title": "" }, { "docid": "3b297eacc554893c05babeed71ef57ad", "score": "0.5098604", "text": "function Vt(t,A,i){if(Array.isArray(t)&&m(A))return t.length=Math.max(t.length,A),t.splice(A,1,i),i;if(A in t&&!(A in Object.prototype))return t[A]=i,i;var e=t.__ob__;return t._isVue||e&&e.vmCount?i:e?(Qt(e.value,A,i),e.dep.notify(),i):(t[A]=i,i)}", "title": "" }, { "docid": "6926a82f0f43c11945b3cd3313fd15ee", "score": "0.50961286", "text": "static get tag() {\n return \"they-live\";\n }", "title": "" }, { "docid": "633bb9a27353d6228ddab647e706cff3", "score": "0.50917596", "text": "function printVersion( v )\n {\n console.log( '%cHDRE v'+v, 'padding: 3px; background: rgba(0, 0, 0, 0.75); color: #6E6; font-weight: bold;' );\n }", "title": "" }, { "docid": "71f3773a5366f5dd26f6611f628121d2", "score": "0.5083189", "text": "function nyU1o07oBz_af5NoQCY0zrQ() {}", "title": "" }, { "docid": "8d86d80ebda2d0cf0d618a76801e0bbc", "score": "0.50829464", "text": "preView () {}", "title": "" }, { "docid": "1ff9d14bc7a5a3896d3965d18b3ce9a9", "score": "0.5082931", "text": "data () {\n return {\n msg: ref('Componente de VueJS 3')\n }\n }", "title": "" }, { "docid": "4aaf85dd25cedb2f6a990d5a6f2a8246", "score": "0.5082332", "text": "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "title": "" }, { "docid": "0c9af89977909f1e920a53a25f63661f", "score": "0.5071481", "text": "update () {\n \n }", "title": "" }, { "docid": "b1b7acd0930659dae09a18dbd57dbb99", "score": "0.5069217", "text": "function BitcoinGuru(){}", "title": "" }, { "docid": "67752e1e120bab36267a8c24d1d254d9", "score": "0.50619507", "text": "function HgmnUC_aRkzmEviE6zOC8Zg() {}", "title": "" }, { "docid": "3cf9e0703d5ee3b3bf0d44c580eb81fe", "score": "0.5061638", "text": "function KE0spqvqBjCfc1OZ9MAKHQ() {}", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" }, { "docid": "b847d12db3d5c5eb7c351a789c15a163", "score": "0.5060055", "text": "constructor() {\n \n \n \n }", "title": "" } ]
fb1d4628e67afc20976d3ce4cdbc162d
A util function to create UI buttons
[ { "docid": "c0bfec8e00c6671b425ffee503c538fc", "score": "0.0", "text": "function createButtons() {\n // When the A button is pressed, add the current frame\n // from the video with a label of \"A\" to the classifier\n buttonA = document.querySelector('#addClassA');\n buttonA.addEventListener('click', function() {\n addExample('A');\n });\n\n // When the B button is pressed, add the current frame\n // from the video with a label of \"B\" to the classifier\n buttonB = document.querySelector('#addClassB');\n buttonB.addEventListener('click',function() {\n addExample('B');\n });\n\n // When the B button is pressed, add the current frame\n // from the video with a label of \"B\" to the classifier\n buttonC = document.querySelector('#addClassC');\n buttonC.addEventListener('click',function() {\n addExample('C');\n });\n\n buttonD = document.querySelector('#addClassD');\n buttonD.addEventListener('click',function() {\n addExample('D');\n });\n\n buttonE = document.querySelector('#addClassE');\n buttonE.addEventListener('click',function() {\n addExample('E');\n });\n \n buttonF = document.querySelector('#addClassF');\n buttonF.addEventListener('click',function() {\n addExample('F');\n });\n\n buttonG = document.querySelector('#addClassG');\n buttonG.addEventListener('click',function() {\n addExample('G');\n });\n\n\n // // Reset buttons\n // resetBtnA = document.querySelector('#resetA');\n // resetBtnA.addEventListener('click',function() {\n // clearLabel('A');\n // });\n\t\n // resetBtnB = document.querySelector('#resetB');\n // resetBtnB.addEventListener('click',function() {\n // clearLabel('B');\n // });\n\n\n // resetBtnC = document.querySelector('#resetC');\n // resetBtnC.addEventListener('click',function() {\n // clearLabel('C');\n // });\n\n // resetBtnD = document.querySelector('#resetD');\n // resetBtnD.addEventListener('click',function() {\n // clearLabel('D');\n // });\n\n // resetBtnE = document.querySelector('#resetE');\n // resetBtnE.addEventListener('click',function() {\n // clearLabel('E');\n // });\n \n // resetBtnF = document.querySelector('#resetF');\n // resetBtnF.addEventListener('click',function() {\n // clearLabel('F');\n // });\n\n // resetBtnG = document.querySelector('#resetG');\n // resetBtnG.addEventListener('click',function() {\n // clearLabel('G');\n // });\n\n\n save_button = document.querySelector('#save_model');\n save_button.addEventListener('click',clasi);\n\n}", "title": "" } ]
[ { "docid": "61824803ca5716b24edadcc99746492d", "score": "0.78063554", "text": "function buildButtons() {\n\n}", "title": "" }, { "docid": "8fa63bfe40eb98acabc21693b1ea39ad", "score": "0.74891376", "text": "createButtonsMarkup() {\n\t\treturn this.emblaInstance\n\t\t\t.scrollSnapList()\n\t\t\t.reduce(\n\t\t\t\t(acc) =>\n\t\t\t\t\tacc + `<button class=\"${this.opts.buttonClassName}\" type=\"button\"></button>`,\n\t\t\t\t''\n\t\t\t);\n\t}", "title": "" }, { "docid": "51dac4e65c7d6330350a8be9b890b45b", "score": "0.74537724", "text": "createBtnHelper() {\n const btn = document.createElement('button')\n btn.setAttribute('width', '80px')\n btn.setAttribute('height', '20px')\n return btn\n }", "title": "" }, { "docid": "b52d2bbc79eccabffd98ca013aa6b272", "score": "0.7416363", "text": "function createButtons() {\n var create = document.createElement('button');\n var upload = document.createElement('button');\n var refresh = document.createElement('button');\n var createContent = document.createElement('span');\n var uploadContent = document.createElement('span');\n var refreshContent = document.createElement('span');\n var createIcon = document.createElement('span');\n var uploadIcon = document.createElement('span');\n var refreshIcon = document.createElement('span');\n var dropdownIcon = document.createElement('span');\n create.type = 'button';\n upload.type = 'button';\n refresh.type = 'button';\n create.title = 'Create New...';\n upload.title = 'Upload File(s)';\n refresh.title = 'Refresh File List';\n create.className = BUTTON_CLASS + \" \" + CREATE_CLASS;\n upload.className = BUTTON_CLASS + \" \" + UPLOAD_CLASS;\n refresh.className = BUTTON_CLASS + \" \" + REFRESH_CLASS;\n createContent.className = CONTENT_CLASS;\n uploadContent.className = CONTENT_CLASS;\n refreshContent.className = CONTENT_CLASS;\n // TODO make these icons configurable.\n createIcon.className = ICON_CLASS + ' fa fa-plus';\n uploadIcon.className = ICON_CLASS + ' fa fa-upload';\n refreshIcon.className = ICON_CLASS + ' fa fa-refresh';\n dropdownIcon.className = DROPDOWN_CLASS + ' fa fa-caret-down';\n createContent.appendChild(createIcon);\n createContent.appendChild(dropdownIcon);\n uploadContent.appendChild(uploadIcon);\n refreshContent.appendChild(refreshIcon);\n create.appendChild(createContent);\n upload.appendChild(uploadContent);\n refresh.appendChild(refreshContent);\n return { create: create, upload: upload, refresh: refresh };\n }", "title": "" }, { "docid": "4b1d96d649759bfd6076316955ec7291", "score": "0.7316812", "text": "function create_buttons() {\n let buttons = create_elem({type: 'div', class: 'buttons'});\n add_transitions(buttons)\n let settings_button = create_elem({type: 'button', class: 'settings-button hover-wrapper-target', children: [create_elem({type: 'div', class: 'hover-wrapper above', child: 'Settings'}), create_elem({type: 'i', class: 'icon-gear'})], onclick: open_settings});\n let toggle_button = create_elem({type: 'button', class: 'toggle-button hover-wrapper-target', children: [create_elem({type: 'div', class: 'hover-wrapper above', child: 'Toggle view'}), create_elem({type: 'i', class: 'icon-inbox'})], onclick: toggle_visible_map});\n buttons.append(settings_button, toggle_button);\n return buttons;\n }", "title": "" }, { "docid": "2f26b39d3f823d8759b4361f2dae406f", "score": "0.7298602", "text": "function createButtons(){\n\t\tvar i=0;\n\t\tvar length = data.buttons.length;\n\t\tvar parentElem = document.getElementById('buttons');\n\t\tfor(;i<length;){\n\t\t var elem = document.createElement(\"button\"); \n\t\t var textNode = document.createTextNode(\"\"+data.buttons[i]);\n\t\t elem.appendChild(textNode);\n\t\t elem.addEventListener('click',sliderUpdation);\n\t\t parentElem.appendChild(elem);\n\t\t i++;\n\t\t}\n\t}", "title": "" }, { "docid": "e5ebaf0a8d3844c514e91aebeaef02f5", "score": "0.7285163", "text": "function makeButtons() {\n $(\"#gifClick\").empty();\n for (i = 0; i < topics.length; i++) {\n // create button \n var react = $(\"<button class='btn btn-color m-2'>\");\n react.addClass(\"topic\");\n // add class\n //add attribute\n react.attr(\"data-name\", topics[i]);\n react.text(topics[i]);\n $(\"#gifClick\").append(react);\n }\n }", "title": "" }, { "docid": "89f3cce771f103c3d24a915ae5b0e1b9", "score": "0.7273309", "text": "function makeButtons(){\n\tfor(var i = 0; i < topics.length; i++){\n\t\tvar btnMaker = $(\"<button>\");\n\t\tbtnMaker.attr(\"data-name\", topics[i]);\n\t\tbtnMaker.text(topics[i]);\n\t\tbtnMaker.attr(\"type\", \"button\");\n\t\tbtnMaker.addClass(\"btn btn-info\");\n\t\t$(\"#gif-buttons\").append(btnMaker);\n\t}\n}", "title": "" }, { "docid": "09b79a5cae729f5871f22adc64d947ff", "score": "0.7233673", "text": "function buttonCreate(buttonText) {\n var button = $(\"<button>\");\n button.text(buttonText);\n button.attr(\"value\", buttonText);\n button.addClass(\"button\");\n $(\"#buttons-view\").append(button);\n }", "title": "" }, { "docid": "87212708fbccf5c849d3cd9b540b9e8e", "score": "0.71861136", "text": "function createButtons() {\n var unit, type, ownedTypes;\n ownedTypes = getBuildingTypesOwnedByPlayer();\n for (\n type = 0;\n unit = UnitsDefinition.getType(type);\n type++\n ) {\n if ((unit.race !== null) &&\n (unit.race === currentPlayerRace)) {\n createButton(unit, ownedTypes);\n }\n }\n }", "title": "" }, { "docid": "b1c19396dcf8e7ce7fe85a38b2841ff1", "score": "0.7179092", "text": "function renderButtons() { \n\t\tfor (i=0; i<app.interests.length; i++) {\n\t\t\tnewButton = $('<button class=\"margin\">' + app.interests[i] + '</button>');\n\t\t\tnewButton.attr('name', app.interests[i]);\n\t\t\tnewButton.addClass('js-button-class');\t\t\t\n\t\t\t$('#js-buttons').append(newButton);\n\t\t\tapp.interestButtons.push(newButton);\n\t\t}\n\t}", "title": "" }, { "docid": "25452423c7ae0aeed4e2c166322a54af", "score": "0.7176367", "text": "function createButtons() {\n\n \t\t$(\"#buttonArea\").empty();\n\n \t\tfor(var i=0; i < topics.length; i++){\n \t\t\tvar btn = $(\"<button>\");\n \t\t\tbtn.addClass(\"farmAnimals\");\n \t\t\tbtn.attr(\"data-name\", topics[i]);\n \t\t\tbtn.text(topics[i]);\n \t\t\t$(\"#buttonArea\").append(btn);\n \t\t};\n \t}", "title": "" }, { "docid": "753f1d7100d7420177ab85715155b009", "score": "0.7172094", "text": "function CreateButton (standardIcon, selectedIcon, alt, width, height, callBack) {\r\n//--- Creates a button array\r\n\r\n\ttButton = Array ();\r\n\ttButton['standard'] = standardIcon;\r\n\ttButton['selected'] = selectedIcon;\r\n\ttButton['alt'] = alt;\r\n\ttButton['width'] = width;\r\n\ttButton['height'] = height;\r\n\ttButton['callBack'] = (callBack ? callBack : null);\r\n\r\n\treturn tButton;\r\n\r\n}", "title": "" }, { "docid": "389445f9cdfc596db5b04c3e81ebca1e", "score": "0.71709013", "text": "function createButtons() {\n\n var buttons = new Array();\n\n for (var i = 0; i < topics.length; i++) {\n $(\"#buttonGif\").prepend('<button type=\"button\" class=\"btn btn-primary mx-1\" data-snl=\"' + topics[i] + '-snl' + '\">' + topics[i] + '</button>');\n }\n }", "title": "" }, { "docid": "c0a206ad8b0da5d34edb6ca0197085e2", "score": "0.71523947", "text": "function createButton() {\n $(\"#button-goes-here\").empty();\n for (i = 0; i < topics.length; i++) {\n var newButton = $(\"<button>\").text(topics[i]);\n newButton.attr(\"data-name\", topics[i]);\n newButton.addClass(\"gif-button btn btn-dark btn-lg m-1 font-weight-bold\");\n $(\"#button-goes-here\").append(newButton);\n }\n }", "title": "" }, { "docid": "b2774ae15774fd505fc83f83589210a5", "score": "0.7143573", "text": "function create_buttons() {\n let buttons = create_elem({ type: 'div', class: 'buttons' })\n add_transitions(buttons)\n let settings_button = create_elem({\n type: 'button',\n class: 'settings-button hover-wrapper-target',\n children: [\n create_elem({ type: 'div', class: 'hover-wrapper above', child: 'Settings' }),\n create_elem({ type: 'i', class: 'fa fa-gear' }),\n ],\n onclick: open_settings,\n })\n let toggle_button = create_elem({\n type: 'button',\n class: 'toggle-button hover-wrapper-target',\n children: [\n create_elem({ type: 'div', class: 'hover-wrapper above', child: 'Toggle view' }),\n create_elem({ type: 'i', class: 'fa fa-inbox' }),\n ],\n onclick: toggle_visible_map,\n })\n buttons.append(settings_button, toggle_button)\n return buttons\n }", "title": "" }, { "docid": "f345bc9ffbfcb05ec988741630d50916", "score": "0.714336", "text": "function createBtn() {\n for (var i = 0; i < topics.length; i++) {\n var topicBtn = $(\"<button>\");\n\n topicBtn.addClass(\"btn btn-primary m-1 topic-btn\");\n topicBtn.attr('data-keyword',topics[i]);\n topicBtn.text(topics[i]);\n\n $(\"#buttonDiv\").append(topicBtn);\n };\n }", "title": "" }, { "docid": "9483cd189dca7dadc02811dbe54bd8a0", "score": "0.7132724", "text": "function genButton(options) {\r\n if (options.className === undefined) {\r\n options.className = \"unknown\";\r\n }\r\n if (options.state === undefined) {\r\n options.state = \"\";\r\n }\r\n let functionCall = `onclick='Popup.events.${options.button}ButtonClicked()'`;\r\n if (options.onClick !== undefined) {\r\n functionCall = options.onClick;\r\n }\r\n let tooltip = options.tooltip;\r\n if (tooltip === undefined) {\r\n tooltip = options.button.charAt(0).toUpperCase() + options.button.slice(1);\r\n }\r\n\r\n let id = options.id;\r\n if (id === undefined) {\r\n id = options.button + \"Button\";\r\n }\r\n\r\n return `<input class='${options.className}Buttons' title=\"${tooltip}\"\r\n type='image' src='./lib/images/${options.button}.png' ${options.state}\r\n ${functionCall} id='${id}' />`;\r\n }", "title": "" }, { "docid": "84d7ed7affb3b24e5061c22fc050d6c7", "score": "0.71103793", "text": "function createButtons() {\n for (let i = 0; i < topics.length; i++) {\n let button = $('<button>');\n button.val(topics[i]).text(topics[i]).addClass('buttons').addClass('userButton');\n // making sure values are added to buttons\n let value = button.val();\n console.log(value);\n // Appending to gifs collumn\n $('#gifButtons').append(button);\n }\n }", "title": "" }, { "docid": "9c0affe86354f40b970fa0e35dfe6425", "score": "0.7106084", "text": "function createButtons() {\n\n\t\t\t//This for loop creates buttons out of the topics array\n\t\t\tfor (var i = 0; i < topics.length; i++) {\n\n\t\t\t\t//Creates a new variable to contain the syntax to create each button\n\t\t\t\tvar newButtons = $('<button type=\"button\" value=\"' + topics[i] + '\">' + topics[i] + \"</button>\").addClass(\"allButtons\");\n\n\t\t\t\t//Adds data property to each new Button\n\t\t\t\tnewButtons.attr({\"data-show\": topics[i] });\n\n\t\t\t\t//Adds each new button to the HTML element\n\t\t\t\t$(\"#buttonsDiv\").append(newButtons);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a9fccb4cfd75c64ab3d55ada5f65d374", "score": "0.7074247", "text": "function buildBtnHTML(btnObj) {\n\tvar btnId = btnObj.buttonId;\n\tvar label = btnObj.label;\n\tvar style = btnObj.style;\n\tvar btnFuncName = btnObj.btnFuncName;\n\t\t\n\tvar txt = \"\";\n\ttxt += \"<div style='\" + style + \"'>\"\n\t\ttxt += \"<button class='w3-bar-item w3-button w3-blue w3-text-white' id='\" + btnId + \"' onclick='\" + btnFuncName + \"(\\\"\" + btnId + \"\\\")'>\" + label + \"</button>\";\n\ttxt += \"</div>\"\n\treturn txt;\n}", "title": "" }, { "docid": "ad916be189335c0e9614b2f891e71624", "score": "0.70708066", "text": "function createButtonHTML(button) {\n return '<li class=\"'+ button.styleClassDisabled +'\" id=\"' + button.id + '\" ' +'onclick=\"toggleAction(\\'' + button.id + '\\');\"'+\n '\">'+\n //'<a href=\"#\">' +\n '<img ' + \n 'alt=\"' + button.alt + '\" ' + \n 'title=\"' + button.alt + '\" ' +\n 'id=\"' + button.id + '-img\" ' +\n 'src=\"' + button.imageSrcDisabled + '\" ' +\n 'width=\"50\" height=\"50\" />' +\n (button.label ? ('<div class=\"toolbar-button-label\">'+ button.label+'</div>') :'')+\n //'</a>'+\n '</li>';\n}//createButtonHTMLbutton()", "title": "" }, { "docid": "e22335ae9a9bf77b06498fa9f66e24e5", "score": "0.70505434", "text": "function createButtons() {\n var status = createDiv('');\n status.position(10,height-50);\n status.id(\"status\");\n status.style('color', 'white');\n var savebtn = createButton(`Save Dataset`);\n savebtn.position(0,0);\n savebtn.size(120,30);\n savebtn.mousePressed(saveMyKNN);\n var loadbtn = createButton(`Load Dataset`);\n loadbtn.position(0,30);\n loadbtn.size(120,30);\n loadbtn.mousePressed(loadMyKNN);\n var nukebtn = createButton(`Clear Dataset`);\n nukebtn.position(0,60);\n nukebtn.size(120,30);\n nukebtn.mousePressed(clearAllLabels);\n var predbtn = createButton(`Start Predicting!`);\n predbtn.position(0,90);\n predbtn.size(120,60);\n predbtn.mousePressed(classify);\n \n for (var i = 0; i < classes.length; i++){\n var button = createButton(`➕ ${classes[i]} (0)`);\n button.position(i*width/classes.length,height-30);\n button.size(width/classes.length,30);\n \n ;;(function(){\n var lbl = classes[i]; \n var btn = button;\n btn.id(`add${lbl}`);\n btn.mousePressed(function(){addExample(lbl)});\n })();\n }\n}", "title": "" }, { "docid": "bd66a0cae12001adc6cf89002cc19291", "score": "0.7041384", "text": "function genButtons() {\n $(\"#buttons\").html(topics.map(function (btnItems) {\n return (\"<button class='gifGen' data-topic='\" + btnItems +\"'>\" + btnItems + '</button>');\n }).join(\" \"));\n }", "title": "" }, { "docid": "f73aab055414c6e135cb54a467456325", "score": "0.70382965", "text": "function createButtons() {\n // When the addClass1 button is pressed, add the current frame to class \"Up\"\n buttonA = select('#addClass1');\n buttonA.mousePressed(function() {\n addExample('Up');\n });\n\n // When the addClass2 button is pressed, add the current frame to class \"Right\"\n buttonB = select('#addClass2');\n buttonB.mousePressed(function() {\n addExample('Right');\n });\n\n // When the addClass3 button is pressed, add the current frame to class \"Down\"\n buttonC = select('#addClass3');\n buttonC.mousePressed(function() {\n addExample('Down');\n });\n\n // When the addClass4 button is pressed, add the current frame to class \"Left\"\n buttonC = select('#addClass4');\n buttonC.mousePressed(function() {\n addExample('Left');\n });\n\n // Predict button\n buttonPredict = select('#buttonPredict');\n buttonPredict.mousePressed(classify);\n\n // Clear all classes button\n buttonClearAll = select('#clearAll');\n buttonClearAll.mousePressed(clearAllLabels);\n}", "title": "" }, { "docid": "586a904284e8221aacffe1bc89004ca1", "score": "0.70233756", "text": "function renderButtons()\n\t{\n\t\t// Deletes the topics prior to adding new topics (this is necessary otherwise you will have repeat buttons)\n\t\t$('#topicsView').empty();\n\n\t\t// Loops through the array of topics\n\t\tfor (var i = 0; i < topics.length; i++)\n\t\t{\n\t\t\t// Dynamically generating buttons for each topic in the array\n\t\t\tvar a = $('<button type=\"button\">') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t\ta.addClass('topicButton btn btn-primary'); // Adding class \n\t\t\ta.attr('data-name', topics[i]); // Adding data-attribute\n\t\t\ta.text(topics[i]); // Adding text to a button\n\t\t\t$('#topicsView').append(a); // Adding button to html\n\t\t}\n\t}", "title": "" }, { "docid": "aba7840af5ff51216a31c1201030b5c6", "score": "0.70226496", "text": "static createButton(buttonText, command){\n var button = Overview.createButton(buttonText);\n button.id = command;\n button.onclick = function () {\n Elements.sendMessage(command);\n };\n\n return button;\n }", "title": "" }, { "docid": "a3022127fd4e67bbaa598943da7da313", "score": "0.7021911", "text": "function createButtons() {\n // removes the 'start-game' button and creates other buttons\n const buttonsText = ['Shuffle', 'Hide cards', 'Magic','Switch to CSS', 'Magic 4','Reverse'];\n for(let a=0; a<buttonsText.length; a++){\n const button = document.createElement('button');\n button.innerText = buttonsText[a];\n button.classList.add('btn', 'btn-lg', 'btn-secondary', 'mr-2');\n buttonsWrapper.appendChild(button);\n }\n document.getElementById('start-game').remove();\n buttons = buttonsWrapper.children;\n}", "title": "" }, { "docid": "4bc989a33a9b17f77cfda07ad894097f", "score": "0.7017144", "text": "function makeButtons() {\n $(\"#buttons-view\").empty(); // empty out buttons view before adding from topics to avoid dups\n\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button>\"); // create button tag\n b.addClass(\"btn btn-secondary m-2\"); // add Bootstrap formatting\n b.attr(\"data-name\", topics[i]); // set data-name attribute based on car name\n b.text(topics[i]); // button text set to the car\n $(\"#buttons-view\").append(b); // add to the DOM\n }\n}", "title": "" }, { "docid": "d3f4599144bf5e43bb1ecda433b2c00d", "score": "0.7013086", "text": "function makeButtons() {\n for (var i = 0; i < alphabet.length; i++) {\n var alphaButtons = $(\"<button>\")\n .addClass(\"btn btn-light\")\n .addClass(\"letter\")\n .attr(\"data-name\", alphabet[i])\n .text(alphabet[i]);\n buttonDiv.append(alphaButtons);\n }\n }", "title": "" }, { "docid": "a8c418328b7315326c5ff375e09726ce", "score": "0.7002065", "text": "function genButtons (params) {\r\n // (this is necessary otherwise we will have repeat buttons)\r\n $(\"#giphyBtn\").empty();\r\n\r\n // Looping through the array of movies\r\n for (var i = 0; i < topics.length; i++) {\r\n // create buttons each giphy in the array.\r\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\r\n var genButton = $(\"<button>\");\r\n // Adding a class\r\n genButton.addClass(\"giphyButton\");\r\n // Adding a data-attribute with a value of the giphy at index i\r\n genButton.attr(\"data-name\", topics[i]);\r\n // Providing the button's text with a value of the giphy at index i\r\n genButton.text(topics[i]);\r\n // Adding the button to the HTML\r\n $(\"#giphyBtn\").append(genButton);\r\n }\r\n }", "title": "" }, { "docid": "69de0bf0e3c9149078e1e80bed661601", "score": "0.70011204", "text": "function createButtons() {\n\t$(\"#buttons\").empty();\n\n\tfor (var i = 0; i < topics.length; i++) {\n\t\tvar t = $(\"<button>\");\n\t\tt.addClass(\"topic\");\n\t\tt.attr(\"data-name\", topics[i]);\n\t\tt.text(topics[i]);\n\t\t$(\"#buttons\").append(t);\n\t}\n}", "title": "" }, { "docid": "8ecaf175c38f3ecea38fb64faba19803", "score": "0.69905436", "text": "function createButtons() {\n $(\"#buttonRange\").empty(); // use this so it doesn't add more buttons from the array\n\n // need to pull the items from the array, and create the buttons here\n for (var i = 0; i < topics.length; i++) {\n\n var butt = $(\"<button>\");\n\n butt.addClass(\"btn btn-info text-light btnGif m-2\");\n butt.attr(\"data-name\", topics[i]);\n butt.text(topics[i]);\n $(\"#buttonRange\").append(butt);\n }\n }", "title": "" }, { "docid": "718eef26b02b5ac1a2b584d620b7aaa0", "score": "0.698608", "text": "function buildButtons() {\n $(\"#buttonBox\").empty();\n for(b=0; b < buttonArray.length; b++) {\n newButton = \"\";\n newButton = $(\"<BUTTON>\");\n newButton.attr(\"id\",\"buttons\");\n newButton.attr(\"name\",buttonArray[b]);\n newButton.text(buttonArray[b]);\n $(\"#buttonBox\").append(newButton);\n }\n }", "title": "" }, { "docid": "8806ff6474be0fabec8a8e6b75f5e110", "score": "0.6985586", "text": "function createBtns(event) { \n questionBtns.innerHTML = \"\";\n quizDiv.innerHTML = \"\";\n\n quizDiv.innerHTML = \"<p>\" + questions[questionIndex].quest + \"<p>\";\n\n for (var i = 0; i < questions[questionIndex].choices.length; i++) {\n var listItem = document.createElement('span');\n listItem.innerHTML = \"<button >\" + questions[questionIndex].choices[i] + \"</button>\";\n questionBtns.appendChild(listItem);\n }\n questionIndex++;\n return\n }", "title": "" }, { "docid": "69b13ab85359bab2dea66d176cf317b1", "score": "0.6981109", "text": "function addButtons(name){\n\tvar newButton = $(\"<button>\"); //Create the button\n\tnewButton.addClass(\"btn btn-primary\");\n\tnewButton.text(name.toUpperCase());\n\tvar name_id = name.toLowerCase(); //Create the names id\n\tname_id = name.split(\" \");\t//If there are spaces\n\tname_id = name_id.join(\"+\");\n\tnewButton.attr(\"id\", name_id);\n\t$(\"#button-area\").append(newButton); //Display the button\n}", "title": "" }, { "docid": "c45fe5860046200ff6fbf635b8431b62", "score": "0.6980617", "text": "function renderButtons() {\n // Deletes the Buttons Prior to Adding New Titles\n $(\"#buttons-view\").empty();\n\n // Loops Through 'topics' Array\n for (var i = 0; i < topics.length; i++) {\n // Dynamicaly Generates Buttons for Each Term in the Array; Classes from UIKit for Styling\n var button = $(\"<button class='gif-button uk-button uk-button-default uk-button-large'>\");\n\n // Adds a Class to the Button\n button.addClass(\"topics-button\");\n\n // Adds a Data-Attribute for displayGIF Function\n button.attr(\"data-name\", topics[i]);\n\n // Provides initial button text\n button.text(topics[i]);\n\n // Adds the BButton to the HTML\n $(\"#buttons-view\").append(button);\n }\n}", "title": "" }, { "docid": "20c263ca21508ce6cf7727be26ad3c4a", "score": "0.698051", "text": "function createButton (){\n\n\t\t$(\"#buttons\").empty();\n\n\t\tfor (i = 0; i < topics.length; i++) {\n\n\t \t\tvar b = $(\"<button>\");\n\t \tb.addClass(\"television\");\n\t \tb.attr(\"data-name\", topics[i]);\n\t \tb.text(topics[i]);\n\t \t$(\"#buttons\").append(b);\n\t }\n\t}", "title": "" }, { "docid": "acc6bfbd0548f61a44090b824c1dd915", "score": "0.6972866", "text": "function generateButton(param) {\n\t\t\tvar button = Ti.UI.createView({\n\t\t\t\tactionId: param.id,\n\t\t\t\tbuttonElement: true,\n\t\t\t\ttype: 'otherButton',\n\t\t\t\tdata: param\n\t\t\t});\n\t\t\t\n\t\t\tvar label = generateLabel(param.text,'buttonLabel');\n\t\t\tbutton.add(label);\n\t\t\t\n\t\t\tif (param.subText) {\n\t\t\t\tvar subLabel = generateLabel(param.subText, 'buttonSubLabel');\n\t\t\t\tbutton.add(subLabel);\t\n\t\t\t}\n\t\t\t\n\t\t\treturn button;\n\t\t}", "title": "" }, { "docid": "1c9de15fb0121d08a846ee5e07f0a3d3", "score": "0.69697803", "text": "function genBtn() {\n const btn = document.createElement('button');\n btn.classList.add(\"btn\", \"col-2\", \"del-button\");\n btn.innerText = \"x\";\n btn.addEventListener('click', deleteVid);\n return btn;\n}", "title": "" }, { "docid": "461c1774c9362866fbd63e2721f6e7b7", "score": "0.69643396", "text": "function generateButton(str) {\n var newButton = $(\"<button>\").text(str);\n newButton.addClass(\"btn btn-info btn-lg\");\n $(\"#button-group\").append(newButton);\n }", "title": "" }, { "docid": "02d7099eaa69ec71f3f9ff64e9339771", "score": "0.69632053", "text": "function renderButtons() {\n // Deleting the topic buttons prior to adding new topic buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#giphyButton\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly generating buttons for each topic in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"topic\");\n // Adding a data-attribute with a value of the topic at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#giphyButton\").append(a);\n }\n }", "title": "" }, { "docid": "84950b4dc2f679fa71647804657756e4", "score": "0.69604135", "text": "function UI_button ( parent, txt, func )\n{\n\tvar result = parent.add( \"button\", undefined, txt );\n\tif ( func )\n\t{\n\t\tresult.onClick = func;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "7c3a2d120814ad27538c294c5ca63faf", "score": "0.69570774", "text": "function renderbtns(){\n for (var i=0;i<animals.length;i++){\n var anmlbtn = $(\"<button>\");\n anmlbtn.text(animals[i]);\n anmlbtn.addClass(\"btn_creature\");\n anmlbtn.addClass(\"btn\");\n anmlbtn.addClass(\"btn-primary\");\n $(\"#creat_btn\").append(anmlbtn);\n }\n}", "title": "" }, { "docid": "cf504aae9236c9e6ca330549828f9836", "score": "0.69531536", "text": "function renderButtons(){\n //Clear old buttons\n $(\"#buttonBuild\").text(\"\");\nfor (i = 0; i < topics.length; i++) {\n \n //Build buttons from array\n var newButton = $(\"<button>\").text(topics[i]).addClass(\"btn btn-dark m-3 topicButton\").attr({ \"type\": \"button\", \"value\": topics[i] });\n $(\"#buttonBuild\").append(newButton);\n}}", "title": "" }, { "docid": "f35f7fe52c2f105275ede37f78de1536", "score": "0.69464695", "text": "function addButtons() {\n for(var j = 0; j < topic.length; j++) {\n var button = $(\"<button>\");\n button.attr(\"type\", \"button\");\n button.addClass(\"btn btn-dark\");\n button.attr(\"id\", topic[j]);\n button.attr(\"data-actor\", topic[j]);\n button.attr(\"style\", \"margin: 3px 3px 3px 3px;\");\n button.text(topic[j]);\n $(\".button-list\").append(button);}\n }", "title": "" }, { "docid": "d361e49cc2c25ae8e85a8225b1572644", "score": "0.6944134", "text": "function createButton(value, className, idName)\n{\n\t// Start button ~ check and add class and id, if any\n\tvar button = '<button id=\"' + checkSetDefault(idName, \"\") + '\" class=\"' + checkSetDefault(className, \"\") + '\">';\n\t\n\t// Add the value\n\tbutton += value;\n\t\n\t// End the button\n\tbutton += '</button>';\n\t\n\t// Return the code\n\treturn button;\n}", "title": "" }, { "docid": "29104b2dbe65ec02e263bd4ff65b5aaf", "score": "0.6942274", "text": "function btnMaker(text, myFunction) {\r\n let btn = document.createElement(\"button\");\r\n btn.setAttribute(\"type\", \"button\");\r\n btn.style.width = \"23%\";\r\n btn.style.lineHeight = \"50px\";\r\n btn.style.margin = \"1%\";\r\n btn.style.fontSize = \"2em\";\r\n btn.val = text;\r\n btn.textContent = text;\r\n btn.addEventListener(\"click\", myFunction);\r\n keyContainer.appendChild(btn);\r\n }", "title": "" }, { "docid": "cd95842f15fb90dba6965996e5a5224e", "score": "0.6941096", "text": "function createButton(text, action, show, active) {\n var button = document.createElement(\"a\");\n\n //fix: Mozilla show text, Chrome - innerText \n button.innerText = button.text = text;\n\n button.onclick = action;\n\n //style\n button.style.cursor = \"pointer\";\n button.style.display = \"block\";\n\n if (show !== undefined && !show)\n button.style.display = \"none\";\n\n if (active !== undefined && active)\n button.className = \"active\";\n\n return button;\n }", "title": "" }, { "docid": "8a5f56ef2b4f041eae1107e78fdbbac2", "score": "0.6940006", "text": "function makeButtons(objects, nameField, countField, type, name, onchange, title, destination, special) {\n var string,\n count,\n id,\n name;\n if (title == \"Guide-hint-received\") {\n title = \"<span style=\\\"color:red\\\">\" + title + \"</span>\";\n }\n if (title == \"Guide-remediation-requested\") {\n title = \"<span style=\\\"color:blue\\\">\" + title + \"</span>\";\n }\n if (objects.length == 0) {\n destination.innerHTML = \"\";\n } else {\n destination.innerHTML = \"<b>\" + title + \"</b><br>\";\n }\n for (var i = 0; i < objects.length; i++) {\n if (((objects[i][\"hintReceived\"]) && (!objects[i][\"remediationRequested\"])) || (objects[i].name == \"Guide-hint-received\")) {\n string = \"<span style=\\\"color:red\\\">\" + objects[i][nameField] + \"</span>\";\n } else if (((!objects[i][\"hintReceived\"]) && (objects[i][\"remediationRequested\"])) || (objects[i].name == \"Guide-remediation-requested\")) {\n string = \"<span style=\\\"color:blue\\\">\" + objects[i][nameField] + \"</span>\";\n } else if ((objects[i][\"hintReceived\"]) && (objects[i][\"remediationRequested\"])) {\n string = \"<span style=\\\"color:#990099\\\">\" + objects[i][nameField] + \"</span>\";\n } else {\n string = objects[i][nameField];\n }\n count = objects[i][countField].length;\n id = objects[i][nameField];\n destination.innerHTML += \"<input type=\" + type + \" id= \" + id + \" name=\" + name + \" onchange=\" + onchange + \"></input> \" + string + \" (\" + count + \")<br>\";\n }\n}", "title": "" }, { "docid": "711fee0794dab61d9bbea1f175c1e1be", "score": "0.6937857", "text": "function createButtons() {\n $(\"#buttons-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var movieButton = $(\"<button>\");\n movieButton.addClass(\"movie btn btn-warning m-2 p-2\");\n movieButton.attr(\"data-name\", topics[i]);\n movieButton.text(topics[i]);\n $(\"#buttons-view\").append(movieButton);\n }\n}", "title": "" }, { "docid": "c7618ed1fb15ef666630de5c663b7842", "score": "0.6934598", "text": "function renderButtons() {\n // Deleting the animal buttons prior to adding new animal buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#makeButtons\").empty();\n // Looping through the array of movies\n for (var i = 0; i < animalArray.length; i++) {\n // Then dynamicaly generating buttons for each animal in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"animal btn btn-success button\");\n // Adding a data-attribute with a value of the animal at index i\n a.attr(\"data-name\", animalArray[i]);\n // Providing the button's text with a value of the animal at index i\n a.text(animalArray[i]);\n // Adding the button to the HTML\n $(\"#makeButtons\").append(a);\n }\n }", "title": "" }, { "docid": "52dacc1a55390a5784fb582ab0c13b60", "score": "0.69341123", "text": "function BulbsHTMLButtonElement () {}", "title": "" }, { "docid": "cdbc0a4bb4754bea797dda2160f6d346", "score": "0.6932195", "text": "function setupButton(options) {\n let button = createButton();\n button.class(\"btn btn-primary mx-1\");\n button.html(\"<i class='\" + options.icon + \"'></i>\");\n button.parent(\"#control-panel\");\n button.mousePressed(options.action);\n return button;\n}", "title": "" }, { "docid": "8c288e25a8f082b2d8fa4e1dece2be1c", "score": "0.6931216", "text": "function createButton(text)\n{\n var button = document.createElement('button');\n var buttonText = document.createTextNode(text);\n button.appendChild(buttonText);\n return button;\n}", "title": "" }, { "docid": "3b6337b147fa39a145848333a7993198", "score": "0.6923467", "text": "function commandButtons()\n{\n\t\n\tbtnArray = new Array(\n\t\tMM.BTN_OK, \"clickedOK()\", \n MM.BTN_Cancel, \"clickedCancel()\", \n MM.BTN_Test, \"clickedTest()\");\n\tvar sm = dw.getDocumentDOM().serverModel.getServerName();\n\t// add a button for each different rs type\n\tfor (i = 0;i < MM.rsTypes.length;i++) \t{\n\t\tif(MM.rsTypes[i].single == \"true\") {\n\t\t\tcontinue;\n\t\t}\n\t\tif (sm == MM.rsTypes[i].serverModel) \t{\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}", "title": "" }, { "docid": "71474aa277f5853e8c1df530e89bb9af", "score": "0.6919934", "text": "function makeButtons() {\n $(\"#button-box \").empty();\n for (var i = 0; i < gifOptions.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"animals\").attr(\"data-name\", gifOptions[i]);\n a.addClass(\"btn btn-secondary\");\n a.text(gifOptions[i]);\n $(\"#button-box\").append(a);\n }\n\n }", "title": "" }, { "docid": "daa74a76c447da9ae2ddaebc4842ded9", "score": "0.6910287", "text": "function renderButtons() {\n $(\".button-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"auto-btn\");\n a.attr(\"dumb-name\", topics[i]);\n a.text(topics[i]);\n $(\".button-view\").append(a);\n $(\"#lookup-value\").empty();\n }\n}", "title": "" }, { "docid": "6462a27c64b1121ebf1432924421f375", "score": "0.69069207", "text": "function displayButtons() {\n // clear the buttons area\n $(\"#buttons-area\").empty();\n // iterate through the list of tags\n for (var i=0; i<tagLibrary.length; i++) {\n // make a new button element\n var newButton = $(\"<button>\");\n // add the classes to that button, padding to size it and margins to space them\n newButton.addClass(\"btn btn-primary text-light search-tag p-1 pr-2 pl-2 mr-3 mb-3 \");\n // do I even need this?\n newButton.attr(\"type\", \"button\");\n // set the text to be the current tag we've iterated to\n newButton.text(tagLibrary[i]);\n // put a data-name value here equal to the name for later api queries\n newButton.data(\"name\", tagLibrary[i]);\n // add the new button to the front of the buttons area\n $(\"#buttons-area\").prepend(newButton);\n }\n}", "title": "" }, { "docid": "580ca3139c758314f9a219fb0eb8ed8c", "score": "0.69039184", "text": "function makeBtn() {\n // Emptying the DOM for buttons to not reload the same buttons from array\n $('#buttons').empty();\n\n // Looping to make buttons for each item in the array\n for (var i = 0; i < topics.length; i++) {\n var initialBtn = $('<button>', {id:'gif-button', class:'btn btn-secondary', type:'button'});\n initialBtn.attr('button-name', topics[i]);\n initialBtn.text(topics[i]);\n $('#buttons').append(initialBtn); \n }\n}", "title": "" }, { "docid": "dba682491c87a66f4c3d8385b6c9405d", "score": "0.6901017", "text": "function drawButton(){\n var divBtn = $('<div>', {\n 'class' : 'button-plus-minus',\n 'style' : 'position:absolute; bottom: -45px;',\n })\n\n var buttonMin = $('<button>',{\n 'id' : 'delete-body',\n 'type' : 'button',\n 'class' : 'btn btn-default btn-sm m-bottom-sm btn-del-body',\n });\n\n var iconMinus = $('<i>',{\n 'class' : 'fa fa-minus fa-lg',\n 'style' : 'color: #D81E36;',\n });\n\n var buttonPlus = $('<button>',{\n 'id' : 'add-body',\n 'style' : 'margin-right:3px;',\n 'type' : 'button',\n 'class' : 'btn btn-default btn-sm m-bottom-sm btn-add-body',\n });\n\n var iconPlus = $('<i>',{\n 'class' : 'fa fa-plus fa-lg',\n 'style' : 'color: #3DD091;',\n });\n\n var iconMin = buttonMin.append(iconMinus);\n buttonMin.append(\"&nbsp;\");\n buttonMin.append('Delete Page');\n var iconPls = buttonPlus.append(iconPlus);\n buttonPlus.append(\"&nbsp;\");\n buttonPlus.append('Add Page');\n divBtn.append(iconPls)\n divBtn.append(iconMin)\n\n return divBtn;\n}", "title": "" }, { "docid": "5f3d5765bcbd94c5732278d181bbba5a", "score": "0.6899035", "text": "function createButton(number, top, left) {\n var btn = ui.grayButton(number,{\n top:top,\n left:left,\n height:60,\n width:60\n });\n\n btn.addEventListener('click', function(e) {\n buttonPressed(number);\n });\n\n keypad.add(btn);\n }", "title": "" }, { "docid": "c29024f70f057dfd49311385bfe10f77", "score": "0.6892931", "text": "function makeButtons(responses) {\n\t\t\tconsole.log('making buttons');\n\t\t\tfor (var i = 0; i<responses.length; i++) {\n\t\t\t\tvar rlabel = new createjs.Text(responses[i].name, \"bold 12px Arial\", \"black\");\n\t\t\t\trlabel.name = responses[i].id;\n\t\t\t\trlabel.textAlign = \"center\";\n\t\t\t\trlabel.textBaseline = \"middle\";\n\t\t\t\trlabel.lineWidth = 120;\n\t\t\t\trlabel.x = 60 ;\n\t\t\t\trlabel.y = 35/2;\n\n\t\t\t\tvar rbackground = new createjs.Shape();\n\t\t\t\trbackground.name = responses[i].id;\n\t\t\t\trbackground.graphics.beginFill(\"#00F5FF\").drawRoundRect(0, 0, 120, 35, 5);\n\n\t\t\t\tresponseButtons.push(new createjs.Container());\n\t\t\t\tresponseButtons[i].name = responses[i].id;\n\t\t\t\tresponseButtons[i].addChild(rbackground, rlabel);\n\t\t\t\tresponseButtons[i].x = header.x+(i % 4) * ((300 / 4) + 50);\n\t\t\t\tresponseButtons[i].y = button.y + Math.floor(i / 4) * 50;\n\t\t\t\tresponseButtons[i].addEventListener(\"click\", voteClick);\n\t\t\t\tstage.addChild(responseButtons[i]);\n\t\t\t\tconsole.log('Add button');\n\t\t\t}\n\t\t\tstage.update();\n\t\t}", "title": "" }, { "docid": "fde225357f2015fbd0f042b7666db8c6", "score": "0.6890121", "text": "function createDirectionButtons(){\n var buttonDiv = document.createElement(\"div\");\n var buttonNames = [\"up\", \"down\", \"left\", \"right\"];\n for (name in buttonNames){\n button = document.createElement(\"button\");\n button.textContent = buttonNames[name];\n button.addEventListener(\"click\", moveSelection);\n button.setAttribute(\"id\", \"direction\");\n buttonDiv.appendChild(button);\n }\n return buttonDiv;\n}", "title": "" }, { "docid": "d6e1f8ca95bed00b33c888bd5648e702", "score": "0.68859816", "text": "function createButtons() {\n $(\"#buttonsDiv\").empty();\n\n for (i=0; i < rappers.length; i++) {\n var btn = $(\"<button>\");\n btn.addClass(\"person\");\n btn.attr(\"data-name\", rappers[i]);\n btn.text(rappers[i]);\n $(\"#buttonsDiv\").append(btn);\n }\n\n }", "title": "" }, { "docid": "434c679192cb55917293074b0667efb1", "score": "0.6885448", "text": "function createButtons(create) {\n answerChoices.innerHTML = \"\";\n for (var i = 0; i < create.length; i++) {\n var btn = document.createElement(\"button\");\n var x = document.createTextNode(create[i]);\n btn.appendChild(x);\n btn.value = create[i];\n btn.onclick = checkAnswer;\n answerChoices.appendChild(btn);\n }\n}", "title": "" }, { "docid": "19ab312f086c08d0e18c472c1e2bdce8", "score": "0.6883687", "text": "function renderButtons() {\n // clear the button-area div so that the buttons aren't duplicated every time the user adds a new button\n $(\"#button-area\").empty();\n\n // make a for loop that goes through the buttons array and displays the default search buttons\n for (i = 0; i < buttons.length; i++) {\n var a = $(\"<button>\");\n // add a class to each button\n a.addClass(\"button\");\n // add a data attribute with the name of the current movie in the array\n a.attr(\"data-name\", buttons[i]);\n // add a text attribute that will be displayed on the button\n a.text(buttons[i]);\n // add the button to the button sidebar\n $(\"#button-area\").append(a);\n // $(\"#button-area\").append(\"<br>\");\n\n }\n }", "title": "" }, { "docid": "6a62d91214ff614511c414d1d3819e98", "score": "0.68828225", "text": "function renderButtons() {\n // Deleting original button render to re-render\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly 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\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\n \"testClass btn btn-dark bg-info btn-outline-dark btn m-3\"\n );\n //Adding ID\n //a.attr(\"id\", \"topic-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "0a362d3b2728a46156c87be02c116c7b", "score": "0.6874986", "text": "function renderButtons() {\n\n // clear #buttons-view\n $(\"#button-display\").empty();\n\n // iterate through our movie array and create an HTML button for each one\n for (i = 0; i < topics.length; i++) {\n\n var $gifBtn = $(\"<button>\");\n // $movieBtn => <button></button>\n\n $gifBtn\n .addClass(\"category-button m-3 btn btn-light btn-outline-dark\")\n .text(topics[i])\n .attr(\"data-category\", topics[i]);\n // $movieBtn => <button data-name=\"Mr. Nobody\">Mr. Nobody</button>\n\n $(\"#button-display\").append($gifBtn);\n };\n }", "title": "" }, { "docid": "d3855e94e0fc17a53fb34d33edeef7f1", "score": "0.68749297", "text": "function makeButton(name, bn, fn){\n\t\t\t\tvar bl = document.getElementById('buttonlist');\n\t\t\t\tvar element = document.createElement('input');\n\t\t\t\telement.setAttribute('type', 'button');\n\t\t\t\telement.setAttribute('value', name);\n\t\t\t\telement.setAttribute('id', bn);\n\t\t\t\telement.setAttribute('class', 'button');\n\t\t\t\telement.setAttribute('onclick', 'makeVideoList('+\"'\"+fn+\"'\"+');');\n\t\t\t\tbl.appendChild(element);\n\t\t}", "title": "" }, { "docid": "6f30d202bee5cc4967fe25d5979118ce", "score": "0.68715173", "text": "function createButtons(btnName) {\n var btn = $('<button>');\n btn.attr('class', 'btnCatagories')\n btn.text(btnName);\n $(\"#buttons\").append(btn);\n}", "title": "" }, { "docid": "9b5f4c32dee66ff015621cdd9ca07c88", "score": "0.6871063", "text": "function renderButtons() {\n\n// as learned before, they are ALL recreated each time, or we'd have lots of duplicate buttons.\n $(\"#buttons-view\").empty();\n\n for (i=0; i<topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topic\");\n a.attr(\"data-gif\", topics[i]);\n a.text(topics[i]);\n $(\"#buttons-view\").append(a);\n // console.log(\"going through the array\" + a); \n }\n }", "title": "" }, { "docid": "36db7c70f9ad6122ea623e245a6877e2", "score": "0.6862669", "text": "function buttonRender() {\n // empty previous array \n $(\"#buttons\").empty();\n // loop through the gif name array\n for (var i = 0; i < gifNames.length; i++) {\n // button definition and structure\n buttons = $(\"<button>\");\n buttons.addClass(\"btn btn-outline-info gifSearch\");\n buttons.attr('data-type', gifNames[i]);\n buttons.text(gifNames[i]);\n // add buttons to the button array \n $(\"#buttons\").append(buttons);\n // space between buttons\n $(\"#buttons\").append(\" \");\n }\n}", "title": "" }, { "docid": "44c60d5ea542e42ee1de7da57123abb3", "score": "0.68596077", "text": "function createButton(attributes, el) {\n let btn = document.createElement(\"button\");\n\n btn.type = attributes.type;\n btn.className = attributes.class;\n btn.setAttribute(attributes.attr.name, attributes.attr.value);\n\n if (attributes.action === \"update\") {\n // cria um elemento ícone utilizando as classes do fontawesome\n let i = document.createElement(\"i\");\n i.className = \"fas fa-edit\";\n \n btn.appendChild(i);\n }\n\n \n if (attributes.action === \"delete\") {\n // cria um elemento ícone utilizando as classes do fontawesome\n let i = document.createElement(\"i\");\n i.className = \"fas fa-trash-alt\";\n \n btn.appendChild(i);\n }\n\n el.appendChild(btn);\n}", "title": "" }, { "docid": "4e89f701ec9ceece9fc6f0e683b56d6c", "score": "0.6856424", "text": "function createButtons(tName) {\n var b = $('<button>');\n b.attr('class', 'bTopics')\n b.text(tName);\n $(\"#topic-buttons\").append(b);\n}", "title": "" }, { "docid": "2641864b3349b11b6c04ec30eff11cd7", "score": "0.6852798", "text": "function renderButtons() {\n\n\t$(\"#lotrButtons\").empty()\n\n\tfor(var i = 0; i < topics.length; i++){\n\t\tvar b = $(\"<button>\");\n\n\t\tb.addClass(\"character\");\n\n\t\tb.addClass(\"btn-success\");\n\n\t\tb.attr(\"char-name\", topics[i]);\n\n\t\tb.text(topics[i]);\n\n\t\t$(\"#lotrButtons\").append(b).append(\" \");\n\t\t\n\t\t\n\t}\n}", "title": "" }, { "docid": "69d25ce4da50906d86710576be25a9fb", "score": "0.6850612", "text": "function createButtons() {\n\tfor (var j = 0; j < topics.length; j++) {\n\t\tvar button = $(\"<button>\")\n\t\tbutton.html(topics[j])\n\t\tbutton.attr(\"data-name\", topics[j])\n\t\tbutton.addClass(\"btn\")\n\t\t$(\"#buttons\").append(button);\n\t\tconsole.log(button.attr(\"data-name\"))\n\t};\n}", "title": "" }, { "docid": "d0da6e4a57a97d863c767d213b25393f", "score": "0.68492496", "text": "function renderButtons() {\n for (var i = 0; i < topics.length; i++) {\n var movieBtn = $(\"<button>\");\n movieBtn.addClass(\"btn btn-outline-primary\");\n movieBtn.attr(\"movie-name\", topics[i]);\n movieBtn.text(topics[i]);\n $(\"#buttons-display\").append(movieBtn);\n\n }\n}", "title": "" }, { "docid": "4ae29576354603e6b943c175036b5f5b", "score": "0.68413794", "text": "function renderButtons() {\n $(\"#buttons-view\").empty();\n for (var i = 0; i < topics.length; i++) {\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var topicBtn = $(\"<button>\");\n // Adding a class\n topicBtn.addClass(\"topics\");\n // Added a data-attribute\n topicBtn.attr(\"data-topics\", topics[i]);\n // Provided the initial button text\n topicBtn.text(topics[i]);\n // Added the button to the HTML\n $(\"#buttons-view\").append(topicBtn);\n }\n }", "title": "" }, { "docid": "e48813891b43b5361063bbe84325fb51", "score": "0.6840478", "text": "function makeAllButtons(){\n for(const buttonkey in MY_BUTTONS){\n createButton(MY_BUTTONS[buttonkey]);\n }\n }", "title": "" }, { "docid": "40e63e7863f8b832334f64b9f4818c40", "score": "0.68391824", "text": "function createButtons () {\n\n $(\"#buttons-go-here\").empty();\n\n\n for (var i = 0; i < topics.length; i++) {\n\n var newBTN = $(\"<button>\").text(topics[i]);\n newBTN.addClass(\"btn btn-outline-primary m-2 searchInput\")\n newBTN.attr(\"data-name\", topics[i]);\n $(\"#buttons-go-here\").append(newBTN);\n };\n}", "title": "" }, { "docid": "4dafa095fb24bcf4a295bacc3b3a1018", "score": "0.68386596", "text": "function renderButtons() {\n $(\"#buttonRow\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"animalButton\");\n button.attr(\"data-animal\", topics [i]);\n button.text(topics[i]);\n $(\"#buttonRow\").append(button);\n\n $(\".animalButton\").css({\"background-color\":\"#008B8B\",\"border\" : \"1px solid black\",\n \"padding\" : \"10px\",\"font-size\" : \"medium\",\"margin\" : \"0 0 2px 2px\",\"border-radius\" : \"10px\",\"color\" : \"white\"})\n }\n }", "title": "" }, { "docid": "f18e115c6e493479d258caeb6c2a2766", "score": "0.68315953", "text": "_createButton(className, fn) {\n const button = super._createButton(className, fn);\n button.clickFunction = fn;\n return button;\n }", "title": "" }, { "docid": "8205d0c1273365d02ea6c6a747f84e22", "score": "0.68309987", "text": "function buttons() {\n\n \n $(\"#buttons-view\").empty();\n\n \n for (var i = 0; i < topics.length; i++) {\n \n var newButton = $(\"<button>\");\n \n newButton.addClass(\"btn btn-primary\");\n newButton.addClass(\"button\");\n \n newButton.attr(\"data-name\", topics[i]);\n \n newButton.text(topics[i]);\n \n $(\"#buttons-view\").append(newButton);\n }\n }", "title": "" }, { "docid": "e260fc3bb9fa7e2b21e7990c9b692d20", "score": "0.6824728", "text": "function renderButtons() {\n\n\t// Deletes the buttons prior to adding new ones \n\t$(\"#buttons-list\").empty();\n\n\t// Looping through the array of words(topics)\n\tfor (var i = 0; i < topics.length; i++) {\n\n\t\t\t\t\t// Then dynamicaly generating buttons for each word in the array\n\t\t\t\t\t// This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\tvar a = $(\"<button>\");\n\t\t\t\t\t// Adding a class of word to our button\n\t\ta.addClass(\"word\");\n\t\t\t\t\t// Adding a data-attribute\n\t\ta.attr(\"data-name\", topics[i]);\n\t\t\t\t\t// Providing the initial button text\n\t\ta.text(topics[i]);\n\t\t\t\t\t// Adding the button to the buttons-list div\n\t\t$(\"#buttons-list\").append(a);\n\t}\n}", "title": "" }, { "docid": "41c7611a8674c85af1605629ce3c0c4c", "score": "0.68224156", "text": "function renderButtons() {\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var i = 0; i < tvShows.length; i++) {\n // Then dynamicaly generating buttons for each movie 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 tv show to our button\n a.addClass(\"tv\");\n // Adding a data-attribute\n a.attr(\"data-name\", tvShows[i]);\n\n // Providing the initial button text\n a.text(tvShows[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "title": "" }, { "docid": "5565b3bebb0459c57baa3e8dafc5bdee", "score": "0.68156016", "text": "function createButtons(){\n $(\"#actor-buttons\").empty();\n\n for (var i = 0; i < actors.length; i++) {\n var b = $(\"<button>\");\n b.addClass(\"actor\");\n b.attr(\"data-name\", actors[i]);\n b.text(actors[i]);\n $(\"#actor-buttons\").append(b);\n \n }\n }", "title": "" }, { "docid": "0b75a6c2b9c52ace199fc3ab3a05a0e9", "score": "0.6815572", "text": "function createButton(str) {\r\n // ---------- Your Code Here ----------\r\n var buttonDiv = $(\"<div>\");\r\n var newButton = $(\"<button>\");\r\n newButton.attr(\"class\", \"word-buttons\");\r\n newButton.attr(\"data-value\", str);\r\n newButton.text(str);\r\n console.log(newButton);\r\n buttonDiv.append(newButton);\r\n $(\"#button-area\").append(buttonDiv);\r\n\r\n\r\n\r\n\r\n\r\n // ---------- End of Code area ----------\r\n}", "title": "" }, { "docid": "7d9f18347128b4465d5bbd3775698b89", "score": "0.6815216", "text": "function createButton(cmd, value) {\r\n\t\tvar button = new Object();\r\n\t\tbutton = document.createElement('button');\r\n\t\tbutton.setAttribute('onclick', cmd);\r\n\r\n\t\tvar label = document.createTextNode(value);\r\n\t\tbutton.appendChild(label);\r\n\r\n\t\treturn button;\r\n\t}", "title": "" }, { "docid": "7d9f18347128b4465d5bbd3775698b89", "score": "0.6815216", "text": "function createButton(cmd, value) {\r\n\t\tvar button = new Object();\r\n\t\tbutton = document.createElement('button');\r\n\t\tbutton.setAttribute('onclick', cmd);\r\n\r\n\t\tvar label = document.createTextNode(value);\r\n\t\tbutton.appendChild(label);\r\n\r\n\t\treturn button;\r\n\t}", "title": "" }, { "docid": "c0d86aad74e9e248123b598c564e0776", "score": "0.68147326", "text": "function createButton(){\n \n $(\"#display-buttons\").empty();\n \n for(var i = 0; i < topics.length; i++) {\n \n var buttonName = $(\"<button>\");\n \n buttonName.addClass(\"show\");\n \n buttonName.attr(\"show-name\", topics[i]); \n \n buttonName.text(topics[i]);\n \n $(\"#display-buttons\").append(buttonName);\n };\n}", "title": "" }, { "docid": "800e8936604fc172b1450b6aff5379b8", "score": "0.6809108", "text": "function CreateBtn(){\n queryurl=\"\";\n $('.buttons').empty();\n $('.btns').empty();\n \n for(i=0;i<Topics.length;i++)\n {\n var Btn = $(\"<button>\");\n Btn.attr(\"id\",\"Btn-\"+i);\n Btn.addClass('btns');\n Btn.addClass(\"btn btn-primary\");\n Btn.text(Topics[i]);\n $('.buttons').append(Btn);\n \n\n }\n \n \n}", "title": "" }, { "docid": "f18610d1e191397e2a045b95d2fb6647", "score": "0.6806405", "text": "function createButtons() {\n $(\"#button-area\").empty();\n for (let i = 0; i < topics.length; i++) {\n const a = $(\"<button>\");\n a.text(topics[i]);\n a.attr(\"data-name\", topics[i]);\n a.addClass(\"topicButton\");\n $(\"#button-area\").append(a);\n }\n}", "title": "" }, { "docid": "60c92511d1e511d8cb44f3ca38f5cd6d", "score": "0.67987436", "text": "_makeButtons() {\n this.$buttonsMap = {};\n this.$buttonsList = this.buttons.map(buttonInfo => {\n const $button = $('<input type=\"button\" />')\n .val(buttonInfo.label)\n .attr('id', buttonInfo.id);\n\n if (buttonInfo.class) {\n $button.addClass(buttonInfo.class);\n }\n\n if (buttonInfo.disabled) {\n $button.attr('disabled', true);\n }\n\n if (buttonInfo.primary) {\n $button.addClass('primary');\n this._$primaryButton = $button;\n }\n\n if (buttonInfo.danger) {\n $button.addClass('danger');\n }\n\n if (buttonInfo.onClick) {\n if (_.isFunction(buttonInfo.onClick)) {\n $button.click(buttonInfo.onClick);\n } else {\n $button.click(this[buttonInfo.onClick].bind(this));\n }\n }\n\n this.$buttonsMap[buttonInfo.id] = $button;\n\n return $button;\n });\n }", "title": "" }, { "docid": "94bd65bb14cac557eec61d770a56e782", "score": "0.6797782", "text": "function buttonGenerator() {\n $(\".buttons-div\").empty();\n animalList.forEach(function (animal) {\n var newButtons = $(\"<button type='button' class='btn btn-outline-info mr-2 animalButton'>\");\n newButtons.attr(\"value\", animal);\n newButtons.text(animal);\n $(\".buttons-div\").append(newButtons);\n\n })\n }", "title": "" }, { "docid": "a09dd615ce55c159681789e63cf23833", "score": "0.67975116", "text": "function renderButtons() {\n $(\"#buttons\").empty();\n\n // loop thru array of topics and make buttons\n for (var i=0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topic\");\n a.attr(\"data-name\", topics[i]);\n a.text(movies[i]);\n $(\"#buttons\").append(a);\n }\n }", "title": "" }, { "docid": "8500cdb9d0135f270ac033ebe4003712", "score": "0.67964804", "text": "static createTestButton(buttonText, command, bool){\n var button = Overview.createButton(buttonText);\n button.id = command;\n button.onclick = function () {\n Elements.sendTestMessage(command, bool);\n };\n\n return button;\n }", "title": "" }, { "docid": "060010d6b486fff3cd95c3c7b2c11c3d", "score": "0.6794119", "text": "static createInLayoutCallArgumentUnderWidgets(container) {\n internal.createInVersionCheck(container.model, ActionButton.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, ActionButton, \"widgets\", true);\n }", "title": "" }, { "docid": "5f56dd629713fd29b9e1b593f1328ed4", "score": "0.67881835", "text": "function makeBtns() {\n\n // Deleting existing buttons to avoid duplicates\n $(\".button-holder\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Dynamicaly generating buttons for each character in the array using JQuery\n var name = $(\"<button>\");\n // Adding a class\n name.addClass(\"btn btn-primary\");\n // Adding a data-attribute with a value of the array at index i\n name.attr('character-name', topics[i]);\n // Providing the button's text with a value of the array at index i\n name.text(topics[i]);\n // Adding the button to the HTML\n $(\".button-holder\").append(name);\n }\n }", "title": "" }, { "docid": "d66d9afd5570cf80544ac9f17047d5c9", "score": "0.6787939", "text": "function generateButtons() {\n // first, remove old buttons\n let removeBtns = $('.removable');\n removeBtns.remove()\n\n // Then, create new buttons\n for(i=0; i < searches.length; i++) {\n let li = document.createElement('li');\n // let btn = document.createElement('button');\n li.setAttribute('class', 'col-8 btn btn-light removable border border-primary');\n li.innerText = searches[i];\n searchListEl.append(li); \n }\n}", "title": "" }, { "docid": "325abd71f2d7a7c3ab7041e1da0002a0", "score": "0.67877096", "text": "function renderButtons(){\n //Empty Previous Set of Buttons\n $(\"#btnSpace\").empty();\n\n //Loop Through the Topics Array and Make Button for Each, With Class Needed to Style Them and Attributes to Display Search Results\n for(var j=0;j<topics.length;j++){\n $(\"#btnSpace\").append(\"<button class='btn btn-outline-success topic' data-name='\"+topics[j]+\"'>\"+topics[j]+\"</button>\")\n }\n }", "title": "" } ]
18d011f627c4e29066b506838a092f66
About method: get products data from server
[ { "docid": "5574a886510a93b8ff38d5dfa47b7cd3", "score": "0.67674726", "text": "getProducts(id) {\n const context = this;\n\n // Note: use axios, for HTTP request, get\n axios\n // Note: added port number '3004' to server url, for integration\n // .get(`http://localhost:3004/${id}/api/products`)\n .get(`/${id}/api/products`) // ES6's template literal\n .then(function(response) {\n // console.log(JSON.stringify(response)); // For debugging\n context.setState({\n // product: response.data[0], // Product's 'Option 1' row\n productName: response.data[0].product_name,\n category: response.data[0].category,\n expirationTime: response.data[0].expiration_time,\n\n option1Price: response.data[0].product_price,\n option1Warranty: response.data[0].warranty_cost,\n option2Price: response.data[1].product_price,\n option2Warranty: response.data[1].warranty_cost\n });\n })\n .catch(function(error) {\n console.log(error);\n });\n }", "title": "" } ]
[ { "docid": "01b39d49d2e5ca0d71d90aa5299d03d0", "score": "0.8262249", "text": "function getProducts() {\n return productsData\n}", "title": "" }, { "docid": "a57d6a87a1993d31d38a20c8154fbc2d", "score": "0.78364784", "text": "getProducts(){\n this.apiCall(\"/api/products\", this.showProducts);\n }", "title": "" }, { "docid": "69b3a73a5ffe31abdb5f563941c1c194", "score": "0.7819199", "text": "function getProducts(){\n return get('data/products.json');\n}", "title": "" }, { "docid": "05dd39eac2ef21572cb89f605eb20a1b", "score": "0.78173304", "text": "function GetProducts() {\n\treturn Getproduct(\"/products\", \"GET\");\n}", "title": "" }, { "docid": "2fbe67f6a9150fff9641876a4aa799cf", "score": "0.7815436", "text": "function getProducts() {\n return fetch(`${LOCAL_URL}/products`)\n .then((res) => res.json())\n .then((res) => res.data)\n .catch((error) => console.log(error));\n}", "title": "" }, { "docid": "dfbc8896503c1b5c4ddef07e3b8d5ab1", "score": "0.77878535", "text": "function getProducts() {\n $.get(\"/api/products\", function (data) {\n products = data;\n initilizeRows();\n });\n }", "title": "" }, { "docid": "cca97b09669b4cc81f5271700de1f707", "score": "0.77256685", "text": "getProducts() {\n return this.httpClient.get(this.baseUrl);\n }", "title": "" }, { "docid": "770f1ed87d2e7f00e6a2cf215860aab7", "score": "0.7689338", "text": "function getProducts() {\n $.get(\"/api/14products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "ae391e24e131e4a832c6b71b8b92a491", "score": "0.76737493", "text": "function getProducts() {\n $.get(\"/api/4products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "e1f2cfd7f2a0c677f8f9a4ade3a98e33", "score": "0.7656793", "text": "async getAllProducts() {\n try {\n const response = await fetch(this.uri);\n const products = await response.json();\n console.log(products);\n return products;\n } catch (e) {\n return products;\n }\n }", "title": "" }, { "docid": "37aeb40d2a1894a6c209e1ef392cf9a4", "score": "0.763993", "text": "function getProducts() {\n $.get( \"http://localhost:3000/products\", function( res ) {\n for (eachProduct in res.data) {\n showProduct(res.data[eachProduct]);\n }\n });\n}", "title": "" }, { "docid": "52c2a68e0e62cac63c941bf0644de9a8", "score": "0.762958", "text": "function getProducts() {\n $.get(\"/api/9products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "ff8538a12680c333e397c5471f419900", "score": "0.7581175", "text": "getProductData(e) {\n return instance.get('/api/item/' + e)\n }", "title": "" }, { "docid": "99857e928b094be427dc39a0d9ab780b", "score": "0.7566321", "text": "function getProducts() {\r\n $.get(\"/api/products\", renderProductList);\r\n }", "title": "" }, { "docid": "22e0905e660c13ea4000dc9c336881fb", "score": "0.75554484", "text": "function getProducts(){\n $.ajax(baseUrl, {\n type: 'GET',\n success: function(data) {\n for (index in data.products) {\n var product = data.products[index];\n productCard(product);\n }\n }\n\n });\n }", "title": "" }, { "docid": "8e6c2426c5f4103828bc973162fc687e", "score": "0.75292176", "text": "function getProducts() {\n $.get(\"/api/5products\", function(products) {\n initializeRows(products);\n });\n }", "title": "" }, { "docid": "2019480e04cb73e4475e4558342a9573", "score": "0.7439714", "text": "async getAllProducts() {\r\n const url = API_URL + \"products\";\r\n return axios.get(url);\r\n }", "title": "" }, { "docid": "90702e32369c352ca2886fe83f3bdd25", "score": "0.74170667", "text": "function productdata(){\n fetch(`http://localhost:3000/api/teddies/${code}`)\n .then(function(res){\n if(res.ok){\n return res.json()\n }\n })\n .then(function(items){\n product(items);\n })\n .catch(function(err){\n console.log(err);\n }) \n}", "title": "" }, { "docid": "89c263cede2c7aca0da6dfe0b76a9156", "score": "0.7384824", "text": "function fetchProducts() {\n $.get(BASE_URL + '/sellers/products_partial', function (res) {\n $('#products').html(res);\n console.log(res);\n });\n }", "title": "" }, { "docid": "f59fc15590a1b25188b73bbfa0db0e30", "score": "0.73658776", "text": "function getAll() {\n return Restangular.all('product').getList().then((data) =>{\n products=data;\n return data;\n }, function(err) {\n toaster.pop('error', 'Api error.', 'error connect to api to fetching product.');\n });\n }", "title": "" }, { "docid": "25236babe171c4bae709e7ef1b5cc016", "score": "0.7323228", "text": "async product(_, args) {\n try {\n const products = await getAllData(\"product\")\n return products;\n } catch (error) {\n throw new ApolloError(error)\n }\n }", "title": "" }, { "docid": "4c47d509e0483d9d8928e7bddda99607", "score": "0.73179835", "text": "function getAllProducts () {\n return axios.get('/products').then(response => response.data)\n}", "title": "" }, { "docid": "abbc0009a7ac53167eb5eca9731e3121", "score": "0.7290357", "text": "async function getProductData(page) {}", "title": "" }, { "docid": "f6f6fb220c964bc2de406f3f03e95b4b", "score": "0.7276154", "text": "async function getproducts() {\n const url = \"http://localhost:8000/api/products\";\n let response = await fetch(url, { method: \"GET\" });\n let object = await response.json();\n\n return object;\n}", "title": "" }, { "docid": "dce3a19b8dba62ec35270e0f9f864517", "score": "0.72352344", "text": "function loadProductsFull() {\n return $.ajax({\n type: \"GET\",\n url: \"/Admin/Product/GetAll\",\n success: function (response) {\n cachedObjFull.products = response;\n },\n error: function () {\n onlineshop.notify('Has an error in getting available product progress', 'error');\n }\n });\n }", "title": "" }, { "docid": "26f35bf9962ac2463d32ba6a7ac97480", "score": "0.7231005", "text": "function fetchAllProduct(){\n \n client.product.fetchAll().then((products) => {\n // Do something with the products\n console.log(products.it);\n }); \n}", "title": "" }, { "docid": "50f78962d4f9b75434715030dd10f320", "score": "0.7223715", "text": "function fetchProducts(param){\n $(\".product-container\").children().remove();\n $(\"<div class='lds-roller' style='display:block;'><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>\")\n .appendTo(\".product-container\");\n $.get('fetchproducts', param)\n .done(function(data){\n $(\".product-container .lds-roller\").remove();\n if(data.products != null && data.products != undefined)\n addProductElement(data.products);\n if(data.promotes != null && data.promotes != undefined)\n {\n addPromoteElement(data.promotes);\n addRandomProductElement(data.products);\n }\n })\n .fail(function(err){\n });\n }", "title": "" }, { "docid": "23de2daca1a635d167abb791a7980885", "score": "0.7206309", "text": "async function getAllProducts() {\n var res = await repo.retrieve('products', ['id', 'title', 'author', 'image_path', 'price']);\n return res;\n}", "title": "" }, { "docid": "23de2daca1a635d167abb791a7980885", "score": "0.7206309", "text": "async function getAllProducts() {\n var res = await repo.retrieve('products', ['id', 'title', 'author', 'image_path', 'price']);\n return res;\n}", "title": "" }, { "docid": "73374bfd98ee01f3fc59489924d0d04f", "score": "0.72053885", "text": "function loadProducts() {\n var dateStart = $('#date-start').val();\n return $.ajax({\n type: \"GET\",\n url: \"/Admin/Product/GetAvailableProductForPromotion\",\n data: {\n dateStart: dateStart\n },\n success: function (response) {\n cachedObj.products = response;\n console.log(cachedObj)\n },\n error: function () {\n onlineshop.notify('Has an error in getting available product progress', 'error');\n }\n });\n }", "title": "" }, { "docid": "31aa083089e9631956768e5294dc969c", "score": "0.718584", "text": "function getAllProducts() {\n 'use strict';\n user.product().read({\n }).then(function (products) {\n console.log(products);\n $('#results').append('<h2>All Products</h2>' + JSON.stringify(products, null, 4));\n });\n }", "title": "" }, { "docid": "7faec649a8b34e4a818e8c2197dee2c6", "score": "0.71632093", "text": "fetchProducts() {\n ProductsServices.All()\n .then(respBody => {\n this.setState({\n products: respBody.contents\n })\n });\n }", "title": "" }, { "docid": "43a51af875d7cd53f58d94698910a917", "score": "0.71592355", "text": "function productList() {\n _productData.default.getProducts().then(productObject => {\n (0, _product.default)(productObject);\n });\n}", "title": "" }, { "docid": "d076be54697aec47747dc7a0d83a73c1", "score": "0.71471065", "text": "function getProductList() {\n var sqlQuery = 'SELECT * FROM products';\n connection.query(sqlQuery, function(error, data) {\n if (error) throw error;\n queryCustomer(data);\n })\n}", "title": "" }, { "docid": "f8b41b2bd4b30d674dee8df65618d42d", "score": "0.7146321", "text": "function loadProducts (){\n connection.query('SELECT * FROM products', function (error, response) {\n for (var i = 0; i < response.length; i++){\n console.log(response[i].item_id + \" | \" + response[i].product_name + \" | \" + response[i].price + \" | \" + response[i].stock_quantity);\n // console.log(response);\n }\n promtCustomerForItem()\n }\n )}", "title": "" }, { "docid": "7d05eb4067ec3c7629fbda6cbd18bd4c", "score": "0.7136014", "text": "function getProductsdata(){\n let data=localStorage.getItem('product');\n let productData=JSON.parse(data);\n if(productData!==null){\n Product.allProducts=productData;\n }\n renderThreeImages();\n}", "title": "" }, { "docid": "1a098428af2a0fca0fafcab06f688390", "score": "0.7133551", "text": "function products(root, args, context) {\n const backendURL = context.backendURL\n const foxxMountPoint = context.foxxServMountPoints.generic\n const endPoint = `${context.foxxServGenericEndPoints.CollectionGet}/${collectionName}`\n return genericHelper.fetchQuery(backendURL,foxxMountPoint,endPoint,productsAfterGetHandler, args)\n //return fetch(genericHelper.buildURL(backendURL,foxxMountPoint,endPoint)).then(res => res.json())\n //// return fetch(`${backendURL}/${foxxMountPoint}/genericCollectionGet/${collectionName}`).then(res => res.json())\n}", "title": "" }, { "docid": "fc3002389936eca6b121710e9ec838e0", "score": "0.7105612", "text": "getProducts() {\n return fetch(`${this.baseUrl}/products`) \n .then(resp => resp.json())\n}", "title": "" }, { "docid": "cf68970735578431951ab53b3f2e8d9b", "score": "0.7104187", "text": "async function fetchProducts() {\n const url = `https://api.mediehuset.net/stringsonline/products/` + urlId;\n let data = await props.doFetch(url);\n setProducts(data);\n }", "title": "" }, { "docid": "dd8204f5d5f4728704b5b4bd9c7c1435", "score": "0.7094403", "text": "getProducts() {\n let self = this;\n axios.get(BestPriceFinder.CONFIG.API_SERVER + '/product/')\n .then(function (response) {\n self.setState({ products: response.data });\n })\n .catch(function (error) {\n self.setState({error: \"Unable to retrieve products!\"})\n });\n }", "title": "" }, { "docid": "0756e1d2afa5300128dba0587dbc804f", "score": "0.70759505", "text": "function getProducts (req, res) {\n const userId = req.user.id\n db.getProductByUserId(userId)\n .then(products => {\n res.status(200).json({\n ok: true,\n message: 'Products have been retrieved.',\n products\n })\n })\n .catch(({message}) => {\n res.status(500).json({\n ok: false,\n message: message\n })\n })\n}", "title": "" }, { "docid": "cf3195d973e0caad0456dfaea3b60fdf", "score": "0.7066115", "text": "function listProductos() {\n $.get('/FarmSystem/Adm/AlmInven/store').done(function (data) { \n listProductos1(data);\n }).fail(function () {\n alertify.error(\"ERROR SERVER INVENTARIO STOCK\");\n });\n}", "title": "" }, { "docid": "156b2e541fc2810966a1647dffc049e4", "score": "0.7064821", "text": "function loadData() {\n \n http.getProducts().then(data => {\n setProducts(data);\n }, err => {\n \n }); \n }", "title": "" }, { "docid": "9fce20f54722030c79a86f9bfd100633", "score": "0.70385116", "text": "function getData() {\n var storageAllProducts = localStorage.getItem('data');\n var parsedAllProducts = JSON.parse(storageAllProducts);\n\n for (var h = 0; h < parsedAllProducts.length; h++) {\n var createdProduct = new Product(parsedAllProducts[h].name);\n\n createdProduct.votes = parsedAllProducts[h].votes;\n createdProduct.views = parsedAllProducts[h].views;\n }\n}", "title": "" }, { "docid": "e08a5829bf9b1c7414a37975d1343d8c", "score": "0.7035805", "text": "async getProducts(amt = 62) {\n let products = [];\n\n // Get the list of product IDs.\n let productIDs = await fetch('https://hallam.sci-toolset.com/discover/api/v1/products/search', {\n method: 'POST',\n body: `{\"size\":${amt}, \"keywords\":\"\"}`,\n headers: {\n 'Accept': '*/*',\n 'Authorization': 'Bearer ' + this.accessToken,\n 'Content-Type': 'application/json'\n }\n })\n\n // Load the data of each Product.\n if (productIDs.ok) {\n productIDs = await productIDs.json();\n\n for (let p of productIDs.results.searchresults) {\n let productData = await fetch(\"https://hallam.sci-toolset.com/discover/api/v1/products/\" + p.id, {\n headers: {\n Authorization: 'Bearer ' + this.accessToken,\n },\n })\n\n products.push(await productData.json());\n }\n }\n\n return products;\n }", "title": "" }, { "docid": "0c415b35f09fa4f9caa7a66e4a190476", "score": "0.7030677", "text": "async function getProducts() {\n setLoading(true);\n try {\n const response = await api.get(\"/cart\", {\n headers: {\n authorization: `bearer ${token}`,\n },\n });\n\n // if(response.data.length>0){\n setProducts([...response.data]);\n\n // }\n // else{\n // history.push('/')\n // }\n } catch (error) {\n console.warn(error);\n history.push(\"Error\");\n }\n }", "title": "" }, { "docid": "639f9878755883de2cd35cec8672ce36", "score": "0.7016796", "text": "static async fetchAllProducts(req, res) {\n try {\n const products = await Product.find();\n res.status(200).json(products);\n } catch (err) {\n res.status(400).json({message: err.message});\n }\n }", "title": "" }, { "docid": "78318df3a0c5b1a7bb5ed57ad89bf6bd", "score": "0.70159507", "text": "function readProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n //console.log(res);\n console.log(\"Bamazon products available for purchase:\\n\");\n\n for(var i=0; i<res.length; i++) {\n console.log(\" | \" + res[i].item_id + \" \" + res[i].product_name + \"............\" + \"$\" + res[i].price + \" Units Available: \" + res[i].stock_quantity + \"\\r\\n\");\n };\n console.log(\"-------------------------------------------------------\");\n \n menuOptions();\n });\n \n }", "title": "" }, { "docid": "1845ea5df778e038aa73c053a7224300", "score": "0.6998087", "text": "function products(){\n\tvar data = JSON.parse(this.responseText);\n\tproductsDOM(data);\n}", "title": "" }, { "docid": "9e3b3a731874733c15e1d7982319c538", "score": "0.69943994", "text": "async getProducts() {\n //using fetch method. With this feature we can use Async-wait(this will always return a promise) .\n // We can also use (await)-this will allow us to wait till the (promise) is settled then we return a result\n\n try {\n let result;\n result = await fetch('products.json');\n let data;\n data = await result.json();\n /*return data;*/\n //now,knowing that the data returns the object as above (return data), I will pass the property (items) which is the name of the json data object\n let products = data.items; //products is holding the array of product items\n //will use the map method (map()) since I have an array of product instead arrange the json properly\n products = products.map(item => {\n let fields = item.fields;\n const { title, price } = fields;\n const { id } = item.sys;\n const image = item.fields.image.fields.file.url;\n return { title, price, id, image }\n })\n return products;\n\n\n\n } catch (error) {\n console.log(error)\n }\n\n\n\n\n\n }", "title": "" }, { "docid": "c0e0ceb8ac4ba0dcf2e399a4d27454d6", "score": "0.6990616", "text": "async getData() {\n const data = await readFile(this.datafile, 'utf8');\n return JSON.parse(data).products;\n }", "title": "" }, { "docid": "f7f93ac0551322d80dcc83f5f575c05e", "score": "0.6984889", "text": "getProducts ({ state, commit, dispatch }) {\n\t\tif (!state.products.length) {\n\t\t\tcommit(\"SET_LOADING\", true)\n\t\t\tproductApplication.fetchData((error, data) => dispatch(\"processProductsData\", { error, data }))\n\t\t}\n\t}", "title": "" }, { "docid": "d2ee0c816499d2074d4b7cb800ef0449", "score": "0.6981846", "text": "getProducts(){\n return axios.get(\"http://localhost:8080/api/products/getall\"); \n }", "title": "" }, { "docid": "919c6028dae443f4b9930bbe9637ee7d", "score": "0.69809234", "text": "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT item_id, product_name, price FROM products\", function(error, response) {\n if (error) throw error;\n\n // all results of the SELECT statement\n console.log(response);\n\n // end connection\n //connection.end();\n \n });\n }", "title": "" }, { "docid": "1e08b2a659f85581ec8e5322006e9487", "score": "0.6966793", "text": "function loadProducts() {\n $http.get(\"http://localhost:3000/api/meals\").success(function (offerings) {\n app.offerings = offerings;\n });\n }", "title": "" }, { "docid": "4aaf4b8071231b82afcc445375ecdc46", "score": "0.6957678", "text": "function getUberProducts() {\n $.ajax({\n url: '/api/products?lat=' + myLatlng.lat() + '&lng=' + myLatlng.lng()\n })\n .done(function(msg) {\n findUberXID(msg.products);\n showCurrentPayload('GET', '/v1/products', [{\n 'param': 'latitude',\n 'val': myLatlng.lat()\n }, {\n 'param': 'longitude',\n 'val': myLatlng.lng()\n }], null, msg);\n });\n }", "title": "" }, { "docid": "90c0e2208142595c6af6542f29afa15b", "score": "0.69531524", "text": "function getAllProducts() {\n let api = `${baseApiUrl}products/getAllProducts`;\n let options = {\n method: 'GET',\n headers: {\n \"x-access-token\": localStorage.getItem(\"fv_token\")\n },\n\n }\n fetch(api, options).then(response => response.json())\n .then(data => {\n if (data.status == 200) {\n showProductsInTable(data.data)\n }\n });\n}", "title": "" }, { "docid": "56296fa3e00b1010d858941fda40fbb4", "score": "0.6951048", "text": "function getProductNaam() {\n\n\t\t\tvar data = [];\n\n\t\t\tvar getReq = Titanium.Network.createHTTPClient();\n\t\t\tif(Ti.App.localonline === \"local\") {\n\t\t\t\tgetReq.open(\"GET\", \"http://localhost/smartscan/get_allproducts.php\");\n\t\t\t} else {\n\t\t\t\tgetReq.open(\"GET\", \"http://sofiehendrickx.eu/SmartScan/get_allproducts.php\");\n\t\t\t}\n\t\t\t\n\t\t\tgetReq.timeout = 5000;\n\n\t\t\tgetReq.onload = function() {\n\t\t\t\ttry {\n\t\t\t\t\tvar products = JSON.parse(this.responseText);\n\t\t\t\t\tTitanium.App.product = products;\n\t\t\t\t\tTitanium.App.dataproduct = products.length;\n\t\t\t\t\t\n\t\t\t\t\t//Er zijn nog geen linken in de databank\n\t\t\t\t\tif(products.getProd === false) {\n\t\t\t\t\t\tvar lblNoCat = Titanium.UI.createLabel(Smart.combine(style.textError, {\n\t\t\t\t\t\t\ttop : 42,\n\t\t\t\t\t\t\ttext : 'Geen producten gevonden.',\n\t\t\t\t\t\t\tleft : 45,\n\t\t\t\t\t\t\tright : 30,\n\t\t\t\t\t\t\twidth : 300,\n\t\t\t\t\t\t\theight : 'auto'\n\t\t\t\t\t\t}));\n\t\t\t\t\t\taddProductWin.add(lblNoCat);\n\t\t\t\t\t\t\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor(var i = 0; i < products.length; i++) {\n\t\t\t\t\t\t\tvar id = products[i].id;\n\t\t\t\t\t\t\tvar pNaam = products[i].naam;\n\n\t\t\t\t\t\t\tvar row = Ti.UI.createTableViewRow(style.row);\n\n\t\t\t\t\t\t\tvar name = Ti.UI.createLabel(Smart.combine(style.textNormal, {\n\t\t\t\t\t\t\t\ttext : pNaam\n\t\t\t\t\t\t\t}));\n\n\t\t\t\t\t\t\trow.add(name);\n\t\t\t\t\t\t\trow.className = 'item' + i;\n\t\t\t\t\t\t\tdata[i] = row;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tvar listCat = Titanium.UI.createTableView(Smart.combine(style.tableView, {\n\t\t\t\t\t\t\tdata : data,\n\t\t\t\t\t\t\ttop:40,\n\t\t\t\t\t\t\tbottom:200\n\t\t\t\t\t\t}));\n\t\t\t\t\t\taddProductWin.add(listCat);\n\t\t\t\t\t\t\n\t\t\t\t\t\tlistCat.addEventListener('click', function(e) {\n\t\t\t\t\t\t\tTitanium.App.selectedProdIndex = products[e.index].id;\n\t\t\t\t\t\t\taddProduct();\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\n\t\t\t\t} catch(e) {\n\t\t\t\t\talert(e);\n\t\t\t\t}\n\t\t\t};\n\t\t\tvar params = {\n\t\t\t\tname : searchbar.value\n\t\t\t};\n\t\t\tTi.API.info('Search: '+params.name);\n\t\t\t\n\t\t\tgetReq.onerror = function(e) {\n\t\t\t\tTi.API.info(\"TEXT onerror: \" + this.responseText);\n\t\t\t\talert('Er is iets mis met de databank.');\n\t\t\t}\n\n\t\t\tgetReq.send(params);\n\t\t}", "title": "" }, { "docid": "4b66b4febcc003623bf6d24e58a1c4fb", "score": "0.69510436", "text": "async getList() {\n const data = await this.getData();\n return data.map(product => {\n return {\n shortname: product.shortname,\n title: product.title,\n summary: product.summary,\n image: product.image,\n };\n });\n }", "title": "" }, { "docid": "3c3c2b0836fb006bfa9bc9d8180f3aed", "score": "0.6942025", "text": "async getProducts() {\n try {\n const contentful= await client.getEntries({content_type:\"pastryShop\"})\n let products = contentful.items;\n products = products.map(item => {\n const { name, price } = item.fields;\n const { id } = item.sys;\n const image = item.fields.image.fields.file.url;\n const { sortType }=item.fields\n return {name,price,id,image,sortType}\n })\n return products\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "f35be9087cede9fb13a07003574e8723", "score": "0.693728", "text": "function getProducts (req, res) {\n Product.find({}, (err, products) => {\n if (err) return res.status(500).send({message: `error al realizar la petición ${err}`});\n if (!products) return res.status(404).send({message: `No existen productos`});\n res.status(200).send({ products })\n })\n}", "title": "" }, { "docid": "0a68cf574cd694f80c9af80e9cf88713", "score": "0.6928783", "text": "function getProductsData() {\n let productString = localStorage.getItem('Products');\n\n // convert the prodct data back into normal object array\n let productArray = JSON.parse(productString);\n\n // check the product array not empty to be in the safe side \n if (productArray !== null) {\n allProducts = productArray;\n }\n}", "title": "" }, { "docid": "623274a9a39c4f1d9aeb13c8fcf59662", "score": "0.6925386", "text": "function loadProducts() {\n connection.query(\"SELECT * FROM product\", function(err, res) {\n if (err) throw err;\n console.table(res);\n });\n}", "title": "" }, { "docid": "e962d5dae8d6b49f332ec6906022b1db", "score": "0.6915923", "text": "function serveApiProducts(req, res, params, query) {\n if (params.length > 1) {\n ProductService.getProductById(params[1]).then(function (product) {\n if (product) {\n sendJSONResponse(product, res);\n } else {\n sendNotFound(res);\n }\n }).catch(function (err) {\n serveInternalError(req, res, err.message);\n });\n } else {\n ProductService.getProducts(query).then(function (products) {\n sendJSONResponse(products, res);\n });\n }\n}", "title": "" }, { "docid": "1077b47910e4fd0d772d10acd125a5ed", "score": "0.6913405", "text": "function loadProductData(data){\n\t_product = data[0];\n\t_selected = data[0].variants[0];\n}", "title": "" }, { "docid": "f5d7c856cfa41827fdeb533fc0ebaa8d", "score": "0.689187", "text": "function _refreshProductData() {\n\t\t$http({\n\t\t\tmethod : 'GET',\n\t\t\turl : '/products'\n\t\t}).then(function(res) { // success\n\t\t\t$scope.products = res.data;\n\t\t}, function(res) { // error\n\t\t\tconsole.log(\"Error: \" + res.status + \" : \" + res.data);\n\t\t});\n\t}", "title": "" }, { "docid": "74daa63daa57a4afc0221a2c6e6a3c4f", "score": "0.6890885", "text": "function receiveProductData(error, results) {\n console.log(\"Recieved products table from SQL server.\");\n orderObj.errorProduct = error;\n orderObj.productData = results;\n console.log(orderObj.productData);\n serverfunctions.dbquery(\"SELECT * FROM PRODUCTIMAGES WHERE key_number = '\" + item_key + \"';\", receiveImageData);\n }", "title": "" }, { "docid": "9bd0f0cd208c289de1d86a044e7660ab", "score": "0.6885585", "text": "function getProductsFromServer(cb) {\n setTimeout(function () {\n\n var mockData = [\n {name: 'Football', category: 'Sporting Goods', price: '$49.99', stocked: true, visible: true},\n {name: 'Basketball', category: 'Sporting Goods', price: '$29.99', stocked: false, visible: true},\n {name: 'iPhone 5', category: 'Electronics', price: '$399.99', stocked: false, visible: true},\n {name: 'Nexus 7', category: 'Electronics', price: '$199.99', stocked: true, visible: true}\n ];\n \n cb(mockData)\n\n }, 500)\n}", "title": "" }, { "docid": "edb4be9aa40cefb2f04e2b1727a9c7fa", "score": "0.6871394", "text": "getProducts(data) {\n if (user == undefined) {\n alert('please Log in first.')\n throw Error('please Log in first.')\n } else {\n fetch(`https://amazon-price1.p.rapidapi.com/search?keywords=${data}&marketplace=US`, {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-host\": \"amazon-price1.p.rapidapi.com\",\n \"x-rapidapi-key\": \"04ffdca11fmsh6d2319daea4c209p172278jsn9b371a9115f8\"\n }\n })\n .then((r) => { return r.json() })\n .then((info) => {\n info.forEach((p) => {\n const product = new Product(p);\n product.display();\n this.searchedProducts.push(p);\n\n })\n\n })\n .catch(err => {\n console.log(err);\n });\n }\n }", "title": "" }, { "docid": "602be3f0a4648a41edd204c928ecf261", "score": "0.6859519", "text": "function getProductData(url) {\n const nightmare = new Nightmare();\n // get product id from url`\n const beginStr = url.indexOf('item/') + 5;\n const endStr = url.length;\n const sku = url.slice(beginStr, endStr);\n \n return nightmare\n .goto(url)\n .wait(200)\n .evaluate(() => {\n let obj = {};\n let productCard = document.querySelector(\".productCard\");\n \n obj.title = productCard.getElementsByClassName(\"col-sm-12\")[0].getElementsByTagName('h2')[0].innerText;\n let price = productCard.getElementsByClassName(\"col-sm-12\")[0].getElementsByTagName('h3')[0].innerText;\n obj.price = price.slice(-5) + ' USD'; // for direct upload to google merchant center\n obj.description = productCard.getElementsByClassName(\"col-sm-12\")[0].getElementsByTagName('p')[0].innerText;\n obj.image_link = productCard.getElementsByClassName(\"itemPic\")[0].getElementsByTagName('img')[0].src;\n \n return obj;\n })\n .end()\n .then(data => {\n console.log('getProductsData\\'s then'); // eslint-disable-line\n return Object.assign(data, {\n link: url,\n id: sku\n });\n })\n .catch(err => {\n console.log('failed: ', err); // eslint-disable-line\n });\n }", "title": "" }, { "docid": "37ae4d0e7522c008de50769375d90963", "score": "0.68553585", "text": "function viewProduct() {\n connection.query(\"SELECT `items_id`, `product_name`, `price` FROM `products`\", function (err, data) {\n if (err) throw err;\n console.log(\"View Products For Sale\");\n for (var i = 0; i < data.length; i++) {\n itemsList.push(data[i]);\n console.log(\"Item ID: \", itemsList[i].items_id + \":\", itemsList[i].product_name);\n }\n\n })\n\n }", "title": "" }, { "docid": "2902de2bf7c3bf4031243e6aed947466", "score": "0.6842049", "text": "function getSamplePickProductList() {\n var request = $http({\n method: \"GET\",\n async: true,\n cache: false,\n url: $rootScope.URL.pickProductListUrl\n });\n return (request.then(handleSuccess, handleError));\n }", "title": "" }, { "docid": "ede06c500af0a1f75a5d5ba6c03c0e29", "score": "0.68304044", "text": "function getProducts(req, res) {\r\n let searchQuery = productsQuery(req.query);\r\n\r\n Products.find(searchQuery).then((docs) => {\r\n res.status(200).send(docs);\r\n }, (e) => {\r\n res.status(400).send(e);\r\n });\r\n}", "title": "" }, { "docid": "fa36ffa4a9fae0349168d0bcdf121870", "score": "0.6828298", "text": "function getProducts() {\n\n\t// Show loader\n\t$('#loader').addClass('active');\n\n\tvar categoryChoice = $(this).attr('val');\n\tvar category;\n\n\t// If user chose category\n\tif (categoryChoice === 'health') {\n\t\tcategory = 'pcmcat242800050021';\n\n\t// If user chose laptops\n\t} else {\n\t\tcategory = 'abcat0502000';\n\t};\n\n\tvar urlCall = 'https://api.bestbuy.com/v1/products((categoryPath.id=' + category + '))?apiKey=5lK3DbxYtppGfCfBeahQ9iIu&sort=bestSellingRank.asc&show=image,name,regularPrice,shortDescription,url,bestSellingRank&pageSize=20&format=json';\n\n\t$.ajax(\n\t {\n\t type:'GET',\n\n\t // URL call\n\t url: urlCall,\n\t\t}\n\t)\n\n\t// When the API returs the data\n\t.done(function(data){\n\n\t\t// Show gallery\n\t\t$('#gallery').addClass('active');\n\n\t\t// Hide loader\n\t\t$('#loader').removeClass('active');\n\n\t\tdata.products.forEach(function(product, n) {\n\t\t\taddProduct(product, n, categoryChoice);\n\t\t});\n\n\t\t// Add active to first product\n\t\t$('#product-0').addClass('active');\n\n\t\t// Append arrows\n\t\t$('#gallery').append('<div id=\"arrow-left\" class=\"arrow arrow-left\" val=\"left\"></div><div id=\"arrow-right\" class=\"arrow arrow-right\" val=\"right\"></div>');\n\n\t\t// Hide left arrow\n\t\t$('#arrow-left').addClass('hide');\n\n\t\t// Click event on arrows\n\t\t$('.arrow').on('click', function() {\n\t\t\tslideSwitch($(this).attr('val'), data.products.length);\n\t\t});\n\t})\n\n\t// If it fails\n\t.fail(function(data){\n\n\t\t// Write the error in the console\n\t console.log('Error: ' + data);\n\t});\n}", "title": "" }, { "docid": "ad52f627d5aa7099524476dff91a20fa", "score": "0.6820517", "text": "function GetAllProductCodes() {\n try {\n\n var data = {};\n var ds = {};\n ds = GetDataFromServer(\"ProformaInvoice/GetAllProductCodes/\", data);\n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n _Products = ds.Records;\n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n notyAlert('error', ds.message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "title": "" }, { "docid": "750321f3529e2fbcdb13e28eccc08e2a", "score": "0.6817747", "text": "function getProduct(req, res){\r\n var productId = req.params.id;\r\n\r\n Product.findById(productId).exec((err, product) => { \r\n if(err){\r\n res.status(500).send({\r\n message: \"Error listando el producto en el json\"\r\n })\r\n }else{\r\n if(product){\r\n res.status(200).send({\r\n product\r\n })\r\n }else{\r\n res.status(404).send({\r\n message: \"No hay producto\"\r\n })\r\n }\r\n }\r\n })\r\n}", "title": "" }, { "docid": "da00debe9b143796f039b4fd25e9928e", "score": "0.6810117", "text": "function getProducts() {\n let cartFromStorage = localStorage.getItem(\"shoppingCart\");\n let cartObj = JSON.parse(cartFromStorage);\n let products = cartObj.products;\n getProdsToCart(products);\n setUpDeleteClickEvent();\n setUpPlusQuantityClickEvent();\n setUpMinusQuantityClickEvent();\n}", "title": "" }, { "docid": "a402940e4e44dc32110a14b62a1a1120", "score": "0.6801535", "text": "function viewProductList(){\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n \n for (var i = 0; i < results.length; i++) {\n console.log(\"Id: \" + results[i].id + \" || Product Name: \" + results[i].product_name \n + \" || Price of the product: \" + results[i].price + \" || Quantity of the product: \" + results[i].stock_quantity);\n }\n start();\n }\n\n )\n \n}", "title": "" }, { "docid": "a9e52457704246b18e3774843ed195b2", "score": "0.67964137", "text": "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(\"DEPARTMENT: \" + res[i].department_name);\n console.log(\"PRICE: \" + res[i].price);\n console.log(\"QUANTITY: \" + res[i].quantity);\n console.log(\" \");\n }\n\n userPrompt();\n }\n }); \n }", "title": "" }, { "docid": "a6c178be32ab68b5ab3e1e361f3011ba", "score": "0.67921907", "text": "static async fetchProductById(req, res) {\n const id = req.params.id;\n try {\n const product = await Product.findById(id);\n res.status(200).json(product);\n } catch (err) {\n res.status(400).json({message: err.message});\n }\n }", "title": "" }, { "docid": "ef1d01b344e845150c75af17a5ca4367", "score": "0.6791725", "text": "function viewProducts(){\n var query = \"SELECT * FROM products\"\n connection.query(query, function(err, res) {\n if (err) throw err;\n for(var i = 0; i < res.length; i++) {\n console.log(`Item ID: ${res[i].ID} Product: ${res[i].product_name} Department: ${res[i].department_name} Price: $${res[i].price}.00 Stock: ${res[i].stock_quantity}`);\n product.push(res[i].product_name);\n quantity = res[i].stock_quantity\n }\n //addInventoryConfirmation()\n });\n //console.log(\"viewProducts\");\n }", "title": "" }, { "docid": "0cb3ef9c7abff4655bad6f5bb15764e8", "score": "0.67847884", "text": "static async getAdminProducts(req, res) {\n\t\ttry {\n\t\t\tconst products = await Product.find();\n\n\t\t\tres.status(200).json({\n\t\t\t\tsuccess: true,\n\t\t\t\tproducts,\n\t\t\t});\n\t\t}catch (err) {\n\t\t\treturn errorResponse(res, 500, err.message);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "84db098b8b22567b27f4c378562e7744", "score": "0.67765325", "text": "async function getProducts(param,value){\n const allProducts= await getQueryByParam(\"products\", param,value);\n return allProducts;\n}", "title": "" }, { "docid": "f49ab7b650b734806a426d906a7ebb7d", "score": "0.67664105", "text": "function getAllProducts() {\n\n // ajax request to the RESTful web service\n $.ajax({\n type: 'GET',\n url: 'http://localhost:49822/api/artigos/',\n success: getAllProductsHandler,\n error: function () {\n console.log(\"Request failed!\");\n }\n });\n}", "title": "" }, { "docid": "808dc9e3e1b052bcfd77e3122ed8b3de", "score": "0.6759116", "text": "async getProducts() {\n try {\n // The await operator is used to wait for a Promise. It can only be used inside an async function.\n let result = await fetch(\"products.json\"); // fetching data from products.json locally, it goes and get the data and we get result later point\n //return me the data using JSON method\n let data = await result.json();//instead of returning result return data(items), we will wait and only when it's settled then we return\n let products = data.items;//object = array\n // The Map object holds key-value pairs and remembers the original insertion order of the keys. \n products = products.map(item => {\n const { title, price } = item.fields;\n const { id } = item.sys;\n const image = item.fields.image.fields.file.url;\n return { title, price, id, image };\n });\n // console.log(products);\n return products;\n } catch (error) {\n console.log(error);\n // console.log(getProducts);\n }\n }", "title": "" }, { "docid": "009e6a05be71840ef7b4a53bf00c0215", "score": "0.67533195", "text": "function getProducts(callback, type) {\n \tdebugger;\n\t if(response === null) {\n\t \t$http.get('./home.json').success(function(data, status, headers, config) {\n\t\t\t\t response = data;\n\t\t\t\t}).\n\t\t\t\t error(function(data, status, headers, config) {\n\t\t\t\t alert('Error on fetching from the server');\n\t\t\t\t}).then(function(){\n \tdebugger;\n\t\t\t\t\tif(type != null){\n\t\t\t\t\t\tcallback(response.products[type]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback(response);\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// if we already had fetched the elements\n\t\t\t\tif(type !== undefined){\n\t\t\t\t\tcallback(response.products[type]);\n\t\t\t\t} else {\n\t\t\t\t\tcallback(response);\n\t\t\t\t}\n\t\t\t}\n }", "title": "" }, { "docid": "9860c12fe49c97de2f5e62e29c245d43", "score": "0.6746735", "text": "function retrieveProducts(data) {\n return JSON.parse(localStorage.getItem(data));\n \n}", "title": "" }, { "docid": "e485d70e86c3c885e6c147c7bc9e94e2", "score": "0.6738159", "text": "function product(parent,args,context) {\n const id = args._key\n const backendURL = context.backendURL\n const foxxMountPoint = context.foxxServMountPoints.generic\n const endPoint = `${context.foxxServGenericEndPoints.DocumentByKeyGet}/${collectionName}/${id}`\n return genericHelper.fetchQuery(backendURL,foxxMountPoint,endPoint,productAfterGetHandler)\n //return fetch(genericHelper.buildURL(backendURL,foxxMountPoint,endPoint)).then(res => res.json())\n //return fetch(`${backendURL}/${foxxMountPoint}/genericDocumentByKeyGet/${collectionName}/${id}`).then(res => res.json())\n}", "title": "" }, { "docid": "48a933a1cdde2a4e9dd331e6d13c45a4", "score": "0.6730841", "text": "function readProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price FROM products\", function (err, res) {\n console.log(\"======================\");\n console.log(\"Product list\");\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));\n }\n askquestions();\n })\n}", "title": "" }, { "docid": "7bdde4a17a1b2c59cdb2719837496092", "score": "0.6730554", "text": "function load() {\n const url = \"http://localhost:3000/api/products\";\n const productId = new URLSearchParams(window.location.search).get(\"id\");\n const productUrl = url + \"/\" + productId;\n fetch(productUrl).then((response) => {\n response\n .json()\n .then((data) => {\n displayProduct(data);\n })\n\n .catch((error) => {\n console.error(error);\n });\n });\n}", "title": "" }, { "docid": "33c237e0153ea62e4755a9d29beac0d5", "score": "0.66988087", "text": "function getProducts(req, res, next) {\n console.log(\"Simar\");\n var query = 'SELECT * FROM \"PRODUCT\"';\n var productId = parseInt(req.query.productId);\n\n if(productId){\n query += ' WHERE \"PRODUCT_ID\" = ' + productId;\n }\n \n dataBase.any(query)\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Retrieved all products'\n });\n })\n .catch(function (err) {\n console.log(err);\n return next(err);\n });\n}", "title": "" }, { "docid": "7f442379fa50dc771b2feeefb4123ddd", "score": "0.66921693", "text": "function getData(db = connection) {\n return db('products').select().map(product => {\n return {\n id: product.id,\n name: product.name,\n price: product.price,\n description: product.description,\n ingredients: product.ingredients,\n weight: product.weight,\n dateAvailable: product.date_available,\n inStock: product.in_stock,\n }\n })\n \n}", "title": "" }, { "docid": "d98080c95b79a74e1b31bad44fed29a5", "score": "0.66864616", "text": "getProductInfo(id) {\n axios\n .get(`/products/${id}`)\n .then((data) => {\n this.setState({\n productData: data.data,\n });\n })\n .catch((err) => {\n console.log(\"ERR Axios get product from client\", err);\n });\n }", "title": "" }, { "docid": "1bac5edc710f827febfec6db2c74c1f2", "score": "0.66861206", "text": "function ListProducts(_, response) {\n response(null, { products: products })\n}", "title": "" }, { "docid": "e9d079728bb9d4ca63ac41ee58aeda97", "score": "0.66831946", "text": "getAllProducts() {\n return new Promise(async (resolve, reject) => {\n try {\n const response = await ProductService.getAllProducts();\n if (response.status === 200) {\n this.setState({\n products: response.data\n });\n resolve(this.state.products);\n }\n } catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "6a5c153bd73ea58aa95fdd7809d507eb", "score": "0.66810715", "text": "getList(cb) {\n return this.dataProvider.send({type: 'product.list'}).then(cb);\n }", "title": "" }, { "docid": "0d89aaf82e13bc4d69d5a7d594e68a64", "score": "0.66789436", "text": "function getAllProducts() {\n\n\tlet role = sessionStorage.getItem(\"USER_ROLE\");\n\tfetch(getUrl(role)).then(res => res.json()).then(res => {\n\t\tif (message.errorMessagemessage != null) {\n\t\t\ttoastr.error(message.errorMessage);\n\t\t} else {\n\t\t\tdisplayFunction(res, role);\n\t\t}\n\t})\n}", "title": "" }, { "docid": "801bdec0e8a1b1fccbc1bc3e7977e691", "score": "0.6677926", "text": "function readProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n })\n}", "title": "" }, { "docid": "ec411aee0d0ad3fadbebd048038a8688", "score": "0.66732967", "text": "getAllProduct() {\n axios.get(apiRootUrl + \"/products/getMyProducts\", {\n headers: {\n Authorization: \"Bearer \" + localStorage.getItem(\"token\"),\n },\n })\n//returns the products data\n .then((res) => {\n\n this.setState({\n products: res.data.data,\n });\n })\n\n //returns error if issues encountered\n .catch((err) => {\n notification(\"error\", \"Error\", err.response.data.error)\n });\n }", "title": "" }, { "docid": "62af868fd1eb60f9d82def8ce3a00376", "score": "0.66694593", "text": "function getProduct() {\n\n // récupérer l'url avec le bon Id\n function getId() {\n const params = (new URL(window.location)).searchParams;\n let id = params.get(\"id\");\n return id;\n }\n id = getId();\n\n // récupérer la réponse de l'API \n fetch(\"http://localhost:3000/api/cameras/\" + id)\n .then(response => response.json())\n .then(response => {\n addProductInfo(response);\n basketContentNav();\n })\n .catch((err) => {\n console.log(err);\n alert(\"Problème de serveur, merci de revenir plus tard.\");\n });\n\n}", "title": "" } ]
2bfb679ea63bbacc5acfcc90a6bb6ef9
Checks if the string is a hexadecimal color. If given value is not a string, then it returns false.
[ { "docid": "1c6c1e03c165c9111a6442ebbedb8e52", "score": "0.86025816", "text": "function isHexColor(value) {\n return typeof value === \"string\" && validator.isHexColor(value);\n}", "title": "" } ]
[ { "docid": "579d94b5a7fa3b7bd1d687469cf86fe8", "score": "0.84967357", "text": "function isHexColor(value) {\n return typeof value === \"string\" && validator.isHexColor(value);\n }", "title": "" }, { "docid": "1ece22df8cfb9aed2d0616e974cbeeef", "score": "0.8220759", "text": "function isHexaColor(sNum) {\n return (typeof sNum === \"string\") && (sNum.length === 6)\n && !isNaN(parseInt(sNum, 16));\n}", "title": "" }, { "docid": "4c14fbadb7b1c6ace3eb0abb317a3801", "score": "0.80300266", "text": "function isHex(value) {\n return /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(value);\n}", "title": "" }, { "docid": "6353267b206a167c69967bc935460585", "score": "0.785659", "text": "static isHex(value) {\r\n if (value.length % 2 === 1) {\r\n return false;\r\n }\r\n return /^[\\da-f]+$/g.test(value);\r\n }", "title": "" }, { "docid": "cf448e3a42440bf1b9346e731dfc1dc5", "score": "0.77471316", "text": "function isHexColor(color) {\n const colorRegex = /^\\#?[A-Fa-f0-9]{3}([A-Fa-f0-9]{3})?$/;\n return colorRegex.test(color);\n}", "title": "" }, { "docid": "a67fa34429a21faf3fb7bbb763c1dac5", "score": "0.7714351", "text": "function isHex (_str){\n var reg = new RegExp(/^#([0-9a-f]{3}|[0-9a-f]{6})$/)\n}", "title": "" }, { "docid": "92e5e5b2d1be6c7ff72a048b141f78e6", "score": "0.7648555", "text": "checkIfHex(str) {\n const regexp = /^[0-9a-fA-F]+$/\n for (var i = 0; i < str.length; i++) {\n if (!regexp.test(str.charAt(i)))\n {\n return false\n }\n }\n return true\n }", "title": "" }, { "docid": "f2cd98dc868e2e4ba0ace6ff0686655b", "score": "0.7625641", "text": "function hexRgb(value) {\n\t return check.string(value) &&\n\t rgb.test(value);\n\t }", "title": "" }, { "docid": "f2cd98dc868e2e4ba0ace6ff0686655b", "score": "0.7625641", "text": "function hexRgb(value) {\n\t return check.string(value) &&\n\t rgb.test(value);\n\t }", "title": "" }, { "docid": "547304644030456839e2c0a7aa217876", "score": "0.7582133", "text": "function isValidColorCode(str) {\r\n\treturn /^\\#[0-9a-fA-F]{6}$/.test(str);\r\n}", "title": "" }, { "docid": "ad044c114c353daf1232b4ee12618787", "score": "0.7546909", "text": "function checkIfHexa(value) {\n const re = /^[0-9a-fA-F]+$/;\n if (re.test(value) && value.length == 6) {\n return true;\n } else {\n alert(\"Please enter a 6-digits hexadecimal value.\");\n colorCode.value = \"\";\n return false;\n }\n}", "title": "" }, { "docid": "77b5bafb163a6225e1be95974046d47b", "score": "0.75312436", "text": "function color (string) {\n\treturn (typeof(string) === 'string' ? true : false)\n}", "title": "" }, { "docid": "f58b97a36338adc3415872054bf9bffe", "score": "0.75285256", "text": "isValidateHex(value) {\n return /^#([A-Fa-f0-9]{3}$)|([A-Fa-f0-9]{6}$)/.test(value) && value.length === 7;\n }", "title": "" }, { "docid": "8b9d08cac7426dd092d6c7b279c06130", "score": "0.7500242", "text": "function isHEX(color, testShortHex) {\n return (testShortHex && /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color)) ||\n /^#([A-Fa-f0-9]{6})$/.test(color);\n }", "title": "" }, { "docid": "91a282b33b63107d604cf952a8d72a55", "score": "0.7417343", "text": "function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))\n return false;\n if (length && value.length !== 2 + 2 * length)\n return false;\n return true;\n}", "title": "" }, { "docid": "91a282b33b63107d604cf952a8d72a55", "score": "0.7417343", "text": "function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))\n return false;\n if (length && value.length !== 2 + 2 * length)\n return false;\n return true;\n}", "title": "" }, { "docid": "1ee63945890e80a1dbca1a24db0f5d2d", "score": "0.74091184", "text": "function isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/))\n return false;\n if (typeof length !== 'undefined' && length > 0 && value.length !== 2 + 2 * length)\n return false;\n return true;\n}", "title": "" }, { "docid": "6d65a70f34328c28ac8088d7a8a188f9", "score": "0.7367551", "text": "function validHexColour(colour) {\n var reg = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\n return reg.test(colour);\n }", "title": "" }, { "docid": "fba4ef1880bec9541ba38ca481822229", "score": "0.7263939", "text": "function checkColor(colorCode){\n return (typeof(colorCode) === 'string' && /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(colorCode));\n}", "title": "" }, { "docid": "1d2fdb99abe32252ad078ef479d6d39b", "score": "0.718564", "text": "function isHex(hex) {\n return HEX_REGEX.test(hex);\n}", "title": "" }, { "docid": "e336a05fd4920923c48269c55c3ab154", "score": "0.70859754", "text": "function isHexChar(c) {\n if ((c >= 'A' && c <= 'F') ||\n (c >= 'a' && c <= 'f') ||\n (c >= '0' && c <= '9')) {\n return 1;\n }\n return 0;\n}", "title": "" }, { "docid": "2c95f380019c687ccad75514be2c3ae1", "score": "0.7057473", "text": "function isHexadecimal(value) {\n return typeof value === \"string\" && validator.isHexadecimal(value);\n}", "title": "" }, { "docid": "81d97813e78f5b9303f0217c33e5d854", "score": "0.7039331", "text": "isHex(input) {\n var _a;\n const hexRegEx = /(?:[0-9]|[a-f])/gimu;\n return ((_a = input.match(hexRegEx)) !== null && _a !== void 0 ? _a : []).length === input.length;\n }", "title": "" }, { "docid": "13438f2cc28278ebf7d1ca05ee459463", "score": "0.7002674", "text": "function testHex (str) {\n \n}", "title": "" }, { "docid": "d49b88ebc0a300c9c717bfa0ec32b39b", "score": "0.69803363", "text": "function checkValidColor(color) {\n let RegExp = /(^[0-9A-Fa-f]{6}$)|(^[0-9A-F]{3}$)/i;\n return RegExp.test(color);\n }", "title": "" }, { "docid": "ec4d25379d29cb6a0a903082d289333a", "score": "0.69785917", "text": "function isHexadecimal(value) {\n return typeof value === \"string\" && validator.isHexadecimal(value);\n }", "title": "" }, { "docid": "060cb35fe15439c314045aedb451a6ba", "score": "0.6908237", "text": "function isHex(code) {\n return isNumber(code) || isAlpha(code, 65, 70); // A-F\n}", "title": "" }, { "docid": "f8e03403be81afe8253a5e8b644210c5", "score": "0.6702985", "text": "function IsHexColor(validationOptions) {\n return ValidateBy({\n name: IS_HEX_COLOR,\n validator: {\n validate: function (value, args) { return isHexColor(value); },\n defaultMessage: buildMessage(function (eachPrefix) { return eachPrefix + \"$property must be a hexadecimal color\"; }, validationOptions)\n }\n }, validationOptions);\n }", "title": "" }, { "docid": "c5a0472737bf7b98f9fc3c415bf798d3", "score": "0.66924864", "text": "function IsHexColor(validationOptions) {\n return ValidateBy({\n name: IS_HEX_COLOR,\n validator: {\n validate: function (value, args) { return isHexColor(value); },\n defaultMessage: buildMessage(function (eachPrefix) { return eachPrefix + \"$property must be a hexadecimal color\"; }, validationOptions)\n }\n }, validationOptions);\n}", "title": "" }, { "docid": "5b0468d6ff8fe6d1445434bbf3c6faff", "score": "0.66324675", "text": "function hexColor(str){return '#' + str.replace('#', '')}", "title": "" }, { "docid": "3ded3508ab5dfd139c27204cbba9546b", "score": "0.66272026", "text": "function isHex(code) {\n return Object(_emmetio_scanner__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(code) || Object(_emmetio_scanner__WEBPACK_IMPORTED_MODULE_0__[\"isAlpha\"])(code, 65, 70); // A-F\n}", "title": "" }, { "docid": "24ca2cad72642bc43aae11a44e5ae07e", "score": "0.658423", "text": "function isHexaData(data)\n{\n\tvar len = data.length;\n\tvar i = 0;\n\tfor( i = 0; i < len; i++)\n\t{\n\t\tif(isHexaDigit(data.charAt(i)) == false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.65836054", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" }, { "docid": "0a56ae06d7a844f0da33b93efd579ae7", "score": "0.6581619", "text": "function validateHex(kleur) {\n return /^#[0-9A-F]{6}$/i.test(kleur)\n}", "title": "" }, { "docid": "ded93f0f81acf0244095c12e84053910", "score": "0.65780884", "text": "function hexNumber(str) {\n var strArr = str.split('');\n if (strArr[0] !== '0' && strArr[1] === 'x') {\n return false;\n } else if (/\\W/.test(str) === false && /[0]/.test(str) === false && /\\s/.test(str) === false) {\n return str.length >= 1 && /[a-f]|[0-9]/i.test(str);\n } else if (str !== '0x' && /[0]/.test(str) === true && /\\s/.test(str) === false) {\n var count = 0;\n for (i = 0; i < strArr.length; i++) {\n if (strArr[i] === '0') {\n count++;\n }\n }\n if (strArr[1] === 'x' && strArr[0] !== '0') {\n return false;\n } else {\n return count === 1 || count === str.length;\n }\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "4ce5115d6b8c6b063b3332f7b8ce97db", "score": "0.65657634", "text": "function isTwoDigitHex(s) {\r\n\t\tif (s.length<2) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(s.length>2 && s.charAt(2)!=\" \") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tvar c = s.charAt(0);\r\n\t\tif ( !((c>='0' && c<='9') || (c>='A' && c<='F')) ){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tc = s.charAt(1);\r\n\t\tif ( !((c>='0' && c<='9') || (c>='A' && c<='F')) ){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "d3a0759e86496dd6ecef2c380e89f431", "score": "0.65393484", "text": "_isHexDigit (char) {\n return (char >= '0' && char <= '9')\n || (char >= 'a' && char <= 'f')\n || (char >= 'A' && char <= 'F');\n }", "title": "" }, { "docid": "d14bae1a4fceac27cec62d98f16105b1", "score": "0.6534301", "text": "function isColor(value) {\n return value instanceof Color_Color;\n}", "title": "" }, { "docid": "f1dc458d1f2ad00ddcfae8299d966908", "score": "0.6467703", "text": "function isRgb(string) {\n var rgb = string.match(/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i);\n return (rgb && rgb.length === 4) ? true : false;\n }", "title": "" }, { "docid": "1ddd64a1e30364ac8e11f17ab1bc0ef5", "score": "0.6466526", "text": "static isHashStr(hash) {\n const hexRegExp = new RegExp(/^[0-9a-f]*$/, 'i')\n return (typeof hash !== \"string\") ? false : hexRegExp.test(hash)\n }", "title": "" }, { "docid": "41bd1f8e2e5e28badd5c7bf82e9d6310", "score": "0.64337677", "text": "function isHexPrefixed(str) {\n return str.length >= 2 && str[0] === '0' && str[1] === 'x';\n}", "title": "" }, { "docid": "05c81266ecf810be137f22c558ee84a3", "score": "0.64293456", "text": "function isHexDigit(codePoint) {\n return isDigit(codePoint) || isBetween(codePoint, 0x41, 0x46) || isBetween(codePoint, 0x61, 0x66);\n}", "title": "" }, { "docid": "8ec28ba6ebb9ea7b9b17585a3091c360", "score": "0.6416689", "text": "function test_getColor(){\n console.assert(getColor('khaki') == '#f0e68c', 'getColor assertion failure: color lib');\n console.assert(getColor('kek') == false, 'getColor assertion failure: invalid lib entry');\n \n console.assert(getColor('#123AbC') == '#123abc', 'getColor assertion failure: hex echo');\n console.assert(getColor('#7dF') == '#77ddff', 'getColor assertion failure: hex repeat');\n console.assert(getColor('123abc') == false, 'getColor assertion failure: not marked as hex');\n console.assert(getColor('#abfh12') == false, 'getColor assertion failure: invalid hex characters');\n \n console.assert(getColor('(255,0,0)') == '#ff0000', 'getColor assertion failure: rgb conversion');\n console.assert(getColor(' (125, 0 , 80)') == '#7d0050', 'getColor assertion failure: rgb conversion & whitespace trim');\n console.assert(getColor('(,20,0)') == false, 'getColor assertion failure: invalid rgb formatting');\n}", "title": "" }, { "docid": "c93f23c69fdfe5701234e1bb39f25811", "score": "0.6408414", "text": "function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(\"[isHexPrefixed] input must be type 'string', received type \".concat(typeof str));\n }\n return str[0] === '0' && str[1] === 'x';\n}", "title": "" }, { "docid": "3a4306dda625c23e6571fd1cd5d5445c", "score": "0.64077085", "text": "function isValid_64_Hex_string(value) {\n if (typeof value === 'string') {\n return /^[0-9a-f]{64}$/.test(value);\n }\n\n return false;\n}", "title": "" }, { "docid": "0900140605c99e09835f598b1af7c360", "score": "0.6363386", "text": "function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(\"[isHexPrefixed] input must be type 'string', received type \" + typeof str);\n }\n return str[0] === '0' && str[1] === 'x';\n}", "title": "" }, { "docid": "537e0ea08c2d7d4407e8dcb711b29b88", "score": "0.63483614", "text": "function isColorValid(color) {\n return color === \"blue\" || color === \"green\";\n}", "title": "" }, { "docid": "0ae21cf3c9141ee96f2692ca85728047", "score": "0.62959665", "text": "function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof str}`);\n }\n return str[0] === '0' && str[1] === 'x';\n}", "title": "" }, { "docid": "4c1acd5ed043ae22a01221cdc31b0931", "score": "0.6286832", "text": "function getValidColor(color) {\n return validhexcolor.test(parseColor(color)) && color;\n}", "title": "" }, { "docid": "b8ebe06c5e7e7dc06d4416ab564f5851", "score": "0.6281974", "text": "function isHex(Object,msg)\n {\n var strInput = new String(Object.value)\n if (trim(strInput) == \"\")\n {\n return true\n }\n var objregExp = new RegExp(PatternsDict.hexpat)\n if(objregExp.test(strInput))\n {\n return true\n }\n alert(msg)\n Object.focus()\n return false\n }", "title": "" }, { "docid": "f0b9e77bc856c7c12c489c84f732da71", "score": "0.6271399", "text": "function IsHexDigit(ch) {\n return IsClosedCharClass(ch, IS_HEX_DIGIT);\n}", "title": "" }, { "docid": "7e4187c2da0ac285c94288a082f9007d", "score": "0.6259419", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "d1e4056f7110ee46ee1dd1fa6be4d3b3", "score": "0.625552", "text": "function isValidColor(newColor) {\n var valid = false;\n if (newColor.startsWith('#')) {\n valid = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(newColor);\n } else if (colors.includes(newColor)) {\n valid = true;\n } else {\n newColor = '#' + newColor;\n valid = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(newColor);\n }\n return valid;\n}", "title": "" }, { "docid": "d4f2e57b737df4c8ad7f9fad6c0df3d5", "score": "0.6255343", "text": "function isRgbColor(value, includePercentValues) {\n return typeof value === \"string\" && validator.isRgbColor(value, includePercentValues);\n}", "title": "" }, { "docid": "eca105c76aa7edecd5b8f0e7ed1041f2", "score": "0.62525123", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "eca105c76aa7edecd5b8f0e7ed1041f2", "score": "0.62525123", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "eca105c76aa7edecd5b8f0e7ed1041f2", "score": "0.62525123", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007E) ||\n (0x00085 === character) ||\n (0x000A0 <= character && character <= 0x00D7FF) ||\n (0x0E000 <= character && character <= 0x00FFFD) ||\n (0x10000 <= character && character <= 0x10FFFF));\n}", "title": "" }, { "docid": "62908c7756bd5ecb2a455731bdff365d", "score": "0.6243621", "text": "function isRed(color) {\n if (color === 'red') {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "73b32aa6b688839a6b3849d79848443a", "score": "0.62101555", "text": "function isHexDigit(char) {\n return char.length == 1 && '0123456789abcdefABCDEF'.indexOf(char) !== -1;\n }", "title": "" }, { "docid": "2cd11fcb789e6e607684bfc675a7c9e8", "score": "0.61823136", "text": "function ColorPickerIsThatAColor (c) {\n\t\tvar col = new RGBColor(c);\n\t\tif (col.ok) {\t\t\n\t\t\treturn [col.toHex(),col.t,col.a];\n\t\t}else{\t\t\n\t\t\treturn false;\n\t\t}\n}", "title": "" }, { "docid": "2d8f748df314c7abc3fe2f9794dba241", "score": "0.61814696", "text": "function needsHexEscape(character) {\n return !((0x00020 <= character && character <= 0x00007e) ||\n 0x00085 === character ||\n (0x000a0 <= character && character <= 0x00d7ff) ||\n (0x0e000 <= character && character <= 0x00fffd) ||\n (0x10000 <= character && character <= 0x10ffff));\n }", "title": "" }, { "docid": "223fc378a0548e72300e47ec0c21d259", "score": "0.6180133", "text": "function isRgbColor(value, includePercentValues) {\n return typeof value === \"string\" && validator.isRgbColor(value, includePercentValues);\n }", "title": "" }, { "docid": "9115c50275894c6c611c1b53a19dab73", "score": "0.6157453", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97\n /* a */\n && code <= 102 ||\n /* z */\n code >= 65\n /* A */\n && code <= 70\n /* Z */\n || code >= 48\n /* A */\n && code <= 57\n /* Z */\n ;\n}", "title": "" }, { "docid": "9115c50275894c6c611c1b53a19dab73", "score": "0.6157453", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97\n /* a */\n && code <= 102 ||\n /* z */\n code >= 65\n /* A */\n && code <= 70\n /* Z */\n || code >= 48\n /* A */\n && code <= 57\n /* Z */\n ;\n}", "title": "" }, { "docid": "f84f6544394455bc031adf0786471487", "score": "0.60891324", "text": "function ifValidHex(Modulus) {\n var i;\n for (i = 0; i < Modulus.length; i++) {\n if (isNaN(parseInt(Modulus.charAt(i), 16))) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a53ed58d57aee621d1f54c82bab07203", "score": "0.6079277", "text": "function parseHex(hex) {\n if (!hex) {\n // Invalid color\n return null;\n }\n var length = hex.length;\n if (length === 0) {\n // Invalid color\n return null;\n }\n if (hex.charCodeAt(0) !== 35 /* Hash */) {\n // Does not begin with a #\n return null;\n }\n if (length === 7) {\n // #RRGGBB format\n var r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));\n var g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));\n var b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));\n return new Color(new RGBA(r, g, b, 1));\n }\n if (length === 9) {\n // #RRGGBBAA format\n var r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));\n var g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));\n var b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));\n var a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8));\n return new Color(new RGBA(r, g, b, a / 255));\n }\n if (length === 4) {\n // #RGB format\n var r = _parseHexDigit(hex.charCodeAt(1));\n var g = _parseHexDigit(hex.charCodeAt(2));\n var b = _parseHexDigit(hex.charCodeAt(3));\n return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b));\n }\n if (length === 5) {\n // #RGBA format\n var r = _parseHexDigit(hex.charCodeAt(1));\n var g = _parseHexDigit(hex.charCodeAt(2));\n var b = _parseHexDigit(hex.charCodeAt(3));\n var a = _parseHexDigit(hex.charCodeAt(4));\n return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255));\n }\n // Invalid color\n return null;\n }", "title": "" }, { "docid": "524e6ad7eabf76a1204f7be2230fb68e", "score": "0.60396147", "text": "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "title": "" }, { "docid": "524e6ad7eabf76a1204f7be2230fb68e", "score": "0.60396147", "text": "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "title": "" }, { "docid": "524e6ad7eabf76a1204f7be2230fb68e", "score": "0.60396147", "text": "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "title": "" }, { "docid": "524e6ad7eabf76a1204f7be2230fb68e", "score": "0.60396147", "text": "function isHexDigit(code) {\n return (\n isDigit(code) || // 0 .. 9\n (code >= 0x0041 && code <= 0x0046) || // A .. F\n (code >= 0x0061 && code <= 0x0066) // a .. f\n );\n}", "title": "" }, { "docid": "9d8e89179bf919d147844c2f87f096a0", "score": "0.60132635", "text": "stringToHex(str) {\n if (!str) str = \"none\";\n var hash = 0;\n for (var i = 0; i < str.length; i++) {\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n var color = \"#\";\n for (var i = 0; i < 3; i++) {\n var value = (hash >> (i * 8)) & 0xff;\n color += (\"00\" + value.toString(16)).substr(-2);\n }\n return color;\n }", "title": "" }, { "docid": "90750b78f4bc55ad80914907236ba3c3", "score": "0.60122377", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ?\n character.charCodeAt(0) : character;\n\n return (code >= 97 /* a */ && code <= 102 /* z */) ||\n (code >= 65 /* A */ && code <= 70 /* Z */) ||\n (code >= 48 /* A */ && code <= 57 /* Z */);\n}", "title": "" }, { "docid": "90750b78f4bc55ad80914907236ba3c3", "score": "0.60122377", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ?\n character.charCodeAt(0) : character;\n\n return (code >= 97 /* a */ && code <= 102 /* z */) ||\n (code >= 65 /* A */ && code <= 70 /* Z */) ||\n (code >= 48 /* A */ && code <= 57 /* Z */);\n}", "title": "" }, { "docid": "c9a832d5d3054e0a050786ebd513f1c6", "score": "0.60081226", "text": "function returnHexaNumber(s) {\n var regExp = /^[-+]?[0-9A-Fa-f]+\\.?[0-9A-Fa-f]*?$/;\n return (typeof s === 'string' && regExp.test(s));\n}", "title": "" }, { "docid": "53ed01ce6e6f3ed8bc1c933bf316a6b6", "score": "0.6002974", "text": "function isValidColor(color) {\n return colors.has(color);\n }", "title": "" }, { "docid": "2983c73bd250eee204f49b4d3e5af14f", "score": "0.5974921", "text": "function isCssColor(color) {\n return !!color && !!color.match(/^(#|var\\(--|(rgb|hsl)a?\\()/);\n}", "title": "" }, { "docid": "c702251b6650cdee4b075f7c1d01db1c", "score": "0.5949476", "text": "function isAlmostWhite(hex) {\n return typeof hex === 'string' && getColorBrightness(hex) >= 240;\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "ed0629cc7eeca17e25f7591124627260", "score": "0.59437305", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}", "title": "" }, { "docid": "9700d19c4d115a51084493eb9adae4c1", "score": "0.5943385", "text": "function hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n }", "title": "" } ]
9e13b56908ae0dd0e5f5d308444ea574
is the next selection an open space or one occupied by an enemy piece? chess pieces not move through another piece and can only move into an open spot or an enemy
[ { "docid": "e3f38c0b45835022b40c7176b22198d8", "score": "0.0", "text": "function kingVector (color) {\n let vector = null\n board.forEach((row, x) => {\n row.forEach((space, y) => {\n if (board[x][y].children[0].id === `${color}-king`) {\n vector = { x, y }\n }\n })\n })\n return vector\n }", "title": "" } ]
[ { "docid": "60944104e431dfbfee75e5bcae7817e5", "score": "0.7031586", "text": "validPieceToMove(select) {\n var [r, c] = select;\n return this.matrix[r][c].player == this.player;\n }", "title": "" }, { "docid": "d82b4c9a90eb3d56cbf46db2ea858c59", "score": "0.67513114", "text": "function has_moves(cx,cy){\n var flag = 0;\n if(adjacent_is_different(cx,cy)){\n for(var x = -1;x<=1;x++){\n for(var y = -1; y<=1;y++){\n for(var moves = 1;;moves++){\n var posx= cx +(moves*x);\n var posy= cy +(moves*y);\n //console.log(\"pos inside has moves-> posx:\"+posx+\",posy:\"+posy);\n //out of bounds\n if(posx <0 || posx > (length-1) || posy <0 || posy > (length-1) || (cx === posx && cy === posy) || moves > 7){flag = 0; break;}\n //finds empty piece in which a piece can be placed and rivals' pieces flip\n if(state[posx][posy] === 0 && flag === 0) break;\n else if(state[posx][posy] === 0 && flag === 1){/*console.log(\"possible cuz x:\"+posx+\",y:\"+posy);*/ return true;}\n //already has piece there(from player playing)\n else if(state[posx][posy] === player && flag === 1) flag = 0;\n //has rival's piece in surrounding square\n else if(state[posx][posy] != player && state[posx][posy] !== 0) flag = 1;\n }\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "d31a7f9d04ed80914756fd79672aa25c", "score": "0.66947055", "text": "function pawnMoves() {\n //Pawn 2 for first move\n // 1 move up\n //attack from angle\n var attackLeftUp = pawnMoves(1, -1);\n var attackRightUp = pawnMoves(1, 1);\n\n var attackLeftDown = pawnMoves(-1, 1);\n var attackRightDown = pawnMoves(-1, -1);\n\n var firstUp = pawnMoves(2, 0);\n var firstDown = pawnMoves(2, 0);\n\n var up = pawnMoves(1, 0);\n var down = pawnMoves(-1, 0);\n\n var blocked = alert(\"Cannot move to that square\");\n\n var pieceSelected = piece.indexOf(player);\n\n if (pieceSelected === \"whitePawn1\") {\n (move(down) ) {\n blocked;\n } else {\n piece !== null {\n move(down);\n }\n }\n return move;\n\n //console.log(piece.indexOf(player));\n}", "title": "" }, { "docid": "4e1dc4e0fb55a6a29b31c0819d51f23d", "score": "0.65628797", "text": "function player_move_piece(indexcord){\n\tvar temp;\n\tvar board = sync_board(BaseBoard.whitepieces,BaseBoard.blackpieces); // syncing too often but really doesnt matter\n\tif(player_move_piece.selected){\n\t\tif(is_legal_move(board,player_move_piece.selected[0],player_move_piece.selected[1],indexcord) && player_move_piece.selected[1] == true){\n\t\t\tdo_move(BaseBoard,player_move_piece.selected[0],indexcord);\t\t\t\n\t\t\tai_move();\n\t\t\tdraw_all();\n\t\t}\n\t\telse\n\t\t\tdraw_select([indexcord[0] *tile_width, indexcord[1] * tile_height],\"rgba(255, 102, 0, .5)\");\n\t\t\tplayer_move_piece.selected = null;\n\t}\n\telse{\n\t\tdraw_select([indexcord[0] *tile_width, indexcord[1] * tile_height],\"rgba(0, 0, 255, .5)\");\n\t\ttemp = get_piece(indexcord);\n\t\tif(temp[0] == -1) //empty box\n\t\t\treturn;\n\t\tdraw_legal_moves_piece(board,indexcord);\n\t\tplayer_move_piece.selected = temp;\n\t}\n\n}", "title": "" }, { "docid": "7d86a27b4d09a9c46204cff62dbd1628", "score": "0.656141", "text": "function move(i,j,piece) {\n\ti = Number(i);\n\tj = Number(j);\n\tconsole.log(i,j,piece);\n\tif ((piece.charAt(0) == 'b' && isWhite || piece.charAt(0) == 'w' && !isWhite) && !lookupTile(2,i,j).highlighted) {\n\t\treturn;\n\t} else if (lookupTile(2,i,j).highlighted) {\n\t\thandleSpecialMoveCheck(lookupTile(2,currSelectedPiece.i,currSelectedPiece.j),currSelectedPiece.i,currSelectedPiece.j);\n\t\tsocket.emit('move', {from: {x: currSelectedPiece.i, y: currSelectedPiece.j}, to: {x: i, y:j}, upgrade: false});\n\t\tconsole.log( {from: {x: currSelectedPiece.i, y: currSelectedPiece.j}, to: {x: i, y:j}, upgrade: false});\n\t} else if (currSelectedPiece.i == i && currSelectedPiece.j == j) {\n\t\tresetHighlight();\n\t\tcurrSelectedPiece = {i:null, j:null};\n\t} else {\n\t\tresetHighlight();\n\t\tcurrSelectedPiece.i = i;\n\t\tcurrSelectedPiece.j = j;\n\t\tswitch(piece.charAt(1)) {\n\t\t\tcase 'b':\n\t\t\t\thighlightBishop(i,j);\n\t\t\t\tbreak;\n\t\t\tcase 'h':\n\t\t\t\thighlightKnight(i,j);\n\t\t\t\tbreak;\n\t\t\tcase 'k':\n\t\t\t\thighlightKing(i,j);\n\t\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\t\thighlightPawn(i,j);\n\t\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\thighlightQueen(i,j);\n\t\t\t\tbreak;\n\t\t\tcase 'r':\n\t\t\t\thighlightRook(i,j);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "352d10c132c16da7bb86158eda162d05", "score": "0.6519663", "text": "function showMoves(piece) {\n var match = false;\n mustAttack = false;\n if (selectedPiece) {\n erase_roads(selectedPiece);\n }\n selectedPiece = piece;\n var i, j; //used to maintain active pieces\n for (j = 1; j <= 12; j++) {\n if (the_checker[j].id == piece) {\n i = j;\n selectedPieceIndex = j;\n match = true;\n }\n }\n if (moveOne && !attackMoves(moveOne)) {\n changeTurns(moveOne);\n moveOne = undefined;\n return false;\n }\n if (moveOne && moveOne != the_checker[i]) {\n return false;\n }\n //no match is found, happens when it's one player's turn but they click on an opponent's piece\n if (!match) {\n return 0;\n }\n //set edges and movements of the piece that are possible\n //For a red piece\n if (the_checker[i].color == \"red\") {\n tableLimit = 8;\n tableLimitRight = 1;\n tableLimitLeft = 8;\n moveUpRight = 7;\n moveUpLeft = 9;\n moveDownRight = -9;\n moveDownLeft = -7\n }\n //For a black piece\n else {\n tableLimit = 1;\n tableLimitRight = 8;\n tableLimitLeft = 1;\n moveUpRight = -7;\n moveUpLeft = -9;\n moveDownRight = 9;\n moveDownLeft = 7;\n }\n\n //Attack Check\n attackMoves(the_checker[i]); //Check if this piece can attack\n\n //Verify each move, if the piece can/cannot move there\n if (!mustAttack) {\n downLeft = checkMove(the_checker[i], tableLimit, tableLimitRight,\n moveUpRight, downLeft);\n downRight = checkMove(the_checker[i], tableLimit, tableLimitLeft,\n moveUpLeft, downRight);\n //check if piece is a king\n if (the_checker[i].king) {\n upLeft = checkMove(the_checker[i], reverse_tableLimit, tableLimitRight,\n moveDownRight, upLeft);\n upRight = checkMove(the_checker[i], reverse_tableLimit, tableLimitLeft,\n moveDownLeft, upRight);\n }\n }\n if (downLeft || downRight || upLeft || upRight) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "aac99312bc8c7f21d0a8edbce7d89f8d", "score": "0.6405935", "text": "function verticalCheck(pos, color, oldPiecePos, newPiecePos)\n{\n // the square the king is currently on\n pos = parseInt(pos);\n let p = pos;\n var elementCheckResponse;\n\n p = p - 8;\n while(p >= 0)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n p = p - 8;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n // see what piece is on the current square to check\n elementCheckResponse = elementCheck(p, color);\n // if not null, a piece was found on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not a fiendly piece\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"rook\")\n {\n return true;\n }\n }\n break;\n }\n // update value\n p = p - 8;\n }\n // for down\n p = pos;\n p = p + 8;\n while(p < 64)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n p = p + 8;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n // see what piece is on the current square to check\n elementCheckResponse = elementCheck(p, color);\n // if not null, a piece was found on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"rook\")\n {\n return true;\n }\n }\n break;\n }\n p = p + 8;\n }\n return false;\n}", "title": "" }, { "docid": "26d4b8cfea15e5868c89522675d6ba6e", "score": "0.6394952", "text": "function aiChooseAvailSpaceOther() {\n var proceed = true;\n //Makes the AI stay away from the corners if they are not blocking or trying to win in the next round\n if(!$scope.squares.data[0].val) {\n aiMoveSet(0);\n return;\n }\n //Cannot do a break in an Angular foreach, so must do it this way. If game board size changes to large board size, this should be changed to native foreach\n angular.forEach($scope.squares.data, function(item) {\n if(!item.val && proceed) {\n aiMoveSet(item.id);\n proceed = false;\n }\n });\n }", "title": "" }, { "docid": "39697d47197abf58dc3623735fbbf774", "score": "0.63865876", "text": "function whitePawnAttack(selected, el) {\n if ((selected.id - 1) % 8 == 0) { //if a left side pawn\n if ((selected.id - el.id) == 7) {\n move = true;\n return;\n }\n }\n if (selected.id % 8 == 0) { // if a right side pawn\n if ((selected.id - el.id) == 9) {\n move = true;\n return;\n }\n }\n else { //is a center pawn\n if (((selected.id - el.id) == 7 || (selected.id - el.id) == 9)) {\n move = true;\n return;\n }\n }\n}", "title": "" }, { "docid": "2cce464ad7816d45d495eb9ac01ba43c", "score": "0.6376201", "text": "find_enemy_cell() {\n var potential_enemy_x, potential_enemy_y;\n if(this.coords_after[0] == this.coords_before[0])\n potential_enemy_x = this.coords_after[0];\n else if(this.coords_after[0] < this.coords_before[0])\n potential_enemy_x = this.coords_after[0]+1;\n else if(this.coords_after[0] > this.coords_before[0])\n potential_enemy_x = this.coords_after[0]-1;\n\n if(this.coords_after[1] == this.coords_before[1])\n potential_enemy_y = this.coords_after[1];\n else if(this.coords_after[1] < this.coords_before[1])\n potential_enemy_y = this.coords_after[1]+1;\n else if(this.coords_after[1] > this.coords_before[1])\n potential_enemy_y = this.coords_after[1]-1;\n \n if(this.gameMode != this.modeGame.Movie) {\n this.board.delete_from_board([potential_enemy_x, potential_enemy_y]);\n }\n for(var i = 0; i < this.pawns.length; i++)\n {\n if(this.pawns[i].coordinates[0] == potential_enemy_x && this.pawns[i].coordinates[1] == potential_enemy_y) {\n this.selected_pawn = this.pawns[i];\n var coords_animation = [0,0];\n if(this.pawns[i].player == this.player.white_player) {\n var index = null;\n for(var s = 0; s < this.white_eaten_pawns.length; s++) {\n if(this.white_eaten_pawns[s] == this.selected_pawn) {\n index=s+1;\n break;\n }\n }\n if(index==null) {\n this.white_eaten_pawns.push(this.selected_pawn);\n coords_animation = [this.white_eaten_pawns.length, -6];\n } else {\n coords_animation = [index, -6];\n }\n }\n else {\n var index = null;\n for(var s = 0; s < this.black_eaten_pawns.length; s++) {\n if(this.black_eaten_pawns[s] == this.selected_pawn) {\n index=s+1;\n break;\n }\n }\n if(index==null) {\n this.black_eaten_pawns.push(this.selected_pawn);\n coords_animation = [12 - this.black_eaten_pawns.length, 12];\n } else {\n coords_animation = [12 - index, 12];\n }\n }\n this.selected_pawn.setAnimation(coords_animation);\n this.currentState = this.state.pawn_animation;\n break;\n }\n }\n }", "title": "" }, { "docid": "a19467e561d21cff22dfdbaa127c5065", "score": "0.6374263", "text": "function has_moves(cx,cy,board,player){\n var flag = 0;\n if(adjacent_is_different(cx,cy,board,player)){\n for(var x = -1;x<=1;x++){\n for(var y = -1; y<=1;y++){\n for(var moves = 1;;moves++){\n var posx= cx +(moves*x);\n var posy= cy +(moves*y);\n //console.log(\"pos inside has moves-> posx:\"+posx+\",posy:\"+posy);\n //out of bounds\n if(posx <0 || posx > (8-1) || posy <0 || posy > (8-1) || (cx === posx && cy === posy) || moves > 7){flag = 0; break;}\n //finds empty piece in which a piece can be placed and rivals' pieces flip\n if(board[posx][posy] === 0 && flag === 0) break;\n else if(board[posx][posy] === 0 && flag === 1){/*console.log(\"possible cuz x:\"+posx+\",y:\"+posy);*/ return true;}\n //already has piece there(from player playing)\n else if(board[posx][posy] === player && flag === 1) flag = 0;\n //has rival's piece in surrounding square\n else if(board[posx][posy] != player && board[posx][posy] !== 0) flag = 1;\n }\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "6b954797f473a34d2236b0f6be77bbc0", "score": "0.6333067", "text": "function game_over() { // no game over for half moves, insufficient material or threefold repetition\n /* use fila & columna method\n while (!fila_y_columna()) {\n move rook internally to next position and pop that pawn\n but if there's multiple possible pawns, we need to do some DFS/BFS to calculate all possible paths\n if (pawns == 0){\n return true\n }\n return false\n */\n /* or use attacked(color, square) method\n need to read docu on this method\n */\n }", "title": "" }, { "docid": "067aa230c5721c5c544d54aa36cc88c8", "score": "0.6257643", "text": "function pieceWhichAttackTheCase(casePos, colorPiece, newPiece = \"\", newPos = \"\", pieceEsclusion = \"\") {\n var listPieces = findPieces();\n // if a piece is moved\n if (newPiece != \"\") {\n // change virtually the position\n listPieces[newPiece] = newPos;\n }\n\n var flagEchecs = true;\n\n // for all pieces we will check if it attack the case\n for (var key1 in listPieces) {\n\n // if the piece is eat\n if (newPos == listPieces[key1] && newPiece != key1) {\n listPieces[key1] = \"\";\n }\n\n switch (key1.charAt(2)) {\n // if it's a rook\n case \"R\":\n flagEchecs = true;\n var posPieceEchecs = nameCaseToPosition(listPieces[key1]);\n\n // check if the rook is in the same line or column and it's the adverse color\n if ((casePos[0] == posPieceEchecs[0] || casePos[1] == posPieceEchecs[1]) && colorPiece != key1.charAt(0)) {\n // check if a piece is between lastPos and newPos\n for (var key2 in listPieces) {\n var posPieceBetween = nameCaseToPosition(listPieces[key2])\n // if a piece is between lastPos and newPos\n if (((posPieceBetween[1] < posPieceEchecs[1] && posPieceBetween[1] > casePos[1]) ||\n (posPieceBetween[1] > posPieceEchecs[1] && posPieceBetween[1] < casePos[1]) ||\n (posPieceBetween[0] < posPieceEchecs[0] && posPieceBetween[0] > casePos[0]) ||\n (posPieceBetween[0] > posPieceEchecs[0] && posPieceBetween[0] < casePos[0])) &&\n (posPieceBetween[0] == posPieceEchecs[0] ||\n posPieceBetween[1] == posPieceEchecs[1])) {\n flagEchecs = false;\n }\n }\n // if check return the piece which make check\n if (flagEchecs == true) {\n console.log(\"ECHECS\");\n return key1;\n }\n }\n break;\n \n // if it's a knight\n case \"N\":\n var posPieceEchecs = nameCaseToPosition(listPieces[key1]);\n\n var x = (casePos[0] - posPieceEchecs[0]);\n var y = (casePos[1] - posPieceEchecs[1]);\n\n // if the knight attack the case return the pieceId\n if (((Math.abs(x) == 1 && Math.abs(y) == 2) || (Math.abs(x) == 2 && Math.abs(y) == 1)) && colorPiece != key1.charAt(0)) {\n console.log(\"ECHECS\");\n return key1;\n }\n break;\n\n // if it's a bishop\n case \"B\":\n flagEchecs = true;\n var posPieceEchecs = nameCaseToPosition(listPieces[key1]);\n\n var x = (casePos[0] - posPieceEchecs[0]);\n var y = (casePos[1] - posPieceEchecs[1]);\n\n // if the bishop attack the case\n if (Math.abs(x) == Math.abs(y) && colorPiece != key1.charAt(0)) {\n // check if a piece is between lastPos and listPieces\n for (var key2 in listPieces) {\n var posPieceBetween = nameCaseToPosition(listPieces[key2]);\n // if a piece is between lastPos and listPieces\n if (((posPieceBetween[1] < posPieceEchecs[1] && posPieceBetween[1] > casePos[1]) ||\n (posPieceBetween[1] > posPieceEchecs[1] && posPieceBetween[1] < casePos[1]) ||\n (posPieceBetween[0] < posPieceEchecs[0] && posPieceBetween[0] > casePos[0]) ||\n (posPieceBetween[0] > posPieceEchecs[0] && posPieceBetween[0] < casePos[0]))\n && ((Math.abs(posPieceBetween[0] - posPieceEchecs[0]) == Math.abs(posPieceBetween[1] - posPieceEchecs[1]))\n && (Math.abs(posPieceBetween[0] - casePos[0]) == Math.abs(posPieceBetween[1] - casePos[1])))\n ) {\n flagEchecs = false;\n }\n }\n\n // if the bishop attack the case return his id\n if (flagEchecs == true) {\n console.log(\"ECHECS\");\n return key1;\n }\n }\n break;\n \n // if it's a king\n case \"K\":\n // if he is exclude pass to an other piece (use if the king can't eat a piece)\n if (pieceEsclusion == key1)\n break;\n\n var posPieceEchecs = nameCaseToPosition(listPieces[key1]);\n\n var x = (casePos[0] - posPieceEchecs[0]);\n var y = (casePos[1] - posPieceEchecs[1]);\n\n // check if it can move\n if (Math.abs(x) <= 1 && Math.abs(y) <= 1 && colorPiece != key1.charAt(0)) {\n console.log(\"ECHECS\");\n return key1;\n }\n break;\n\n // if it's a queen\n case \"Q\":\n flagEchecs = true;\n var posPieceEchecs = nameCaseToPosition(listPieces[key1]);\n var x = (casePos[0] - posPieceEchecs[0]);\n var y = (casePos[1] - posPieceEchecs[1]);\n\n // check if it can attack moving like rook\n if ((casePos[0] == posPieceEchecs[0] || casePos[1] == posPieceEchecs[1]) && colorPiece != key1.charAt(0)) {\n // check if a piece is between lastPos and newPos\n for (var key2 in listPieces) {\n var posPieceBetween = nameCaseToPosition(listPieces[key2])\n // if a piece is between lastPos and newPos\n if (((posPieceBetween[1] < posPieceEchecs[1] && posPieceBetween[1] > casePos[1]) ||\n (posPieceBetween[1] > posPieceEchecs[1] && posPieceBetween[1] < casePos[1]) ||\n (posPieceBetween[0] < posPieceEchecs[0] && posPieceBetween[0] > casePos[0]) ||\n (posPieceBetween[0] > posPieceEchecs[0] && posPieceBetween[0] < casePos[0])) &&\n (posPieceBetween[0] == posPieceEchecs[0] ||\n posPieceBetween[1] == posPieceEchecs[1])) {\n flagEchecs = false;\n }\n }\n\n if (flagEchecs == true) {\n console.log(\"ECHECS\");\n return key1;\n }\n }\n // check if it can attack like bishop\n else if (Math.abs(x) == Math.abs(y) && colorPiece != key1.charAt(0)) {\n // check if a piece is between lastPos and listPieces\n for (var key2 in listPieces) {\n var posPieceBetween = nameCaseToPosition(listPieces[key2])\n // if a piece is between lastPos and listPieces\n if (((posPieceBetween[1] < posPieceEchecs[1] && posPieceBetween[1] > casePos[1]) ||\n (posPieceBetween[1] > posPieceEchecs[1] && posPieceBetween[1] < casePos[1]) ||\n (posPieceBetween[0] < posPieceEchecs[0] && posPieceBetween[0] > casePos[0]) ||\n (posPieceBetween[0] > posPieceEchecs[0] && posPieceBetween[0] < casePos[0]))\n && ((Math.abs(posPieceBetween[0] - posPieceEchecs[0]) == Math.abs(posPieceBetween[1] - posPieceEchecs[1]))\n && (Math.abs(posPieceBetween[0] - casePos[0]) == Math.abs(posPieceBetween[1] - casePos[1])))\n ) {\n flagEchecs = false;\n }\n }\n\n if (flagEchecs == true) {\n console.log(\"ECHECS\");\n return key1;\n }\n }\n break;\n\n // if it's a pawn\n case \"P\":\n var posPieceEchecs = nameCaseToPosition(listPieces[key1]);\n\n var x = (casePos[0] - posPieceEchecs[0]);\n var y = (casePos[1] - posPieceEchecs[1]);\n\n // check if it can eat\n if (colorPiece != key1.charAt(0) && (x == 1 || x == -1) && (y == 1 || y == -1)) {\n console.log(\"ECHECS\");\n return key1;\n }\n break;\n }\n }\n return false;\n}", "title": "" }, { "docid": "8321d0978992357cbceaae89b2c8ae11", "score": "0.6256154", "text": "function move_up_friendly_pieces(piece)\r\n{\r\n var move_needed = true;\r\n for(var i = 0; i < pieces.length; i++)\r\n {\r\n if(pieces[i].position == 6 && pieces[i].color == piece.color)\r\n {\r\n move_needed = false;\r\n }\r\n }\r\n\r\n if(move_needed == true)\r\n {\r\n for(var i = 0; i < pieces.length; i++)\r\n {\r\n if(pieces[i].position < 6 && pieces[i].color == piece.color)\r\n {\r\n pieces[i].position++;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cb8f4f37ef36aa18e1c8ee4ea33c8901", "score": "0.6252739", "text": "function findenemy() {\n for (var x = 0; x < 3; x++) {\n if ((Unit[x].curtop - 100) === Unit[y].curtop && Unit[x].curleft === Unit[y].curleft) {\n enemyonbottom = Unit[x].type;\n enemyonbottomindex = x;\n }\n if ((Unit[x].curtop - 200) === Unit[y].curtop && Unit[x].curleft === Unit[y].curleft) {\n enemyonbottom2 = Unit[x].type;\n enemyonbottom2index = x;\n }\n }\n //if above\n for (var x = 0; x < 3; x++) {\n if (((Unit[x].curtop + 100) === Unit[y].curtop) && Unit[x].curleft === Unit[y].curleft) {\n enemyontop = Unit[x].type;\n enemyontopindex = x;\n }\n if (((Unit[x].curtop + 200) === Unit[y].curtop) && Unit[x].curleft === Unit[y].curleft) {\n enemyontop2 = Unit[x].type;\n enemyontop2index = x;\n }\n }\n //if right\n for (var x = 0; x < 3; x++) {\n if (((Unit[x].curleft - 100) === Unit[y].curleft) && Unit[x].curtop === Unit[y].curtop) {\n enemyonright = Unit[x].type;\n enemyonrightindex = x;\n }\n if (((Unit[x].curleft - 200) === Unit[y].curleft) && Unit[x].curtop === Unit[y].curtop) {\n enemyonright2 = Unit[x].type;\n enemyonright2index = x;\n }\n //if right\n }\n //if left\n for (var x = 0; x < 3; x++) {\n if (((Unit[x].curleft + 100) === Unit[y].curleft) && Unit[x].curtop === Unit[y].curtop) {\n enemyonleft = Unit[x].type;\n enemyonleftindex = x;\n }\n if (((Unit[x].curleft + 200) === Unit[y].curleft) && Unit[x].curtop === Unit[y].curtop) {\n enemyonleft2 = Unit[x].type;\n enemyonleft2index = x;\n }\n }\n }", "title": "" }, { "docid": "a86f74a16ee26e52cc2cbd2175503ed9", "score": "0.62371624", "text": "function Piece(player) {\n this.go = player.go\n this.player = player\n this.at_home = true\n this.current_node = null\n this.default_colour = player.house.colour\n this.colour = player.house.colour\n this.x = null\n this.y = null\n // The pieces that are stacked along with this one\n this.stacked_with = []\n this.stacked = false\n this.set_current_node = (node) => {\n this.current_node = node\n this.x = this.current_node.x + this.player.go.square_size / 2\n this.y = this.current_node.y + this.player.go.square_size / 2\n this.at_home = false\n }\n\n this.move = () => {\n // Is the movement left enough to exactly reach this square?\n let next = this.current_node\n let does_it_reach_with_d1 = false\n let does_it_reach_with_d2 = false\n\n if ((this.go.dice_1 == 6) || (this.go.dice_2 == 6)) {\n if (!this.go.dice_1_used) {\n Array.from(Array(this.go.dice_1)).forEach((i) => {\n next = next.connected[0]\n })\n does_it_reach_with_d1 = (next == this.go.current_movement_target)\n }\n\n if (!this.go.dice_2_used && !does_it_reach_with_d1) {\n next = this.current_node\n Array.from(Array(this.go.dice_2)).forEach((i) => {\n next = next.connected[0]\n })\n does_it_reach_with_d2 = (next == this.go.current_movement_target)\n }\n }\n if (!does_it_reach_with_d1 && !does_it_reach_with_d2) {\n next = this.current_node\n Array.from(Array(this.go.total_movement_left)).forEach((i) => {\n next = next.connected[0]\n })\n }\n\n // If the end result matches with the clicked target, let's go\n if (next == this.go.current_movement_target) {\n if (does_it_reach_with_d1) {\n this.go.dice_1_used = true\n this.go.total_movement_left -= this.go.dice_1_used\n }\n if (does_it_reach_with_d2) {\n this.go.dice_2_used = true\n this.go.total_movement_left -= this.go.dice_2_used\n }\n // Checking if there is already one of our\n let collided_piece = null\n this.go.players.find((player) => {\n return player.pieces.find((piece) => {\n if (!piece.at_home && !piece.stacked && piece.current_node == next) {\n collided_piece = piece\n return true\n }\n })}\n )\n\n if (collided_piece) {\n collided_piece.stacked_with.push(this)\n let stacked_piece = null\n while(stacked_piece = this.stacked_with.pop()) {\n collided_piece.stacked_with.push(stacked_piece)\n }\n this.stacked = true\n this.at_home = false\n this.current_node = null // Works?\n } else {\n // Changing place and reseting former place's default unselected colour\n this.set_current_node(next)\n }\n // Unselect piece\n this.colour = this.default_colour\n this.go.current_piece_selected = null\n this.go.current_movement_target.colour = this.go.current_movement_target.default_colour\n this.go.current_movement_target = null\n\n // Remove movement from movement pool\n if (this.go.dice_1_used && this.go.dice_2_used) {\n this.go.game_state = \"next_turn\"\n this.go.total_movement_left = null\n }\n } else {\n console.log(\"Can't this.go.there\")\n }\n }\n}", "title": "" }, { "docid": "7b89d00bcdbc5e66aff21c849d10188f", "score": "0.6218817", "text": "function selectPhaseOne(){\n\n /*if(x.num >= y.num && x.num >= z.num){\n let dummy = x;\n return dummy;\n }\n if(y.num >= x.num && y.num >= z.num){\n let dummy = y;\n return dummy;\n }\n if(z.num >= x.num && z.num >= y.num){\n let dummy = z;\n return dummy;\n }*/\n\n let idk = Math.floor(Math.random() * enemyDeck.length);\n\n oppCardOne = enemyDeck[idk];\n david.gotoAndStop(idk);\n\n}", "title": "" }, { "docid": "2eb51d94079d29c97488519d63ea2301", "score": "0.6217409", "text": "function isValid(p) {\n //if this is the first click and the piece isn't empty\n if(p.text() !== \"\" && firstClick){\n return true;\n }\n //if this is the second click and you haven't clicked on\n // the same piece twice\n else if(p.attr(\"id\") !== oldLoc.attr(\"id\") && !firstClick){\n var oldIndex = [parseInt(oldLoc.attr(\"id\").substring(0,1)),\n parseInt(oldLoc.attr(\"id\").substring(1))];\n var newIndex = [parseInt(p.attr(\"id\").substring(0,1)), \n parseInt(p.attr(\"id\").substring(1))];\n var color;\n\n \n\n //If the piece is white\n if(whitePieces.includes(oldLoc.text())){\n //if you're not clicking on a piece of the same color\n if(!whitePieces.includes(p.text())){\n //PIECES\n //|---------------------KING--------------------|\n //if the piece is a king\n if(oldLoc.text() === kingWhite){\n if(Math.abs(oldIndex[0] - newIndex[0]) <= 1 &&\n Math.abs(oldIndex[1] - newIndex[1]) <= 1){\n kingWhiteMoved = true;\n return true;\n }\n //if they try to castle kingside\n if(oldLoc.attr(\"id\") === \"74\" &&\n p.attr(\"id\") === \"76\" &&\n !kingWhiteMoved && !rookA8Moved){\n $(\"#77\").html(\"\");\n $(\"#75\").html(\"♖\");\n kingWhiteMoved = true;\n rookA8Moved = true;\n return true;\n }\n //if they try to castle queenside\n if(oldLoc.attr(\"id\") === \"74\" &&\n p.attr(\"id\") === \"72\" &&\n !kingWhiteMoved && !rookA1Moved){\n $(\"#70\").html(\"\");\n $(\"#73\").html(\"♖\");\n kingWhiteMoved = true;\n rookA1Moved = true;\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|---------------------PAWN--------------------|\n //if the piece is a pawn\n if(oldLoc.text() === pawnWhite){\n //if it is the pawn's first move and\n // they try moving up by either 1 or\n // 2 spots\n if(oldIndex[0]==6 && (newIndex[0]==5 || newIndex[0]==4)&&\n newIndex[1] == oldIndex[1]){\n return true;\n }\n //if the pawn is moving up 1 square\n // and the square is not occupied\n else if(newIndex[0] == oldIndex[0] - 1 &&\n newIndex[1] == oldIndex[1] &&\n p.text() === \"\"){ \n return true;\n }\n //if the pawn is capturing\n else if(newIndex[0] == oldIndex[0] - 1 &&\n (newIndex[1] == oldIndex[1] - 1 ||\n newIndex[1] == oldIndex[1] + 1) &&\n p.text() !== \"\"){\n return true;\n }\n }\n //|---------------------END---------------------|\n\n \n //|-------------------KNIGHT--------------------|\n //If the piece is a knight\n if(oldLoc.text() === knightWhite){\n //If the location is valid\n //Locations to the North of the knight\n if(newIndex[0] == oldIndex[0] - 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the South of the knight\n if(newIndex[0] == oldIndex[0] + 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the East of the knight\n if(newIndex[1] == oldIndex[1] + 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n //Locations to the West of the knight\n if(newIndex[1] == oldIndex[1] - 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n }\n //|---------------------END---------------------|\n \n\n //|---------------------ROOK--------------------|\n //If the piece is a rook\n if(oldLoc.text() === rookWhite){\n //if the new position is in a straight line\n var positionsVert = [];\n var positionsHori = [];\n if(newIndex[0] == oldIndex[0]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the rook's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"70\"){\n rookA1Moved = true;\n }else{\n rookA8Moved = true;\n }\n return true;\n }else if(newIndex[1] == oldIndex[1]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is vertical of the rook's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n });\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"70\"){\n rookA1Moved = true;\n }else{\n rookA8Moved = true;\n }\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|--------------------BISHOP-------------------|\n //if the piece is a bishop\n if(oldLoc.text() === bishopWhite){\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0)){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays depending on their location \n // relative to the original position\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n\n //|--------------------QUEEN--------------------|\n //if the piece is a queen\n if(oldLoc.text() === queenWhite){\n var positionsVert = [];\n var positionsHori = [];\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal,horizontal,or vertical of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0) && \n !(oldIndex[0] == newIndex[0]) &&\n !(oldIndex[1] == newIndex[1])){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the queen's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n //if the id is in the same lane and the \n // new position is vertical of the queen's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n }\n }\n \n //if the piece is black\n else{\n //if you're not clicking on a piece of the same color\n if(blackPieces.includes(p.text())){\n return false;\n }\n if(!blackPieces.includes(p.text())){\n\n //PIECES\n //|---------------------KING--------------------|\n //if the piece is a king\n if(oldLoc.text() === kingBlack){\n if(Math.abs(oldIndex[0] - newIndex[0]) <= 1 &&\n Math.abs(oldIndex[1] - newIndex[1]) <= 1){\n kingBlackMoved = true;\n return true;\n }\n //if they try to castle kingside\n if(oldLoc.attr(\"id\") === \"04\" &&\n p.attr(\"id\") === \"06\" &&\n !kingBlackMoved && !rookH8Moved){\n $(\"#07\").html(\"\");\n $(\"#05\").html(\"♜\");\n kingBlackMoved = true;\n rookH8Moved = true;\n return true;\n }\n //if they try to castle queenside\n if(oldLoc.attr(\"id\") === \"04\" &&\n p.attr(\"id\") === \"02\" &&\n !kingBlackMoved && !rookH1Moved){\n $(\"#00\").html(\"\");\n $(\"#03\").html(\"♜\");\n kingBlackMoved = true;\n rookH1Moved = true;\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|---------------------PAWN--------------------|\n //if the piece is a pawn\n if(oldLoc.text() === pawnBlack){\n //if it is the pawn's first move and\n // they try moving up by either 1 or\n // 2 spots\n if(oldIndex[0]==1 && (newIndex[0]==2 || newIndex[0]==3) &&\n newIndex[1] == oldIndex[1]){\n return true;\n }\n //if the pawn is moving up 1 square\n // and the square is not occupied\n else if(newIndex[0] == oldIndex[0] + 1 &&\n newIndex[1] == oldIndex[1] &&\n p.text() === \"\"){ \n return true;\n }\n //if the pawn is capturing\n else if(newIndex[0] == oldIndex[0] + 1 &&\n (newIndex[1] == oldIndex[1] - 1 ||\n newIndex[1] == oldIndex[1] + 1) &&\n p.text() !== \"\"){\n return true;\n }\n }\n }\n //|---------------------END---------------------|\n\n \n //|-------------------KNIGHT--------------------|\n //If the piece is a knight\n if(oldLoc.text() === knightBlack){\n //If the location is valid\n //Locations to the North of the knight\n if(newIndex[0] == oldIndex[0] - 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the South of the knight\n if(newIndex[0] == oldIndex[0] + 2){\n if(newIndex[1] == oldIndex[1] + 1 ||\n newIndex[1] == oldIndex[1] - 1){\n return true;\n }\n }\n //Locations to the East of the knight\n if(newIndex[1] == oldIndex[1] + 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n //Locations to the West of the knight\n if(newIndex[1] == oldIndex[1] - 2){\n if(newIndex[0] == oldIndex[0] + 1 ||\n newIndex[0] == oldIndex[0] - 1){\n return true;\n }\n }\n }\n //|---------------------END---------------------|\n \n\n //|---------------------ROOK--------------------|\n //If the piece is a rook\n if(oldLoc.text() == rookBlack){\n //if the new position is in a straight line\n var positionsVert = [];\n var positionsHori = [];\n \n if(newIndex[0] == oldIndex[0]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the rook's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"00\"){\n rookH1Moved = true;\n }else{\n rookH8Moved = true;\n }\n return true;\n }else if(newIndex[1] == oldIndex[1]){\n //loop through each grid item\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is vertical of the rook's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n });\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i){\n return false;\n }\n }\n if(oldLoc.attr(\"id\") === \"00\"){\n rookH1Moved = true;\n }else{\n rookH8Moved = true;\n }\n return true;\n }\n }\n //|---------------------END---------------------|\n\n //|--------------------BISHOP-------------------|\n //if the piece is a bishop\n if(oldLoc.text() === bishopBlack){\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0)){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays depending on their location \n // relative to the original position\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n\n //|--------------------QUEEN--------------------|\n //if the piece is a queen\n if(oldLoc.text() === queenBlack){\n var positionsVert = [];\n var positionsHori = [];\n var positionsNW = [];\n var positionsNE = [];\n var positionsSW = [];\n var positionsSE = [];\n //if the new position is not diagonal,horizontal,or vertical of the original\n // position, return false\n if(!(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0) &&\n !(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0) && \n !(oldIndex[0] == newIndex[0]) &&\n !(oldIndex[1] == newIndex[1])){\n return false;\n }\n //loop through each grid item and add them to their\n // respective arrays\n $(\".grid-container\").children().each(function(){\n var id = $(this).attr(\"id\");\n //if the id is in the same lane and the \n // new position is horizontal of the queen's \n // original position\n if(id.substring(0,1) === (oldIndex[0] + \"\")){\n positionsHori.push($(this).text());\n }\n //if the id is in the same lane and the \n // new position is vertical of the queen's \n // original position\n if(id.substring(1) === (oldIndex[1] + \"\")){\n positionsVert.push($(this).text());\n }\n var id = $(this).attr(\"id\");\n var x = parseInt(id.substring(0,1));\n var y = parseInt(id.substring(1));\n //if the id is to the NW of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x > 0){\n positionsNW.push($(this).text());\n }\n //if the id is to the SE of the original position\n if(oldIndex[0] - x == oldIndex[1] - y && oldIndex[0] - x < 0){\n positionsSE.push($(this).text());\n }\n //if the id is to the NE of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x > 0){\n positionsNE.push($(this).text());\n }\n //if the id is to the SW of the original position\n if(oldIndex[0] - x == -1 * (oldIndex[1] - y)\n && oldIndex[0] - x < 0){\n positionsSW.push($(this).text());\n }\n });\n //loop through positionsVert in the WEST direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]-1; i >= 0; i--){\n if(positionsHori[i] !== \"\" && newIndex[1] < i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the East direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[1]+1; i < 8; i++){\n if(positionsHori[i] !== \"\" && newIndex[1] > i && newIndex[0] == oldIndex[0]){\n return false;\n }\n }\n //loop through positionsVert in the NORTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]-1; i >= 0; i--){\n if(positionsVert[i] !== \"\" && newIndex[0] < i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //loop through positionsVert in the SOUTH direction\n // to see if the new index is not a valid position \n for(var i = oldIndex[0]+1; i < 8; i++){\n if(positionsVert[i] !== \"\" && newIndex[0] > i && newIndex[1] == oldIndex[1]){\n return false;\n }\n }\n //if the new position is to the NORTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNW to determine if the new\n // location is valid\n for(var i=positionsNW.length-1, j=oldIndex[0]-1, k=oldIndex[1]-1; i>=0; i--,j--,k--){\n if(positionsNW[i] !== \"\" && newIndex[0] < j && newIndex[1] < k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == oldIndex[1] - newIndex[1]\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSE to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]+1; i<positionsSE.length; i++,j++,k++){\n if(positionsSE[i] !== \"\" && newIndex[0] > j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the NORTHEAST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] > 0){\n //loop through positionsNE to determine if the new\n // location is valid\n for(var i=positionsNE.length-1, j=oldIndex[0]-1, k=oldIndex[1]+1; i>=0; i--,j--,k++){\n if(positionsNE[i] !== \"\" && newIndex[0] < j && newIndex[1] > k){\n return false;\n }\n }\n }\n //if the new position is to the SOUTHWEST\n // of the original position\n if(oldIndex[0] - newIndex[0] == -1 * (oldIndex[1] - newIndex[1])\n && oldIndex[0] - newIndex[0] < 0){\n //loop through positionsSW to determine if the new\n // location is valid\n for(var i=0, j=oldIndex[0]+1, k=oldIndex[1]-1; i<positionsSW.length; i++,j++,k--){\n if(positionsSW[i] !== \"\" && newIndex[0] > j && newIndex[1] < k){\n return false;\n }\n }\n }\n return true;\n }\n //|---------------------END---------------------|\n }\n }\n \n return false;\n }", "title": "" }, { "docid": "2de4924d90d14e9928659ea5bfa731db", "score": "0.61984503", "text": "canMove(squareFrom, squareTo, player=this.player) {\n if(!squareFrom.piece || squareFrom.piece.color !== player) return false\n const indexFrom = this.squares.indexOf(squareFrom)\n const indexTo = this.squares.indexOf(squareTo)\n\n let colDiff = squareTo.col - squareFrom.col\n let rowDiff = squareTo.row - squareFrom.row\n\n let move = this.findValidMove(squareFrom, rowDiff, colDiff)\n\n if(move && move.restricted) {\n const attackingMove = squareTo.piece && squareTo.piece.color !== squareFrom.piece.color\n if(move.nonAttacking && attackingMove) return false\n if(move.attackingOnly && !attackingMove) return false\n return !!move\n }\n\n // check that picece is moving horizontally, vertically or diagonally\n if(![0, -0, 1, -1, Infinity, -Infinity].includes(colDiff / rowDiff)) return false\n\n rowDiff = rowDiff / Math.abs(rowDiff) || 0\n colDiff = colDiff / Math.abs(colDiff) || 0\n\n if(!move || !move.firstMoveOnly) move = this.findValidMove(squareFrom, rowDiff, colDiff)\n\n // firstly check that piece could move from one square to the next\n if(!move || move.restricted) return false\n\n const indexDiff = Math.abs((rowDiff * 8) + colDiff)\n // check that the end square is unoccupied, or occupied with an opposition piece\n return this.pathIsClear(indexFrom, indexTo, indexDiff) &&\n (!squareTo.piece || squareTo.piece.color !== squareFrom.piece.color)\n }", "title": "" }, { "docid": "0f0ca37f304f01d0f49b82354121a834", "score": "0.61978596", "text": "function isSelectableUnit(x,y){\n\tif(board[x][y] == 0) return false;\n\t\n\tvar rank = getSoldierRank(getBoardUnit(board[x][y]));\n\tif ((rank == 10)||(rank==11)) return false;\n\treturn true;\n}", "title": "" }, { "docid": "c39ee6fd40b87adb1be69a6f7e93bc8a", "score": "0.6190045", "text": "function moveOpponentsPiece(move) {\n\n var $opponentPiece;\n\n move.from.x = Math.abs(move.from.x - 7);\n move.from.y = Math.abs(move.from.y - 7);\n move.to.x = Math.abs(move.to.x - 7);\n move.to.y = Math.abs(move.to.y - 7);\n\n\n if (move.color == black) {\n var $opponentsPieces = $('div.piece.dark').each(function(index, piece) {\n var position = $(piece).position();\n var coords = getCoords(position.top, position.left);\n\n if (move.from.x == coords.x && move.from.y == coords.y) {\n $opponentPiece = $(piece);\n currentMove = red;\n }\n });\n } else {\n var $opponentsPieces = $('div.piece.light').each(function(index, piece) {\n var position = $(piece).position();\n var coords = getCoords(position.top, position.left);\n\n if (move.from.x == coords.x && move.from.y == coords.y) {\n $opponentPiece = $(piece);\n currentMove = black;\n }\n });\n }\n\n if (move.isJump) {\n backwardsJump(move);\n }\n\n toggleSelect($opponentPiece);\n var pixels = getPixels(move.to.x, move.to.y);\n movePieceTo($opponentPiece, pixels.top, pixels.left, move);\n createKing($opponentPiece, move.to);\n $opponentPiece.removeClass('selected');\n\n //set the new legal moves\n $('div.square').removeClass('movable');\n getMovableSquares().addClass('movable');\n\n}", "title": "" }, { "docid": "cd49a030cf6f9f051a91120eba797c60", "score": "0.6189054", "text": "function horizontalCheck(pos, color, oldPiecePos, newPiecePos)\n{\n pos = parseInt(pos);\n let p = pos;\n let previous_pos = pos % 8;\n var elementCheckResponse;\n\n // for left\n p = p - 1;\n while(previous_pos != 0)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n previous_pos = p % 8;\n p = p - 1;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n elementCheckResponse = elementCheck(p, color);\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"rook\")\n {\n return true;\n }\n }\n break;\n }\n // get position within row\n previous_pos = p % 8;\n // update value\n p = p - 1;\n }\n // reset values\n // for right\n p = pos;\n previous_pos = pos % 8;\n p = p + 1;\n while(previous_pos != 7)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n previous_pos = p % 8;\n p = p + 1;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"rook\")\n {\n return true;\n }\n }\n break;\n }\n // get position within row\n previous_pos = p % 8;\n p = p + 1;\n }\n return false;\n}", "title": "" }, { "docid": "d33eea5e9c5314dc297d8d44afe6d7f8", "score": "0.61753565", "text": "function checkPuzzlePiece(rowSelected, columnSelected) {\n var r = rowSelected;\n var c = columnSelected;\n if(((r - 1) >= 0) && PUZZLECOORDINATES[r - 1][c] == 0) {\n movePuzzlePiece(r, c, \"up\");\n MOVING.play();\n }\n else if (((r + 1) < ROWS) && PUZZLECOORDINATES[r + 1][c] == 0) {\n movePuzzlePiece(r, c, \"down\");\n MOVING.play();\n }\n else if (((c - 1) >= 0) && PUZZLECOORDINATES[r][c - 1] == 0) {\n movePuzzlePiece(r, c, \"left\");\n MOVING.play();\n }\n else if (((c + 1) < COLUMNS) && PUZZLECOORDINATES[r][c + 1] == 0) {\n movePuzzlePiece(r, c, \"right\");\n MOVING.play();\n }\n checkForMovable();\n getBackground();\n if (ifWon() && MOVES != 1) {\n gameWon();\n }\n MOVES++;\n}", "title": "" }, { "docid": "653d3fc522eecf6fa6bbe29cd55911fe", "score": "0.61691797", "text": "calculateNextDestiny(enemy) {\n // Math.floor(Math.random()*3.9)\n switch (enemy.direction) {\n case 'UP':\n case 0:\n //Si no hay obstaculos en el camino no cambia de ruta. Si en frente tiene un obstaculo calcula aleatoriamente otra dirección\n if (this.scenary.scenaryTiles[enemy.coord.y - 1][enemy.coord.x].isBlocking) {\n enemy.direction = Math.floor(Math.random() * 3.9)\n this.calculateNextDestiny(enemy)\n } else {//No hay obstaculos en su dirección\n enemy.direction = 'UP'\n enemy.destinyPos.y = this.scenary.scenaryTiles[enemy.coord.y - 1][enemy.coord.x].posY\n enemy.coord.y--\n enemy.isDestinyReached = false\n }\n break\n case 'DOWN':\n case 1:\n if (this.scenary.scenaryTiles[enemy.coord.y + 1][enemy.coord.x].isBlocking) {\n enemy.direction = Math.floor(Math.random() * 3.9)\n this.calculateNextDestiny(enemy)\n } else {\n enemy.direction = 'DOWN'\n enemy.destinyPos.y = this.scenary.scenaryTiles[enemy.coord.y + 1][enemy.coord.x].posY\n enemy.coord.y++\n enemy.isDestinyReached = false\n }\n break\n case 'RIGHT':\n case 2:\n if (this.scenary.scenaryTiles[enemy.coord.y][enemy.coord.x + 1].isBlocking) {\n enemy.direction = Math.floor(Math.random() * 3.9)\n this.calculateNextDestiny(enemy)\n } else {\n enemy.direction = 'RIGHT'\n enemy.destinyPos.x = this.scenary.scenaryTiles[enemy.coord.y][enemy.coord.x + 1].posX\n enemy.coord.x++\n enemy.isDestinyReached = false\n }\n break\n case 'LEFT':\n case 3:\n if (this.scenary.scenaryTiles[enemy.coord.y][enemy.coord.x - 1].isBlocking) {\n enemy.direction = Math.floor(Math.random() * 3.9)\n this.calculateNextDestiny(enemy)\n } else {\n enemy.direction = 'LEFT'\n enemy.destinyPos.x = this.scenary.scenaryTiles[enemy.coord.y][enemy.coord.x - 1].posX\n enemy.coord.x--\n enemy.isDestinyReached = false\n }\n break\n }\n }", "title": "" }, { "docid": "34bc7bf842d5dd8261ffcf6a7965887c", "score": "0.6168561", "text": "function knightCheck(pos, color, oldPiecePos, newPiecePos)\n{\n pos = parseInt(pos);\n let p = pos;\n let row_pos = pos % 8;\n let elementCheckResponse;\n\n // for two up, one left\n // if alread at left most column, skip\n if(row_pos > 0)\n {\n p = p - 17;\n if(p >= 0)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // one up, two left\n p = pos;\n if(row_pos > 1)\n {\n p = p - 10;\n if(p >= 0)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // two up, one right\n p = pos;\n if(row_pos < 7)\n {\n p = p - 15;\n if(p >= 0)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // one up, two right\n p = pos;\n if(row_pos < 6)\n {\n p = p - 6;\n if(p >= 0)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // two down, one right\n p = pos;\n if(row_pos < 7)\n {\n p = p + 17;\n if(p < 64)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not frienly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // one down, two right\n p = pos;\n if(row_pos < 6)\n {\n p = p + 10;\n if(p < 64)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // one down, two left\n p = pos;\n if(row_pos > 1)\n {\n p = p + 6;\n if(p < 64)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n // two, one left\n p = pos;\n if(row_pos > 0)\n {\n p = p + 15;\n if(p < 64)\n {\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"knight\")\n {\n return true;\n }\n }\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "288fd8cb65c49e3ee9c165f19e0b40a8", "score": "0.61662835", "text": "function selectedTile(event,validity) {\n // var currentPlayer;\n const pos = {\n x: event.clientX,\n y: event.clientY\n };\n selectedPiece = \"none\";\n if (currentPlayer==\"red\") {\n if (tile(pos, redTile1Positions)) {\n if (validity.tile1==true) {\n selectedPiece = \"redTile1\";\n }\n } else if (tile(pos, redTile2Positions)) {\n if (validity.tile2==true) {\n selectedPiece = \"redTile2\";\n }\n } else if (tile(pos, redTile3Positions)) {\n if (validity.tile3==true) {\n selectedPiece = \"redTile3\";\n }\n } else if (tile(pos, redTile4Positions)) {\n if (validity.tile4==true) {\n selectedPiece = \"redTile4\";\n }\n }\n } else if (currentPlayer==\"green\") {\n if (tile(pos, greenTile1Positions)) {\n if (validity.tile1==true) {\n selectedPiece = \"greenTile1\";\n }\n } else if (tile(pos, greenTile2Positions)) {\n if (validity.tile2==true) {\n selectedPiece = \"greenTile2\";\n }\n } else if (tile(pos, greenTile3Positions)) {\n if (validity.tile3==true) {\n selectedPiece = \"greenTile3\";\n }\n } else if (tile(pos, greenTile4Positions)) {\n if (validity.tile4==true) {\n selectedPiece = \"greenTile4\";\n }\n }\n } else if (currentPlayer==\"yellow\") {\n if (tile(pos, yellowTile1Positions)) {\n if (validity.tile1==true) {\n selectedPiece = \"yellowTile1\";\n }\n } else if (tile(pos, yellowTile2Positions)) {\n if (validity.tile2==true) {\n selectedPiece = \"yellowTile2\";\n }\n } else if (tile(pos, yellowTile3Positions)) {\n if (validity.tile3==true) {\n selectedPiece = \"yellowTile3\";\n }\n } else if (tile(pos, yellowTile4Positions)) {\n if (validity.tile4==true) {\n selectedPiece = \"yellowTile4\";\n }\n }\n } else if (currentPlayer==\"blue\") {\n if (tile(pos, blueTile1Positions)) {\n if (validity.tile1==true) {\n selectedPiece = \"blueTile1\";\n }\n } else if (tile(pos, blueTile2Positions)) {\n if (validity.tile2==true) {\n selectedPiece = \"blueTile2\";\n }\n } else if (tile(pos, blueTile3Positions)) {\n if (validity.tile3==true) {\n selectedPiece = \"blueTile3\";\n }\n } else if (tile(pos, blueTile4Positions)) {\n if (validity.tile4==true) {\n selectedPiece = \"blueTile4\";\n }\n }\n }\n // return selectedPiece;\n}", "title": "" }, { "docid": "cf138888decd769c423ff3e9eaf96c45", "score": "0.6162378", "text": "function knock(piece)\r\n{\r\n var index = 6;\r\n var done_flag = false;\r\n while(done_flag == false)\r\n {\r\n var occupied = false;\r\n for(var i = 0; i < pieces.length; i++)\r\n {\r\n if(pieces[i].position == index && pieces[i].color == piece.color)\r\n {\r\n occupied = true;\r\n }\r\n }\r\n if (occupied == false)\r\n {\r\n piece.position = index;\r\n done_flag = true;\r\n }\r\n else\r\n {\r\n index--;\r\n }\r\n }\r\n \r\n}", "title": "" }, { "docid": "1c1c794277835b96ec5c93e0df1b9808", "score": "0.61616", "text": "function tryToMoveBlue(piece, x, y) {\n // regula pt mutare pe diagonala player 2 (blue) cand NU captureaza piesa adversarului\n if (piece.piece == 2) {\n if (piece.x - 1 == x && (piece.y - 1 == y || piece.y + 1 == y)) {\n\n movePiece2(piece, x, y);\n\n // regula pt mutare pe diagonala player 2 (blue) cand captureaza piesa adversarului\n } else if (piece.x - 2 == x) {\n var opozitePiece = findPiece(x + 1, y - (y - piece.y) / 2);\n if (opozitePiece && opozitePiece.piece != piece.piece) {\n removePiece(opozitePiece);\n movePiece2(piece, x, y);\n }\n\n }\n // regula cand piesa player 2 (blue) devine king\n if (piece.piece == 2 && (piece.x - 1 == 1 || piece.x - 2 == 1)) {\n piece.piece = 4;\n\n }\n // logica jocului cand piesa devine king red (UK version not US)\n\n } else if (piece.piece == 4) {\n\n // regula pt mutare pe diagonala player 2 (blue) piesa King cand Nu captureaza piesa adversarului\n if ((piece.x - 1 == x || piece.x + 1 == x) && (piece.y - 1 == y || piece.y + 1 == y)) {\n movePiece2(piece, x, y);\n\n // regula pt mutare pe diagonala player 2 (blue) piesa King cand captureaza piesa adversarului\n } else if (piece.x - 2 == x) {\n var opozitePiece = findPiece(x + 1, y - (y - piece.y) / 2);\n if (opozitePiece && (opozitePiece.piece != 2 && opozitePiece.piece != piece.piece)) {\n removePiece(opozitePiece);\n movePiece2(piece, x, y);\n }\n } else if (piece.x + 2 == x) {\n var opozitePiece = findPiece(x - 1, y - (y - piece.y) / 2);\n if (opozitePiece && (opozitePiece.piece != 2 && opozitePiece.piece != piece.piece)) {\n removePiece(opozitePiece);\n movePiece2(piece, x, y);\n }\n } winer();\n\n }\n}", "title": "" }, { "docid": "cd5af41fbbd986573ae3e79564978f02", "score": "0.61559653", "text": "move(player, y, x){\r\n if (this.get(y, x) === null || this.get(y, x).occupied !== null){ // If space doesn't exist or is occupied, stop\r\n return false;\r\n } else{\r\n this.get(player.plocation.y, player.plocation.x).occupied = null;\r\n player.plocation = this.get(y, x);\r\n this.get(y, x).occupied = player;\r\n\r\n if ([0, 1, 2].includes(player.plocation.token)){\r\n player.cuedTokens.push(player.plocation.token);\r\n this.tokens.push(player.plocation.token);\r\n player.plocation.token = -1;\r\n }\r\n\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "2be4634bd19b8e0daa4811ffd8cc634b", "score": "0.61554486", "text": "handleAttack(attack_index, defend_index, enemy) { /* maybe modify so that its enemy ? */\n const squares = this.state.squares.slice();\n const game = this.state.game.slice();\n const visibility_arr = this.state.visibility_arr.slice();\n\n let winner = helper.comparePieceValues(squares, attack_index, defend_index);\n let attacking_piece;\n let defending_piece;\n let team = (enemy === 'P') ? 'C' : 'P';\n if (this.state.current_piece) {\n attacking_piece = this.state.current_piece;\n defending_piece = squares[defend_index];\n } else {\n attacking_piece = squares[attack_index];\n defending_piece = squares[defend_index];\n }\n\n game[attack_index] = null;\n squares[attack_index] = null;\n\n if (winner < 0) {\n this.addToLog('Both pieces [' + defending_piece + '] from cell ' + defend_index + ' removed from the board')\n visibility_arr[defend_index] = false;\n game[defend_index] = null;\n squares[defend_index] = null;\n this.handleDecrementPieceCount(attacking_piece, enemy);\n this.handleDecrementPieceCount(defending_piece, team);\n } else {\n visibility_arr[defend_index] = true; // attacker or defender is revealed\n visibility_arr[attack_index] = false; // attacker piece is now empty \n\n if (winner === defend_index) {\n //defender won\n if (team === 'P') {\n this.addToLog('Computer defended cell ' + defend_index + ' with [' +\n defending_piece + '] and captured the Player\\'s [' + attacking_piece + ']'\n );\n this.handleDecrementPieceCount(attacking_piece, 'P');\n } else {\n this.addToLog('Player defended cell ' + defend_index + ' with [' +\n defending_piece + '] and captured the Computer\\'s [' + attacking_piece + ']'\n );\n this.handleDecrementPieceCount(attacking_piece, 'C');\n }\n } else {\n //attacker won\n if (team === 'P') {\n this.addToLog('Player attacked cell ' + defend_index + ' with [' +\n attacking_piece + '] and captured the Computer\\'s [' + defending_piece + ']'\n );\n game[defend_index] = 'P';\n this.handleDecrementPieceCount(defending_piece, 'C');\n } else {\n this.addToLog('Computer attacked cell ' + defend_index + ' with [' +\n attacking_piece + '] and captured the Player\\'s [' + defending_piece + ']'\n );\n game[defend_index] = 'C';\n this.handleDecrementPieceCount(defending_piece, 'P');\n }\n squares[defend_index] = attacking_piece;\n }\n }\n this.setState({\n squares: squares,\n game: game,\n visibility_arr: visibility_arr,\n });\n }", "title": "" }, { "docid": "36bd737eb5ed01b9c90886113a9941f5", "score": "0.615417", "text": "function isValidBishop(row,col) {\n var distance = abs(col-selected_piece.xPos);\n\n if (abs(row-selected_piece.yPos) != abs(col-selected_piece.xPos)) {\n\n return 0;\n\n } else if (distance == 1) {\n return 1;\n\n\n } else { // checking for pieces in the way. you can't go through someone\n var ycounter = 0;\n var xcounter = 0;\n var counter = 0;\n\n // loops through all the spots between where the piece is and where it\n // wants to go, checking to see if anyone is there, blocking the path\n while (counter < distance-1) {\n // these if else branches increment the ycounter and xcounter in a way\n // that all the spots in between will be checked\n if ((col-selected_piece.xPos < 0) && (row-selected_piece.yPos > 0)) {\n ycounter++; // player is moving down left\n xcounter--;\n } else if ((col-selected_piece.xPos < 0) && (row-selected_piece.yPos) < 0) {\n ycounter--; // player is movign up left\n xcounter--;\n } else if ((col-selected_piece.xPos > 0) && (row-selected_piece.yPos) < 0) {\n ycounter--;\n xcounter++;\n } else if ((col-selected_piece.xPos > 0) && (row-selected_piece.yPos > 0)) {\n ycounter++;\n xcounter++;\n }\n\n // checks to see if a piece is in a spot in the way counters are incremmented above to check correct spots\n if ( gameBoard[selected_piece.yPos+ycounter][selected_piece.xPos+xcounter] != 0) {\n\n return 0;\n }// of small if\n counter++;\n }// of while loop\n return 1; // means none of the bad conditons were met so proceed\n } // of giant if\n}// of function isValidBishop", "title": "" }, { "docid": "708227b6fba152958d95efa7b2e91cad", "score": "0.6139256", "text": "function aiChooseAvailSpaceMiddleFirst() {\n var proceed = true;\n //Makes the AI stay away from the corners if they are not blocking or trying to win in the next round\n if(!$scope.squares.data[1].val) {\n aiMoveSet(1);\n return;\n }\n else if(!$scope.squares.data[3].val) {\n aiMoveSet(3);\n return;\n }\n else if(!$scope.squares.data[5].val) {\n aiMoveSet(5);\n return;\n }\n else if(!$scope.squares.data[7].val) {\n aiMoveSet(7);\n return;\n }\n //Cannot do a break in an Angular foreach, so must do it this way. If game board size changes to large board size, this should be changed to native foreach\n angular.forEach($scope.squares.data, function(item) {\n if(!item.val && proceed) {\n aiMoveSet(item.id);\n proceed = false;\n }\n });\n }", "title": "" }, { "docid": "4527081147aa2290bca853fe6d13ef80", "score": "0.6133113", "text": "checkInter(s) {\n return ((s.pos.x < this.right && s.pos.x > this.left && s.pos.y > this.top && s.pos.y < this.bottom) && !s.goal);\n }", "title": "" }, { "docid": "833d3b8df92a7471b85e207e13df9991", "score": "0.61252505", "text": "function checkMove(){\r\n\tif(supplies[OXEN] <= 0) {alert(\"You have no oxen to pull your wagon!\"); return 0;}\r\n\telse if(brokenPart == WHEEL) {alert(\"Your wagon cannot move with a broken wheel!\"); return 0;}\r\n\telse if(brokenPart == AXLE) {alert(\"Your wagon cannot move with a broken axle!\"); return 0;}\r\n\telse if(brokenPart == TONGUE) {alert(\"Your wagon cannot move with a broken tongue!\"); return 0;}\r\n\treturn 1;\r\n}", "title": "" }, { "docid": "ba1be77657211fa0d49a5ae22f22cf04", "score": "0.6107306", "text": "function legalMove(startx,starty,newx,newy,piece,movePiece){\n\t\t// check if they're trying to move off the board\n\t\tif (newx<0 || newx>16 || newy<0 || newy>16){\n\t\t\trender();\n\t\t\t$('#log').text('Can not move piece off the board');\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if they're trying to move too far or diagonally\n\t\tif (Math.abs(newx-startx)>0 && Math.abs(newy-starty)>0){\n\t\t\trender();\n\t\t\t$('#log').text('You cannot move diagonally');\n\t\t\treturn false;\n\t\t}\n\t\telse if (Math.abs(newx-startx)>4 || Math.abs(newy-starty)>4) {\n\t\t\trender();\n\t\t\t$('#log').text('You can not move that far');\n\t\t\treturn false;\n\t\t}\n\n\n\t\t// check to see if it was a jump and if so what piece was jumped\n\t\t// value of -1 means no jump was made\n\t\tvar jumpPiece = jumped(startx,starty,newx,newy,piece);\n\n\t\t// if no jump then you can only move 1\n\t\tif (jumpPiece==-1 && Math.abs(newx-startx)+Math.abs(newy-starty)>2){\n\t\t\trender();\n\t\t\t$('#log').text('You can not move that far');\n\t\t\treturn false;\t\t\t\n\t\t}\n\n\t\t// if you've jumped you must move 2 (not coded as not necessary)\n\n\t\t// else it's a legal move\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\n\t}", "title": "" }, { "docid": "29ec744c2bc59932edb962a31e12c345", "score": "0.6104421", "text": "function checkIfValidMove(oldId, newId)\r\n{ \r\n var notValidMove = 0\r\n var isValidMove = 1\r\n var isValidJump = 2\r\n\r\n var newCoordX = newId[4]\r\n var newCoordY = newId[5]\r\n var oldCoordX = oldId[4]\r\n var oldCoordY = oldId[5]\r\n\r\n\r\n if(piecesArray[newCoordX][newCoordY] == null)\r\n {\r\n //Jump function checking\r\n if((Math.abs(oldCoordX-newCoordX) == 2 ) && (Math.abs(oldCoordY-newCoordY) == 2))\r\n { \r\n findMiddleTile(oldId, newId)\r\n if((piecesArray[middleTileX][middleTileY] == (playerColorTurn == \"r\"?\"b\":\"r\")) || (piecesArray[middleTileX][middleTileY] == (playerColorTurn == \"r\"?\"b\":\"r\") + \"k\")) //If opposite piece\r\n {\r\n if((piecesArray[oldCoordX][oldCoordY].length == 2) || (hasAnotherJump))\r\n return isValidJump\r\n if((piecesArray[oldCoordX][oldCoordY] == \"r\")&&(oldCoordX - newCoordX == 2))\r\n return isValidJump\r\n if((piecesArray[oldCoordX][oldCoordY] == \"b\")&&(newCoordX - oldCoordX == 2))\r\n return isValidJump\r\n }\r\n }\r\n \r\n //Regular move checking\r\n if((Math.abs(oldCoordX-newCoordX) == 1 ) && (Math.abs(oldCoordY-newCoordY) == 1))\r\n { \r\n //If piece is king\r\n if(piecesArray[oldCoordX][oldCoordY].length == 2)\r\n return isValidMove\r\n //If piece is regular piece\r\n if(piecesArray[oldCoordX][oldCoordY].length == 1)\r\n {\r\n if((piecesArray[oldCoordX][oldCoordY] == \"r\")&&(oldCoordX - newCoordX == 1))\r\n return isValidMove\r\n \r\n if((piecesArray[oldCoordX][oldCoordY] == \"b\")&&(newCoordX - oldCoordX == 1))\r\n return isValidMove\r\n }\r\n }\r\n }\r\n return notValidMove\r\n}", "title": "" }, { "docid": "29a8173d8d65e48d66b5f0a616bc5a7b", "score": "0.6095043", "text": "function possibleSubMoves(piece, testLocal) {\n if(!piece) return [];\n var xOffsets;\n var yOffsets;\n if (piece.isKing){\n xOffsets = [1,1,-1,-1];\n yOffsets = [1,-1,1,-1];\n } else if (piece.isAlly) {\n xOffsets = [1,-1];\n yOffsets = [-1,-1];\n } else if (!piece.isAlly) {\n xOffsets = [1,-1];\n yOffsets = [1,1];\n }\n var moves = [];\n for (var i = 0; i < xOffsets.length; i++){\n var m = new Move();\n m.captures = false;\n m.isFinal = true;\n m.srcX = piece.x;\n m.srcY = piece.y;\n m.destX = piece.x + xOffsets[i];\n m.destY = piece.y + yOffsets[i];\n\n if (!isValid(m.destX,m.destY)) continue;\n\n if (g.moveHistory.length > 0 || g.board[m.destX][m.destY]){\n if (!g.board[m.destX][m.destY]) continue;\n var lastMove = g.moveHistory[g.moveHistory.length-1];\n\n m.captures = g.board[m.destX][m.destY].isAlly !== piece.isAlly;\n m.destX += xOffsets[i];\n m.destY += yOffsets[i];\n\n if (lastMove && lastMove.srcX === m.destX && lastMove.srcY === m.destY) continue;\n if (!isValid(m.destX,m.destY) || g.board[m.destX][m.destY]) continue;\n // Check if next state has valid moves\n if (!testLocal) {\n var isKing = piece.isKing;\n var srcPt = {x: piece.x, y: piece.y};\n var destPt = {x: m.destX, y: m.destY};\n movePiece(srcPt, destPt);\n g.moveHistory.push(m);\n piece.isKing = isKing;\n m.isFinal = (possibleSubMoves(piece, true).length === 0);\n g.moveHistory.pop();\n movePiece(destPt, srcPt);\n } else {\n m.isFinal = false;\n }\n\n\n }\n\n if (_.where(g.moveHistory, m).length === 0){\n moves.push(m);\n }\n }\n return moves;\n }", "title": "" }, { "docid": "64b31a72dae4ac0a401b6bebdff39753", "score": "0.60720915", "text": "function AIfindNextBestMove(row, col)\n {\n //Check if row is less than 3 to avoid going upwards when only space for 3\n if(row < 3 && grid[row+1][col] == '')\n {\n aiCol = col;\n freeSpace = true;\n return true;\n }\n else if(grid[row][col-1] == '' && grid[row-1][col-1] != '')\n {\n aiCol = col - 1;\n freeSpace = true;\n return true;\n }\n else if(grid[row][col+1] == '' && grid[row-1][col+1] != '')\n {\n aiCol = col + 1;\n freeSpace = true;\n return true;\n }\n else if(grid[row+1][col-1] == '' && grid[row][col-1] != '')\n {\n aiCol = col - 1;\n freeSpace = true;\n return true;\n }\n else if(grid[row+1][col+1] == '' && grid[row][col+1] != '')\n {\n aiCol = col + 1;\n freeSpace = true;\n return true;\n }\n else if(row > 0 && grid[row-1][col+1] == '')\n {\n aiCol = col + 1;\n freeSpace = true;\n return true;\n }\n else if(row > 0 && grid[row-1][col-1] == '')\n {\n aiCol = col + 1;\n freeSpace = true;\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "902f93b50907cbf3ad429ac5872e87a8", "score": "0.6072064", "text": "saveMoveChoice(selectedChess, enemyGroup, previousX, previousY) {\n enemyGroup.getChildren().forEach(enemy => {\n this.GRULocation.push(enemy.getPositionX());\n this.GRULocation.push(enemy.getPositionY());\n\n /*\n Calculate the winning probability (Survivability) of the selected chess against enemy\n Factors that affect the probability:\n 1. Current health of selected chess\n 2. Current health of enemy\n 3. Damage taken by selected chess if encounters enemy\n 4. Damage deal to enemy\n */\n\n let damageDeal = selectedChess.getAttack() - enemy.getDefense();\n if (damageDeal <= 0) {\n damageDeal = 1;\n }\n let damageTaken = enemy.getAttack() - selectedChess.getDefense();\n if (damageTaken <= 0) {\n damageTaken = 1;\n }\n let roundToKill = Math.ceil(enemy.getHealth() / damageDeal);\n let roundToDeath = Math.ceil(selectedChess.getHealth() / damageTaken);\n this.roundToKill_2.push(roundToKill);\n this.roundToDeath_2.push(roundToDeath);\n })\n this.GRULocation.push(previousX);\n this.GRULocation.push(previousY);\n this.GRULocation.push(selectedChess.getPositionX());\n this.GRULocation.push(selectedChess.getPositionY());\n }", "title": "" }, { "docid": "e8cb471d74c77170fd13b14d16f0502e", "score": "0.60717905", "text": "function SqAttacked (sq, side)\n{\t\n\t//pawn attack\n\tif (side == COLORS.WHITE)\n\t{\n\t\t//diagonals move by 9 and 11 in the 12x10 board\n\t\tif (GameBoard.pieces[sq - 11] == PIECES.wP || GameBoard.pieces[sq - 9] == PIECES.wP)\n\t\t{\n\t\t\treturn BOOL.TRUE;\n\t\t}\n\t}\n\telse \n\t{\n\t\t//diagonals move by 9 and 11 in the 12x10 board\n\t\tif (GameBoard.pieces[sq + 11] == PIECES.bP || GameBoard.pieces[sq + 9] == PIECES.bP)\n\t\t{\n\t\t\treturn BOOL.TRUE;\n\t\t}\n\t}\n\t\n\t//Looping through various knight directions\n\tfor (let i = 0; i < KnDir.length; i++)\n\t{\n\t\tlet piece = GameBoard.pieces[sq + KnDir[i]];\n\t\tif (piece != SQUARES.OFFBOARD && PieceCol[piece] == side && PieceKnight[piece] == BOOL.TRUE)\n\t\t{\n\t\t\treturn BOOL.TRUE;\n\t\t}\n\t}\n\t\n\t//Looping through four directions of rooks\n\tfor (let i = 0; i < 4; i++)\n\t{\n\t\tlet t_sq = sq + RkDir[i];\n\t\tlet piece = GameBoard.pieces[t_sq];\n\t\t//loop until we go off the board\n\t\twhile (piece != SQUARES.OFFBOARD)\n\t\t{\n\t\t\t//break out of the loop if we run into a piece\n\t\t\tif (piece != PIECES.EMPTY)\n\t\t\t{\n\t\t\t\t//Returns true if there is a rook or queen horizontally / vertically\n\t\t\t\t//Breaks if wrong color\n\t\t\t\tif (PieceRookQueen[piece] == BOOL.TRUE && PieceCol[piece] == side)\n\t\t\t\t{\n\t\t\t\t\treturn BOOL.TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tt_sq += RkDir[i];\n\t\t\tpiece = GameBoard.pieces[t_sq];\n\t\t}\n\t}\n\t\n\t//Looping through four directions of bishops\n\tfor (let i = 0; i < 4; i++)\n\t{\n\t\tlet t_sq = sq + BiDir[i];\n\t\tlet piece = GameBoard.pieces[t_sq];\n\t\t//loop until we go off the board\n\t\twhile (piece != SQUARES.OFFBOARD)\n\t\t{\n\t\t\t//break out of the loop if we run into a piece\n\t\t\tif (piece != PIECES.EMPTY)\n\t\t\t{\n\t\t\t\t//Returns true if there is a bishop or queen diagonally\n\t\t\t\t//Breaks if wrong color\n\t\t\t\tif (PieceBishopQueen[piece] == BOOL.TRUE && PieceCol[piece] == side)\n\t\t\t\t{\n\t\t\t\t\treturn BOOL.TRUE;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tt_sq += BiDir[i];\n\t\t\tpiece = GameBoard.pieces[t_sq];\n\t\t}\n\t}\n\t\n\t//Looping through various king directions\n\tfor (let i = 0; i < KiDir.length; i++)\n\t{\n\t\tlet piece = GameBoard.pieces[sq + KiDir[i]];\n\t\tif (piece != SQUARES.OFFBOARD && PieceCol[piece] == side && PieceKing[piece] == BOOL.TRUE)\n\t\t{\n\t\t\treturn BOOL.TRUE;\n\t\t}\n\t}\n\t\n\treturn BOOL.FALSE;\n}", "title": "" }, { "docid": "2b3fc05e3f13b9e956d86b7de7d8fa04", "score": "0.6065349", "text": "playerInCheck() {\n // get all the opponent's pieces\n const opponentSquares = this.squares.reduce((squares, square) => {\n if(square.piece && square.piece.color !== this.player) return squares.concat(square)\n return squares\n }, [])\n\n // find the king\n const kingSquare = this.squares.find(square => {\n return square.piece instanceof King && square.piece.color === this.player\n })\n\n // check if any of the pieces can move to the king's square\n return opponentSquares.some(square => {\n return this.canMove(square, kingSquare, square.piece.color)\n })\n }", "title": "" }, { "docid": "01b4832cdff797bd3ebbf8a0f983e0d7", "score": "0.6064582", "text": "function nextMove(moveType) //\"a\"=offense; \"d\"=defense\r\n{\r\n $playChecker=0;\r\n $checkPlayer = (moveType == \"a\") ? $cpu : $human; //check for attack or block\r\n\r\n var nextMoveArray=null;\r\n nextMoveArray=new Array();\r\n\r\n //scan win scenarios\r\n for($g=0;$g<winScenarios.length;$g++)\r\n {\r\n\r\n var checkScenario=winScenarios[$g].split(\",\");\r\n\r\n //alert(checkScenario[0]);\r\n\r\n $p1=\"#cell\"+checkScenario[0];\r\n $p2=\"#cell\"+checkScenario[1];\r\n $p3=\"#cell\"+checkScenario[2];\r\n\r\n if($($p1).text()==$checkPlayer && ($($p2).text()==\"\" || $($p3).text()==\"\"))\r\n {\r\n $captureCell = ($($p2).text()==\"\") ? checkScenario[2] : checkScenario[1];\r\n $playChecker++;\r\n }\r\n\r\n if($($p2).text()==$checkPlayer && ($($p1).text()==\"\" || $($p3).text()==\"\"))\r\n {\r\n $captureCell = ($($p1).text()==\"\") ? checkScenario[0] : checkScenario[2];\r\n $playChecker++;\r\n }\r\n\r\n if($($p3).text()==$checkPlayer && ($($p2).text()==\"\" || $($p1).text()==\"\"))\r\n {\r\n $captureCell = ($($p2).text()==\"\") ? checkScenario[1] : checkScenario[0];\r\n $playChecker++;\r\n }\r\n\r\n if($playChecker==2)\r\n {\r\n nextMoveArray.push($captureCell);\r\n }\r\n\r\n $playChecker=0;\r\n }\r\n\r\n if(nextMoveArray && nextMoveArray.length>0)\r\n {\r\n return nextMoveArray;\r\n }else\r\n {\r\n return \"na\";\r\n }\r\n}", "title": "" }, { "docid": "0be579994caf39428f9154f5b0e8f30c", "score": "0.60612375", "text": "function showPossibleMoves() {\r\n var cellElement = selectedPiece.parentElement;\r\n var cellId = cellElement.getAttribute(\"id\");\r\n var cellIdSplit = cellId.split(\"-\");\r\n\r\n var currentRow = parseInt(cellIdSplit[1]);\r\n var currentColumn = parseInt(cellIdSplit[2]);\r\n\r\n var coordChecks = [[-1, -1], [-1, 1], [1, -1], [1, 1]];\r\n var enemyChecks = [[-2, -2], [-2, 2], [2, -2], [2, 2]];\r\n for(var i = 0; i < coordChecks.length; i++) {\r\n var coord = coordChecks[i];\r\n var xChange = coord[0];\r\n var yChange = coord[1];\r\n\r\n var rowToCheck = (currentRow + yChange);\r\n if(rowToCheck < 1 || rowToCheck > 8) continue;\r\n\r\n var columnToCheck = (currentColumn + xChange);\r\n if(columnToCheck < 1 || columnToCheck > 8) continue;\r\n\r\n var cellToCheckId = (\"cell-\" + rowToCheck + \"-\" + columnToCheck);\r\n if(isEnemy(getMan(cellToCheckId))) {\r\n var jumpCoord = enemyChecks[i];\r\n var xJump = jumpCoord[0];\r\n var yJump = jumpCoord[1];\r\n\r\n rowToCheck = (currentRow + yJump);\r\n if(rowToCheck < 1 || rowToCheck > 8) continue;\r\n \r\n columnToCheck = (currentColumn + xJump);\r\n if(columnToCheck < 1 || columnToCheck > 8) continue;\r\n cellToCheckId = (\"cell-\" + rowToCheck + \"-\" + columnToCheck);\r\n }\r\n\r\n if(isPossibleMove(rowToCheck, columnToCheck)) {\r\n var cellToCheckElement = document.getElementById(cellToCheckId);\r\n cellToCheckElement.classList.add(\"possible\");\r\n console.log(\"Moving [\" + currentRow + \", \" + currentColumn + \"] to [\" + rowToCheck + \", \" + columnToCheck + \"] is possible.\");\r\n } else {\r\n console.log(\"Moving [\" + currentRow + \", \" + currentColumn + \"] to [\" + rowToCheck + \", \" + columnToCheck + \"] is NOT possible!\");\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0bed59520489d5570258062a020161b4", "score": "0.6058825", "text": "function pieceClick(){\r\n var piece;\r\n //Loop through all puzzle pieces \r\n for(var i = 0;i < pieces.length;i++){\r\n piece = pieces[i];\r\n //Determine if the click was within the bounds of any of our objects\r\n if(cursor.x < piece.xPos || cursor.x > (piece.xPos + widthPiece) || cursor.y < piece.yPos || cursor.y > (piece.yPos + heightPiece)){\r\n //PIECE NOT HIT\r\n }\r\n else{\r\n return piece;\r\n }\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "70545cf960e15c410c1093404e023b82", "score": "0.6058781", "text": "function findMoveableSquares() {\n\t\tvar moveAble = document.querySelectorAll('.canmove');\n\t\tfor (var i = 0; i < moveAble.length; i++) {\t\n\t\t\tmoveAble[i].classList.remove('canmove');\n\t\t}\n\t\tvar eligibleX = [EMPTY_X, EMPTY_X + 1, EMPTY_X - 1];\n\t\tvar eligibleY = [EMPTY_Y, EMPTY_Y + 1, EMPTY_Y - 1];\n\t\tfor (var i = 0; i < eligibleX.length; i++) {\n\t\t\tvar row = eligibleX[i];\n\t\t\tif(row >= 0 && row <= 3) {\n\t\t\t\tfor(var j = 0; j < eligibleY.length; j++) {\n\t\t\t\t\tvar col = eligibleY[j];\n\t\t\t\t\tif((col >= 0 && col <= 3) && (col == EMPTY_Y && row != EMPTY_X || col != EMPTY_Y && row == EMPTY_X)) {\n\t\t\t\t\t\tvar eligiblePiece = \"square_\" + row + \"_\" + col;\n\t\t\t\t\t\tdocument.getElementById(eligiblePiece).classList.add('canmove');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "title": "" }, { "docid": "d6b71f050a2cae4d2061b8d948f66914", "score": "0.6055048", "text": "isCheckMate() {\r\n let kingTeamCheck = this.kingInCheck(true);\r\n if(kingTeamCheck[0]) {\r\n \r\n //an array of possible tile directions the king could go to to escape Check\r\n let moveRange = [\r\n [1,1],[1,0],[1,-1],[0,1],[0,-1],[-1,-1],[-1,0],[-1,1]\r\n ]\r\n if(kingTeamCheck[1] == 'b') {\r\n\r\n \r\n for(let i = 0; i < moveRange.length; i++) {\r\n \r\n let kingx = this.kingPos.black.x;\r\n let kingy = this.kingPos.black.y;\r\n let x1 = moveRange[i][1];\r\n let y1 = moveRange[i][0];\r\n if(king.move([kingy, kingx],[kingy + y1, kingx + x1], false)) {\r\n let potPiece = board.board[kingy + y1][kingx + x1]\r\n this.kingPos.black.x = kingx + x1;\r\n this.kingPos.black.y = kingy + y1;\r\n\r\n board.board[kingy + y1][kingx + x1] = 'bKi';\r\n board.board[kingy][kingx] = null;\r\n\r\n let tempKingCheck = this.kingInCheck(true)\r\n\r\n board.board[kingy][kingx] = 'bKi';\r\n board.board[kingy + y1][kingx + x1] = potPiece;\r\n\r\n this.kingPos.black.x = kingx;\r\n this.kingPos.black.y = kingy;\r\n if(tempKingCheck[0]) {\r\n continue\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n continue;\r\n }\r\n }\r\n return [true, 'b'];\r\n } else if(kingTeamCheck[1] == 'w') {\r\n for(let i = 0; i < moveRange.length; i++) {\r\n \r\n let kingx = this.kingPos.white.x;\r\n let kingy = this.kingPos.white.y;\r\n let x1 = moveRange[i][1];\r\n let y1 = moveRange[i][0];\r\n if(king.move([kingy, kingx],[kingy + y1, kingx + x1], false)) {\r\n let potPiece = board.board[kingy + y1][kingx + x1]\r\n this.kingPos.white.x = kingx + x1;\r\n this.kingPos.white.y = kingy + y1;\r\n\r\n board.board[kingy + y1][kingx + x1] = 'wKi';\r\n board.board[kingy][kingx] = null;\r\n\r\n let tempKingCheck = this.kingInCheck(true)\r\n\r\n board.board[kingy][kingx] = 'wKi';\r\n board.board[kingy + y1][kingx + x1] = potPiece;\r\n\r\n this.kingPos.white.x = kingx;\r\n this.kingPos.white.y = kingy;\r\n if(tempKingCheck[0]) {\r\n continue\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n continue;\r\n }\r\n }\r\n return [true, 'w'];\r\n }\r\n \r\n }\r\n\r\n }", "title": "" }, { "docid": "0bec5f7c0fcc3382b34b64632a967dc0", "score": "0.60483986", "text": "function chooseMove(gameState, aiToken, opponentToken) {\n var winningMove = findWinningMove();\n var requiredBlockingMove = findRequiredBlockingMove();\n var strategicMove = createStrategicMove();\n var doubleImpendingWinMove = createDoubleImpendingWin();\n var doubleImpendingBlock = createDoubleImpendingBlock();\n var impendingWinMove = createImpendingWin();\n var randomMove = createRandomMove();\n return winningMove || requiredBlockingMove || strategicMove || doubleImpendingWinMove || doubleImpendingBlock || impendingWinMove || randomMove;\n\n function findWinningMove() {\n //check to see if any winning moves are available\n var move = impendingMatchLocations(gameState, aiToken);\n return move ? move[0] : move;\n }\n\n function findRequiredBlockingMove() {\n if (winningMove) return false;\n //check the board to see if opponent can win on next turn\n var move = impendingMatchLocations(gameState, opponentToken);\n return move ? move[0] : move;\n }\n\n function createStrategicMove() {\n if (winningMove || requiredBlockingMove) return false;\n //check to see whether it is turn 1, 2, or 3 by how many\n //pieces are already on the board\n if (boardIsEmpty()) return { x: 0, y: 0 };\n if (boardHasTokens(1)) return playCenterOrCorner();\n if (boardHasTokens(2)) return playDiagonalOrHVCorner();\n if (boardHasTokens(3)) return playSideIfInCenter();\n return false;\n\n function boardIsEmpty() {\n return gameState.every(function (row) {\n return row.every(function (e) {\n return !e;\n });\n });\n }\n\n function boardHasTokens(num) {\n var tokenCount = 0;\n gameState.map(function (row) {\n return row.map(function (element) {\n if (element) tokenCount += 1;\n });\n });\n return tokenCount === num;\n }\n\n function playCenterOrCorner() {\n if (opponentPlayedCorner()) return { x: 1, y: 1 };\n if (opponentPlayedCenter()) return { x: 0, y: 0 };\n return playAdjacentCorner();\n\n function opponentPlayedCorner() {\n var corners = [gameState[0][0], gameState[0][2], gameState[2][0], gameState[2][2]];\n return corners.includes(opponentToken);\n }\n\n function opponentPlayedCenter() {\n return gameState[1][1] === opponentToken;\n }\n\n function playAdjacentCorner() {\n if (!rowEmpty(0) || !columnEmpty(0)) return { x: 0, y: 0 };\n return { x: 2, y: 2 };\n }\n\n function rowEmpty(row) {\n return gameState[row].every(function (e) {\n return !e;\n });\n }\n\n function columnEmpty(column) {\n var theColumn = [gameState[0][column], gameState[1][column], gameState[2][column]];\n return theColumn.every(function (e) {\n return !e;\n });\n }\n }\n\n function playDiagonalOrHVCorner() {\n if (opponentTokenInCenter()) return { x: 2, y: 2 }; //diagonal move\n return horizontalOrVerticalCornerMove();\n\n function opponentTokenInCenter() {\n return gameState[1][1] === opponentToken;\n }\n\n function horizontalOrVerticalCornerMove() {\n if (gameState[0].includes(opponentToken)) return { x: 0, y: 2 };\n return { x: 2, y: 0 };\n }\n }\n\n function playSideIfInCenter() {\n if (gameState[1][1] !== aiToken) return false;\n var possibleMoves = [{ x: 1, y: 0 }, { x: 1, y: 2 }, { x: 0, y: 1 }, { x: 2, y: 1 }];\n for (var i = 0; i < 4; i++) {\n if (testMove(possibleMoves[i])) return possibleMoves[i];\n }\n\n function testMove(move) {\n if (gameState[move.y][move.x]) return false;\n var playMove = newGridWithMove(move, aiToken);\n return impendingMatchLocations(playMove, aiToken);\n }\n }\n }\n\n function createDoubleImpendingWin() {\n if (winningMove || requiredBlockingMove || strategicMove) return false;\n var moves = findAllImpendingWinMoves(aiToken);\n var bestMoves = checkForDoubleImpendingWins(moves, aiToken);\n return bestMoves.length > 0 ? bestMoves[0] : false;\n }\n\n function createDoubleImpendingBlock() {\n if (winningMove || requiredBlockingMove || strategicMove || doubleImpendingWinMove) return false;\n var problems = findAllImpendingWinMoves(opponentToken);\n var worstProblems = checkForDoubleImpendingWins(problems, opponentToken);\n return worstProblems.length > 0 ? worstProblems[0] : false;\n }\n\n function createImpendingWin() {\n if (winningMove || requiredBlockingMove || strategicMove || doubleImpendingWinMove || doubleImpendingBlock) return false;\n var moves = findAllImpendingWinMoves(aiToken);\n return moves.length > 0 ? moves[0] : false;\n }\n\n function createRandomMove() {\n if (winningMove || requiredBlockingMove || strategicMove || doubleImpendingWinMove || doubleImpendingBlock || impendingWinMove) return false;\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n if (!gameState[i][j]) return { x: j, y: i };\n }\n }\n return false;\n }\n\n //helper functions\n\n function findAllImpendingWinMoves(player) {\n var allImpendingWinMoves = [];\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n if (!gameState[i][j]) {\n var grid = newGridWithMove({ x: j, y: i }, player);\n var moves = impendingMatchLocations(grid, player);\n if (moves) allImpendingWinMoves.push({ y: i, x: j });\n }\n }\n }\n return allImpendingWinMoves;\n }\n\n function checkForDoubleImpendingWins(moveList, player) {\n var doubleMoves = [];\n moveList.map(function (move) {\n var gridWithMove = newGridWithMove(move, player);\n var impendingWins = impendingMatchLocations(gridWithMove, player);\n if (impendingWins && impendingWins.length >= 2) doubleMoves.push(move);\n });\n return doubleMoves;\n }\n\n function newGridWithMove(_ref, player) {\n var x = _ref.x,\n y = _ref.y;\n\n var copy = duplicateGrid(gameState);\n copy[y][x] = player;\n return copy;\n }\n\n function duplicateGrid(grid) {\n return grid.map(function (row) {\n return row.map(function (element) {\n return element;\n });\n });\n }\n}", "title": "" }, { "docid": "f19c6ba4dd65fe44b63b6515e30e1c50", "score": "0.60268897", "text": "function diagonalCheck(pos, color, oldPiecePos, newPiecePos)\n{\n pos = parseInt(pos);\n let p = pos;\n let previous_pos = pos % 8;\n var elementCheckResponse;\n\n // for up, left\n p = p - 9;\n while(p >= 0 && previous_pos != 0)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n previous_pos = p % 8;\n p = p - 9;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"bishop\")\n {\n return true;\n }\n // check if the piece is a pawn\n // could have issue if the pawn is coming down the opposite way if it were to turn around\n // could keep track of pawns going the opposite direction in an array?\n if(color == \"white\")\n {\n if(p == (pos - 9))\n {\n if(enemyPiece.className == \"pawn\")\n {\n return true;\n }\n }\n }\n }\n break;\n }\n // get position within row\n previous_pos = p % 8;\n // update value\n p = p - 9;\n }\n // reset values\n // for up, right\n p = pos;\n previous_pos = pos % 8;\n p = p - 7;\n while(p >= 0 && previous_pos != 7)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n previous_pos = p % 8;\n p = p - 7;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n elementCheckResponse = elementCheck(p, color);\n // if the there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"bishop\")\n {\n return true;\n }\n // check if the piece is a pawn\n if(color == \"white\")\n {\n if(p == (pos - 7))\n {\n if(enemyPiece.className == \"pawn\")\n {\n return true;\n }\n }\n }\n }\n break;\n }\n // get position within row\n previous_pos = p % 8;\n p = p - 7;\n }\n // reset values\n // for down, left\n p = pos;\n previous_pos = pos % 8;\n p = p + 7;\n while(p < 64 && previous_pos != 0)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n previous_pos = p % 8;\n p = p + 7;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"bishop\")\n {\n return true;\n }\n // check if the piece is a pawn\n if(color == \"black\")\n {\n if(p == (pos + 7))\n {\n if(enemyPiece.className == \"pawn\")\n {\n return true;\n }\n }\n }\n }\n break;\n }\n // get position within row\n previous_pos = p % 8;\n // update value\n p = p + 7;\n }\n // reset values\n // for down, right\n p = pos;\n previous_pos = pos % 8;\n p = p + 9;\n while(p < 64 && previous_pos != 7)\n {\n // if at old piece, assume the square will be empty\n if(p == parseInt(oldPiecePos))\n {\n previous_pos = p % 8;\n p = p + 9;\n continue;\n }\n // if you get to where the new piece will be, it there is something\n // blocking the king\n if(p == parseInt(newPiecePos))\n {\n break;\n }\n elementCheckResponse = elementCheck(p, color);\n // if there is a piece on the square\n if(elementCheckResponse != null)\n {\n // if the piece is not friendly\n if(elementCheckResponse != \"break\")\n {\n // need to see if the piece can access the king\n let enemyElem = document.getElementById(String(p));\n // get the piece\n let enemyPiece = enemyElem.firstElementChild;\n if(enemyPiece.className == \"queen\" || enemyPiece.className == \"bishop\")\n {\n return true;\n }\n // check if the piece is a pawn\n if(color == \"black\")\n {\n if(p == (pos + 9))\n {\n if(enemyPiece.className == \"pawn\")\n {\n return true;\n }\n }\n }\n }\n break;\n }\n // get position within row\n previous_pos = p % 8;\n // update value\n p = p + 9;\n }\n return false;\n}", "title": "" }, { "docid": "9b5eb9d75300bb03d1b6e20186676f3a", "score": "0.60002816", "text": "function legal_moves(piece,board,side){ //recursive for ray pieces?\n\tvar enemy = side ? 2 : 1;\n\tvar i,tile;\n\tvar move_array = [];\n\tswitch(piece.type){\n\t\tcase \"Pawn\":\n\t\t\t\tvar direction = side ? -1: 1; \n\t\t\t\tif(board[indexcord2index(piece.position[0],piece.position[1]-direction)] === 0 )\n\t\t\t\t\tmove_array.push([piece.position[0],piece.position[1]-direction]);\n\t\t\t\tif(board[indexcord2index(piece.position[0]-direction,piece.position[1]-direction)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0]-direction,piece.position[1]-direction]);\n\t\t\t\tif(board[indexcord2index(piece.position[0]+direction,piece.position[1]-direction)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0]+direction,piece.position[1]-direction]);\n\t\t\t\tif( side ? piece.position[1] == 1 : piece.position[1] == 6) //home row so two moves\n\t\t\t\t\tif(board[indexcord2index(piece.position[0],piece.position[1] - direction - direction)] === 0 )\n\t\t\t\t\t\tmove_array.push([piece.position[0],piece.position[1] - direction - direction]);\n\t\t\t\tbreak;\n\n\t\tcase \"Knight\":\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] + 1,piece.position[1]+2)]; // L\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] +1 ,piece.position[1] +2]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] - 1,piece.position[1]+2)]; // backwards L\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] - 1 ,piece.position[1] +2]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] - 1,piece.position[1]-2)]; // upside-down backwards L\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] - 1 ,piece.position[1] -2]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] + 1,piece.position[1]-2)]; // upside-down L\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] + 1 ,piece.position[1] -2]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] + 2,piece.position[1]+1)]; \n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] +2 ,piece.position[1] +1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] - 2,piece.position[1]+1)]; \n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] - 2 ,piece.position[1] +1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] - 2,piece.position[1]-1)]; \n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] - 2 ,piece.position[1] -1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] + 2,piece.position[1]-1)]; \n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] + 2 ,piece.position[1] -1]);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"Queen\": // use rook and Bishop code\n\t\t\tcase \"Rook\": //NOTE DO BOUND CHECKS IN FOR LOOP only x needs bounds check\n\t\t\t\tfor(i =1; board[indexcord2index(piece.position[0] + i,piece.position[1])] === 0; ++i) //down check will stop on out of bounds\n\t\t\t\t\tmove_array.push([piece.position[0] + i,piece.position[1]]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] + i,piece.position[1])] === enemy) // once you hit something check if enemy piece\n\t\t\t\t\tmove_array.push([piece.position[0] + i,piece.position[1]]);\n\n\t\t\t\tfor(i =1; board[indexcord2index(piece.position[0] - i,piece.position[1])] === 0; ++i) //up\n\t\t\t\t\tmove_array.push([piece.position[0] - i,piece.position[1]]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] - i,piece.position[1])] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0] - i,piece.position[1]]);\n\n\t\t\t\tfor(i = 1; board[indexcord2index(piece.position[0] ,piece.position[1] + i)] === 0; ++i) //right\n\t\t\t\t\tmove_array.push([piece.position[0] ,piece.position[1] + i]);\n\t\t\t\tif(board[indexcord2index(piece.position[0],piece.position[1] + i)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0],piece.position[1] + i]);\n\n\t\t\t\tfor(i = 1; board[indexcord2index(piece.position[0] ,piece.position[1]- i)] === 0; ++i) //left\n\t\t\t\t\tmove_array.push([piece.position[0] ,piece.position[1]- i]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] ,piece.position[1] - i)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0] ,piece.position[1] - i]);\n\t\t\t\t\n\t\t\t\tif(piece.type == \"Rook\")\n\t\t\t\t\tbreak;\n\t\t\t\t//fall through to bishop code if it is a queen\n\n\t\tcase \"Bishop\":\n\t\t\t\tfor(i =1; board[indexcord2index(piece.position[0] + i,piece.position[1]+i)] === 0; ++i) //down right check will stop on out of bounds\n\t\t\t\t\tmove_array.push([piece.position[0] + i,piece.position[1]+i]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] + i,piece.position[1] + i)] === enemy) // once you hit something check if enemy piece\n\t\t\t\t\tmove_array.push([piece.position[0] + i,piece.position[1] +i]);\n\n\t\t\t\tfor(i =1; board[indexcord2index(piece.position[0] - i,piece.position[1] -i)] === 0; ++i) //up left\n\t\t\t\t\tmove_array.push([piece.position[0] - i,piece.position[1]-i]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] - i,piece.position[1]-i)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0] - i,piece.position[1]-i]);\n\n\t\t\t\tfor(i = 1; board[indexcord2index(piece.position[0] - i ,piece.position[1] + i)] === 0; ++i) // down left\n\t\t\t\t\tmove_array.push([piece.position[0] - i ,piece.position[1] + i]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] - i,piece.position[1] + i)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0] - i,piece.position[1] + i]);\n\n\t\t\t\tfor(i = 1; board[indexcord2index(piece.position[0] + i ,piece.position[1]- i)] === 0; ++i) // up right\n\t\t\t\t\tmove_array.push([piece.position[0] + i ,piece.position[1]- i]);\n\t\t\t\tif(board[indexcord2index(piece.position[0] + i ,piece.position[1] - i)] === enemy)\n\t\t\t\t\tmove_array.push([piece.position[0] + i ,piece.position[1] - i]); \n\t\t\t\tbreak;\n\t\n\n\t\tcase \"King\":\n\t\t\t\ttile = board[indexcord2index(piece.position[0],piece.position[1]+1)]; // down\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] ,piece.position[1] +1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0]+1,piece.position[1]+1)]; // down right\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] +1 ,piece.position[1] +1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0] +1,piece.position[1])]; // right\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] +1 ,piece.position[1]]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0]+1,piece.position[1]-1)]; // up right\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] +1,piece.position[1] -1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0],piece.position[1]-1)]; // up\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0] ,piece.position[1]-1 ]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0]-1,piece.position[1]-1)]; // up left\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0]-1 ,piece.position[1] -1]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0]-1,piece.position[1])]; // left\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0]-1 ,piece.position[1]]);\n\n\t\t\t\ttile = board[indexcord2index(piece.position[0]-1,piece.position[1]+1)]; // down left\n\t\t\t\tif(tile === 0 || tile === enemy )\n\t\t\t\t\tmove_array.push([piece.position[0]-1 ,piece.position[1] +1]);\n\t\t\t\tbreak;\n\t}\n\treturn move_array;\n}", "title": "" }, { "docid": "bc9acb0ee9cf58791343de14e2b71dd9", "score": "0.5988529", "text": "function king(startX, startY, destX, destY){\n\t//since eating its own piece is already checked for, nothing to really check\n\tconsole.log(startX, startY, destX, destY);\n\tif((Math.abs(startX - destX) <= 1) && (Math.abs(startY - destY) <= 1)){\n\t\tconsole.log(\"king is good\")\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "7484eb14fb1cca050a4b4ff7c6855f26", "score": "0.59852195", "text": "possibleMoves(board) {\r\n const currentRow = this.row;\r\n const currentCol = this.col;\r\n\r\n const possibleMoves = [];\r\n // if pawn is white\r\n if (this.color === 0) {\r\n // 1 unit forward\r\n if (\r\n ChessLogic.indexInRange(currentRow - 1, currentCol) &&\r\n !this.enemyAtIndex(board, currentRow - 1, currentCol)\r\n ) {\r\n possibleMoves.push([currentRow - 1, currentCol]);\r\n }\r\n // 2 units forward\r\n if (\r\n ChessLogic.indexInRange(currentRow - 2, currentCol) &&\r\n !this.hasUsedFirstMove &&\r\n !this.enemyAtIndex(board, currentRow - 2, currentCol)\r\n ) {\r\n possibleMoves.push([currentRow - 2, currentCol]);\r\n }\r\n // diagonals if enemy present\r\n if (\r\n ChessLogic.indexInRange(currentRow - 1, currentCol + 1) &&\r\n this.enemyAtIndex(board, currentRow - 1, currentCol + 1)\r\n ) {\r\n possibleMoves.push([currentRow - 1, currentCol + 1]);\r\n }\r\n if (\r\n ChessLogic.indexInRange(currentRow - 1, currentCol - 1) &&\r\n this.enemyAtIndex(board, currentRow - 1, currentCol - 1)\r\n ) {\r\n possibleMoves.push([currentRow - 1, currentCol - 1]);\r\n }\r\n }\r\n // if pawn is black\r\n else {\r\n // 1 unit forward\r\n if (\r\n ChessLogic.indexInRange(currentRow + 1, currentCol) &&\r\n !this.enemyAtIndex(board, currentRow + 1, currentCol)\r\n ) {\r\n possibleMoves.push([currentRow + 1, currentCol]);\r\n }\r\n // 2 units forward\r\n if (\r\n ChessLogic.indexInRange(currentRow + 2, currentCol) &&\r\n !this.hasUsedFirstMove &&\r\n !this.enemyAtIndex(board, currentRow + 2, currentCol)\r\n ) {\r\n possibleMoves.push([currentRow + 2, currentCol]);\r\n }\r\n // diagonals if enemy present\r\n if (\r\n ChessLogic.indexInRange(currentRow + 1, currentCol + 1) &&\r\n this.enemyAtIndex(board, currentRow + 1, currentCol + 1)\r\n ) {\r\n possibleMoves.push([currentRow + 1, currentCol + 1]);\r\n }\r\n if (\r\n ChessLogic.indexInRange(currentRow + 1, currentCol - 1) &&\r\n this.enemyAtIndex(board, currentRow + 1, currentCol - 1)\r\n ) {\r\n possibleMoves.push([currentRow + 1, currentCol - 1]);\r\n }\r\n }\r\n\r\n return possibleMoves.filter(move => {\r\n return this.isValidMove(board, currentRow, currentCol, move[0], move[1]);\r\n });\r\n }", "title": "" }, { "docid": "c55be9708808be8151300e19d8a93e8b", "score": "0.5975492", "text": "function chooseMove(player) {\r\n\t\"use strict\";\r\n\tif (isGameOver === false) {\r\n\t\tif (chosenSquare === false) {\r\n\t\t\tchosenSquare = winCheck(player);\r\n\t\t}\r\n\t\tif (chosenSquare === false) {\t\t\t\r\n\t\t\tchosenSquare = blockCheck(player,otherplayer);\r\n\t\t} \r\n\t\tif (chosenSquare === false) {\t\t\r\n\t\t\tchosenSquare = otherCheck();\r\n\t\t}\t\t\t\r\n\t\tisGameOver = squareClicked(chosenSquare);\r\n\t\tchosenSquare = false;\r\n\t}\r\n}", "title": "" }, { "docid": "f352e9c9e421e7bd44997f3a1dcd0b4e", "score": "0.59744257", "text": "function play(){\n var best = -100000;\n var bestmove = null;\n var valid_moves = [];\n var p = game.possible(game.board);\n \n if(state.mode=='easy'){\n easyPlay(p);\n return;\n }\n \n if(p.length==9){\n var rand= Math.floor(Math.random()*8);\n computer.avail.push(rand);\n game.board[rand]=computer.token;\n $(\"#childval-\"+rand).html('<i class=\"fa fa-times\" aria-hidden=true/>');\n $(\"#childval-\"+rand).addClass(\"disabled\");\n return;\n }\n \n for(var i in p){\n game.board[p[i]] = computer.token;\n computer.avail.push(+p[i]);\n var now;\n\n if(game.isComplete()){\n var winner = game.isWinner();\n if(winner==false)\n now=0;\n else if(winner.name=='computer')\n now=100;\n else \n now=-100;\n }\n\n else\n now = game.minimax(human, 0);\n\n game.board[p[i]]=0;\n computer.avail.pop();\n \n if(now>best){\n best = now;\n valid_moves= [+p[i]];\n }\n\n else if(now==best){\n valid_moves.push(+p[i]);\n }\n }\n \n bestmove = valid_moves[\n Math.floor(\n Math.random()*\n valid_moves.length)];\n\n game.board[bestmove] = computer.token;\n computer.avail.push(bestmove);\n if(computer.token=='x')\n $('#childval-'+bestmove).html('<i class=\"fa fa-times\" aria-hidden=true/>');\n else\n $('#childval-'+bestmove).html('<i class=\"fa fa-circle-o\" aria-hidden=true/>');\n $(\"#childval-\"+bestmove).addClass('disabled');\n if(game.isComplete()){\n var woo= game.isWinner();\n state.win=1;\n //console.log(state.winningCombo);\n if(woo==false){\n stats.tie++;\n interface.updateStat('tie');\n $(\".textContain\").html(\"TIE\");\n setTimeout(interface.reset, 2000);\n }\n else if(woo.name=='computer'){\n stats.loss++;\n interface.updateStat('loss');\n $(\".textContain\").html('LOSS');\n interface.showWinner(state.winningCombo);\n }\n else{\n stats.wins++;\n interface.updateStat(stats.wins);\n $(\".textContain\").html('win');\n interface.showWinner(state.winningCombo);\n }\n }\n}", "title": "" }, { "docid": "692922b64dc72507ca4bca750e4ad851", "score": "0.5971435", "text": "checkLowerLeftToUpperRight(x, y, playerId) {\r\n //Includes piece that was just placed\r\n let connectedPieces = 1;\r\n //Check lower left\r\n connectedPieces += this.checkForConnected(x, y, playerId, (x,i) => x - i, (y,i) => y - i);\r\n //Check upper right\r\n connectedPieces += this.checkForConnected(x, y, playerId, (x,i) => x + i, (y,i) => y + i);\r\n \r\n if(connectedPieces > 3) return true;\r\n \r\n return false;\r\n }", "title": "" }, { "docid": "05ed8d4100c059e30f61aba3b93ce9d6", "score": "0.59693694", "text": "function isNextTo(puzzlePiece){\n var left = parseInt(puzzlePiece.style.left);\n var top = parseInt(puzzlePiece.style.top);\n \n //If the square is exactly 1 square away from the blank and is in the same\n //column or row.\n if((Math.abs(blankLeft - left) == SQUARE_HEIGHT && top == blankTop) || \n (Math.abs(blankTop - top) == SQUARE_HEIGHT && left == blankLeft)){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "940ee46c613abc82c65b97d504854ec1", "score": "0.5961518", "text": "function checkInteraction(){\n let playerPosX = player.estadoPartida.x;\n let playerPosY = player.estadoPartida.y;\n //console.log(mapa[playerPosY][playerPosX]);\n switch(mapa[playerPosY][playerPosX]){\n case \"E\"://CAsilla de enemigo: activar combate\n\n iniciarCombate();\n break;\n\n case \"O\": //Casilla de objeto: interfaz de recogida de objeto\n iniciarRecogidaDeObjeto();\n break;\n\n case \"S\":\n iniciarNuevoNivel();\n break;\n\n default: break;\n }\n}", "title": "" }, { "docid": "4b83d851ccddc5de2c2adef57d69eb33", "score": "0.5957951", "text": "canMove(fromPos, toPos, board){\n\n var fromRow, fromCol;\n [fromRow, fromCol] = board.algerbraicToIndeces(fromPos);\n\n // check to see if there is another piece at the target location and, if\n // there is, determine if it is opposing.\n let pieceAtToPos = board.getPieceAt(toPos);\n let taking = false;\n\n var moveArr = [];\n\n //determine if the move is meant to take an opposing piece based on the\n //contents of the destination square\n if(pieceAtToPos !== undefined\n && pieceAtToPos.getColor() !== this.getColor()){\n taking = true;\n }\n\n if(taking){\n if(this.getColor() === 'w'){\n moveArr.push([fromRow-1, fromCol-1]);//take left\n moveArr.push([fromRow-1, fromCol+1]);//take right\n }\n else if(this.getColor() === 'b'){\n moveArr.push([fromRow+1, fromCol-1]);//take left\n moveArr.push([fromRow+1, fromCol+1]);//take right\n }\n }\n // if not taking\n else{\n\n //add possible positions to Move Array\n //white pawns can only move north\n if(this.getColor() === 'w'){\n moveArr.push([fromRow - 1, fromCol]); // move forward one square\n if(!this.hasMoved){\n moveArr.push([fromRow - 2, fromCol]); // move fwd 2 squares from home\n }\n }\n //black pawns can only move south\n else if(this.getColor() === 'b'){\n moveArr.push([fromRow + 1, fromCol]); // move forward one square\n if(!this.hasMoved){\n moveArr.push([fromRow + 2, fromCol]); // move fwd 2 squares from home\n }\n }\n }\n\n\n // filter out positions that are outside of the board's constraints\n moveArr = moveArr.filter(el => board.validPos(el[0], el[1]));\n\n // filter out moves whose paths are not clear\n moveArr = moveArr.filter(el => board.isClearPath(fromPos, board.indecesToAlgebraic(el[0],el[1])));\n\n //TODO refactor below out of each Piece child\n // verify that no pieces of the same color are occupying that space\n moveArr = moveArr.filter(el => {\n let piece = board.getPieceAt(el[0],el[1]);\n\n //if there is a piece present AND that piece is NOT an opposing color\n if(piece !== undefined && piece.getColor() === this.getColor() ){\n return false;\n }\n // otherwise, if there is not a piece there OR the piece is opposing color\n return true;\n });\n\n moveArr = moveArr.map(board.indecesToAlgebraic);\n\n return this.includesArray(moveArr, toPos, board);\n\n }", "title": "" }, { "docid": "a44eca2291ec13b136ae1fd38d5ca2d7", "score": "0.5955398", "text": "movePiece(pos, target) {\n // Check if there is a piece there\n // And the move is in its moveset\n if (this.possibleMoves[pos] !== undefined &&\n this.possibleMoves[pos].find((val) => val == target) !== undefined) {\n this.replacePiece(pos, target);\n // Switch moves\n this.order = !this.order;\n this.refreshMoves();\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "361896118fd1ce99d6645046c20266b4", "score": "0.5944139", "text": "function checkDeplacement(pieceId, lastCase, newCase) {\n var lastPos = nameCaseToPosition(lastCase);\n var newPos = nameCaseToPosition(newCase);\n\n var listPieces = findPieces();\n\n // check if piece don't eat a piece which has the same color\n for (var key in listPieces) {\n if (listPieces[key] == newCase && key.charAt(0) == pieceId.charAt(0)) {\n return false;\n }\n }\n\n // if the piece is not the king\n if (pieceId.charAt(2) != \"K\") {\n // check if the king is not check after the movement\n if (pieceWhichAttackTheCase(nameCaseToPosition(listPieces[pieceId.charAt(0) + \"_K\"]), pieceId.charAt(0), pieceId, newCase) != false) {\n return false;\n }\n }\n // else (the king move)\n else {\n // check if the king is not check after his movement\n if (pieceWhichAttackTheCase(newPos, pieceId.charAt(0), pieceId, newCase) != false) {\n return false;\n }\n }\n\n // rules to move\n switch (pieceId.charAt(2)) {\n\n // if it's a rook\n case \"R\":\n // if it moves vertically or horizontally\n if (lastPos[0] == newPos[0] || lastPos[1] == newPos[1]) {\n // check if a piece is between lastPos and newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n // if a piece is between lastPos and newPos (not possible to move)\n if (((pos[1] < newPos[1] && pos[1] > lastPos[1]) ||\n (pos[1] > newPos[1] && pos[1] < lastPos[1]) ||\n (pos[0] < newPos[0] && pos[0] > lastPos[0]) ||\n (pos[0] > newPos[0] && pos[0] < lastPos[0])) && (pos[0] == newPos[0] || pos[1] == newPos[1])) {\n return false;\n }\n }\n \n // update pieceMove\n var data = {};\n data[pieceId] = true;\n firebase.database().ref('/games/' + idGame + '/piecesMove').update(data);\n return true;\n }\n // not possible\n else\n return false;\n break;\n\n // if it's knight\n case \"N\":\n var x = (lastPos[0] - newPos[0]);\n var y = (lastPos[1] - newPos[1]);\n\n // if it move like an \"L\"\n if ((Math.abs(x) == 1 && Math.abs(y) == 2) || (Math.abs(x) == 2 && Math.abs(y) == 1)) {\n return true;\n }\n else\n return false;\n break;\n\n // if it's a bishop\n case \"B\":\n var x = (lastPos[0] - newPos[0]);\n var y = (lastPos[1] - newPos[1]);\n\n // if it move diagonally\n if (Math.abs(x) == Math.abs(y)) {\n // check if a piece is between lastPos and newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n // if a piece is between lastPos and newPos (not possible to move)\n if (((pos[1] < newPos[1] && pos[1] > lastPos[1]) ||\n (pos[1] > newPos[1] && pos[1] < lastPos[1]) ||\n (pos[0] < newPos[0] && pos[0] > lastPos[0]) ||\n (pos[0] > newPos[0] && pos[0] < lastPos[0])) && ((Math.abs(pos[0] - newPos[0]) == Math.abs(pos[1] - newPos[1]))\n && (Math.abs(pos[0] - lastPos[0]) == Math.abs(pos[1] - lastPos[1]))\n )\n ) {\n return false;\n }\n }\n return true;\n }\n // else impossible to move\n else\n return false;\n break;\n\n // if it's a king\n case \"K\":\n var x = (lastPos[0] - newPos[0]);\n var y = (lastPos[1] - newPos[1]);\n\n // if king go one case around him (move possible)\n if (Math.abs(x) <= 1 && Math.abs(y) <= 1) {\n var data = {};\n data[pieceId] = true;\n firebase.database().ref('/games/' + idGame + '/piecesMove').update(data);\n return true;\n }\n // if it's rock\n else if (Math.abs(x) == 2 && Math.abs(y) == 0) {\n // get piece which have already move\n var ref = firebase.database().ref('/games/' + idGame + '/piecesMove');\n var listPieceMove;\n ref.once(\"value\", function (snapshot) {\n listPieceMove = snapshot.val();\n });\n\n var data = {};\n var pieceMoveData = {};\n\n // check the four check possible (small and big rock for black and white)\n // if king and the rook have'nt move and check if the king don't pass in a case which is check\n if (pieceId.charAt(0) == \"B\" && lastCase == \"E8\" && listPieces[\"B_R2\"] == \"H8\" && listPieceMove[\"B_K\"] == false && listPieceMove[\"B_R2\"] == false) {\n if (pieceWhichAttackTheCase(nameCaseToPosition(\"F8\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"G8\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"E8\"), pieceId.charAt(0), pieceId, newCase) != false)\n return false;\n else {\n data[\"B_R2\"] = \"F8\";\n pieceMoveData[\"B_K\"] = true;\n pieceMoveData[\"B_R2\"] = true;\n }\n }\n else if (pieceId.charAt(0) == \"B\" && lastCase == \"E8\" && listPieces[\"B_R1\"] == \"A8\" && listPieceMove[\"B_K\"] == false && listPieceMove[\"B_R1\"] == false) {\n if (pieceWhichAttackTheCase(nameCaseToPosition(\"D8\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"C8\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"E8\"), pieceId.charAt(0), pieceId, newCase) != false)\n return false;\n else {\n data[\"B_R1\"] = \"D8\";\n pieceMoveData[\"B_K\"] = true;\n pieceMoveData[\"B_R1\"] = true;\n }\n }\n else if (pieceId.charAt(0) == \"W\" && lastCase == \"E1\" && listPieces[\"W_R2\"] == \"H1\" && listPieceMove[\"W_K\"] == false && listPieceMove[\"W_R2\"] == false) {\n if (pieceWhichAttackTheCase(nameCaseToPosition(\"E1\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"F1\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"G1\"), pieceId.charAt(0), pieceId, newCase) != false)\n return false;\n else {\n data[\"W_R2\"] = \"F1\";\n pieceMoveData[\"W_K\"] = true;\n pieceMoveData[\"W_R2\"] = true;\n }\n }\n else if (pieceId.charAt(0) == \"W\" && lastCase == \"E1\" && listPieces[\"W_R1\"] == \"A1\" && listPieceMove[\"W_K\"] == false && listPieceMove[\"W_R1\"] == false) {\n if (pieceWhichAttackTheCase(nameCaseToPosition(\"E1\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"D1\"), pieceId.charAt(0), pieceId, newCase) != false ||\n pieceWhichAttackTheCase(nameCaseToPosition(\"C1\"), pieceId.charAt(0), pieceId, newCase) != false)\n return false;\n else {\n data[\"W_R1\"] = \"D1\";\n pieceMoveData[\"W_K\"] = true;\n pieceMoveData[\"W_R1\"] = true;\n }\n }\n else\n return false;\n\n // update database\n firebase.database().ref('/games/' + idGame + '/pieces').update(data);\n firebase.database().ref('/games/' + idGame + '/piecesMove').update(pieceMoveData);\n\n return true;\n }\n else\n return false;\n break;\n\n // if it's a queen\n case \"Q\":\n var x = (lastPos[0] - newPos[0]);\n var y = (lastPos[1] - newPos[1]);\n\n // if queen move like a rook\n if (lastPos[0] == newPos[0] || lastPos[1] == newPos[1]) {\n // check if a piece is between lastPos and newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n // if a piece is between lastPos and newPos\n if (((pos[1] < newPos[1] && pos[1] > lastPos[1]) ||\n (pos[1] > newPos[1] && pos[1] < lastPos[1]) ||\n (pos[0] < newPos[0] && pos[0] > lastPos[0]) ||\n (pos[0] > newPos[0] && pos[0] < lastPos[0])) && (pos[0] == newPos[0] || pos[1] == newPos[1])) {\n return false;\n }\n }\n return true;\n }\n // else if it move like a bishop\n else if (Math.abs(x) == Math.abs(y)) {\n // check if a piece is between lastPos and newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n // if a piece is between lastPos and newPos\n if (((pos[1] < newPos[1] && pos[1] > lastPos[1]) ||\n (pos[1] > newPos[1] && pos[1] < lastPos[1]) ||\n (pos[0] < newPos[0] && pos[0] > lastPos[0]) ||\n (pos[0] > newPos[0] && pos[0] < lastPos[0])) && ((Math.abs(pos[0] - newPos[0]) == Math.abs(pos[1] - newPos[1]))\n && (Math.abs(pos[0] - lastPos[0]) == Math.abs(pos[1] - lastPos[1]))\n )\n ) {\n return false;\n }\n }\n return true;\n }\n else\n return false;\n break;\n \n // if it's a pawn\n case \"P\":\n var color = pieceId.charAt(0);\n var x = newPos[0] - lastPos[0];\n var y = newPos[1] - lastPos[1];\n\n // if it's black pawn\n if (color == \"B\" && y >= -2 && y < 0) {\n // if the pawn advance to two case and it is in his initial position\n if (y == -2 && lastCase[1] == 7) {\n // check if a piece is not between or in the newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n if (pos[0] == newPos[0] && pos[1] == newPos[1] + 1) {\n return false;\n }\n }\n return true;\n }\n // else if the pawn advance to one case\n else if (y == -1 && x == 0) {\n // check if a piece is in the newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n if (pos[0] == newPos[0] && pos[1] == newPos[1]) {\n return false;\n }\n }\n // if it's a promotion\n if (newPos[1] == 1)\n return \"promot\";\n\n return true;\n }\n // else if the pawn eat another piece\n else if (y == -1 && (x == -1 || x == 1)) {\n // check if ther is a piece in the newPos\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n if (pos[0] == newPos[0] && pos[1] == newPos[1]) {\n // if it's promot\n if (newPos[1] == 1)\n return \"promot\";\n return true;\n }\n }\n return false;\n }\n else\n return false;\n }\n // else if a white pawn, same thing but inversed\n else if (color == \"W\" && y <= 2 && y > 0) {\n if (y == 2 && lastCase[1] == 2) {\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n if (pos[0] == newPos[0] && pos[1] == newPos[1] - 1) {\n return false;\n }\n }\n return true;\n }\n else if (y == 1 && x == 0) {\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n if (pos[0] == newPos[0] && pos[1] == newPos[1]) {\n return false;\n }\n }\n\n if (newPos[1] == 8)\n return \"promot\";\n\n return true;\n }\n else if (y == 1 && (x == -1 || x == 1)) {\n for (var key in listPieces) {\n var pos = nameCaseToPosition(listPieces[key])\n if (pos[0] == newPos[0] && pos[1] == newPos[1]) {\n if (newPos[1] == 8)\n return \"promot\";\n\n return true;\n }\n }\n return false;\n }\n else\n return false;\n }\n else\n return false;\n\n break;\n }\n\n return true;\n}", "title": "" }, { "docid": "59a0f231cd712b9c4d4f0cf27d95564a", "score": "0.59393084", "text": "checkKingSafety(pos, target) {\n const board = this.board;\n const tarP = board[target].piece;\n const tarC = board[target].color;\n // Get current color\n const kingColor = board[pos].color;\n\n // Get king location\n var kingPos = -1;\n kingPos = board.find((val) => { kingPos++; return val.color == kingColor && val.piece == PieceE.KING }) && kingPos;\n // Try move\n this.replacePiece(pos, target);\n\n // Check rook here\n // If danger is true, then move is not possible.\n var danger = false;\n for (var i = 1;; i++) {\n if (board[kingPos+i] === undefined) break;\n if (board[kingPos+i].piece != PieceE.NONE) {\n if (board[kingPos+i].color != board[kingPos].color) danger=true;\n break;\n }\n }\n for (var i = -1;; i--) {\n if (board[kingPos+i] === undefined) break;\n if (board[kingPos+i].piece != PieceE.NONE) {\n if (board[kingPos+i].color != board[kingPos].color) danger=true;\n break;\n }\n }\n\n // Redo move\n this.replacePiece(target, pos);\n board[target].piece = tarP;\n board[target].color = tarC;\n return !danger;\n }", "title": "" }, { "docid": "4a9909e83fe9784a75d32177925df8a4", "score": "0.59341025", "text": "draw() {\n return !this.computerWon() && !this.playerWon() && !this.availableMoves.length;\n }", "title": "" }, { "docid": "aea7d1a405d1eb2c4713183b7066f9ef", "score": "0.59323645", "text": "function checkCheckMat(kingCase, colorPiece) {\n var colorOpponent;\n if (colorPiece == \"B\")\n colorOpponent = \"W\";\n else\n colorOpponent = \"B\";\n\n var newKingPos = {};\n\n // check if the king is check, if is not it's not a checkmate\n var kingPos = nameCaseToPosition(kingCase);\n var pieceCheck = pieceWhichAttackTheCase(kingPos, colorPiece);\n if (!pieceCheck)\n return false;\n\n // if the king can move, it's not checkmate\n for (var i = -1; i <= 1; i++) {\n if (kingPos[0] + i > 0 && kingPos[0] + i < 9) {\n for (var j = -1; j <= 1; j++) {\n if (kingPos[1] + j > 0 && kingPos[1] + j < 9) {\n newKingPos[0] = kingPos[0] + i;\n newKingPos[1] = kingPos[1] + j;\n if (checkDeplacement(colorPiece + \"_K\", kingCase, namePositionToCase(newKingPos)) != false) {\n pieceCheck = pieceWhichAttackTheCase(newKingPos, colorPiece);\n if (!pieceCheck)\n return false;\n }\n }\n }\n }\n }\n\n var listPieces = findPieces();\n\n // check if we can make a piece between the king and the opponent piece\n switch (pieceCheck.charAt(2)) {\n // if the opponent is a rook\n case \"R\":\n var posPieceCheck = nameCaseToPosition(listPieces[pieceCheck]);\n\n // if the rook is placed in the same column and a line < than the king\n if (posPieceCheck[0] == kingPos[0]) {\n if (posPieceCheck[1] < kingPos[1]) {\n // check if we can place a piece between\n for (var i = posPieceCheck[1]; i < kingPos[1]; i++) {\n var casePos = {};\n casePos[0] = posPieceCheck[0];\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n // if a piece can go check if it can move\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false) {\n return false;\n }\n // else if it can't and it's the king, double check without the king\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n // same thing but with the rook in another place\n else {\n for (var i = kingPos[1]; i < posPieceCheck[1]; i++) {\n var casePos = {};\n casePos[0] = posPieceCheck[0];\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n // same thing but with the rook in another place\n else if (posPieceCheck[1] == kingPos[1]) {\n if (posPieceCheck[0] < kingPos[0]) {\n for (var i = posPieceCheck[0]; i < kingPos[0]; i++) {\n var casePos = {};\n casePos[1] = posPieceCheck[1];\n casePos[0] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n // same thing but with the rook in another place\n else {\n for (var i = kingPos[0]; i < posPieceCheck[0]; i++) {\n var casePos = {};\n casePos[1] = posPieceCheck[1];\n casePos[0] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n\n break;\n\n // if it's a pawn or a knight check if we can it them\n case \"N\":\n case \"P\":\n var casePos = nameCaseToPosition(listPieces[pieceCheck]);\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n }\n }\n }\n\n break;\n\n // if it's a bishop check we can eat them or place a piece between\n case \"B\":\n var posPieceCheck = nameCaseToPosition(listPieces[pieceCheck]);\n\n var j = 0;\n\n // same thing that the rook but with a bishop\n if (posPieceCheck[0] < kingPos[0]) {\n if (posPieceCheck[1] < kingPos[1]) {\n for (var i = posPieceCheck[1]; i < kingPos[1]; i++) {\n j++;\n var casePos = {};\n casePos[0] = posPieceCheck[0] + j;\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n else {\n for (var i = kingPos[1]; i < posPieceCheck[1]; i++) {\n j--;\n var casePos = {};\n casePos[0] = posPieceCheck[0] + j;\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n else if (posPieceCheck[0] > kingPos[0]) {\n if (posPieceCheck[1] < kingPos[1]) {\n for (var i = posPieceCheck[1]; i < kingPos[1]; i++) {\n j++;\n var casePos = {};\n casePos[0] = posPieceCheck[0] + j;\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n else {\n for (var i = kingPos[1]; i < posPieceCheck[1]; i++) {\n j--;\n var casePos = {};\n casePos[0] = posPieceCheck[0] + j;\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n\n break;\n\n // if it's queen, same thing that the rook and the bishop\n case \"Q\":\n var posPieceCheck = nameCaseToPosition(listPieces[pieceCheck]);\n\n var j = 0;\n\n if (posPieceCheck[0] == kingPos[0]) {\n if (posPieceCheck[1] < kingPos[1]) {\n for (var i = posPieceCheck[1]; i < kingPos[1]; i++) {\n var casePos = {};\n casePos[0] = posPieceCheck[0];\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n else {\n for (var i = kingPos[1]; i < posPieceCheck[1]; i++) {\n var casePos = {};\n casePos[0] = posPieceCheck[0];\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n }\n }\n }\n }\n }\n }\n else if (posPieceCheck[1] == kingPos[1]) {\n if (posPieceCheck[0] < kingPos[0]) {\n for (var i = posPieceCheck[0]; i < kingPos[0]; i++) {\n var casePos = {};\n casePos[1] = posPieceCheck[1];\n casePos[0] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n else {\n for (var i = kingPos[0]; i < posPieceCheck[0]; i++) {\n var casePos = {};\n casePos[1] = posPieceCheck[1];\n casePos[0] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n else if (posPieceCheck[0] < kingPos[0]) {\n if (posPieceCheck[1] < kingPos[1]) {\n for (var i = posPieceCheck[1]; i < kingPos[1]; i++) {\n j++;\n var casePos = {};\n casePos[0] = posPieceCheck[0] + j;\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n else {\n for (var i = kingPos[1]; i < posPieceCheck[1]; i++) {\n j--;\n var casePos = {};\n casePos[0] = posPieceCheck[0] + j;\n casePos[1] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n else if (posPieceCheck[1] > kingPos[1]) {\n if (posPieceCheck[0] < kingPos[0]) {\n for (var i = posPieceCheck[0]; i < kingPos[0]; i++) {\n j++;\n var casePos = {};\n casePos[1] = posPieceCheck[1] + j;\n casePos[0] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n else {\n for (var i = kingPos[0]; i < posPieceCheck[0]; i++) {\n j--;\n var casePos = {};\n casePos[1] = posPieceCheck[1] + j;\n casePos[0] = i;\n var pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent);\n if (pieceCanGo != false) {\n var flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n else if (flag == false && pieceCanGo == colorPiece + \"_K\") {\n pieceCanGo = pieceWhichAttackTheCase(casePos, colorOpponent, \"\", \"\", colorPiece + \"_K\");\n if (pieceCanGo != false) {\n flag = checkDeplacement(pieceCanGo, listPieces[pieceCanGo], namePositionToCase(casePos));\n if (flag != false)\n return false;\n\n }\n }\n }\n }\n }\n }\n break;\n }\n\n console.log(\"Checkmate !!!\");\n return true;\n}", "title": "" }, { "docid": "f7de5fcb5142792a1f25ad6f534dff6a", "score": "0.5927232", "text": "function inCheckBy(pieceType, loc) {\n //const opponentColor = capturedOwn.classList.contains(\"black\") ? \"white\" : \"black\";\n const position = boardCells[loc];\n if (position.firstChild\n && position.firstChild.classList.contains(pieceType)\n && position.firstChild.classList.contains(color === \"black\" ? \"white\" : \"black\")) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "f7ecc76a4c0c686a5f30ec7006fe847e", "score": "0.5926317", "text": "isMovePossible(startSquare, endSquare) {\n return (startSquare + 6 === endSquare ||\n startSquare - 6 === endSquare ||\n startSquare + 10 === endSquare ||\n startSquare - 10 === endSquare ||\n startSquare + 15 === endSquare ||\n startSquare - 15 === endSquare ||\n startSquare + 17 === endSquare ||\n startSquare - 17 === endSquare);\n }", "title": "" }, { "docid": "e038eeac2e484ea18f0794a9e0ea0f46", "score": "0.5925609", "text": "function checkMove() {\n\n var emptytile = 0;\n var move = 0;\n for (var x = 0; x < xLength; x++) {\n for (var y = 0; y < yLength; y++) {\n if ($('.grid[data-line=' + y + '][data-column=' + x + ']').hasClass('empty')) {\n emptytile += 1;\n }\n }\n }\n if (emptytile == 0) {\n for (var x = 0; x < xLength; x++) {\n var i = x + 1;\n for (var y = 0; y < yLength; y++) {\n var j = y + 1;\n var valueyi = $('.grid[data-line=' + y + '][data-column=' + i + ']').html();\n var valuejx = $('.grid[data-line=' + j + '][data-column=' + x + ']').html();\n var valueyx = $('.grid[data-line=' + y + '][data-column=' + x + ']').html();\n if (Number(valueyx) == Number(valueyi) || Number(valueyx) == Number(valuejx)) {\n move += 1;\n }\n }\n }\n if (move == 0) {\n $('.grid').finish();\n endGame();\n }\n }\n }", "title": "" }, { "docid": "6b3d29124679e04250c62422dd444ae4", "score": "0.5923548", "text": "function canMove()\r\n{\r\n\tif(!inProgress)\r\n\t{\r\n\t\tif((parseInt(this.style.left)+parseInt(this.offsetWidth)) === parseInt(getXCoord()) && this.style.top===getYCoord())\r\n\t\t{\r\n\t\t\tthis.className = this.className + \" movablepiece\";\r\n\t\t\tmove=\"right\";\r\n\t\t}\r\n\t\telse if(parseInt(this.style.left) === (parseInt(getXCoord())+parseInt(this.offsetWidth)) && this.style.top===getYCoord())\r\n\t\t{\r\n\t\t\tthis.className = this.className + \" movablepiece\";\r\n\t\t\tmove= \"left\";\r\n\t\t}\r\n\t\telse if((parseInt(this.style.top)+parseInt(this.offsetHeight)) === parseInt(getYCoord()) && this.style.left===getXCoord())\r\n\t\t{\r\n\t\t\tthis.className = this.className + \" movablepiece\";\r\n\t\t\tmove= \"down\";\r\n\t\t}\r\n\t\telse if(parseInt(this.style.top) === (parseInt(getYCoord())+parseInt(this.offsetHeight)) && this.style.left===getXCoord())\r\n\t\t{\r\n\t\t\tthis.className = this.className + \" movablepiece\";\r\n\t\t\tmove= \"up\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tmove= \"none\";\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}", "title": "" }, { "docid": "5004e3fbfce52c3d3ee4ba6b2b98b637", "score": "0.5923062", "text": "function checkPosition() {\n\t\tif(mark == 1) {\n\t\t\tflag(this);\n\t\t\tmark = 0;\n\t\t\treturn;\n\t\t}\n\n\t\t// Does nothing if this piece is flagged\n\t\tif(this.innerHTML == \"?\") {\n\t\t\t// Unmarks the marked piece if the button \"unmark\" was selected\n\t\t\tif(unmark == 1) {\n\t\t\t\tthis.innerHTML = \"\";\n\t\t\t\tunmark = 0;\n\t\t\t}\n return;\n }\n\n\t\tlet board = document.getElementById(\"board\").children;\n\t\tlet i = 0;\n\t\tfor(i = 0; i < 256; i++) {\n\t\t\tlet piece = board[i];\n\t\t\tif(piece == this) {\n\t\t\t\tisMine(piece, i);\n\t\t\t\tthis.style.backgroundColor = \"#d9d9d9\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet numMines = 0;\n\n\t\t// Checks the top of the piece for mines\n\t\tif(i > 15) {\n\t\t\tnumMines = checkUp(board, numMines, i);\n\t\t}\n\n\t\t// Checks the bottom of the piece for mines\n\t\tif(i < 240) {\n\t\t\tnumMines = checkBottom(board, numMines, i);\n\t\t}\n\n\t\t// Checks right of the piece for mines\n\t\tif((i + 1) % 16 != 0) {\n\t\t\tlet other = board[i + 1];\n\t\t\tif(other.className == \"mine\") {\n\t\t\t\tnumMines += 1;\n\t\t\t}\n\t\t}\n\n\t\t// Checks left of the piece for mines\n\t\tif(i % 16 != 0 && i != 0) {\n \t \tlet other = board[i - 1];\n \t\tif(other.className == \"mine\") {\n \t numMines += 1;\n }\n }\n\n\t\tif(numMines != 0 && this.className != \"mine\") {\n\t\t\tthis.innerHTML = numMines.toString();\n\t\t\tnumColor(this);\n\t\t}\n\t\tthis.onmouseover = null;\n\t\tthis.onclick = null;\n\t\tuncovered += 1;\n\n\t\tif(uncovered == (256 - totMines)) {\n\t\t\tisOver();\n\t\t}\n\t}", "title": "" }, { "docid": "01712041b2c6aaaa9dd7cedcec0f1de6", "score": "0.59176487", "text": "function validQueenMove(state){\n return validBishopMove(state) || validRookMove(state);\n}", "title": "" }, { "docid": "9a736cf006002e5b0733583c59d42db8", "score": "0.5915284", "text": "function nextMove(choice)\r\n{\r\n \r\n if(choice.textContent!==\" \" || winner!==null)\r\n {\r\n return;\r\n }\r\n turn++;\r\n for(var i=firstIndex;i<=lastIndex;i++)\r\n {\r\n if(\"s\"+array[i][turn-1]==choice.id)\r\n {\r\n firstIndex = i;\r\n break;\r\n }\r\n }\r\n\r\n for(var i=lastIndex;i>=firstIndex;i--)\r\n {\r\n if(\"s\"+array[i][turn-1]==choice.id)\r\n {\r\n lastIndex = i;\r\n break;\r\n }\r\n }\r\n\r\n choice_history.push(parseInt(choice.id[1]));\r\n choice.textContent = 'X'; \r\n choice.style.color=\"#FBFF12\";\r\n\r\n\r\n CPUturn(); \r\n \r\n}", "title": "" }, { "docid": "8d212c36139979ccf9007488a71a722f", "score": "0.5914694", "text": "function enableMovablePieces()\n {\n let maxImportance = 0;\n for(let i = 0; i < 20; i++)\n {\n let piece = board.allies[\"a\"+i];\n if(piece.alive)\n {\n let importance = new validMovesCollection(piece).importance;\n if(importance > maxImportance) { maxImportance = importance; } \n }\n }\n if(maxImportance == 0) { return false; }\n\n for(let i = 0; i < 20; i++)\n {\n let piece = board.allies[\"a\"+i];\n if(piece.alive)\n {\n let moves = new validMovesCollection(piece);\n if(moves.importance == maxImportance)\n {\n piece.possibleTurn = true;\n piece.moves = moves;\n\n setPieceColor(piece, \"Orange\");\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "0db7c25ea43a55078777560de626b86a", "score": "0.591298", "text": "function chooseWin(agent, board) {\n for (var i = 0; i < agent.myCells.length; i++) {\n for (var j = i + 1; j < agent.myCells.length; j++) {\n var cellNeeded = 15 - agent.myCells[i] - agent.myCells[j];\n if (agent.freeCells.contains(cellNeeded)) {\n return cellNeeded;\n }\n }\n }\n}", "title": "" }, { "docid": "14e36160e6e5c18b639622f5f96af810", "score": "0.59056365", "text": "function checkAttack(check, x, y, negX, negY, squareMove, direction) {\n if (check.coordX * negX >= x * negX && check.coordY * negY <= y * negY &&\n block[check.occupied_square + squareMove].occupied && block[check.occupied_square +\n squareMove].pieceId.color != check.color && !block[check.occupied_square + squareMove * 2].occupied) {\n mustAttack = true;\n direction = check.occupied_square + (squareMove * 2);\n block[direction].id.style.background = \"url('Black Square - Highlight.jpg')\";\n return direction;\n } else {\n direction = undefined;\n return direction;\n }\n}", "title": "" }, { "docid": "ee4b11480d66602a381344a7634df856", "score": "0.5899105", "text": "function isAttackingKing(state, move){\n\t\tlet color = (state[move.ex][move.ey] & PIECE_MASK) === B ? B : WHITE_MASK;\n\t\tif(color !== B){\n\t\t\treturn false; //its a defender\n\t\t}\n\t\tif(state[move.ex+1]){console.log(\"right: \"+state[move.ex+1][move.ey] );}\n\t\tif(state[move.ex-1]){console.log(\"left: \"+state[move.ex-1][move.ey]);}\n\t\tconsole.log(\"down: \"+state[move.ex][move.ey+1]);\n\t\tconsole.log(\"up: \"+state[move.ex][move.ey-1]);\n\t\treturn (state[move.ex+1] && state[move.ex+1][move.ey] && (state[move.ex+1][move.ey] & K) > 0) ||\n\t\t (state[move.ex-1] && state[move.ex-1][move.ey] && (state[move.ex-1][move.ey] & K) > 0) ||\n\t\t (state[move.ex][move.ey+1] && (state[move.ex][move.ey+1] & K) > 0) ||\n\t\t (state[move.ex][move.ey-1] && (state[move.ex][move.ey-1] & K) > 0);\n\t}", "title": "" }, { "docid": "ee4b11480d66602a381344a7634df856", "score": "0.5899105", "text": "function isAttackingKing(state, move){\n\t\tlet color = (state[move.ex][move.ey] & PIECE_MASK) === B ? B : WHITE_MASK;\n\t\tif(color !== B){\n\t\t\treturn false; //its a defender\n\t\t}\n\t\tif(state[move.ex+1]){console.log(\"right: \"+state[move.ex+1][move.ey] );}\n\t\tif(state[move.ex-1]){console.log(\"left: \"+state[move.ex-1][move.ey]);}\n\t\tconsole.log(\"down: \"+state[move.ex][move.ey+1]);\n\t\tconsole.log(\"up: \"+state[move.ex][move.ey-1]);\n\t\treturn (state[move.ex+1] && state[move.ex+1][move.ey] && (state[move.ex+1][move.ey] & K) > 0) ||\n\t\t (state[move.ex-1] && state[move.ex-1][move.ey] && (state[move.ex-1][move.ey] & K) > 0) ||\n\t\t (state[move.ex][move.ey+1] && (state[move.ex][move.ey+1] & K) > 0) ||\n\t\t (state[move.ex][move.ey-1] && (state[move.ex][move.ey-1] & K) > 0);\n\t}", "title": "" }, { "docid": "fe46208c77faf266bed5d1b69249dc08", "score": "0.5897568", "text": "checkPossibleMove(destination, isEnemyAtDestination) {\n var move = [\n destination[0] - this.position[0], \n destination[1] - this.position[1]\n ];\n\n if (isEnemyAtDestination) {\n return this.checkListForTuple(this.captureMoveSet, move);\n\n } else if (this.position[0] === this.startingRow) {\n\n return this.checkListForTuple(this.firstMoveSet, move);\n \n } else {\n return this.checkListForTuple(this.moveSet, move);\n };\n }", "title": "" }, { "docid": "dbe61d6b0a667e0a2435d2bf4de88230", "score": "0.5896479", "text": "isMoveLegal(x,y,diagonal){\r\n if(diagonal){\r\n //console.log(\"Diagonal\");\r\n let xs=x; let ys=y;\r\n if(x>this.x){\r\n //console.log(\"X>this.x\");\r\n if(y>this.y){\r\n while(xs>this.x && ys>this.y){\r\n let spot = this.board.checkSpot(xs,ys);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n xs--; ys--;\r\n }\r\n }\r\n else{\r\n while(xs>this.x && ys<this.y){\r\n let spot = this.board.checkSpot(xs,ys);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n xs--; ys++;\r\n }\r\n }\r\n }\r\n else{\r\n if(y>this.y){\r\n while(xs<this.x && ys>this.y){\r\n let spot = this.board.checkSpot(xs,ys);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n xs++; ys--;\r\n }\r\n }\r\n else{\r\n while(xs<this.x && ys<this.y){\r\n let spot = this.board.checkSpot(xs,ys);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n xs++; ys++;\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n //console.log(\"Moving striaght\");\r\n if(x==this.x){\r\n //console.log(\"X is the same\");\r\n if(y>this.y){\r\n //console.log(\"y>this.y\");\r\n for(var i=y; i>this.y; i--){\r\n let spot=this.board.checkSpot(x,i);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n }\r\n }\r\n else{\r\n //console.log(\"y<this.y\");\r\n for(var i=y; i<this.y; i++){\r\n let spot=this.board.checkSpot(x,i);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n if(y==this.y){\r\n //console.log(\"Y is the same\");\r\n if(x>this.x){\r\n //console.log(\"x>this.x\");\r\n for(var i=x; i>this.x; i--){\r\n let spot=this.board.checkSpot(i,this.y);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n }\r\n }\r\n else{\r\n //console.log(\"x>this.x\");\r\n for(var i=x; i<this.x; i++){\r\n let spot=this.board.checkSpot(i,this.y);\r\n if(spot!=null && spot.player==this.player){\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "9dd7c104b2b54e371dafc310034771d6", "score": "0.58916813", "text": "function checkVictory() {\n\t\t\t/* checked based on position */\n\n\t\t\tif (field1 == selected && field2 == selected && field3 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field1 == selected && field5 == selected && field9 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field3 == selected && field5 == selected && field7 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field4 == selected && field5 == selected && field6 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field7 == selected && field8 == selected && field9 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field1 == selected && field4 == selected && field7 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field2 == selected && field5 == selected && field8 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field3 == selected && field6 == selected && field9 == selected) {\n\t\t\t\tvictory();\n\t\t\t}\n\t\t\tif (field1 == comp_selected && field2 == comp_selected && field3 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field1 == comp_selected && field5 == comp_selected && field9 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field3 == comp_selected && field5 == comp_selected && field7 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field4 == comp_selected && field5 == comp_selected && field6 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field7 == comp_selected && field8 == comp_selected && field9 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field1 == comp_selected && field4 == comp_selected && field7 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field2 == comp_selected && field5 == comp_selected && field8 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (field3 == comp_selected && field6 == comp_selected && field9 == comp_selected) {\n\t\t\t\tdefeat();\n\t\t\t}\n\t\t\tif (count == 9) {\n\t\t\t\tdrawGame();\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b146e4e3f0d0a5185e6feaa9c028f224", "score": "0.58883244", "text": "function occupied ( i, j ) {\r\n\t\tif ( GRID1[i][j] == GRID_WALL)\r\n\t\t\treturn true;\r\n\t\tif ( GRID1[i][j] == GRID_MAZE && agentFloor == -50) \r\n\t\t\treturn true;\r\n\r\n\t\tif ( GRID2[i][j] == GRID_WALL) \r\n\t\t\treturn true;\r\n\t\tif ( GRID2[i][j] == GRID_MAZE && agentFloor == 950) \r\n\t\t\treturn true;\r\n\r\n\t\tif ( GRID3[i][j] == GRID_WALL) \r\n\t\t\treturn true;\r\n\t\tif ( GRID3[i][j] == GRID_MAZE && agentFloor == 1950) \r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "84b5381be83209d46403aaff6f60a92f", "score": "0.5884951", "text": "function move(piece, x, y) {\n\tif (getPiece(x, y) !== null) return false;\n\tif (((piece.isWhite && y > piece.y) || (!piece.isWhite && y < piece.y)) && !piece.isKing) return false;\n\treturn true;\n}", "title": "" }, { "docid": "fe87f11476b030ff6a6d409d6fda0f42", "score": "0.5883812", "text": "isValidPiece(piece) {\n let valid = true;\n\n return piece.forActivePixels((pixelX, pixelY) => {\n const x = piece.x + pixelX;\n const y = piece.y + pixelY;\n\n if (x < 0 || x >= this.columns) {\n return false;\n }\n\n if (y < 0 || y >= this.rows) {\n return false;\n }\n\n if (this.board[y][x]) {\n return false;\n }\n\n return true;\n });\n }", "title": "" }, { "docid": "b5fedeebbff7534f2ebd8355aa321a1e", "score": "0.588216", "text": "function checkForMovable() {\n var selection = 0;\n for (var i = 0; i < ROWS; i++) {\n for(var j = 0; j < COLUMNS; j++) {\n if (PUZZLECOORDINATES[i][j] != 0) {\n if(((i - 1) >= 0) && PUZZLECOORDINATES[i - 1][j] == 0) {\n selection = PUZZLECOORDINATES[i][j];\n document.getElementById(\"piece \" + selection).className = \"grid-container-item-moveable\";\n }\n else if (((i + 1) < ROWS) && PUZZLECOORDINATES[i + 1][j] == 0) {\n selection = PUZZLECOORDINATES[i][j];\n document.getElementById(\"piece \" + selection).className = \"grid-container-item-moveable\";\n }\n else if (((j - 1) >= 0) && PUZZLECOORDINATES[i][j - 1] == 0) {\n selection = PUZZLECOORDINATES[i][j];\n document.getElementById(\"piece \" + selection).className = \"grid-container-item-moveable\";\n }\n else if (((j + 1) < COLUMNS) && PUZZLECOORDINATES[i][j + 1] == 0) {\n selection = PUZZLECOORDINATES[i][j];\n document.getElementById(\"piece \" + selection).className = \"grid-container-item-moveable\";\n }\n else {\n selection = PUZZLECOORDINATES[i][j];\n document.getElementById(\"piece \" + selection).className = \"grid-container-item\";\n }\n }\n }\n }\n}", "title": "" }, { "docid": "c3543780cd05b7fa5c76d9a59da3dcb8", "score": "0.5880777", "text": "checkUpperLeftToLowerRight(x, y, playerId) {\r\n //Includes piece that was just placed\r\n let connectedPieces = 1;\r\n //Check upper left\r\n connectedPieces += this.checkForConnected(x, y, playerId, (x,i) => x - i, (y,i) => y + i);\r\n //Check lower right\r\n connectedPieces += this.checkForConnected(x, y, playerId, (x,i) => x + i, (y,i) => y - i);\r\n \r\n if(connectedPieces > 3) return true;\r\n \r\n return false;\r\n }", "title": "" }, { "docid": "8ace2bd341eb2e60b9da5a78ea6cc775", "score": "0.587938", "text": "function validateMove()\r\n{\r\n \r\n var moveType = checkIfValidMove(oldDivId, newDivId)\r\n if (moveType<2 && mustJumpPieces.includes(oldDivId))\r\n return false\r\n if(moveType > 0)\r\n {\r\n clearMarks(\"blue\")\r\n hasAnotherJump = false\r\n if(moveType == 2) // If the piece is jumping\r\n {\r\n removePiece('tile'+middleTileX+middleTileY) //Capture a piece\r\n hasAnotherJump = true\r\n }\r\n \r\n if(assignPiece(event)) \r\n hasAnotherJump = false //End turn if became king\r\n \r\n if(hasAnotherJump){\r\n if(checkPieceMovable(newDivId) == 2){ //Check if another jump in the same turn is possible\r\n mustJumpPieces.push(newDivId)\r\n print(\"Another jump is mandatory\")\r\n hasAnotherJump = true\r\n }else hasAnotherJump = false\r\n }\r\n\r\n return true\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "719697d7aff5da6e53f735c506aca743", "score": "0.58782876", "text": "function detect_win() {\n var win = true;\n for( k = 0 ; k < 8 ; k++ ) {\n if ( (pieces[k].initial_x != pieces[k].x ) || (pieces[k].initial_y != pieces[k].y )) {\n win = false;\n }\n }\n if (win) {\n $('#total_moves').html( moves );\n $('.fixed-piece').css('opacity', 1);\n $('#win').show();\n $('#play').prop( 'disabled', false );\n empty_piece.x = 10;\n empty_piece.y = 10;\n }\n }", "title": "" }, { "docid": "57b0232bff1133ada825c8b388e19a6f", "score": "0.5870869", "text": "function check_winner () {\n //compare current \"o\" occupied spaces to an array holding all winning combinations\n for ( i = 0; i < win.length; i++ ) {\n \n if ( o_spaces.indexOf(win[i][0]) !== -1 && o_spaces.indexOf(win[i][1]) !== -1 && o_spaces.indexOf(win[i][2]) !== -1 ) {\n console.log(\"o has won\");\n // o wins! move grid to left, show the \"o wins\" text and pic\n document.getElementById(\"start_game\").style.display = \"none\";\n document.getElementById(\"grid\").style.margin = \"0 100px\";\n document.getElementById(\"grid\").style.float = \"left\";\n document.getElementById(\"tie_game\").style.display = \"none\";\n document.getElementById(\"who_wins\").style.display = \"inline-block\";\n return true;\n }\n \n if ( x_spaces.indexOf(win[i][0]) !== -1 && x_spaces.indexOf(win[i][1]) !== -1 && x_spaces.indexOf(win[i][2]) !== -1 ) {\n console.log(\"x has won\");\n // x wins! move grid to left, show the \"x wins\" text and pic\n document.getElementById(\"start_game\").style.display = \"none\";\n document.getElementById(\"grid\").style.margin = \"0 100px\";\n document.getElementById(\"grid\").style.float = \"left\";\n document.getElementById(\"tie_game\").style.display = \"none\";\n document.getElementById(\"who_wins\").style.display = \"inline-block\";\n document.getElementById(\"declare_winner\").style.backgroundImage = \"url(img/x.png)\";\n return true;\n }\n }\n\n if ( o_spaces.length + x_spaces.length == 9) {\n console.log(\"tie game\");\n // tie game! move grid to left, show the \"its a tie\" text and pic\n document.getElementById(\"start_game\").style.display = \"none\";\n document.getElementById(\"grid\").style.margin = \"0 100px\";\n document.getElementById(\"grid\").style.float = \"left\";\n document.getElementById(\"who_wins\").style.display = \"inline-block\";\n document.getElementById(\"declare_winner\").style.display = \"none\";\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "c000750ff587df527ca163cd8fae7219", "score": "0.58674616", "text": "function checkOkMove(oldLocX, oldLocY, locX, locY) {\n var savePiece = cells[oldLocY][oldLocX]; // save piece should be selected piece\n var oldText = document.getElementById(\"checkLoc\").innerHTML;\n // Check to see if the piece to be moved would cause the player to be in check if moved \n // (Moving a random piece or moving a piece that is preventing check), if moving the king skip this step\n updateCell(oldLocX, oldLocY, null);\n if (savePiece != whiteKing && savePiece != blackKing) {\n checkCheck(!playerTurn);\n if (inCheck) {\n inCheck = false;\n // cells[oldLocY][oldLocX] = savePiece;\n } else {\n updateCell(locX, locY, savePiece);\n document.getElementById(\"checkLoc\").innerHTML = oldText;\n return true;\n }\n }\n // Check to see if moving the piece to the new location would cause check (Moving King or Taking Piece)\n // cells[locY][locX] = savePiece;\n var savePiece2 = cells[locY][locX];\n removePiece((locY*10)+locX);\n updateCell(locX, locY, savePiece);\n checkCheck(!playerTurn);\n if (inCheck) {\n inCheck = false;\n // cells[locY][locX] = null;\n updateCell(oldLocX, oldLocY, savePiece);\n updateCell(locX, locY, savePiece2);\n if (!playerTurn) {\n //Got rid of a white piece to see\n for (const key in whitePieces) {\n if (whitePieces[key] == null) {\n whitePieces[key] = savePiece2;\n }\n }\n } else {\n //Got rid of a black piece to see\n for (const key in blackPieces) {\n if (blackPieces[key] == null) {\n blackPieces[key] = savePiece2;\n }\n }\n }\n document.getElementById(\"checkLoc\").innerHTML = \"This move would put you in check or keep you in check\";\n return false;\n }\n updateCell(oldLocX, oldLocY, selectedPiece);\n updateCell(locX, locY, savePiece2);\n document.getElementById(\"checkLoc\").innerHTML = oldText;\n return true;\n}", "title": "" }, { "docid": "d3e608bcab8f91f2386a41eba563d3c2", "score": "0.58667505", "text": "function evaluatePos(pos, square){\n pos[square] = ai;\n var evaluation = 0;\n //Prefer center over corners over edges\n //evaluation -= (pos[0]*0.2+pos[1]*0.1+pos[2]*0.2+pos[3]*0.1+pos[4]*0.25+pos[5]*0.1+pos[6]*0.2+pos[7]*0.1+pos[8]*0.2);\n var points = [0.2, 0.17, 0.2, 0.17, 0.22, 0.17, 0.2, 0.17, 0.2];\n\n var a = 2;\n evaluation+=points[square];\n //console.log(\"Eyy\");\n //Prefer creating pairs\n a = -2;\n if(pos[0] + pos[1] + pos[2] === a || pos[3] + pos[4] + pos[5] === a || pos[6] + pos[7] + pos[8] === a || pos[0] + pos[3] + pos[6] === a || pos[1] + pos[4] + pos[7] === a ||\n pos[2] + pos[5] + pos[8] === a || pos[0] + pos[4] + pos[8] === a || pos[2] + pos[4] + pos[6] === a) {\n evaluation += 1;\n }\n //Take victories\n a = -3;\n if(pos[0] + pos[1] + pos[2] === a || pos[3] + pos[4] + pos[5] === a || pos[6] + pos[7] + pos[8] === a || pos[0] + pos[3] + pos[6] === a || pos[1] + pos[4] + pos[7] === a ||\n pos[2] + pos[5] + pos[8] === a || pos[0] + pos[4] + pos[8] === a || pos[2] + pos[4] + pos[6] === a) {\n evaluation += 5;\n }\n\n //Block a players turn if necessary\n pos[square] = player;\n\n a = 3;\n if(pos[0] + pos[1] + pos[2] === a || pos[3] + pos[4] + pos[5] === a || pos[6] + pos[7] + pos[8] === a || pos[0] + pos[3] + pos[6] === a || pos[1] + pos[4] + pos[7] === a ||\n pos[2] + pos[5] + pos[8] === a || pos[0] + pos[4] + pos[8] === a || pos[2] + pos[4] + pos[6] === a) {\n evaluation += 2;\n }\n\n pos[square] = ai;\n\n evaluation-=checkWinCondition(pos)*15;\n\n pos[square] = 0;\n\n //evaluation -= checkWinCondition(pos)*4;\n\n return evaluation;\n}", "title": "" }, { "docid": "36cd26d685064739ea2de65ea6716822", "score": "0.5865775", "text": "check(team, boardState, enemyTeamSet) {\n // const enemy =\n // team == \"light\" ? this.state.darkTeam : this.state.lightTeam;\n const king =\n team == \"light\"\n ? this.state.lightKing.position\n : this.state.darkKing.position;\n\n for (let en of enemyTeamSet.entries()) {\n const e = en[0];\n if (e.moveSet(e.position, boardState)[king.y][king.x]) {\n // console.log(\"Der Koenig von \" + team + \" steht im Schach\");\n // console.log(\"Grund dafuer ist:\");\n // console.log(e);\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "fe7c7d589b84469223e2d128eb2033cd", "score": "0.58629173", "text": "function AIfindBestMove(colour) {\n\n var row;\n\n //loop through all columns\n for(var col = 0; col < 7; col++)\n {\n //get the first empty row in the column\n row = checkColumn(col);\n\n //if a best move is found, do not continue searching\n if(columnFull == false)\n {\n\n //Check for 3 up\n if(row > 1)\n {\n //check for 2 upwards, replace aiCol if there is 3 upwards\n if(grid[row-1][col] == colour && grid[row-2][col] == colour)\n {\n\n if(row > 2 && grid[row-3][col] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n }\n //Check for 3 to the right\n //XOOO//\n if(grid[row][col+1] == colour && grid[row][col+2] == colour && grid[row][col+3] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n //Check for 3 to the left\n //OOOX//\n if(grid[row][col-1] == colour && grid[row][col-2] == colour && grid[row][col-3] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n //OOXO//\n if(grid[row][col+1] == colour && grid[row][col-1] == colour && grid[row][col-2] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n //OXOO//\n if(grid[row][col-1] == colour && grid[row][col+1] == colour && grid[row][col+2] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n /////O//\n ////O///\n ///O////\n //X/////\n if (row < 3)\n {\n if(grid[row+1][col+1] == colour && grid[row+2][col+2] == colour && grid[row+3][col+3] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n /////X//\n ////O///\n ///O////\n //O/////\n if (row > 2)\n {\n if(grid[row-1][col-1] == colour && grid[row-2][col-2] == colour && grid[row-3][col-3] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n //O/////\n ///O////\n ////O///\n /////X//\n if (row < 3)\n {\n if(grid[row+1][col-1] == colour && grid[row+2][col-2] == colour && grid[row+3][col-3] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n //X/////\n ///O////\n ////O///\n /////O//\n if (row > 2)\n {\n if(grid[row-1][col+1] == colour && grid[row-2][col+2] == colour && grid[row-3][col+3] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n /////O//\n ////O///\n ///X////\n //O/////\n if(row > 0 && row < 4)\n {\n if(grid[row-1][col-1] == colour && grid[row+1][col+1] == colour && grid[row+2][col+2] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n /////O//\n ////X///\n ///O////\n //O/////\n if(row > 1 && row < 5)\n {\n if(grid[row-1][col-1] == colour && grid[row-2][col-2] == colour && grid[row+1][col+1] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n //O/////\n ///O////\n ////X///\n /////O//\n if(row > 0 && row < 4)\n {\n if(grid[row-1][col+1] == colour && grid[row+1][col-1] == colour && grid[row+2][col-2] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n //O/////\n ///X////\n ////O///\n /////O//\n if(row > 1 && row < 5)\n {\n if(grid[row-1][col+1] == colour && grid[row-2][col+2] == colour && grid[row+1][col-1] == colour)\n {\n aiCol = col;\n bestMove = true;\n return true;\n }\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "587024b836b903a4bd9301f889126a4d", "score": "0.5858163", "text": "is_goal_state(state)\n {\n var white_won = true\n var black_won = true\n for(var r=0; r<BOARD_DIM; r++){\n for(var c=0; c<BOARD_DIM; c++){\n if(this.isEnemy(state,'white',r,c))\n white_won = false\n if(this.isEnemy(state,'black',r,c))\n black_won = false\n if(!white_won && !black_won)\n return false\n }\n }\n return true\n }", "title": "" }, { "docid": "007e0bc2190cf4d78f59c418936c63eb", "score": "0.58544475", "text": "function isValidMove(x,y){\n\tif (isValidSpot(x,y) == 0) return false;\n\tif ((Math.abs(x-selectedX)==1)&&((Math.abs(y-selectedY)==0))) return true;\n\tif ((Math.abs(x-selectedX)==0)&&((Math.abs(y-selectedY)==1))) return true;\n\treturn false;\n}", "title": "" }, { "docid": "65500b006c02bbff354564b5fe1b008f", "score": "0.58453053", "text": "function movesExhausted() {\n\tfor(var i = 0; i < board_state.length; i ++) {\n\t\tif(board_state[i] == -1)\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "5b8df2f3d669fdc47c2814f05cc8fbf5", "score": "0.5845017", "text": "performMoveWhenPossible(from, to) {\n // shallow copy des Array\n const current = this.state.current.slice(0);\n const possibleMoves = this.state.possibleMoves;\n const figure = current[from.y][from.x];\n const enemy = current[to.y][to.x];\n const friendTeamSet =\n figure.team == \"light\" ? this.state.lightTeam : this.state.darkTeam;\n const enemyTeam = figure.team == \"light\" ? \"dark\" : \"light\";\n if (possibleMoves[to.y][to.x]) {\n // Bauer kann nur einmal am Anfang 2 Felder ziehen\n if (figure.type == \"pawn\") figure.moved = true;\n // Aktualisieren der Positionen der Koenig\n // if (figure.type == \"king\")\n // if (figure.team == \"light\")\n // this.setState({\n // lightKing: to,\n // });\n // else\n // this.setState({\n // darkKing: to,\n // });\n\n // Positon der Figur aktualisieren\n figure.position = to;\n // Figur aus set loeschen, wenn diese geschlagen wird\n if (enemy)\n if (enemy.team == \"light\") this.state.lightTeam.delete(enemy);\n else this.state.darkTeam.delete(enemy);\n\n current[to.y][to.x] = current[from.y][from.x];\n current[from.y][from.x] = null;\n\n if (this.check(enemyTeam, current, friendTeamSet)) {\n if (this.checkmate(enemyTeam, current)) {\n console.log(enemyTeam + \" hat verloren!\");\n }\n }\n return current;\n }\n return false;\n }", "title": "" }, { "docid": "ccfc1becadb26eb5160db96321ec8efa", "score": "0.5835829", "text": "function kingVulnerable(pos, color, nextPos, kingPiece)\n{\n //alert(\"king vulnerable called\");\n let kingElem;\n let kignSquare;\n // just added this in\n if(!kingPiece)\n {\n if(color == \"white\")\n {\n kingElem = document.getElementById(\"whiteKing\");\n }\n else\n {\n kingElem = document.getElementById(\"blackKing\");\n }\n kingSquare = kingElem.parentNode;\n let vertCheck = verticalCheck(kingSquare.id, color, pos, nextPos);\n //alert(\"King in danger vertically: \" + vertCheck);\n let horizCheck = horizontalCheck(kingSquare.id, color, pos, nextPos);\n //alert(\"King in danger horizontally: \" + horizCheck);\n let diagCheck = diagonalCheck(kingSquare.id, color, pos, nextPos);\n //alert(\"King in danger diagonally: \" + diagCheck);\n let knightValid = knightCheck(kingSquare.id, color, pos, nextPos);\n //alert(\"King in danger from knight: \" + knightValid);\n if(vertCheck || horizCheck || diagCheck || knightValid)\n {\n return true;\n }\n return false;\n }\n else\n {\n let vertCheck = verticalCheck(nextPos, color, pos, nextPos);\n let horizCheck = horizontalCheck(nextPos, color, pos, nextPos);\n let diagCheck = diagonalCheck(nextPos, color, pos, nextPos);\n let knightValid = knightCheck(nextPos, color, pos, nextPos);\n if(vertCheck || horizCheck || diagCheck || knightValid)\n {\n return true;\n }\n return false;\n }\n}", "title": "" }, { "docid": "e6c8bbdcbd37ced9e97f44b0739e2c8c", "score": "0.5831866", "text": "function collision(x, y, piece){\n\tfor(let r = 0; r < piece.length; r++){\n\t\tfor(let c = 0; c < piece.length; c++){\n\t\t\tif(piece[r][c] === 0){\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet newX = X + c + x;\n\t\t\tlet newY = Y +r + y;\n\t\t\tif(newX < 0 || newX >= COL || newY >= ROW){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(newY > -1){\n\t\t\t\tif(board[newY][newX] != empty){\n\t\t\t\t\treturn true;\n\t\t\t\t};\t\t\t\n\t\t\t};\n\t\t};\n\t};\n\treturn false;\t\t\n}", "title": "" }, { "docid": "27bfeb55ab793bc0e67cba882ec474eb", "score": "0.58230823", "text": "function lineCombination(occupied1, occupied2, empty, piece) {\n if ($scope.grid[occupied1.row][occupied1.col] == piece &&\n $scope.grid[occupied2.row][occupied2.col] == piece &&\n $scope.grid[empty.row][empty.col] == \"-\") {\n $scope.grid[empty.row][empty.col] = \"X\";\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "c47c90ef20c7d86a0ab84f360dd188bd", "score": "0.58206254", "text": "function aiMove() {\n if(moves.length === 1) {\n //If user moves to the middle on first move, move to bottom left\n if($scope.squares.data[4].val) {\n aiMoveSet(6);\n }\n //If user moves to a corner on first move, move to the middle\n else {\n aiMoveSet(4);\n }\n }\n else {\n ifAICanWin();\n if(!$scope.gameEnded.gameover) {\n //If AI's first move was the middle, now move to edges and block human player\n if($scope.squares.data[4].val === 'O') {\n if($scope.squares.data[0].val === 'X' && $scope.squares.data[1].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[1].val) {\n aiMoveSet(1);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[3].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[3].val) {\n aiMoveSet(3);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[5].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[5].val) {\n aiMoveSet(5);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[7].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[7].val) {\n aiMoveSet(7);\n }\n //Blocking all 4 corners if necessary\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[5].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[3].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n //Move were all blocked, move to next available space\n else {\n aiChooseAvailSpaceMiddleFirst();\n }\n }\n //If Players first move was the middle, now block or win\n else {\n if($scope.squares.data[0].val === 'X' && $scope.squares.data[1].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[1].val) {\n aiMoveSet(1);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[3].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[3].val) {\n aiMoveSet(3);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[5].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[5].val) {\n aiMoveSet(5);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[7].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[7].val) {\n aiMoveSet(7);\n }\n //Account for the middle space also since the user has moved into that space\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[8].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[5].val) {\n aiMoveSet(5);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[3].val) {\n aiMoveSet(3);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[7].val) {\n aiMoveSet(7);\n }\n else if($scope.squares.data[7].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[1].val) {\n aiMoveSet(1);\n }\n //Move was blocked, move to next available space\n else {\n aiChooseAvailSpaceOther();\n }\n }\n }\n }\n }", "title": "" }, { "docid": "bb97d8b10a2cbd4f6102450ab409d096", "score": "0.5818036", "text": "function fullCheck(){\n let ans=0;\n if(gameMap.get(me.shipyard.position).isOccupied){\n ans++;\n }\n if(gameMap.get(me.shipyard.position.directionalOffset(Direction.North)).isOccupied){\n ans++;\n }\n if(gameMap.get(me.shipyard.position.directionalOffset(Direction.South)).isOccupied){\n ans++;\n }\n if(gameMap.get(me.shipyard.position.directionalOffset(Direction.East)).isOccupied){\n ans++;\n }\n if(gameMap.get(me.shipyard.position.directionalOffset(Direction.West)).isOccupied){\n ans++;\n }\n return ans;\n }", "title": "" }, { "docid": "034360cb5648a71bebb36aec23970ca4", "score": "0.5812723", "text": "function validKingMove(state){\n console.log('kingmove',state)\n if ((Math.abs(state.origin[0] - state.dest[0]) < 2) && (Math.abs(state.origin[1] - state.dest[1]) < 2)) {\n if (state.turn === 'w') {\n state.whiteKingPos = state.dest\n } else {\n state.blackKingPos = state.dest\n }\n return true\n } else if(state.dest[0] === 7 && state.dest[1] == 6 && state.whiteKingSideCastle && noHorizontalJump(state)) {\n state.board[7][7]='empty'\n state.board[7][5]='w-r'\n return true\n } else if(state.dest[0] === 7 && state.dest[1] == 2 && state.whiteQueenSideCastle && noHorizontalJump(state)) {\n state.board[7][0]='empty'\n state.board[7][3]='w-r'\n return true\n } else if(state.dest[0] === 0 && state.dest[1] == 6 && state.blackKingSideCastle && noHorizontalJump(state)) {\n state.board[0][7]='empty'\n state.board[0][5]='b-r'\n return true\n } else if(state.dest[0] === 0 && state.dest[1] == 2 && state.blackQueenSideCastle && noHorizontalJump(state)) {\n state.board[0][0]='empty'\n state.board[0][3]='b-r'\n return true\n }\n else {\n return false\n }\n}", "title": "" }, { "docid": "c49a629e043e089f1240e1ef4b426f0b", "score": "0.58101875", "text": "function winGame(coordinates,move,gridSize,dimensions) {\n //check = coordinates.filter(x => !move.includes(x));\n if(coordinates.length<gridSize-1) {\n return false;\n }\n var combos = Combinatorics.bigCombination(coordinates,gridSize-1);\n var winBool = false;\n var check;\n var nullWin = null;\n while(check = combos.next()) {\n var group = check.slice();\n group.push(move);\n console.log(group);\n let possWin = checkWin(dimensions,gridSize,group);\n if(possWin) {\n nullWin = group;\n }\n winBool = (winBool || possWin);\n }\n var retObj = {\n win:winBool,\n condition:nullWin\n }\n return retObj;\n}", "title": "" }, { "docid": "c8f602deabe2688c78066a24eb4af8cc", "score": "0.57981986", "text": "function checkWinO(){\n if (sq1.hasClass(\"O\") && sq2.hasClass(\"O\") && sq3.hasClass(\"O\") || sq1.hasClass(\"O\") && sq4.hasClass(\"O\") && sq7.hasClass(\"O\") || sq1.hasClass(\"O\") && sq5.hasClass(\"O\") && sq9.hasClass(\"O\")){\n return oWin = true;\n } if (sq2.hasClass(\"O\") && sq5.hasClass(\"O\") && sq8.hasClass(\"O\")){\n return oWin = true;\n } if (sq3.hasClass(\"O\") && sq6.hasClass(\"O\") && sq9.hasClass(\"O\") || sq3.hasClass(\"O\") && sq5.hasClass(\"O\") && sq7.hasClass(\"O\")){\n return oWin = true;\n } if (sq4.hasClass(\"O\") && sq5.hasClass(\"O\") && sq6.hasClass(\"O\")){\n return oWin = true;\n } if (sq7.hasClass(\"O\") && sq8.hasClass(\"O\") && sq9.hasClass(\"O\")){\n return oWin = true;\n }\n}", "title": "" } ]
45b69bea97f24dc30367820cb1f69726
! The buffer module from node.js, for the browser.
[ { "docid": "b1917ed6cf3e869eca0713beaef43fc7", "score": "0.0", "text": "function i(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0}", "title": "" } ]
[ { "docid": "17ce006d6ec9963f5d2c5b13ad427fc6", "score": "0.80066925", "text": "function Buffer() {\n}", "title": "" }, { "docid": "dfc03ac224f884b10590b84e387bef0f", "score": "0.7769355", "text": "buffer() {\n throw new Error('Not implemented');\n }", "title": "" }, { "docid": "b9fa4965921ac535c0d5de0b2260c0c3", "score": "0.75165343", "text": "function Buffer (arg, encodingOrOffset, length) {}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.7284882", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.7284882", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "3e6ac72fc88a1a5278092a2566b67675", "score": "0.7148754", "text": "function Buffer(arg){if(!(this instanceof Buffer)){// Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;}// Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);}// Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');}// Unusual.\nreturn fromObject(this,arg);}", "title": "" }, { "docid": "3e6ac72fc88a1a5278092a2566b67675", "score": "0.7148754", "text": "function Buffer(arg){if(!(this instanceof Buffer)){// Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;}// Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);}// Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');}// Unusual.\nreturn fromObject(this,arg);}", "title": "" }, { "docid": "1f4e932f2b9d9c4519f7b883739f4c4c", "score": "0.7113112", "text": "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length > 1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}this.length = 0;this.parent = undefined; // Common case.\nif(typeof arg === 'number'){return fromNumber(this,arg);} // Slightly less common case.\nif(typeof arg === 'string'){return fromString(this,arg,arguments.length > 1?arguments[1]:'utf8');} // Unusual.\nreturn fromObject(this,arg);}", "title": "" }, { "docid": "107a85eb3bd48663a5895fec56074e0f", "score": "0.7022859", "text": "onBuffer(buffer) {\n console.log('onBuffer');\n console.log(buffer);\n }", "title": "" }, { "docid": "0a1e165be01e9d454df29c9d6accaef3", "score": "0.6926958", "text": "get buffer() {\n return this.request(`${this.prefix}get_buf`, []);\n }", "title": "" }, { "docid": "e2b5dc3e29bad80fa41dfdd417504038", "score": "0.6891944", "text": "SetBuffer() {}", "title": "" }, { "docid": "369235a600e0d9abee89a848602c093b", "score": "0.68065274", "text": "function Buffer (arg) {\r\n if (!(this instanceof Buffer)) {\r\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\r\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\r\n return new Buffer(arg)\r\n }\r\n\r\n this.length = 0\r\n this.parent = undefined\r\n\r\n // Common case.\r\n if (typeof arg === 'number') {\r\n return fromNumber(this, arg)\r\n }\r\n\r\n // Slightly less common case.\r\n if (typeof arg === 'string') {\r\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\r\n }\r\n\r\n // Unusual.\r\n return fromObject(this, arg)\r\n}", "title": "" }, { "docid": "4f0046acb597caa8791b6b3fb32ff9b5", "score": "0.679456", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t this.length = 0\n\t this.parent = undefined\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "f317c1fd3f2821cfebc52b721ef4a3f0", "score": "0.6785041", "text": "function Buffer (arg) {\n\t\t if (!(this instanceof Buffer)) {\n\t\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t return new Buffer(arg)\n\t\t }\n\t\n\t\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t\t this.length = 0\n\t\t this.parent = undefined\n\t\t }\n\t\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t return fromNumber(this, arg)\n\t\t }\n\t\n\t\t // Slightly less common case.\n\t\t if (typeof arg === 'string') {\n\t\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t }\n\t\n\t\t // Unusual.\n\t\t return fromObject(this, arg)\n\t\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.67571044", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.67571044", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.67571044", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.67571044", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.67571044", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.67571044", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "a54eabb1f304ac9f491ed025581da4b4", "score": "0.6753756", "text": "function _toBuffer(buffer) {\n var _buffer, nums;\n\n if (Buffer.isBuffer(buffer)) {\n _buffer = new Buffer(buffer.length);\n buffer.copy(_buffer);\n }\n else if (Array.isArray(buffer)) {\n _buffer = new Buffer(buffer);\n }\n else if (typeof buffer === 'string') {\n nums = buffer.replace(/^0x/i, '').match(/.{1,2}(?=(..)+(?!.))|..?$/g);\n _buffer = new Buffer(nums.length);\n\n _buffer.fill(0);\n\n for (var i = nums.length - 1; i >= 0; i--) {\n _buffer.writeUInt8(parseInt(nums[i], 16), i);\n }\n }\n\n return _buffer;\n }", "title": "" }, { "docid": "34f213208d722159064cdcbc408c73fd", "score": "0.6753038", "text": "get buffer() {\n return this._buffer;\n }", "title": "" }, { "docid": "34f213208d722159064cdcbc408c73fd", "score": "0.6753038", "text": "get buffer() {\n return this._buffer;\n }", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6745795", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6745795", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6745795", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "edb249f71f9866f9cf417c5be8142d7d", "score": "0.67351615", "text": "toBuffer() {\n return Buffer.from(this.buf);\n }", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6726359", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6726359", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6726359", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6726359", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6726359", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6713478", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6697466", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6697466", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6697466", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6697466", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6697466", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "23312aa37c242874a3323faba55bf0b7", "score": "0.66956913", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66880316", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "e26ae2fa4a3d3cd3bca053e937bc3cf7", "score": "0.6667989", "text": "function Buffer(arg,encodingOrOffset,length){\n// Common case.\nif(typeof arg==='number'){\nif(typeof encodingOrOffset==='string'){\nthrow new TypeError(\n'The \"string\" argument must be of type string. Received type number');\n\n}\nreturn allocUnsafe(arg);\n}\nreturn from(arg,encodingOrOffset,length);\n}", "title": "" }, { "docid": "c9eea5ba914c050fd0b78820e9b4a709", "score": "0.66347855", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);} // Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627528", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "1080a8de1a16e5dd19b9e3be53b2b769", "score": "0.6596287", "text": "function isBuffer(value) {\n instanceOf(value, appendable_1.AppendableBuffer);\n}", "title": "" }, { "docid": "beef693b6e1ca8112a8542c0278b2f14", "score": "0.6594496", "text": "function Buffer(arg) {\n\t\t\t\t\t\tif (!(this instanceof Buffer)) {\n\t\t\t\t\t\t\t// Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t\t\t\t\t\tif (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t\t\t\t\t\treturn new Buffer(arg)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.length = 0\n\t\t\t\t\t\tthis.parent = undefined\n\n\t\t\t\t\t\t// Common case.\n\t\t\t\t\t\tif (typeof arg === 'number') {\n\t\t\t\t\t\t\treturn fromNumber(this, arg)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Slightly less common case.\n\t\t\t\t\t\tif (typeof arg === 'string') {\n\t\t\t\t\t\t\treturn fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Unusual.\n\t\t\t\t\t\treturn fromObject(this, arg)\n\t\t\t\t\t}", "title": "" }, { "docid": "406ff8b620434019f76fa1b780c1539f", "score": "0.6592771", "text": "get buffer() {\n return this._buffer;\n }", "title": "" }, { "docid": "406ff8b620434019f76fa1b780c1539f", "score": "0.6592771", "text": "get buffer() {\n return this._buffer;\n }", "title": "" }, { "docid": "406ff8b620434019f76fa1b780c1539f", "score": "0.6592771", "text": "get buffer() {\n return this._buffer;\n }", "title": "" }, { "docid": "e66aea82a0083d32669c9c995a2a520a", "score": "0.65701824", "text": "function buffer (data, cb) {\n worker(data, cb)\n }", "title": "" }, { "docid": "f0b81600040a57f8e84f44804161fc67", "score": "0.65562415", "text": "function Buffer(arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1)\n return new Buffer(arg, arguments[1]);\n return new Buffer(arg);\n }\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0;\n this.parent = undefined;\n }\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg);\n }\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n }\n // Unusual.\n return fromObject(this, arg);\n }", "title": "" }, { "docid": "13d299ad21de986181720870f491d3d2", "score": "0.6551984", "text": "function buffer() {\n return new (through.cork())();\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65465736", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" } ]
f1085c9d4731e6ebaad13d446fcd20d6
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
[ { "docid": "95636b697ad4b6f536f3503909339d05", "score": "0.0", "text": "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "title": "" } ]
[ { "docid": "5586f757e12f65008d7a1245e0628ee7", "score": "0.5533147", "text": "loadFbLoginApi() {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '287435505152197',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.5' // use version 2.1\n });\n };\n\n console.log(\"Loading fb api\");\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "title": "" }, { "docid": "9d8a78965e7afc54285a7ebdab5c0687", "score": "0.52758783", "text": "testAPI() {\n const { token } = this.state\n const { dispatch } = this.props\n window.FB.api('/me?fields=id,name,email,picture', function(response) {\n const oauth = {\n token,\n name: response.name,\n email: response.email,\n picture: response.picture.data.url,\n provider_user_id: response.id,\n }\n dispatch(handleLoginOAuth(oauth, 'facebook'))\n });\n }", "title": "" }, { "docid": "6a198f813f1f6d077a876135ea87c298", "score": "0.5257417", "text": "function isFacebook() {\n\treturn (robot.adapterName && robot.adapterName.toLowerCase() === 'fb');\n}", "title": "" }, { "docid": "68fde050a3b1ba3cbe6795913a4e7f24", "score": "0.5197854", "text": "function getLocalFB() {\n return localFB;\n}", "title": "" }, { "docid": "a22e8948b4669a0cefcb56b9caa35529", "score": "0.5196318", "text": "function facebookLogin()\r\n{\r\n alert(\"facebook\");\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "title": "" }, { "docid": "e9c53429ecd38c19c80cd2d8811b429b", "score": "0.51352435", "text": "getUserInfo() {\n console.log('Welcome! Fetching your information.... ')\n FB.api('/me', {fields: 'first_name, last_name, email, name, age_range, birthday, cover, gender, hometown, location, significant_other'}, (response) => this.handleUserResponse(response, this.props.actions.loginWithFacebook)) // eslint-disable-line\n }", "title": "" }, { "docid": "eb694b8daa4d2af11018de80991348b5", "score": "0.5084082", "text": "componentDidMount() {\n firebase.auth().onAuthStateChanged((user) => {\n if(user !=null) {\n console.log('Facebook Login:', user);\n }\n })\n }", "title": "" }, { "docid": "84b2d9d07cdd26eea4b7b290514f6487", "score": "0.50830185", "text": "_fbGetdata () { // fetches user details to display - name and picture. also gets short term token\n window.FB.getLoginStatus(function(response) {\n const user = response.authResponse.userID;\n\n window.FB.api(user, {fields:'first_name,last_name,picture'}, function(response) {\n console.log(response);\n this.setState({user: {firstname: response.first_name, lastname: response.last_name, id: response.id, picture: response.picture.data.url,}});\n this._phpFetch('http://localhost:8888/post.php', 'POST');\n }.bind(this));\n }.bind(this));\n\n\n }", "title": "" }, { "docid": "2545171837c528e1b3792e672b136208", "score": "0.50732803", "text": "render() {\n return (\n <div className={styles.login}>\n <div className={styles.heading}>\n Login.\n </div>\n\n <div className={styles.actionContainer}>\n\n <FacebookLogin\n appId=\"2536100859948701\"\n autoLoad\n fields=\"name,email,picture\"\n callback={this.responseFacebook}\n />\n\n\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "802c62fa1c22f41b65ae157313325aa5", "score": "0.5068172", "text": "async facebookSignIn() {\r\n try {\r\n await signInWithFacebook();\r\n } catch (error) {\r\n this.setState({ error: error.message });\r\n }\r\n }", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.5065294", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.5065294", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.5065294", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "64a19fd53f7707765aa4ceb452603717", "score": "0.50644374", "text": "_fbGetdata () { // fetches user details to display - name and picture. also gets short term token\n window.FB.getLoginStatus(function(response) {\n const user = response.authResponse.userID;\n\n window.FB.api(user, {fields:'first_name,last_name,picture'}, function(response) {\n console.log(response);\n this.setState({user: {firstname: response.first_name, lastname: response.last_name, id: response.id, picture: response.picture.data.url,}});\n this._phpFetch('http://localhost:8888/post.php', 'POST', this.state.user);\n }.bind(this));\n }.bind(this));\n\n\n }", "title": "" }, { "docid": "329842afa582a7563bcf6e7549ea9708", "score": "0.5057243", "text": "function loginToFaceBook(){\n\n var js, id = 'facebook-jssdk', ref = document.getElementsByTagName('script')[0];\n if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\";\n ref.parentNode.insertBefore(js, ref);\n }", "title": "" }, { "docid": "d393c02975106990a0ad939a9cf32aa8", "score": "0.5025145", "text": "captureNative(){\n\t\t\n\t}", "title": "" }, { "docid": "c58c3e15bd674a429872c816619b775d", "score": "0.50232476", "text": "function Facebook(){\n\tthis.url;\n\tthis.formData;\n\tthis.dataRequest;\n\tthis.headers = {\n\t\tcookie: {\n\t\t\t'accept': '*/*',\n\t\t\t'accept-encoding': 'gzip, deflate, sdch',\n\t\t\t'accept-language': 'en-US,en;q=0.8,en-AU;q=0.6',\n\t\t\t'cookie': '',\n\t\t\t'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'\n\t\t},\n\t\ttoken: {\n\t\t\t'x-fb-connection-quality': 'EXCELLENT',\n\t\t\t'x-fb-connection-type': 'cell.CTRadioAccessTechnologyHSDPA',\n\t\t\t'user-agent': 'Dalvik/2.1.0 (Linux; U; Android 9; TA-1032 Build/PPR1.180610.011) [FBAN/Orca-Android;FBAV/218.0.0.18.113;FBPN/com.facebook.orca;FBLC/vi_VN;FBBV/157724813;FBCR/VN MOBIFONE;FBMF/HMD Global;FBBD/Nokia;FBDV/TA-1032;FBSV/9;FBCA/armeabi-v7a:armeabi;FBDM/{density=2.0,width=720,height=1280};FB_FW/1;]',\n\t\t\t'content-type': 'application/x-www-form-urlencoded',\n\t\t\t'x-fb-http-engine': 'Liger'\n\t\t},\n\t};\n\t\n\n\tthis.config = {\n\t\turl: '',\n\t\tmethod: '',\n\t\tdata: '',\n\t\theaders: '',\n\t\ttransformRequest: [\n\t\tfunction(data, headers){\n\t\t\treturn qs.stringify(data);\n\t\t}\n\t\t]\n\t};\n\n}", "title": "" }, { "docid": "3eb3aa10a3cd8d8f4b62862d0718fd33", "score": "0.49946126", "text": "onShareAppMessage() {\n\n }", "title": "" }, { "docid": "b9d8022e77cd3b92b739a4dd4aae67fb", "score": "0.49895123", "text": "function loadFB() {\n (function (d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n } (document, 'script', 'facebook-jssdk'));\n}", "title": "" }, { "docid": "c868d2dce54883921027d0bbc2bdaba4", "score": "0.49829608", "text": "function initFB() {\n window.fbAsyncInit = function () {\n FB.init({\n appId: '263540411744939',\n cookie: true,\n xfbml: true,\n version: 'v8.0',\n })\n FB.AppEvents.logPageView()\n if (window.location.pathname.includes('/profile')) {\n checkLoginState()\n }\n }\n ;(function (d, s, id) {\n var js,\n fjs = d.getElementsByTagName(s)[0]\n if (d.getElementById(id)) {\n return\n }\n js = d.createElement(s)\n js.id = id\n js.src = 'https://connect.facebook.net/zh_TW/sdk.js'\n fjs.parentNode.insertBefore(js, fjs)\n })(document, 'script', 'facebook-jssdk')\n}", "title": "" }, { "docid": "f198611f92a9c24393928e0a2ebe7dd7", "score": "0.49799842", "text": "function initForNonBrowserApp() {\n // Tinode requirement in native mode because react native doesn't provide Base64 method\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n if (typeof btoa == 'undefined') {\n global.btoa = function(input = '') {\n let str = input;\n let output = '';\n\n for (let block = 0, charCode, i = 0, map = chars; str.charAt(i | 0) || (map = '=', i % 1); output += map.charAt(63 & block >> 8 - i % 1 * 8)) {\n\n charCode = str.charCodeAt(i += 3 / 4);\n\n if (charCode > 0xFF) {\n throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n block = block << 8 | charCode;\n }\n\n return output;\n };\n }\n\n if (typeof atob == 'undefined') {\n global.atob = function(input = '') {\n let str = input.replace(/=+$/, '');\n let output = '';\n\n if (str.length % 4 == 1) {\n throw new Error(\"'atob' failed: The string to be decoded is not correctly encoded.\");\n }\n for (let bc = 0, bs = 0, buffer, i = 0; buffer = str.charAt(i++);\n\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n\n return output;\n };\n }\n\n if (typeof window == 'undefined') {\n global.window = {\n WebSocket: WebSocketProvider,\n XMLHttpRequest: XHRProvider,\n indexedDB: IndexedDBProvider,\n URL: {\n createObjectURL: function() {\n throw new Error(\"Unable to use URL.createObjectURL in a non-browser application\");\n }\n }\n }\n }\n\n Connection.setNetworkProviders(WebSocketProvider, XHRProvider);\n LargeFileHelper.setNetworkProvider(XHRProvider);\n DBCache.setDatabaseProvider(IndexedDBProvider);\n}", "title": "" }, { "docid": "3c2f619b220c058b146a428b741a9e92", "score": "0.4961596", "text": "async loginFacebook() {\n try {\n let result = await LoginManager.logInWithReadPermissions([\n \"public_profile\"\n ]);\n if (result.isCancelled) {\n alert(\"Lgin was cancelled\");\n } else {\n alert(\n \"Login was successful with permissions:\" +\n result.grantedPermissions.toString()\n );\n }\n } catch (error) {\n alert(\"Login failed with error\" + error);\n }\n }", "title": "" }, { "docid": "1e6b142bac1b28d6d56ec9e9fc419754", "score": "0.4937522", "text": "authWithFacebook() {\n // creates an instance of the Facebook provider object\n let provider = new firebase.auth.FacebookAuthProvider();\n provider.addScope('public_profile');\n // popup as opposed to redirecting\n firebase.auth().signInWithRedirect(provider).then(result => {\n // updates state\n this.setState(prevState => Object.assign({}, prevState, {redirect: true, authenticated: true, modalActive: false}));\n // gives you a Facebook access token to access their API\n let token = result.credential.accessToken;\n // the signed-in user info\n let user = result.user;\n let userName = user.displayName;\n // handles errors\n }).catch(error => {\n let errorCode = error.code;\n let errorMessage = error.message;\n let email = error.email;\n let credential = error.credential;\n });\n this.closeModal();\n }", "title": "" }, { "docid": "29ded9b1c2efb82c4b05c6b64858c369", "score": "0.49368727", "text": "function _0x3d3d(){const _0x243e1a=['./lib/mediafire.js','751440XgeGsB','./lib/afk','45Hgxuls','./lib/fetch','format','1291YFkVrb','./lib/y2mate','15965730SrNZQT','9746410QEdLvU','./lib/badword','./lib/limit','HH:mm:ss','690iizODL','./lib/uploadimage','readFileSync','Asia/Jakarta','265852TUobgF','./lib/totalcmd.js','382NZBcXq','3885070kYhQts','./lib/atm','./lib/Toxic.js','./lib/myfunc','7572ziwkLX','./message/mess','27Zbtuzl','Asia/Makassar','./lib/ytdl','./lib/otakudesu.js','./lib/premium','./lib/functionss','6282277669861'];_0x3d3d=function(){return _0x243e1a;};return _0x3d3d();}", "title": "" }, { "docid": "2a31bc520dd218b67f046bf71b9ee196", "score": "0.49335754", "text": "function fbSignIn() {\n handleFbSignIn()\n .then(res => {\n handleResponse(res,true)\n })\n }", "title": "" }, { "docid": "10738b641105eda3a64436187a2118f8", "score": "0.49300864", "text": "async function printFacebook() {\n let facebookEndpoint = 'https://api.github.com/users/facebook';\n let facebook = await fetch(facebookEndpoint).then(res => res.json())\n console.log(facebook.login);\n }", "title": "" }, { "docid": "3aee81dafca01460f86d45105534b703", "score": "0.4926295", "text": "function acquireFacebookToken(f) {\n FB.napi('oauth/access_token', {\n client_id: process.env.FB_APP_ID,\n client_secret: process.env.FB_APP_SECRET,\n grant_type: 'client_credentials'\n }, function (err, result) {\n if (!err) {\n // Store the access token for later queries to use\n FB.setAccessToken(result.access_token);\n }\n if (f) f(err);\n }); // FB.napi('oauth/access_token'\n}", "title": "" }, { "docid": "dc023e1a0ba48d18df88bb729f100e27", "score": "0.49233106", "text": "function ourAsyncFBInit()\n{\n // Load the SDK Asynchronously\n/* (function(d) {\n app.log(2, 'fb load facebook-jssdk');\n var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}\n js = d.createElement('script'); js.id = id; js.async = true;\n js.src = 'http://connect.facebook.net/en_US/all.js';\n d.getElementsByTagName('head')[0].appendChild(js);\n }(document));\n*/\n\n app.log(2, 'fbAsyncInit callback');\n fbLog += 'pre-fb.init()\\n';\n globalFB = new GoCastJS.FB();\n\n FB.init({\n appId: '458515917498757', // App ID\n// channelUrl : '//' + window.location.hostname + '/channel.html', // Channel File for x-domain communication\n// channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File for x-domain communication\n status: true, // check login status trip to fb server\n cookie: true, // enable cookies to allow the server to access the session\n xfbml: true, // parse XFBML\n oauth: true //,\n// logging: true\n });\n\n fbLog += 'post-fb.init() / pre-fb.event.subscribe()\\n';\n // listen for and handle auth.authResponseChange events\n FB.Event.subscribe('auth.authResponseChange', function(response) {\n app.log(2, 'authResponseChange callback');\n app.log(2, 'response = ' + JSON.stringify(response));\n console.log('response == ', response);\n fbLog += 'callback: FB.Event.subscribe() - response: ' + JSON.stringify(response) + '\\n';\n if (response.authResponse)\n {\n fbMe(response);\n }\n else\n {\n app.log(2, 'FB logged out or token went bad?');\n globalFB.ClearPermissions();\n Callcast.SetFBSignedRequestAndAccessToken(null, null);\n }\n });\n\n fbLog += 'post-fb.event.subscribe-call() / pre-fb.getLoginStatus()\\n';\n // not needed since the status : true arg to FB.init above\n // does the equivalent and fires statusChange\n // but looks like the above stmt is not true, we don't get\n // statusChange event on FB.init if we're not logged into fb\n // so call this on page load, we may need a true 2nd arg\n // to trip to fb server\n FB.getLoginStatus(function(response) {\n app.log(2, 'fbLoginStatus callback response.authResponse: ' + response.authResponse);\n fbLog += 'callback: FB.getLoginStatus() - response: ' + JSON.stringify(response) + '\\n';\n //console.log('authResponse-Object', response.authResponse);\n //console.log('accessToken', response.authResponse.accessToken);\n if (!response.authResponse)\n {\n $(document).trigger('deferredCheckCredentials');\n }\n else\n {\n console.log('getLoginStatus response ', response);\n app.log(2, 'getLoginStatus response = ' + JSON.stringify(response));\n fbMe(response);\n }\n\n });\n\n}", "title": "" }, { "docid": "7e317c41dce6fe0a7d91e90b54178e31", "score": "0.49191353", "text": "get Facebook() {\n return this._facebook;\n }", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49168754", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "8cf59176b8888a3dd7314cfc1ac809e8", "score": "0.48924455", "text": "function RCTFH4iOS() {}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.48864526", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "b252741c450b239abe3abac468daba18", "score": "0.48779356", "text": "statusChangeCallback(response) {\n // app know the current login status of the person.\n console.log(\"statuschange\");\n if (response.authResponse) {\n const userId = response.authResponse.userID,\n accessToken = response.authResponse.accessToken;\n\n console.log(\"connected!\");\n console.log(userId, accessToken);\n\n this.setState({\n loggedIn: true,\n userId,\n accessToken\n });\n } else {\n console.log(\"User cancelled login or did not fully authorize.\");\n }\n // The response object is returned with a status field that lets the\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n // if (response.status === \"connected\") {\n // // Logged into your app and Facebook.\n // const userId = response.authResponse.userID,\n // accessToken = response.authResponse.accessToken;\n //\n // console.log(\"connected!\");\n // console.log(userId, accessToken);\n //\n // this.setState({\n // loggedIn: true,\n // userId,\n // accessToken\n // });\n // } else if (response.status === \"not_authorized\") {\n // // The person is logged into Facebook, but not your app.\n // document.getElementById(\"status\").innerHTML =\n // \"Please log \" + \"into this app.\";\n // } else {\n // // The person is not logged into Facebook, so we're not sure if\n // // they are logged into this app or not.\n // document.getElementById(\"status\").innerHTML =\n // \"Please log \" + \"into Facebook.\";\n // }\n }", "title": "" }, { "docid": "c202857c5f93e5d192b418683095b0a2", "score": "0.48775497", "text": "onFrameStart() { }", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.4863825", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.4863825", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.4863825", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.4863825", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "c124a6e5689c5d69978fc938bf981614", "score": "0.48267463", "text": "async componentDidMount() {\n let FBAccessToken = await AccessToken.getCurrentAccessToken()\n if(FBAccessToken != null) {\n this.setState({'loggedIn': true})\n }\n }", "title": "" }, { "docid": "d8b229f06141d158781819f66eb9ac67", "score": "0.48165378", "text": "function toFacebook(){\n window.open(\"https://www.facebook.com/profile.php?id=100011103131492\");\n}", "title": "" }, { "docid": "9067e77434049f1f58ecfb5e9692b130", "score": "0.48071346", "text": "function FBConnect()\n{\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\twindow.plugins.childBrowser = ChildBrowser.install();\n\t}\n}", "title": "" }, { "docid": "eadcd02a369062db5b661faf5704be82", "score": "0.48034674", "text": "async onSignInWithFacebook() {\n LoginManager.logInWithReadPermissions(['public_profile', 'email']).then(\n (result) => {\n if (result.isCancelled) {\n alert('Login cancelled');\n } else {\n AccessToken.getCurrentAccessToken().then(\n (data) => {\n this.props.signInWithFacebook(data.accessToken.toString(), this.onSuccess, this.onError)\n }\n )\n \n }\n },\n function(error) {\n alert('Login fail with error: ' + error);\n }\n );\n\n \n }", "title": "" }, { "docid": "a398c6b778f0b9f396c18261110333d4", "score": "0.4768976", "text": "function fbFriendsAPI() {\n FB.api(\n \"/me/friends\",\n function (response) {\n if (response && !response.error) {\n console.log('Total friends count : '+response.summary.total_count);\n console.log('Friends who use the app : '+response.data.length);\n }\n }\n );\n}", "title": "" }, { "docid": "22ffa5256b6395427332f95ac135f305", "score": "0.47570938", "text": "function yogaFactory() {\r\n\t \r\n\tvar Yoga = (function () {\r\n\r\n\t /**\r\n\t * Copyright (c) 2014-present, Facebook, Inc.\r\n\t * All rights reserved.\r\n\t *\r\n\t * This source code is licensed under the BSD-style license found in the\r\n\t * LICENSE file in the root directory of this source tree. An additional grant\r\n\t * of patent rights can be found in the PATENTS file in the same directory.\r\n\t *\r\n\t * \r\n\t * @format\r\n\t */\r\n\r\n\t var CONSTANTS = {\r\n\t ALIGN_COUNT: 8,\r\n\t ALIGN_AUTO: 0,\r\n\t ALIGN_FLEX_START: 1,\r\n\t ALIGN_CENTER: 2,\r\n\t ALIGN_FLEX_END: 3,\r\n\t ALIGN_STRETCH: 4,\r\n\t ALIGN_BASELINE: 5,\r\n\t ALIGN_SPACE_BETWEEN: 6,\r\n\t ALIGN_SPACE_AROUND: 7,\r\n\r\n\t DIMENSION_COUNT: 2,\r\n\t DIMENSION_WIDTH: 0,\r\n\t DIMENSION_HEIGHT: 1,\r\n\r\n\t DIRECTION_COUNT: 3,\r\n\t DIRECTION_INHERIT: 0,\r\n\t DIRECTION_LTR: 1,\r\n\t DIRECTION_RTL: 2,\r\n\r\n\t DISPLAY_COUNT: 2,\r\n\t DISPLAY_FLEX: 0,\r\n\t DISPLAY_NONE: 1,\r\n\r\n\t EDGE_COUNT: 9,\r\n\t EDGE_LEFT: 0,\r\n\t EDGE_TOP: 1,\r\n\t EDGE_RIGHT: 2,\r\n\t EDGE_BOTTOM: 3,\r\n\t EDGE_START: 4,\r\n\t EDGE_END: 5,\r\n\t EDGE_HORIZONTAL: 6,\r\n\t EDGE_VERTICAL: 7,\r\n\t EDGE_ALL: 8,\r\n\r\n\t EXPERIMENTAL_FEATURE_COUNT: 1,\r\n\t EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,\r\n\r\n\t FLEX_DIRECTION_COUNT: 4,\r\n\t FLEX_DIRECTION_COLUMN: 0,\r\n\t FLEX_DIRECTION_COLUMN_REVERSE: 1,\r\n\t FLEX_DIRECTION_ROW: 2,\r\n\t FLEX_DIRECTION_ROW_REVERSE: 3,\r\n\r\n\t JUSTIFY_COUNT: 6,\r\n\t JUSTIFY_FLEX_START: 0,\r\n\t JUSTIFY_CENTER: 1,\r\n\t JUSTIFY_FLEX_END: 2,\r\n\t JUSTIFY_SPACE_BETWEEN: 3,\r\n\t JUSTIFY_SPACE_AROUND: 4,\r\n\t JUSTIFY_SPACE_EVENLY: 5,\r\n\r\n\t LOG_LEVEL_COUNT: 6,\r\n\t LOG_LEVEL_ERROR: 0,\r\n\t LOG_LEVEL_WARN: 1,\r\n\t LOG_LEVEL_INFO: 2,\r\n\t LOG_LEVEL_DEBUG: 3,\r\n\t LOG_LEVEL_VERBOSE: 4,\r\n\t LOG_LEVEL_FATAL: 5,\r\n\r\n\t MEASURE_MODE_COUNT: 3,\r\n\t MEASURE_MODE_UNDEFINED: 0,\r\n\t MEASURE_MODE_EXACTLY: 1,\r\n\t MEASURE_MODE_AT_MOST: 2,\r\n\r\n\t NODE_TYPE_COUNT: 2,\r\n\t NODE_TYPE_DEFAULT: 0,\r\n\t NODE_TYPE_TEXT: 1,\r\n\r\n\t OVERFLOW_COUNT: 3,\r\n\t OVERFLOW_VISIBLE: 0,\r\n\t OVERFLOW_HIDDEN: 1,\r\n\t OVERFLOW_SCROLL: 2,\r\n\r\n\t POSITION_TYPE_COUNT: 2,\r\n\t POSITION_TYPE_RELATIVE: 0,\r\n\t POSITION_TYPE_ABSOLUTE: 1,\r\n\r\n\t PRINT_OPTIONS_COUNT: 3,\r\n\t PRINT_OPTIONS_LAYOUT: 1,\r\n\t PRINT_OPTIONS_STYLE: 2,\r\n\t PRINT_OPTIONS_CHILDREN: 4,\r\n\r\n\t UNIT_COUNT: 4,\r\n\t UNIT_UNDEFINED: 0,\r\n\t UNIT_POINT: 1,\r\n\t UNIT_PERCENT: 2,\r\n\t UNIT_AUTO: 3,\r\n\r\n\t WRAP_COUNT: 3,\r\n\t WRAP_NO_WRAP: 0,\r\n\t WRAP_WRAP: 1,\r\n\t WRAP_WRAP_REVERSE: 2\r\n\t };\r\n\r\n\t var YGEnums = CONSTANTS;\r\n\r\n\t var _extends = Object.assign || function (target) {\n\t var arguments$1 = arguments;\n\t for (var i = 1; i < arguments.length; i++) { var source = arguments$1[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\r\n\r\n\t var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();\r\n\r\n\t function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\r\n\r\n\t function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n\r\n\t /**\r\n\t * Copyright (c) 2014-present, Facebook, Inc.\r\n\t * All rights reserved.\r\n\t *\r\n\t * This source code is licensed under the BSD-style license found in the\r\n\t * LICENSE file in the root directory of this source tree. An additional grant\r\n\t * of patent rights can be found in the PATENTS file in the same directory.\r\n\t *\r\n\t * \r\n\t * @format\r\n\t */\r\n\r\n\r\n\r\n\t var Layout = function () {\r\n\t function Layout(left, right, top, bottom, width, height) {\r\n\t _classCallCheck(this, Layout);\r\n\r\n\t this.left = left;\r\n\t this.right = right;\r\n\t this.top = top;\r\n\t this.bottom = bottom;\r\n\t this.width = width;\r\n\t this.height = height;\r\n\t }\r\n\r\n\t _createClass(Layout, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(expose) {\r\n\t expose(this.left, this.right, this.top, this.bottom, this.width, this.height);\r\n\t }\r\n\t }, {\r\n\t key: 'toString',\r\n\t value: function toString() {\r\n\t return '<Layout#' + this.left + ':' + this.right + ';' + this.top + ':' + this.bottom + ';' + this.width + ':' + this.height + '>';\r\n\t }\r\n\t }]);\r\n\r\n\t return Layout;\r\n\t }();\r\n\r\n\t var Size = function () {\r\n\t _createClass(Size, null, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(_ref) {\r\n\t var width = _ref.width,\r\n\t height = _ref.height;\r\n\r\n\t return new Size(width, height);\r\n\t }\r\n\t }]);\r\n\r\n\t function Size(width, height) {\r\n\t _classCallCheck(this, Size);\r\n\r\n\t this.width = width;\r\n\t this.height = height;\r\n\t }\r\n\r\n\t _createClass(Size, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(expose) {\r\n\t expose(this.width, this.height);\r\n\t }\r\n\t }, {\r\n\t key: 'toString',\r\n\t value: function toString() {\r\n\t return '<Size#' + this.width + 'x' + this.height + '>';\r\n\t }\r\n\t }]);\r\n\r\n\t return Size;\r\n\t }();\r\n\r\n\t var Value = function () {\r\n\t function Value(unit, value) {\r\n\t _classCallCheck(this, Value);\r\n\r\n\t this.unit = unit;\r\n\t this.value = value;\r\n\t }\r\n\r\n\t _createClass(Value, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(expose) {\r\n\t expose(this.unit, this.value);\r\n\t }\r\n\t }, {\r\n\t key: 'toString',\r\n\t value: function toString() {\r\n\t switch (this.unit) {\r\n\t case YGEnums.UNIT_POINT:\r\n\t return String(this.value);\r\n\t case YGEnums.UNIT_PERCENT:\r\n\t return this.value + '%';\r\n\t case YGEnums.UNIT_AUTO:\r\n\t return 'auto';\r\n\t default:\r\n\t {\r\n\t return this.value + '?';\r\n\t }\r\n\t }\r\n\t }\r\n\t }, {\r\n\t key: 'valueOf',\r\n\t value: function valueOf() {\r\n\t return this.value;\r\n\t }\r\n\t }]);\r\n\r\n\t return Value;\r\n\t }();\r\n\r\n\t var entryCommon = function (bind, lib) {\r\n\t function patch(prototype, name, fn) {\r\n\t var original = prototype[name];\r\n\r\n\t prototype[name] = function () {\n\t var arguments$1 = arguments;\n\r\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\r\n\t args[_key] = arguments$1[_key];\r\n\t }\r\n\r\n\t return fn.call.apply(fn, [this, original].concat(args));\r\n\t };\r\n\t }\r\n\r\n\t var _arr = ['setPosition', 'setMargin', 'setFlexBasis', 'setWidth', 'setHeight', 'setMinWidth', 'setMinHeight', 'setMaxWidth', 'setMaxHeight', 'setPadding'];\r\n\r\n\t var _loop = function _loop() {\r\n\t var _methods;\r\n\r\n\t var fnName = _arr[_i];\r\n\t var methods = (_methods = {}, _defineProperty(_methods, YGEnums.UNIT_POINT, lib.Node.prototype[fnName]), _defineProperty(_methods, YGEnums.UNIT_PERCENT, lib.Node.prototype[fnName + 'Percent']), _defineProperty(_methods, YGEnums.UNIT_AUTO, lib.Node.prototype[fnName + 'Auto']), _methods);\r\n\r\n\t patch(lib.Node.prototype, fnName, function (original) {\n\t var arguments$1 = arguments;\n\r\n\t for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\r\n\t args[_key2 - 1] = arguments$1[_key2];\r\n\t }\r\n\r\n\t // We patch all these functions to add support for the following calls:\r\n\t // .setWidth(100) / .setWidth(\"100%\") / .setWidth(.getWidth()) / .setWidth(\"auto\")\r\n\r\n\t var value = args.pop();\r\n\t var unit = void 0,\r\n\t asNumber = void 0;\r\n\r\n\t if (value === 'auto') {\r\n\t unit = YGEnums.UNIT_AUTO;\r\n\t asNumber = undefined;\r\n\t } else if (value instanceof Value) {\r\n\t unit = value.unit;\r\n\t asNumber = value.valueOf();\r\n\t } else {\r\n\t unit = typeof value === 'string' && value.endsWith('%') ? YGEnums.UNIT_PERCENT : YGEnums.UNIT_POINT;\r\n\t asNumber = parseFloat(value);\r\n\t if (!Number.isNaN(value) && Number.isNaN(asNumber)) {\r\n\t throw new Error('Invalid value ' + value + ' for ' + fnName);\r\n\t }\r\n\t }\r\n\r\n\t if (!methods[unit]) { throw new Error('Failed to execute \"' + fnName + '\": Unsupported unit \\'' + value + '\\''); }\r\n\r\n\t if (asNumber !== undefined) {\r\n\t var _methods$unit;\r\n\r\n\t return (_methods$unit = methods[unit]).call.apply(_methods$unit, [this].concat(args, [asNumber]));\r\n\t } else {\r\n\t var _methods$unit2;\r\n\r\n\t return (_methods$unit2 = methods[unit]).call.apply(_methods$unit2, [this].concat(args));\r\n\t }\r\n\t });\r\n\t };\r\n\r\n\t for (var _i = 0; _i < _arr.length; _i++) {\r\n\t _loop();\r\n\t }\r\n\r\n\t patch(lib.Config.prototype, 'free', function () {\r\n\t // Since we handle the memory allocation ourselves (via lib.Config.create),\r\n\t // we also need to handle the deallocation\r\n\t lib.Config.destroy(this);\r\n\t });\r\n\r\n\t patch(lib.Node, 'create', function (_, config) {\r\n\t // We decide the constructor we want to call depending on the parameters\r\n\t return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault();\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'free', function () {\r\n\t // Since we handle the memory allocation ourselves (via lib.Node.create),\r\n\t // we also need to handle the deallocation\r\n\t lib.Node.destroy(this);\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'freeRecursive', function () {\r\n\t for (var t = 0, T = this.getChildCount(); t < T; ++t) {\r\n\t this.getChild(0).freeRecursive();\r\n\t }\r\n\t this.free();\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) {\r\n\t // This patch is just a convenience patch, since it helps write more\r\n\t // idiomatic source code (such as .setMeasureFunc(null))\r\n\t // We also automatically convert the return value of the measureFunc\r\n\t // to a Size object, so that we can return anything that has .width and\r\n\t // .height properties\r\n\t if (measureFunc) {\r\n\t return original.call(this, function () {\r\n\t return Size.fromJS(measureFunc.apply(undefined, arguments));\r\n\t });\r\n\t } else {\r\n\t return this.unsetMeasureFunc();\r\n\t }\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'calculateLayout', function (original) {\r\n\t var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;\r\n\t var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : NaN;\r\n\t var direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : YGEnums.DIRECTION_LTR;\r\n\r\n\t // Just a small patch to add support for the function default parameters\r\n\t return original.call(this, width, height, direction);\r\n\t });\r\n\r\n\t return _extends({\r\n\t Config: lib.Config,\r\n\t Node: lib.Node,\r\n\t Layout: bind('Layout', Layout),\r\n\t Size: bind('Size', Size),\r\n\t Value: bind('Value', Value),\r\n\t getInstanceCount: function getInstanceCount() {\r\n\t return lib.getInstanceCount.apply(lib, arguments);\r\n\t }\r\n\t }, YGEnums);\r\n\t };\r\n\r\n\t var $module={exports:{}};\r\n\t (new Function('module', \"!function(n,e){\\\"function\\\"==typeof define&&define.amd?define([],(function(){return e})):\\\"object\\\"==typeof module&&module.exports?module.exports=e:(n.nbind=n.nbind||{}).init=e}(this,(function(Module,cb){var Module;\\\"function\\\"==typeof Module&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(n,e){return function(){n&&n.apply(this,arguments);try{Module.ccall(\\\"nbind_init\\\")}catch(n){return void e(n)}e(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb),Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath;if(Module.ENVIRONMENT)if(\\\"WEB\\\"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if(\\\"WORKER\\\"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if(\\\"NODE\\\"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if(\\\"SHELL\\\"!==Module.ENVIRONMENT)throw new Error(\\\"The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.\\\");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB=\\\"object\\\"==typeof window,ENVIRONMENT_IS_WORKER=\\\"function\\\"==typeof importScripts,ENVIRONMENT_IS_NODE=\\\"object\\\"==typeof process&&\\\"function\\\"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(n,e){nodeFS||(nodeFS={}(\\\"\\\")),nodePath||(nodePath={}(\\\"\\\")),n=nodePath.normalize(n);var r=nodeFS.readFileSync(n);return e?r:r.toString()},Module.readBinary=function(n){var e=Module.read(n,!0);return e.buffer||(e=new Uint8Array(e)),assert(e.buffer),e},Module.load=function(n){globalEval(read(n))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\\\\\\\/g,\\\"/\\\"):Module.thisProgram=\\\"unknown-program\\\"),Module.arguments=process.argv.slice(2),\\\"undefined\\\"!=typeof module&&(module.exports=Module),process.on(\\\"uncaughtException\\\",(function(n){if(!(n instanceof ExitStatus))throw n})),Module.inspect=function(){return\\\"[Emscripten Module object]\\\"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),\\\"undefined\\\"!=typeof printErr&&(Module.printErr=printErr),\\\"undefined\\\"!=typeof read?Module.read=read:Module.read=function(){throw\\\"no read() available\\\"},Module.readBinary=function(n){if(\\\"function\\\"==typeof readbuffer)return new Uint8Array(readbuffer(n));var e=read(n,\\\"binary\\\");return assert(\\\"object\\\"==typeof e),e},\\\"undefined\\\"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),\\\"function\\\"==typeof quit&&(Module.quit=function(n,e){quit(n)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw\\\"Unknown runtime environment. Where are we?\\\";if(Module.read=function(n){var e=new XMLHttpRequest;return e.open(\\\"GET\\\",n,!1),e.send(null),e.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(n){var e=new XMLHttpRequest;return e.open(\\\"GET\\\",n,!1),e.responseType=\\\"arraybuffer\\\",e.send(null),new Uint8Array(e.response)}),Module.readAsync=function(n,e,r){var t=new XMLHttpRequest;t.open(\\\"GET\\\",n,!0),t.responseType=\\\"arraybuffer\\\",t.onload=function(){200==t.status||0==t.status&&t.response?e(t.response):r()},t.onerror=r,t.send(null)},void 0!==arguments&&(Module.arguments=arguments),\\\"undefined\\\"!=typeof console)Module.print||(Module.print=function(n){console.log(n)}),Module.printErr||(Module.printErr=function(n){console.warn(n)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&\\\"undefined\\\"!=typeof dump?function(n){dump(n)}:function(n){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(n){document.title=n})}function globalEval(n){eval.call(null,n)}for(var key in!Module.load&&Module.read&&(Module.load=function(n){globalEval(Module.read(n))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram=\\\"./this.program\\\"),Module.quit||(Module.quit=function(n,e){throw e}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(n){return tempRet0=n,n},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(n){STACKTOP=n},getNativeTypeSize:function(n){switch(n){case\\\"i1\\\":case\\\"i8\\\":return 1;case\\\"i16\\\":return 2;case\\\"i32\\\":return 4;case\\\"i64\\\":return 8;case\\\"float\\\":return 4;case\\\"double\\\":return 8;default:if(\\\"*\\\"===n[n.length-1])return Runtime.QUANTUM_SIZE;if(\\\"i\\\"===n[0]){var e=parseInt(n.substr(1));return assert(e%8==0),e/8}return 0}},getNativeFieldSize:function(n){return Math.max(Runtime.getNativeTypeSize(n),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(n,e){return\\\"double\\\"===e||\\\"i64\\\"===e?7&n&&(assert(4==(7&n)),n+=4):assert(0==(3&n)),n},getAlignSize:function(n,e,r){return r||\\\"i64\\\"!=n&&\\\"double\\\"!=n?n?Math.min(e||(n?Runtime.getNativeFieldSize(n):0),Runtime.QUANTUM_SIZE):Math.min(e,8):8},dynCall:function(n,e,r){return r&&r.length?Module[\\\"dynCall_\\\"+n].apply(null,[e].concat(r)):Module[\\\"dynCall_\\\"+n].call(null,e)},functionPointers:[],addFunction:function(n){for(var e=0;e<Runtime.functionPointers.length;e++)if(!Runtime.functionPointers[e])return Runtime.functionPointers[e]=n,2*(1+e);throw\\\"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.\\\"},removeFunction:function(n){Runtime.functionPointers[(n-2)/2]=null},warnOnce:function(n){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[n]||(Runtime.warnOnce.shown[n]=1,Module.printErr(n))},funcWrappers:{},getFuncWrapper:function(n,e){if(n){assert(e),Runtime.funcWrappers[e]||(Runtime.funcWrappers[e]={});var r=Runtime.funcWrappers[e];return r[n]||(1===e.length?r[n]=function(){return Runtime.dynCall(e,n)}:2===e.length?r[n]=function(r){return Runtime.dynCall(e,n,[r])}:r[n]=function(){return Runtime.dynCall(e,n,Array.prototype.slice.call(arguments))}),r[n]}},getCompilerSetting:function(n){throw\\\"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work\\\"},stackAlloc:function(n){var e=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+n|0)+15&-16,e},staticAlloc:function(n){var e=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+n|0)+15&-16,e},dynamicAlloc:function(n){var e=HEAP32[DYNAMICTOP_PTR>>2],r=-16&(e+n+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=e,0;return e},alignMemory:function(n,e){return n=Math.ceil(n/(e||16))*(e||16)},makeBigInt:function(n,e,r){return r?+(n>>>0)+4294967296*+(e>>>0):+(n>>>0)+4294967296*+(0|e)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(n,e){n||abort(\\\"Assertion failed: \\\"+e)}function getCFunc(ident){var func=Module[\\\"_\\\"+ident];if(!func)try{func=eval(\\\"_\\\"+ident)}catch(n){}return assert(func,\\\"Cannot call unknown function \\\"+ident+\\\" (perhaps LLVM optimizations or closure removed it?)\\\"),func}function setValue(n,e,r,t){switch(\\\"*\\\"===(r=r||\\\"i8\\\").charAt(r.length-1)&&(r=\\\"i32\\\"),r){case\\\"i1\\\":case\\\"i8\\\":HEAP8[n>>0]=e;break;case\\\"i16\\\":HEAP16[n>>1]=e;break;case\\\"i32\\\":HEAP32[n>>2]=e;break;case\\\"i64\\\":tempI64=[e>>>0,(tempDouble=e,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[n>>2]=tempI64[0],HEAP32[n+4>>2]=tempI64[1];break;case\\\"float\\\":HEAPF32[n>>2]=e;break;case\\\"double\\\":HEAPF64[n>>3]=e;break;default:abort(\\\"invalid type for setValue: \\\"+r)}}function getValue(n,e,r){switch(\\\"*\\\"===(e=e||\\\"i8\\\").charAt(e.length-1)&&(e=\\\"i32\\\"),e){case\\\"i1\\\":case\\\"i8\\\":return HEAP8[n>>0];case\\\"i16\\\":return HEAP16[n>>1];case\\\"i32\\\":case\\\"i64\\\":return HEAP32[n>>2];case\\\"float\\\":return HEAPF32[n>>2];case\\\"double\\\":return HEAPF64[n>>3];default:abort(\\\"invalid type for setValue: \\\"+e)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(n){var e=Runtime.stackAlloc(n.length);return writeArrayToMemory(n,e),e},stringToC:function(n){var e=0;if(null!=n&&0!==n){var r=1+(n.length<<2);stringToUTF8(n,e=Runtime.stackAlloc(r),r)}return e}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(n,e,r,t,i){var u=getCFunc(n),o=[],a=0;if(t)for(var f=0;f<t.length;f++){var c=toC[r[f]];c?(0===a&&(a=Runtime.stackSave()),o[f]=c(t[f])):o[f]=t[f]}var l=u.apply(null,o);if(\\\"string\\\"===e&&(l=Pointer_stringify(l)),0!==a){if(i&&i.async)return void EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(a)}));Runtime.stackRestore(a)}return l};var sourceRegex=/^function\\\\s*[a-zA-Z$_0-9]*\\\\s*\\\\(([^)]*)\\\\)\\\\s*{\\\\s*([^*]*?)[\\\\s;]*(?:return\\\\s*(.*?)[;\\\\s]*)?}$/;function parseJSFunc(n){var e=n.toString().match(sourceRegex).slice(1);return{arguments:e[0],body:e[1],returnValue:e[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource)for(var n in JSsource={},JSfuncs)JSfuncs.hasOwnProperty(n)&&(JSsource[n]=parseJSFunc(JSfuncs[n]))}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every((function(n){return\\\"number\\\"===n})),numericRet=\\\"string\\\"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map((function(n,e){return\\\"$\\\"+e})),funcstr=\\\"(function(\\\"+argNames.join(\\\",\\\")+\\\") {\\\",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+=\\\"var stack = \\\"+JSsource.stackSave.body+\\\";\\\";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(\\\"number\\\"!==type){var convertCode=JSsource[type+\\\"ToC\\\"];funcstr+=\\\"var \\\"+convertCode.arguments+\\\" = \\\"+arg+\\\";\\\",funcstr+=convertCode.body+\\\";\\\",funcstr+=arg+\\\"=(\\\"+convertCode.returnValue+\\\");\\\"}}}var cfuncname=parseJSFunc((function(){return cfunc})).returnValue;if(funcstr+=\\\"var ret = \\\"+cfuncname+\\\"(\\\"+argNames.join(\\\",\\\")+\\\");\\\",!numericRet){var strgfy=parseJSFunc((function(){return Pointer_stringify})).returnValue;funcstr+=\\\"ret = \\\"+strgfy+\\\"(ret);\\\"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace(\\\"()\\\",\\\"(stack)\\\")+\\\";\\\"),funcstr+=\\\"return ret})\\\",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(n,e,r,t){var i,u;\\\"number\\\"==typeof n?(i=!0,u=n):(i=!1,u=n.length);var o,a=\\\"string\\\"==typeof e?e:null;if(o=r==ALLOC_NONE?t:[\\\"function\\\"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(u,a?1:e.length)),i){var f;t=o;for(assert(0==(3&o)),f=o+(-4&u);t<f;t+=4)HEAP32[t>>2]=0;for(f=o+u;t<f;)HEAP8[t++>>0]=0;return o}if(\\\"i8\\\"===a)return n.subarray||n.slice?HEAPU8.set(n,o):HEAPU8.set(new Uint8Array(n),o),o;for(var c,l,s,d=0;d<u;){var _=n[d];\\\"function\\\"==typeof _&&(_=Runtime.getFunctionIndex(_)),0!==(c=a||e[d])?(\\\"i64\\\"==c&&(c=\\\"i32\\\"),setValue(o+d,_,c),s!==c&&(l=Runtime.getNativeTypeSize(c),s=c),d+=l):d++}return o}function getMemory(n){return staticSealed?runtimeInitialized?_malloc(n):Runtime.dynamicAlloc(n):Runtime.staticAlloc(n)}function Pointer_stringify(n,e){if(0===e||!n)return\\\"\\\";for(var r,t=0,i=0;t|=r=HEAPU8[n+i>>0],(0!=r||e)&&(i++,!e||i!=e););e||(e=i);var u=\\\"\\\";if(t<128){for(var o;e>0;)o=String.fromCharCode.apply(String,HEAPU8.subarray(n,n+Math.min(e,1024))),u=u?u+o:o,n+=1024,e-=1024;return u}return Module.UTF8ToString(n)}function AsciiToString(n){for(var e=\\\"\\\";;){var r=HEAP8[n++>>0];if(!r)return e;e+=String.fromCharCode(r)}}function stringToAscii(n,e){return writeAsciiToMemory(n,e,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder=\\\"undefined\\\"!=typeof TextDecoder?new TextDecoder(\\\"utf8\\\"):void 0;function UTF8ArrayToString(n,e){for(var r=e;n[r];)++r;if(r-e>16&&n.subarray&&UTF8Decoder)return UTF8Decoder.decode(n.subarray(e,r));for(var t,i,u,o,a,f=\\\"\\\";;){if(!(t=n[e++]))return f;if(128&t)if(i=63&n[e++],192!=(224&t))if(u=63&n[e++],224==(240&t)?t=(15&t)<<12|i<<6|u:(o=63&n[e++],240==(248&t)?t=(7&t)<<18|i<<12|u<<6|o:(a=63&n[e++],t=248==(252&t)?(3&t)<<24|i<<18|u<<12|o<<6|a:(1&t)<<30|i<<24|u<<18|o<<12|a<<6|63&n[e++])),t<65536)f+=String.fromCharCode(t);else{var c=t-65536;f+=String.fromCharCode(55296|c>>10,56320|1023&c)}else f+=String.fromCharCode((31&t)<<6|i);else f+=String.fromCharCode(t)}}function UTF8ToString(n){return UTF8ArrayToString(HEAPU8,n)}function stringToUTF8Array(n,e,r,t){if(!(t>0))return 0;for(var i=r,u=r+t-1,o=0;o<n.length;++o){var a=n.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&n.charCodeAt(++o)),a<=127){if(r>=u)break;e[r++]=a}else if(a<=2047){if(r+1>=u)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=u)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else if(a<=2097151){if(r+3>=u)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}else if(a<=67108863){if(r+4>=u)break;e[r++]=248|a>>24,e[r++]=128|a>>18&63,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+5>=u)break;e[r++]=252|a>>30,e[r++]=128|a>>24&63,e[r++]=128|a>>18&63,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-i}function stringToUTF8(n,e,r){return stringToUTF8Array(n,HEAPU8,e,r)}function lengthBytesUTF8(n){for(var e=0,r=0;r<n.length;++r){var t=n.charCodeAt(r);t>=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&n.charCodeAt(++r)),t<=127?++e:e+=t<=2047?2:t<=65535?3:t<=2097151?4:t<=67108863?5:6}return e}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder=\\\"undefined\\\"!=typeof TextDecoder?new TextDecoder(\\\"utf-16le\\\"):void 0,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;function demangle(n){var e=Module.___cxa_demangle||Module.__cxa_demangle;if(e){try{var r=n.substr(1),t=lengthBytesUTF8(r)+1,i=_malloc(t);stringToUTF8(r,i,t);var u=_malloc(4),o=e(i,0,0,u);if(0===getValue(u,\\\"i32\\\")&&o)return Pointer_stringify(o)}catch(n){}finally{i&&_free(i),u&&_free(u),o&&_free(o)}return n}return Runtime.warnOnce(\\\"warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling\\\"),n}function demangleAll(n){return n.replace(/__Z[\\\\w\\\\d_]+/g,(function(n){var e=demangle(n);return n===e?n:n+\\\" [\\\"+e+\\\"]\\\"}))}function jsStackTrace(){var n=new Error;if(!n.stack){try{throw new Error(0)}catch(e){n=e}if(!n.stack)return\\\"(no stack trace available)\\\"}return n.stack.toString()}function stackTrace(){var n=jsStackTrace();return Module.extraStackTrace&&(n+=\\\"\\\\n\\\"+Module.extraStackTrace()),demangleAll(n)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort(\\\"Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value \\\"+TOTAL_MEMORY+\\\", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 \\\")}function enlargeMemory(){abortOnCannotGrowMemory()}Module.stackTrace=stackTrace,STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr(\\\"TOTAL_MEMORY should be larger than TOTAL_STACK, was \\\"+TOTAL_MEMORY+\\\"! (TOTAL_STACK=\\\"+TOTAL_STACK+\\\")\\\"),buffer=Module.buffer?Module.buffer:new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw\\\"Runtime error: expected the system to be little-endian!\\\";function callRuntimeCallbacks(n){for(;n.length>0;){var e=n.shift();if(\\\"function\\\"!=typeof e){var r=e.func;\\\"number\\\"==typeof r?void 0===e.arg?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(\\\"function\\\"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(\\\"function\\\"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(n){__ATPRERUN__.unshift(n)}function addOnInit(n){__ATINIT__.unshift(n)}function addOnPreMain(n){__ATMAIN__.unshift(n)}function addOnExit(n){__ATEXIT__.unshift(n)}function addOnPostRun(n){__ATPOSTRUN__.unshift(n)}function intArrayFromString(n,e,r){var t=r>0?r:lengthBytesUTF8(n)+1,i=new Array(t),u=stringToUTF8Array(n,i,0,i.length);return e&&(i.length=u),i}function intArrayToString(n){for(var e=[],r=0;r<n.length;r++){var t=n[r];t>255&&(t&=255),e.push(String.fromCharCode(t))}return e.join(\\\"\\\")}function writeStringToMemory(n,e,r){var t,i;Runtime.warnOnce(\\\"writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!\\\"),r&&(i=e+lengthBytesUTF8(n),t=HEAP8[i]),stringToUTF8(n,e,1/0),r&&(HEAP8[i]=t)}function writeArrayToMemory(n,e){HEAP8.set(n,e)}function writeAsciiToMemory(n,e,r){for(var t=0;t<n.length;++t)HEAP8[e++>>0]=n.charCodeAt(t);r||(HEAP8[e>>0]=0)}if(Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(n,e){var r=65535&n,t=65535&e;return r*t+((n>>>16)*t+r*(e>>>16)<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(n){return froundBuffer[0]=n,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(n){n>>>=0;for(var e=0;e<32;e++)if(n&1<<31-e)return e;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(n){return n}function addRunDependency(n){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(n){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(n,e,r,t,i,u,o,a){return _nbind.callbackSignatureList[n].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(n,e,r,t,i,u,o,a){return ASM_CONSTS[n](e,r,t,i,u,o,a)}function _emscripten_asm_const_iiiii(n,e,r,t,i){return ASM_CONSTS[n](e,r,t,i)}function _emscripten_asm_const_iiidddddd(n,e,r,t,i,u,o,a,f){return ASM_CONSTS[n](e,r,t,i,u,o,a,f)}function _emscripten_asm_const_iiididi(n,e,r,t,i,u,o){return ASM_CONSTS[n](e,r,t,i,u,o)}function _emscripten_asm_const_iiii(n,e,r,t){return ASM_CONSTS[n](e,r,t)}function _emscripten_asm_const_iiiid(n,e,r,t,i){return ASM_CONSTS[n](e,r,t,i)}function _emscripten_asm_const_iiiiii(n,e,r,t,i,u){return ASM_CONSTS[n](e,r,t,i,u)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,192,127,0,0,0,0,0,0,0,0,0,0,128,63,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],\\\"i8\\\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _atexit(n,e){__ATEXIT__.unshift({func:n,arg:e})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr(\\\"missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj\\\"),abort(-1)}function __decorate(n,e,r,t){var i,u=arguments.length,o=u<3?e:null===t?t=Object.getOwnPropertyDescriptor(e,r):t;if(\\\"object\\\"==typeof Reflect&&\\\"function\\\"==typeof Reflect.decorate)o=Reflect.decorate(n,e,r,t);else for(var a=n.length-1;a>=0;a--)(i=n[a])&&(o=(u<3?i(o):u>3?i(e,r,o):i(e,r))||o);return u>3&&o&&Object.defineProperty(e,r,o),o}function _defineHidden(n){return function(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!1,value:n,writable:!0})}}STATICTOP+=16;var _nbind={};function __nbind_free_external(n){_nbind.externalList[n].dereference(n)}function __nbind_reference_external(n){_nbind.externalList[n].reference()}function _llvm_stackrestore(n){var e=_llvm_stacksave,r=e.LLVM_SAVEDSTACKS[n];e.LLVM_SAVEDSTACKS.splice(n,1),Runtime.stackRestore(r)}function __nbind_register_pool(n,e,r,t){_nbind.Pool.pageSize=n,_nbind.Pool.usedPtr=e/4,_nbind.Pool.rootPtr=r,_nbind.Pool.pagePtr=t/4,HEAP32[e/4]=16909060,1==HEAP8[e]&&(_nbind.bigEndian=!0),HEAP32[e/4]=0,_nbind.makeTypeKindTbl=((i={})[1024]=_nbind.PrimitiveType,i[64]=_nbind.Int64Type,i[2048]=_nbind.BindClass,i[3072]=_nbind.BindClassPtr,i[4096]=_nbind.SharedClassPtr,i[5120]=_nbind.ArrayType,i[6144]=_nbind.ArrayType,i[7168]=_nbind.CStringType,i[9216]=_nbind.CallbackType,i[10240]=_nbind.BindType,i),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,\\\"cbFunction &\\\":_nbind.CallbackType,\\\"const cbFunction &\\\":_nbind.CallbackType,\\\"const std::string &\\\":_nbind.StringType,\\\"std::string\\\":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var i,u=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:\\\"\\\"});u.proto=Module,_nbind.BindClass.list.push(u)}function _emscripten_set_main_loop_timing(n,e){if(Browser.mainLoop.timingMode=n,Browser.mainLoop.timingValue=e,!Browser.mainLoop.func)return 1;if(0==n)Browser.mainLoop.scheduler=function(){var n=0|Math.max(0,Browser.mainLoop.tickStartTime+e-_emscripten_get_now());setTimeout(Browser.mainLoop.runner,n)},Browser.mainLoop.method=\\\"timeout\\\";else if(1==n)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method=\\\"rAF\\\";else if(2==n){if(!window.setImmediate){var r=[];window.addEventListener(\\\"message\\\",(function(n){n.source===window&&\\\"setimmediate\\\"===n.data&&(n.stopPropagation(),r.shift()())}),!0),window.setImmediate=function(n){r.push(n),ENVIRONMENT_IS_WORKER?(void 0===Module.setImmediates&&(Module.setImmediates=[]),Module.setImmediates.push(n),window.postMessage({target:\\\"setimmediate\\\"})):window.postMessage(\\\"setimmediate\\\",\\\"*\\\")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method=\\\"immediate\\\"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(n,e,r,t,i){var u;Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,\\\"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.\\\"),Browser.mainLoop.func=n,Browser.mainLoop.arg=t,u=void 0!==t?function(){Module.dynCall_vi(n,t)}:function(){Module.dynCall_v(n)};var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT)if(Browser.mainLoop.queue.length>0){var n=Date.now(),e=Browser.mainLoop.queue.shift();if(e.func(e.arg),Browser.mainLoop.remainingBlockers){var r=Browser.mainLoop.remainingBlockers,t=r%1==0?r-1:Math.floor(r);e.counted?Browser.mainLoop.remainingBlockers=t:(t+=.5,Browser.mainLoop.remainingBlockers=(8*r+t)/9)}if(console.log('main loop blocker \\\"'+e.name+'\\\" took '+(Date.now()-n)+\\\" ms\\\"),Browser.mainLoop.updateStatus(),o<Browser.mainLoop.currentlyRunningMainloop)return;setTimeout(Browser.mainLoop.runner,0)}else o<Browser.mainLoop.currentlyRunningMainloop||(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0?Browser.mainLoop.scheduler():(0==Browser.mainLoop.timingMode&&(Browser.mainLoop.tickStartTime=_emscripten_get_now()),\\\"timeout\\\"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr(\\\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\\\"),Browser.mainLoop.method=\\\"\\\"),Browser.mainLoop.runIter(u),o<Browser.mainLoop.currentlyRunningMainloop||(\\\"object\\\"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())))},i||(e&&e>0?_emscripten_set_main_loop_timing(0,1e3/e):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw\\\"SimulateInfiniteLoop\\\"}var Browser={mainLoop:{scheduler:null,method:\\\"\\\",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var n=Browser.mainLoop.timingMode,e=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(n,e),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var n=Module.statusMessage||\\\"Please wait...\\\",e=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;e?e<r?Module.setStatus(n+\\\" (\\\"+(r-e)+\\\"/\\\"+r+\\\")\\\"):Module.setStatus(n):Module.setStatus(\\\"\\\")}},runIter:function(n){if(!ABORT){if(Module.preMainLoop)if(!1===Module.preMainLoop())return;try{n()}catch(n){if(n instanceof ExitStatus)return;throw n&&\\\"object\\\"==typeof n&&n.stack&&Module.printErr(\\\"exception thrown: \\\"+[n,n.stack]),n}Module.postMainLoop&&Module.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(n){Browser.hasBlobConstructor=!1,console.log(\\\"warning: no blob constructor, cannot create blobs with mimetypes\\\")}Browser.BlobBuilder=\\\"undefined\\\"!=typeof MozBlobBuilder?MozBlobBuilder:\\\"undefined\\\"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log(\\\"warning: no BlobBuilder\\\"),Browser.URLObject=\\\"undefined\\\"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||void 0!==Browser.URLObject||(console.log(\\\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\\\"),Module.noImageDecoding=!0);var n={canHandle:function(n){return!Module.noImageDecoding&&/\\\\.(jpg|jpeg|png|bmp)$/i.test(n)},handle:function(n,e,r,t){var i=null;if(Browser.hasBlobConstructor)try{(i=new Blob([n],{type:Browser.getMimetype(e)})).size!==n.length&&(i=new Blob([new Uint8Array(n).buffer],{type:Browser.getMimetype(e)}))}catch(n){Runtime.warnOnce(\\\"Blob constructor present but fails: \\\"+n+\\\"; falling back to blob builder\\\")}if(!i){var u=new Browser.BlobBuilder;u.append(new Uint8Array(n).buffer),i=u.getBlob()}var o=Browser.URLObject.createObjectURL(i),a=new Image;a.onload=function(){assert(a.complete,\\\"Image \\\"+e+\\\" could not be decoded\\\");var t=document.createElement(\\\"canvas\\\");t.width=a.width,t.height=a.height,t.getContext(\\\"2d\\\").drawImage(a,0,0),Module.preloadedImages[e]=t,Browser.URLObject.revokeObjectURL(o),r&&r(n)},a.onerror=function(n){console.log(\\\"Image \\\"+o+\\\" could not be decoded\\\"),t&&t()},a.src=o}};Module.preloadPlugins.push(n);var e={canHandle:function(n){return!Module.noAudioDecoding&&n.substr(-4)in{\\\".ogg\\\":1,\\\".wav\\\":1,\\\".mp3\\\":1}},handle:function(n,e,r,t){var i=!1;function u(t){i||(i=!0,Module.preloadedAudios[e]=t,r&&r(n))}function o(){i||(i=!0,Module.preloadedAudios[e]=new Audio,t&&t())}if(!Browser.hasBlobConstructor)return o();try{var a=new Blob([n],{type:Browser.getMimetype(e)})}catch(n){return o()}var f=Browser.URLObject.createObjectURL(a),c=new Audio;c.addEventListener(\\\"canplaythrough\\\",(function(){u(c)}),!1),c.onerror=function(r){i||(console.log(\\\"warning: browser could not fully decode audio \\\"+e+\\\", trying slower base64 approach\\\"),c.src=\\\"data:audio/x-\\\"+e.substr(-3)+\\\";base64,\\\"+function(n){for(var e=\\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\\\",r=\\\"\\\",t=0,i=0,u=0;u<n.length;u++)for(t=t<<8|n[u],i+=8;i>=6;){var o=t>>i-6&63;i-=6,r+=e[o]}return 2==i?(r+=e[(3&t)<<4],r+=\\\"==\\\"):4==i&&(r+=e[(15&t)<<2],r+=\\\"=\\\"),r}(n),u(c))},c.src=f,Browser.safeSetTimeout((function(){u(c)}),1e4)}};Module.preloadPlugins.push(e);var r=Module.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener(\\\"pointerlockchange\\\",t,!1),document.addEventListener(\\\"mozpointerlockchange\\\",t,!1),document.addEventListener(\\\"webkitpointerlockchange\\\",t,!1),document.addEventListener(\\\"mspointerlockchange\\\",t,!1),Module.elementPointerLock&&r.addEventListener(\\\"click\\\",(function(n){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),n.preventDefault())}),!1))}function t(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}},createContext:function(n,e,r,t){if(e&&Module.ctx&&n==Module.canvas)return Module.ctx;var i,u;if(e){var o={antialias:!1,alpha:!1};if(t)for(var a in t)o[a]=t[a];(u=GL.createContext(n,o))&&(i=GL.getContext(u).GLctx)}else i=n.getContext(\\\"2d\\\");return i?(r&&(e||assert(\\\"undefined\\\"==typeof GLctx,\\\"cannot set in module if GLctx is used, but we are a non-GL context that would replace it\\\"),Module.ctx=i,e&&GL.makeContextCurrent(u),Module.useWebGL=e,Browser.moduleContextCreatedCallbacks.forEach((function(n){n()})),Browser.init()),i):null},destroyContext:function(n,e,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(n,e,r){Browser.lockPointer=n,Browser.resizeCanvas=e,Browser.vrDevice=r,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1),void 0===Browser.vrDevice&&(Browser.vrDevice=null);var t=Module.canvas;function i(){Browser.isFullscreen=!1;var n=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===n?(t.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},t.exitFullscreen=t.exitFullscreen.bind(document),Browser.lockPointer&&t.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(n.parentNode.insertBefore(t,n),n.parentNode.removeChild(n),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(t)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener(\\\"fullscreenchange\\\",i,!1),document.addEventListener(\\\"mozfullscreenchange\\\",i,!1),document.addEventListener(\\\"webkitfullscreenchange\\\",i,!1),document.addEventListener(\\\"MSFullscreenChange\\\",i,!1));var u=document.createElement(\\\"div\\\");t.parentNode.insertBefore(u,t),u.appendChild(t),u.requestFullscreen=u.requestFullscreen||u.mozRequestFullScreen||u.msRequestFullscreen||(u.webkitRequestFullscreen?function(){u.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(u.webkitRequestFullScreen?function(){u.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?u.requestFullscreen({vrDisplay:r}):u.requestFullscreen()},requestFullScreen:function(n,e,r){return Module.printErr(\\\"Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.\\\"),Browser.requestFullScreen=function(n,e,r){return Browser.requestFullscreen(n,e,r)},Browser.requestFullscreen(n,e,r)},nextRAF:0,fakeRequestAnimationFrame:function(n){var e=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=e+1e3/60;else for(;e+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-e,0);setTimeout(n,r)},requestAnimationFrame:function(n){\\\"undefined\\\"==typeof window?Browser.fakeRequestAnimationFrame(n):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(n))},safeCallback:function(n){return function(){if(!ABORT)return n.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var n=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],n.forEach((function(n){n()}))}},safeRequestAnimationFrame:function(n){return Browser.requestAnimationFrame((function(){ABORT||(Browser.allowAsyncCallbacks?n():Browser.queuedAsyncCallbacks.push(n))}))},safeSetTimeout:function(n,e){return Module.noExitRuntime=!0,setTimeout((function(){ABORT||(Browser.allowAsyncCallbacks?n():Browser.queuedAsyncCallbacks.push(n))}),e)},safeSetInterval:function(n,e){return Module.noExitRuntime=!0,setInterval((function(){ABORT||Browser.allowAsyncCallbacks&&n()}),e)},getMimetype:function(n){return{jpg:\\\"image/jpeg\\\",jpeg:\\\"image/jpeg\\\",png:\\\"image/png\\\",bmp:\\\"image/bmp\\\",ogg:\\\"audio/ogg\\\",wav:\\\"audio/wav\\\",mp3:\\\"audio/mpeg\\\"}[n.substr(n.lastIndexOf(\\\".\\\")+1)]},getUserMedia:function(n){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(n)},getMovementX:function(n){return n.movementX||n.mozMovementX||n.webkitMovementX||0},getMovementY:function(n){return n.movementY||n.mozMovementY||n.webkitMovementY||0},getMouseWheelDelta:function(n){var e=0;switch(n.type){case\\\"DOMMouseScroll\\\":e=n.detail;break;case\\\"mousewheel\\\":e=n.wheelDelta;break;case\\\"wheel\\\":e=n.deltaY;break;default:throw\\\"unrecognized mouse wheel event: \\\"+n.type}return e},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(n){if(Browser.pointerLock)\\\"mousemove\\\"!=n.type&&\\\"mozMovementX\\\"in n?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(n),Browser.mouseMovementY=Browser.getMovementY(n)),\\\"undefined\\\"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var e=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,t=Module.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,u=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(\\\"touchstart\\\"===n.type||\\\"touchend\\\"===n.type||\\\"touchmove\\\"===n.type){var o=n.touch;if(void 0===o)return;var a=o.pageX-(i+e.left),f=o.pageY-(u+e.top),c={x:a*=r/e.width,y:f*=t/e.height};if(\\\"touchstart\\\"===n.type)Browser.lastTouches[o.identifier]=c,Browser.touches[o.identifier]=c;else if(\\\"touchend\\\"===n.type||\\\"touchmove\\\"===n.type){var l=Browser.touches[o.identifier];l||(l=c),Browser.lastTouches[o.identifier]=l,Browser.touches[o.identifier]=c}return}var s=n.pageX-(i+e.left),d=n.pageY-(u+e.top);s*=r/e.width,d*=t/e.height,Browser.mouseMovementX=s-Browser.mouseX,Browser.mouseMovementY=d-Browser.mouseY,Browser.mouseX=s,Browser.mouseY=d}},asyncLoad:function(n,e,r,t){var i=t?\\\"\\\":getUniqueRunDependency(\\\"al \\\"+n);Module.readAsync(n,(function(r){assert(r,'Loading data file \\\"'+n+'\\\" failed (no arrayBuffer).'),e(new Uint8Array(r)),i&&removeRunDependency(i)}),(function(e){if(!r)throw'Loading data file \\\"'+n+'\\\" failed.';r()})),i&&addRunDependency(i)},resizeListeners:[],updateResizeListeners:function(){var n=Module.canvas;Browser.resizeListeners.forEach((function(e){e(n.width,n.height)}))},setCanvasSize:function(n,e,r){var t=Module.canvas;Browser.updateCanvasDimensions(t,n,e),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(\\\"undefined\\\"!=typeof SDL){var n=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];n|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=n}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(\\\"undefined\\\"!=typeof SDL){var n=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];n&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=n}Browser.updateResizeListeners()},updateCanvasDimensions:function(n,e,r){e&&r?(n.widthNative=e,n.heightNative=r):(e=n.widthNative,r=n.heightNative);var t=e,i=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(t/i<Module.forcedAspectRatio?t=Math.round(i*Module.forcedAspectRatio):i=Math.round(t/Module.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===n.parentNode&&\\\"undefined\\\"!=typeof screen){var u=Math.min(screen.width/t,screen.height/i);t=Math.round(t*u),i=Math.round(i*u)}Browser.resizeCanvas?(n.width!=t&&(n.width=t),n.height!=i&&(n.height=i),void 0!==n.style&&(n.style.removeProperty(\\\"width\\\"),n.style.removeProperty(\\\"height\\\"))):(n.width!=e&&(n.width=e),n.height!=r&&(n.height=r),void 0!==n.style&&(t!=e||i!=r?(n.style.setProperty(\\\"width\\\",t+\\\"px\\\",\\\"important\\\"),n.style.setProperty(\\\"height\\\",i+\\\"px\\\",\\\"important\\\")):(n.style.removeProperty(\\\"width\\\"),n.style.removeProperty(\\\"height\\\"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var n=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,n}},SYSCALLS={varargs:0,get:function(n){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var n=SYSCALLS.get(),e=SYSCALLS.get();return assert(n>=0?0===e:-1===e),n},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(n,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function ___syscall54(n,e){SYSCALLS.varargs=e;try{return 0}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function _typeModule(n){var e=[[0,1,\\\"X\\\"],[1,1,\\\"const X\\\"],[128,1,\\\"X *\\\"],[256,1,\\\"X &\\\"],[384,1,\\\"X &&\\\"],[512,1,\\\"std::shared_ptr<X>\\\"],[640,1,\\\"std::unique_ptr<X>\\\"],[5120,1,\\\"std::vector<X>\\\"],[6144,2,\\\"std::array<X, Y>\\\"],[9216,-1,\\\"std::function<X (Y)>\\\"]];function r(n,e,r,t,i,u){if(1==e){var o=896&t;128!=o&&256!=o&&384!=o||(n=\\\"X const\\\")}return(u?r.replace(\\\"X\\\",n).replace(\\\"Y\\\",i):n.replace(\\\"X\\\",r).replace(\\\"Y\\\",i)).replace(/([*&]) (?=[*&])/g,\\\"$1\\\")}function t(n,e){var r=e.flags,t=896&r,i=15360&r;return e.name||1024!=i||(1==e.ptrSize?e.name=(16&r?\\\"\\\":(8&r?\\\"un\\\":\\\"\\\")+\\\"signed \\\")+\\\"char\\\":e.name=(8&r?\\\"u\\\":\\\"\\\")+(32&r?\\\"float\\\":\\\"int\\\")+8*e.ptrSize+\\\"_t\\\"),8!=e.ptrSize||32&r||(i=64),2048==i&&(512==t||640==t?i=4096:t&&(i=3072)),n(i,e)}var i={Type:function(){function n(n){this.id=n.id,this.name=n.name,this.flags=n.flags,this.spec=n}return n.prototype.toString=function(){return this.name},n}(),getComplexType:function n(i,u,o,a,f,c,l,s){void 0===c&&(c=\\\"X\\\"),void 0===s&&(s=1);var d=o(i);if(d)return d;var _,v=a(i),p=v.placeholderFlag,m=e[p];l&&m&&(c=r(l[2],l[0],c,m[0],\\\"?\\\",!0)),0==p&&(_=\\\"Unbound\\\"),p>=10&&(_=\\\"Corrupt\\\"),s>20&&(_=\\\"Deeply nested\\\"),_&&function(n,e,r,t,i){throw new Error(n+\\\" type \\\"+r.replace(\\\"X\\\",e+\\\"?\\\")+(t?\\\" with flag \\\"+t:\\\"\\\")+\\\" in \\\"+i)}(_,i,c,p,f||\\\"?\\\");var b,h=n(v.paramList[0],u,o,a,f,c,m,s+1),y={flags:m[0],id:i,name:\\\"\\\",paramList:[h]},w=[],M=\\\"?\\\";switch(v.placeholderFlag){case 1:b=h.spec;break;case 2:if(1024==(15360&h.flags)&&1==h.spec.ptrSize){y.flags=7168;break}case 3:case 6:case 5:b=h.spec,h.flags;break;case 8:M=\\\"\\\"+v.paramList[1],y.paramList.push(v.paramList[1]);break;case 9:for(var k=0,g=v.paramList[1];k<g.length;k++){var T=n(g[k],u,o,a,f,c,m,s+1);w.push(T.name),y.paramList.push(T)}M=w.join(\\\", \\\")}if(y.name=r(m[2],m[0],h.name,h.flags,M),b){for(var A=0,S=Object.keys(b);A<S.length;A++){var E=S[A];y[E]=y[E]||b[E]}y.flags|=b.flags}return t(u,y)},makeType:t,structureList:e};return n.output=i,n.output||i}function __nbind_register_type(n,e){var r={flags:10240,id:n,name:_nbind.readAsciiString(e)};_nbind.makeType(_nbind.constructType,r)}function __nbind_register_callback_signature(n,e){var r=_nbind.readTypeIdList(n,e),t=_nbind.callbackSignatureList.length;return _nbind.callbackSignatureList[t]=_nbind.makeJSCaller(r),t}function __extends(n,e){for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);function t(){this.constructor=n}t.prototype=e.prototype,n.prototype=new t}function __nbind_register_class(n,e,r,t,i,u,o){var a=_nbind.readAsciiString(o),f=_nbind.readPolicyList(e),c=HEAPU32.subarray(n/4,n/4+2),l={flags:2048|(f.Value?2:0),id:c[0],name:a},s=_nbind.makeType(_nbind.constructType,l);s.ptrType=_nbind.getComplexType(c[1],_nbind.constructType,_nbind.getType,_nbind.queryType),s.destroy=_nbind.makeMethodCaller(s.ptrType,{boundID:l.id,flags:0,name:\\\"destroy\\\",num:0,ptr:u,title:s.name+\\\".free\\\",typeList:[\\\"void\\\",\\\"uint32_t\\\",\\\"uint32_t\\\"]}),i&&(s.superIdList=Array.prototype.slice.call(HEAPU32.subarray(r/4,r/4+i)),s.upcastList=Array.prototype.slice.call(HEAPU32.subarray(t/4,t/4+i))),Module[s.name]=s.makeBound(f),_nbind.BindClass.list.push(s)}function _removeAccessorPrefix(n){return n.replace(/^[Gg]et_?([A-Z]?([A-Z]?))/,(function(n,e,r){return r?e:e.toLowerCase()}))}function __nbind_register_function(n,e,r,t,i,u,o,a,f,c){var l,s=_nbind.getType(n),d=_nbind.readPolicyList(e),_=_nbind.readTypeIdList(r,t);if(5==o)l=[{direct:i,name:\\\"__nbindConstructor\\\",ptr:0,title:s.name+\\\" constructor\\\",typeList:[\\\"uint32_t\\\"].concat(_.slice(1))},{direct:u,name:\\\"__nbindValueConstructor\\\",ptr:0,title:s.name+\\\" value constructor\\\",typeList:[\\\"void\\\",\\\"uint32_t\\\"].concat(_.slice(1))}];else{var v=_nbind.readAsciiString(a),p=(s.name&&s.name+\\\".\\\")+v;3!=o&&4!=o||(v=_removeAccessorPrefix(v)),l=[{boundID:n,direct:u,name:v,ptr:i,title:p,typeList:_}]}for(var m=0,b=l;m<b.length;m++){var h=b[m];h.signatureType=o,h.policyTbl=d,h.num=f,h.flags=c,s.addMethod(h)}}function _nbind_value(n,e){_nbind.typeNameTbl[n]||_nbind.throwError(\\\"Unknown value type \\\"+n),Module.NBind.bind_value(n,e),_defineHidden(_nbind.typeNameTbl[n].proto.prototype.__nbindValueConstructor)(e.prototype,\\\"__nbindValueConstructor\\\")}function __nbind_get_value_object(n,e){var r=_nbind.popValue(n);if(!r.fromJS)throw new Error(\\\"Object \\\"+r+\\\" has no fromJS function\\\");r.fromJS((function(){r.__nbindValueConstructor.apply(this,Array.prototype.concat.apply([e],arguments))}))}function _emscripten_memcpy_big(n,e,r){return HEAPU8.set(HEAPU8.subarray(e,e+r),n),n}function __nbind_register_primitive(n,e,r){var t={flags:1024|r,id:n,ptrSize:e};_nbind.makeType(_nbind.constructType,t)}Module._nbind_value=_nbind_value;var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],\\\"i8\\\",ALLOC_STATIC);function ___setErrNo(n){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=n),n}function _llvm_stacksave(){var n=_llvm_stacksave;return n.LLVM_SAVEDSTACKS||(n.LLVM_SAVEDSTACKS=[]),n.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),n.LLVM_SAVEDSTACKS.length-1}function ___syscall140(n,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD(),t=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),u=SYSCALLS.get(),o=t;return FS.llseek(r,o,u),HEAP32[i>>2]=r.position,r.getdents&&0===o&&0===u&&(r.getdents=null),0}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function ___syscall146(n,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.get(),t=SYSCALLS.get(),i=SYSCALLS.get(),u=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(n,e){var r=___syscall146.buffers[n];assert(r),0===e||10===e?((1===n?Module.print:Module.printErr)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)});for(var o=0;o<i;o++){for(var a=HEAP32[t+8*o>>2],f=HEAP32[t+(8*o+4)>>2],c=0;c<f;c++)___syscall146.printChar(r,HEAPU8[a+c]);u+=f}return u}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function __nbind_finish(){for(var n=0,e=_nbind.BindClass.list;n<e.length;n++){e[n].finish()}}var ___dso_handle=STATICTOP;function invoke_viiiii(n,e,r,t,i,u){try{Module.dynCall_viiiii(n,e,r,t,i,u)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vif(n,e,r){try{Module.dynCall_vif(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vid(n,e,r){try{Module.dynCall_vid(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_fiff(n,e,r,t){try{return Module.dynCall_fiff(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vi(n,e){try{Module.dynCall_vi(n,e)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vii(n,e,r){try{Module.dynCall_vii(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_ii(n,e){try{return Module.dynCall_ii(n,e)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viddi(n,e,r,t,i){try{Module.dynCall_viddi(n,e,r,t,i)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vidd(n,e,r,t){try{Module.dynCall_vidd(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iiii(n,e,r,t){try{return Module.dynCall_iiii(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_diii(n,e,r,t){try{return Module.dynCall_diii(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_di(n,e){try{return Module.dynCall_di(n,e)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iid(n,e,r){try{return Module.dynCall_iid(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iii(n,e,r){try{return Module.dynCall_iii(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiddi(n,e,r,t,i,u){try{Module.dynCall_viiddi(n,e,r,t,i,u)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiiiii(n,e,r,t,i,u,o){try{Module.dynCall_viiiiii(n,e,r,t,i,u,o)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_dii(n,e,r){try{return Module.dynCall_dii(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_i(n){try{return Module.dynCall_i(n)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iiiiii(n,e,r,t,i,u){try{return Module.dynCall_iiiiii(n,e,r,t,i,u)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiid(n,e,r,t,i){try{Module.dynCall_viiid(n,e,r,t,i)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viififi(n,e,r,t,i,u,o){try{Module.dynCall_viififi(n,e,r,t,i,u,o)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viii(n,e,r,t){try{Module.dynCall_viii(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_v(n){try{Module.dynCall_v(n)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viid(n,e,r,t){try{Module.dynCall_viid(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_idd(n,e,r){try{return Module.dynCall_idd(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiii(n,e,r,t,i){try{Module.dynCall_viiii(n,e,r,t,i)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}STATICTOP+=16,function(_nbind){var typeIdTbl={};_nbind.typeNameTbl={};var Pool=function(){function n(){}return n.lalloc=function(e){e=e+7&-8;var r=HEAPU32[n.usedPtr];return e>n.pageSize/2||e>n.pageSize-r?_nbind.typeNameTbl.NBind.proto.lalloc(e):(HEAPU32[n.usedPtr]=r+e,n.rootPtr+r)},n.lreset=function(e,r){HEAPU32[n.pagePtr]?_nbind.typeNameTbl.NBind.proto.lreset(e,r):HEAPU32[n.usedPtr]=e},n}();function constructType(n,e){var r=new(10240==n?_nbind.makeTypeNameTbl[e.name]||_nbind.BindType:_nbind.makeTypeKindTbl[n])(e);return typeIdTbl[e.id]=r,_nbind.typeNameTbl[e.name]=r,r}function getType(n){return typeIdTbl[n]}function queryType(n){var e=HEAPU8[n],r=_nbind.structureList[e][1];n/=4,r<0&&(++n,r=HEAPU32[n]+1);var t=Array.prototype.slice.call(HEAPU32.subarray(n+1,n+1+r));return 9==e&&(t=[t[0],t.slice(1)]),{paramList:t,placeholderFlag:e}}function getTypes(n,e){return n.map((function(n){return\\\"number\\\"==typeof n?_nbind.getComplexType(n,constructType,getType,queryType,e):_nbind.typeNameTbl[n]}))}function readTypeIdList(n,e){return Array.prototype.slice.call(HEAPU32,n/4,n/4+e)}function readAsciiString(n){for(var e=n;HEAPU8[e++];);return String.fromCharCode.apply(\\\"\\\",HEAPU8.subarray(n,e-1))}function readPolicyList(n){var e={};if(n)for(;;){var r=HEAPU32[n/4];if(!r)break;e[readAsciiString(r)]=!0,n+=4}return e}function getDynCall(n,e){var r={float32_t:\\\"d\\\",float64_t:\\\"d\\\",int64_t:\\\"d\\\",uint64_t:\\\"d\\\",void:\\\"v\\\"},t=n.map((function(n){return r[n.name]||\\\"i\\\"})).join(\\\"\\\"),i=Module[\\\"dynCall_\\\"+t];if(!i)throw new Error(\\\"dynCall_\\\"+t+\\\" not found for \\\"+e+\\\"(\\\"+n.map((function(n){return n.name})).join(\\\", \\\")+\\\")\\\");return i}function addMethod(n,e,r,t){var i=n[e];n.hasOwnProperty(e)&&i?((i.arity||0===i.arity)&&(i=_nbind.makeOverloader(i,i.arity),n[e]=i),i.addMethod(r,t)):(r.arity=t,n[e]=r)}function throwError(n){throw new Error(n)}_nbind.Pool=Pool,_nbind.constructType=constructType,_nbind.getType=getType,_nbind.queryType=queryType,_nbind.getTypes=getTypes,_nbind.readTypeIdList=readTypeIdList,_nbind.readAsciiString=readAsciiString,_nbind.readPolicyList=readPolicyList,_nbind.getDynCall=getDynCall,_nbind.addMethod=addMethod,_nbind.throwError=throwError,_nbind.bigEndian=!1;var _a=_typeModule(_typeModule);_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.heap=HEAPU32,e.ptrSize=4,e}return __extends(e,n),e.prototype.needsWireRead=function(n){return!!this.wireRead||!!this.makeWireRead},e.prototype.needsWireWrite=function(n){return!!this.wireWrite||!!this.makeWireWrite},e}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(n){function e(e){var r=n.call(this,e)||this,t=32&e.flags?{32:HEAPF32,64:HEAPF64}:8&e.flags?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return r.heap=t[8*e.ptrSize],r.ptrSize=e.ptrSize,r}return __extends(e,n),e.prototype.needsWireWrite=function(n){return!!n&&!!n.Strict},e.prototype.makeWireWrite=function(n,e){return e&&e.Strict&&function(n){if(\\\"number\\\"==typeof n)return n;throw new Error(\\\"Type mismatch\\\")}},e}(BindType);function pushCString(n,e){if(null==n){if(e&&e.Nullable)return 0;throw new Error(\\\"Type mismatch\\\")}if(e&&e.Strict){if(\\\"string\\\"!=typeof n)throw new Error(\\\"Type mismatch\\\")}else n=n.toString();var r=Module.lengthBytesUTF8(n)+1,t=_nbind.Pool.lalloc(r);return Module.stringToUTF8Array(n,HEAPU8,t,r),t}function popCString(n){return 0===n?null:Module.Pointer_stringify(n)}_nbind.PrimitiveType=PrimitiveType,_nbind.pushCString=pushCString,_nbind.popCString=popCString;var CStringType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=popCString,e.wireWrite=pushCString,e.readResources=[_nbind.resources.pool],e.writeResources=[_nbind.resources.pool],e}return __extends(e,n),e.prototype.makeWireWrite=function(n,e){return function(n){return pushCString(n,e)}},e}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=function(n){return!!n},e}return __extends(e,n),e.prototype.needsWireWrite=function(n){return!!n&&!!n.Strict},e.prototype.makeWireRead=function(n){return\\\"!!(\\\"+n+\\\")\\\"},e.prototype.makeWireWrite=function(n,e){return e&&e.Strict&&function(n){if(\\\"boolean\\\"==typeof n)return n;throw new Error(\\\"Type mismatch\\\")}||n},e}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function n(){}return n.prototype.persist=function(){this.__nbindState|=1},n}();function makeBound(n,e){var r=function(n){function r(e,t,i,u){var o=n.call(this)||this;if(!(o instanceof r))return new(Function.prototype.bind.apply(r,Array.prototype.concat.apply([null],arguments)));var a=t,f=i,c=u;if(e!==_nbind.ptrMarker){var l=o.__nbindConstructor.apply(o,arguments);a=4608,c=HEAPU32[l/4],f=HEAPU32[l/4+1]}var s={configurable:!0,enumerable:!1,value:null,writable:!1},d={__nbindFlags:a,__nbindPtr:f};c&&(d.__nbindShared=c,_nbind.mark(o));for(var _=0,v=Object.keys(d);_<v.length;_++){var p=v[_];s.value=d[p],Object.defineProperty(o,p,s)}return _defineHidden(0)(o,\\\"__nbindState\\\"),o}return __extends(r,n),r.prototype.free=function(){e.destroy.call(this,this.__nbindShared,this.__nbindFlags),this.__nbindState|=2,disableMember(this,\\\"__nbindShared\\\"),disableMember(this,\\\"__nbindPtr\\\")},r}(Wrapper);return __decorate([_defineHidden()],r.prototype,\\\"__nbindConstructor\\\",void 0),__decorate([_defineHidden()],r.prototype,\\\"__nbindValueConstructor\\\",void 0),__decorate([_defineHidden(n)],r.prototype,\\\"__nbindPolicies\\\",void 0),r}function disableMember(n,e){function r(){throw new Error(\\\"Accessing deleted object\\\")}Object.defineProperty(n,e,{configurable:!1,enumerable:!1,get:r,set:r})}_nbind.Wrapper=Wrapper,_nbind.makeBound=makeBound,_nbind.ptrMarker={};var BindClass=function(n){function e(e){var r=n.call(this,e)||this;return r.wireRead=function(n){return _nbind.popValue(n,r.ptrType)},r.wireWrite=function(n){return pushPointer(n,r.ptrType,!0)},r.pendingSuperCount=0,r.ready=!1,r.methodTbl={},e.paramList?(r.classType=e.paramList[0].classType,r.proto=r.classType.proto):r.classType=r,r}return __extends(e,n),e.prototype.makeBound=function(n){var e=_nbind.makeBound(n,this);return this.proto=e,this.ptrType.proto=e,e},e.prototype.addMethod=function(n){var e=this.methodTbl[n.name]||[];e.push(n),this.methodTbl[n.name]=e},e.prototype.registerMethods=function(n,e){for(var r,t=0,i=Object.keys(n.methodTbl);t<i.length;t++)for(var u=i[t],o=0,a=n.methodTbl[u];o<a.length;o++){var f=a[o],c=void 0,l=void 0;if(c=this.proto.prototype,!e||1==f.signatureType)switch(f.signatureType){case 1:c=this.proto;case 5:l=_nbind.makeCaller(f),_nbind.addMethod(c,f.name,l,f.typeList.length-1);break;case 4:r=_nbind.makeMethodCaller(n.ptrType,f);break;case 3:Object.defineProperty(c,f.name,{configurable:!0,enumerable:!1,get:_nbind.makeMethodCaller(n.ptrType,f),set:r});break;case 2:l=_nbind.makeMethodCaller(n.ptrType,f),_nbind.addMethod(c,f.name,l,f.typeList.length-1)}}},e.prototype.registerSuperMethods=function(n,e,r){if(!r[n.name]){r[n.name]=!0;for(var t,i=0,u=0,o=n.superIdList||[];u<o.length;u++){var a=o[u],f=_nbind.getType(a);t=i++<e||e<0?-1:0,this.registerSuperMethods(f,t,r)}this.registerMethods(n,e<0)}},e.prototype.finish=function(){if(this.ready)return this;this.ready=!0,this.superList=(this.superIdList||[]).map((function(n){return _nbind.getType(n).finish()}));var n=this.proto;if(this.superList.length){var e=function(){this.constructor=n};e.prototype=this.superList[0].proto.prototype,n.prototype=new e}return n!=Module&&(n.prototype.__nbindType=this),this.registerSuperMethods(this,1,{}),this},e.prototype.upcastStep=function(n,e){if(n==this)return e;for(var r=0;r<this.superList.length;++r){var t=this.superList[r].upcastStep(n,_nbind.callUpcast(this.upcastList[r],e));if(t)return t}return 0},e}(_nbind.BindType);function popPointer(n,e){return n?new e.proto(_nbind.ptrMarker,e.flags,n):null}function pushPointer(n,e,r){if(!(n instanceof _nbind.Wrapper)){if(r)return _nbind.pushValue(n);throw new Error(\\\"Type mismatch\\\")}var t=n.__nbindPtr,i=n.__nbindType.classType,u=e.classType;if(n instanceof e.proto)for(;i!=u;)t=_nbind.callUpcast(i.upcastList[0],t),i=i.superList[0];else if(!(t=i.upcastStep(u,t)))throw new Error(\\\"Type mismatch\\\");return t}function pushMutablePointer(n,e){var r=pushPointer(n,e);if(1&n.__nbindFlags)throw new Error(\\\"Passing a const value as a non-const argument\\\");return r}BindClass.list=[],_nbind.BindClass=BindClass,_nbind.popPointer=popPointer,_nbind.pushPointer=pushPointer;var BindClassPtr=function(n){function e(e){var r=n.call(this,e)||this;r.classType=e.paramList[0].classType,r.proto=r.classType.proto;var t=1&e.flags,i=256==(896&r.flags)&&2&e.flags,u=t?pushPointer:pushMutablePointer,o=i?_nbind.popValue:popPointer;return r.makeWireWrite=function(n,e){return e.Nullable?function(n){return n?u(n,r):0}:function(n){return u(n,r)}},r.wireRead=function(n){return o(n,r)},r.wireWrite=function(n){return u(n,r)},r}return __extends(e,n),e}(_nbind.BindType);function popShared(n,e){var r=HEAPU32[n/4],t=HEAPU32[n/4+1];return t?new e.proto(_nbind.ptrMarker,e.flags,t,r):null}function pushShared(n,e){if(!(n instanceof e.proto))throw new Error(\\\"Type mismatch\\\");return n.__nbindShared}function pushMutableShared(n,e){if(!(n instanceof e.proto))throw new Error(\\\"Type mismatch\\\");if(1&n.__nbindFlags)throw new Error(\\\"Passing a const value as a non-const argument\\\");return n.__nbindShared}_nbind.BindClassPtr=BindClassPtr,_nbind.popShared=popShared;var SharedClassPtr=function(n){function e(e){var r=n.call(this,e)||this;r.readResources=[_nbind.resources.pool],r.classType=e.paramList[0].classType,r.proto=r.classType.proto;var t=1&e.flags?pushShared:pushMutableShared;return r.wireRead=function(n){return popShared(n,r)},r.wireWrite=function(n){return t(n,r)},r}return __extends(e,n),e}(_nbind.BindType);_nbind.SharedClassPtr=SharedClassPtr,_nbind.externalList=[0];var firstFreeExternal=0,External=function(){function n(n){this.refCount=1,this.data=n}return n.prototype.register=function(){var n=firstFreeExternal;return n?firstFreeExternal=_nbind.externalList[n]:n=_nbind.externalList.length,_nbind.externalList[n]=this,n},n.prototype.reference=function(){++this.refCount},n.prototype.dereference=function(n){0==--this.refCount&&(this.free&&this.free(),_nbind.externalList[n]=firstFreeExternal,firstFreeExternal=n)},n}();function popExternal(n){var e=_nbind.externalList[n];return e.dereference(n),e.data}function pushExternal(n){var e=new External(n);return e.reference(),e.register()}_nbind.External=External;var ExternalType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=popExternal,e.wireWrite=pushExternal,e}return __extends(e,n),e}(_nbind.BindType);_nbind.ExternalType=ExternalType,_nbind.callbackSignatureList=[];var CallbackType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireWrite=function(n){return\\\"function\\\"!=typeof n&&_nbind.throwError(\\\"Type mismatch\\\"),new _nbind.External(n).register()},e}return __extends(e,n),e}(_nbind.BindType);_nbind.CallbackType=CallbackType,_nbind.valueList=[0];var firstFreeValue=0;function pushValue(n){var e=firstFreeValue;return e?firstFreeValue=_nbind.valueList[e]:e=_nbind.valueList.length,_nbind.valueList[e]=n,2*e+1}function popValue(n,e){if(n||_nbind.throwError(\\\"Value type JavaScript class is missing or not registered\\\"),1&n){n>>=1;var r=_nbind.valueList[n];return _nbind.valueList[n]=firstFreeValue,firstFreeValue=n,r}if(e)return _nbind.popShared(n,e);throw new Error(\\\"Invalid value slot \\\"+n)}_nbind.pushValue=pushValue,_nbind.popValue=popValue;var valueBase=0x10000000000000000;function push64(n){return\\\"number\\\"==typeof n?n:4096*pushValue(n)+valueBase}function pop64(n){return n<valueBase?n:popValue((n-valueBase)/4096)}var CreateValueType=function(n){function e(){return null!==n&&n.apply(this,arguments)||this}return __extends(e,n),e.prototype.makeWireWrite=function(n){return\\\"(_nbind.pushValue(new \\\"+n+\\\"))\\\"},e}(_nbind.BindType);_nbind.CreateValueType=CreateValueType;var Int64Type=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireWrite=push64,e.wireRead=pop64,e}return __extends(e,n),e}(_nbind.BindType);function pushArray(n,e){if(!n)return 0;var r=n.length;if((e.size||0===e.size)&&r<e.size)throw new Error(\\\"Type mismatch\\\");var t=e.memberType.ptrSize,i=_nbind.Pool.lalloc(4+r*t);HEAPU32[i/4]=r;var u=e.memberType.heap,o=(i+4)/t,a=e.memberType.wireWrite,f=0;if(a)for(;f<r;)u[o++]=a(n[f++]);else for(;f<r;)u[o++]=n[f++];return i}function popArray(n,e){if(0===n)return null;var r=HEAPU32[n/4],t=new Array(r),i=e.memberType.heap;n=(n+4)/e.memberType.ptrSize;var u=e.memberType.wireRead,o=0;if(u)for(;o<r;)t[o++]=u(i[n++]);else for(;o<r;)t[o++]=i[n++];return t}_nbind.Int64Type=Int64Type,_nbind.pushArray=pushArray,_nbind.popArray=popArray;var ArrayType=function(n){function e(e){var r=n.call(this,e)||this;return r.wireRead=function(n){return popArray(n,r)},r.wireWrite=function(n){return pushArray(n,r)},r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r.memberType=e.paramList[0],e.paramList[1]&&(r.size=e.paramList[1]),r}return __extends(e,n),e}(_nbind.BindType);function pushString(n,e){if(null==n){if(!e||!e.Nullable)throw new Error(\\\"Type mismatch\\\");n=\\\"\\\"}if(e&&e.Strict){if(\\\"string\\\"!=typeof n)throw new Error(\\\"Type mismatch\\\")}else n=n.toString();var r=Module.lengthBytesUTF8(n),t=_nbind.Pool.lalloc(4+r+1);return HEAPU32[t/4]=r,Module.stringToUTF8Array(n,HEAPU8,t+4,r+1),t}function popString(n){if(0===n)return null;var e=HEAPU32[n/4];return Module.Pointer_stringify(n+4,e)}_nbind.ArrayType=ArrayType,_nbind.pushString=pushString,_nbind.popString=popString;var StringType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=popString,e.wireWrite=pushString,e.readResources=[_nbind.resources.pool],e.writeResources=[_nbind.resources.pool],e}return __extends(e,n),e.prototype.makeWireWrite=function(n,e){return function(n){return pushString(n,e)}},e}(_nbind.BindType);function makeArgList(n){return Array.apply(null,Array(n)).map((function(n,e){return\\\"a\\\"+(e+1)}))}function anyNeedsWireWrite(n,e){return n.reduce((function(n,r){return n||r.needsWireWrite(e)}),!1)}function anyNeedsWireRead(n,e){return n.reduce((function(n,r){return n||!!r.needsWireRead(e)}),!1)}function makeWireRead(n,e,r,t){var i=n.length;return r.makeWireRead?r.makeWireRead(t,n,i):r.wireRead?(n[i]=r.wireRead,\\\"(convertParamList[\\\"+i+\\\"](\\\"+t+\\\"))\\\"):t}function makeWireWrite(n,e,r,t){var i,u=n.length;return(i=r.makeWireWrite?r.makeWireWrite(t,e,n,u):r.wireWrite)?\\\"string\\\"==typeof i?i:(n[u]=i,\\\"(convertParamList[\\\"+u+\\\"](\\\"+t+\\\"))\\\"):t}function buildCallerFunction(dynCall,ptrType,ptr,num,policyTbl,needsWireWrite,prefix,returnType,argTypeList,mask,err){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireRead(convertParamList,policyTbl,returnType,\\\"dynCall(\\\"+[prefix].concat(argList.map((function(n,e){return makeWireWrite(convertParamList,policyTbl,argTypeList[e],n)}))).join(\\\",\\\")+\\\")\\\"),resourceSet=_nbind.listResources([returnType],argTypeList),sourceCode=\\\"function(\\\"+argList.join(\\\",\\\")+\\\"){\\\"+(mask?\\\"this.__nbindFlags&mask&&err();\\\":\\\"\\\")+resourceSet.makeOpen()+\\\"var r=\\\"+callExpression+\\\";\\\"+resourceSet.makeClose()+\\\"return r;}\\\";return eval(\\\"(\\\"+sourceCode+\\\")\\\")}function buildJSCallerFunction(returnType,argTypeList){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireWrite(convertParamList,null,returnType,\\\"_nbind.externalList[num].data(\\\"+argList.map((function(n,e){return makeWireRead(convertParamList,null,argTypeList[e],n)})).join(\\\",\\\")+\\\")\\\"),resourceSet=_nbind.listResources(argTypeList,[returnType]);resourceSet.remove(_nbind.resources.pool);var sourceCode=\\\"function(\\\"+[\\\"dummy\\\",\\\"num\\\"].concat(argList).join(\\\",\\\")+\\\"){\\\"+resourceSet.makeOpen()+\\\"var r=\\\"+callExpression+\\\";\\\"+resourceSet.makeClose()+\\\"return r;}\\\";return eval(\\\"(\\\"+sourceCode+\\\")\\\")}function makeJSCaller(n){var e=n.length-1,r=_nbind.getTypes(n,\\\"callback\\\"),t=r[0],i=r.slice(1),u=anyNeedsWireRead(i,null);if(!t.needsWireWrite(null)&&!u)switch(e){case 0:return function(n,e){return _nbind.externalList[e].data()};case 1:return function(n,e,r){return _nbind.externalList[e].data(r)};case 2:return function(n,e,r,t){return _nbind.externalList[e].data(r,t)};case 3:return function(n,e,r,t,i){return _nbind.externalList[e].data(r,t,i)}}return buildJSCallerFunction(t,i)}function makeMethodCaller(n,e){var r=e.typeList.length-1,t=e.typeList.slice(0);t.splice(1,0,\\\"uint32_t\\\",e.boundID);var i=_nbind.getTypes(t,e.title),u=i[0],o=i.slice(3),a=u.needsWireRead(e.policyTbl),f=anyNeedsWireWrite(o,e.policyTbl),c=e.ptr,l=e.num,s=_nbind.getDynCall(i,e.title),d=1&~e.flags;function _(){throw new Error(\\\"Calling a non-const method on a const object\\\")}if(!a&&!f)switch(r){case 0:return function(){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n))};case 1:return function(e){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n),e)};case 2:return function(e,r){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n),e,r)};case 3:return function(e,r,t){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n),e,r,t)}}return buildCallerFunction(s,n,c,l,e.policyTbl,f,\\\"ptr,num,pushPointer(this,ptrType)\\\",u,o,d,_)}function makeCaller(n){var e,r=n.typeList.length-1,t=_nbind.getTypes(n.typeList,n.title),i=t[0],u=t.slice(1),o=i.needsWireRead(n.policyTbl),a=anyNeedsWireWrite(u,n.policyTbl),f=n.direct,c=n.ptr;if(n.direct&&!o&&!a){var l=_nbind.getDynCall(t,n.title);switch(r){case 0:return function(){return l(f)};case 1:return function(n){return l(f,n)};case 2:return function(n,e){return l(f,n,e)};case 3:return function(n,e,r){return l(f,n,e,r)}}c=0}if(c){var s=n.typeList.slice(0);s.splice(1,0,\\\"uint32_t\\\"),t=_nbind.getTypes(s,n.title),e=\\\"ptr,num\\\"}else c=f,e=\\\"ptr\\\";return buildCallerFunction(_nbind.getDynCall(t,n.title),null,c,n.num,n.policyTbl,a,e,i,u)}function makeOverloader(n,e){var r=[];function t(){return r[arguments.length].apply(this,arguments)}return t.addMethod=function(n,e){r[e]=n},t.addMethod(n,e),t}_nbind.StringType=StringType,_nbind.buildJSCallerFunction=buildJSCallerFunction,_nbind.makeJSCaller=makeJSCaller,_nbind.makeMethodCaller=makeMethodCaller,_nbind.makeCaller=makeCaller,_nbind.makeOverloader=makeOverloader;var Resource=function(){function n(n,e){var r=this;this.makeOpen=function(){return Object.keys(r.openTbl).join(\\\"\\\")},this.makeClose=function(){return Object.keys(r.closeTbl).join(\\\"\\\")},this.openTbl={},this.closeTbl={},n&&(this.openTbl[n]=!0),e&&(this.closeTbl[e]=!0)}return n.prototype.add=function(n){for(var e=0,r=Object.keys(n.openTbl);e<r.length;e++){var t=r[e];this.openTbl[t]=!0}for(var i=0,u=Object.keys(n.closeTbl);i<u.length;i++){t=u[i];this.closeTbl[t]=!0}},n.prototype.remove=function(n){for(var e=0,r=Object.keys(n.openTbl);e<r.length;e++){var t=r[e];delete this.openTbl[t]}for(var i=0,u=Object.keys(n.closeTbl);i<u.length;i++){t=u[i];delete this.closeTbl[t]}},n}();function listResources(n,e){for(var r=new Resource,t=0,i=n;t<i.length;t++)for(var u=0,o=i[t].readResources||[];u<o.length;u++){var a=o[u];r.add(a)}for(var f=0,c=e;f<c.length;f++)for(var l=0,s=c[f].writeResources||[];l<s.length;l++){a=s[l];r.add(a)}return r}_nbind.Resource=Resource,_nbind.listResources=listResources,_nbind.resources={pool:new Resource(\\\"var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];\\\",\\\"_nbind.Pool.lreset(used,page);\\\")};var ExternalBuffer=function(n){function e(e,r){var t=n.call(this,e)||this;return t.ptr=r,t}return __extends(e,n),e.prototype.free=function(){_free(this.ptr)},e}(_nbind.External);function getBuffer(n){return n instanceof ArrayBuffer?new Uint8Array(n):n instanceof DataView?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function pushBuffer(n,e){if(null==n&&e&&e.Nullable&&(n=[]),\\\"object\\\"!=typeof n)throw new Error(\\\"Type mismatch\\\");var r=n,t=r.byteLength||r.length;if(!t&&0!==t&&0!==r.byteLength)throw new Error(\\\"Type mismatch\\\");var i=_nbind.Pool.lalloc(8),u=_malloc(t),o=i/4;return HEAPU32[o++]=t,HEAPU32[o++]=u,HEAPU32[o++]=new ExternalBuffer(n,u).register(),HEAPU8.set(getBuffer(n),u),i}var BufferType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireWrite=pushBuffer,e.readResources=[_nbind.resources.pool],e.writeResources=[_nbind.resources.pool],e}return __extends(e,n),e.prototype.makeWireWrite=function(n,e){return function(n){return pushBuffer(n,e)}},e}(_nbind.BindType);function commitBuffer(n,e,r){var t=_nbind.externalList[n].data,i=Buffer;if(\\\"function\\\"!=typeof Buffer&&(i=function(){}),t instanceof Array);else{var u=HEAPU8.subarray(e,e+r);if(t instanceof i){(\\\"function\\\"==typeof Buffer.from&&Buffer.from.length>=3?Buffer.from(u):new Buffer(u)).copy(t)}else getBuffer(t).set(u)}}_nbind.BufferType=BufferType,_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var n=0,e=dirtyList;n<e.length;n++){var r=e[n];3&r.__nbindState||r.free()}dirtyList=[],gcTimer=0}function toggleLightGC(n){_nbind.mark=n?function(n){dirtyList.push(n),gcTimer||(gcTimer=setTimeout(sweep,0))}:function(n){}}_nbind.mark=function(n){},_nbind.toggleLightGC=toggleLightGC}(_nbind),Module.requestFullScreen=function(n,e,r){Module.printErr(\\\"Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.\\\"),Module.requestFullScreen=Module.requestFullscreen,Browser.requestFullScreen(n,e,r)},Module.requestFullscreen=function(n,e,r){Browser.requestFullscreen(n,e,r)},Module.requestAnimationFrame=function(n){Browser.requestAnimationFrame(n)},Module.setCanvasSize=function(n,e,r){Browser.setCanvasSize(n,e,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(n,e,r,t){return Browser.createContext(n,e,r,t)},_emscripten_get_now=ENVIRONMENT_IS_NODE?function(){var n=process.hrtime();return 1e3*n[0]+n[1]/1e6}:\\\"undefined\\\"!=typeof dateNow?dateNow:\\\"object\\\"==typeof self&&self.performance&&\\\"function\\\"==typeof self.performance.now?function(){return self.performance.now()}:\\\"object\\\"==typeof performance&&\\\"function\\\"==typeof performance.now?function(){return performance.now()}:Date.now,__ATEXIT__.push((function(){var n=Module._fflush;n&&n(0);var e=___syscall146.printChar;if(e){var r=___syscall146.buffers;r[1].length&&e(1,10),r[2].length&&e(2,10)}})),DYNAMICTOP_PTR=allocate(1,\\\"i32\\\",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_viiiii:invoke_viiiii,invoke_vif:invoke_vif,invoke_vid:invoke_vid,invoke_fiff:invoke_fiff,invoke_vi:invoke_vi,invoke_vii:invoke_vii,invoke_ii:invoke_ii,invoke_viddi:invoke_viddi,invoke_vidd:invoke_vidd,invoke_iiii:invoke_iiii,invoke_diii:invoke_diii,invoke_di:invoke_di,invoke_iid:invoke_iid,invoke_iii:invoke_iii,invoke_viiddi:invoke_viiddi,invoke_viiiiii:invoke_viiiiii,invoke_dii:invoke_dii,invoke_i:invoke_i,invoke_iiiiii:invoke_iiiiii,invoke_viiid:invoke_viiid,invoke_viififi:invoke_viififi,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viid:invoke_viid,invoke_idd:invoke_idd,invoke_viiii:invoke_viiii,_emscripten_asm_const_iiiii:_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd:_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid:_emscripten_asm_const_iiiid,__nbind_reference_external:__nbind_reference_external,_emscripten_asm_const_iiiiiiii:_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix:_removeAccessorPrefix,_typeModule:_typeModule,__nbind_register_pool:__nbind_register_pool,__decorate:__decorate,_llvm_stackrestore:_llvm_stackrestore,___cxa_atexit:___cxa_atexit,__extends:__extends,__nbind_get_value_object:__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj:__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,__nbind_register_primitive:__nbind_register_primitive,__nbind_register_type:__nbind_register_type,_emscripten_memcpy_big:_emscripten_memcpy_big,__nbind_register_function:__nbind_register_function,___setErrNo:___setErrNo,__nbind_register_class:__nbind_register_class,__nbind_finish:__nbind_finish,_abort:_abort,_nbind_value:_nbind_value,_llvm_stacksave:_llvm_stacksave,___syscall54:___syscall54,_defineHidden:_defineHidden,_emscripten_set_main_loop:_emscripten_set_main_loop,_emscripten_get_now:_emscripten_get_now,__nbind_register_callback_signature:__nbind_register_callback_signature,_emscripten_asm_const_iiiiii:_emscripten_asm_const_iiiiii,__nbind_free_external:__nbind_free_external,_emscripten_asm_const_iiii:_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi:_emscripten_asm_const_iiididi,___syscall6:___syscall6,_atexit:_atexit,___syscall140:___syscall140,___syscall146:___syscall146,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8,___dso_handle:___dso_handle};var asm=function(n,e,r){\\\"use asm\\\";var t=new n.Int8Array(r);var i=new n.Int16Array(r);var u=new n.Int32Array(r);var o=new n.Uint8Array(r);var a=new n.Uint16Array(r);var f=new n.Uint32Array(r);var c=new n.Float32Array(r);var l=new n.Float64Array(r);var s=e.DYNAMICTOP_PTR|0;var d=e.tempDoublePtr|0;var _=e.ABORT|0;var v=e.STACKTOP|0;var p=e.STACK_MAX|0;var m=e.cttz_i8|0;var b=e.___dso_handle|0;var h=0;var y=0;var w=0;var M=0;var k=n.NaN,g=n.Infinity;var T=0,A=0,S=0,E=0,C=0.0;var L=0;var R=n.Math.floor;var P=n.Math.abs;var B=n.Math.sqrt;var O=n.Math.pow;var N=n.Math.cos;var I=n.Math.sin;var F=n.Math.tan;var x=n.Math.acos;var U=n.Math.asin;var H=n.Math.atan;var D=n.Math.atan2;var W=n.Math.exp;var Y=n.Math.log;var V=n.Math.ceil;var j=n.Math.imul;var q=n.Math.min;var z=n.Math.max;var G=n.Math.clz32;var K=n.Math.fround;var X=e.abort;var J=e.assert;var Z=e.enlargeMemory;var Q=e.getTotalMemory;var $=e.abortOnCannotGrowMemory;var nn=e.invoke_viiiii;var en=e.invoke_vif;var rn=e.invoke_vid;var tn=e.invoke_fiff;var un=e.invoke_vi;var on=e.invoke_vii;var an=e.invoke_ii;var fn=e.invoke_viddi;var cn=e.invoke_vidd;var ln=e.invoke_iiii;var sn=e.invoke_diii;var dn=e.invoke_di;var _n=e.invoke_iid;var vn=e.invoke_iii;var pn=e.invoke_viiddi;var mn=e.invoke_viiiiii;var bn=e.invoke_dii;var hn=e.invoke_i;var yn=e.invoke_iiiiii;var wn=e.invoke_viiid;var Mn=e.invoke_viififi;var kn=e.invoke_viii;var gn=e.invoke_v;var Tn=e.invoke_viid;var An=e.invoke_idd;var Sn=e.invoke_viiii;var En=e._emscripten_asm_const_iiiii;var Cn=e._emscripten_asm_const_iiidddddd;var Ln=e._emscripten_asm_const_iiiid;var Rn=e.__nbind_reference_external;var Pn=e._emscripten_asm_const_iiiiiiii;var Bn=e._removeAccessorPrefix;var On=e._typeModule;var Nn=e.__nbind_register_pool;var In=e.__decorate;var Fn=e._llvm_stackrestore;var xn=e.___cxa_atexit;var Un=e.__extends;var Hn=e.__nbind_get_value_object;var Dn=e.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj;var Wn=e._emscripten_set_main_loop_timing;var Yn=e.__nbind_register_primitive;var Vn=e.__nbind_register_type;var jn=e._emscripten_memcpy_big;var qn=e.__nbind_register_function;var zn=e.___setErrNo;var Gn=e.__nbind_register_class;var Kn=e.__nbind_finish;var Xn=e._abort;var Jn=e._nbind_value;var Zn=e._llvm_stacksave;var Qn=e.___syscall54;var $n=e._defineHidden;var ne=e._emscripten_set_main_loop;var ee=e._emscripten_get_now;var re=e.__nbind_register_callback_signature;var te=e._emscripten_asm_const_iiiiii;var ie=e.__nbind_free_external;var ue=e._emscripten_asm_const_iiii;var oe=e._emscripten_asm_const_iiididi;var ae=e.___syscall6;var fe=e._atexit;var ce=e.___syscall140;var le=e.___syscall146;var se=K(0);const de=K(0);function _e(n){n=n|0;var e=0;e=v;v=v+n|0;v=v+15&-16;return e|0}function ve(){return v|0}function pe(n){n=n|0;v=n}function me(n,e){n=n|0;e=e|0;v=n;p=e}function be(n,e){n=n|0;e=e|0;if(!h){h=n;y=e}}function he(n){n=n|0;L=n}function ye(){return L|0}function we(){var n=0,e=0;iC(8104,8,400)|0;iC(8504,408,540)|0;n=9044;e=n+44|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));t[9088]=0;t[9089]=1;u[2273]=0;u[2274]=948;u[2275]=948;xn(17,8104,b|0)|0;return}function Me(n){n=n|0;ze(n+948|0);return}function ke(n){n=K(n);return((Bi(n)|0)&2147483647)>>>0>2139095040|0}function ge(n,e,r){n=n|0;e=e|0;r=r|0;n:do{if(!(u[n+(e<<3)+4>>2]|0)){if((e|2|0)==3?u[n+60>>2]|0:0){n=n+56|0;break}switch(e|0){case 0:case 2:case 4:case 5:{if(u[n+52>>2]|0){n=n+48|0;break n}break}default:{}}if(!(u[n+68>>2]|0)){n=(e|1|0)==5?948:r;break}else{n=n+64|0;break}}else n=n+(e<<3)|0}while(0);return n|0}function Te(n){n=n|0;var e=0;e=qS(1e3)|0;Ae(n,(e|0)!=0,2456);u[2276]=(u[2276]|0)+1;iC(e|0,8104,1e3)|0;if(t[n+2>>0]|0){u[e+4>>2]=2;u[e+12>>2]=4}u[e+976>>2]=n;return e|0}function Ae(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;i=v;v=v+16|0;t=i;if(!e){u[t>>2]=r;xt(n,5,3197,t)}v=i;return}function Se(){return Te(956)|0}function Ee(n){n=n|0;var e=0;e=GE(1e3)|0;Ce(e,n);Ae(u[n+976>>2]|0,1,2456);u[2276]=(u[2276]|0)+1;u[e+944>>2]=0;return e|0}function Ce(n,e){n=n|0;e=e|0;var r=0;iC(n|0,e|0,948)|0;Dt(n+948|0,e+948|0);r=n+960|0;n=e+960|0;e=r+40|0;do{u[r>>2]=u[n>>2];r=r+4|0;n=n+4|0}while((r|0)<(e|0));return}function Le(n){n=n|0;var e=0,r=0,t=0,i=0;e=n+944|0;r=u[e>>2]|0;if(r|0){Re(r+948|0,n)|0;u[e>>2]=0}r=Pe(n)|0;if(r|0){e=0;do{u[(Be(n,e)|0)+944>>2]=0;e=e+1|0}while((e|0)!=(r|0))}r=n+948|0;t=u[r>>2]|0;i=n+952|0;e=u[i>>2]|0;if((e|0)!=(t|0))u[i>>2]=e+(~((e+-4-t|0)>>>2)<<2);Oe(r);zS(n);u[2276]=(u[2276]|0)+-1;return}function Re(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0;t=u[n>>2]|0;f=n+4|0;r=u[f>>2]|0;o=r;n:do{if((t|0)==(r|0)){i=t;a=4}else{n=t;while(1){if((u[n>>2]|0)==(e|0)){i=n;a=4;break n}n=n+4|0;if((n|0)==(r|0)){n=0;break}}}}while(0);if((a|0)==4)if((i|0)!=(r|0)){t=i+4|0;n=o-t|0;e=n>>2;if(e){cC(i|0,t|0,n|0)|0;r=u[f>>2]|0}n=i+(e<<2)|0;if((r|0)==(n|0))n=1;else{u[f>>2]=r+(~((r+-4-n|0)>>>2)<<2);n=1}}else n=0;return n|0}function Pe(n){n=n|0;return(u[n+952>>2]|0)-(u[n+948>>2]|0)>>2|0}function Be(n,e){n=n|0;e=e|0;var r=0;r=u[n+948>>2]|0;if((u[n+952>>2]|0)-r>>2>>>0>e>>>0)n=u[r+(e<<2)>>2]|0;else n=0;return n|0}function Oe(n){n=n|0;var e=0,r=0,t=0,i=0;t=v;v=v+32|0;e=t;i=u[n>>2]|0;r=(u[n+4>>2]|0)-i|0;if(((u[n+8>>2]|0)-i|0)>>>0>r>>>0){i=r>>2;Oi(e,i,i,n+8|0);Ni(n,e);Ii(e)}v=t;return}function Ne(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;l=Pe(n)|0;do{if(l|0){if((u[(Be(n,0)|0)+944>>2]|0)==(n|0)){if(!(Re(n+948|0,e)|0))break;iC(e+400|0,8504,540)|0;u[e+944>>2]=0;qe(n);break}a=u[(u[n+976>>2]|0)+12>>2]|0;f=n+948|0;c=(a|0)==0;r=0;o=0;do{t=u[(u[f>>2]|0)+(o<<2)>>2]|0;if((t|0)==(e|0))qe(n);else{i=Ee(t)|0;u[(u[f>>2]|0)+(r<<2)>>2]=i;u[i+944>>2]=n;if(!c)IL[a&15](t,i,n,r);r=r+1|0}o=o+1|0}while((o|0)!=(l|0));if(r>>>0<l>>>0){c=n+948|0;f=n+952|0;a=r;r=u[f>>2]|0;do{o=(u[c>>2]|0)+(a<<2)|0;t=o+4|0;i=r-t|0;e=i>>2;if(!e)i=r;else{cC(o|0,t|0,i|0)|0;r=u[f>>2]|0;i=r}t=o+(e<<2)|0;if((i|0)!=(t|0)){r=i+(~((i+-4-t|0)>>>2)<<2)|0;u[f>>2]=r}a=a+1|0}while((a|0)!=(l|0))}}}while(0);return}function Ie(n){n=n|0;var e=0,r=0,i=0,o=0;Fe(n,(Pe(n)|0)==0,2491);Fe(n,(u[n+944>>2]|0)==0,2545);e=n+948|0;r=u[e>>2]|0;i=n+952|0;o=u[i>>2]|0;if((o|0)!=(r|0))u[i>>2]=o+(~((o+-4-r|0)>>>2)<<2);Oe(e);e=n+976|0;r=u[e>>2]|0;iC(n|0,8104,1e3)|0;if(t[r+2>>0]|0){u[n+4>>2]=2;u[n+12>>2]=4}u[e>>2]=r;return}function Fe(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;i=v;v=v+16|0;t=i;if(!e){u[t>>2]=r;At(n,5,3197,t)}v=i;return}function xe(){return u[2276]|0}function Ue(){var n=0;n=qS(20)|0;He((n|0)!=0,2592);u[2277]=(u[2277]|0)+1;u[n>>2]=u[239];u[n+4>>2]=u[240];u[n+8>>2]=u[241];u[n+12>>2]=u[242];u[n+16>>2]=u[243];return n|0}function He(n,e){n=n|0;e=e|0;var r=0,t=0;t=v;v=v+16|0;r=t;if(!n){u[r>>2]=e;At(0,5,3197,r)}v=t;return}function De(n){n=n|0;zS(n);u[2277]=(u[2277]|0)+-1;return}function We(n,e){n=n|0;e=e|0;var r=0;if(!e){r=0;e=0}else{Fe(n,(Pe(n)|0)==0,2629);r=1}u[n+964>>2]=e;u[n+988>>2]=r;return}function Ye(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;o=t+8|0;i=t+4|0;a=t;u[i>>2]=e;Fe(n,(u[e+944>>2]|0)==0,2709);Fe(n,(u[n+964>>2]|0)==0,2763);Ve(n);e=n+948|0;u[a>>2]=(u[e>>2]|0)+(r<<2);u[o>>2]=u[a>>2];je(e,o,i)|0;u[(u[i>>2]|0)+944>>2]=n;qe(n);v=t;return}function Ve(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=Pe(n)|0;if(r|0?(u[(Be(n,0)|0)+944>>2]|0)!=(n|0):0){t=u[(u[n+976>>2]|0)+12>>2]|0;i=n+948|0;o=(t|0)==0;e=0;do{a=u[(u[i>>2]|0)+(e<<2)>>2]|0;f=Ee(a)|0;u[(u[i>>2]|0)+(e<<2)>>2]=f;u[f+944>>2]=n;if(!o)IL[t&15](a,f,n,e);e=e+1|0}while((e|0)!=(r|0))}return}function je(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0;h=v;v=v+64|0;d=h+52|0;f=h+48|0;_=h+28|0;p=h+24|0;m=h+20|0;b=h;t=u[n>>2]|0;o=t;e=t+((u[e>>2]|0)-o>>2<<2)|0;t=n+4|0;i=u[t>>2]|0;a=n+8|0;do{if(i>>>0<(u[a>>2]|0)>>>0){if((e|0)==(i|0)){u[e>>2]=u[r>>2];u[t>>2]=(u[t>>2]|0)+4;break}Fi(n,e,i,e+4|0);if(e>>>0<=r>>>0)r=(u[t>>2]|0)>>>0>r>>>0?r+4|0:r;u[e>>2]=u[r>>2]}else{t=(i-o>>2)+1|0;i=Vt(n)|0;if(i>>>0<t>>>0)DE(n);s=u[n>>2]|0;l=(u[a>>2]|0)-s|0;o=l>>1;Oi(b,l>>2>>>0<i>>>1>>>0?o>>>0<t>>>0?t:o:i,e-s>>2,n+8|0);s=b+8|0;t=u[s>>2]|0;o=b+12|0;l=u[o>>2]|0;a=l;c=t;do{if((t|0)==(l|0)){l=b+4|0;t=u[l>>2]|0;y=u[b>>2]|0;i=y;if(t>>>0<=y>>>0){t=a-i>>1;t=(t|0)==0?1:t;Oi(_,t,t>>>2,u[b+16>>2]|0);u[p>>2]=u[l>>2];u[m>>2]=u[s>>2];u[f>>2]=u[p>>2];u[d>>2]=u[m>>2];Ui(_,f,d);t=u[b>>2]|0;u[b>>2]=u[_>>2];u[_>>2]=t;t=_+4|0;y=u[l>>2]|0;u[l>>2]=u[t>>2];u[t>>2]=y;t=_+8|0;y=u[s>>2]|0;u[s>>2]=u[t>>2];u[t>>2]=y;t=_+12|0;y=u[o>>2]|0;u[o>>2]=u[t>>2];u[t>>2]=y;Ii(_);t=u[s>>2]|0;break}o=t;a=((o-i>>2)+1|0)/-2|0;f=t+(a<<2)|0;i=c-o|0;o=i>>2;if(o){cC(f|0,t|0,i|0)|0;t=u[l>>2]|0}y=f+(o<<2)|0;u[s>>2]=y;u[l>>2]=t+(a<<2);t=y}}while(0);u[t>>2]=u[r>>2];u[s>>2]=(u[s>>2]|0)+4;e=xi(n,b,e)|0;Ii(b)}}while(0);v=h;return e|0}function qe(n){n=n|0;var e=0;do{e=n+984|0;if(t[e>>0]|0)break;t[e>>0]=1;c[n+504>>2]=K(k);n=u[n+944>>2]|0}while((n|0)!=0);return}function ze(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-4-t|0)>>>2)<<2);XE(r)}return}function Ge(n){n=n|0;return u[n+944>>2]|0}function Ke(n){n=n|0;Fe(n,(u[n+964>>2]|0)!=0,2832);qe(n);return}function Xe(n){n=n|0;return(t[n+984>>0]|0)!=0|0}function Je(n,e){n=n|0;e=e|0;if(iE(n,e,400)|0){iC(n|0,e|0,400)|0;qe(n)}return}function Ze(n){n=n|0;var e=de;e=K(c[n+44>>2]);n=ke(e)|0;return K(n?K(0.0):e)}function Qe(n){n=n|0;var e=de;e=K(c[n+48>>2]);if(ke(e)|0)e=t[(u[n+976>>2]|0)+2>>0]|0?K(1.0):K(0.0);return K(e)}function $e(n,e){n=n|0;e=e|0;u[n+980>>2]=e;return}function nr(n){n=n|0;return u[n+980>>2]|0}function er(n,e){n=n|0;e=e|0;var r=0;r=n+4|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function rr(n){n=n|0;return u[n+4>>2]|0}function tr(n,e){n=n|0;e=e|0;var r=0;r=n+8|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function ir(n){n=n|0;return u[n+8>>2]|0}function ur(n,e){n=n|0;e=e|0;var r=0;r=n+12|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function or(n){n=n|0;return u[n+12>>2]|0}function ar(n,e){n=n|0;e=e|0;var r=0;r=n+16|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function fr(n){n=n|0;return u[n+16>>2]|0}function cr(n,e){n=n|0;e=e|0;var r=0;r=n+20|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function lr(n){n=n|0;return u[n+20>>2]|0}function sr(n,e){n=n|0;e=e|0;var r=0;r=n+24|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function dr(n){n=n|0;return u[n+24>>2]|0}function _r(n,e){n=n|0;e=e|0;var r=0;r=n+28|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function vr(n){n=n|0;return u[n+28>>2]|0}function pr(n,e){n=n|0;e=e|0;var r=0;r=n+32|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function mr(n){n=n|0;return u[n+32>>2]|0}function br(n,e){n=n|0;e=e|0;var r=0;r=n+36|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function hr(n){n=n|0;return u[n+36>>2]|0}function yr(n,e){n=n|0;e=K(e);var r=0;r=n+40|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function wr(n,e){n=n|0;e=K(e);var r=0;r=n+44|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function Mr(n,e){n=n|0;e=K(e);var r=0;r=n+48|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function kr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+52|0;i=n+56|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function gr(n,e){n=n|0;e=K(e);var r=0,t=0;t=n+52|0;r=n+56|0;if(!(!(K(c[t>>2])!=e)?(u[r>>2]|0)==2:0)){c[t>>2]=e;t=ke(e)|0;u[r>>2]=t?3:2;qe(n)}return}function Tr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+52|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Ar(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+132+(e<<3)|0;e=n+132+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Sr(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=o?0:2;i=n+132+(e<<3)|0;e=n+132+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Er(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=e+132+(r<<3)|0;e=u[t+4>>2]|0;r=n;u[r>>2]=u[t>>2];u[r+4>>2]=e;return}function Cr(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+60+(e<<3)|0;e=n+60+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Lr(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=o?0:2;i=n+60+(e<<3)|0;e=n+60+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Rr(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=e+60+(r<<3)|0;e=u[t+4>>2]|0;r=n;u[r>>2]=u[t>>2];u[r+4>>2]=e;return}function Pr(n,e){n=n|0;e=e|0;var r=0;r=n+60+(e<<3)+4|0;if((u[r>>2]|0)!=3){c[n+60+(e<<3)>>2]=K(k);u[r>>2]=3;qe(n)}return}function Br(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+204+(e<<3)|0;e=n+204+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Or(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=o?0:2;i=n+204+(e<<3)|0;e=n+204+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Nr(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=e+204+(r<<3)|0;e=u[t+4>>2]|0;r=n;u[r>>2]=u[t>>2];u[r+4>>2]=e;return}function Ir(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+276+(e<<3)|0;e=n+276+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Fr(n,e){n=n|0;e=e|0;return K(c[n+276+(e<<3)>>2])}function xr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+348|0;i=n+352|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Ur(n,e){n=n|0;e=K(e);var r=0,t=0;t=n+348|0;r=n+352|0;if(!(!(K(c[t>>2])!=e)?(u[r>>2]|0)==2:0)){c[t>>2]=e;t=ke(e)|0;u[r>>2]=t?3:2;qe(n)}return}function Hr(n){n=n|0;var e=0;e=n+352|0;if((u[e>>2]|0)!=3){c[n+348>>2]=K(k);u[e>>2]=3;qe(n)}return}function Dr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+348|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Wr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+356|0;i=n+360|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Yr(n,e){n=n|0;e=K(e);var r=0,t=0;t=n+356|0;r=n+360|0;if(!(!(K(c[t>>2])!=e)?(u[r>>2]|0)==2:0)){c[t>>2]=e;t=ke(e)|0;u[r>>2]=t?3:2;qe(n)}return}function Vr(n){n=n|0;var e=0;e=n+360|0;if((u[e>>2]|0)!=3){c[n+356>>2]=K(k);u[e>>2]=3;qe(n)}return}function jr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+356|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function qr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+364|0;i=n+368|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function zr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+364|0;i=n+368|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Gr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+364|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Kr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+372|0;i=n+376|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Xr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+372|0;i=n+376|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Jr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+372|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Zr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+380|0;i=n+384|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Qr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+380|0;i=n+384|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function $r(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+380|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function nt(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+388|0;i=n+392|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function et(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+388|0;i=n+392|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function rt(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+388|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function tt(n,e){n=n|0;e=K(e);var r=0;r=n+396|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function it(n){n=n|0;return K(c[n+396>>2])}function ut(n){n=n|0;return K(c[n+400>>2])}function ot(n){n=n|0;return K(c[n+404>>2])}function at(n){n=n|0;return K(c[n+408>>2])}function ft(n){n=n|0;return K(c[n+412>>2])}function ct(n){n=n|0;return K(c[n+416>>2])}function lt(n){n=n|0;return K(c[n+420>>2])}function st(n,e){n=n|0;e=e|0;Fe(n,(e|0)<6,2918);switch(e|0){case 0:{e=(u[n+496>>2]|0)==2?5:4;break}case 2:{e=(u[n+496>>2]|0)==2?4:5;break}default:{}}return K(c[n+424+(e<<2)>>2])}function dt(n,e){n=n|0;e=e|0;Fe(n,(e|0)<6,2918);switch(e|0){case 0:{e=(u[n+496>>2]|0)==2?5:4;break}case 2:{e=(u[n+496>>2]|0)==2?4:5;break}default:{}}return K(c[n+448+(e<<2)>>2])}function _t(n,e){n=n|0;e=e|0;Fe(n,(e|0)<6,2918);switch(e|0){case 0:{e=(u[n+496>>2]|0)==2?5:4;break}case 2:{e=(u[n+496>>2]|0)==2?4:5;break}default:{}}return K(c[n+472+(e<<2)>>2])}function vt(n,e){n=n|0;e=e|0;var r=0,t=de;r=u[n+4>>2]|0;if((r|0)==(u[e+4>>2]|0)){if(!r)n=1;else{t=K(c[n>>2]);n=K(P(K(t-K(c[e>>2]))))<K(.0000999999974)}}else n=0;return n|0}function pt(n,e){n=K(n);e=K(e);var r=0;if(ke(n)|0)r=ke(e)|0;else r=K(P(K(n-e)))<K(.0000999999974);return r|0}function mt(n,e){n=n|0;e=e|0;bt(n,e);return}function bt(n,e){n=n|0;e=e|0;var r=0,i=0;r=v;v=v+16|0;i=r+4|0;u[i>>2]=0;u[i+4>>2]=0;u[i+8>>2]=0;Dn(i|0,n|0,e|0,0);At(n,3,(t[i+11>>0]|0)<0?u[i>>2]|0:i,r);JE(i);v=r;return}function ht(n,e,r,t){n=K(n);e=K(e);r=r|0;t=t|0;var i=de;n=K(n*e);i=K(xE(n,K(1.0)));do{if(!(pt(i,K(0.0))|0)){n=K(n-i);if(pt(i,K(1.0))|0){n=K(n+K(1.0));break}if(r){n=K(n+K(1.0));break}if(!t){if(i>K(.5))i=K(1.0);else{t=pt(i,K(.5))|0;i=t?K(1.0):K(0.0)}n=K(n+i)}}else n=K(n-i)}while(0);return K(n/e)}function yt(n,e,r,t,i,u,o,a,f,l,s,d,_){n=n|0;e=K(e);r=r|0;t=K(t);i=i|0;u=K(u);o=o|0;a=K(a);f=K(f);l=K(l);s=K(s);d=K(d);_=_|0;var v=0,p=de,m=de,b=de,h=de,y=de,w=de;if(f<K(0.0)|l<K(0.0))_=0;else{if((_|0)!=0?(p=K(c[_+4>>2]),p!=K(0.0)):0){b=K(ht(e,p,0,0));h=K(ht(t,p,0,0));m=K(ht(u,p,0,0));p=K(ht(a,p,0,0))}else{m=u;b=e;p=a;h=t}if((i|0)==(n|0))v=pt(m,b)|0;else v=0;if((o|0)==(r|0))_=pt(p,h)|0;else _=0;if((!v?(y=K(e-s),!(wt(n,y,f)|0)):0)?!(Mt(n,y,i,f)|0):0)v=kt(n,y,i,u,f)|0;else v=1;if((!_?(w=K(t-d),!(wt(r,w,l)|0)):0)?!(Mt(r,w,o,l)|0):0)_=kt(r,w,o,a,l)|0;else _=1;_=v&_}return _|0}function wt(n,e,r){n=n|0;e=K(e);r=K(r);if((n|0)==1)n=pt(e,r)|0;else n=0;return n|0}function Mt(n,e,r,t){n=n|0;e=K(e);r=r|0;t=K(t);if((n|0)==2&(r|0)==0){if(!(e>=t))n=pt(e,t)|0;else n=1}else n=0;return n|0}function kt(n,e,r,t,i){n=n|0;e=K(e);r=r|0;t=K(t);i=K(i);if((n|0)==2&(r|0)==2&t>e){if(!(i<=e))n=pt(e,i)|0;else n=1}else n=0;return n|0}function gt(n,e,r,i,o,a,f,s,d,_,p){n=n|0;e=K(e);r=K(r);i=i|0;o=o|0;a=a|0;f=K(f);s=K(s);d=d|0;_=_|0;p=p|0;var m=0,b=0,h=0,y=0,w=de,M=de,k=0,g=0,T=0,A=0,S=0,E=0,C=0,L=0,R=0,P=0,B=0,O=de,N=de,I=de,F=0.0,x=0.0;B=v;v=v+160|0;L=B+152|0;C=B+120|0;E=B+104|0;T=B+72|0;y=B+56|0;S=B+8|0;g=B;A=(u[2279]|0)+1|0;u[2279]=A;R=n+984|0;if((t[R>>0]|0)!=0?(u[n+512>>2]|0)!=(u[2278]|0):0)k=4;else if((u[n+516>>2]|0)==(i|0))P=0;else k=4;if((k|0)==4){u[n+520>>2]=0;u[n+924>>2]=-1;u[n+928>>2]=-1;c[n+932>>2]=K(-1.0);c[n+936>>2]=K(-1.0);P=1}n:do{if(!(u[n+964>>2]|0)){if(d){m=n+916|0;if(!(pt(K(c[m>>2]),e)|0)){k=21;break}if(!(pt(K(c[n+920>>2]),r)|0)){k=21;break}if((u[n+924>>2]|0)!=(o|0)){k=21;break}m=(u[n+928>>2]|0)==(a|0)?m:0;k=22;break}h=u[n+520>>2]|0;if(!h)k=21;else{b=0;while(1){m=n+524+(b*24|0)|0;if(((pt(K(c[m>>2]),e)|0?pt(K(c[n+524+(b*24|0)+4>>2]),r)|0:0)?(u[n+524+(b*24|0)+8>>2]|0)==(o|0):0)?(u[n+524+(b*24|0)+12>>2]|0)==(a|0):0){k=22;break n}b=b+1|0;if(b>>>0>=h>>>0){k=21;break}}}}else{w=K(Tt(n,2,f));M=K(Tt(n,0,f));m=n+916|0;I=K(c[m>>2]);N=K(c[n+920>>2]);O=K(c[n+932>>2]);if(!(yt(o,e,a,r,u[n+924>>2]|0,I,u[n+928>>2]|0,N,O,K(c[n+936>>2]),w,M,p)|0)){h=u[n+520>>2]|0;if(!h)k=21;else{b=0;while(1){m=n+524+(b*24|0)|0;O=K(c[m>>2]);N=K(c[n+524+(b*24|0)+4>>2]);I=K(c[n+524+(b*24|0)+16>>2]);if(yt(o,e,a,r,u[n+524+(b*24|0)+8>>2]|0,O,u[n+524+(b*24|0)+12>>2]|0,N,I,K(c[n+524+(b*24|0)+20>>2]),w,M,p)|0){k=22;break n}b=b+1|0;if(b>>>0>=h>>>0){k=21;break}}}}else k=22}}while(0);do{if((k|0)==21){if(!(t[11697]|0)){m=0;k=31}else{m=0;k=28}}else if((k|0)==22){b=(t[11697]|0)!=0;if(!((m|0)!=0&(P^1)))if(b){k=28;break}else{k=31;break}y=m+16|0;u[n+908>>2]=u[y>>2];h=m+20|0;u[n+912>>2]=u[h>>2];if(!((t[11698]|0)==0|b^1)){u[g>>2]=St(A)|0;u[g+4>>2]=A;At(n,4,2972,g);b=u[n+972>>2]|0;if(b|0)vL[b&127](n);o=Et(o,d)|0;a=Et(a,d)|0;x=+K(c[y>>2]);F=+K(c[h>>2]);u[S>>2]=o;u[S+4>>2]=a;l[S+8>>3]=+e;l[S+16>>3]=+r;l[S+24>>3]=x;l[S+32>>3]=F;u[S+40>>2]=_;At(n,4,2989,S)}}}while(0);if((k|0)==28){b=St(A)|0;u[y>>2]=b;u[y+4>>2]=A;u[y+8>>2]=P?3047:11699;At(n,4,3038,y);b=u[n+972>>2]|0;if(b|0)vL[b&127](n);S=Et(o,d)|0;k=Et(a,d)|0;u[T>>2]=S;u[T+4>>2]=k;l[T+8>>3]=+e;l[T+16>>3]=+r;u[T+24>>2]=_;At(n,4,3049,T);k=31}if((k|0)==31){Ct(n,e,r,i,o,a,f,s,d,p);if(t[11697]|0){b=u[2279]|0;S=St(b)|0;u[E>>2]=S;u[E+4>>2]=b;u[E+8>>2]=P?3047:11699;At(n,4,3083,E);b=u[n+972>>2]|0;if(b|0)vL[b&127](n);S=Et(o,d)|0;E=Et(a,d)|0;F=+K(c[n+908>>2]);x=+K(c[n+912>>2]);u[C>>2]=S;u[C+4>>2]=E;l[C+8>>3]=F;l[C+16>>3]=x;u[C+24>>2]=_;At(n,4,3092,C)}u[n+516>>2]=i;if(!m){b=n+520|0;m=u[b>>2]|0;if((m|0)==16){if(t[11697]|0)At(n,4,3124,L);u[b>>2]=0;m=0}if(d)m=n+916|0;else{u[b>>2]=m+1;m=n+524+(m*24|0)|0}c[m>>2]=e;c[m+4>>2]=r;u[m+8>>2]=o;u[m+12>>2]=a;u[m+16>>2]=u[n+908>>2];u[m+20>>2]=u[n+912>>2];m=0}}if(d){u[n+416>>2]=u[n+908>>2];u[n+420>>2]=u[n+912>>2];t[n+985>>0]=1;t[R>>0]=0}u[2279]=(u[2279]|0)+-1;u[n+512>>2]=u[2278];v=B;return P|(m|0)==0|0}function Tt(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;t=K(jt(n,e,r));return K(t+K(qt(n,e,r)))}function At(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=v;v=v+16|0;i=o;u[i>>2]=t;if(!n)t=0;else t=u[n+976>>2]|0;Ut(t,n,e,r,i);v=o;return}function St(n){n=n|0;return(n>>>0>60?3201:3201+(60-n)|0)|0}function Et(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i+12|0;t=i;u[r>>2]=u[254];u[r+4>>2]=u[255];u[r+8>>2]=u[256];u[t>>2]=u[257];u[t+4>>2]=u[258];u[t+8>>2]=u[259];if((n|0)>2)n=11699;else n=u[(e?t:r)+(n<<2)>>2]|0;v=i;return n|0}function Ct(n,e,r,i,a,f,l,s,_,p){n=n|0;e=K(e);r=K(r);i=i|0;a=a|0;f=f|0;l=K(l);s=K(s);_=_|0;p=p|0;var m=0,b=0,h=0,y=0,w=de,M=de,k=de,g=de,T=de,A=de,S=de,E=0,C=0,L=0,R=de,P=de,B=0,O=de,N=0,I=0,F=0,x=0,U=0,H=0,D=0,W=0,Y=0,V=0,j=0,q=0,z=0,G=0,X=0,J=0,Z=0,Q=0,$=de,nn=de,en=de,rn=de,tn=de,un=0,on=0,an=0,fn=0,cn=0,ln=de,sn=de,dn=de,_n=de,vn=de,pn=de,mn=0,bn=de,hn=de,yn=de,wn=de,Mn=de,kn=de,gn=0,Tn=0,An=de,Sn=de,En=0,Cn=0,Ln=0,Rn=0,Pn=de,Bn=0,On=0,Nn=0,In=0,Fn=0,xn=0,Un=0,Hn=de,Dn=0,Wn=0;Un=v;v=v+16|0;un=Un+12|0;on=Un+8|0;an=Un+4|0;fn=Un;Fe(n,(a|0)==0|(ke(e)|0)^1,3326);Fe(n,(f|0)==0|(ke(r)|0)^1,3406);On=Kt(n,i)|0;u[n+496>>2]=On;Fn=Xt(2,On)|0;xn=Xt(0,On)|0;c[n+440>>2]=K(jt(n,Fn,l));c[n+444>>2]=K(qt(n,Fn,l));c[n+428>>2]=K(jt(n,xn,l));c[n+436>>2]=K(qt(n,xn,l));c[n+464>>2]=K(Jt(n,Fn));c[n+468>>2]=K(Zt(n,Fn));c[n+452>>2]=K(Jt(n,xn));c[n+460>>2]=K(Zt(n,xn));c[n+488>>2]=K(Qt(n,Fn,l));c[n+492>>2]=K($t(n,Fn,l));c[n+476>>2]=K(Qt(n,xn,l));c[n+484>>2]=K($t(n,xn,l));do{if(!(u[n+964>>2]|0)){Nn=n+948|0;In=(u[n+952>>2]|0)-(u[Nn>>2]|0)>>2;if(!In){ei(n,e,r,a,f,l,s);break}if(!_?ri(n,e,r,a,f,l,s)|0:0)break;Ve(n);J=n+508|0;t[J>>0]=0;Fn=Xt(u[n+4>>2]|0,On)|0;xn=ti(Fn,On)|0;Bn=zt(Fn)|0;Z=u[n+8>>2]|0;Cn=n+28|0;Q=(u[Cn>>2]|0)!=0;Mn=Bn?l:s;An=Bn?s:l;$=K(ii(n,Fn,l));nn=K(ui(n,Fn,l));w=K(ii(n,xn,l));kn=K(oi(n,Fn,l));Sn=K(oi(n,xn,l));L=Bn?a:f;En=Bn?f:a;Pn=Bn?kn:Sn;T=Bn?Sn:kn;wn=K(Tt(n,2,l));g=K(Tt(n,0,l));M=K(K(Ot(n+364|0,l))-Pn);k=K(K(Ot(n+380|0,l))-Pn);A=K(K(Ot(n+372|0,s))-T);S=K(K(Ot(n+388|0,s))-T);en=Bn?M:A;rn=Bn?k:S;wn=K(e-wn);e=K(wn-Pn);if(ke(e)|0)Pn=e;else Pn=K(OE(K(IE(e,k)),M));hn=K(r-g);e=K(hn-T);if(ke(e)|0)yn=e;else yn=K(OE(K(IE(e,S)),A));M=Bn?Pn:yn;bn=Bn?yn:Pn;n:do{if((L|0)==1){i=0;b=0;while(1){m=Be(n,b)|0;if(!i){if(K(fi(m))>K(0.0)?K(ci(m))>K(0.0):0)i=m;else i=0}else if(ai(m)|0){y=0;break n}b=b+1|0;if(b>>>0>=In>>>0){y=i;break}}}else y=0}while(0);E=y+500|0;C=y+504|0;i=0;m=0;e=K(0.0);h=0;do{b=u[(u[Nn>>2]|0)+(h<<2)>>2]|0;if((u[b+36>>2]|0)==1){li(b);t[b+985>>0]=1;t[b+984>>0]=0}else{Pt(b);if(_)Nt(b,Kt(b,On)|0,M,bn,Pn);do{if((u[b+24>>2]|0)!=1){if((b|0)==(y|0)){u[E>>2]=u[2278];c[C>>2]=K(0.0);break}else{si(n,b,Pn,a,yn,Pn,yn,f,On,p);break}}else{if(m|0)u[m+960>>2]=b;u[b+960>>2]=0;m=b;i=(i|0)==0?b:i}}while(0);pn=K(c[b+504>>2]);e=K(e+K(pn+K(Tt(b,Fn,Pn))))}h=h+1|0}while((h|0)!=(In|0));F=e>M;mn=Q&((L|0)==2&F)?1:L;N=(En|0)==1;U=N&(_^1);H=(mn|0)==1;D=(mn|0)==2;W=976+(Fn<<2)|0;Y=(En|2|0)==2;G=N&(Q^1);V=1040+(xn<<2)|0;j=1040+(Fn<<2)|0;q=976+(xn<<2)|0;z=(En|0)!=1;F=Q&((L|0)!=0&F);I=n+976|0;N=N^1;e=M;B=0;x=0;pn=K(0.0);tn=K(0.0);while(1){n:do{if(B>>>0<In>>>0){C=u[Nn>>2]|0;h=0;S=K(0.0);A=K(0.0);k=K(0.0);M=K(0.0);b=0;m=0;y=B;while(1){E=u[C+(y<<2)>>2]|0;if((u[E+36>>2]|0)!=1?(u[E+940>>2]=x,(u[E+24>>2]|0)!=1):0){g=K(Tt(E,Fn,Pn));X=u[W>>2]|0;r=K(Ot(E+380+(X<<3)|0,Mn));T=K(c[E+504>>2]);r=K(IE(r,T));r=K(OE(K(Ot(E+364+(X<<3)|0,Mn)),r));if(Q&(h|0)!=0&K(g+K(A+r))>e){f=h;g=S;L=y;break n}g=K(g+r);r=K(A+g);g=K(S+g);if(ai(E)|0){k=K(k+K(fi(E)));M=K(M-K(T*K(ci(E))))}if(m|0)u[m+960>>2]=E;u[E+960>>2]=0;h=h+1|0;m=E;b=(b|0)==0?E:b}else{g=S;r=A}y=y+1|0;if(y>>>0<In>>>0){S=g;A=r}else{f=h;L=y;break}}}else{f=0;g=K(0.0);k=K(0.0);M=K(0.0);b=0;L=B}}while(0);X=k>K(0.0)&k<K(1.0);R=X?K(1.0):k;X=M>K(0.0)&M<K(1.0);S=X?K(1.0):M;do{if(!H){if(!(g<en&((ke(en)|0)^1))){if(!(g>rn&((ke(rn)|0)^1))){if(!(t[(u[I>>2]|0)+3>>0]|0)){if(!(R==K(0.0))?!(K(fi(n))==K(0.0)):0){X=53;break}e=g;X=53}else X=51}else{e=rn;X=51}}else{e=en;X=51}}else X=51}while(0);if((X|0)==51){X=0;if(ke(e)|0)X=53;else{P=K(e-g);O=e}}if((X|0)==53){X=0;if(g<K(0.0)){P=K(-g);O=e}else{P=K(0.0);O=e}}if(!U?(cn=(b|0)==0,!cn):0){h=u[W>>2]|0;y=P<K(0.0);T=K(P/S);E=P>K(0.0);A=K(P/R);k=K(0.0);g=K(0.0);e=K(0.0);m=b;do{r=K(Ot(m+380+(h<<3)|0,Mn));M=K(Ot(m+364+(h<<3)|0,Mn));M=K(IE(r,K(OE(M,K(c[m+504>>2])))));if(y){r=K(M*K(ci(m)));if(r!=K(-0.0)?(Hn=K(M-K(T*r)),ln=K(di(m,Fn,Hn,O,Pn)),Hn!=ln):0){k=K(k-K(ln-M));e=K(e+r)}}else if((E?(sn=K(fi(m)),sn!=K(0.0)):0)?(Hn=K(M+K(A*sn)),dn=K(di(m,Fn,Hn,O,Pn)),Hn!=dn):0){k=K(k-K(dn-M));g=K(g-sn)}m=u[m+960>>2]|0}while((m|0)!=0);e=K(S+e);M=K(P+k);if(!cn){T=K(R+g);y=u[W>>2]|0;E=M<K(0.0);C=e==K(0.0);A=K(M/e);h=M>K(0.0);T=K(M/T);e=K(0.0);do{Hn=K(Ot(b+380+(y<<3)|0,Mn));k=K(Ot(b+364+(y<<3)|0,Mn));k=K(IE(Hn,K(OE(k,K(c[b+504>>2])))));if(E){Hn=K(k*K(ci(b)));M=K(-Hn);if(Hn!=K(-0.0)){Hn=K(A*M);M=K(di(b,Fn,K(k+(C?M:Hn)),O,Pn))}else M=k}else if(h?(_n=K(fi(b)),_n!=K(0.0)):0)M=K(di(b,Fn,K(k+K(T*_n)),O,Pn));else M=k;e=K(e-K(M-k));g=K(Tt(b,Fn,Pn));r=K(Tt(b,xn,Pn));M=K(M+g);c[on>>2]=M;u[fn>>2]=1;k=K(c[b+396>>2]);n:do{if(ke(k)|0){m=ke(bn)|0;do{if(!m){if(F|(Bt(b,xn,bn)|0|N))break;if((_i(n,b)|0)!=4)break;if((u[(vi(b,xn)|0)+4>>2]|0)==3)break;if((u[(pi(b,xn)|0)+4>>2]|0)==3)break;c[un>>2]=bn;u[an>>2]=1;break n}}while(0);if(Bt(b,xn,bn)|0){m=u[b+992+(u[q>>2]<<2)>>2]|0;Hn=K(r+K(Ot(m,bn)));c[un>>2]=Hn;m=z&(u[m+4>>2]|0)==2;u[an>>2]=((ke(Hn)|0|m)^1)&1;break}else{c[un>>2]=bn;u[an>>2]=m?0:2;break}}else{Hn=K(M-g);R=K(Hn/k);Hn=K(k*Hn);u[an>>2]=1;c[un>>2]=K(r+(Bn?R:Hn))}}while(0);mi(b,Fn,O,Pn,fn,on);mi(b,xn,bn,Pn,an,un);do{if(!(Bt(b,xn,bn)|0)?(_i(n,b)|0)==4:0){if((u[(vi(b,xn)|0)+4>>2]|0)==3){m=0;break}m=(u[(pi(b,xn)|0)+4>>2]|0)!=3}else m=0}while(0);Hn=K(c[on>>2]);R=K(c[un>>2]);Dn=u[fn>>2]|0;Wn=u[an>>2]|0;gt(b,Bn?Hn:R,Bn?R:Hn,On,Bn?Dn:Wn,Bn?Wn:Dn,Pn,yn,_&(m^1),3488,p)|0;t[J>>0]=t[J>>0]|t[b+508>>0];b=u[b+960>>2]|0}while((b|0)!=0)}else e=K(0.0)}else e=K(0.0);e=K(P+e);Wn=e<K(0.0)&1;t[J>>0]=Wn|o[J>>0];if(D&e>K(0.0)){m=u[W>>2]|0;if((u[n+364+(m<<3)+4>>2]|0)!=0?(vn=K(Ot(n+364+(m<<3)|0,Mn)),vn>=K(0.0)):0)M=K(OE(K(0.0),K(vn-K(O-e))));else M=K(0.0)}else M=e;E=B>>>0<L>>>0;if(E){y=u[Nn>>2]|0;h=B;m=0;do{b=u[y+(h<<2)>>2]|0;if(!(u[b+24>>2]|0)){m=((u[(vi(b,Fn)|0)+4>>2]|0)==3&1)+m|0;m=m+((u[(pi(b,Fn)|0)+4>>2]|0)==3&1)|0}h=h+1|0}while((h|0)!=(L|0));if(m){g=K(0.0);r=K(0.0)}else X=101}else X=101;n:do{if((X|0)==101){X=0;switch(Z|0){case 1:{m=0;g=K(M*K(.5));r=K(0.0);break n}case 2:{m=0;g=M;r=K(0.0);break n}case 3:{if(f>>>0<=1){m=0;g=K(0.0);r=K(0.0);break n}r=K((f+-1|0)>>>0);m=0;g=K(0.0);r=K(K(OE(M,K(0.0)))/r);break n}case 5:{r=K(M/K((f+1|0)>>>0));m=0;g=r;break n}case 4:{r=K(M/K(f>>>0));m=0;g=K(r*K(.5));break n}default:{m=0;g=K(0.0);r=K(0.0);break n}}}}while(0);e=K($+g);if(E){k=K(M/K(m|0));h=u[Nn>>2]|0;b=B;M=K(0.0);do{m=u[h+(b<<2)>>2]|0;n:do{if((u[m+36>>2]|0)!=1){switch(u[m+24>>2]|0){case 1:{if(bi(m,Fn)|0){if(!_)break n;Hn=K(hi(m,Fn,O));Hn=K(Hn+K(Jt(n,Fn)));Hn=K(Hn+K(jt(m,Fn,Pn)));c[m+400+(u[j>>2]<<2)>>2]=Hn;break n}break}case 0:{Wn=(u[(vi(m,Fn)|0)+4>>2]|0)==3;Hn=K(k+e);e=Wn?Hn:e;if(_){Wn=m+400+(u[j>>2]<<2)|0;c[Wn>>2]=K(e+K(c[Wn>>2]))}Wn=(u[(pi(m,Fn)|0)+4>>2]|0)==3;Hn=K(k+e);e=Wn?Hn:e;if(U){Hn=K(r+K(Tt(m,Fn,Pn)));M=bn;e=K(e+K(Hn+K(c[m+504>>2])));break n}else{e=K(e+K(r+K(yi(m,Fn,Pn))));M=K(OE(M,K(yi(m,xn,Pn))));break n}}default:{}}if(_){Hn=K(g+K(Jt(n,Fn)));Wn=m+400+(u[j>>2]<<2)|0;c[Wn>>2]=K(Hn+K(c[Wn>>2]))}}}while(0);b=b+1|0}while((b|0)!=(L|0))}else M=K(0.0);r=K(nn+e);if(Y)g=K(K(di(n,xn,K(Sn+M),An,l))-Sn);else g=bn;k=K(K(di(n,xn,K(Sn+(G?bn:M)),An,l))-Sn);if(E&_){b=B;do{h=u[(u[Nn>>2]|0)+(b<<2)>>2]|0;do{if((u[h+36>>2]|0)!=1){if((u[h+24>>2]|0)==1){if(bi(h,xn)|0){Hn=K(hi(h,xn,bn));Hn=K(Hn+K(Jt(n,xn)));Hn=K(Hn+K(jt(h,xn,Pn)));m=u[V>>2]|0;c[h+400+(m<<2)>>2]=Hn;if(!(ke(Hn)|0))break}else m=u[V>>2]|0;Hn=K(Jt(n,xn));c[h+400+(m<<2)>>2]=K(Hn+K(jt(h,xn,Pn)));break}m=_i(n,h)|0;do{if((m|0)==4){if((u[(vi(h,xn)|0)+4>>2]|0)==3){X=139;break}if((u[(pi(h,xn)|0)+4>>2]|0)==3){X=139;break}if(Bt(h,xn,bn)|0){e=w;break}Dn=u[h+908+(u[W>>2]<<2)>>2]|0;u[un>>2]=Dn;e=K(c[h+396>>2]);Wn=ke(e)|0;M=(u[d>>2]=Dn,K(c[d>>2]));if(Wn)e=k;else{P=K(Tt(h,xn,Pn));Hn=K(M/e);e=K(e*M);e=K(P+(Bn?Hn:e))}c[on>>2]=e;c[un>>2]=K(K(Tt(h,Fn,Pn))+M);u[an>>2]=1;u[fn>>2]=1;mi(h,Fn,O,Pn,an,un);mi(h,xn,bn,Pn,fn,on);e=K(c[un>>2]);P=K(c[on>>2]);Hn=Bn?e:P;e=Bn?P:e;Wn=((ke(Hn)|0)^1)&1;gt(h,Hn,e,On,Wn,((ke(e)|0)^1)&1,Pn,yn,1,3493,p)|0;e=w}else X=139}while(0);n:do{if((X|0)==139){X=0;e=K(g-K(yi(h,xn,Pn)));do{if((u[(vi(h,xn)|0)+4>>2]|0)==3){if((u[(pi(h,xn)|0)+4>>2]|0)!=3)break;e=K(w+K(OE(K(0.0),K(e*K(.5)))));break n}}while(0);if((u[(pi(h,xn)|0)+4>>2]|0)==3){e=w;break}if((u[(vi(h,xn)|0)+4>>2]|0)==3){e=K(w+K(OE(K(0.0),e)));break}switch(m|0){case 1:{e=w;break n}case 2:{e=K(w+K(e*K(.5)));break n}default:{e=K(w+e);break n}}}}while(0);Hn=K(pn+e);Wn=h+400+(u[V>>2]<<2)|0;c[Wn>>2]=K(Hn+K(c[Wn>>2]))}}while(0);b=b+1|0}while((b|0)!=(L|0))}pn=K(pn+k);tn=K(OE(tn,r));f=x+1|0;if(L>>>0>=In>>>0)break;else{e=O;B=L;x=f}}do{if(_){m=f>>>0>1;if(!m?!(wi(n)|0):0)break;if(!(ke(bn)|0)){e=K(bn-pn);n:do{switch(u[n+12>>2]|0){case 3:{w=K(w+e);A=K(0.0);break}case 2:{w=K(w+K(e*K(.5)));A=K(0.0);break}case 4:{if(bn>pn)A=K(e/K(f>>>0));else A=K(0.0);break}case 7:if(bn>pn){w=K(w+K(e/K(f<<1>>>0)));A=K(e/K(f>>>0));A=m?A:K(0.0);break n}else{w=K(w+K(e*K(.5)));A=K(0.0);break n}case 6:{A=K(e/K(x>>>0));A=bn>pn&m?A:K(0.0);break}default:A=K(0.0)}}while(0);if(f|0){E=1040+(xn<<2)|0;C=976+(xn<<2)|0;y=0;b=0;while(1){n:do{if(b>>>0<In>>>0){M=K(0.0);k=K(0.0);e=K(0.0);h=b;while(1){m=u[(u[Nn>>2]|0)+(h<<2)>>2]|0;do{if((u[m+36>>2]|0)!=1?(u[m+24>>2]|0)==0:0){if((u[m+940>>2]|0)!=(y|0))break n;if(Mi(m,xn)|0){Hn=K(c[m+908+(u[C>>2]<<2)>>2]);e=K(OE(e,K(Hn+K(Tt(m,xn,Pn)))))}if((_i(n,m)|0)!=5)break;vn=K(ki(m));vn=K(vn+K(jt(m,0,Pn)));Hn=K(c[m+912>>2]);Hn=K(K(Hn+K(Tt(m,0,Pn)))-vn);vn=K(OE(k,vn));Hn=K(OE(M,Hn));M=Hn;k=vn;e=K(OE(e,K(vn+Hn)))}}while(0);m=h+1|0;if(m>>>0<In>>>0)h=m;else{h=m;break}}}else{k=K(0.0);e=K(0.0);h=b}}while(0);T=K(A+e);r=w;w=K(w+T);if(b>>>0<h>>>0){g=K(r+k);m=b;do{b=u[(u[Nn>>2]|0)+(m<<2)>>2]|0;n:do{if((u[b+36>>2]|0)!=1?(u[b+24>>2]|0)==0:0)switch(_i(n,b)|0){case 1:{Hn=K(r+K(jt(b,xn,Pn)));c[b+400+(u[E>>2]<<2)>>2]=Hn;break n}case 3:{Hn=K(K(w-K(qt(b,xn,Pn)))-K(c[b+908+(u[C>>2]<<2)>>2]));c[b+400+(u[E>>2]<<2)>>2]=Hn;break n}case 2:{Hn=K(r+K(K(T-K(c[b+908+(u[C>>2]<<2)>>2]))*K(.5)));c[b+400+(u[E>>2]<<2)>>2]=Hn;break n}case 4:{Hn=K(r+K(jt(b,xn,Pn)));c[b+400+(u[E>>2]<<2)>>2]=Hn;if(Bt(b,xn,bn)|0)break n;if(Bn){M=K(c[b+908>>2]);e=K(M+K(Tt(b,Fn,Pn)));k=T}else{k=K(c[b+912>>2]);k=K(k+K(Tt(b,xn,Pn)));e=T;M=K(c[b+908>>2])}if(pt(e,M)|0?pt(k,K(c[b+912>>2]))|0:0)break n;gt(b,e,k,On,1,1,Pn,yn,1,3501,p)|0;break n}case 5:{c[b+404>>2]=K(K(g-K(ki(b)))+K(hi(b,0,bn)));break n}default:break n}}while(0);m=m+1|0}while((m|0)!=(h|0))}y=y+1|0;if((y|0)==(f|0))break;else b=h}}}}}while(0);c[n+908>>2]=K(di(n,2,wn,l,l));c[n+912>>2]=K(di(n,0,hn,s,l));if((mn|0)!=0?(gn=u[n+32>>2]|0,Tn=(mn|0)==2,!(Tn&(gn|0)!=2)):0){if(Tn&(gn|0)==2){e=K(kn+O);e=K(OE(K(IE(e,K(gi(n,Fn,tn,Mn)))),kn));X=198}}else{e=K(di(n,Fn,tn,Mn,l));X=198}if((X|0)==198)c[n+908+(u[976+(Fn<<2)>>2]<<2)>>2]=e;if((En|0)!=0?(Ln=u[n+32>>2]|0,Rn=(En|0)==2,!(Rn&(Ln|0)!=2)):0){if(Rn&(Ln|0)==2){e=K(Sn+bn);e=K(OE(K(IE(e,K(gi(n,xn,K(Sn+pn),An)))),Sn));X=204}}else{e=K(di(n,xn,K(Sn+pn),An,l));X=204}if((X|0)==204)c[n+908+(u[976+(xn<<2)>>2]<<2)>>2]=e;if(_){if((u[Cn>>2]|0)==2){b=976+(xn<<2)|0;h=1040+(xn<<2)|0;m=0;do{y=Be(n,m)|0;if(!(u[y+24>>2]|0)){Dn=u[b>>2]|0;Hn=K(c[n+908+(Dn<<2)>>2]);Wn=y+400+(u[h>>2]<<2)|0;Hn=K(Hn-K(c[Wn>>2]));c[Wn>>2]=K(Hn-K(c[y+908+(Dn<<2)>>2]))}m=m+1|0}while((m|0)!=(In|0))}if(i|0){m=Bn?mn:a;do{Ti(n,i,Pn,m,yn,On,p);i=u[i+960>>2]|0}while((i|0)!=0)}m=(Fn|2|0)==3;b=(xn|2|0)==3;if(m|b){i=0;do{h=u[(u[Nn>>2]|0)+(i<<2)>>2]|0;if((u[h+36>>2]|0)!=1){if(m)Ai(n,h,Fn);if(b)Ai(n,h,xn)}i=i+1|0}while((i|0)!=(In|0))}}}else ni(n,e,r,a,f,l,s)}while(0);v=Un;return}function Lt(n,e){n=n|0;e=K(e);var r=0;Ae(n,e>=K(0.0),3147);r=e==K(0.0);c[n+4>>2]=r?K(0.0):e;return}function Rt(n,e,r,i){n=n|0;e=K(e);r=K(r);i=i|0;var o=de,a=de,f=0,l=0,s=0;u[2278]=(u[2278]|0)+1;Pt(n);if(!(Bt(n,2,e)|0)){o=K(Ot(n+380|0,e));if(!(o>=K(0.0))){s=((ke(e)|0)^1)&1;o=e}else s=2}else{o=K(Ot(u[n+992>>2]|0,e));s=1;o=K(o+K(Tt(n,2,e)))}if(!(Bt(n,0,r)|0)){a=K(Ot(n+388|0,r));if(!(a>=K(0.0))){l=((ke(r)|0)^1)&1;a=r}else l=2}else{a=K(Ot(u[n+996>>2]|0,r));l=1;a=K(a+K(Tt(n,0,e)))}f=n+976|0;if(gt(n,o,a,i,s,l,e,r,1,3189,u[f>>2]|0)|0?(Nt(n,u[n+496>>2]|0,e,r,e),It(n,K(c[(u[f>>2]|0)+4>>2]),K(0.0),K(0.0)),t[11696]|0):0)mt(n,7);return}function Pt(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;a=f+24|0;o=f+16|0;t=f+8|0;i=f;r=0;do{e=n+380+(r<<3)|0;if(!((u[n+380+(r<<3)+4>>2]|0)!=0?(c=e,l=u[c+4>>2]|0,s=t,u[s>>2]=u[c>>2],u[s+4>>2]=l,s=n+364+(r<<3)|0,l=u[s+4>>2]|0,c=i,u[c>>2]=u[s>>2],u[c+4>>2]=l,u[o>>2]=u[t>>2],u[o+4>>2]=u[t+4>>2],u[a>>2]=u[i>>2],u[a+4>>2]=u[i+4>>2],vt(o,a)|0):0))e=n+348+(r<<3)|0;u[n+992+(r<<2)>>2]=e;r=r+1|0}while((r|0)!=2);v=f;return}function Bt(n,e,r){n=n|0;e=e|0;r=K(r);var t=0;n=u[n+992+(u[976+(e<<2)>>2]<<2)>>2]|0;switch(u[n+4>>2]|0){case 0:case 3:{n=0;break}case 1:{if(K(c[n>>2])<K(0.0))n=0;else t=5;break}case 2:{if(K(c[n>>2])<K(0.0))n=0;else n=(ke(r)|0)^1;break}default:t=5}if((t|0)==5)n=1;return n|0}function Ot(n,e){n=n|0;e=K(e);switch(u[n+4>>2]|0){case 2:{e=K(K(K(c[n>>2])*e)/K(100.0));break}case 1:{e=K(c[n>>2]);break}default:e=K(k)}return K(e)}function Nt(n,e,r,t,i){n=n|0;e=e|0;r=K(r);t=K(t);i=K(i);var o=0,a=de;e=u[n+944>>2]|0?e:1;o=Xt(u[n+4>>2]|0,e)|0;e=ti(o,e)|0;r=K(Pi(n,o,r));t=K(Pi(n,e,t));a=K(r+K(jt(n,o,i)));c[n+400+(u[1040+(o<<2)>>2]<<2)>>2]=a;r=K(r+K(qt(n,o,i)));c[n+400+(u[1e3+(o<<2)>>2]<<2)>>2]=r;r=K(t+K(jt(n,e,i)));c[n+400+(u[1040+(e<<2)>>2]<<2)>>2]=r;i=K(t+K(qt(n,e,i)));c[n+400+(u[1e3+(e<<2)>>2]<<2)>>2]=i;return}function It(n,e,r,t){n=n|0;e=K(e);r=K(r);t=K(t);var i=0,o=0,a=de,f=de,l=0,s=0,d=de,_=0,v=de,p=de,m=de,b=de;if(!(e==K(0.0))){i=n+400|0;b=K(c[i>>2]);o=n+404|0;m=K(c[o>>2]);_=n+416|0;p=K(c[_>>2]);s=n+420|0;a=K(c[s>>2]);v=K(b+r);d=K(m+t);t=K(v+p);f=K(d+a);l=(u[n+988>>2]|0)==1;c[i>>2]=K(ht(b,e,0,l));c[o>>2]=K(ht(m,e,0,l));r=K(xE(K(p*e),K(1.0)));if(pt(r,K(0.0))|0)o=0;else o=(pt(r,K(1.0))|0)^1;r=K(xE(K(a*e),K(1.0)));if(pt(r,K(0.0))|0)i=0;else i=(pt(r,K(1.0))|0)^1;b=K(ht(t,e,l&o,l&(o^1)));c[_>>2]=K(b-K(ht(v,e,0,l)));b=K(ht(f,e,l&i,l&(i^1)));c[s>>2]=K(b-K(ht(d,e,0,l)));o=(u[n+952>>2]|0)-(u[n+948>>2]|0)>>2;if(o|0){i=0;do{It(Be(n,i)|0,e,v,d);i=i+1|0}while((i|0)!=(o|0))}}return}function Ft(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;switch(r|0){case 5:case 0:{n=uE(u[489]|0,t,i)|0;break}default:n=HE(t,i)|0}return n|0}function xt(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;i=v;v=v+16|0;o=i;u[o>>2]=t;Ut(n,0,e,r,o);v=i;return}function Ut(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;n=n|0?n:956;CL[u[n+8>>2]&1](n,e,r,t,i)|0;if((r|0)==5)Xn();else return}function Ht(n,e,r){n=n|0;e=e|0;r=r|0;t[n+e>>0]=r&1;return}function Dt(n,e){n=n|0;e=e|0;var r=0,t=0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;r=e+4|0;t=(u[r>>2]|0)-(u[e>>2]|0)>>2;if(t|0){Wt(n,t);Yt(n,u[e>>2]|0,u[r>>2]|0,t)}return}function Wt(n,e){n=n|0;e=e|0;var r=0;if((Vt(n)|0)>>>0<e>>>0)DE(n);if(e>>>0>1073741823)Xn();else{r=GE(e<<2)|0;u[n+4>>2]=r;u[n>>2]=r;u[n+8>>2]=r+(e<<2);return}}function Yt(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=n+4|0;n=r-e|0;if((n|0)>0){iC(u[t>>2]|0,e|0,n|0)|0;u[t>>2]=(u[t>>2]|0)+(n>>>2<<2)}return}function Vt(n){n=n|0;return 1073741823}function jt(n,e,r){n=n|0;e=e|0;r=K(r);if(zt(e)|0?(u[n+96>>2]|0)!=0:0)n=n+92|0;else n=ge(n+60|0,u[1040+(e<<2)>>2]|0,992)|0;return K(Gt(n,r))}function qt(n,e,r){n=n|0;e=e|0;r=K(r);if(zt(e)|0?(u[n+104>>2]|0)!=0:0)n=n+100|0;else n=ge(n+60|0,u[1e3+(e<<2)>>2]|0,992)|0;return K(Gt(n,r))}function zt(n){n=n|0;return(n|1|0)==3|0}function Gt(n,e){n=n|0;e=K(e);if((u[n+4>>2]|0)==3)e=K(0.0);else e=K(Ot(n,e));return K(e)}function Kt(n,e){n=n|0;e=e|0;n=u[n>>2]|0;return((n|0)==0?(e|0)>1?e:1:n)|0}function Xt(n,e){n=n|0;e=e|0;var r=0;n:do{if((e|0)==2){switch(n|0){case 2:{n=3;break n}case 3:break;default:{r=4;break n}}n=2}else r=4}while(0);return n|0}function Jt(n,e){n=n|0;e=e|0;var r=de;if(!((zt(e)|0?(u[n+312>>2]|0)!=0:0)?(r=K(c[n+308>>2]),r>=K(0.0)):0))r=K(OE(K(c[(ge(n+276|0,u[1040+(e<<2)>>2]|0,992)|0)>>2]),K(0.0)));return K(r)}function Zt(n,e){n=n|0;e=e|0;var r=de;if(!((zt(e)|0?(u[n+320>>2]|0)!=0:0)?(r=K(c[n+316>>2]),r>=K(0.0)):0))r=K(OE(K(c[(ge(n+276|0,u[1e3+(e<<2)>>2]|0,992)|0)>>2]),K(0.0)));return K(r)}function Qt(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;if(!((zt(e)|0?(u[n+240>>2]|0)!=0:0)?(t=K(Ot(n+236|0,r)),t>=K(0.0)):0))t=K(OE(K(Ot(ge(n+204|0,u[1040+(e<<2)>>2]|0,992)|0,r)),K(0.0)));return K(t)}function $t(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;if(!((zt(e)|0?(u[n+248>>2]|0)!=0:0)?(t=K(Ot(n+244|0,r)),t>=K(0.0)):0))t=K(OE(K(Ot(ge(n+204|0,u[1e3+(e<<2)>>2]|0,992)|0,r)),K(0.0)));return K(t)}function ni(n,e,r,t,i,o,a){n=n|0;e=K(e);r=K(r);t=t|0;i=i|0;o=K(o);a=K(a);var f=de,l=de,s=de,d=de,_=de,p=de,m=0,b=0,h=0;h=v;v=v+16|0;m=h;b=n+964|0;Fe(n,(u[b>>2]|0)!=0,3519);f=K(oi(n,2,e));l=K(oi(n,0,e));s=K(Tt(n,2,e));d=K(Tt(n,0,e));if(ke(e)|0)_=e;else _=K(OE(K(0.0),K(K(e-s)-f)));if(ke(r)|0)p=r;else p=K(OE(K(0.0),K(K(r-d)-l)));if((t|0)==1&(i|0)==1){c[n+908>>2]=K(di(n,2,K(e-s),o,o));e=K(di(n,0,K(r-d),a,o))}else{RL[u[b>>2]&1](m,n,_,t,p,i);_=K(f+K(c[m>>2]));p=K(e-s);c[n+908>>2]=K(di(n,2,(t|2|0)==2?_:p,o,o));p=K(l+K(c[m+4>>2]));e=K(r-d);e=K(di(n,0,(i|2|0)==2?p:e,a,o))}c[n+912>>2]=e;v=h;return}function ei(n,e,r,t,i,u,o){n=n|0;e=K(e);r=K(r);t=t|0;i=i|0;u=K(u);o=K(o);var a=de,f=de,l=de,s=de;l=K(oi(n,2,u));a=K(oi(n,0,u));s=K(Tt(n,2,u));f=K(Tt(n,0,u));e=K(e-s);c[n+908>>2]=K(di(n,2,(t|2|0)==2?l:e,u,u));r=K(r-f);c[n+912>>2]=K(di(n,0,(i|2|0)==2?a:r,o,u));return}function ri(n,e,r,t,i,u,o){n=n|0;e=K(e);r=K(r);t=t|0;i=i|0;u=K(u);o=K(o);var a=0,f=de,l=de;a=(t|0)==2;if((!(e<=K(0.0)&a)?!(r<=K(0.0)&(i|0)==2):0)?!((t|0)==1&(i|0)==1):0)n=0;else{f=K(Tt(n,0,u));l=K(Tt(n,2,u));a=e<K(0.0)&a|(ke(e)|0);e=K(e-l);c[n+908>>2]=K(di(n,2,a?K(0.0):e,u,u));e=K(r-f);a=r<K(0.0)&(i|0)==2|(ke(r)|0);c[n+912>>2]=K(di(n,0,a?K(0.0):e,o,u));n=1}return n|0}function ti(n,e){n=n|0;e=e|0;if(Si(n)|0)n=Xt(2,e)|0;else n=0;return n|0}function ii(n,e,r){n=n|0;e=e|0;r=K(r);r=K(Qt(n,e,r));return K(r+K(Jt(n,e)))}function ui(n,e,r){n=n|0;e=e|0;r=K(r);r=K($t(n,e,r));return K(r+K(Zt(n,e)))}function oi(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;t=K(ii(n,e,r));return K(t+K(ui(n,e,r)))}function ai(n){n=n|0;if(!(u[n+24>>2]|0)){if(K(fi(n))!=K(0.0))n=1;else n=K(ci(n))!=K(0.0)}else n=0;return n|0}function fi(n){n=n|0;var e=de;if(u[n+944>>2]|0){e=K(c[n+44>>2]);if(ke(e)|0){e=K(c[n+40>>2]);n=e>K(0.0)&((ke(e)|0)^1);return K(n?e:K(0.0))}}else e=K(0.0);return K(e)}function ci(n){n=n|0;var e=de,r=0,i=de;do{if(u[n+944>>2]|0){e=K(c[n+48>>2]);if(ke(e)|0){r=t[(u[n+976>>2]|0)+2>>0]|0;if(r<<24>>24==0?(i=K(c[n+40>>2]),i<K(0.0)&((ke(i)|0)^1)):0){e=K(-i);break}e=r<<24>>24?K(1.0):K(0.0)}}else e=K(0.0)}while(0);return K(e)}function li(n){n=n|0;var e=0,r=0;eC(n+400|0,0,540)|0;t[n+985>>0]=1;Ve(n);r=Pe(n)|0;if(r|0){e=n+948|0;n=0;do{li(u[(u[e>>2]|0)+(n<<2)>>2]|0);n=n+1|0}while((n|0)!=(r|0))}return}function si(n,e,r,t,i,o,a,f,l,s){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);o=K(o);a=K(a);f=f|0;l=l|0;s=s|0;var d=0,_=de,p=0,m=0,b=de,h=de,y=0,w=de,M=0,g=de,T=0,A=0,S=0,E=0,C=0,L=0,R=0,P=0,B=0,O=0;B=v;v=v+16|0;S=B+12|0;E=B+8|0;C=B+4|0;L=B;P=Xt(u[n+4>>2]|0,l)|0;T=zt(P)|0;_=K(Ot(Ei(e)|0,T?o:a));A=Bt(e,2,o)|0;R=Bt(e,0,a)|0;do{if(!(ke(_)|0)?!(ke(T?r:i)|0):0){d=e+504|0;if(!(ke(K(c[d>>2]))|0)){if(!(Ci(u[e+976>>2]|0,0)|0))break;if((u[e+500>>2]|0)==(u[2278]|0))break}c[d>>2]=K(OE(_,K(oi(e,P,o))))}else p=7}while(0);do{if((p|0)==7){M=T^1;if(!(M|A^1)){a=K(Ot(u[e+992>>2]|0,o));c[e+504>>2]=K(OE(a,K(oi(e,2,o))));break}if(!(T|R^1)){a=K(Ot(u[e+996>>2]|0,a));c[e+504>>2]=K(OE(a,K(oi(e,0,o))));break}c[S>>2]=K(k);c[E>>2]=K(k);u[C>>2]=0;u[L>>2]=0;w=K(Tt(e,2,o));g=K(Tt(e,0,o));if(A){b=K(w+K(Ot(u[e+992>>2]|0,o)));c[S>>2]=b;u[C>>2]=1;m=1}else{m=0;b=K(k)}if(R){_=K(g+K(Ot(u[e+996>>2]|0,a)));c[E>>2]=_;u[L>>2]=1;d=1}else{d=0;_=K(k)}p=u[n+32>>2]|0;if(!(T&(p|0)==2)){if(ke(b)|0?!(ke(r)|0):0){c[S>>2]=r;u[C>>2]=2;m=2;b=r}}else p=2;if((!((p|0)==2&M)?ke(_)|0:0)?!(ke(i)|0):0){c[E>>2]=i;u[L>>2]=2;d=2;_=i}h=K(c[e+396>>2]);y=ke(h)|0;do{if(!y){if((m|0)==1&M){c[E>>2]=K(K(b-w)/h);u[L>>2]=1;d=1;p=1;break}if(T&(d|0)==1){c[S>>2]=K(h*K(_-g));u[C>>2]=1;d=1;p=1}else p=m}else p=m}while(0);O=ke(r)|0;m=(_i(n,e)|0)!=4;if(!(T|A|((t|0)!=1|O)|(m|(p|0)==1))?(c[S>>2]=r,u[C>>2]=1,!y):0){c[E>>2]=K(K(r-w)/h);u[L>>2]=1;d=1}if(!(R|M|((f|0)!=1|(ke(i)|0))|(m|(d|0)==1))?(c[E>>2]=i,u[L>>2]=1,!y):0){c[S>>2]=K(h*K(i-g));u[C>>2]=1}mi(e,2,o,o,C,S);mi(e,0,a,o,L,E);r=K(c[S>>2]);i=K(c[E>>2]);gt(e,r,i,l,u[C>>2]|0,u[L>>2]|0,o,a,0,3565,s)|0;a=K(c[e+908+(u[976+(P<<2)>>2]<<2)>>2]);c[e+504>>2]=K(OE(a,K(oi(e,P,o))))}}while(0);u[e+500>>2]=u[2278];v=B;return}function di(n,e,r,t,i){n=n|0;e=e|0;r=K(r);t=K(t);i=K(i);t=K(gi(n,e,r,t));return K(OE(t,K(oi(n,e,i))))}function _i(n,e){n=n|0;e=e|0;e=e+20|0;e=u[((u[e>>2]|0)==0?n+16|0:e)>>2]|0;if((e|0)==5?Si(u[n+4>>2]|0)|0:0)e=1;return e|0}function vi(n,e){n=n|0;e=e|0;if(zt(e)|0?(u[n+96>>2]|0)!=0:0)e=4;else e=u[1040+(e<<2)>>2]|0;return n+60+(e<<3)|0}function pi(n,e){n=n|0;e=e|0;if(zt(e)|0?(u[n+104>>2]|0)!=0:0)e=5;else e=u[1e3+(e<<2)>>2]|0;return n+60+(e<<3)|0}function mi(n,e,r,t,i,o){n=n|0;e=e|0;r=K(r);t=K(t);i=i|0;o=o|0;r=K(Ot(n+380+(u[976+(e<<2)>>2]<<3)|0,r));r=K(r+K(Tt(n,e,t)));switch(u[i>>2]|0){case 2:case 1:{i=ke(r)|0;t=K(c[o>>2]);c[o>>2]=i|t<r?t:r;break}case 0:{if(!(ke(r)|0)){u[i>>2]=2;c[o>>2]=r}break}default:{}}return}function bi(n,e){n=n|0;e=e|0;n=n+132|0;if(zt(e)|0?(u[(ge(n,4,948)|0)+4>>2]|0)!=0:0)n=1;else n=(u[(ge(n,u[1040+(e<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return n|0}function hi(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0;n=n+132|0;if(zt(e)|0?(t=ge(n,4,948)|0,(u[t+4>>2]|0)!=0):0)i=4;else{t=ge(n,u[1040+(e<<2)>>2]|0,948)|0;if(!(u[t+4>>2]|0))r=K(0.0);else i=4}if((i|0)==4)r=K(Ot(t,r));return K(r)}function yi(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;t=K(c[n+908+(u[976+(e<<2)>>2]<<2)>>2]);t=K(t+K(jt(n,e,r)));return K(t+K(qt(n,e,r)))}function wi(n){n=n|0;var e=0,r=0,t=0;n:do{if(!(Si(u[n+4>>2]|0)|0)){if((u[n+16>>2]|0)!=5){r=Pe(n)|0;if(!r)e=0;else{e=0;while(1){t=Be(n,e)|0;if((u[t+24>>2]|0)==0?(u[t+20>>2]|0)==5:0){e=1;break n}e=e+1|0;if(e>>>0>=r>>>0){e=0;break}}}}else e=1}else e=0}while(0);return e|0}function Mi(n,e){n=n|0;e=e|0;var r=de;r=K(c[n+908+(u[976+(e<<2)>>2]<<2)>>2]);return r>=K(0.0)&((ke(r)|0)^1)|0}function ki(n){n=n|0;var e=de,r=0,t=0,i=0,o=0,a=0,f=0,l=de;r=u[n+968>>2]|0;if(!r){o=Pe(n)|0;do{if(o|0){r=0;i=0;while(1){t=Be(n,i)|0;if(u[t+940>>2]|0){a=8;break}if((u[t+24>>2]|0)!=1){f=(_i(n,t)|0)==5;if(f){r=t;break}else r=(r|0)==0?t:r}i=i+1|0;if(i>>>0>=o>>>0){a=8;break}}if((a|0)==8)if(!r)break;e=K(ki(r));return K(e+K(c[r+404>>2]))}}while(0);e=K(c[n+912>>2])}else{l=K(c[n+908>>2]);e=K(c[n+912>>2]);e=K(_L[r&0](n,l,e));Fe(n,(ke(e)|0)^1,3573)}return K(e)}function gi(n,e,r,t){n=n|0;e=e|0;r=K(r);t=K(t);var i=de,u=0;if(!(Si(e)|0)){if(zt(e)|0){e=0;u=3}else{t=K(k);i=K(k)}}else{e=1;u=3}if((u|0)==3){i=K(Ot(n+364+(e<<3)|0,t));t=K(Ot(n+380+(e<<3)|0,t))}u=t<r&(t>=K(0.0)&((ke(t)|0)^1));r=u?t:r;u=i>=K(0.0)&((ke(i)|0)^1)&r<i;return K(u?i:r)}function Ti(n,e,r,t,i,o,a){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);o=o|0;a=a|0;var f=de,l=de,s=0,d=0,_=de,v=de,p=de,m=0,b=0,h=0,y=0,w=de,M=0;h=Xt(u[n+4>>2]|0,o)|0;m=ti(h,o)|0;b=zt(h)|0;_=K(Tt(e,2,r));v=K(Tt(e,0,r));if(!(Bt(e,2,r)|0)){if(bi(e,2)|0?Li(e,2)|0:0){f=K(c[n+908>>2]);l=K(Jt(n,2));l=K(f-K(l+K(Zt(n,2))));f=K(hi(e,2,r));f=K(di(e,2,K(l-K(f+K(Ri(e,2,r)))),r,r))}else f=K(k)}else f=K(_+K(Ot(u[e+992>>2]|0,r)));if(!(Bt(e,0,i)|0)){if(bi(e,0)|0?Li(e,0)|0:0){l=K(c[n+912>>2]);w=K(Jt(n,0));w=K(l-K(w+K(Zt(n,0))));l=K(hi(e,0,i));l=K(di(e,0,K(w-K(l+K(Ri(e,0,i)))),i,r))}else l=K(k)}else l=K(v+K(Ot(u[e+996>>2]|0,i)));s=ke(f)|0;d=ke(l)|0;do{if(s^d?(p=K(c[e+396>>2]),!(ke(p)|0)):0)if(s){f=K(_+K(K(l-v)*p));break}else{w=K(v+K(K(f-_)/p));l=d?w:l;break}}while(0);d=ke(f)|0;s=ke(l)|0;if(d|s){M=(d^1)&1;t=r>K(0.0)&((t|0)!=0&d);f=b?f:t?r:f;gt(e,f,l,o,b?M:t?2:M,d&(s^1)&1,f,l,0,3623,a)|0;f=K(c[e+908>>2]);f=K(f+K(Tt(e,2,r)));l=K(c[e+912>>2]);l=K(l+K(Tt(e,0,r)))}gt(e,f,l,o,1,1,f,l,1,3635,a)|0;if(Li(e,h)|0?!(bi(e,h)|0):0){M=u[976+(h<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));w=K(w-K(Zt(n,h)));w=K(w-K(qt(e,h,r)));w=K(w-K(Ri(e,h,b?r:i)));c[e+400+(u[1040+(h<<2)>>2]<<2)>>2]=w}else y=21;do{if((y|0)==21){if(!(bi(e,h)|0)?(u[n+8>>2]|0)==1:0){M=u[976+(h<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(K(w-K(c[e+908+(M<<2)>>2]))*K(.5));c[e+400+(u[1040+(h<<2)>>2]<<2)>>2]=w;break}if(!(bi(e,h)|0)?(u[n+8>>2]|0)==2:0){M=u[976+(h<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));c[e+400+(u[1040+(h<<2)>>2]<<2)>>2]=w}}}while(0);if(Li(e,m)|0?!(bi(e,m)|0):0){M=u[976+(m<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));w=K(w-K(Zt(n,m)));w=K(w-K(qt(e,m,r)));w=K(w-K(Ri(e,m,b?i:r)));c[e+400+(u[1040+(m<<2)>>2]<<2)>>2]=w}else y=30;do{if((y|0)==30?!(bi(e,m)|0):0){if((_i(n,e)|0)==2){M=u[976+(m<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(K(w-K(c[e+908+(M<<2)>>2]))*K(.5));c[e+400+(u[1040+(m<<2)>>2]<<2)>>2]=w;break}M=(_i(n,e)|0)==3;if(M^(u[n+28>>2]|0)==2){M=u[976+(m<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));c[e+400+(u[1040+(m<<2)>>2]<<2)>>2]=w}}}while(0);return}function Ai(n,e,r){n=n|0;e=e|0;r=r|0;var t=de,i=0;i=u[976+(r<<2)>>2]|0;t=K(c[e+908+(i<<2)>>2]);t=K(K(c[n+908+(i<<2)>>2])-t);t=K(t-K(c[e+400+(u[1040+(r<<2)>>2]<<2)>>2]));c[e+400+(u[1e3+(r<<2)>>2]<<2)>>2]=t;return}function Si(n){n=n|0;return(n|1|0)==1|0}function Ei(n){n=n|0;var e=de;switch(u[n+56>>2]|0){case 0:case 3:{e=K(c[n+40>>2]);if(e>K(0.0)&((ke(e)|0)^1))n=t[(u[n+976>>2]|0)+2>>0]|0?1056:992;else n=1056;break}default:n=n+52|0}return n|0}function Ci(n,e){n=n|0;e=e|0;return(t[n+e>>0]|0)!=0|0}function Li(n,e){n=n|0;e=e|0;n=n+132|0;if(zt(e)|0?(u[(ge(n,5,948)|0)+4>>2]|0)!=0:0)n=1;else n=(u[(ge(n,u[1e3+(e<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return n|0}function Ri(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0;n=n+132|0;if(zt(e)|0?(t=ge(n,5,948)|0,(u[t+4>>2]|0)!=0):0)i=4;else{t=ge(n,u[1e3+(e<<2)>>2]|0,948)|0;if(!(u[t+4>>2]|0))r=K(0.0);else i=4}if((i|0)==4)r=K(Ot(t,r));return K(r)}function Pi(n,e,r){n=n|0;e=e|0;r=K(r);if(bi(n,e)|0)r=K(hi(n,e,r));else r=K(-K(Ri(n,e,r)));return K(r)}function Bi(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function Oi(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>1073741823)Xn();else{i=GE(e<<2)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<2)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<2);return}function Ni(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Ii(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-4-e|0)>>>2)<<2);n=u[n>>2]|0;if(n|0)XE(n);return}function Fi(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;a=n+4|0;f=u[a>>2]|0;i=f-t|0;o=i>>2;n=e+(o<<2)|0;if(n>>>0<r>>>0){t=f;do{u[t>>2]=u[n>>2];n=n+4|0;t=(u[a>>2]|0)+4|0;u[a>>2]=t}while(n>>>0<r>>>0)}if(o|0)cC(f+(0-o<<2)|0,e|0,i|0)|0;return}function xi(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0;f=e+4|0;c=u[f>>2]|0;i=u[n>>2]|0;a=r;o=a-i|0;t=c+(0-(o>>2)<<2)|0;u[f>>2]=t;if((o|0)>0)iC(t|0,i|0,o|0)|0;i=n+4|0;o=e+8|0;t=(u[i>>2]|0)-a|0;if((t|0)>0){iC(u[o>>2]|0,r|0,t|0)|0;u[o>>2]=(u[o>>2]|0)+(t>>>2<<2)}a=u[n>>2]|0;u[n>>2]=u[f>>2];u[f>>2]=a;a=u[i>>2]|0;u[i>>2]=u[o>>2];u[o>>2]=a;a=n+8|0;r=e+12|0;n=u[a>>2]|0;u[a>>2]=u[r>>2];u[r>>2]=n;u[e>>2]=u[f>>2];return c|0}function Ui(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;a=u[e>>2]|0;o=u[r>>2]|0;if((a|0)!=(o|0)){i=n+8|0;r=((o+-4-a|0)>>>2)+1|0;n=a;t=u[i>>2]|0;do{u[t>>2]=u[n>>2];t=(u[i>>2]|0)+4|0;u[i>>2]=t;n=n+4|0}while((n|0)!=(o|0));u[e>>2]=a+(r<<2)}return}function Hi(){we();return}function Di(){var n=0;n=GE(4)|0;Wi(n);return n|0}function Wi(n){n=n|0;u[n>>2]=Ue()|0;return}function Yi(n){n=n|0;if(n|0){Vi(n);XE(n)}return}function Vi(n){n=n|0;De(u[n>>2]|0);return}function ji(n,e,r){n=n|0;e=e|0;r=r|0;Ht(u[n>>2]|0,e,r);return}function qi(n,e){n=n|0;e=K(e);Lt(u[n>>2]|0,e);return}function zi(n,e){n=n|0;e=e|0;return Ci(u[n>>2]|0,e)|0}function Gi(){var n=0;n=GE(8)|0;Ki(n,0);return n|0}function Ki(n,e){n=n|0;e=e|0;if(!e)e=Se()|0;else e=Te(u[e>>2]|0)|0;u[n>>2]=e;u[n+4>>2]=0;$e(e,n);return}function Xi(n){n=n|0;var e=0;e=GE(8)|0;Ki(e,n);return e|0}function Ji(n){n=n|0;if(n|0){Zi(n);XE(n)}return}function Zi(n){n=n|0;var e=0;Le(u[n>>2]|0);e=n+4|0;n=u[e>>2]|0;u[e>>2]=0;if(n|0){Qi(n);XE(n)}return}function Qi(n){n=n|0;$i(n);return}function $i(n){n=n|0;n=u[n>>2]|0;if(n|0)ie(n|0);return}function nu(n){n=n|0;return nr(n)|0}function eu(n){n=n|0;var e=0,r=0;r=n+4|0;e=u[r>>2]|0;u[r>>2]=0;if(e|0){Qi(e);XE(e)}Ie(u[n>>2]|0);return}function ru(n,e){n=n|0;e=e|0;Je(u[n>>2]|0,u[e>>2]|0);return}function tu(n,e){n=n|0;e=e|0;sr(u[n>>2]|0,e);return}function iu(n,e,r){n=n|0;e=e|0;r=+r;Ar(u[n>>2]|0,e,K(r));return}function uu(n,e,r){n=n|0;e=e|0;r=+r;Sr(u[n>>2]|0,e,K(r));return}function ou(n,e){n=n|0;e=e|0;ur(u[n>>2]|0,e);return}function au(n,e){n=n|0;e=e|0;ar(u[n>>2]|0,e);return}function fu(n,e){n=n|0;e=e|0;cr(u[n>>2]|0,e);return}function cu(n,e){n=n|0;e=e|0;er(u[n>>2]|0,e);return}function lu(n,e){n=n|0;e=e|0;_r(u[n>>2]|0,e);return}function su(n,e){n=n|0;e=e|0;tr(u[n>>2]|0,e);return}function du(n,e,r){n=n|0;e=e|0;r=+r;Cr(u[n>>2]|0,e,K(r));return}function _u(n,e,r){n=n|0;e=e|0;r=+r;Lr(u[n>>2]|0,e,K(r));return}function vu(n,e){n=n|0;e=e|0;Pr(u[n>>2]|0,e);return}function pu(n,e){n=n|0;e=e|0;pr(u[n>>2]|0,e);return}function mu(n,e){n=n|0;e=e|0;br(u[n>>2]|0,e);return}function bu(n,e){n=n|0;e=+e;yr(u[n>>2]|0,K(e));return}function hu(n,e){n=n|0;e=+e;kr(u[n>>2]|0,K(e));return}function yu(n,e){n=n|0;e=+e;gr(u[n>>2]|0,K(e));return}function wu(n,e){n=n|0;e=+e;wr(u[n>>2]|0,K(e));return}function Mu(n,e){n=n|0;e=+e;Mr(u[n>>2]|0,K(e));return}function ku(n,e){n=n|0;e=+e;xr(u[n>>2]|0,K(e));return}function gu(n,e){n=n|0;e=+e;Ur(u[n>>2]|0,K(e));return}function Tu(n){n=n|0;Hr(u[n>>2]|0);return}function Au(n,e){n=n|0;e=+e;Wr(u[n>>2]|0,K(e));return}function Su(n,e){n=n|0;e=+e;Yr(u[n>>2]|0,K(e));return}function Eu(n){n=n|0;Vr(u[n>>2]|0);return}function Cu(n,e){n=n|0;e=+e;qr(u[n>>2]|0,K(e));return}function Lu(n,e){n=n|0;e=+e;zr(u[n>>2]|0,K(e));return}function Ru(n,e){n=n|0;e=+e;Kr(u[n>>2]|0,K(e));return}function Pu(n,e){n=n|0;e=+e;Xr(u[n>>2]|0,K(e));return}function Bu(n,e){n=n|0;e=+e;Zr(u[n>>2]|0,K(e));return}function Ou(n,e){n=n|0;e=+e;Qr(u[n>>2]|0,K(e));return}function Nu(n,e){n=n|0;e=+e;nt(u[n>>2]|0,K(e));return}function Iu(n,e){n=n|0;e=+e;et(u[n>>2]|0,K(e));return}function Fu(n,e){n=n|0;e=+e;tt(u[n>>2]|0,K(e));return}function xu(n,e,r){n=n|0;e=e|0;r=+r;Ir(u[n>>2]|0,e,K(r));return}function Uu(n,e,r){n=n|0;e=e|0;r=+r;Br(u[n>>2]|0,e,K(r));return}function Hu(n,e,r){n=n|0;e=e|0;r=+r;Or(u[n>>2]|0,e,K(r));return}function Du(n){n=n|0;return dr(u[n>>2]|0)|0}function Wu(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Er(i,u[e>>2]|0,r);Yu(n,i);v=t;return}function Yu(n,e){n=n|0;e=e|0;Vu(n,u[e+4>>2]|0,+K(c[e>>2]));return}function Vu(n,e,r){n=n|0;e=e|0;r=+r;u[n>>2]=e;l[n+8>>3]=r;return}function ju(n){n=n|0;return or(u[n>>2]|0)|0}function qu(n){n=n|0;return fr(u[n>>2]|0)|0}function zu(n){n=n|0;return lr(u[n>>2]|0)|0}function Gu(n){n=n|0;return rr(u[n>>2]|0)|0}function Ku(n){n=n|0;return vr(u[n>>2]|0)|0}function Xu(n){n=n|0;return ir(u[n>>2]|0)|0}function Ju(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Rr(i,u[e>>2]|0,r);Yu(n,i);v=t;return}function Zu(n){n=n|0;return mr(u[n>>2]|0)|0}function Qu(n){n=n|0;return hr(u[n>>2]|0)|0}function $u(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Tr(t,u[e>>2]|0);Yu(n,t);v=r;return}function no(n){n=n|0;return+ +K(Ze(u[n>>2]|0))}function eo(n){n=n|0;return+ +K(Qe(u[n>>2]|0))}function ro(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Dr(t,u[e>>2]|0);Yu(n,t);v=r;return}function to(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;jr(t,u[e>>2]|0);Yu(n,t);v=r;return}function io(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Gr(t,u[e>>2]|0);Yu(n,t);v=r;return}function uo(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Jr(t,u[e>>2]|0);Yu(n,t);v=r;return}function oo(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;$r(t,u[e>>2]|0);Yu(n,t);v=r;return}function ao(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;rt(t,u[e>>2]|0);Yu(n,t);v=r;return}function fo(n){n=n|0;return+ +K(it(u[n>>2]|0))}function co(n,e){n=n|0;e=e|0;return+ +K(Fr(u[n>>2]|0,e))}function lo(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Nr(i,u[e>>2]|0,r);Yu(n,i);v=t;return}function so(n,e,r){n=n|0;e=e|0;r=r|0;Ye(u[n>>2]|0,u[e>>2]|0,r);return}function _o(n,e){n=n|0;e=e|0;Ne(u[n>>2]|0,u[e>>2]|0);return}function vo(n){n=n|0;return Pe(u[n>>2]|0)|0}function po(n){n=n|0;n=Ge(u[n>>2]|0)|0;if(!n)n=0;else n=nu(n)|0;return n|0}function mo(n,e){n=n|0;e=e|0;n=Be(u[n>>2]|0,e)|0;if(!n)n=0;else n=nu(n)|0;return n|0}function bo(n,e){n=n|0;e=e|0;var r=0,t=0;t=GE(4)|0;ho(t,e);r=n+4|0;e=u[r>>2]|0;u[r>>2]=t;if(e|0){Qi(e);XE(e)}We(u[n>>2]|0,1);return}function ho(n,e){n=n|0;e=e|0;Uo(n,e);return}function yo(n,e,r,t,i,u){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);u=u|0;var o=0,a=0;o=v;v=v+16|0;a=o;wo(a,nr(e)|0,+r,t,+i,u);c[n>>2]=K(+l[a>>3]);c[n+4>>2]=K(+l[a+8>>3]);v=o;return}function wo(n,e,r,t,i,o){n=n|0;e=e|0;r=+r;t=t|0;i=+i;o=o|0;var a=0,f=0,c=0,s=0,d=0;a=v;v=v+32|0;d=a+8|0;s=a+20|0;c=a;f=a+16|0;l[d>>3]=r;u[s>>2]=t;l[c>>3]=i;u[f>>2]=o;Mo(n,u[e+4>>2]|0,d,s,c,f);v=a;return}function Mo(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0;a=v;v=v+16|0;f=a;gS(f);e=ko(e)|0;go(n,e,+l[r>>3],u[t>>2]|0,+l[i>>3],u[o>>2]|0);AS(f);v=a;return}function ko(n){n=n|0;return u[n>>2]|0}function go(n,e,r,t,i,u){n=n|0;e=e|0;r=+r;t=t|0;i=+i;u=u|0;var o=0;o=Ao(To()|0)|0;r=+So(r);t=Eo(t)|0;i=+So(i);Co(n,oe(0,o|0,e|0,+r,t|0,+i,Eo(u)|0)|0);return}function To(){var n=0;if(!(t[7608]|0)){Io(9120);n=7608;u[n>>2]=1;u[n+4>>2]=0}return 9120}function Ao(n){n=n|0;return u[n+8>>2]|0}function So(n){n=+n;return+ +No(n)}function Eo(n){n=n|0;return Oo(n)|0}function Co(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i;t=e;if(!(t&1)){u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=u[e+8>>2];u[n+12>>2]=u[e+12>>2]}else{Lo(r,0);Hn(t|0,r|0)|0;Ro(n,r);Po(r)}v=i;return}function Lo(n,e){n=n|0;e=e|0;Bo(n,e);u[n+8>>2]=0;t[n+24>>0]=0;return}function Ro(n,e){n=n|0;e=e|0;e=e+8|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=u[e+8>>2];u[n+12>>2]=u[e+12>>2];return}function Po(n){n=n|0;t[n+24>>0]=0;return}function Bo(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function Oo(n){n=n|0;return n|0}function No(n){n=+n;return+n}function Io(n){n=n|0;xo(n,Fo()|0,4);return}function Fo(){return 1064}function xo(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;u[n+8>>2]=re(e|0,r+1|0)|0;return}function Uo(n,e){n=n|0;e=e|0;e=u[e>>2]|0;u[n>>2]=e;Rn(e|0);return}function Ho(n){n=n|0;var e=0,r=0;r=n+4|0;e=u[r>>2]|0;u[r>>2]=0;if(e|0){Qi(e);XE(e)}We(u[n>>2]|0,0);return}function Do(n){n=n|0;Ke(u[n>>2]|0);return}function Wo(n){n=n|0;return Xe(u[n>>2]|0)|0}function Yo(n,e,r,t){n=n|0;e=+e;r=+r;t=t|0;Rt(u[n>>2]|0,K(e),K(r),t);return}function Vo(n){n=n|0;return+ +K(ut(u[n>>2]|0))}function jo(n){n=n|0;return+ +K(at(u[n>>2]|0))}function qo(n){n=n|0;return+ +K(ot(u[n>>2]|0))}function zo(n){n=n|0;return+ +K(ft(u[n>>2]|0))}function Go(n){n=n|0;return+ +K(ct(u[n>>2]|0))}function Ko(n){n=n|0;return+ +K(lt(u[n>>2]|0))}function Xo(n,e){n=n|0;e=e|0;l[n>>3]=+K(ut(u[e>>2]|0));l[n+8>>3]=+K(at(u[e>>2]|0));l[n+16>>3]=+K(ot(u[e>>2]|0));l[n+24>>3]=+K(ft(u[e>>2]|0));l[n+32>>3]=+K(ct(u[e>>2]|0));l[n+40>>3]=+K(lt(u[e>>2]|0));return}function Jo(n,e){n=n|0;e=e|0;return+ +K(st(u[n>>2]|0,e))}function Zo(n,e){n=n|0;e=e|0;return+ +K(dt(u[n>>2]|0,e))}function Qo(n,e){n=n|0;e=e|0;return+ +K(_t(u[n>>2]|0,e))}function $o(){return xe()|0}function na(){ea();ra();ta();ia();ua();oa();return}function ea(){Ww(11713,4938,1);return}function ra(){ew(10448);return}function ta(){Iy(10408);return}function ia(){Qh(10324);return}function ua(){qm(10096);return}function oa(){aa(9132);return}function aa(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0,M=0,k=0,g=0,T=0,A=0,S=0,E=0,C=0,L=0,R=0,P=0,B=0,O=0,N=0,I=0,F=0,x=0,U=0,H=0,D=0,W=0,Y=0,V=0,j=0,q=0,z=0,G=0,K=0,X=0,J=0,Z=0,Q=0,$=0,nn=0,en=0,rn=0,tn=0,un=0,on=0,an=0,fn=0,cn=0,ln=0,sn=0,dn=0,_n=0,vn=0,pn=0,mn=0,bn=0,hn=0,yn=0,wn=0,Mn=0,kn=0,gn=0,Tn=0,An=0,Sn=0,En=0,Cn=0,Ln=0,Rn=0,Pn=0,Bn=0,On=0;e=v;v=v+672|0;r=e+656|0;On=e+648|0;Bn=e+640|0;Pn=e+632|0;Rn=e+624|0;Ln=e+616|0;Cn=e+608|0;En=e+600|0;Sn=e+592|0;An=e+584|0;Tn=e+576|0;gn=e+568|0;kn=e+560|0;Mn=e+552|0;wn=e+544|0;yn=e+536|0;hn=e+528|0;bn=e+520|0;mn=e+512|0;pn=e+504|0;vn=e+496|0;_n=e+488|0;dn=e+480|0;sn=e+472|0;ln=e+464|0;cn=e+456|0;fn=e+448|0;an=e+440|0;on=e+432|0;un=e+424|0;tn=e+416|0;rn=e+408|0;en=e+400|0;nn=e+392|0;$=e+384|0;Q=e+376|0;Z=e+368|0;J=e+360|0;X=e+352|0;K=e+344|0;G=e+336|0;z=e+328|0;q=e+320|0;j=e+312|0;V=e+304|0;Y=e+296|0;W=e+288|0;D=e+280|0;H=e+272|0;U=e+264|0;x=e+256|0;F=e+248|0;I=e+240|0;N=e+232|0;O=e+224|0;B=e+216|0;P=e+208|0;R=e+200|0;L=e+192|0;C=e+184|0;E=e+176|0;S=e+168|0;A=e+160|0;T=e+152|0;g=e+144|0;k=e+136|0;M=e+128|0;w=e+120|0;y=e+112|0;h=e+104|0;b=e+96|0;m=e+88|0;p=e+80|0;_=e+72|0;d=e+64|0;s=e+56|0;l=e+48|0;c=e+40|0;f=e+32|0;a=e+24|0;o=e+16|0;i=e+8|0;t=e;fa(n,3646);ca(n,3651,2)|0;la(n,3665,2)|0;sa(n,3682,18)|0;u[On>>2]=19;u[On+4>>2]=0;u[r>>2]=u[On>>2];u[r+4>>2]=u[On+4>>2];da(n,3690,r)|0;u[Bn>>2]=1;u[Bn+4>>2]=0;u[r>>2]=u[Bn>>2];u[r+4>>2]=u[Bn+4>>2];_a(n,3696,r)|0;u[Pn>>2]=2;u[Pn+4>>2]=0;u[r>>2]=u[Pn>>2];u[r+4>>2]=u[Pn+4>>2];va(n,3706,r)|0;u[Rn>>2]=1;u[Rn+4>>2]=0;u[r>>2]=u[Rn>>2];u[r+4>>2]=u[Rn+4>>2];pa(n,3722,r)|0;u[Ln>>2]=2;u[Ln+4>>2]=0;u[r>>2]=u[Ln>>2];u[r+4>>2]=u[Ln+4>>2];pa(n,3734,r)|0;u[Cn>>2]=3;u[Cn+4>>2]=0;u[r>>2]=u[Cn>>2];u[r+4>>2]=u[Cn+4>>2];va(n,3753,r)|0;u[En>>2]=4;u[En+4>>2]=0;u[r>>2]=u[En>>2];u[r+4>>2]=u[En+4>>2];va(n,3769,r)|0;u[Sn>>2]=5;u[Sn+4>>2]=0;u[r>>2]=u[Sn>>2];u[r+4>>2]=u[Sn+4>>2];va(n,3783,r)|0;u[An>>2]=6;u[An+4>>2]=0;u[r>>2]=u[An>>2];u[r+4>>2]=u[An+4>>2];va(n,3796,r)|0;u[Tn>>2]=7;u[Tn+4>>2]=0;u[r>>2]=u[Tn>>2];u[r+4>>2]=u[Tn+4>>2];va(n,3813,r)|0;u[gn>>2]=8;u[gn+4>>2]=0;u[r>>2]=u[gn>>2];u[r+4>>2]=u[gn+4>>2];va(n,3825,r)|0;u[kn>>2]=3;u[kn+4>>2]=0;u[r>>2]=u[kn>>2];u[r+4>>2]=u[kn+4>>2];pa(n,3843,r)|0;u[Mn>>2]=4;u[Mn+4>>2]=0;u[r>>2]=u[Mn>>2];u[r+4>>2]=u[Mn+4>>2];pa(n,3853,r)|0;u[wn>>2]=9;u[wn+4>>2]=0;u[r>>2]=u[wn>>2];u[r+4>>2]=u[wn+4>>2];va(n,3870,r)|0;u[yn>>2]=10;u[yn+4>>2]=0;u[r>>2]=u[yn>>2];u[r+4>>2]=u[yn+4>>2];va(n,3884,r)|0;u[hn>>2]=11;u[hn+4>>2]=0;u[r>>2]=u[hn>>2];u[r+4>>2]=u[hn+4>>2];va(n,3896,r)|0;u[bn>>2]=1;u[bn+4>>2]=0;u[r>>2]=u[bn>>2];u[r+4>>2]=u[bn+4>>2];ma(n,3907,r)|0;u[mn>>2]=2;u[mn+4>>2]=0;u[r>>2]=u[mn>>2];u[r+4>>2]=u[mn+4>>2];ma(n,3915,r)|0;u[pn>>2]=3;u[pn+4>>2]=0;u[r>>2]=u[pn>>2];u[r+4>>2]=u[pn+4>>2];ma(n,3928,r)|0;u[vn>>2]=4;u[vn+4>>2]=0;u[r>>2]=u[vn>>2];u[r+4>>2]=u[vn+4>>2];ma(n,3948,r)|0;u[_n>>2]=5;u[_n+4>>2]=0;u[r>>2]=u[_n>>2];u[r+4>>2]=u[_n+4>>2];ma(n,3960,r)|0;u[dn>>2]=6;u[dn+4>>2]=0;u[r>>2]=u[dn>>2];u[r+4>>2]=u[dn+4>>2];ma(n,3974,r)|0;u[sn>>2]=7;u[sn+4>>2]=0;u[r>>2]=u[sn>>2];u[r+4>>2]=u[sn+4>>2];ma(n,3983,r)|0;u[ln>>2]=20;u[ln+4>>2]=0;u[r>>2]=u[ln>>2];u[r+4>>2]=u[ln+4>>2];da(n,3999,r)|0;u[cn>>2]=8;u[cn+4>>2]=0;u[r>>2]=u[cn>>2];u[r+4>>2]=u[cn+4>>2];ma(n,4012,r)|0;u[fn>>2]=9;u[fn+4>>2]=0;u[r>>2]=u[fn>>2];u[r+4>>2]=u[fn+4>>2];ma(n,4022,r)|0;u[an>>2]=21;u[an+4>>2]=0;u[r>>2]=u[an>>2];u[r+4>>2]=u[an+4>>2];da(n,4039,r)|0;u[on>>2]=10;u[on+4>>2]=0;u[r>>2]=u[on>>2];u[r+4>>2]=u[on+4>>2];ma(n,4053,r)|0;u[un>>2]=11;u[un+4>>2]=0;u[r>>2]=u[un>>2];u[r+4>>2]=u[un+4>>2];ma(n,4065,r)|0;u[tn>>2]=12;u[tn+4>>2]=0;u[r>>2]=u[tn>>2];u[r+4>>2]=u[tn+4>>2];ma(n,4084,r)|0;u[rn>>2]=13;u[rn+4>>2]=0;u[r>>2]=u[rn>>2];u[r+4>>2]=u[rn+4>>2];ma(n,4097,r)|0;u[en>>2]=14;u[en+4>>2]=0;u[r>>2]=u[en>>2];u[r+4>>2]=u[en+4>>2];ma(n,4117,r)|0;u[nn>>2]=15;u[nn+4>>2]=0;u[r>>2]=u[nn>>2];u[r+4>>2]=u[nn+4>>2];ma(n,4129,r)|0;u[$>>2]=16;u[$+4>>2]=0;u[r>>2]=u[$>>2];u[r+4>>2]=u[$+4>>2];ma(n,4148,r)|0;u[Q>>2]=17;u[Q+4>>2]=0;u[r>>2]=u[Q>>2];u[r+4>>2]=u[Q+4>>2];ma(n,4161,r)|0;u[Z>>2]=18;u[Z+4>>2]=0;u[r>>2]=u[Z>>2];u[r+4>>2]=u[Z+4>>2];ma(n,4181,r)|0;u[J>>2]=5;u[J+4>>2]=0;u[r>>2]=u[J>>2];u[r+4>>2]=u[J+4>>2];pa(n,4196,r)|0;u[X>>2]=6;u[X+4>>2]=0;u[r>>2]=u[X>>2];u[r+4>>2]=u[X+4>>2];pa(n,4206,r)|0;u[K>>2]=7;u[K+4>>2]=0;u[r>>2]=u[K>>2];u[r+4>>2]=u[K+4>>2];pa(n,4217,r)|0;u[G>>2]=3;u[G+4>>2]=0;u[r>>2]=u[G>>2];u[r+4>>2]=u[G+4>>2];ba(n,4235,r)|0;u[z>>2]=1;u[z+4>>2]=0;u[r>>2]=u[z>>2];u[r+4>>2]=u[z+4>>2];ha(n,4251,r)|0;u[q>>2]=4;u[q+4>>2]=0;u[r>>2]=u[q>>2];u[r+4>>2]=u[q+4>>2];ba(n,4263,r)|0;u[j>>2]=5;u[j+4>>2]=0;u[r>>2]=u[j>>2];u[r+4>>2]=u[j+4>>2];ba(n,4279,r)|0;u[V>>2]=6;u[V+4>>2]=0;u[r>>2]=u[V>>2];u[r+4>>2]=u[V+4>>2];ba(n,4293,r)|0;u[Y>>2]=7;u[Y+4>>2]=0;u[r>>2]=u[Y>>2];u[r+4>>2]=u[Y+4>>2];ba(n,4306,r)|0;u[W>>2]=8;u[W+4>>2]=0;u[r>>2]=u[W>>2];u[r+4>>2]=u[W+4>>2];ba(n,4323,r)|0;u[D>>2]=9;u[D+4>>2]=0;u[r>>2]=u[D>>2];u[r+4>>2]=u[D+4>>2];ba(n,4335,r)|0;u[H>>2]=2;u[H+4>>2]=0;u[r>>2]=u[H>>2];u[r+4>>2]=u[H+4>>2];ha(n,4353,r)|0;u[U>>2]=12;u[U+4>>2]=0;u[r>>2]=u[U>>2];u[r+4>>2]=u[U+4>>2];ya(n,4363,r)|0;u[x>>2]=1;u[x+4>>2]=0;u[r>>2]=u[x>>2];u[r+4>>2]=u[x+4>>2];wa(n,4376,r)|0;u[F>>2]=2;u[F+4>>2]=0;u[r>>2]=u[F>>2];u[r+4>>2]=u[F+4>>2];wa(n,4388,r)|0;u[I>>2]=13;u[I+4>>2]=0;u[r>>2]=u[I>>2];u[r+4>>2]=u[I+4>>2];ya(n,4402,r)|0;u[N>>2]=14;u[N+4>>2]=0;u[r>>2]=u[N>>2];u[r+4>>2]=u[N+4>>2];ya(n,4411,r)|0;u[O>>2]=15;u[O+4>>2]=0;u[r>>2]=u[O>>2];u[r+4>>2]=u[O+4>>2];ya(n,4421,r)|0;u[B>>2]=16;u[B+4>>2]=0;u[r>>2]=u[B>>2];u[r+4>>2]=u[B+4>>2];ya(n,4433,r)|0;u[P>>2]=17;u[P+4>>2]=0;u[r>>2]=u[P>>2];u[r+4>>2]=u[P+4>>2];ya(n,4446,r)|0;u[R>>2]=18;u[R+4>>2]=0;u[r>>2]=u[R>>2];u[r+4>>2]=u[R+4>>2];ya(n,4458,r)|0;u[L>>2]=3;u[L+4>>2]=0;u[r>>2]=u[L>>2];u[r+4>>2]=u[L+4>>2];wa(n,4471,r)|0;u[C>>2]=1;u[C+4>>2]=0;u[r>>2]=u[C>>2];u[r+4>>2]=u[C+4>>2];Ma(n,4486,r)|0;u[E>>2]=10;u[E+4>>2]=0;u[r>>2]=u[E>>2];u[r+4>>2]=u[E+4>>2];ba(n,4496,r)|0;u[S>>2]=11;u[S+4>>2]=0;u[r>>2]=u[S>>2];u[r+4>>2]=u[S+4>>2];ba(n,4508,r)|0;u[A>>2]=3;u[A+4>>2]=0;u[r>>2]=u[A>>2];u[r+4>>2]=u[A+4>>2];ha(n,4519,r)|0;u[T>>2]=4;u[T+4>>2]=0;u[r>>2]=u[T>>2];u[r+4>>2]=u[T+4>>2];ka(n,4530,r)|0;u[g>>2]=19;u[g+4>>2]=0;u[r>>2]=u[g>>2];u[r+4>>2]=u[g+4>>2];ga(n,4542,r)|0;u[k>>2]=12;u[k+4>>2]=0;u[r>>2]=u[k>>2];u[r+4>>2]=u[k+4>>2];Ta(n,4554,r)|0;u[M>>2]=13;u[M+4>>2]=0;u[r>>2]=u[M>>2];u[r+4>>2]=u[M+4>>2];Aa(n,4568,r)|0;u[w>>2]=2;u[w+4>>2]=0;u[r>>2]=u[w>>2];u[r+4>>2]=u[w+4>>2];Sa(n,4578,r)|0;u[y>>2]=20;u[y+4>>2]=0;u[r>>2]=u[y>>2];u[r+4>>2]=u[y+4>>2];Ea(n,4587,r)|0;u[h>>2]=22;u[h+4>>2]=0;u[r>>2]=u[h>>2];u[r+4>>2]=u[h+4>>2];da(n,4602,r)|0;u[b>>2]=23;u[b+4>>2]=0;u[r>>2]=u[b>>2];u[r+4>>2]=u[b+4>>2];da(n,4619,r)|0;u[m>>2]=14;u[m+4>>2]=0;u[r>>2]=u[m>>2];u[r+4>>2]=u[m+4>>2];Ca(n,4629,r)|0;u[p>>2]=1;u[p+4>>2]=0;u[r>>2]=u[p>>2];u[r+4>>2]=u[p+4>>2];La(n,4637,r)|0;u[_>>2]=4;u[_+4>>2]=0;u[r>>2]=u[_>>2];u[r+4>>2]=u[_+4>>2];wa(n,4653,r)|0;u[d>>2]=5;u[d+4>>2]=0;u[r>>2]=u[d>>2];u[r+4>>2]=u[d+4>>2];wa(n,4669,r)|0;u[s>>2]=6;u[s+4>>2]=0;u[r>>2]=u[s>>2];u[r+4>>2]=u[s+4>>2];wa(n,4686,r)|0;u[l>>2]=7;u[l+4>>2]=0;u[r>>2]=u[l>>2];u[r+4>>2]=u[l+4>>2];wa(n,4701,r)|0;u[c>>2]=8;u[c+4>>2]=0;u[r>>2]=u[c>>2];u[r+4>>2]=u[c+4>>2];wa(n,4719,r)|0;u[f>>2]=9;u[f+4>>2]=0;u[r>>2]=u[f>>2];u[r+4>>2]=u[f+4>>2];wa(n,4736,r)|0;u[a>>2]=21;u[a+4>>2]=0;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Ra(n,4754,r)|0;u[o>>2]=2;u[o+4>>2]=0;u[r>>2]=u[o>>2];u[r+4>>2]=u[o+4>>2];Ma(n,4772,r)|0;u[i>>2]=3;u[i+4>>2]=0;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];Ma(n,4790,r)|0;u[t>>2]=4;u[t+4>>2]=0;u[r>>2]=u[t>>2];u[r+4>>2]=u[t+4>>2];Ma(n,4808,r)|0;v=e;return}function fa(n,e){n=n|0;e=e|0;var r=0;r=Nm()|0;u[n>>2]=r;Im(r,e);lM(u[n>>2]|0);return}function ca(n,e,r){n=n|0;e=e|0;r=r|0;bm(n,Ba(e)|0,r,0);return n|0}function la(n,e,r){n=n|0;e=e|0;r=r|0;Jp(n,Ba(e)|0,r,0);return n|0}function sa(n,e,r){n=n|0;e=e|0;r=r|0;Op(n,Ba(e)|0,r,0);return n|0}function da(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];vp(n,e,i);v=t;return n|0}function _a(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];zv(n,e,i);v=t;return n|0}function va(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ev(n,e,i);v=t;return n|0}function pa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];fv(n,e,i);v=t;return n|0}function ma(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];V_(n,e,i);v=t;return n|0}function ba(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];T_(n,e,i);v=t;return n|0}function ha(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];u_(n,e,i);v=t;return n|0}function ya(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ad(n,e,i);v=t;return n|0}function wa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];od(n,e,i);v=t;return n|0}function Ma(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ws(n,e,i);v=t;return n|0}function ka(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ks(n,e,i);v=t;return n|0}function ga(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ns(n,e,i);v=t;return n|0}function Ta(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Nl(n,e,i);v=t;return n|0}function Aa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];pl(n,e,i);v=t;return n|0}function Sa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];zc(n,e,i);v=t;return n|0}function Ea(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];kc(n,e,i);v=t;return n|0}function Ca(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];rc(n,e,i);v=t;return n|0}function La(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Pf(n,e,i);v=t;return n|0}function Ra(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Pa(n,e,i);v=t;return n|0}function Pa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Oa(n,r,i,1);v=t;return}function Ba(n){n=n|0;return n|0}function Oa(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Na()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Ia(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Fa(o,t)|0,t);v=i;return}function Na(){var n=0,e=0;if(!(t[7616]|0)){Ka(9136);xn(24,9136,b|0)|0;e=7616;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9136)|0)){n=9136;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Ka(9136)}return 9136}function Ia(n){n=n|0;return 0}function Fa(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Na()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ya(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Va(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function xa(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;a=v;v=v+32|0;_=a+24|0;d=a+20|0;c=a+16|0;s=a+12|0;l=a+8|0;f=a+4|0;p=a;u[d>>2]=e;u[c>>2]=r;u[s>>2]=t;u[l>>2]=i;u[f>>2]=o;o=n+28|0;u[p>>2]=u[o>>2];u[_>>2]=u[p>>2];Ua(n+24|0,_,d,s,l,c,f)|0;u[o>>2]=u[u[o>>2]>>2];v=a;return}function Ua(n,e,r,t,i,o,a){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;a=a|0;n=Ha(e)|0;e=GE(24)|0;Da(e+4|0,u[r>>2]|0,u[t>>2]|0,u[i>>2]|0,u[o>>2]|0,u[a>>2]|0);u[e>>2]=u[n>>2];u[n>>2]=e;return e|0}function Ha(n){n=n|0;return u[n>>2]|0}function Da(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;u[n>>2]=e;u[n+4>>2]=r;u[n+8>>2]=t;u[n+12>>2]=i;u[n+16>>2]=o;return}function Wa(n,e){n=n|0;e=e|0;return e|n|0}function Ya(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Va(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=ja(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;qa(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ya(o,t,r);u[c>>2]=(u[c>>2]|0)+12;za(n,f);Ga(f);v=l;return}}function ja(n){n=n|0;return 357913941}function qa(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function za(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Ga(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Ka(n){n=n|0;Qa(n);return}function Xa(n){n=n|0;Za(n+24|0);return}function Ja(n){n=n|0;return u[n>>2]|0}function Za(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Qa(n){n=n|0;var e=0;e=$a()|0;rf(n,2,3,e,nf()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function $a(){return 9228}function nf(){return 1140}function ef(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=tf(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=uf(e,t)|0;v=r;return e|0}function rf(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;u[n>>2]=e;u[n+4>>2]=r;u[n+8>>2]=t;u[n+12>>2]=i;u[n+16>>2]=o;return}function tf(n){n=n|0;return(u[(Na()|0)+24>>2]|0)+(n*12|0)|0}function uf(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+48|0;t=i;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;pL[r&31](t,n);t=of(t)|0;v=i;return t|0}function of(n){n=n|0;var e=0,r=0,t=0,i=0;i=v;v=v+32|0;e=i+12|0;r=i;t=ff(af()|0)|0;if(!t)n=_f(n)|0;else{cf(e,t);lf(r,e);sf(n,r);n=df(e)|0}v=i;return n|0}function af(){var n=0;if(!(t[7632]|0)){Tf(9184);xn(25,9184,b|0)|0;n=7632;u[n>>2]=1;u[n+4>>2]=0}return 9184}function ff(n){n=n|0;return u[n+36>>2]|0}function cf(n,e){n=n|0;e=e|0;u[n>>2]=e;u[n+4>>2]=n;u[n+8>>2]=0;return}function lf(n,e){n=n|0;e=e|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=0;return}function sf(n,e){n=n|0;e=e|0;hf(e,n,n+8|0,n+16|0,n+24|0,n+32|0,n+40|0)|0;return}function df(n){n=n|0;return u[(u[n+4>>2]|0)+8>>2]|0}function _f(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0;c=v;v=v+16|0;r=c+4|0;t=c;i=Dg(8)|0;o=i;a=GE(48)|0;f=a;e=f+48|0;do{u[f>>2]=u[n>>2];f=f+4|0;n=n+4|0}while((f|0)<(e|0));e=o+4|0;u[e>>2]=a;f=GE(8)|0;a=u[e>>2]|0;u[t>>2]=0;u[r>>2]=u[t>>2];vf(f,a,r);u[i>>2]=f;v=c;return o|0}function vf(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1092;u[r+12>>2]=e;u[n+4>>2]=r;return}function pf(n){n=n|0;WE(n);XE(n);return}function mf(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function bf(n){n=n|0;XE(n);return}function hf(n,e,r,t,i,o,a){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;a=a|0;o=yf(u[n>>2]|0,e,r,t,i,o,a)|0;a=n+4|0;u[(u[a>>2]|0)+8>>2]=o;return u[(u[a>>2]|0)+8>>2]|0}function yf(n,e,r,t,i,u,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;o=o|0;var a=0,f=0;a=v;v=v+16|0;f=a;gS(f);n=ko(n)|0;o=wf(n,+l[e>>3],+l[r>>3],+l[t>>3],+l[i>>3],+l[u>>3],+l[o>>3])|0;AS(f);v=a;return o|0}function wf(n,e,r,t,i,u,o){n=n|0;e=+e;r=+r;t=+t;i=+i;u=+u;o=+o;var a=0;a=Ao(Mf()|0)|0;e=+So(e);r=+So(r);t=+So(t);i=+So(i);u=+So(u);return Cn(0,a|0,n|0,+e,+r,+t,+i,+u,+ +So(o))|0}function Mf(){var n=0;if(!(t[7624]|0)){kf(9172);n=7624;u[n>>2]=1;u[n+4>>2]=0}return 9172}function kf(n){n=n|0;xo(n,gf()|0,6);return}function gf(){return 1112}function Tf(n){n=n|0;Rf(n);return}function Af(n){n=n|0;Sf(n+24|0);Ef(n+16|0);return}function Sf(n){n=n|0;Lf(n);return}function Ef(n){n=n|0;Cf(n);return}function Cf(n){n=n|0;var e=0,r=0;e=u[n>>2]|0;if(e|0)do{r=e;e=u[e>>2]|0;XE(r)}while((e|0)!=0);u[n>>2]=0;return}function Lf(n){n=n|0;var e=0,r=0;e=u[n>>2]|0;if(e|0)do{r=e;e=u[e>>2]|0;XE(r)}while((e|0)!=0);u[n>>2]=0;return}function Rf(n){n=n|0;var e=0;u[n+16>>2]=0;u[n+20>>2]=0;e=n+24|0;u[e>>2]=0;u[n+28>>2]=e;u[n+36>>2]=0;t[n+40>>0]=0;t[n+41>>0]=0;return}function Pf(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Bf(n,r,i,0);v=t;return}function Bf(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Of()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Nf(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,If(o,t)|0,t);v=i;return}function Of(){var n=0,e=0;if(!(t[7640]|0)){Yf(9232);xn(26,9232,b|0)|0;e=7640;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9232)|0)){n=9232;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Yf(9232)}return 9232}function Nf(n){n=n|0;return 0}function If(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Of()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ff(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{xf(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Ff(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function xf(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Uf(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Hf(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ff(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Df(n,f);Wf(f);v=l;return}}function Uf(n){n=n|0;return 357913941}function Hf(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Df(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Wf(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Yf(n){n=n|0;qf(n);return}function Vf(n){n=n|0;jf(n+24|0);return}function jf(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function qf(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,zf()|0,3);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function zf(){return 1144}function Gf(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+16|0;a=o+8|0;f=o;c=Kf(n)|0;n=u[c+4>>2]|0;u[f>>2]=u[c>>2];u[f+4>>2]=n;u[a>>2]=u[f>>2];u[a+4>>2]=u[f+4>>2];Xf(e,a,r,t,i);v=o;return}function Kf(n){n=n|0;return(u[(Of()|0)+24>>2]|0)+(n*12|0)|0}function Xf(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;var o=0,a=0,f=0,c=0,l=0;l=v;v=v+16|0;a=l+2|0;f=l+1|0;c=l;o=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)o=u[(u[n>>2]|0)+o>>2]|0;Jf(a,r);r=+Zf(a,r);Jf(f,t);t=+Zf(f,t);Qf(c,i);c=$f(c,i)|0;bL[o&1](n,r,t,c);v=l;return}function Jf(n,e){n=n|0;e=+e;return}function Zf(n,e){n=n|0;e=+e;return+ +ec(e)}function Qf(n,e){n=n|0;e=e|0;return}function $f(n,e){n=n|0;e=e|0;return nc(e)|0}function nc(n){n=n|0;return n|0}function ec(n){n=+n;return+n}function rc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];tc(n,r,i,1);v=t;return}function tc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=ic()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=uc(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,oc(o,t)|0,t);v=i;return}function ic(){var n=0,e=0;if(!(t[7648]|0)){_c(9268);xn(27,9268,b|0)|0;e=7648;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9268)|0)){n=9268;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));_c(9268)}return 9268}function uc(n){n=n|0;return 0}function oc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=ic()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ac(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{fc(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function ac(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function fc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=cc(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;lc(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];ac(o,t,r);u[c>>2]=(u[c>>2]|0)+12;sc(n,f);dc(f);v=l;return}}function cc(n){n=n|0;return 357913941}function lc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function sc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function dc(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function _c(n){n=n|0;mc(n);return}function vc(n){n=n|0;pc(n+24|0);return}function pc(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function mc(n){n=n|0;var e=0;e=$a()|0;rf(n,2,4,e,bc()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function bc(){return 1160}function hc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=yc(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=wc(e,t)|0;v=r;return e|0}function yc(n){n=n|0;return(u[(ic()|0)+24>>2]|0)+(n*12|0)|0}function wc(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return Mc(mL[r&31](n)|0)|0}function Mc(n){n=n|0;return n&1|0}function kc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gc(n,r,i,0);v=t;return}function gc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Tc()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Ac(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Sc(o,t)|0,t);v=i;return}function Tc(){var n=0,e=0;if(!(t[7656]|0)){Oc(9304);xn(28,9304,b|0)|0;e=7656;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9304)|0)){n=9304;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Oc(9304)}return 9304}function Ac(n){n=n|0;return 0}function Sc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Tc()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ec(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Cc(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Ec(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Cc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Lc(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Rc(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ec(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Pc(n,f);Bc(f);v=l;return}}function Lc(n){n=n|0;return 357913941}function Rc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Pc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Bc(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Oc(n){n=n|0;Fc(n);return}function Nc(n){n=n|0;Ic(n+24|0);return}function Ic(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Fc(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,xc()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function xc(){return 1164}function Uc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=Hc(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Dc(e,i,r);v=t;return}function Hc(n){n=n|0;return(u[(Tc()|0)+24>>2]|0)+(n*12|0)|0}function Dc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Wc(i,r);r=Yc(i,r)|0;pL[t&31](n,r);Vc(i);v=o;return}function Wc(n,e){n=n|0;e=e|0;jc(n,e);return}function Yc(n,e){n=n|0;e=e|0;return n|0}function Vc(n){n=n|0;Qi(n);return}function jc(n,e){n=n|0;e=e|0;qc(n,e);return}function qc(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function zc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Gc(n,r,i,0);v=t;return}function Gc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Kc()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Xc(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Jc(o,t)|0,t);v=i;return}function Kc(){var n=0,e=0;if(!(t[7664]|0)){tl(9340);xn(29,9340,b|0)|0;e=7664;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9340)|0)){n=9340;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));tl(9340)}return 9340}function Xc(n){n=n|0;return 0}function Jc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Kc()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Zc(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Qc(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Zc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Qc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=$c(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;nl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Zc(o,t,r);u[c>>2]=(u[c>>2]|0)+12;el(n,f);rl(f);v=l;return}}function $c(n){n=n|0;return 357913941}function nl(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function el(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function rl(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function tl(n){n=n|0;ol(n);return}function il(n){n=n|0;ul(n+24|0);return}function ul(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function ol(n){n=n|0;var e=0;e=$a()|0;rf(n,2,4,e,al()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function al(){return 1180}function fl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=cl(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=ll(e,i,r)|0;v=t;return r|0}function cl(n){n=n|0;return(u[(Kc()|0)+24>>2]|0)+(n*12|0)|0}function ll(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;sl(i,r);i=dl(i,r)|0;i=_l(gL[t&15](n,i)|0)|0;v=o;return i|0}function sl(n,e){n=n|0;e=e|0;return}function dl(n,e){n=n|0;e=e|0;return vl(e)|0}function _l(n){n=n|0;return n|0}function vl(n){n=n|0;return n|0}function pl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ml(n,r,i,0);v=t;return}function ml(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=bl()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=hl(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,yl(o,t)|0,t);v=i;return}function bl(){var n=0,e=0;if(!(t[7672]|0)){Sl(9376);xn(30,9376,b|0)|0;e=7672;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9376)|0)){n=9376;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Sl(9376)}return 9376}function hl(n){n=n|0;return 0}function yl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=bl()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];wl(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Ml(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function wl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Ml(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=kl(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;gl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];wl(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Tl(n,f);Al(f);v=l;return}}function kl(n){n=n|0;return 357913941}function gl(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Tl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Al(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Sl(n){n=n|0;Ll(n);return}function El(n){n=n|0;Cl(n+24|0);return}function Cl(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Ll(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,Rl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Rl(){return 1196}function Pl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Bl(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Ol(e,t)|0;v=r;return e|0}function Bl(n){n=n|0;return(u[(bl()|0)+24>>2]|0)+(n*12|0)|0}function Ol(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return _l(mL[r&31](n)|0)|0}function Nl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Il(n,r,i,1);v=t;return}function Il(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Fl()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=xl(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Ul(o,t)|0,t);v=i;return}function Fl(){var n=0,e=0;if(!(t[7680]|0)){ql(9412);xn(31,9412,b|0)|0;e=7680;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9412)|0)){n=9412;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));ql(9412)}return 9412}function xl(n){n=n|0;return 0}function Ul(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Fl()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Hl(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Dl(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Hl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Dl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Wl(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Yl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Hl(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Vl(n,f);jl(f);v=l;return}}function Wl(n){n=n|0;return 357913941}function Yl(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Vl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function jl(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function ql(n){n=n|0;Kl(n);return}function zl(n){n=n|0;Gl(n+24|0);return}function Gl(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Kl(n){n=n|0;var e=0;e=$a()|0;rf(n,2,6,e,Xl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Xl(){return 1200}function Jl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Zl(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Ql(e,t)|0;v=r;return e|0}function Zl(n){n=n|0;return(u[(Fl()|0)+24>>2]|0)+(n*12|0)|0}function Ql(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return $l(mL[r&31](n)|0)|0}function $l(n){n=n|0;return n|0}function ns(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];es(n,r,i,0);v=t;return}function es(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=rs()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=ts(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,is(o,t)|0,t);v=i;return}function rs(){var n=0,e=0;if(!(t[7688]|0)){ss(9448);xn(32,9448,b|0)|0;e=7688;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9448)|0)){n=9448;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));ss(9448)}return 9448}function ts(n){n=n|0;return 0}function is(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=rs()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];us(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{os(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function us(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function os(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=as(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;fs(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];us(o,t,r);u[c>>2]=(u[c>>2]|0)+12;cs(n,f);ls(f);v=l;return}}function as(n){n=n|0;return 357913941}function fs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function cs(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function ls(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function ss(n){n=n|0;vs(n);return}function ds(n){n=n|0;_s(n+24|0);return}function _s(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function vs(n){n=n|0;var e=0;e=$a()|0;rf(n,2,6,e,ps()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function ps(){return 1204}function ms(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=bs(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];hs(e,i,r);v=t;return}function bs(n){n=n|0;return(u[(rs()|0)+24>>2]|0)+(n*12|0)|0}function hs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;ys(i,r);i=ws(i,r)|0;pL[t&31](n,i);v=o;return}function ys(n,e){n=n|0;e=e|0;return}function ws(n,e){n=n|0;e=e|0;return Ms(e)|0}function Ms(n){n=n|0;return n|0}function ks(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gs(n,r,i,0);v=t;return}function gs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Ts()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=As(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Ss(o,t)|0,t);v=i;return}function Ts(){var n=0,e=0;if(!(t[7696]|0)){Os(9484);xn(33,9484,b|0)|0;e=7696;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9484)|0)){n=9484;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Os(9484)}return 9484}function As(n){n=n|0;return 0}function Ss(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Ts()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Es(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Cs(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Es(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Cs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Ls(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Rs(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Es(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Ps(n,f);Bs(f);v=l;return}}function Ls(n){n=n|0;return 357913941}function Rs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Ps(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Bs(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Os(n){n=n|0;Fs(n);return}function Ns(n){n=n|0;Is(n+24|0);return}function Is(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Fs(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,xs()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function xs(){return 1212}function Us(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=Hs(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Ds(e,o,r,t);v=i;return}function Hs(n){n=n|0;return(u[(Ts()|0)+24>>2]|0)+(n*12|0)|0}function Ds(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)i=u[(u[n>>2]|0)+i>>2]|0;ys(o,r);o=ws(o,r)|0;sl(a,t);a=dl(a,t)|0;PL[i&15](n,o,a);v=f;return}function Ws(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ys(n,r,i,1);v=t;return}function Ys(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Vs()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=js(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,qs(o,t)|0,t);v=i;return}function Vs(){var n=0,e=0;if(!(t[7704]|0)){Qs(9520);xn(34,9520,b|0)|0;e=7704;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9520)|0)){n=9520;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Qs(9520)}return 9520}function js(n){n=n|0;return 0}function qs(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Vs()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];zs(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Gs(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function zs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Gs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Ks(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Xs(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];zs(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Js(n,f);Zs(f);v=l;return}}function Ks(n){n=n|0;return 357913941}function Xs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Js(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Zs(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Qs(n){n=n|0;ed(n);return}function $s(n){n=n|0;nd(n+24|0);return}function nd(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function ed(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,rd()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function rd(){return 1224}function td(n,e,r){n=n|0;e=e|0;r=r|0;var t=0.0,i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=id(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];t=+ud(e,o,r);v=i;return+t}function id(n){n=n|0;return(u[(Vs()|0)+24>>2]|0)+(n*12|0)|0}function ud(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0.0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(i,r);i=$f(i,r)|0;a=+No(+SL[t&7](n,i));v=o;return+a}function od(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ad(n,r,i,1);v=t;return}function ad(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=fd()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=cd(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,ld(o,t)|0,t);v=i;return}function fd(){var n=0,e=0;if(!(t[7712]|0)){bd(9556);xn(35,9556,b|0)|0;e=7712;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9556)|0)){n=9556;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));bd(9556)}return 9556}function cd(n){n=n|0;return 0}function ld(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=fd()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];sd(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{dd(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function sd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function dd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=_d(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;vd(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];sd(o,t,r);u[c>>2]=(u[c>>2]|0)+12;pd(n,f);md(f);v=l;return}}function _d(n){n=n|0;return 357913941}function vd(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function pd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function md(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function bd(n){n=n|0;wd(n);return}function hd(n){n=n|0;yd(n+24|0);return}function yd(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function wd(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,Md()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Md(){return 1232}function kd(n,e){n=n|0;e=e|0;var r=0.0,t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=gd(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=+Td(e,i);v=t;return+r}function gd(n){n=n|0;return(u[(fd()|0)+24>>2]|0)+(n*12|0)|0}function Td(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return+ +No(+ML[r&15](n))}function Ad(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Sd(n,r,i,1);v=t;return}function Sd(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Ed()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Cd(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Ld(o,t)|0,t);v=i;return}function Ed(){var n=0,e=0;if(!(t[7720]|0)){Fd(9592);xn(36,9592,b|0)|0;e=7720;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9592)|0)){n=9592;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Fd(9592)}return 9592}function Cd(n){n=n|0;return 0}function Ld(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Ed()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Rd(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Pd(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Rd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Pd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Bd(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Od(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Rd(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Nd(n,f);Id(f);v=l;return}}function Bd(n){n=n|0;return 357913941}function Od(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Nd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Id(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Fd(n){n=n|0;Hd(n);return}function xd(n){n=n|0;Ud(n+24|0);return}function Ud(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Hd(n){n=n|0;var e=0;e=$a()|0;rf(n,2,7,e,Dd()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Dd(){return 1276}function Wd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Yd(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Vd(e,t)|0;v=r;return e|0}function Yd(n){n=n|0;return(u[(Ed()|0)+24>>2]|0)+(n*12|0)|0}function Vd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+16|0;t=i;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;pL[r&31](t,n);t=jd(t)|0;v=i;return t|0}function jd(n){n=n|0;var e=0,r=0,t=0,i=0;i=v;v=v+32|0;e=i+12|0;r=i;t=ff(qd()|0)|0;if(!t)n=Gd(n)|0;else{cf(e,t);lf(r,e);zd(n,r);n=df(e)|0}v=i;return n|0}function qd(){var n=0;if(!(t[7736]|0)){i_(9640);xn(25,9640,b|0)|0;n=7736;u[n>>2]=1;u[n+4>>2]=0}return 9640}function zd(n,e){n=n|0;e=e|0;Qd(e,n,n+8|0)|0;return}function Gd(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=Dg(8)|0;e=t;f=GE(16)|0;u[f>>2]=u[n>>2];u[f+4>>2]=u[n+4>>2];u[f+8>>2]=u[n+8>>2];u[f+12>>2]=u[n+12>>2];o=e+4|0;u[o>>2]=f;n=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];Kd(n,o,i);u[t>>2]=n;v=r;return e|0}function Kd(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1244;u[r+12>>2]=e;u[n+4>>2]=r;return}function Xd(n){n=n|0;WE(n);XE(n);return}function Jd(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function Zd(n){n=n|0;XE(n);return}function Qd(n,e,r){n=n|0;e=e|0;r=r|0;e=$d(u[n>>2]|0,e,r)|0;r=n+4|0;u[(u[r>>2]|0)+8>>2]=e;return u[(u[r>>2]|0)+8>>2]|0}function $d(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;gS(i);n=ko(n)|0;r=n_(n,u[e>>2]|0,+l[r>>3])|0;AS(i);v=t;return r|0}function n_(n,e,r){n=n|0;e=e|0;r=+r;var t=0;t=Ao(e_()|0)|0;e=Eo(e)|0;return Ln(0,t|0,n|0,e|0,+ +So(r))|0}function e_(){var n=0;if(!(t[7728]|0)){r_(9628);n=7728;u[n>>2]=1;u[n+4>>2]=0}return 9628}function r_(n){n=n|0;xo(n,t_()|0,2);return}function t_(){return 1264}function i_(n){n=n|0;Rf(n);return}function u_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];o_(n,r,i,1);v=t;return}function o_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=a_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=f_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,c_(o,t)|0,t);v=i;return}function a_(){var n=0,e=0;if(!(t[7744]|0)){m_(9684);xn(37,9684,b|0)|0;e=7744;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9684)|0)){n=9684;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));m_(9684)}return 9684}function f_(n){n=n|0;return 0}function c_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=a_()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];l_(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{s_(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function l_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function s_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=d_(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;__(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];l_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;v_(n,f);p_(f);v=l;return}}function d_(n){n=n|0;return 357913941}function __(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function v_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function p_(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function m_(n){n=n|0;y_(n);return}function b_(n){n=n|0;h_(n+24|0);return}function h_(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function y_(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,w_()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function w_(){return 1280}function M_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=k_(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=g_(e,i,r)|0;v=t;return r|0}function k_(n){n=n|0;return(u[(a_()|0)+24>>2]|0)+(n*12|0)|0}function g_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;a=v;v=v+32|0;i=a;o=a+16|0;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(o,r);o=$f(o,r)|0;PL[t&15](i,n,o);o=jd(i)|0;v=a;return o|0}function T_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];A_(n,r,i,1);v=t;return}function A_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=S_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=E_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,C_(o,t)|0,t);v=i;return}function S_(){var n=0,e=0;if(!(t[7752]|0)){I_(9720);xn(38,9720,b|0)|0;e=7752;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9720)|0)){n=9720;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));I_(9720)}return 9720}function E_(n){n=n|0;return 0}function C_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=S_()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];L_(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{R_(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function L_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function R_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=P_(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;B_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];L_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;O_(n,f);N_(f);v=l;return}}function P_(n){n=n|0;return 357913941}function B_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function O_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function N_(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function I_(n){n=n|0;U_(n);return}function F_(n){n=n|0;x_(n+24|0);return}function x_(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function U_(n){n=n|0;var e=0;e=$a()|0;rf(n,2,8,e,H_()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function H_(){return 1288}function D_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=W_(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Y_(e,t)|0;v=r;return e|0}function W_(n){n=n|0;return(u[(S_()|0)+24>>2]|0)+(n*12|0)|0}function Y_(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return Oo(mL[r&31](n)|0)|0}function V_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];j_(n,r,i,0);v=t;return}function j_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=q_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=z_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,G_(o,t)|0,t);v=i;return}function q_(){var n=0,e=0;if(!(t[7760]|0)){nv(9756);xn(39,9756,b|0)|0;e=7760;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9756)|0)){n=9756;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));nv(9756)}return 9756}function z_(n){n=n|0;return 0}function G_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=q_()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];K_(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{X_(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function K_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function X_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=J_(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Z_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];K_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Q_(n,f);$_(f);v=l;return}}function J_(n){n=n|0;return 357913941}function Z_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Q_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function $_(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function nv(n){n=n|0;tv(n);return}function ev(n){n=n|0;rv(n+24|0);return}function rv(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function tv(n){n=n|0;var e=0;e=$a()|0;rf(n,2,8,e,iv()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function iv(){return 1292}function uv(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=ov(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];av(e,i,r);v=t;return}function ov(n){n=n|0;return(u[(q_()|0)+24>>2]|0)+(n*12|0)|0}function av(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Jf(i,r);r=+Zf(i,r);dL[t&31](n,r);v=o;return}function fv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];cv(n,r,i,0);v=t;return}function cv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=lv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=sv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,dv(o,t)|0,t);v=i;return}function lv(){var n=0,e=0;if(!(t[7768]|0)){yv(9792);xn(40,9792,b|0)|0;e=7768;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9792)|0)){n=9792;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));yv(9792)}return 9792}function sv(n){n=n|0;return 0}function dv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=lv()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];_v(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{vv(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function _v(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function vv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=pv(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;mv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];_v(o,t,r);u[c>>2]=(u[c>>2]|0)+12;bv(n,f);hv(f);v=l;return}}function pv(n){n=n|0;return 357913941}function mv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function bv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function hv(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function yv(n){n=n|0;kv(n);return}function wv(n){n=n|0;Mv(n+24|0);return}function Mv(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function kv(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,gv()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function gv(){return 1300}function Tv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=Av(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Sv(e,o,r,t);v=i;return}function Av(n){n=n|0;return(u[(lv()|0)+24>>2]|0)+(n*12|0)|0}function Sv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)i=u[(u[n>>2]|0)+i>>2]|0;Qf(o,r);o=$f(o,r)|0;Jf(a,t);t=+Zf(a,t);OL[i&15](n,o,t);v=f;return}function Ev(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Cv(n,r,i,0);v=t;return}function Cv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Lv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Rv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Pv(o,t)|0,t);v=i;return}function Lv(){var n=0,e=0;if(!(t[7776]|0)){Uv(9828);xn(41,9828,b|0)|0;e=7776;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9828)|0)){n=9828;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Uv(9828)}return 9828}function Rv(n){n=n|0;return 0}function Pv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Lv()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Bv(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Ov(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Bv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Ov(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Nv(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Iv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Bv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Fv(n,f);xv(f);v=l;return}}function Nv(n){n=n|0;return 357913941}function Iv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Fv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function xv(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Uv(n){n=n|0;Wv(n);return}function Hv(n){n=n|0;Dv(n+24|0);return}function Dv(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Wv(n){n=n|0;var e=0;e=$a()|0;rf(n,2,7,e,Yv()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Yv(){return 1312}function Vv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=jv(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];qv(e,i,r);v=t;return}function jv(n){n=n|0;return(u[(Lv()|0)+24>>2]|0)+(n*12|0)|0}function qv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(i,r);i=$f(i,r)|0;pL[t&31](n,i);v=o;return}function zv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Gv(n,r,i,0);v=t;return}function Gv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Kv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Xv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Jv(o,t)|0,t);v=i;return}function Kv(){var n=0,e=0;if(!(t[7784]|0)){tp(9864);xn(42,9864,b|0)|0;e=7784;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9864)|0)){n=9864;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));tp(9864)}return 9864}function Xv(n){n=n|0;return 0}function Jv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Kv()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Zv(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Qv(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Zv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Qv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=$v(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;np(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Zv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;ep(n,f);rp(f);v=l;return}}function $v(n){n=n|0;return 357913941}function np(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function ep(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function rp(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function tp(n){n=n|0;op(n);return}function ip(n){n=n|0;up(n+24|0);return}function up(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function op(n){n=n|0;var e=0;e=$a()|0;rf(n,2,8,e,ap()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function ap(){return 1320}function fp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=cp(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];lp(e,i,r);v=t;return}function cp(n){n=n|0;return(u[(Kv()|0)+24>>2]|0)+(n*12|0)|0}function lp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;sp(i,r);i=dp(i,r)|0;pL[t&31](n,i);v=o;return}function sp(n,e){n=n|0;e=e|0;return}function dp(n,e){n=n|0;e=e|0;return _p(e)|0}function _p(n){n=n|0;return n|0}function vp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];pp(n,r,i,0);v=t;return}function pp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=mp()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=bp(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,hp(o,t)|0,t);v=i;return}function mp(){var n=0,e=0;if(!(t[7792]|0)){Ap(9900);xn(43,9900,b|0)|0;e=7792;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9900)|0)){n=9900;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Ap(9900)}return 9900}function bp(n){n=n|0;return 0}function hp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=mp()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];yp(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{wp(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function yp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function wp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Mp(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;kp(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];yp(o,t,r);u[c>>2]=(u[c>>2]|0)+12;gp(n,f);Tp(f);v=l;return}}function Mp(n){n=n|0;return 357913941}function kp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function gp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Tp(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Ap(n){n=n|0;Cp(n);return}function Sp(n){n=n|0;Ep(n+24|0);return}function Ep(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Cp(n){n=n|0;var e=0;e=$a()|0;rf(n,2,22,e,Lp()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Lp(){return 1344}function Rp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Pp(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];Bp(e,t);v=r;return}function Pp(n){n=n|0;return(u[(mp()|0)+24>>2]|0)+(n*12|0)|0}function Bp(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;vL[r&127](n);return}function Op(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=Np()|0;n=Ip(r)|0;xa(o,e,i,n,Fp(r,t)|0,t);return}function Np(){var n=0,e=0;if(!(t[7800]|0)){Vp(9936);xn(44,9936,b|0)|0;e=7800;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9936)|0)){n=9936;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Vp(9936)}return 9936}function Ip(n){n=n|0;return n|0}function Fp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=Np()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){xp(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{Up(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function xp(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function Up(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=Hp(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;Dp(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;xp(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Wp(n,i);Yp(i);v=f;return}}function Hp(n){n=n|0;return 536870911}function Dp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function Wp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Yp(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function Vp(n){n=n|0;zp(n);return}function jp(n){n=n|0;qp(n+24|0);return}function qp(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function zp(n){n=n|0;var e=0;e=$a()|0;rf(n,1,23,e,ps()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Gp(n,e){n=n|0;e=e|0;Xp(u[(Kp(n)|0)>>2]|0,e);return}function Kp(n){n=n|0;return(u[(Np()|0)+24>>2]|0)+(n<<3)|0}function Xp(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;ys(t,e);e=ws(t,e)|0;vL[n&127](e);v=r;return}function Jp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=Zp()|0;n=Qp(r)|0;xa(o,e,i,n,$p(r,t)|0,t);return}function Zp(){var n=0,e=0;if(!(t[7808]|0)){om(9972);xn(45,9972,b|0)|0;e=7808;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9972)|0)){n=9972;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));om(9972)}return 9972}function Qp(n){n=n|0;return n|0}function $p(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=Zp()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){nm(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{em(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function nm(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function em(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=rm(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;tm(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;nm(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;im(n,i);um(i);v=f;return}}function rm(n){n=n|0;return 536870911}function tm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function im(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function um(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function om(n){n=n|0;cm(n);return}function am(n){n=n|0;fm(n+24|0);return}function fm(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function cm(n){n=n|0;var e=0;e=$a()|0;rf(n,1,9,e,lm()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function lm(){return 1348}function sm(n,e){n=n|0;e=e|0;return _m(u[(dm(n)|0)>>2]|0,e)|0}function dm(n){n=n|0;return(u[(Zp()|0)+24>>2]|0)+(n<<3)|0}function _m(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;vm(t,e);e=pm(t,e)|0;e=_l(mL[n&31](e)|0)|0;v=r;return e|0}function vm(n,e){n=n|0;e=e|0;return}function pm(n,e){n=n|0;e=e|0;return mm(e)|0}function mm(n){n=n|0;return n|0}function bm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=hm()|0;n=ym(r)|0;xa(o,e,i,n,wm(r,t)|0,t);return}function hm(){var n=0,e=0;if(!(t[7816]|0)){Em(10008);xn(46,10008,b|0)|0;e=7816;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10008)|0)){n=10008;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Em(10008)}return 10008}function ym(n){n=n|0;return n|0}function wm(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=hm()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Mm(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{km(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function Mm(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function km(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=gm(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;Tm(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;Mm(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Am(n,i);Sm(i);v=f;return}}function gm(n){n=n|0;return 536870911}function Tm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function Am(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Sm(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function Em(n){n=n|0;Rm(n);return}function Cm(n){n=n|0;Lm(n+24|0);return}function Lm(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Rm(n){n=n|0;var e=0;e=$a()|0;rf(n,1,15,e,Rl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Pm(n){n=n|0;return Om(u[(Bm(n)|0)>>2]|0)|0}function Bm(n){n=n|0;return(u[(hm()|0)+24>>2]|0)+(n<<3)|0}function Om(n){n=n|0;return _l(EL[n&7]()|0)|0}function Nm(){var n=0;if(!(t[7832]|0)){jm(10052);xn(25,10052,b|0)|0;n=7832;u[n>>2]=1;u[n+4>>2]=0}return 10052}function Im(n,e){n=n|0;e=e|0;u[n>>2]=Fm()|0;u[n+4>>2]=xm()|0;u[n+12>>2]=e;u[n+8>>2]=Um()|0;u[n+32>>2]=2;return}function Fm(){return 11709}function xm(){return 1188}function Um(){return Ym()|0}function Hm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){Wm(r);XE(r)}}else if(e|0){Zi(e);XE(e)}return}function Dm(n,e){n=n|0;e=e|0;return e&n|0}function Wm(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Ym(){var n=0;if(!(t[7824]|0)){u[2511]=Vm()|0;u[2512]=0;n=7824;u[n>>2]=1;u[n+4>>2]=0}return 10044}function Vm(){return 0}function jm(n){n=n|0;Rf(n);return}function qm(n){n=n|0;var e=0,r=0,t=0,i=0,o=0;e=v;v=v+32|0;r=e+24|0;o=e+16|0;i=e+8|0;t=e;zm(n,4827);Gm(n,4834,3)|0;Km(n,3682,47)|0;u[o>>2]=9;u[o+4>>2]=0;u[r>>2]=u[o>>2];u[r+4>>2]=u[o+4>>2];Xm(n,4841,r)|0;u[i>>2]=1;u[i+4>>2]=0;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];Jm(n,4871,r)|0;u[t>>2]=10;u[t+4>>2]=0;u[r>>2]=u[t>>2];u[r+4>>2]=u[t+4>>2];Zm(n,4891,r)|0;v=e;return}function zm(n,e){n=n|0;e=e|0;var r=0;r=jh()|0;u[n>>2]=r;qh(r,e);lM(u[n>>2]|0);return}function Gm(n,e,r){n=n|0;e=e|0;r=r|0;Ah(n,Ba(e)|0,r,0);return n|0}function Km(n,e,r){n=n|0;e=e|0;r=r|0;ah(n,Ba(e)|0,r,0);return n|0}function Xm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Hb(n,e,i);v=t;return n|0}function Jm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];bb(n,e,i);v=t;return n|0}function Zm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Qm(n,e,i);v=t;return n|0}function Qm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];$m(n,r,i,1);v=t;return}function $m(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=nb()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=eb(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,rb(o,t)|0,t);v=i;return}function nb(){var n=0,e=0;if(!(t[7840]|0)){cb(10100);xn(48,10100,b|0)|0;e=7840;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10100)|0)){n=10100;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));cb(10100)}return 10100}function eb(n){n=n|0;return 0}function rb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=nb()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];tb(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{ib(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function tb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function ib(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=ub(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;ob(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];tb(o,t,r);u[c>>2]=(u[c>>2]|0)+12;ab(n,f);fb(f);v=l;return}}function ub(n){n=n|0;return 357913941}function ob(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function ab(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function fb(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function cb(n){n=n|0;db(n);return}function lb(n){n=n|0;sb(n+24|0);return}function sb(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function db(n){n=n|0;var e=0;e=$a()|0;rf(n,2,6,e,_b()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function _b(){return 1364}function vb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=pb(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=mb(e,i,r)|0;v=t;return r|0}function pb(n){n=n|0;return(u[(nb()|0)+24>>2]|0)+(n*12|0)|0}function mb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(i,r);i=$f(i,r)|0;i=Mc(gL[t&15](n,i)|0)|0;v=o;return i|0}function bb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];hb(n,r,i,0);v=t;return}function hb(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=yb()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=wb(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Mb(o,t)|0,t);v=i;return}function yb(){var n=0,e=0;if(!(t[7848]|0)){Cb(10136);xn(49,10136,b|0)|0;e=7848;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10136)|0)){n=10136;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Cb(10136)}return 10136}function wb(n){n=n|0;return 0}function Mb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=yb()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];kb(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{gb(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function kb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function gb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Tb(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Ab(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];kb(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Sb(n,f);Eb(f);v=l;return}}function Tb(n){n=n|0;return 357913941}function Ab(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Sb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Eb(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Cb(n){n=n|0;Pb(n);return}function Lb(n){n=n|0;Rb(n+24|0);return}function Rb(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Pb(n){n=n|0;var e=0;e=$a()|0;rf(n,2,9,e,Bb()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Bb(){return 1372}function Ob(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=Nb(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ib(e,i,r);v=t;return}function Nb(n){n=n|0;return(u[(yb()|0)+24>>2]|0)+(n*12|0)|0}function Ib(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=de;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Fb(i,r);a=K(xb(i,r));sL[t&1](n,a);v=o;return}function Fb(n,e){n=n|0;e=+e;return}function xb(n,e){n=n|0;e=+e;return K(Ub(e))}function Ub(n){n=+n;return K(n)}function Hb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Db(n,r,i,0);v=t;return}function Db(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Wb()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Yb(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Vb(o,t)|0,t);v=i;return}function Wb(){var n=0,e=0;if(!(t[7856]|0)){Jb(10172);xn(50,10172,b|0)|0;e=7856;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10172)|0)){n=10172;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Jb(10172)}return 10172}function Yb(n){n=n|0;return 0}function Vb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Wb()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];jb(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{qb(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function jb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function qb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=zb(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Gb(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];jb(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Kb(n,f);Xb(f);v=l;return}}function zb(n){n=n|0;return 357913941}function Gb(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Kb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Xb(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Jb(n){n=n|0;$b(n);return}function Zb(n){n=n|0;Qb(n+24|0);return}function Qb(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function $b(n){n=n|0;var e=0;e=$a()|0;rf(n,2,3,e,nh()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function nh(){return 1380}function eh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=rh(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];th(e,o,r,t);v=i;return}function rh(n){n=n|0;return(u[(Wb()|0)+24>>2]|0)+(n*12|0)|0}function th(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)i=u[(u[n>>2]|0)+i>>2]|0;Qf(o,r);o=$f(o,r)|0;ih(a,t);a=uh(a,t)|0;PL[i&15](n,o,a);v=f;return}function ih(n,e){n=n|0;e=e|0;return}function uh(n,e){n=n|0;e=e|0;return oh(e)|0}function oh(n){n=n|0;return(n|0)!=0|0}function ah(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=fh()|0;n=ch(r)|0;xa(o,e,i,n,lh(r,t)|0,t);return}function fh(){var n=0,e=0;if(!(t[7864]|0)){bh(10208);xn(51,10208,b|0)|0;e=7864;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10208)|0)){n=10208;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));bh(10208)}return 10208}function ch(n){n=n|0;return n|0}function lh(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=fh()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){sh(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{dh(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function sh(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function dh(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=_h(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;vh(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;sh(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;ph(n,i);mh(i);v=f;return}}function _h(n){n=n|0;return 536870911}function vh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function ph(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function mh(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function bh(n){n=n|0;wh(n);return}function hh(n){n=n|0;yh(n+24|0);return}function yh(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function wh(n){n=n|0;var e=0;e=$a()|0;rf(n,1,24,e,Mh()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Mh(){return 1392}function kh(n,e){n=n|0;e=e|0;Th(u[(gh(n)|0)>>2]|0,e);return}function gh(n){n=n|0;return(u[(fh()|0)+24>>2]|0)+(n<<3)|0}function Th(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;vm(t,e);e=pm(t,e)|0;vL[n&127](e);v=r;return}function Ah(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=Sh()|0;n=Eh(r)|0;xa(o,e,i,n,Ch(r,t)|0,t);return}function Sh(){var n=0,e=0;if(!(t[7872]|0)){Ih(10244);xn(52,10244,b|0)|0;e=7872;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10244)|0)){n=10244;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Ih(10244)}return 10244}function Eh(n){n=n|0;return n|0}function Ch(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=Sh()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Lh(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{Rh(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function Lh(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function Rh(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=Ph(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;Bh(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;Lh(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Oh(n,i);Nh(i);v=f;return}}function Ph(n){n=n|0;return 536870911}function Bh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function Oh(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Nh(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function Ih(n){n=n|0;Uh(n);return}function Fh(n){n=n|0;xh(n+24|0);return}function xh(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Uh(n){n=n|0;var e=0;e=$a()|0;rf(n,1,16,e,Hh()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Hh(){return 1400}function Dh(n){n=n|0;return Yh(u[(Wh(n)|0)>>2]|0)|0}function Wh(n){n=n|0;return(u[(Sh()|0)+24>>2]|0)+(n<<3)|0}function Yh(n){n=n|0;return Vh(EL[n&7]()|0)|0}function Vh(n){n=n|0;return n|0}function jh(){var n=0;if(!(t[7880]|0)){Zh(10280);xn(25,10280,b|0)|0;n=7880;u[n>>2]=1;u[n+4>>2]=0}return 10280}function qh(n,e){n=n|0;e=e|0;u[n>>2]=zh()|0;u[n+4>>2]=Gh()|0;u[n+12>>2]=e;u[n+8>>2]=Kh()|0;u[n+32>>2]=4;return}function zh(){return 11711}function Gh(){return 1356}function Kh(){return Ym()|0}function Xh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){Jh(r);XE(r)}}else if(e|0){Vi(e);XE(e)}return}function Jh(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Zh(n){n=n|0;Rf(n);return}function Qh(n){n=n|0;$h(n,4920);ny(n)|0;ey(n)|0;return}function $h(n,e){n=n|0;e=e|0;var r=0;r=qd()|0;u[n>>2]=r;Ey(r,e);lM(u[n>>2]|0);return}function ny(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,py()|0);return n|0}function ey(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,ry()|0);return n|0}function ry(){var n=0;if(!(t[7888]|0)){iy(10328);xn(53,10328,b|0)|0;n=7888;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10328)|0))iy(10328);return 10328}function ty(n,e){n=n|0;e=e|0;xa(n,0,e,0,0,0);return}function iy(n){n=n|0;ay(n);cy(n,10);return}function uy(n){n=n|0;oy(n+24|0);return}function oy(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function ay(n){n=n|0;var e=0;e=$a()|0;rf(n,5,1,e,dy()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function fy(n,e,r){n=n|0;e=e|0;r=+r;ly(n,e,r);return}function cy(n,e){n=n|0;e=e|0;u[n+20>>2]=e;return}function ly(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;o=t+8|0;f=t+13|0;i=t;a=t+12|0;Qf(f,e);u[o>>2]=$f(f,e)|0;Jf(a,r);l[i>>3]=+Zf(a,r);sy(n,o,i);v=t;return}function sy(n,e,r){n=n|0;e=e|0;r=r|0;Vu(n+8|0,u[e>>2]|0,+l[r>>3]);t[n+24>>0]=1;return}function dy(){return 1404}function _y(n,e){n=n|0;e=+e;return vy(n,e)|0}function vy(n,e){n=n|0;e=+e;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+16|0;o=t+4|0;a=t+8|0;f=t;i=Dg(8)|0;r=i;c=GE(16)|0;Qf(o,n);n=$f(o,n)|0;Jf(a,e);Vu(c,n,+Zf(a,e));a=r+4|0;u[a>>2]=c;n=GE(8)|0;a=u[a>>2]|0;u[f>>2]=0;u[o>>2]=u[f>>2];Kd(n,a,o);u[i>>2]=n;v=t;return r|0}function py(){var n=0;if(!(t[7896]|0)){my(10364);xn(54,10364,b|0)|0;n=7896;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10364)|0))my(10364);return 10364}function my(n){n=n|0;yy(n);cy(n,55);return}function by(n){n=n|0;hy(n+24|0);return}function hy(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function yy(n){n=n|0;var e=0;e=$a()|0;rf(n,5,4,e,Ty()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function wy(n){n=n|0;My(n);return}function My(n){n=n|0;ky(n);return}function ky(n){n=n|0;gy(n+8|0);t[n+24>>0]=1;return}function gy(n){n=n|0;u[n>>2]=0;l[n+8>>3]=0.0;return}function Ty(){return 1424}function Ay(){return Sy()|0}function Sy(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0;e=v;v=v+16|0;i=e+4|0;a=e;r=Dg(8)|0;n=r;t=GE(16)|0;gy(t);o=n+4|0;u[o>>2]=t;t=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];Kd(t,o,i);u[r>>2]=t;v=e;return n|0}function Ey(n,e){n=n|0;e=e|0;u[n>>2]=Cy()|0;u[n+4>>2]=Ly()|0;u[n+12>>2]=e;u[n+8>>2]=Ry()|0;u[n+32>>2]=5;return}function Cy(){return 11710}function Ly(){return 1416}function Ry(){return Oy()|0}function Py(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){By(r);XE(r)}}else if(e|0)XE(e);return}function By(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Oy(){var n=0;if(!(t[7904]|0)){u[2600]=Ny()|0;u[2601]=0;n=7904;u[n>>2]=1;u[n+4>>2]=0}return 10400}function Ny(){return u[357]|0}function Iy(n){n=n|0;Fy(n,4926);xy(n)|0;return}function Fy(n,e){n=n|0;e=e|0;var r=0;r=af()|0;u[n>>2]=r;Xy(r,e);lM(u[n>>2]|0);return}function xy(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,Uy()|0);return n|0}function Uy(){var n=0;if(!(t[7912]|0)){Hy(10412);xn(56,10412,b|0)|0;n=7912;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10412)|0))Hy(10412);return 10412}function Hy(n){n=n|0;Yy(n);cy(n,57);return}function Dy(n){n=n|0;Wy(n+24|0);return}function Wy(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Yy(n){n=n|0;var e=0;e=$a()|0;rf(n,5,5,e,zy()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Vy(n){n=n|0;jy(n);return}function jy(n){n=n|0;qy(n);return}function qy(n){n=n|0;var e=0,r=0;e=n+8|0;r=e+48|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(r|0));t[n+56>>0]=1;return}function zy(){return 1432}function Gy(){return Ky()|0}function Ky(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0,f=0;a=v;v=v+16|0;n=a+4|0;e=a;r=Dg(8)|0;t=r;i=GE(48)|0;o=i;f=o+48|0;do{u[o>>2]=0;o=o+4|0}while((o|0)<(f|0));o=t+4|0;u[o>>2]=i;f=GE(8)|0;o=u[o>>2]|0;u[e>>2]=0;u[n>>2]=u[e>>2];vf(f,o,n);u[r>>2]=f;v=a;return t|0}function Xy(n,e){n=n|0;e=e|0;u[n>>2]=Jy()|0;u[n+4>>2]=Zy()|0;u[n+12>>2]=e;u[n+8>>2]=Qy()|0;u[n+32>>2]=6;return}function Jy(){return 11704}function Zy(){return 1436}function Qy(){return Oy()|0}function $y(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){nw(r);XE(r)}}else if(e|0)XE(e);return}function nw(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function ew(n){n=n|0;rw(n,4933);tw(n)|0;iw(n)|0;return}function rw(n,e){n=n|0;e=e|0;var r=0;r=Ow()|0;u[n>>2]=r;Nw(r,e);lM(u[n>>2]|0);return}function tw(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,Mw()|0);return n|0}function iw(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,uw()|0);return n|0}function uw(){var n=0;if(!(t[7920]|0)){ow(10452);xn(58,10452,b|0)|0;n=7920;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10452)|0))ow(10452);return 10452}function ow(n){n=n|0;cw(n);cy(n,1);return}function aw(n){n=n|0;fw(n+24|0);return}function fw(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function cw(n){n=n|0;var e=0;e=$a()|0;rf(n,5,1,e,vw()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function lw(n,e,r){n=n|0;e=+e;r=+r;sw(n,e,r);return}function sw(n,e,r){n=n|0;e=+e;r=+r;var t=0,i=0,u=0,o=0,a=0;t=v;v=v+32|0;u=t+8|0;a=t+17|0;i=t;o=t+16|0;Jf(a,e);l[u>>3]=+Zf(a,e);Jf(o,r);l[i>>3]=+Zf(o,r);dw(n,u,i);v=t;return}function dw(n,e,r){n=n|0;e=e|0;r=r|0;_w(n+8|0,+l[e>>3],+l[r>>3]);t[n+24>>0]=1;return}function _w(n,e,r){n=n|0;e=+e;r=+r;l[n>>3]=e;l[n+8>>3]=r;return}function vw(){return 1472}function pw(n,e){n=+n;e=+e;return mw(n,e)|0}function mw(n,e){n=+n;e=+e;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+16|0;a=t+4|0;f=t+8|0;c=t;i=Dg(8)|0;r=i;o=GE(16)|0;Jf(a,n);n=+Zf(a,n);Jf(f,e);_w(o,n,+Zf(f,e));f=r+4|0;u[f>>2]=o;o=GE(8)|0;f=u[f>>2]|0;u[c>>2]=0;u[a>>2]=u[c>>2];bw(o,f,a);u[i>>2]=o;v=t;return r|0}function bw(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1452;u[r+12>>2]=e;u[n+4>>2]=r;return}function hw(n){n=n|0;WE(n);XE(n);return}function yw(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function ww(n){n=n|0;XE(n);return}function Mw(){var n=0;if(!(t[7928]|0)){kw(10488);xn(59,10488,b|0)|0;n=7928;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10488)|0))kw(10488);return 10488}function kw(n){n=n|0;Aw(n);cy(n,60);return}function gw(n){n=n|0;Tw(n+24|0);return}function Tw(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Aw(n){n=n|0;var e=0;e=$a()|0;rf(n,5,6,e,Rw()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Sw(n){n=n|0;Ew(n);return}function Ew(n){n=n|0;Cw(n);return}function Cw(n){n=n|0;Lw(n+8|0);t[n+24>>0]=1;return}function Lw(n){n=n|0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;u[n+12>>2]=0;return}function Rw(){return 1492}function Pw(){return Bw()|0}function Bw(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0;e=v;v=v+16|0;i=e+4|0;a=e;r=Dg(8)|0;n=r;t=GE(16)|0;Lw(t);o=n+4|0;u[o>>2]=t;t=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];bw(t,o,i);u[r>>2]=t;v=e;return n|0}function Ow(){var n=0;if(!(t[7936]|0)){Dw(10524);xn(25,10524,b|0)|0;n=7936;u[n>>2]=1;u[n+4>>2]=0}return 10524}function Nw(n,e){n=n|0;e=e|0;u[n>>2]=Iw()|0;u[n+4>>2]=Fw()|0;u[n+12>>2]=e;u[n+8>>2]=xw()|0;u[n+32>>2]=7;return}function Iw(){return 11700}function Fw(){return 1484}function xw(){return Oy()|0}function Uw(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){Hw(r);XE(r)}}else if(e|0)XE(e);return}function Hw(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Dw(n){n=n|0;Rf(n);return}function Ww(n,e,r){n=n|0;e=e|0;r=r|0;n=Ba(e)|0;e=Yw(r)|0;r=Vw(r,0)|0;CM(n,e,r,jw()|0,0);return}function Yw(n){n=n|0;return n|0}function Vw(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=jw()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Qw(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{$w(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function jw(){var n=0,e=0;if(!(t[7944]|0)){qw(10568);xn(61,10568,b|0)|0;e=7944;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10568)|0)){n=10568;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));qw(10568)}return 10568}function qw(n){n=n|0;Kw(n);return}function zw(n){n=n|0;Gw(n+24|0);return}function Gw(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Kw(n){n=n|0;var e=0;e=$a()|0;rf(n,1,17,e,Xl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Xw(n){n=n|0;return Zw(u[(Jw(n)|0)>>2]|0)|0}function Jw(n){n=n|0;return(u[(jw()|0)+24>>2]|0)+(n<<3)|0}function Zw(n){n=n|0;return $l(EL[n&7]()|0)|0}function Qw(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function $w(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=nM(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;eM(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;Qw(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;rM(n,i);tM(i);v=f;return}}function nM(n){n=n|0;return 536870911}function eM(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function rM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function tM(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function iM(){uM();return}function uM(){oM(10604);return}function oM(n){n=n|0;aM(n,4955);return}function aM(n,e){n=n|0;e=e|0;var r=0;r=fM()|0;u[n>>2]=r;cM(r,e);lM(u[n>>2]|0);return}function fM(){var n=0;if(!(t[7952]|0)){wM(10612);xn(25,10612,b|0)|0;n=7952;u[n>>2]=1;u[n+4>>2]=0}return 10612}function cM(n,e){n=n|0;e=e|0;u[n>>2]=pM()|0;u[n+4>>2]=mM()|0;u[n+12>>2]=e;u[n+8>>2]=bM()|0;u[n+32>>2]=8;return}function lM(n){n=n|0;var e=0,r=0;e=v;v=v+16|0;r=e;sM()|0;u[r>>2]=n;dM(10608,r);v=e;return}function sM(){if(!(t[11714]|0)){u[2652]=0;xn(62,10608,b|0)|0;t[11714]=1}return 10608}function dM(n,e){n=n|0;e=e|0;var r=0;r=GE(8)|0;u[r+4>>2]=u[e>>2];u[r>>2]=u[n>>2];u[n>>2]=r;return}function _M(n){n=n|0;vM(n);return}function vM(n){n=n|0;var e=0,r=0;e=u[n>>2]|0;if(e|0)do{r=e;e=u[e>>2]|0;XE(r)}while((e|0)!=0);u[n>>2]=0;return}function pM(){return 11715}function mM(){return 1496}function bM(){return Ym()|0}function hM(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){yM(r);XE(r)}}else if(e|0)XE(e);return}function yM(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function wM(n){n=n|0;Rf(n);return}function MM(n,e){n=n|0;e=e|0;var r=0,t=0;sM()|0;r=u[2652]|0;n:do{if(r|0){while(1){t=u[r+4>>2]|0;if(t|0?(tE(kM(t)|0,n)|0)==0:0)break;r=u[r>>2]|0;if(!r)break n}gM(t,e)}}while(0);return}function kM(n){n=n|0;return u[n+12>>2]|0}function gM(n,e){n=n|0;e=e|0;var r=0;n=n+36|0;r=u[n>>2]|0;if(r|0){Qi(r);XE(r)}r=GE(4)|0;ho(r,e);u[n>>2]=r;return}function TM(){if(!(t[11716]|0)){u[2664]=0;xn(63,10656,b|0)|0;t[11716]=1}return 10656}function AM(){var n=0;if(!(t[11717]|0)){SM();u[2665]=1504;t[11717]=1;n=1504}else n=u[2665]|0;return n|0}function SM(){if(!(t[11740]|0)){t[11718]=Wa(Wa(8,0)|0,0)|0;t[11719]=Wa(Wa(0,0)|0,0)|0;t[11720]=Wa(Wa(0,16)|0,0)|0;t[11721]=Wa(Wa(8,0)|0,0)|0;t[11722]=Wa(Wa(0,0)|0,0)|0;t[11723]=Wa(Wa(8,0)|0,0)|0;t[11724]=Wa(Wa(0,0)|0,0)|0;t[11725]=Wa(Wa(8,0)|0,0)|0;t[11726]=Wa(Wa(0,0)|0,0)|0;t[11727]=Wa(Wa(8,0)|0,0)|0;t[11728]=Wa(Wa(0,0)|0,0)|0;t[11729]=Wa(Wa(0,0)|0,32)|0;t[11730]=Wa(Wa(0,0)|0,32)|0;t[11740]=1}return}function EM(){return 1572}function CM(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0;o=v;v=v+32|0;s=o+16|0;l=o+12|0;c=o+8|0;f=o+4|0;a=o;u[s>>2]=n;u[l>>2]=e;u[c>>2]=r;u[f>>2]=t;u[a>>2]=i;TM()|0;LM(10656,s,l,c,f,a);v=o;return}function LM(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0;a=GE(24)|0;Da(a+4|0,u[e>>2]|0,u[r>>2]|0,u[t>>2]|0,u[i>>2]|0,u[o>>2]|0);u[a>>2]=u[n>>2];u[n>>2]=a;return}function RM(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0;w=v;v=v+32|0;m=w+20|0;b=w+8|0;h=w+4|0;y=w;e=u[e>>2]|0;if(e|0){p=m+4|0;c=m+8|0;l=b+4|0;s=b+8|0;d=b+8|0;_=m+8|0;do{a=e+4|0;f=PM(a)|0;if(f|0){i=BM(f)|0;u[m>>2]=0;u[p>>2]=0;u[c>>2]=0;t=(OM(f)|0)+1|0;NM(m,t);if(t|0)while(1){t=t+-1|0;bS(b,u[i>>2]|0);o=u[p>>2]|0;if(o>>>0<(u[_>>2]|0)>>>0){u[o>>2]=u[b>>2];u[p>>2]=(u[p>>2]|0)+4}else IM(m,b);if(!t)break;else i=i+4|0}t=FM(f)|0;u[b>>2]=0;u[l>>2]=0;u[s>>2]=0;n:do{if(u[t>>2]|0){i=0;o=0;while(1){if((i|0)==(o|0))xM(b,t);else{u[i>>2]=u[t>>2];u[l>>2]=(u[l>>2]|0)+4}t=t+4|0;if(!(u[t>>2]|0))break n;i=u[l>>2]|0;o=u[d>>2]|0}}}while(0);u[h>>2]=UM(a)|0;u[y>>2]=Ja(f)|0;HM(r,n,h,y,m,b);DM(b);WM(m)}e=u[e>>2]|0}while((e|0)!=0)}v=w;return}function PM(n){n=n|0;return u[n+12>>2]|0}function BM(n){n=n|0;return u[n+12>>2]|0}function OM(n){n=n|0;return u[n+16>>2]|0}function NM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i;t=u[n>>2]|0;if((u[n+8>>2]|0)-t>>2>>>0<e>>>0){wk(r,e,(u[n+4>>2]|0)-t>>2,n+8|0);Mk(n,r);kk(r)}v=i;return}function IM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;a=v;v=v+32|0;r=a;t=n+4|0;i=((u[t>>2]|0)-(u[n>>2]|0)>>2)+1|0;o=mk(n)|0;if(o>>>0<i>>>0)DE(n);else{f=u[n>>2]|0;l=(u[n+8>>2]|0)-f|0;c=l>>1;wk(r,l>>2>>>0<o>>>1>>>0?c>>>0<i>>>0?i:c:o,(u[t>>2]|0)-f>>2,n+8|0);o=r+8|0;u[u[o>>2]>>2]=u[e>>2];u[o>>2]=(u[o>>2]|0)+4;Mk(n,r);kk(r);v=a;return}}function FM(n){n=n|0;return u[n+8>>2]|0}function xM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;a=v;v=v+32|0;r=a;t=n+4|0;i=((u[t>>2]|0)-(u[n>>2]|0)>>2)+1|0;o=_k(n)|0;if(o>>>0<i>>>0)DE(n);else{f=u[n>>2]|0;l=(u[n+8>>2]|0)-f|0;c=l>>1;bk(r,l>>2>>>0<o>>>1>>>0?c>>>0<i>>>0?i:c:o,(u[t>>2]|0)-f>>2,n+8|0);o=r+8|0;u[u[o>>2]>>2]=u[e>>2];u[o>>2]=(u[o>>2]|0)+4;hk(n,r);yk(r);v=a;return}}function UM(n){n=n|0;return u[n>>2]|0}function HM(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;YM(n,e,r,t,i,u);return}function DM(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-4-t|0)>>>2)<<2);XE(r)}return}function WM(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-4-t|0)>>>2)<<2);XE(r)}return}function YM(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0;a=v;v=v+48|0;s=a+40|0;f=a+32|0;d=a+24|0;c=a+12|0;l=a;gS(f);n=ko(n)|0;u[d>>2]=u[e>>2];r=u[r>>2]|0;t=u[t>>2]|0;VM(c,i);jM(l,o);u[s>>2]=u[d>>2];qM(n,s,r,t,c,l);DM(l);WM(c);AS(f);v=a;return}function VM(n,e){n=n|0;e=e|0;var r=0,t=0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;r=e+4|0;t=(u[r>>2]|0)-(u[e>>2]|0)>>2;if(t|0){vk(n,t);pk(n,u[e>>2]|0,u[r>>2]|0,t)}return}function jM(n,e){n=n|0;e=e|0;var r=0,t=0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;r=e+4|0;t=(u[r>>2]|0)-(u[e>>2]|0)>>2;if(t|0){sk(n,t);dk(n,u[e>>2]|0,u[r>>2]|0,t)}return}function qM(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0;a=v;v=v+32|0;s=a+28|0;d=a+24|0;f=a+12|0;c=a;l=Ao(zM()|0)|0;u[d>>2]=u[e>>2];u[s>>2]=u[d>>2];e=GM(s)|0;r=KM(r)|0;t=XM(t)|0;u[f>>2]=u[i>>2];s=i+4|0;u[f+4>>2]=u[s>>2];d=i+8|0;u[f+8>>2]=u[d>>2];u[d>>2]=0;u[s>>2]=0;u[i>>2]=0;i=JM(f)|0;u[c>>2]=u[o>>2];s=o+4|0;u[c+4>>2]=u[s>>2];d=o+8|0;u[c+8>>2]=u[d>>2];u[d>>2]=0;u[s>>2]=0;u[o>>2]=0;Pn(0,l|0,n|0,e|0,r|0,t|0,i|0,ZM(c)|0)|0;DM(c);WM(f);v=a;return}function zM(){var n=0;if(!(t[7968]|0)){ck(10708);n=7968;u[n>>2]=1;u[n+4>>2]=0}return 10708}function GM(n){n=n|0;return ek(n)|0}function KM(n){n=n|0;return $M(n)|0}function XM(n){n=n|0;return $l(n)|0}function JM(n){n=n|0;return nk(n)|0}function ZM(n){n=n|0;return QM(n)|0}function QM(n){n=n|0;var e=0,r=0,t=0;t=(u[n+4>>2]|0)-(u[n>>2]|0)|0;r=t>>2;t=Dg(t+4|0)|0;u[t>>2]=r;if(r|0){e=0;do{u[t+4+(e<<2)>>2]=$M(u[(u[n>>2]|0)+(e<<2)>>2]|0)|0;e=e+1|0}while((e|0)!=(r|0))}return t|0}function $M(n){n=n|0;return n|0}function nk(n){n=n|0;var e=0,r=0,t=0;t=(u[n+4>>2]|0)-(u[n>>2]|0)|0;r=t>>2;t=Dg(t+4|0)|0;u[t>>2]=r;if(r|0){e=0;do{u[t+4+(e<<2)>>2]=ek((u[n>>2]|0)+(e<<2)|0)|0;e=e+1|0}while((e|0)!=(r|0))}return t|0}function ek(n){n=n|0;var e=0,r=0,t=0,i=0;i=v;v=v+32|0;e=i+12|0;r=i;t=ff(rk()|0)|0;if(!t)n=tk(n)|0;else{cf(e,t);lf(r,e);wS(n,r);n=df(e)|0}v=i;return n|0}function rk(){var n=0;if(!(t[7960]|0)){fk(10664);xn(25,10664,b|0)|0;n=7960;u[n>>2]=1;u[n+4>>2]=0}return 10664}function tk(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=Dg(8)|0;e=t;f=GE(4)|0;u[f>>2]=u[n>>2];o=e+4|0;u[o>>2]=f;n=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];ik(n,o,i);u[t>>2]=n;v=r;return e|0}function ik(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1656;u[r+12>>2]=e;u[n+4>>2]=r;return}function uk(n){n=n|0;WE(n);XE(n);return}function ok(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function ak(n){n=n|0;XE(n);return}function fk(n){n=n|0;Rf(n);return}function ck(n){n=n|0;xo(n,lk()|0,5);return}function lk(){return 1676}function sk(n,e){n=n|0;e=e|0;var r=0;if((_k(n)|0)>>>0<e>>>0)DE(n);if(e>>>0>1073741823)Xn();else{r=GE(e<<2)|0;u[n+4>>2]=r;u[n>>2]=r;u[n+8>>2]=r+(e<<2);return}}function dk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=n+4|0;n=r-e|0;if((n|0)>0){iC(u[t>>2]|0,e|0,n|0)|0;u[t>>2]=(u[t>>2]|0)+(n>>>2<<2)}return}function _k(n){n=n|0;return 1073741823}function vk(n,e){n=n|0;e=e|0;var r=0;if((mk(n)|0)>>>0<e>>>0)DE(n);if(e>>>0>1073741823)Xn();else{r=GE(e<<2)|0;u[n+4>>2]=r;u[n>>2]=r;u[n+8>>2]=r+(e<<2);return}}function pk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=n+4|0;n=r-e|0;if((n|0)>0){iC(u[t>>2]|0,e|0,n|0)|0;u[t>>2]=(u[t>>2]|0)+(n>>>2<<2)}return}function mk(n){n=n|0;return 1073741823}function bk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>1073741823)Xn();else{i=GE(e<<2)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<2)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<2);return}function hk(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function yk(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-4-e|0)>>>2)<<2);n=u[n>>2]|0;if(n|0)XE(n);return}function wk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>1073741823)Xn();else{i=GE(e<<2)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<2)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<2);return}function Mk(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function kk(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-4-e|0)>>>2)<<2);n=u[n>>2]|0;if(n|0)XE(n);return}function gk(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0;b=v;v=v+32|0;s=b+20|0;d=b+12|0;l=b+16|0;_=b+4|0;p=b;m=b+8|0;f=AM()|0;o=u[f>>2]|0;a=u[o>>2]|0;if(a|0){c=u[f+8>>2]|0;f=u[f+4>>2]|0;while(1){bS(s,a);Tk(n,s,f,c);o=o+4|0;a=u[o>>2]|0;if(!a)break;else{c=c+1|0;f=f+1|0}}}o=EM()|0;a=u[o>>2]|0;if(a|0)do{bS(s,a);u[d>>2]=u[o+4>>2];Ak(e,s,d);o=o+8|0;a=u[o>>2]|0}while((a|0)!=0);o=u[(sM()|0)>>2]|0;if(o|0)do{e=u[o+4>>2]|0;bS(s,u[(Sk(e)|0)>>2]|0);u[d>>2]=kM(e)|0;Ek(r,s,d);o=u[o>>2]|0}while((o|0)!=0);bS(l,0);o=TM()|0;u[s>>2]=u[l>>2];RM(s,o,i);o=u[(sM()|0)>>2]|0;if(o|0){n=s+4|0;e=s+8|0;r=s+8|0;do{c=u[o+4>>2]|0;bS(d,u[(Sk(c)|0)>>2]|0);Lk(_,Ck(c)|0);a=u[_>>2]|0;if(a|0){u[s>>2]=0;u[n>>2]=0;u[e>>2]=0;do{bS(p,u[(Sk(u[a+4>>2]|0)|0)>>2]|0);f=u[n>>2]|0;if(f>>>0<(u[r>>2]|0)>>>0){u[f>>2]=u[p>>2];u[n>>2]=(u[n>>2]|0)+4}else IM(s,p);a=u[a>>2]|0}while((a|0)!=0);Rk(t,d,s);WM(s)}u[m>>2]=u[d>>2];l=Pk(c)|0;u[s>>2]=u[m>>2];RM(s,l,i);Ef(_);o=u[o>>2]|0}while((o|0)!=0)}v=b;return}function Tk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;qk(n,e,r,t);return}function Ak(n,e,r){n=n|0;e=e|0;r=r|0;jk(n,e,r);return}function Sk(n){n=n|0;return n|0}function Ek(n,e,r){n=n|0;e=e|0;r=r|0;Hk(n,e,r);return}function Ck(n){n=n|0;return n+16|0}function Lk(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;o=v;v=v+16|0;i=o+8|0;r=o;u[n>>2]=0;t=u[e>>2]|0;u[i>>2]=t;u[r>>2]=n;r=xk(r)|0;if(t|0){t=GE(12)|0;a=(Uk(i)|0)+4|0;n=u[a+4>>2]|0;e=t+4|0;u[e>>2]=u[a>>2];u[e+4>>2]=n;e=u[u[i>>2]>>2]|0;u[i>>2]=e;if(!e)n=t;else{e=t;while(1){n=GE(12)|0;c=(Uk(i)|0)+4|0;f=u[c+4>>2]|0;a=n+4|0;u[a>>2]=u[c>>2];u[a+4>>2]=f;u[e>>2]=n;a=u[u[i>>2]>>2]|0;u[i>>2]=a;if(!a)break;else e=n}}u[n>>2]=u[r>>2];u[r>>2]=t}v=o;return}function Rk(n,e,r){n=n|0;e=e|0;r=r|0;Bk(n,e,r);return}function Pk(n){n=n|0;return n+24|0}function Bk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+32|0;a=t+24|0;i=t+16|0;f=t+12|0;o=t;gS(i);n=ko(n)|0;u[f>>2]=u[e>>2];VM(o,r);u[a>>2]=u[f>>2];Ok(n,a,o);WM(o);AS(i);v=t;return}function Ok(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+32|0;a=t+16|0;f=t+12|0;i=t;o=Ao(Nk()|0)|0;u[f>>2]=u[e>>2];u[a>>2]=u[f>>2];e=GM(a)|0;u[i>>2]=u[r>>2];a=r+4|0;u[i+4>>2]=u[a>>2];f=r+8|0;u[i+8>>2]=u[f>>2];u[f>>2]=0;u[a>>2]=0;u[r>>2]=0;En(0,o|0,n|0,e|0,JM(i)|0)|0;WM(i);v=t;return}function Nk(){var n=0;if(!(t[7976]|0)){Ik(10720);n=7976;u[n>>2]=1;u[n+4>>2]=0}return 10720}function Ik(n){n=n|0;xo(n,Fk()|0,2);return}function Fk(){return 1732}function xk(n){n=n|0;return u[n>>2]|0}function Uk(n){n=n|0;return u[n>>2]|0}function Hk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+32|0;o=t+16|0;i=t+8|0;a=t;gS(i);n=ko(n)|0;u[a>>2]=u[e>>2];r=u[r>>2]|0;u[o>>2]=u[a>>2];Dk(n,o,r);AS(i);v=t;return}function Dk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;o=t+4|0;a=t;i=Ao(Wk()|0)|0;u[a>>2]=u[e>>2];u[o>>2]=u[a>>2];e=GM(o)|0;En(0,i|0,n|0,e|0,KM(r)|0)|0;v=t;return}function Wk(){var n=0;if(!(t[7984]|0)){Yk(10732);n=7984;u[n>>2]=1;u[n+4>>2]=0}return 10732}function Yk(n){n=n|0;xo(n,Vk()|0,2);return}function Vk(){return 1744}function jk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+32|0;o=t+16|0;i=t+8|0;a=t;gS(i);n=ko(n)|0;u[a>>2]=u[e>>2];r=u[r>>2]|0;u[o>>2]=u[a>>2];Dk(n,o,r);AS(i);v=t;return}function qk(n,e,r,i){n=n|0;e=e|0;r=r|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+32|0;f=o+16|0;a=o+8|0;c=o;gS(a);n=ko(n)|0;u[c>>2]=u[e>>2];r=t[r>>0]|0;i=t[i>>0]|0;u[f>>2]=u[c>>2];zk(n,f,r,i);AS(a);v=o;return}function zk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;a=i+4|0;f=i;o=Ao(Gk()|0)|0;u[f>>2]=u[e>>2];u[a>>2]=u[f>>2];e=GM(a)|0;r=Kk(r)|0;te(0,o|0,n|0,e|0,r|0,Kk(t)|0)|0;v=i;return}function Gk(){var n=0;if(!(t[7992]|0)){Jk(10744);n=7992;u[n>>2]=1;u[n+4>>2]=0}return 10744}function Kk(n){n=n|0;return Xk(n)|0}function Xk(n){n=n|0;return n&255|0}function Jk(n){n=n|0;xo(n,Zk()|0,3);return}function Zk(){return 1756}function Qk(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;p=v;v=v+32|0;c=p+8|0;l=p+4|0;s=p+20|0;d=p;qc(n,0);i=yS(e)|0;u[c>>2]=0;_=c+4|0;u[_>>2]=0;u[c+8>>2]=0;switch(i<<24>>24){case 0:{t[s>>0]=0;$k(l,r,s);ng(n,l)|0;$i(l);break}case 8:{_=hS(e)|0;t[s>>0]=8;bS(d,u[_+4>>2]|0);eg(l,r,s,d,_+8|0);ng(n,l)|0;$i(l);break}case 9:{a=hS(e)|0;e=u[a+4>>2]|0;if(e|0){f=c+8|0;o=a+12|0;while(1){e=e+-1|0;bS(l,u[o>>2]|0);i=u[_>>2]|0;if(i>>>0<(u[f>>2]|0)>>>0){u[i>>2]=u[l>>2];u[_>>2]=(u[_>>2]|0)+4}else IM(c,l);if(!e)break;else o=o+4|0}}t[s>>0]=9;bS(d,u[a+8>>2]|0);rg(l,r,s,d,c);ng(n,l)|0;$i(l);break}default:{_=hS(e)|0;t[s>>0]=i;bS(d,u[_+4>>2]|0);tg(l,r,s,d);ng(n,l)|0;$i(l)}}WM(c);v=p;return}function $k(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,u=0;i=v;v=v+16|0;u=i;gS(u);e=ko(e)|0;bg(n,e,t[r>>0]|0);AS(u);v=i;return}function ng(n,e){n=n|0;e=e|0;var r=0;r=u[n>>2]|0;if(r|0)ie(r|0);u[n>>2]=u[e>>2];u[e>>2]=0;return n|0}function eg(n,e,r,i,o){n=n|0;e=e|0;r=r|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0;a=v;v=v+32|0;c=a+16|0;f=a+8|0;l=a;gS(f);e=ko(e)|0;r=t[r>>0]|0;u[l>>2]=u[i>>2];o=u[o>>2]|0;u[c>>2]=u[l>>2];_g(n,e,r,c,o);AS(f);v=a;return}function rg(n,e,r,i,o){n=n|0;e=e|0;r=r|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0;a=v;v=v+32|0;l=a+24|0;f=a+16|0;s=a+12|0;c=a;gS(f);e=ko(e)|0;r=t[r>>0]|0;u[s>>2]=u[i>>2];VM(c,o);u[l>>2]=u[s>>2];cg(n,e,r,l,c);WM(c);AS(f);v=a;return}function tg(n,e,r,i){n=n|0;e=e|0;r=r|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+32|0;f=o+16|0;a=o+8|0;c=o;gS(a);e=ko(e)|0;r=t[r>>0]|0;u[c>>2]=u[i>>2];u[f>>2]=u[c>>2];ig(n,e,r,f);AS(a);v=o;return}function ig(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+4|0;f=i;a=Ao(ug()|0)|0;r=Kk(r)|0;u[f>>2]=u[t>>2];u[o>>2]=u[f>>2];og(n,En(0,a|0,e|0,r|0,GM(o)|0)|0);v=i;return}function ug(){var n=0;if(!(t[8e3]|0)){ag(10756);n=8e3;u[n>>2]=1;u[n+4>>2]=0}return 10756}function og(n,e){n=n|0;e=e|0;qc(n,e);return}function ag(n){n=n|0;xo(n,fg()|0,2);return}function fg(){return 1772}function cg(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0;o=v;v=v+32|0;c=o+16|0;l=o+12|0;a=o;f=Ao(lg()|0)|0;r=Kk(r)|0;u[l>>2]=u[t>>2];u[c>>2]=u[l>>2];t=GM(c)|0;u[a>>2]=u[i>>2];c=i+4|0;u[a+4>>2]=u[c>>2];l=i+8|0;u[a+8>>2]=u[l>>2];u[l>>2]=0;u[c>>2]=0;u[i>>2]=0;og(n,te(0,f|0,e|0,r|0,t|0,JM(a)|0)|0);WM(a);v=o;return}function lg(){var n=0;if(!(t[8008]|0)){sg(10768);n=8008;u[n>>2]=1;u[n+4>>2]=0}return 10768}function sg(n){n=n|0;xo(n,dg()|0,3);return}function dg(){return 1784}function _g(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+16|0;f=o+4|0;c=o;a=Ao(vg()|0)|0;r=Kk(r)|0;u[c>>2]=u[t>>2];u[f>>2]=u[c>>2];t=GM(f)|0;og(n,te(0,a|0,e|0,r|0,t|0,XM(i)|0)|0);v=o;return}function vg(){var n=0;if(!(t[8016]|0)){pg(10780);n=8016;u[n>>2]=1;u[n+4>>2]=0}return 10780}function pg(n){n=n|0;xo(n,mg()|0,3);return}function mg(){return 1800}function bg(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=Ao(hg()|0)|0;og(n,ue(0,t|0,e|0,Kk(r)|0)|0);return}function hg(){var n=0;if(!(t[8024]|0)){yg(10792);n=8024;u[n>>2]=1;u[n+4>>2]=0}return 10792}function yg(n){n=n|0;xo(n,wg()|0,1);return}function wg(){return 1816}function Mg(){kg();gg();Tg();return}function kg(){u[2702]=KE(65536)|0;return}function gg(){Gg(10856);return}function Tg(){Ag(10816);return}function Ag(n){n=n|0;Sg(n,5044);Eg(n)|0;return}function Sg(n,e){n=n|0;e=e|0;var r=0;r=rk()|0;u[n>>2]=r;Wg(r,e);lM(u[n>>2]|0);return}function Eg(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,Cg()|0);return n|0}function Cg(){var n=0;if(!(t[8032]|0)){Lg(10820);xn(64,10820,b|0)|0;n=8032;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10820)|0))Lg(10820);return 10820}function Lg(n){n=n|0;Bg(n);cy(n,25);return}function Rg(n){n=n|0;Pg(n+24|0);return}function Pg(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Bg(n){n=n|0;var e=0;e=$a()|0;rf(n,5,18,e,xg()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Og(n,e){n=n|0;e=e|0;Ng(n,e);return}function Ng(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;r=v;v=v+16|0;t=r;i=r+4|0;sl(i,e);u[t>>2]=dl(i,e)|0;Ig(n,t);v=r;return}function Ig(n,e){n=n|0;e=e|0;Fg(n+4|0,u[e>>2]|0);t[n+8>>0]=1;return}function Fg(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function xg(){return 1824}function Ug(n){n=n|0;return Hg(n)|0}function Hg(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=Dg(8)|0;e=t;f=GE(4)|0;sl(i,n);Fg(f,dl(i,n)|0);o=e+4|0;u[o>>2]=f;n=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];ik(n,o,i);u[t>>2]=n;v=r;return e|0}function Dg(n){n=n|0;var e=0,r=0;n=n+7&-8;if(n>>>0<=32768?(e=u[2701]|0,n>>>0<=(65536-e|0)>>>0):0){r=(u[2702]|0)+e|0;u[2701]=e+n;n=r}else{n=KE(n+8|0)|0;u[n>>2]=u[2703];u[2703]=n;n=n+8|0}return n|0}function Wg(n,e){n=n|0;e=e|0;u[n>>2]=Yg()|0;u[n+4>>2]=Vg()|0;u[n+12>>2]=e;u[n+8>>2]=jg()|0;u[n+32>>2]=9;return}function Yg(){return 11744}function Vg(){return 1832}function jg(){return Oy()|0}function qg(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){zg(r);XE(r)}}else if(e|0)XE(e);return}function zg(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Gg(n){n=n|0;Kg(n,5052);Xg(n)|0;Jg(n,5058,26)|0;Zg(n,5069,1)|0;Qg(n,5077,10)|0;$g(n,5087,19)|0;eT(n,5094,27)|0;return}function Kg(n,e){n=n|0;e=e|0;var r=0;r=cS()|0;u[n>>2]=r;lS(r,e);lM(u[n>>2]|0);return}function Xg(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,KA()|0);return n|0}function Jg(n,e,r){n=n|0;e=e|0;r=r|0;EA(n,Ba(e)|0,r,0);return n|0}function Zg(n,e,r){n=n|0;e=e|0;r=r|0;cA(n,Ba(e)|0,r,0);return n|0}function Qg(n,e,r){n=n|0;e=e|0;r=r|0;UT(n,Ba(e)|0,r,0);return n|0}function $g(n,e,r){n=n|0;e=e|0;r=r|0;wT(n,Ba(e)|0,r,0);return n|0}function nT(n,e){n=n|0;e=e|0;var r=0,t=0;n:while(1){r=u[2703]|0;while(1){if((r|0)==(e|0))break n;t=u[r>>2]|0;u[2703]=t;if(!r)r=t;else break}XE(r)}u[2701]=n;return}function eT(n,e,r){n=n|0;e=e|0;r=r|0;rT(n,Ba(e)|0,r,0);return n|0}function rT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=tT()|0;n=iT(r)|0;xa(o,e,i,n,uT(r,t)|0,t);return}function tT(){var n=0,e=0;if(!(t[8040]|0)){dT(10860);xn(65,10860,b|0)|0;e=8040;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10860)|0)){n=10860;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));dT(10860)}return 10860}function iT(n){n=n|0;return n|0}function uT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=tT()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){oT(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{aT(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function oT(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function aT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=fT(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;cT(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;oT(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;lT(n,i);sT(i);v=f;return}}function fT(n){n=n|0;return 536870911}function cT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function lT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function sT(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function dT(n){n=n|0;pT(n);return}function _T(n){n=n|0;vT(n+24|0);return}function vT(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function pT(n){n=n|0;var e=0;e=$a()|0;rf(n,1,11,e,mT()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function mT(){return 1840}function bT(n,e,r){n=n|0;e=e|0;r=r|0;yT(u[(hT(n)|0)>>2]|0,e,r);return}function hT(n){n=n|0;return(u[(tT()|0)+24>>2]|0)+(n<<3)|0}function yT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+1|0;i=t;sl(u,e);e=dl(u,e)|0;sl(i,r);r=dl(i,r)|0;pL[n&31](e,r);v=t;return}function wT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=MT()|0;n=kT(r)|0;xa(o,e,i,n,gT(r,t)|0,t);return}function MT(){var n=0,e=0;if(!(t[8048]|0)){RT(10896);xn(66,10896,b|0)|0;e=8048;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10896)|0)){n=10896;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));RT(10896)}return 10896}function kT(n){n=n|0;return n|0}function gT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=MT()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){TT(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{AT(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function TT(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function AT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=ST(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;ET(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;TT(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;CT(n,i);LT(i);v=f;return}}function ST(n){n=n|0;return 536870911}function ET(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function CT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function LT(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function RT(n){n=n|0;OT(n);return}function PT(n){n=n|0;BT(n+24|0);return}function BT(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function OT(n){n=n|0;var e=0;e=$a()|0;rf(n,1,11,e,NT()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function NT(){return 1852}function IT(n,e){n=n|0;e=e|0;return xT(u[(FT(n)|0)>>2]|0,e)|0}function FT(n){n=n|0;return(u[(MT()|0)+24>>2]|0)+(n<<3)|0}function xT(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;sl(t,e);e=dl(t,e)|0;e=$l(mL[n&31](e)|0)|0;v=r;return e|0}function UT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=HT()|0;n=DT(r)|0;xa(o,e,i,n,WT(r,t)|0,t);return}function HT(){var n=0,e=0;if(!(t[8056]|0)){KT(10932);xn(67,10932,b|0)|0;e=8056;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10932)|0)){n=10932;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));KT(10932)}return 10932}function DT(n){n=n|0;return n|0}function WT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=HT()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){YT(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{VT(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function YT(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function VT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=jT(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;qT(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;YT(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;zT(n,i);GT(i);v=f;return}}function jT(n){n=n|0;return 536870911}function qT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function zT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function GT(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function KT(n){n=n|0;ZT(n);return}function XT(n){n=n|0;JT(n+24|0);return}function JT(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function ZT(n){n=n|0;var e=0;e=$a()|0;rf(n,1,7,e,QT()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function QT(){return 1860}function $T(n,e,r){n=n|0;e=e|0;r=r|0;return eA(u[(nA(n)|0)>>2]|0,e,r)|0}function nA(n){n=n|0;return(u[(HT()|0)+24>>2]|0)+(n<<3)|0}function eA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+32|0;a=t+12|0;o=t+8|0;f=t;c=t+16|0;i=t+4|0;rA(c,e);tA(f,c,e);Wc(i,r);r=Yc(i,r)|0;u[a>>2]=u[f>>2];PL[n&15](o,a,r);r=iA(o)|0;$i(o);Vc(i);v=t;return r|0}function rA(n,e){n=n|0;e=e|0;return}function tA(n,e,r){n=n|0;e=e|0;r=r|0;uA(n,r);return}function iA(n){n=n|0;return ko(n)|0}function uA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+16|0;r=i;t=e;if(!(t&1))u[n>>2]=u[e>>2];else{oA(r,0);Hn(t|0,r|0)|0;aA(n,r);fA(r)}v=i;return}function oA(n,e){n=n|0;e=e|0;Bo(n,e);u[n+4>>2]=0;t[n+8>>0]=0;return}function aA(n,e){n=n|0;e=e|0;u[n>>2]=u[e+4>>2];return}function fA(n){n=n|0;t[n+8>>0]=0;return}function cA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=lA()|0;n=sA(r)|0;xa(o,e,i,n,dA(r,t)|0,t);return}function lA(){var n=0,e=0;if(!(t[8064]|0)){yA(10968);xn(68,10968,b|0)|0;e=8064;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10968)|0)){n=10968;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));yA(10968)}return 10968}function sA(n){n=n|0;return n|0}function dA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=lA()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){_A(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{vA(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function _A(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function vA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=pA(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;mA(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;_A(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;bA(n,i);hA(i);v=f;return}}function pA(n){n=n|0;return 536870911}function mA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function bA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function hA(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function yA(n){n=n|0;kA(n);return}function wA(n){n=n|0;MA(n+24|0);return}function MA(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function kA(n){n=n|0;var e=0;e=$a()|0;rf(n,1,1,e,gA()|0,5);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function gA(){return 1872}function TA(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;SA(u[(AA(n)|0)>>2]|0,e,r,t,i,o);return}function AA(n){n=n|0;return(u[(lA()|0)+24>>2]|0)+(n<<3)|0}function SA(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;var o=0,a=0,f=0,c=0,l=0,s=0;o=v;v=v+32|0;a=o+16|0;f=o+12|0;c=o+8|0;l=o+4|0;s=o;Wc(a,e);e=Yc(a,e)|0;Wc(f,r);r=Yc(f,r)|0;Wc(c,t);t=Yc(c,t)|0;Wc(l,i);i=Yc(l,i)|0;Wc(s,u);u=Yc(s,u)|0;lL[n&1](e,r,t,i,u);Vc(s);Vc(l);Vc(c);Vc(f);Vc(a);v=o;return}function EA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=CA()|0;n=LA(r)|0;xa(o,e,i,n,RA(r,t)|0,t);return}function CA(){var n=0,e=0;if(!(t[8072]|0)){xA(11004);xn(69,11004,b|0)|0;e=8072;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(11004)|0)){n=11004;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));xA(11004)}return 11004}function LA(n){n=n|0;return n|0}function RA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=CA()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){PA(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{BA(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function PA(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function BA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=OA(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;NA(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;PA(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;IA(n,i);FA(i);v=f;return}}function OA(n){n=n|0;return 536870911}function NA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function IA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function FA(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function xA(n){n=n|0;DA(n);return}function UA(n){n=n|0;HA(n+24|0);return}function HA(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function DA(n){n=n|0;var e=0;e=$a()|0;rf(n,1,12,e,WA()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function WA(){return 1896}function YA(n,e,r){n=n|0;e=e|0;r=r|0;jA(u[(VA(n)|0)>>2]|0,e,r);return}function VA(n){n=n|0;return(u[(CA()|0)+24>>2]|0)+(n<<3)|0}function jA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+4|0;i=t;qA(u,e);e=zA(u,e)|0;Wc(i,r);r=Yc(i,r)|0;pL[n&31](e,r);Vc(i);v=t;return}function qA(n,e){n=n|0;e=e|0;return}function zA(n,e){n=n|0;e=e|0;return GA(e)|0}function GA(n){n=n|0;return n|0}function KA(){var n=0;if(!(t[8080]|0)){XA(11040);xn(70,11040,b|0)|0;n=8080;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(11040)|0))XA(11040);return 11040}function XA(n){n=n|0;QA(n);cy(n,71);return}function JA(n){n=n|0;ZA(n+24|0);return}function ZA(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function QA(n){n=n|0;var e=0;e=$a()|0;rf(n,5,7,e,rS()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function $A(n){n=n|0;nS(n);return}function nS(n){n=n|0;eS(n);return}function eS(n){n=n|0;t[n+8>>0]=1;return}function rS(){return 1936}function tS(){return iS()|0}function iS(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0;e=v;v=v+16|0;i=e+4|0;a=e;r=Dg(8)|0;n=r;o=n+4|0;u[o>>2]=GE(1)|0;t=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];uS(t,o,i);u[r>>2]=t;v=e;return n|0}function uS(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1916;u[r+12>>2]=e;u[n+4>>2]=r;return}function oS(n){n=n|0;WE(n);XE(n);return}function aS(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function fS(n){n=n|0;XE(n);return}function cS(){var n=0;if(!(t[8088]|0)){mS(11076);xn(25,11076,b|0)|0;n=8088;u[n>>2]=1;u[n+4>>2]=0}return 11076}function lS(n,e){n=n|0;e=e|0;u[n>>2]=sS()|0;u[n+4>>2]=dS()|0;u[n+12>>2]=e;u[n+8>>2]=_S()|0;u[n+32>>2]=10;return}function sS(){return 11745}function dS(){return 1940}function _S(){return Ym()|0}function vS(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){pS(r);XE(r)}}else if(e|0)XE(e);return}function pS(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function mS(n){n=n|0;Rf(n);return}function bS(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function hS(n){n=n|0;return u[n>>2]|0}function yS(n){n=n|0;return t[u[n>>2]>>0]|0}function wS(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;u[t>>2]=u[n>>2];MS(e,t)|0;v=r;return}function MS(n,e){n=n|0;e=e|0;var r=0;r=kS(u[n>>2]|0,e)|0;e=n+4|0;u[(u[e>>2]|0)+8>>2]=r;return u[(u[e>>2]|0)+8>>2]|0}function kS(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;gS(t);n=ko(n)|0;e=TS(n,u[e>>2]|0)|0;AS(t);v=r;return e|0}function gS(n){n=n|0;u[n>>2]=u[2701];u[n+4>>2]=u[2703];return}function TS(n,e){n=n|0;e=e|0;var r=0;r=Ao(SS()|0)|0;return ue(0,r|0,n|0,XM(e)|0)|0}function AS(n){n=n|0;nT(u[n>>2]|0,u[n+4>>2]|0);return}function SS(){var n=0;if(!(t[8096]|0)){ES(11120);n=8096;u[n>>2]=1;u[n+4>>2]=0}return 11120}function ES(n){n=n|0;xo(n,CS()|0,1);return}function CS(){return 1948}function LS(){RS();return}function RS(){var n=0,e=0,r=0,i=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0;h=v;v=v+16|0;_=h+4|0;p=h;Nn(65536,10804,u[2702]|0,10812);r=AM()|0;e=u[r>>2]|0;n=u[e>>2]|0;if(n|0){i=u[r+8>>2]|0;r=u[r+4>>2]|0;while(1){Yn(n|0,o[r>>0]|0|0,t[i>>0]|0);e=e+4|0;n=u[e>>2]|0;if(!n)break;else{i=i+1|0;r=r+1|0}}}n=EM()|0;e=u[n>>2]|0;if(e|0)do{Vn(e|0,u[n+4>>2]|0);n=n+8|0;e=u[n>>2]|0}while((e|0)!=0);Vn(PS()|0,5167);d=sM()|0;n=u[d>>2]|0;n:do{if(n|0){do{BS(u[n+4>>2]|0);n=u[n>>2]|0}while((n|0)!=0);n=u[d>>2]|0;if(n|0){s=d;do{while(1){a=n;n=u[n>>2]|0;a=u[a+4>>2]|0;if(!(OS(a)|0))break;u[p>>2]=s;u[_>>2]=u[p>>2];NS(d,_)|0;if(!n)break n}IS(a);s=u[s>>2]|0;e=FS(a)|0;f=Zn()|0;c=v;v=v+((1*(e<<2)|0)+15&-16)|0;l=v;v=v+((1*(e<<2)|0)+15&-16)|0;e=u[(Ck(a)|0)>>2]|0;if(e|0){r=c;i=l;while(1){u[r>>2]=u[(Sk(u[e+4>>2]|0)|0)>>2];u[i>>2]=u[e+8>>2];e=u[e>>2]|0;if(!e)break;else{r=r+4|0;i=i+4|0}}}y=Sk(a)|0;e=xS(a)|0;r=FS(a)|0;i=US(a)|0;Gn(y|0,e|0,c|0,l|0,r|0,i|0,kM(a)|0);Fn(f|0)}while((n|0)!=0)}}}while(0);n=u[(TM()|0)>>2]|0;if(n|0)do{y=n+4|0;d=PM(y)|0;a=FM(d)|0;f=BM(d)|0;c=(OM(d)|0)+1|0;l=HS(d)|0;s=DS(y)|0;d=Ja(d)|0;_=UM(y)|0;p=WS(y)|0;qn(0,a|0,f|0,c|0,l|0,s|0,d|0,_|0,p|0,YS(y)|0);n=u[n>>2]|0}while((n|0)!=0);n=u[(sM()|0)>>2]|0;n:do{if(n|0){e:while(1){e=u[n+4>>2]|0;if(e|0?(m=u[(Sk(e)|0)>>2]|0,b=u[(Pk(e)|0)>>2]|0,b|0):0){r=b;do{e=r+4|0;i=PM(e)|0;r:do{if(i|0)switch(Ja(i)|0){case 0:break e;case 4:case 3:case 2:{l=FM(i)|0;s=BM(i)|0;d=(OM(i)|0)+1|0;_=HS(i)|0;p=Ja(i)|0;y=UM(e)|0;qn(m|0,l|0,s|0,d|0,_|0,0,p|0,y|0,WS(e)|0,YS(e)|0);break r}case 1:{c=FM(i)|0;l=BM(i)|0;s=(OM(i)|0)+1|0;d=HS(i)|0;_=DS(e)|0;p=Ja(i)|0;y=UM(e)|0;qn(m|0,c|0,l|0,s|0,d|0,_|0,p|0,y|0,WS(e)|0,YS(e)|0);break r}case 5:{d=FM(i)|0;_=BM(i)|0;p=(OM(i)|0)+1|0;y=HS(i)|0;qn(m|0,d|0,_|0,p|0,y|0,VS(i)|0,Ja(i)|0,0,0,0);break r}default:break r}}while(0);r=u[r>>2]|0}while((r|0)!=0)}n=u[n>>2]|0;if(!n)break n}Xn()}}while(0);Kn();v=h;return}function PS(){return 11703}function BS(n){n=n|0;t[n+40>>0]=0;return}function OS(n){n=n|0;return(t[n+40>>0]|0)!=0|0}function NS(n,e){n=n|0;e=e|0;e=jS(e)|0;n=u[e>>2]|0;u[e>>2]=u[n>>2];XE(n);return u[e>>2]|0}function IS(n){n=n|0;t[n+40>>0]=1;return}function FS(n){n=n|0;return u[n+20>>2]|0}function xS(n){n=n|0;return u[n+8>>2]|0}function US(n){n=n|0;return u[n+32>>2]|0}function HS(n){n=n|0;return u[n+4>>2]|0}function DS(n){n=n|0;return u[n+4>>2]|0}function WS(n){n=n|0;return u[n+8>>2]|0}function YS(n){n=n|0;return u[n+16>>2]|0}function VS(n){n=n|0;return u[n+20>>2]|0}function jS(n){n=n|0;return u[n>>2]|0}function qS(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0,M=0,k=0,g=0;g=v;v=v+16|0;_=g;do{if(n>>>0<245){l=n>>>0<11?16:n+11&-8;n=l>>>3;d=u[2783]|0;r=d>>>n;if(r&3|0){e=(r&1^1)+n|0;n=11172+(e<<1<<2)|0;r=n+8|0;t=u[r>>2]|0;i=t+8|0;o=u[i>>2]|0;if((n|0)==(o|0))u[2783]=d&~(1<<e);else{u[o+12>>2]=n;u[r>>2]=o}k=e<<3;u[t+4>>2]=k|3;k=t+k+4|0;u[k>>2]=u[k>>2]|1;k=i;v=g;return k|0}s=u[2785]|0;if(l>>>0>s>>>0){if(r|0){e=2<<n;e=r<<n&(e|0-e);e=(e&0-e)+-1|0;a=e>>>12&16;e=e>>>a;r=e>>>5&8;e=e>>>r;i=e>>>2&4;e=e>>>i;n=e>>>1&2;e=e>>>n;t=e>>>1&1;t=(r|a|i|n|t)+(e>>>t)|0;e=11172+(t<<1<<2)|0;n=e+8|0;i=u[n>>2]|0;a=i+8|0;r=u[a>>2]|0;if((e|0)==(r|0)){n=d&~(1<<t);u[2783]=n}else{u[r+12>>2]=e;u[n>>2]=r;n=d}o=(t<<3)-l|0;u[i+4>>2]=l|3;t=i+l|0;u[t+4>>2]=o|1;u[t+o>>2]=o;if(s|0){i=u[2788]|0;e=s>>>3;r=11172+(e<<1<<2)|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=i;u[e+12>>2]=i;u[i+8>>2]=e;u[i+12>>2]=r}u[2785]=o;u[2788]=t;k=a;v=g;return k|0}f=u[2784]|0;if(f){r=(f&0-f)+-1|0;a=r>>>12&16;r=r>>>a;o=r>>>5&8;r=r>>>o;c=r>>>2&4;r=r>>>c;t=r>>>1&2;r=r>>>t;n=r>>>1&1;n=u[11436+((o|a|c|t|n)+(r>>>n)<<2)>>2]|0;r=(u[n+4>>2]&-8)-l|0;t=u[n+16+(((u[n+16>>2]|0)==0&1)<<2)>>2]|0;if(!t){c=n;o=r}else{do{a=(u[t+4>>2]&-8)-l|0;c=a>>>0<r>>>0;r=c?a:r;n=c?t:n;t=u[t+16+(((u[t+16>>2]|0)==0&1)<<2)>>2]|0}while((t|0)!=0);c=n;o=r}a=c+l|0;if(c>>>0<a>>>0){i=u[c+24>>2]|0;e=u[c+12>>2]|0;do{if((e|0)==(c|0)){n=c+20|0;e=u[n>>2]|0;if(!e){n=c+16|0;e=u[n>>2]|0;if(!e){r=0;break}}while(1){r=e+20|0;t=u[r>>2]|0;if(t|0){e=t;n=r;continue}r=e+16|0;t=u[r>>2]|0;if(!t)break;else{e=t;n=r}}u[n>>2]=0;r=e}else{r=u[c+8>>2]|0;u[r+12>>2]=e;u[e+8>>2]=r;r=e}}while(0);do{if(i|0){e=u[c+28>>2]|0;n=11436+(e<<2)|0;if((c|0)==(u[n>>2]|0)){u[n>>2]=r;if(!r){u[2784]=f&~(1<<e);break}}else{u[i+16+(((u[i+16>>2]|0)!=(c|0)&1)<<2)>>2]=r;if(!r)break}u[r+24>>2]=i;e=u[c+16>>2]|0;if(e|0){u[r+16>>2]=e;u[e+24>>2]=r}e=u[c+20>>2]|0;if(e|0){u[r+20>>2]=e;u[e+24>>2]=r}}}while(0);if(o>>>0<16){k=o+l|0;u[c+4>>2]=k|3;k=c+k+4|0;u[k>>2]=u[k>>2]|1}else{u[c+4>>2]=l|3;u[a+4>>2]=o|1;u[a+o>>2]=o;if(s|0){t=u[2788]|0;e=s>>>3;r=11172+(e<<1<<2)|0;e=1<<e;if(!(d&e)){u[2783]=d|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=t;u[e+12>>2]=t;u[t+8>>2]=e;u[t+12>>2]=r}u[2785]=o;u[2788]=a}k=c+8|0;v=g;return k|0}else d=l}else d=l}else d=l}else if(n>>>0<=4294967231){n=n+11|0;l=n&-8;c=u[2784]|0;if(c){t=0-l|0;n=n>>>8;if(n){if(l>>>0>16777215)f=31;else{d=(n+1048320|0)>>>16&8;M=n<<d;s=(M+520192|0)>>>16&4;M=M<<s;f=(M+245760|0)>>>16&2;f=14-(s|d|f)+(M<<f>>>15)|0;f=l>>>(f+7|0)&1|f<<1}}else f=0;r=u[11436+(f<<2)>>2]|0;n:do{if(!r){r=0;n=0;M=57}else{n=0;a=l<<((f|0)==31?0:25-(f>>>1)|0);o=0;while(1){i=(u[r+4>>2]&-8)-l|0;if(i>>>0<t>>>0)if(!i){n=r;t=0;i=r;M=61;break n}else{n=r;t=i}i=u[r+20>>2]|0;r=u[r+16+(a>>>31<<2)>>2]|0;o=(i|0)==0|(i|0)==(r|0)?o:i;i=(r|0)==0;if(i){r=o;M=57;break}else a=a<<((i^1)&1)}}}while(0);if((M|0)==57){if((r|0)==0&(n|0)==0){n=2<<f;n=c&(n|0-n);if(!n){d=l;break}d=(n&0-n)+-1|0;a=d>>>12&16;d=d>>>a;o=d>>>5&8;d=d>>>o;f=d>>>2&4;d=d>>>f;s=d>>>1&2;d=d>>>s;r=d>>>1&1;n=0;r=u[11436+((o|a|f|s|r)+(d>>>r)<<2)>>2]|0}if(!r){f=n;a=t}else{i=r;M=61}}if((M|0)==61)while(1){M=0;r=(u[i+4>>2]&-8)-l|0;d=r>>>0<t>>>0;r=d?r:t;n=d?i:n;i=u[i+16+(((u[i+16>>2]|0)==0&1)<<2)>>2]|0;if(!i){f=n;a=r;break}else{t=r;M=61}}if((f|0)!=0?a>>>0<((u[2785]|0)-l|0)>>>0:0){o=f+l|0;if(f>>>0>=o>>>0){k=0;v=g;return k|0}i=u[f+24>>2]|0;e=u[f+12>>2]|0;do{if((e|0)==(f|0)){n=f+20|0;e=u[n>>2]|0;if(!e){n=f+16|0;e=u[n>>2]|0;if(!e){e=0;break}}while(1){r=e+20|0;t=u[r>>2]|0;if(t|0){e=t;n=r;continue}r=e+16|0;t=u[r>>2]|0;if(!t)break;else{e=t;n=r}}u[n>>2]=0}else{k=u[f+8>>2]|0;u[k+12>>2]=e;u[e+8>>2]=k}}while(0);do{if(i){n=u[f+28>>2]|0;r=11436+(n<<2)|0;if((f|0)==(u[r>>2]|0)){u[r>>2]=e;if(!e){t=c&~(1<<n);u[2784]=t;break}}else{u[i+16+(((u[i+16>>2]|0)!=(f|0)&1)<<2)>>2]=e;if(!e){t=c;break}}u[e+24>>2]=i;n=u[f+16>>2]|0;if(n|0){u[e+16>>2]=n;u[n+24>>2]=e}n=u[f+20>>2]|0;if(n){u[e+20>>2]=n;u[n+24>>2]=e;t=c}else t=c}else t=c}while(0);do{if(a>>>0>=16){u[f+4>>2]=l|3;u[o+4>>2]=a|1;u[o+a>>2]=a;e=a>>>3;if(a>>>0<256){r=11172+(e<<1<<2)|0;n=u[2783]|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=o;u[e+12>>2]=o;u[o+8>>2]=e;u[o+12>>2]=r;break}e=a>>>8;if(e){if(a>>>0>16777215)e=31;else{M=(e+1048320|0)>>>16&8;k=e<<M;w=(k+520192|0)>>>16&4;k=k<<w;e=(k+245760|0)>>>16&2;e=14-(w|M|e)+(k<<e>>>15)|0;e=a>>>(e+7|0)&1|e<<1}}else e=0;r=11436+(e<<2)|0;u[o+28>>2]=e;n=o+16|0;u[n+4>>2]=0;u[n>>2]=0;n=1<<e;if(!(t&n)){u[2784]=t|n;u[r>>2]=o;u[o+24>>2]=r;u[o+12>>2]=o;u[o+8>>2]=o;break}n=a<<((e|0)==31?0:25-(e>>>1)|0);r=u[r>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(a|0)){M=97;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){M=96;break}else{n=n<<1;r=e}}if((M|0)==96){u[t>>2]=o;u[o+24>>2]=r;u[o+12>>2]=o;u[o+8>>2]=o;break}else if((M|0)==97){M=r+8|0;k=u[M>>2]|0;u[k+12>>2]=o;u[M>>2]=o;u[o+8>>2]=k;u[o+12>>2]=r;u[o+24>>2]=0;break}}else{k=a+l|0;u[f+4>>2]=k|3;k=f+k+4|0;u[k>>2]=u[k>>2]|1}}while(0);k=f+8|0;v=g;return k|0}else d=l}else d=l}else d=-1}while(0);r=u[2785]|0;if(r>>>0>=d>>>0){e=r-d|0;n=u[2788]|0;if(e>>>0>15){k=n+d|0;u[2788]=k;u[2785]=e;u[k+4>>2]=e|1;u[k+e>>2]=e;u[n+4>>2]=d|3}else{u[2785]=0;u[2788]=0;u[n+4>>2]=r|3;k=n+r+4|0;u[k>>2]=u[k>>2]|1}k=n+8|0;v=g;return k|0}a=u[2786]|0;if(a>>>0>d>>>0){w=a-d|0;u[2786]=w;k=u[2789]|0;M=k+d|0;u[2789]=M;u[M+4>>2]=w|1;u[k+4>>2]=d|3;k=k+8|0;v=g;return k|0}if(!(u[2901]|0)){u[2903]=4096;u[2902]=4096;u[2904]=-1;u[2905]=-1;u[2906]=0;u[2894]=0;n=_&-16^1431655768;u[_>>2]=n;u[2901]=n;n=4096}else n=u[2903]|0;f=d+48|0;c=d+47|0;o=n+c|0;i=0-n|0;l=o&i;if(l>>>0<=d>>>0){k=0;v=g;return k|0}n=u[2893]|0;if(n|0?(s=u[2891]|0,_=s+l|0,_>>>0<=s>>>0|_>>>0>n>>>0):0){k=0;v=g;return k|0}n:do{if(!(u[2894]&4)){r=u[2789]|0;e:do{if(r){t=11580;while(1){n=u[t>>2]|0;if(n>>>0<=r>>>0?(b=t+4|0,(n+(u[b>>2]|0)|0)>>>0>r>>>0):0)break;n=u[t+8>>2]|0;if(!n){M=118;break e}else t=n}e=o-a&i;if(e>>>0<2147483647){n=fC(e|0)|0;if((n|0)==((u[t>>2]|0)+(u[b>>2]|0)|0)){if((n|0)!=(-1|0)){a=e;o=n;M=135;break n}}else{t=n;M=126}}else e=0}else M=118}while(0);do{if((M|0)==118){r=fC(0)|0;if((r|0)!=(-1|0)?(e=r,p=u[2902]|0,m=p+-1|0,e=((m&e|0)==0?0:(m+e&0-p)-e|0)+l|0,p=u[2891]|0,m=e+p|0,e>>>0>d>>>0&e>>>0<2147483647):0){b=u[2893]|0;if(b|0?m>>>0<=p>>>0|m>>>0>b>>>0:0){e=0;break}n=fC(e|0)|0;if((n|0)==(r|0)){a=e;o=r;M=135;break n}else{t=n;M=126}}else e=0}}while(0);do{if((M|0)==126){r=0-e|0;if(!(f>>>0>e>>>0&(e>>>0<2147483647&(t|0)!=(-1|0))))if((t|0)==(-1|0)){e=0;break}else{a=e;o=t;M=135;break n}n=u[2903]|0;n=c-e+n&0-n;if(n>>>0>=2147483647){a=e;o=t;M=135;break n}if((fC(n|0)|0)==(-1|0)){fC(r|0)|0;e=0;break}else{a=n+e|0;o=t;M=135;break n}}}while(0);u[2894]=u[2894]|4;M=133}else{e=0;M=133}}while(0);if(((M|0)==133?l>>>0<2147483647:0)?(w=fC(l|0)|0,b=fC(0)|0,h=b-w|0,y=h>>>0>(d+40|0)>>>0,!((w|0)==(-1|0)|y^1|w>>>0<b>>>0&((w|0)!=(-1|0)&(b|0)!=(-1|0))^1)):0){a=y?h:e;o=w;M=135}if((M|0)==135){e=(u[2891]|0)+a|0;u[2891]=e;if(e>>>0>(u[2892]|0)>>>0)u[2892]=e;c=u[2789]|0;do{if(c){e=11580;while(1){n=u[e>>2]|0;r=e+4|0;t=u[r>>2]|0;if((o|0)==(n+t|0)){M=145;break}i=u[e+8>>2]|0;if(!i)break;else e=i}if(((M|0)==145?(u[e+12>>2]&8|0)==0:0)?c>>>0<o>>>0&c>>>0>=n>>>0:0){u[r>>2]=t+a;k=c+8|0;k=(k&7|0)==0?0:0-k&7;M=c+k|0;k=(u[2786]|0)+(a-k)|0;u[2789]=M;u[2786]=k;u[M+4>>2]=k|1;u[M+k+4>>2]=40;u[2790]=u[2905];break}if(o>>>0<(u[2787]|0)>>>0)u[2787]=o;r=o+a|0;e=11580;while(1){if((u[e>>2]|0)==(r|0)){M=153;break}n=u[e+8>>2]|0;if(!n)break;else e=n}if((M|0)==153?(u[e+12>>2]&8|0)==0:0){u[e>>2]=o;s=e+4|0;u[s>>2]=(u[s>>2]|0)+a;s=o+8|0;s=o+((s&7|0)==0?0:0-s&7)|0;e=r+8|0;e=r+((e&7|0)==0?0:0-e&7)|0;l=s+d|0;f=e-s-d|0;u[s+4>>2]=d|3;do{if((e|0)!=(c|0)){if((e|0)==(u[2788]|0)){k=(u[2785]|0)+f|0;u[2785]=k;u[2788]=l;u[l+4>>2]=k|1;u[l+k>>2]=k;break}n=u[e+4>>2]|0;if((n&3|0)==1){a=n&-8;t=n>>>3;n:do{if(n>>>0<256){n=u[e+8>>2]|0;r=u[e+12>>2]|0;if((r|0)==(n|0)){u[2783]=u[2783]&~(1<<t);break}else{u[n+12>>2]=r;u[r+8>>2]=n;break}}else{o=u[e+24>>2]|0;n=u[e+12>>2]|0;do{if((n|0)==(e|0)){t=e+16|0;r=t+4|0;n=u[r>>2]|0;if(!n){n=u[t>>2]|0;if(!n){n=0;break}else r=t}while(1){t=n+20|0;i=u[t>>2]|0;if(i|0){n=i;r=t;continue}t=n+16|0;i=u[t>>2]|0;if(!i)break;else{n=i;r=t}}u[r>>2]=0}else{k=u[e+8>>2]|0;u[k+12>>2]=n;u[n+8>>2]=k}}while(0);if(!o)break;r=u[e+28>>2]|0;t=11436+(r<<2)|0;do{if((e|0)!=(u[t>>2]|0)){u[o+16+(((u[o+16>>2]|0)!=(e|0)&1)<<2)>>2]=n;if(!n)break n}else{u[t>>2]=n;if(n|0)break;u[2784]=u[2784]&~(1<<r);break n}}while(0);u[n+24>>2]=o;r=e+16|0;t=u[r>>2]|0;if(t|0){u[n+16>>2]=t;u[t+24>>2]=n}r=u[r+4>>2]|0;if(!r)break;u[n+20>>2]=r;u[r+24>>2]=n}}while(0);e=e+a|0;i=a+f|0}else i=f;e=e+4|0;u[e>>2]=u[e>>2]&-2;u[l+4>>2]=i|1;u[l+i>>2]=i;e=i>>>3;if(i>>>0<256){r=11172+(e<<1<<2)|0;n=u[2783]|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=l;u[e+12>>2]=l;u[l+8>>2]=e;u[l+12>>2]=r;break}e=i>>>8;do{if(!e)e=0;else{if(i>>>0>16777215){e=31;break}M=(e+1048320|0)>>>16&8;k=e<<M;w=(k+520192|0)>>>16&4;k=k<<w;e=(k+245760|0)>>>16&2;e=14-(w|M|e)+(k<<e>>>15)|0;e=i>>>(e+7|0)&1|e<<1}}while(0);t=11436+(e<<2)|0;u[l+28>>2]=e;n=l+16|0;u[n+4>>2]=0;u[n>>2]=0;n=u[2784]|0;r=1<<e;if(!(n&r)){u[2784]=n|r;u[t>>2]=l;u[l+24>>2]=t;u[l+12>>2]=l;u[l+8>>2]=l;break}n=i<<((e|0)==31?0:25-(e>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(i|0)){M=194;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){M=193;break}else{n=n<<1;r=e}}if((M|0)==193){u[t>>2]=l;u[l+24>>2]=r;u[l+12>>2]=l;u[l+8>>2]=l;break}else if((M|0)==194){M=r+8|0;k=u[M>>2]|0;u[k+12>>2]=l;u[M>>2]=l;u[l+8>>2]=k;u[l+12>>2]=r;u[l+24>>2]=0;break}}else{k=(u[2786]|0)+f|0;u[2786]=k;u[2789]=l;u[l+4>>2]=k|1}}while(0);k=s+8|0;v=g;return k|0}e=11580;while(1){n=u[e>>2]|0;if(n>>>0<=c>>>0?(k=n+(u[e+4>>2]|0)|0,k>>>0>c>>>0):0)break;e=u[e+8>>2]|0}i=k+-47|0;n=i+8|0;n=i+((n&7|0)==0?0:0-n&7)|0;i=c+16|0;n=n>>>0<i>>>0?c:n;e=n+8|0;r=o+8|0;r=(r&7|0)==0?0:0-r&7;M=o+r|0;r=a+-40-r|0;u[2789]=M;u[2786]=r;u[M+4>>2]=r|1;u[M+r+4>>2]=40;u[2790]=u[2905];r=n+4|0;u[r>>2]=27;u[e>>2]=u[2895];u[e+4>>2]=u[2896];u[e+8>>2]=u[2897];u[e+12>>2]=u[2898];u[2895]=o;u[2896]=a;u[2898]=0;u[2897]=e;e=n+24|0;do{M=e;e=e+4|0;u[e>>2]=7}while((M+8|0)>>>0<k>>>0);if((n|0)!=(c|0)){o=n-c|0;u[r>>2]=u[r>>2]&-2;u[c+4>>2]=o|1;u[n>>2]=o;e=o>>>3;if(o>>>0<256){r=11172+(e<<1<<2)|0;n=u[2783]|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=c;u[e+12>>2]=c;u[c+8>>2]=e;u[c+12>>2]=r;break}e=o>>>8;if(e){if(o>>>0>16777215)r=31;else{M=(e+1048320|0)>>>16&8;k=e<<M;w=(k+520192|0)>>>16&4;k=k<<w;r=(k+245760|0)>>>16&2;r=14-(w|M|r)+(k<<r>>>15)|0;r=o>>>(r+7|0)&1|r<<1}}else r=0;t=11436+(r<<2)|0;u[c+28>>2]=r;u[c+20>>2]=0;u[i>>2]=0;e=u[2784]|0;n=1<<r;if(!(e&n)){u[2784]=e|n;u[t>>2]=c;u[c+24>>2]=t;u[c+12>>2]=c;u[c+8>>2]=c;break}n=o<<((r|0)==31?0:25-(r>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(o|0)){M=216;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){M=215;break}else{n=n<<1;r=e}}if((M|0)==215){u[t>>2]=c;u[c+24>>2]=r;u[c+12>>2]=c;u[c+8>>2]=c;break}else if((M|0)==216){M=r+8|0;k=u[M>>2]|0;u[k+12>>2]=c;u[M>>2]=c;u[c+8>>2]=k;u[c+12>>2]=r;u[c+24>>2]=0;break}}}else{k=u[2787]|0;if((k|0)==0|o>>>0<k>>>0)u[2787]=o;u[2895]=o;u[2896]=a;u[2898]=0;u[2792]=u[2901];u[2791]=-1;e=0;do{k=11172+(e<<1<<2)|0;u[k+12>>2]=k;u[k+8>>2]=k;e=e+1|0}while((e|0)!=32);k=o+8|0;k=(k&7|0)==0?0:0-k&7;M=o+k|0;k=a+-40-k|0;u[2789]=M;u[2786]=k;u[M+4>>2]=k|1;u[M+k+4>>2]=40;u[2790]=u[2905]}}while(0);e=u[2786]|0;if(e>>>0>d>>>0){w=e-d|0;u[2786]=w;k=u[2789]|0;M=k+d|0;u[2789]=M;u[M+4>>2]=w|1;u[k+4>>2]=d|3;k=k+8|0;v=g;return k|0}}u[(QS()|0)>>2]=12;k=0;v=g;return k|0}function zS(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0;if(!n)return;r=n+-8|0;i=u[2787]|0;n=u[n+-4>>2]|0;e=n&-8;c=r+e|0;do{if(!(n&1)){t=u[r>>2]|0;if(!(n&3))return;a=r+(0-t)|0;o=t+e|0;if(a>>>0<i>>>0)return;if((a|0)==(u[2788]|0)){n=c+4|0;e=u[n>>2]|0;if((e&3|0)!=3){f=a;e=o;break}u[2785]=o;u[n>>2]=e&-2;u[a+4>>2]=o|1;u[a+o>>2]=o;return}r=t>>>3;if(t>>>0<256){n=u[a+8>>2]|0;e=u[a+12>>2]|0;if((e|0)==(n|0)){u[2783]=u[2783]&~(1<<r);f=a;e=o;break}else{u[n+12>>2]=e;u[e+8>>2]=n;f=a;e=o;break}}i=u[a+24>>2]|0;n=u[a+12>>2]|0;do{if((n|0)==(a|0)){r=a+16|0;e=r+4|0;n=u[e>>2]|0;if(!n){n=u[r>>2]|0;if(!n){n=0;break}else e=r}while(1){r=n+20|0;t=u[r>>2]|0;if(t|0){n=t;e=r;continue}r=n+16|0;t=u[r>>2]|0;if(!t)break;else{n=t;e=r}}u[e>>2]=0}else{f=u[a+8>>2]|0;u[f+12>>2]=n;u[n+8>>2]=f}}while(0);if(i){e=u[a+28>>2]|0;r=11436+(e<<2)|0;if((a|0)==(u[r>>2]|0)){u[r>>2]=n;if(!n){u[2784]=u[2784]&~(1<<e);f=a;e=o;break}}else{u[i+16+(((u[i+16>>2]|0)!=(a|0)&1)<<2)>>2]=n;if(!n){f=a;e=o;break}}u[n+24>>2]=i;e=a+16|0;r=u[e>>2]|0;if(r|0){u[n+16>>2]=r;u[r+24>>2]=n}e=u[e+4>>2]|0;if(e){u[n+20>>2]=e;u[e+24>>2]=n;f=a;e=o}else{f=a;e=o}}else{f=a;e=o}}else{f=r;a=r}}while(0);if(a>>>0>=c>>>0)return;n=c+4|0;t=u[n>>2]|0;if(!(t&1))return;if(!(t&2)){n=u[2788]|0;if((c|0)==(u[2789]|0)){c=(u[2786]|0)+e|0;u[2786]=c;u[2789]=f;u[f+4>>2]=c|1;if((f|0)!=(n|0))return;u[2788]=0;u[2785]=0;return}if((c|0)==(n|0)){c=(u[2785]|0)+e|0;u[2785]=c;u[2788]=a;u[f+4>>2]=c|1;u[a+c>>2]=c;return}i=(t&-8)+e|0;r=t>>>3;do{if(t>>>0<256){e=u[c+8>>2]|0;n=u[c+12>>2]|0;if((n|0)==(e|0)){u[2783]=u[2783]&~(1<<r);break}else{u[e+12>>2]=n;u[n+8>>2]=e;break}}else{o=u[c+24>>2]|0;n=u[c+12>>2]|0;do{if((n|0)==(c|0)){r=c+16|0;e=r+4|0;n=u[e>>2]|0;if(!n){n=u[r>>2]|0;if(!n){r=0;break}else e=r}while(1){r=n+20|0;t=u[r>>2]|0;if(t|0){n=t;e=r;continue}r=n+16|0;t=u[r>>2]|0;if(!t)break;else{n=t;e=r}}u[e>>2]=0;r=n}else{r=u[c+8>>2]|0;u[r+12>>2]=n;u[n+8>>2]=r;r=n}}while(0);if(o|0){n=u[c+28>>2]|0;e=11436+(n<<2)|0;if((c|0)==(u[e>>2]|0)){u[e>>2]=r;if(!r){u[2784]=u[2784]&~(1<<n);break}}else{u[o+16+(((u[o+16>>2]|0)!=(c|0)&1)<<2)>>2]=r;if(!r)break}u[r+24>>2]=o;n=c+16|0;e=u[n>>2]|0;if(e|0){u[r+16>>2]=e;u[e+24>>2]=r}n=u[n+4>>2]|0;if(n|0){u[r+20>>2]=n;u[n+24>>2]=r}}}}while(0);u[f+4>>2]=i|1;u[a+i>>2]=i;if((f|0)==(u[2788]|0)){u[2785]=i;return}}else{u[n>>2]=t&-2;u[f+4>>2]=e|1;u[a+e>>2]=e;i=e}n=i>>>3;if(i>>>0<256){r=11172+(n<<1<<2)|0;e=u[2783]|0;n=1<<n;if(!(e&n)){u[2783]=e|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=f;u[n+12>>2]=f;u[f+8>>2]=n;u[f+12>>2]=r;return}n=i>>>8;if(n){if(i>>>0>16777215)n=31;else{a=(n+1048320|0)>>>16&8;c=n<<a;o=(c+520192|0)>>>16&4;c=c<<o;n=(c+245760|0)>>>16&2;n=14-(o|a|n)+(c<<n>>>15)|0;n=i>>>(n+7|0)&1|n<<1}}else n=0;t=11436+(n<<2)|0;u[f+28>>2]=n;u[f+20>>2]=0;u[f+16>>2]=0;e=u[2784]|0;r=1<<n;do{if(e&r){e=i<<((n|0)==31?0:25-(n>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(i|0)){n=73;break}t=r+16+(e>>>31<<2)|0;n=u[t>>2]|0;if(!n){n=72;break}else{e=e<<1;r=n}}if((n|0)==72){u[t>>2]=f;u[f+24>>2]=r;u[f+12>>2]=f;u[f+8>>2]=f;break}else if((n|0)==73){a=r+8|0;c=u[a>>2]|0;u[c+12>>2]=f;u[a>>2]=f;u[f+8>>2]=c;u[f+12>>2]=r;u[f+24>>2]=0;break}}else{u[2784]=e|r;u[t>>2]=f;u[f+24>>2]=t;u[f+12>>2]=f;u[f+8>>2]=f}}while(0);c=(u[2791]|0)+-1|0;u[2791]=c;if(!c)n=11588;else return;while(1){n=u[n>>2]|0;if(!n)break;else n=n+8|0}u[2791]=-1;return}function GS(){return 11628}function KS(n){n=n|0;var e=0,r=0;e=v;v=v+16|0;r=e;u[r>>2]=eE(u[n+60>>2]|0)|0;n=ZS(ae(6,r|0)|0)|0;v=e;return n|0}function XS(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;d=v;v=v+48|0;l=d+16|0;o=d;i=d+32|0;f=n+28|0;t=u[f>>2]|0;u[i>>2]=t;c=n+20|0;t=(u[c>>2]|0)-t|0;u[i+4>>2]=t;u[i+8>>2]=e;u[i+12>>2]=r;t=t+r|0;a=n+60|0;u[o>>2]=u[a>>2];u[o+4>>2]=i;u[o+8>>2]=2;o=ZS(le(146,o|0)|0)|0;n:do{if((t|0)!=(o|0)){e=2;while(1){if((o|0)<0)break;t=t-o|0;p=u[i+4>>2]|0;_=o>>>0>p>>>0;i=_?i+8|0:i;e=(_<<31>>31)+e|0;p=o-(_?p:0)|0;u[i>>2]=(u[i>>2]|0)+p;_=i+4|0;u[_>>2]=(u[_>>2]|0)-p;u[l>>2]=u[a>>2];u[l+4>>2]=i;u[l+8>>2]=e;o=ZS(le(146,l|0)|0)|0;if((t|0)==(o|0)){s=3;break n}}u[n+16>>2]=0;u[f>>2]=0;u[c>>2]=0;u[n>>2]=u[n>>2]|32;if((e|0)==2)r=0;else r=r-(u[i+4>>2]|0)|0}else s=3}while(0);if((s|0)==3){p=u[n+44>>2]|0;u[n+16>>2]=p+(u[n+48>>2]|0);u[f>>2]=p;u[c>>2]=p}v=d;return r|0}function JS(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;i=v;v=v+32|0;o=i;t=i+20|0;u[o>>2]=u[n+60>>2];u[o+4>>2]=0;u[o+8>>2]=e;u[o+12>>2]=t;u[o+16>>2]=r;if((ZS(ce(140,o|0)|0)|0)<0){u[t>>2]=-1;n=-1}else n=u[t>>2]|0;v=i;return n|0}function ZS(n){n=n|0;if(n>>>0>4294963200){u[(QS()|0)>>2]=0-n;n=-1}return n|0}function QS(){return($S()|0)+64|0}function $S(){return nE()|0}function nE(){return 2084}function eE(n){n=n|0;return n|0}function rE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0;o=v;v=v+32|0;i=o;u[n+36>>2]=1;if((u[n>>2]&64|0)==0?(u[i>>2]=u[n+60>>2],u[i+4>>2]=21523,u[i+8>>2]=o+16,Qn(54,i|0)|0):0)t[n+75>>0]=-1;i=XS(n,e,r)|0;v=o;return i|0}function tE(n,e){n=n|0;e=e|0;var r=0,i=0;r=t[n>>0]|0;i=t[e>>0]|0;if(r<<24>>24==0?1:r<<24>>24!=i<<24>>24)n=i;else{do{n=n+1|0;e=e+1|0;r=t[n>>0]|0;i=t[e>>0]|0}while(!(r<<24>>24==0?1:r<<24>>24!=i<<24>>24));n=i}return(r&255)-(n&255)|0}function iE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,u=0;n:do{if(!r)n=0;else{while(1){i=t[n>>0]|0;u=t[e>>0]|0;if(i<<24>>24!=u<<24>>24)break;r=r+-1|0;if(!r){n=0;break n}else{n=n+1|0;e=e+1|0}}n=(i&255)-(u&255)|0}}while(0);return n|0}function uE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0;h=v;v=v+224|0;d=h+120|0;_=h+80|0;m=h;b=h+136|0;i=_;o=i+40|0;do{u[i>>2]=0;i=i+4|0}while((i|0)<(o|0));u[d>>2]=u[r>>2];if((oE(0,e,d,m,_)|0)<0)r=-1;else{if((u[n+76>>2]|0)>-1)p=aE(n)|0;else p=0;r=u[n>>2]|0;s=r&32;if((t[n+74>>0]|0)<1)u[n>>2]=r&-33;i=n+48|0;if(!(u[i>>2]|0)){o=n+44|0;a=u[o>>2]|0;u[o>>2]=b;f=n+28|0;u[f>>2]=b;c=n+20|0;u[c>>2]=b;u[i>>2]=80;l=n+16|0;u[l>>2]=b+80;r=oE(n,e,d,m,_)|0;if(a){yL[u[n+36>>2]&7](n,0,0)|0;r=(u[c>>2]|0)==0?-1:r;u[o>>2]=a;u[i>>2]=0;u[l>>2]=0;u[f>>2]=0;u[c>>2]=0}}else r=oE(n,e,d,m,_)|0;i=u[n>>2]|0;u[n>>2]=i|s;if(p|0)fE(n);r=(i&32|0)==0?r:-1}v=h;return r|0}function oE(n,e,r,o,a){n=n|0;e=e|0;r=r|0;o=o|0;a=a|0;var f=0,c=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0,M=0,k=0,g=0,T=0,A=0,S=0,E=0,C=0,R=0,P=0,B=0,O=0;O=v;v=v+64|0;C=O+16|0;R=O;S=O+24|0;P=O+8|0;B=O+20|0;u[C>>2]=e;g=(n|0)!=0;T=S+40|0;A=T;S=S+39|0;E=P+4|0;c=0;f=0;p=0;n:while(1){do{if((f|0)>-1)if((c|0)>(2147483647-f|0)){u[(QS()|0)>>2]=75;f=-1;break}else{f=c+f|0;break}}while(0);c=t[e>>0]|0;if(!(c<<24>>24)){k=87;break}else s=e;e:while(1){switch(c<<24>>24){case 37:{c=s;k=9;break e}case 0:{c=s;break e}default:{}}M=s+1|0;u[C>>2]=M;c=t[M>>0]|0;s=M}e:do{if((k|0)==9)while(1){k=0;if((t[s+1>>0]|0)!=37)break e;c=c+1|0;s=s+2|0;u[C>>2]=s;if((t[s>>0]|0)==37)k=9;else break}}while(0);c=c-e|0;if(g)cE(n,e,c);if(c|0){e=s;continue}d=s+1|0;c=(t[d>>0]|0)+-48|0;if(c>>>0<10){M=(t[s+2>>0]|0)==36;w=M?c:-1;p=M?1:p;d=M?s+3|0:d}else w=-1;u[C>>2]=d;c=t[d>>0]|0;s=(c<<24>>24)+-32|0;e:do{if(s>>>0<32){_=0;m=c;while(1){c=1<<s;if(!(c&75913)){c=m;break e}_=c|_;d=d+1|0;u[C>>2]=d;c=t[d>>0]|0;s=(c<<24>>24)+-32|0;if(s>>>0>=32)break;else m=c}}else _=0}while(0);if(c<<24>>24==42){s=d+1|0;c=(t[s>>0]|0)+-48|0;if(c>>>0<10?(t[d+2>>0]|0)==36:0){u[a+(c<<2)>>2]=10;c=u[o+((t[s>>0]|0)+-48<<3)>>2]|0;p=1;d=d+3|0}else{if(p|0){f=-1;break}if(g){p=(u[r>>2]|0)+(4-1)&~(4-1);c=u[p>>2]|0;u[r>>2]=p+4;p=0;d=s}else{c=0;p=0;d=s}}u[C>>2]=d;M=(c|0)<0;c=M?0-c|0:c;_=M?_|8192:_}else{c=lE(C)|0;if((c|0)<0){f=-1;break}d=u[C>>2]|0}do{if((t[d>>0]|0)==46){if((t[d+1>>0]|0)!=42){u[C>>2]=d+1;s=lE(C)|0;d=u[C>>2]|0;break}m=d+2|0;s=(t[m>>0]|0)+-48|0;if(s>>>0<10?(t[d+3>>0]|0)==36:0){u[a+(s<<2)>>2]=10;s=u[o+((t[m>>0]|0)+-48<<3)>>2]|0;d=d+4|0;u[C>>2]=d;break}if(p|0){f=-1;break n}if(g){M=(u[r>>2]|0)+(4-1)&~(4-1);s=u[M>>2]|0;u[r>>2]=M+4}else s=0;u[C>>2]=m;d=m}else s=-1}while(0);y=0;while(1){if(((t[d>>0]|0)+-65|0)>>>0>57){f=-1;break n}M=d+1|0;u[C>>2]=M;m=t[(t[d>>0]|0)+-65+(5178+(y*58|0))>>0]|0;b=m&255;if((b+-1|0)>>>0<8){y=b;d=M}else break}if(!(m<<24>>24)){f=-1;break}h=(w|0)>-1;do{if(m<<24>>24==19){if(h){f=-1;break n}else k=49}else{if(h){u[a+(w<<2)>>2]=b;h=o+(w<<3)|0;w=u[h+4>>2]|0;k=R;u[k>>2]=u[h>>2];u[k+4>>2]=w;k=49;break}if(!g){f=0;break n}sE(R,b,r)}}while(0);if((k|0)==49?(k=0,!g):0){c=0;e=M;continue}d=t[d>>0]|0;d=(y|0)!=0&(d&15|0)==3?d&-33:d;h=_&-65537;w=(_&8192|0)==0?_:h;e:do{switch(d|0){case 110:switch((y&255)<<24>>24){case 0:{u[u[R>>2]>>2]=f;c=0;e=M;continue n}case 1:{u[u[R>>2]>>2]=f;c=0;e=M;continue n}case 2:{c=u[R>>2]|0;u[c>>2]=f;u[c+4>>2]=((f|0)<0)<<31>>31;c=0;e=M;continue n}case 3:{i[u[R>>2]>>1]=f;c=0;e=M;continue n}case 4:{t[u[R>>2]>>0]=f;c=0;e=M;continue n}case 6:{u[u[R>>2]>>2]=f;c=0;e=M;continue n}case 7:{c=u[R>>2]|0;u[c>>2]=f;u[c+4>>2]=((f|0)<0)<<31>>31;c=0;e=M;continue n}default:{c=0;e=M;continue n}}case 112:{d=120;s=s>>>0>8?s:8;e=w|8;k=61;break}case 88:case 120:{e=w;k=61;break}case 111:{d=R;e=u[d>>2]|0;d=u[d+4>>2]|0;b=_E(e,d,T)|0;h=A-b|0;_=0;m=5642;s=(w&8|0)==0|(s|0)>(h|0)?s:h+1|0;h=w;k=67;break}case 105:case 100:{d=R;e=u[d>>2]|0;d=u[d+4>>2]|0;if((d|0)<0){e=$E(0,0,e|0,d|0)|0;d=L;_=R;u[_>>2]=e;u[_+4>>2]=d;_=1;m=5642;k=66;break e}else{_=(w&2049|0)!=0&1;m=(w&2048|0)==0?(w&1|0)==0?5642:5644:5643;k=66;break e}}case 117:{d=R;_=0;m=5642;e=u[d>>2]|0;d=u[d+4>>2]|0;k=66;break}case 99:{t[S>>0]=u[R>>2];e=S;_=0;m=5642;b=T;d=1;s=h;break}case 109:{d=pE(u[(QS()|0)>>2]|0)|0;k=71;break}case 115:{d=u[R>>2]|0;d=d|0?d:5652;k=71;break}case 67:{u[P>>2]=u[R>>2];u[E>>2]=0;u[R>>2]=P;b=-1;d=P;k=75;break}case 83:{e=u[R>>2]|0;if(!s){bE(n,32,c,0,w);e=0;k=84}else{b=s;d=e;k=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=yE(n,+l[R>>3],c,s,w,d)|0;e=M;continue n}default:{_=0;m=5642;b=T;d=s;s=w}}}while(0);e:do{if((k|0)==61){w=R;y=u[w>>2]|0;w=u[w+4>>2]|0;b=dE(y,w,T,d&32)|0;m=(e&8|0)==0|(y|0)==0&(w|0)==0;_=m?0:2;m=m?5642:5642+(d>>4)|0;h=e;e=y;d=w;k=67}else if((k|0)==66){b=vE(e,d,T)|0;h=w;k=67}else if((k|0)==71){k=0;w=mE(d,0,s)|0;y=(w|0)==0;e=d;_=0;m=5642;b=y?d+s|0:w;d=y?s:w-d|0;s=h}else if((k|0)==75){k=0;m=d;e=0;s=0;while(1){_=u[m>>2]|0;if(!_)break;s=hE(B,_)|0;if((s|0)<0|s>>>0>(b-e|0)>>>0)break;e=s+e|0;if(b>>>0>e>>>0)m=m+4|0;else break}if((s|0)<0){f=-1;break n}bE(n,32,c,e,w);if(!e){e=0;k=84}else{_=0;while(1){s=u[d>>2]|0;if(!s){k=84;break e}s=hE(B,s)|0;_=s+_|0;if((_|0)>(e|0)){k=84;break e}cE(n,B,s);if(_>>>0>=e>>>0){k=84;break}else d=d+4|0}}}}while(0);if((k|0)==67){k=0;d=(e|0)!=0|(d|0)!=0;w=(s|0)!=0|d;d=((d^1)&1)+(A-b)|0;e=w?b:T;b=T;d=w?(s|0)>(d|0)?s:d:s;s=(s|0)>-1?h&-65537:h}else if((k|0)==84){k=0;bE(n,32,c,e,w^8192);c=(c|0)>(e|0)?c:e;e=M;continue}y=b-e|0;h=(d|0)<(y|0)?y:d;w=h+_|0;c=(c|0)<(w|0)?w:c;bE(n,32,c,w,s);cE(n,m,_);bE(n,48,c,w,s^65536);bE(n,48,h,y,0);cE(n,e,y);bE(n,32,c,w,s^8192);e=M}n:do{if((k|0)==87)if(!n)if(!p)f=0;else{f=1;while(1){e=u[a+(f<<2)>>2]|0;if(!e)break;sE(o+(f<<3)|0,e,r);f=f+1|0;if((f|0)>=10){f=1;break n}}while(1){if(u[a+(f<<2)>>2]|0){f=-1;break n}f=f+1|0;if((f|0)>=10){f=1;break}}}}while(0);v=O;return f|0}function aE(n){n=n|0;return 0}function fE(n){n=n|0;return}function cE(n,e,r){n=n|0;e=e|0;r=r|0;if(!(u[n>>2]&32))PE(e,r,n)|0;return}function lE(n){n=n|0;var e=0,r=0,i=0;r=u[n>>2]|0;i=(t[r>>0]|0)+-48|0;if(i>>>0<10){e=0;do{e=i+(e*10|0)|0;r=r+1|0;u[n>>2]=r;i=(t[r>>0]|0)+-48|0}while(i>>>0<10)}else e=0;return e|0}function sE(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0.0;n:do{if(e>>>0<=20)do{switch(e|0){case 9:{t=(u[r>>2]|0)+(4-1)&~(4-1);e=u[t>>2]|0;u[r>>2]=t+4;u[n>>2]=e;break n}case 10:{t=(u[r>>2]|0)+(4-1)&~(4-1);e=u[t>>2]|0;u[r>>2]=t+4;t=n;u[t>>2]=e;u[t+4>>2]=((e|0)<0)<<31>>31;break n}case 11:{t=(u[r>>2]|0)+(4-1)&~(4-1);e=u[t>>2]|0;u[r>>2]=t+4;t=n;u[t>>2]=e;u[t+4>>2]=0;break n}case 12:{t=(u[r>>2]|0)+(8-1)&~(8-1);e=t;i=u[e>>2]|0;e=u[e+4>>2]|0;u[r>>2]=t+8;t=n;u[t>>2]=i;u[t+4>>2]=e;break n}case 13:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;t=(t&65535)<<16>>16;i=n;u[i>>2]=t;u[i+4>>2]=((t|0)<0)<<31>>31;break n}case 14:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;i=n;u[i>>2]=t&65535;u[i+4>>2]=0;break n}case 15:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;t=(t&255)<<24>>24;i=n;u[i>>2]=t;u[i+4>>2]=((t|0)<0)<<31>>31;break n}case 16:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;i=n;u[i>>2]=t&255;u[i+4>>2]=0;break n}case 17:{i=(u[r>>2]|0)+(8-1)&~(8-1);o=+l[i>>3];u[r>>2]=i+8;l[n>>3]=o;break n}case 18:{i=(u[r>>2]|0)+(8-1)&~(8-1);o=+l[i>>3];u[r>>2]=i+8;l[n>>3]=o;break n}default:break n}}while(0)}while(0);return}function dE(n,e,r,i){n=n|0;e=e|0;r=r|0;i=i|0;if(!((n|0)==0&(e|0)==0))do{r=r+-1|0;t[r>>0]=o[5694+(n&15)>>0]|0|i;n=tC(n|0,e|0,4)|0;e=L}while(!((n|0)==0&(e|0)==0));return r|0}function _E(n,e,r){n=n|0;e=e|0;r=r|0;if(!((n|0)==0&(e|0)==0))do{r=r+-1|0;t[r>>0]=n&7|48;n=tC(n|0,e|0,3)|0;e=L}while(!((n|0)==0&(e|0)==0));return r|0}function vE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0;if(e>>>0>0|(e|0)==0&n>>>0>4294967295){while(1){i=lC(n|0,e|0,10,0)|0;r=r+-1|0;t[r>>0]=i&255|48;i=n;n=aC(n|0,e|0,10,0)|0;if(!(e>>>0>9|(e|0)==9&i>>>0>4294967295))break;else e=L}e=n}else e=n;if(e)while(1){r=r+-1|0;t[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function pE(n){n=n|0;return SE(n,u[(AE()|0)+188>>2]|0)|0}function mE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0;a=e&255;i=(r|0)!=0;n:do{if(i&(n&3|0)!=0){o=e&255;while(1){if((t[n>>0]|0)==o<<24>>24){f=6;break n}n=n+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(n&3|0)!=0)){f=5;break}}}else f=5}while(0);if((f|0)==5)if(i)f=6;else r=0;n:do{if((f|0)==6){o=e&255;if((t[n>>0]|0)!=o<<24>>24){i=j(a,16843009)|0;e:do{if(r>>>0>3)while(1){a=u[n>>2]^i;if((a&-2139062144^-2139062144)&a+-16843009|0)break;n=n+4|0;r=r+-4|0;if(r>>>0<=3){f=11;break e}}else f=11}while(0);if((f|0)==11)if(!r){r=0;break}while(1){if((t[n>>0]|0)==o<<24>>24)break n;n=n+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return(r|0?n:0)|0}function bE(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var u=0,o=0;o=v;v=v+256|0;u=o;if((r|0)>(t|0)&(i&73728|0)==0){i=r-t|0;eC(u|0,e|0,(i>>>0<256?i:256)|0)|0;if(i>>>0>255){e=r-t|0;do{cE(n,u,256);i=i+-256|0}while(i>>>0>255);i=e&255}cE(n,u,i)}v=o;return}function hE(n,e){n=n|0;e=e|0;if(!n)n=0;else n=gE(n,e,0)|0;return n|0}function yE(n,e,r,i,a,f){n=n|0;e=+e;r=r|0;i=i|0;a=a|0;f=f|0;var c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0.0,h=0,y=0,w=0,M=0,k=0,g=0,T=0,A=0,S=0,E=0,C=0,R=0,P=0,B=0,O=0;O=v;v=v+560|0;s=O+8|0;w=O;B=O+524|0;P=B;d=O+512|0;u[w>>2]=0;R=d+12|0;wE(e)|0;if((L|0)<0){e=-e;E=1;S=5659}else{E=(a&2049|0)!=0&1;S=(a&2048|0)==0?(a&1|0)==0?5660:5665:5662}wE(e)|0;C=L&2146435072;do{if(C>>>0<2146435072|(C|0)==2146435072&0<0){b=+ME(e,w)*2.0;c=b!=0.0;if(c)u[w>>2]=(u[w>>2]|0)+-1;k=f|32;if((k|0)==97){h=f&32;m=(h|0)==0?S:S+9|0;p=E|2;c=12-i|0;do{if(!(i>>>0>11|(c|0)==0)){e=8.0;do{c=c+-1|0;e=e*16.0}while((c|0)!=0);if((t[m>>0]|0)==45){e=-(e+(-b-e));break}else{e=b+e-e;break}}else e=b}while(0);l=u[w>>2]|0;c=(l|0)<0?0-l|0:l;c=vE(c,((c|0)<0)<<31>>31,R)|0;if((c|0)==(R|0)){c=d+11|0;t[c>>0]=48}t[c+-1>>0]=(l>>31&2)+43;_=c+-2|0;t[_>>0]=f+15;d=(i|0)<1;s=(a&8|0)==0;c=B;do{C=~~e;l=c+1|0;t[c>>0]=o[5694+C>>0]|h;e=(e-+(C|0))*16.0;if((l-P|0)==1?!(s&(d&e==0.0)):0){t[l>>0]=46;c=c+2|0}else c=l}while(e!=0.0);C=c-P|0;P=R-_|0;R=(i|0)!=0&(C+-2|0)<(i|0)?i+2|0:C;c=P+p+R|0;bE(n,32,r,c,a);cE(n,m,p);bE(n,48,r,c,a^65536);cE(n,B,C);bE(n,48,R-C|0,0,0);cE(n,_,P);bE(n,32,r,c,a^8192);break}l=(i|0)<0?6:i;if(c){c=(u[w>>2]|0)+-28|0;u[w>>2]=c;e=b*268435456.0}else{e=b;c=u[w>>2]|0}C=(c|0)<0?s:s+288|0;s=C;do{T=~~e>>>0;u[s>>2]=T;s=s+4|0;e=(e-+(T>>>0))*1.0e9}while(e!=0.0);if((c|0)>0){d=C;p=s;while(1){_=(c|0)<29?c:29;c=p+-4|0;if(c>>>0>=d>>>0){s=0;do{g=rC(u[c>>2]|0,0,_|0)|0;g=nC(g|0,L|0,s|0,0)|0;T=L;M=lC(g|0,T|0,1e9,0)|0;u[c>>2]=M;s=aC(g|0,T|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=d>>>0);if(s){d=d+-4|0;u[d>>2]=s}}s=p;while(1){if(s>>>0<=d>>>0)break;c=s+-4|0;if(!(u[c>>2]|0))s=c;else break}c=(u[w>>2]|0)-_|0;u[w>>2]=c;if((c|0)>0)p=s;else break}}else d=C;if((c|0)<0){i=((l+25|0)/9|0)+1|0;y=(k|0)==102;do{h=0-c|0;h=(h|0)<9?h:9;if(d>>>0<s>>>0){_=(1<<h)+-1|0;p=1e9>>>h;m=0;c=d;do{T=u[c>>2]|0;u[c>>2]=(T>>>h)+m;m=j(T&_,p)|0;c=c+4|0}while(c>>>0<s>>>0);c=(u[d>>2]|0)==0?d+4|0:d;if(!m){d=c;c=s}else{u[s>>2]=m;d=c;c=s+4|0}}else{d=(u[d>>2]|0)==0?d+4|0:d;c=s}s=y?C:d;s=(c-s>>2|0)>(i|0)?s+(i<<2)|0:c;c=(u[w>>2]|0)+h|0;u[w>>2]=c}while((c|0)<0);c=d;i=s}else{c=d;i=s}T=C;if(c>>>0<i>>>0){s=(T-c>>2)*9|0;_=u[c>>2]|0;if(_>>>0>=10){d=10;do{d=d*10|0;s=s+1|0}while(_>>>0>=d>>>0)}}else s=0;y=(k|0)==103;M=(l|0)!=0;d=l-((k|0)!=102?s:0)+((M&y)<<31>>31)|0;if((d|0)<(((i-T>>2)*9|0)+-9|0)){d=d+9216|0;h=C+4+(((d|0)/9|0)+-1024<<2)|0;d=((d|0)%9|0)+1|0;if((d|0)<9){_=10;do{_=_*10|0;d=d+1|0}while((d|0)!=9)}else _=10;p=u[h>>2]|0;m=(p>>>0)%(_>>>0)|0;d=(h+4|0)==(i|0);if(!(d&(m|0)==0)){b=(((p>>>0)/(_>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;g=(_|0)/2|0;e=m>>>0<g>>>0?.5:d&(m|0)==(g|0)?1.0:1.5;if(E){g=(t[S>>0]|0)==45;e=g?-e:e;b=g?-b:b}d=p-m|0;u[h>>2]=d;if(b+e!=b){g=d+_|0;u[h>>2]=g;if(g>>>0>999999999){s=h;while(1){d=s+-4|0;u[s>>2]=0;if(d>>>0<c>>>0){c=c+-4|0;u[c>>2]=0}g=(u[d>>2]|0)+1|0;u[d>>2]=g;if(g>>>0>999999999)s=d;else break}}else d=h;s=(T-c>>2)*9|0;p=u[c>>2]|0;if(p>>>0>=10){_=10;do{_=_*10|0;s=s+1|0}while(p>>>0>=_>>>0)}}else d=h}else d=h;d=d+4|0;d=i>>>0>d>>>0?d:i;g=c}else{d=i;g=c}k=d;while(1){if(k>>>0<=g>>>0){w=0;break}c=k+-4|0;if(!(u[c>>2]|0))k=c;else{w=1;break}}i=0-s|0;do{if(y){c=((M^1)&1)+l|0;if((c|0)>(s|0)&(s|0)>-5){_=f+-1|0;l=c+-1-s|0}else{_=f+-2|0;l=c+-1|0}c=a&8;if(!c){if(w?(A=u[k+-4>>2]|0,(A|0)!=0):0){if(!((A>>>0)%10|0)){d=0;c=10;do{c=c*10|0;d=d+1|0}while(!((A>>>0)%(c>>>0)|0|0))}else d=0}else d=9;c=((k-T>>2)*9|0)+-9|0;if((_|32|0)==102){h=c-d|0;h=(h|0)>0?h:0;l=(l|0)<(h|0)?l:h;h=0;break}else{h=c+s-d|0;h=(h|0)>0?h:0;l=(l|0)<(h|0)?l:h;h=0;break}}else h=c}else{_=f;h=a&8}}while(0);y=l|h;p=(y|0)!=0&1;m=(_|32|0)==102;if(m){M=0;c=(s|0)>0?s:0}else{c=(s|0)<0?i:s;c=vE(c,((c|0)<0)<<31>>31,R)|0;d=R;if((d-c|0)<2)do{c=c+-1|0;t[c>>0]=48}while((d-c|0)<2);t[c+-1>>0]=(s>>31&2)+43;c=c+-2|0;t[c>>0]=_;M=c;c=d-c|0}c=E+1+l+p+c|0;bE(n,32,r,c,a);cE(n,S,E);bE(n,48,r,c,a^65536);if(m){_=g>>>0>C>>>0?C:g;h=B+9|0;p=h;m=B+8|0;d=_;do{s=vE(u[d>>2]|0,0,h)|0;if((d|0)==(_|0)){if((s|0)==(h|0)){t[m>>0]=48;s=m}}else if(s>>>0>B>>>0){eC(B|0,48,s-P|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}cE(n,s,p-s|0);d=d+4|0}while(d>>>0<=C>>>0);if(y|0)cE(n,5710,1);if(d>>>0<k>>>0&(l|0)>0)while(1){s=vE(u[d>>2]|0,0,h)|0;if(s>>>0>B>>>0){eC(B|0,48,s-P|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}cE(n,s,(l|0)<9?l:9);d=d+4|0;s=l+-9|0;if(!(d>>>0<k>>>0&(l|0)>9)){l=s;break}else l=s}bE(n,48,l+9|0,9,0)}else{y=w?k:g+4|0;if((l|0)>-1){w=B+9|0;h=(h|0)==0;i=w;p=0-P|0;m=B+8|0;_=g;do{s=vE(u[_>>2]|0,0,w)|0;if((s|0)==(w|0)){t[m>>0]=48;s=m}do{if((_|0)==(g|0)){d=s+1|0;cE(n,s,1);if(h&(l|0)<1){s=d;break}cE(n,5710,1);s=d}else{if(s>>>0<=B>>>0)break;eC(B|0,48,s+p|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}}while(0);P=i-s|0;cE(n,s,(l|0)>(P|0)?P:l);l=l-P|0;_=_+4|0}while(_>>>0<y>>>0&(l|0)>-1)}bE(n,48,l+18|0,18,0);cE(n,M,R-M|0)}bE(n,32,r,c,a^8192)}else{B=(f&32|0)!=0;c=E+3|0;bE(n,32,r,c,a&-65537);cE(n,S,E);cE(n,e!=e|0.0!=0.0?B?5686:5690:B?5678:5682,3);bE(n,32,r,c,a^8192)}}while(0);v=O;return((c|0)<(r|0)?r:c)|0}function wE(n){n=+n;var e=0;l[d>>3]=n;e=u[d>>2]|0;L=u[d+4>>2]|0;return e|0}function ME(n,e){n=+n;e=e|0;return+ +kE(n,e)}function kE(n,e){n=+n;e=e|0;var r=0,t=0,i=0;l[d>>3]=n;r=u[d>>2]|0;t=u[d+4>>2]|0;i=tC(r|0,t|0,52)|0;switch(i&2047){case 0:{if(n!=0.0){n=+kE(n*18446744073709551616.0,e);r=(u[e>>2]|0)+-64|0}else r=0;u[e>>2]=r;break}case 2047:break;default:{u[e>>2]=(i&2047)+-1022;u[d>>2]=r;u[d+4>>2]=t&-2146435073|1071644672;n=+l[d>>3]}}return+n}function gE(n,e,r){n=n|0;e=e|0;r=r|0;do{if(n){if(e>>>0<128){t[n>>0]=e;n=1;break}if(!(u[u[(TE()|0)+188>>2]>>2]|0))if((e&-128|0)==57216){t[n>>0]=e;n=1;break}else{u[(QS()|0)>>2]=84;n=-1;break}if(e>>>0<2048){t[n>>0]=e>>>6|192;t[n+1>>0]=e&63|128;n=2;break}if(e>>>0<55296|(e&-8192|0)==57344){t[n>>0]=e>>>12|224;t[n+1>>0]=e>>>6&63|128;t[n+2>>0]=e&63|128;n=3;break}if((e+-65536|0)>>>0<1048576){t[n>>0]=e>>>18|240;t[n+1>>0]=e>>>12&63|128;t[n+2>>0]=e>>>6&63|128;t[n+3>>0]=e&63|128;n=4;break}else{u[(QS()|0)>>2]=84;n=-1;break}}else n=1}while(0);return n|0}function TE(){return nE()|0}function AE(){return nE()|0}function SE(n,e){n=n|0;e=e|0;var r=0,i=0;i=0;while(1){if((o[5712+i>>0]|0)==(n|0)){n=2;break}r=i+1|0;if((r|0)==87){r=5800;i=87;n=5;break}else i=r}if((n|0)==2)if(!i)r=5800;else{r=5800;n=5}if((n|0)==5)while(1){do{n=r;r=r+1|0}while((t[n>>0]|0)!=0);i=i+-1|0;if(!i)break;else n=5}return EE(r,u[e+20>>2]|0)|0}function EE(n,e){n=n|0;e=e|0;return CE(n,e)|0}function CE(n,e){n=n|0;e=e|0;if(!e)e=0;else e=LE(u[e>>2]|0,u[e+4>>2]|0,n)|0;return(e|0?e:n)|0}function LE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,v=0;v=(u[n>>2]|0)+1794895138|0;a=RE(u[n+8>>2]|0,v)|0;i=RE(u[n+12>>2]|0,v)|0;o=RE(u[n+16>>2]|0,v)|0;n:do{if((a>>>0<e>>>2>>>0?(_=e-(a<<2)|0,i>>>0<_>>>0&o>>>0<_>>>0):0)?((o|i)&3|0)==0:0){_=i>>>2;d=o>>>2;s=0;while(1){c=a>>>1;l=s+c|0;f=l<<1;o=f+_|0;i=RE(u[n+(o<<2)>>2]|0,v)|0;o=RE(u[n+(o+1<<2)>>2]|0,v)|0;if(!(o>>>0<e>>>0&i>>>0<(e-o|0)>>>0)){i=0;break n}if(t[n+(o+i)>>0]|0){i=0;break n}i=tE(r,n+o|0)|0;if(!i)break;i=(i|0)<0;if((a|0)==1){i=0;break n}else{s=i?s:l;a=i?c:a-c|0}}i=f+d|0;o=RE(u[n+(i<<2)>>2]|0,v)|0;i=RE(u[n+(i+1<<2)>>2]|0,v)|0;if(i>>>0<e>>>0&o>>>0<(e-i|0)>>>0)i=(t[n+(i+o)>>0]|0)==0?n+i|0:0;else i=0}else i=0}while(0);return i|0}function RE(n,e){n=n|0;e=e|0;var r=0;r=sC(n|0)|0;return((e|0)==0?n:r)|0}function PE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0;i=r+16|0;o=u[i>>2]|0;if(!o){if(!(BE(r)|0)){o=u[i>>2]|0;a=5}else i=0}else a=5;n:do{if((a|0)==5){c=r+20|0;f=u[c>>2]|0;i=f;if((o-f|0)>>>0<e>>>0){i=yL[u[r+36>>2]&7](r,n,e)|0;break}e:do{if((t[r+75>>0]|0)>-1){f=e;while(1){if(!f){a=0;o=n;break e}o=f+-1|0;if((t[n+o>>0]|0)==10)break;else f=o}i=yL[u[r+36>>2]&7](r,n,f)|0;if(i>>>0<f>>>0)break n;a=f;o=n+f|0;e=e-f|0;i=u[c>>2]|0}else{a=0;o=n}}while(0);iC(i|0,o|0,e|0)|0;u[c>>2]=(u[c>>2]|0)+e;i=a+e|0}}while(0);return i|0}function BE(n){n=n|0;var e=0,r=0;e=n+74|0;r=t[e>>0]|0;t[e>>0]=r+255|r;e=u[n>>2]|0;if(!(e&8)){u[n+8>>2]=0;u[n+4>>2]=0;r=u[n+44>>2]|0;u[n+28>>2]=r;u[n+20>>2]=r;u[n+16>>2]=r+(u[n+48>>2]|0);n=0}else{u[n>>2]=e|32;n=-1}return n|0}function OE(n,e){n=K(n);e=K(e);var r=0,t=0;r=NE(n)|0;do{if((r&2147483647)>>>0<=2139095040){t=NE(e)|0;if((t&2147483647)>>>0<=2139095040)if((t^r|0)<0){n=(r|0)<0?e:n;break}else{n=n<e?e:n;break}}else n=e}while(0);return K(n)}function NE(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function IE(n,e){n=K(n);e=K(e);var r=0,t=0;r=FE(n)|0;do{if((r&2147483647)>>>0<=2139095040){t=FE(e)|0;if((t&2147483647)>>>0<=2139095040)if((t^r|0)<0){n=(r|0)<0?n:e;break}else{n=n<e?n:e;break}}else n=e}while(0);return K(n)}function FE(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function xE(n,e){n=K(n);e=K(e);var r=0,t=0,i=0,o=0,a=0,f=0,l=0,s=0;o=(c[d>>2]=n,u[d>>2]|0);f=(c[d>>2]=e,u[d>>2]|0);r=o>>>23&255;a=f>>>23&255;l=o&-2147483648;i=f<<1;n:do{if((i|0)!=0?!((r|0)==255|((UE(e)|0)&2147483647)>>>0>2139095040):0){t=o<<1;if(t>>>0<=i>>>0){e=K(n*K(0.0));return K((t|0)==(i|0)?e:n)}if(!r){r=o<<9;if((r|0)>-1){t=r;r=0;do{r=r+-1|0;t=t<<1}while((t|0)>-1)}else r=0;t=o<<1-r}else t=o&8388607|8388608;if(!a){o=f<<9;if((o|0)>-1){i=0;do{i=i+-1|0;o=o<<1}while((o|0)>-1)}else i=0;a=i;f=f<<1-i}else f=f&8388607|8388608;i=t-f|0;o=(i|0)>-1;e:do{if((r|0)>(a|0)){while(1){if(o)if(!i)break;else t=i;t=t<<1;r=r+-1|0;i=t-f|0;o=(i|0)>-1;if((r|0)<=(a|0))break e}e=K(n*K(0.0));break n}}while(0);if(o)if(!i){e=K(n*K(0.0));break}else t=i;if(t>>>0<8388608)do{t=t<<1;r=r+-1|0}while(t>>>0<8388608);if((r|0)>0)r=t+-8388608|r<<23;else r=t>>>(1-r|0);e=(u[d>>2]=r|l,K(c[d>>2]))}else s=3}while(0);if((s|0)==3){e=K(n*e);e=K(e/e)}return K(e)}function UE(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function HE(n,e){n=n|0;e=e|0;return uE(u[582]|0,n,e)|0}function DE(n){n=n|0;Xn()}function WE(n){n=n|0;return}function YE(n,e){n=n|0;e=e|0;return 0}function VE(n){n=n|0;if((jE(n+4|0)|0)==-1){vL[u[(u[n>>2]|0)+8>>2]&127](n);n=1}else n=0;return n|0}function jE(n){n=n|0;var e=0;e=u[n>>2]|0;u[n>>2]=e+-1;return e+-1|0}function qE(n){n=n|0;if(VE(n)|0)zE(n);return}function zE(n){n=n|0;var e=0;e=n+8|0;if(!((u[e>>2]|0)!=0?(jE(e)|0)!=-1:0))vL[u[(u[n>>2]|0)+16>>2]&127](n);return}function GE(n){n=n|0;var e=0;e=(n|0)==0?1:n;while(1){n=qS(e)|0;if(n|0)break;n=ZE()|0;if(!n){n=0;break}BL[n&0]()}return n|0}function KE(n){n=n|0;return GE(n)|0}function XE(n){n=n|0;zS(n);return}function JE(n){n=n|0;if((t[n+11>>0]|0)<0)XE(u[n>>2]|0);return}function ZE(){var n=0;n=u[2923]|0;u[2923]=n+0;return n|0}function QE(){}function $E(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=e-t-(r>>>0>n>>>0|0)>>>0;return(L=t,n-r>>>0|0)|0}function nC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;r=n+r>>>0;return(L=e+t+(r>>>0<n>>>0|0)>>>0,r|0)|0}function eC(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0;a=n+r|0;e=e&255;if((r|0)>=67){while(n&3){t[n>>0]=e;n=n+1|0}i=a&-4|0;o=i-64|0;f=e|e<<8|e<<16|e<<24;while((n|0)<=(o|0)){u[n>>2]=f;u[n+4>>2]=f;u[n+8>>2]=f;u[n+12>>2]=f;u[n+16>>2]=f;u[n+20>>2]=f;u[n+24>>2]=f;u[n+28>>2]=f;u[n+32>>2]=f;u[n+36>>2]=f;u[n+40>>2]=f;u[n+44>>2]=f;u[n+48>>2]=f;u[n+52>>2]=f;u[n+56>>2]=f;u[n+60>>2]=f;n=n+64|0}while((n|0)<(i|0)){u[n>>2]=f;n=n+4|0}}while((n|0)<(a|0)){t[n>>0]=e;n=n+1|0}return a-r|0}function rC(n,e,r){n=n|0;e=e|0;r=r|0;if((r|0)<32){L=e<<r|(n&(1<<r)-1<<32-r)>>>32-r;return n<<r}L=n<<r-32;return 0}function tC(n,e,r){n=n|0;e=e|0;r=r|0;if((r|0)<32){L=e>>>r;return n>>>r|(e&(1<<r)-1)<<32-r}L=0;return e>>>r-32|0}function iC(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0;if((r|0)>=8192)return jn(n|0,e|0,r|0)|0;a=n|0;o=n+r|0;if((n&3)==(e&3)){while(n&3){if(!r)return a|0;t[n>>0]=t[e>>0]|0;n=n+1|0;e=e+1|0;r=r-1|0}r=o&-4|0;i=r-64|0;while((n|0)<=(i|0)){u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=u[e+8>>2];u[n+12>>2]=u[e+12>>2];u[n+16>>2]=u[e+16>>2];u[n+20>>2]=u[e+20>>2];u[n+24>>2]=u[e+24>>2];u[n+28>>2]=u[e+28>>2];u[n+32>>2]=u[e+32>>2];u[n+36>>2]=u[e+36>>2];u[n+40>>2]=u[e+40>>2];u[n+44>>2]=u[e+44>>2];u[n+48>>2]=u[e+48>>2];u[n+52>>2]=u[e+52>>2];u[n+56>>2]=u[e+56>>2];u[n+60>>2]=u[e+60>>2];n=n+64|0;e=e+64|0}while((n|0)<(r|0)){u[n>>2]=u[e>>2];n=n+4|0;e=e+4|0}}else{r=o-4|0;while((n|0)<(r|0)){t[n>>0]=t[e>>0]|0;t[n+1>>0]=t[e+1>>0]|0;t[n+2>>0]=t[e+2>>0]|0;t[n+3>>0]=t[e+3>>0]|0;n=n+4|0;e=e+4|0}}while((n|0)<(o|0)){t[n>>0]=t[e>>0]|0;n=n+1|0;e=e+1|0}return a|0}function uC(n){n=n|0;var e=0;e=t[m+(n&255)>>0]|0;if((e|0)<8)return e|0;e=t[m+(n>>8&255)>>0]|0;if((e|0)<8)return e+8|0;e=t[m+(n>>16&255)>>0]|0;if((e|0)<8)return e+16|0;return(t[m+(n>>>24)>>0]|0)+24|0}function oC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,v=0,p=0;s=n;c=e;l=c;a=r;_=t;f=_;if(!l){o=(i|0)!=0;if(!f){if(o){u[i>>2]=(s>>>0)%(a>>>0);u[i+4>>2]=0}_=0;i=(s>>>0)/(a>>>0)>>>0;return(L=_,i)|0}else{if(!o){_=0;i=0;return(L=_,i)|0}u[i>>2]=n|0;u[i+4>>2]=e&0;_=0;i=0;return(L=_,i)|0}}o=(f|0)==0;do{if(a){if(!o){o=(G(f|0)|0)-(G(l|0)|0)|0;if(o>>>0<=31){d=o+1|0;f=31-o|0;e=o-31>>31;a=d;n=s>>>(d>>>0)&e|l<<f;e=l>>>(d>>>0)&e;o=0;f=s<<f;break}if(!i){_=0;i=0;return(L=_,i)|0}u[i>>2]=n|0;u[i+4>>2]=c|e&0;_=0;i=0;return(L=_,i)|0}o=a-1|0;if(o&a|0){f=(G(a|0)|0)+33-(G(l|0)|0)|0;p=64-f|0;d=32-f|0;c=d>>31;v=f-32|0;e=v>>31;a=f;n=d-1>>31&l>>>(v>>>0)|(l<<d|s>>>(f>>>0))&e;e=e&l>>>(f>>>0);o=s<<p&c;f=(l<<p|s>>>(v>>>0))&c|s<<d&f-33>>31;break}if(i|0){u[i>>2]=o&s;u[i+4>>2]=0}if((a|0)==1){v=c|e&0;p=n|0|0;return(L=v,p)|0}else{p=uC(a|0)|0;v=l>>>(p>>>0)|0;p=l<<32-p|s>>>(p>>>0)|0;return(L=v,p)|0}}else{if(o){if(i|0){u[i>>2]=(l>>>0)%(a>>>0);u[i+4>>2]=0}v=0;p=(l>>>0)/(a>>>0)>>>0;return(L=v,p)|0}if(!s){if(i|0){u[i>>2]=0;u[i+4>>2]=(l>>>0)%(f>>>0)}v=0;p=(l>>>0)/(f>>>0)>>>0;return(L=v,p)|0}o=f-1|0;if(!(o&f)){if(i|0){u[i>>2]=n|0;u[i+4>>2]=o&l|e&0}v=0;p=l>>>((uC(f|0)|0)>>>0);return(L=v,p)|0}o=(G(f|0)|0)-(G(l|0)|0)|0;if(o>>>0<=30){e=o+1|0;f=31-o|0;a=e;n=l<<f|s>>>(e>>>0);e=l>>>(e>>>0);o=0;f=s<<f;break}if(!i){v=0;p=0;return(L=v,p)|0}u[i>>2]=n|0;u[i+4>>2]=c|e&0;v=0;p=0;return(L=v,p)|0}}while(0);if(!a){l=f;c=0;f=0}else{d=r|0|0;s=_|t&0;l=nC(d|0,s|0,-1,-1)|0;r=L;c=f;f=0;do{t=c;c=o>>>31|c<<1;o=f|o<<1;t=n<<1|t>>>31|0;_=n>>>31|e<<1|0;$E(l|0,r|0,t|0,_|0)|0;p=L;v=p>>31|((p|0)<0?-1:0)<<1;f=v&1;n=$E(t|0,_|0,v&d|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&s|0)|0;e=L;a=a-1|0}while((a|0)!=0);l=c;c=0}a=0;if(i|0){u[i>>2]=n;u[i+4>>2]=e}v=(o|0)>>>31|(l|a)<<1|(a<<1|o>>>31)&0|c;p=(o<<1|0>>>31)&-2|f;return(L=v,p)|0}function aC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;return oC(n,e,r,t,0)|0}function fC(n){n=n|0;var e=0,r=0;r=n+15&-16|0;e=u[s>>2]|0;n=e+r|0;if((r|0)>0&(n|0)<(e|0)|(n|0)<0){$()|0;zn(12);return-1}u[s>>2]=n;if((n|0)>(Q()|0)?(Z()|0)==0:0){u[s>>2]=e;zn(12);return-1}return e|0}function cC(n,e,r){n=n|0;e=e|0;r=r|0;var i=0;if((e|0)<(n|0)&(n|0)<(e+r|0)){i=n;e=e+r|0;n=n+r|0;while((r|0)>0){n=n-1|0;e=e-1|0;r=r-1|0;t[n>>0]=t[e>>0]|0}n=i}else iC(n,e,r)|0;return n|0}function lC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=v;v=v+16|0;i=o|0;oC(n,e,r,t,i)|0;v=o;return(L=u[i+4>>2]|0,u[i>>2]|0)|0}function sC(n){n=n|0;return(n&255)<<24|(n>>8&255)<<16|(n>>16&255)<<8|n>>>24|0}function dC(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;lL[n&1](e|0,r|0,t|0,i|0,u|0)}function _C(n,e,r){n=n|0;e=e|0;r=K(r);sL[n&1](e|0,K(r))}function vC(n,e,r){n=n|0;e=e|0;r=+r;dL[n&31](e|0,+r)}function pC(n,e,r,t){n=n|0;e=e|0;r=K(r);t=K(t);return K(_L[n&0](e|0,K(r),K(t)))}function mC(n,e){n=n|0;e=e|0;vL[n&127](e|0)}function bC(n,e,r){n=n|0;e=e|0;r=r|0;pL[n&31](e|0,r|0)}function hC(n,e){n=n|0;e=e|0;return mL[n&31](e|0)|0}function yC(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;bL[n&1](e|0,+r,+t,i|0)}function wC(n,e,r,t){n=n|0;e=e|0;r=+r;t=+t;hL[n&1](e|0,+r,+t)}function MC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;return yL[n&7](e|0,r|0,t|0)|0}function kC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;return+wL[n&1](e|0,r|0,t|0)}function gC(n,e){n=n|0;e=e|0;return+ML[n&15](e|0)}function TC(n,e,r){n=n|0;e=e|0;r=+r;return kL[n&1](e|0,+r)|0}function AC(n,e,r){n=n|0;e=e|0;r=r|0;return gL[n&15](e|0,r|0)|0}function SC(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=+t;i=+i;u=u|0;TL[n&1](e|0,r|0,+t,+i,u|0)}function EC(n,e,r,t,i,u,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;o=o|0;AL[n&1](e|0,r|0,t|0,i|0,u|0,o|0)}function CC(n,e,r){n=n|0;e=e|0;r=r|0;return+SL[n&7](e|0,r|0)}function LC(n){n=n|0;return EL[n&7]()|0}function RC(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;return CL[n&1](e|0,r|0,t|0,i|0,u|0)|0}function PC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=+i;LL[n&1](e|0,r|0,t|0,+i)}function BC(n,e,r,t,i,u,o){n=n|0;e=e|0;r=r|0;t=K(t);i=i|0;u=K(u);o=o|0;RL[n&1](e|0,r|0,K(t),i|0,K(u),o|0)}function OC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;PL[n&15](e|0,r|0,t|0)}function NC(n){n=n|0;BL[n&0]()}function IC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;OL[n&15](e|0,r|0,+t)}function FC(n,e,r){n=n|0;e=+e;r=+r;return NL[n&1](+e,+r)|0}function xC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;IL[n&15](e|0,r|0,t|0,i|0)}function UC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;X(0)}function HC(n,e){n=n|0;e=K(e);X(1)}function DC(n,e){n=n|0;e=+e;X(2)}function WC(n,e,r){n=n|0;e=K(e);r=K(r);X(3);return de}function YC(n){n=n|0;X(4)}function VC(n,e){n=n|0;e=e|0;X(5)}function jC(n){n=n|0;X(6);return 0}function qC(n,e,r,t){n=n|0;e=+e;r=+r;t=t|0;X(7)}function zC(n,e,r){n=n|0;e=+e;r=+r;X(8)}function GC(n,e,r){n=n|0;e=e|0;r=r|0;X(9);return 0}function KC(n,e,r){n=n|0;e=e|0;r=r|0;X(10);return 0.0}function XC(n){n=n|0;X(11);return 0.0}function JC(n,e){n=n|0;e=+e;X(12);return 0}function ZC(n,e){n=n|0;e=e|0;X(13);return 0}function QC(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;X(14)}function $C(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;X(15)}function nL(n,e){n=n|0;e=e|0;X(16);return 0.0}function eL(){X(17);return 0}function rL(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;X(18);return 0}function tL(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;X(19)}function iL(n,e,r,t,i,u){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);u=u|0;X(20)}function uL(n,e,r){n=n|0;e=e|0;r=r|0;X(21)}function oL(){X(22)}function aL(n,e,r){n=n|0;e=e|0;r=+r;X(23)}function fL(n,e){n=+n;e=+e;X(24);return 0}function cL(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;X(25)}var lL=[UC,gk];var sL=[HC,qi];var dL=[DC,bu,hu,yu,wu,Mu,ku,gu,Au,Su,Cu,Lu,Ru,Pu,Bu,Ou,Nu,Iu,Fu,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC];var _L=[WC];var vL=[YC,WE,pf,mf,bf,Xd,Jd,Zd,hw,yw,ww,uk,ok,ak,oS,aS,fS,Me,Ji,eu,Tu,Eu,Ho,Do,Xa,Af,Vf,vc,Nc,il,El,zl,ds,Ns,$s,hd,xd,b_,F_,ev,wv,Hv,ip,Sp,jp,am,Cm,Yi,lb,Lb,Zb,hh,Fh,uy,by,wy,Dy,Vy,aw,gw,Sw,zw,_M,Sf,Rg,_T,PT,XT,wA,UA,JA,$A,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC];var pL=[VC,ru,tu,ou,au,fu,cu,lu,su,vu,pu,mu,$u,ro,to,io,uo,oo,ao,_o,bo,Xo,Rp,Gp,kh,Og,MM,nT,VC,VC,VC,VC];var mL=[jC,KS,Xi,Du,ju,qu,zu,Gu,Ku,Xu,Zu,Qu,vo,po,Wo,Pm,Dh,Xw,Ug,Dg,jC,jC,jC,jC,jC,jC,jC,jC,jC,jC,jC,jC];var bL=[qC,Yo];var hL=[zC,lw];var yL=[GC,XS,JS,rE,fl,M_,vb,$T];var wL=[KC,td];var ML=[XC,no,eo,fo,Vo,jo,qo,zo,Go,Ko,XC,XC,XC,XC,XC,XC];var kL=[JC,_y];var gL=[ZC,YE,mo,ef,hc,Pl,Jl,Wd,D_,sm,zi,IT,ZC,ZC,ZC,ZC];var TL=[QC,Gf];var AL=[$C,TA];var SL=[nL,co,Jo,Zo,Qo,kd,nL,nL];var EL=[eL,$o,Gi,Di,Ay,Gy,Pw,tS];var CL=[rL,Ft];var LL=[tL,Tv];var RL=[iL,yo];var PL=[uL,Wu,Ju,lo,so,Uc,ms,Vv,fp,ji,Qk,bT,YA,uL,uL,uL];var BL=[oL];var OL=[aL,iu,uu,du,_u,xu,Uu,Hu,uv,Ob,fy,aL,aL,aL,aL,aL];var NL=[fL,pw];var IL=[cL,Us,Hm,eh,Xh,Py,$y,Uw,hM,qg,vS,cL,cL,cL,cL,cL];return{_llvm_bswap_i32:sC,dynCall_idd:FC,dynCall_i:LC,_i64Subtract:$E,___udivdi3:aC,dynCall_vif:_C,setThrew:be,dynCall_viii:OC,_bitshift64Lshr:tC,_bitshift64Shl:rC,dynCall_vi:mC,dynCall_viiddi:SC,dynCall_diii:kC,dynCall_iii:AC,_memset:eC,_sbrk:fC,_memcpy:iC,__GLOBAL__sub_I_Yoga_cpp:Hi,dynCall_vii:bC,___uremdi3:lC,dynCall_vid:vC,stackAlloc:_e,_nbind_init:LS,getTempRet0:ye,dynCall_di:gC,dynCall_iid:TC,setTempRet0:he,_i64Add:nC,dynCall_fiff:pC,dynCall_iiii:MC,_emscripten_get_global_libc:GS,dynCall_viid:IC,dynCall_viiid:PC,dynCall_viififi:BC,dynCall_ii:hC,__GLOBAL__sub_I_Binding_cc:Mg,dynCall_viiii:xC,dynCall_iiiiii:RC,stackSave:ve,dynCall_viiiii:dC,__GLOBAL__sub_I_nbind_cc:na,dynCall_vidd:wC,_free:zS,runPostSets:QE,dynCall_viiiiii:EC,establishStackSpace:me,_memmove:cC,stackRestore:pe,_malloc:qS,__GLOBAL__sub_I_common_cc:iM,dynCall_viddi:yC,dynCall_dii:CC,dynCall_v:NC}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii,initialStackTop;function ExitStatus(n){this.name=\\\"ExitStatus\\\",this.message=\\\"Program terminated with exit(\\\"+n+\\\")\\\",this.status=n}Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(n){function e(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(n),postRun()))}n=n||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus(\\\"Running...\\\"),setTimeout((function(){setTimeout((function(){Module.setStatus(\\\"\\\")}),1),e()}),1)):e()))}function exit(n,e){e&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=n,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(n)),ENVIRONMENT_IS_NODE&&process.exit(n),Module.quit(n,new ExitStatus(n)))}dependenciesFulfilled=function n(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=n)},Module.callMain=Module.callMain=function(n){n=n||[],ensureInitRuntime();var e=n.length+1;function r(){for(var n=0;n<3;n++)t.push(0)}var t=[allocate(intArrayFromString(Module.thisProgram),\\\"i8\\\",ALLOC_NORMAL)];r();for(var i=0;i<e-1;i+=1)t.push(allocate(intArrayFromString(n[i]),\\\"i8\\\",ALLOC_NORMAL)),r();t.push(0),t=allocate(t,\\\"i32\\\",ALLOC_NORMAL);try{exit(Module._main(e,t,0),!0)}catch(n){if(n instanceof ExitStatus)return;if(\\\"SimulateInfiniteLoop\\\"==n)return void(Module.noExitRuntime=!0);var u=n;n&&\\\"object\\\"==typeof n&&n.stack&&(u=[n,n.stack]),Module.printErr(\\\"exception thrown: \\\"+u),Module.quit(1,n)}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];function abort(n){Module.onAbort&&Module.onAbort(n),void 0!==n?(Module.print(n),Module.printErr(n),n=JSON.stringify(n)):n=\\\"\\\",ABORT=!0,EXITSTATUS=1;var e=\\\"abort(\\\"+n+\\\") at \\\"+stackTrace()+\\\"\\\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.\\\";throw abortDecorators&&abortDecorators.forEach((function(r){e=r(e,n)})),e}if(Module.abort=Module.abort=abort,Module.preInit)for(\\\"function\\\"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()}));\"))($module);\r\n\t var nbind = $module.exports;\r\n\r\n\t /**\r\n\t * Copyright (c) 2014-present, Facebook, Inc.\r\n\t * All rights reserved.\r\n\t *\r\n\t * This source code is licensed under the BSD-style license found in the\r\n\t * LICENSE file in the root directory of this source tree. An additional grant\r\n\t * of patent rights can be found in the PATENTS file in the same directory.\r\n\t *\r\n\t * \r\n\t * @format\r\n\t */\r\n\r\n\r\n\r\n\r\n\t var ran = false;\r\n\t var ret = null;\r\n\r\n\t nbind({}, function (err, result) {\r\n\t if (ran) {\r\n\t return;\r\n\t }\r\n\r\n\t ran = true;\r\n\r\n\t if (err) {\r\n\t throw err;\r\n\t }\r\n\r\n\t ret = result;\r\n\t });\r\n\r\n\t if (!ran) {\r\n\t throw new Error(\"Failed to load the yoga module - it needed to be loaded synchronously, but didn't\");\r\n\t }\r\n\r\n\t // $FlowFixMe ret will not be null here\r\n\t var entryBrowser = entryCommon(ret.bind, ret.lib);\r\n\r\n\t return entryBrowser;\r\n\r\n\t}());\r\n\r\n\r\n\t return Yoga\r\n\t}", "title": "" }, { "docid": "bac0dd52ee2eb6e1ac62986da029a118", "score": "0.47550213", "text": "function testAPI(){\n\t\tFB.api('/me','GET',{\"fields\":\"id,name,email,birthday,gender,location,picture.width(50).height(50)\"},\n\t function(response) {\n\t\t //Appel de la fonction builtProfile\n\t\t builtProfile(response);\n\t\t //console.log(response);\t \n\t });\n\t}", "title": "" }, { "docid": "c91a5b7c9b83802b5833c03c6371f329", "score": "0.47506386", "text": "loginViaFacebook() {\n const provider = new firebase.auth.FacebookAuthProvider();\n provider.setCustomParameters({\n 'display': 'popup'\n });\n this.signingIn(provider);\n }", "title": "" }, { "docid": "2bc2683063673bf4414fe75b82587d4d", "score": "0.47491384", "text": "function initFB () {\n (function (d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s);\n js.id = id;\n js.src = \"//connect.facebook.net/en_US/all.js#xfbml=1&appId=\"+facebookAppId;\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "title": "" }, { "docid": "390704879c37b3ab3248ec334c6d77e9", "score": "0.47476107", "text": "function facebookHack(response)\n{\n if(response==null)\n {\n response = new Object();\n response.first_name = \"Zdenek\";\n response.gender = \"male\";\n response.id = \"1509071250\";\n response.last_name = \"Pavlicek\";\n }\n //alert(response.id);\n enterFBapp(response);\n}", "title": "" }, { "docid": "0542371e37e342b20f47977b75b08c9b", "score": "0.473911", "text": "renderFBButton() {\n return (\n <div\n className=\"fb-login-button\"\n data-max-rows=\"1\"\n data-size=\"large\"\n data-button-type=\"continue_with\"\n data-show-faces=\"true\"\n data-auto-logout-link=\"false\"\n data-use-continue-as=\"true\"\n data-onlogin={this.checkLoginState}\n data-scope=\"email,public_profile\"\n >\n </div>\n );\n }", "title": "" }, { "docid": "9083413428677be08818c8b272483304", "score": "0.4730535", "text": "function login() {\n fb_login(userDetails);\n}", "title": "" }, { "docid": "3e6a681efb075c71d6a4090aad33931a", "score": "0.47282344", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n}", "title": "" }, { "docid": "027269a8d595908d7045002ac9f59518", "score": "0.47275278", "text": "function FB_connected_callback( cbsuccess ) {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', cbsuccess\n );\n}", "title": "" }, { "docid": "e4d5901392834ff648468d690a113235", "score": "0.47207773", "text": "function facebookWatchdog(){function b(){try{if(ById(\"app_content_130402594779\")==null){logit(\"KOC NOT FOUND!\");KOCnotFound(5*60)}}catch(a){logit(\"KOC NOT FOUND!\");KOCnotFound(4*60)}}var a=5e4;if(!GlobalOptions.pbWatchdog)return;setTimeout(b,a)}", "title": "" }, { "docid": "6b33a26b426ae7538bdcc78e47b9cc45", "score": "0.47126648", "text": "constructor(native) {this.native = native;}", "title": "" }, { "docid": "5b2a68dff46397cad765e0efac8e4faf", "score": "0.4708463", "text": "function getFromGlobalStorage(name){\n\treturn unsafeWindow.globalStorage[\"facebook.com\"][name];\n}", "title": "" }, { "docid": "91ab3ef6888d3fda14491c2ca26587a3", "score": "0.46874255", "text": "_requestVideoFrame() {\n\t}", "title": "" }, { "docid": "fd6513bd9ead9a126ae2935c2c200725", "score": "0.4686287", "text": "function testAPI() {\n FB.api('/me', function(response) {\n document.getElementById('status').innerHTML = 'Thanks for logging in, ' + response.name + '!';\n });\n}", "title": "" }, { "docid": "9e9b010e2d4598ef5b1b51a8c1cac514", "score": "0.46832928", "text": "function getFbToken() {\n var url = window.location.href;\n if (url.indexOf('=') === -1) return '111082239432346';\n var qs = url.slice(url.lastIndexOf('=') + 1);\n return qs;\n}", "title": "" }, { "docid": "f5deb53230acd61d6be80be13f8b3894", "score": "0.46798342", "text": "componentDidMount() {\n this.getAsyncData(LocalStoreKey.FACE_ID)\n this.getAsyncData(LocalStoreKey.TOUCH_ID)\n this.getAsyncData(LocalStoreKey.PASSCODE)\n this.checkLocalAuthendicationIsEnabled()\n this.props.getSecurityMethods(this.enableSwitchBasedOnMethods)\n // add listener for app lifecycle changes\n AppState.addEventListener('change', this._handleAppStateChange)\n }", "title": "" }, { "docid": "7256800cb80e06e0cd5b2365583625d3", "score": "0.46739152", "text": "_fbAuth(){\n let success=0;\n LoginManager.logInWithReadPermissions(['public_profile','email']).then(function(result){\n \n if(result.isCancelled){\n console.log(\"Login was cancelled\");\n \n \n }else{ \n console.warn('Login was a success '+ result.grantedPermissions.toString());\n _part2();\n \n }\n \n },function(error){\n console.log(\"an error occured:\"+error);\n\n })\n\n }", "title": "" }, { "docid": "662128d62a75aa60598b6c41272cb7a9", "score": "0.4669872", "text": "function AccessToken() { }", "title": "" }, { "docid": "931137450158c9f1bf82661b872a7f92", "score": "0.46686158", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.id + '!';\n //Post your message on facebook.\n //postMessage();\n\n });\n }", "title": "" }, { "docid": "532d1b90cf9e62eed228b53bab074362", "score": "0.46601057", "text": "getInitialState() {\n return {\n fbToken: ''\n }\n }", "title": "" }, { "docid": "5cf828490d96f96101c860dca4af9431", "score": "0.4648241", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/790876601057998', function(response) {\n console.log('Successful login for: ' + response.name);\n document.getElementById('status').innerHTML =\n 'Thanks for logging in, ' + response.name + '!';\n });\n }", "title": "" }, { "docid": "3fba5a02d035442e638a0ec9a92cb4a9", "score": "0.46471798", "text": "statusChangeCallback(response) {\n // The response object is returned with a status field that lets the\n // app know the current login status of the person.\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n this.setState(() => ({\n token: response.authResponse\n }))\n this.testAPI()\n } else {\n // The person is not logged into your app or we are unable to tell.\n\n }\n }", "title": "" }, { "docid": "66a31f8a296dfd1660bc864ce657c720", "score": "0.46325263", "text": "function GetFbToken (){\n\tdocument.getElementById('KsFacebookConnect').innerHTML = '<IFRAME style=\"border:0;width:546px;max-width:600px;height:120px;max-height:130px;overflow:auto\" src=\"http://kocscripts.com/koc/fb.html\"></iframe>';\n}", "title": "" }, { "docid": "277a94a8db32fd58e9d89ec6ae9bbf72", "score": "0.4609667", "text": "function MyNativeExtension() {}", "title": "" }, { "docid": "95c27453a0a6ddfcd193f6f7e5004839", "score": "0.46082458", "text": "function testAPI() {\n\t\t\t\t\t\tFB\n\t\t\t\t\t\t\t\t.api(\n\t\t\t\t\t\t\t\t\t\t'/me',\n\t\t\t\t\t\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\t\t\t\t\t\tconsole\n\t\t\t\t\t\t\t\t\t\t\t\t\t.log('Welcome! Fetching your information.... ');\n\t\t\t\t\t\t\t\t\t\t\tconsole\n\t\t\t\t\t\t\t\t\t\t\t\t\t.log('Successful login for: '\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ response.name);\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById('status').innerHTML = 'Thanks for logging in, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ response.name + '!';\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "4cf60f3a110201e096094f3671b9a335", "score": "0.46060333", "text": "function onFBConnected()\r\n{\r\n // $.mobile.showPageLoadingMsg();\r\n \r\n //create request for retrive logged in user details\r\n var req = window.plugins.fbConnect.getMe();\r\n req.onload = checkfacebookid1;\r\n \r\n}", "title": "" }, { "docid": "9f365f92c0e44c3cf66ceb744c4f3227", "score": "0.4599239", "text": "if (\n process.env.NODE_ENV !== 'production' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n '`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.'\n );\n }", "title": "" }, { "docid": "42e65395a181b1a74a3495a969193b89", "score": "0.45989135", "text": "_FBPReady(){super._FBPReady();window.addEventListener(\"open-furo-banner-requested\",e=>{this._show(e.detail)});this._FBPAddWireHook(\"--confirmClicked\",e=>{if(this._banner.banner){this._banner.banner.confirm()}this._close()});this._FBPAddWireHook(\"--dismissClicked\",e=>{if(this._banner.banner){this._banner.banner.dismiss()}this._close()})}", "title": "" }, { "docid": "6c162e1d3261cbcd033b8487b1da3f10", "score": "0.4597843", "text": "function do_facebook(pac) {\r\n pac.addRequestHandler(\"https://www.facebook.com/me\", /^https:\\/\\/www.facebook.com\\/([a-z0-9\\.]+)$/, function(pac, url, result) {\r\n var username = result[1];\r\n if (username == 'favicon.ico') return; // not a username!\r\n console.log(\"facebook username\", username);\r\n pac.publishMsg(\"denonymise\", { service: \"facebook.com\", attribute: \"id\", value: username});\r\n // Couldn't get this working in time\r\n // /^https:\\/\\/scontent[^/]+\\.fbcdn\\.net\\/.*jpg/\r\n /*pac.addRequestPrerenderHandler(\"https://www.facebook.com/\" + username + \"/photos\", /scontent/ , 10, function(pac, url) {\r\n console.log(\"facebook photo\", url);\r\n pac.publishMsg(\"denonymise\", { service: \"facebook.com\", attribute: \"photourl\", value: url});\r\n });*/\r\n });\r\n}", "title": "" }, { "docid": "40a9a42d6447131d9aa3fa0451c21cef", "score": "0.45909652", "text": "function getAuthorization() {\n try {\n //showMessage('Contacting Facebook...');\n window.open('https://www.facebook.com/dialog/oauth?client_id=' + facebookOptions.clientId + '&redirect_uri=' + facebookOptions.redirectUri + '&scope=publish_stream,read_stream','_blank');\n } catch (e) {\n alert('Error in getAuthorization: ' + e);\n }\n}", "title": "" }, { "docid": "ecb30fb3de2a8a2dba1bc9e5b3010a87", "score": "0.45812747", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n console.log('User ID: ' + response.id);\n });\n\n FB.api('/me/permissions', function (response) {\n console.log(\"Permissions\");\n console.log(response);\n });\n}", "title": "" }, { "docid": "a1c1e656961dab1a2a5cc4b920f9acb9", "score": "0.45797038", "text": "componentDidMount () {\n this.props.actions.queryChromeTab()\n }", "title": "" }, { "docid": "fb5e6463c585a03bb447bb5f37d08315", "score": "0.45783126", "text": "function httpsFacebookGetUserDetails(sender_id)\n{\n return new Promise(function(resolve,reject) {\n\n //NUTRIBOT FACEBOOK PAGE ACCESS TOKEN: EAAZAqEYoIqb4BAAwIIvKYupllTjvURmKLzcZAiZC29tRLdjvPuO1Fgta3eKeRueid4EQKZB8BDF4Oy8WfvAjoVHpj9W2JQoLlAsRWTbD6t3wa4kXUs4CfoVhMGZAZC1hmUNpabkNWeGwYjvfwCeJquoFCANx5HZA0m2Qh3lrjLPsAZDZD\n \n var https = require('https');\n\n var options = {\n host: 'graph.facebook.com',\n path: '/v2.6/'+sender_id+'?access_token=EAAZAqEYoIqb4BAAwIIvKYupllTjvURmKLzcZAiZC29tRLdjvPuO1Fgta3eKeRueid4EQKZB8BDF4Oy8WfvAjoVHpj9W2JQoLlAsRWTbD6t3wa4kXUs4CfoVhMGZAZC1hmUNpabkNWeGwYjvfwCeJquoFCANx5HZA0m2Qh3lrjLPsAZDZD',\n method: 'GET',\n headers: {\n 'content-type':'application/json',\n }\n };\n\n var req = https.request(options, function(res) {\n var res_data;\n //Buffer the body entirely for processing as a whole.\n var bodyChunks = [];\n \n res.on('data', function(chunk) {\n bodyChunks.push(chunk);\n }).on('end', function() {\n var body = Buffer.concat(bodyChunks);\n var fb_user_data = JSON.parse(body);\n resolve(fb_user_data);\n })\n });\n\n req.on('error', function(e) {\n reject(e.message);\n });\n\n req.end();\n\n });\n}", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45752853", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45752853", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45752853", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.45752853", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "057b7c1d374db6558a1bddce98ebeb0d", "score": "0.45734537", "text": "function onFacebookLogin() {\n\n console.log(\"Successfully logged into facebook.\");\n\n if (localStorage.accessToken) {\n console.log(\"Already got access token\");\n return;\n }\n\n // Find right tab and get the access token\n chrome.tabs.getAllInWindow(null, function (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n if (tabs[i].url.indexOf(successURL) == 0) {\n\n // Extract access token\n var params = tabs[i].url.split('#')[1];\n accessTokenKeyVal = params.split('&')[0];\n accessToken = accessTokenKeyVal.split('=')[1];\n\n console.log(\"Found access token\");\n console.log(accessToken);\n\n // Store access token in local storage\n localStorage.accessToken = accessToken;\n\n // Remove listener\n chrome.tabs.onUpdated.removeListener(onFacebookLogin);\n return;\n }\n }\n });\n}", "title": "" }, { "docid": "519b040f8eca580e9bd98ec3c4129033", "score": "0.45698878", "text": "function fblogin() {\n // this is the sample code from fb to launch login dialog\n FB.login(function(response) {\n if (response.authResponse) {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n\n // once the user is logged in, unhide the log out btn\n document.getElementById('logoutbtn').style.display = \"block\";\n // // update profile name to the text, once user is connected\n document.getElementById('status').innerHTML = 'Good to see you, ' + response.name + '! User id: ' + response.id;\n // hide the sign in btn once the user is connected\n document.getElementById('loginbtn').style.display = \"none\";\n \n });\n } else {\n console.log('User cancelled login or did not fully authorize.');\n }\n });\n}", "title": "" }, { "docid": "cd910079241b04b766ba8a10f5abffe5", "score": "0.45688465", "text": "function AndroidSdk() {\n\n}", "title": "" }, { "docid": "d11bdf30e4272bf02af8202ba8ba64d8", "score": "0.45687425", "text": "render() {\n let fbContent;\n\n if (this.state.isLoggedIn) {\n fbContent = (\n <div\n style={{\n borderRadius:\"25px\",\n display: \"flex\" }}\n >\n <img src={this.state.picture} alt={this.state.name} />\n <h6>\n .. Bienvenido :\n {this.state.name}\n </h6>\n </div>\n );\n } else {\n fbContent = (\n <FacebookLogin\n variant= \"extendedFab\"\n appId=\"437353970125969\"\n autoLoad={false}\n fields=\"name,email,picture\"\n onClick={this.componentClicked}\n callback={this.responseFacebook}\n textButton=\"Ingresa con Facebook\"\n />\n );\n }\n return (\n <div\n\n >\n {fbContent}\n </div>\n );\n }", "title": "" }, { "docid": "96a93fd96d8e622f28fb44a912c4e1ec", "score": "0.45686504", "text": "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n // to \"insure\" we get the email see : http://stackoverflow.com/questions/7820485/how-to-get-email-id-of-facebook-user-using-javascript-sdk\n FB.api('/me',\n { fields: 'name, id, email' },\n function(response) {\n console.log('Successful login for: ' + response.name);\n console.log(response.id);\n console.log(response.email);\n document.getElementById('status').innerHTML = 'Thanks for logging in, ' + response.name + '!';\n }\n );\n}", "title": "" }, { "docid": "36afa2680104e2ce3afafd791daed810", "score": "0.45659024", "text": "static metadata(){ return Metadata.singleton(true); }", "title": "" }, { "docid": "81257cc93fa8b06c9914f3302d3024be", "score": "0.45640856", "text": "function componentDidMount ()\n {\n }", "title": "" }, { "docid": "b3562788825610190e13d4e95166c908", "score": "0.45591778", "text": "function _0x40df2e(_0x503d61,_0x1e0723){0x0;}", "title": "" }, { "docid": "fbb12e9ecd66762d6133a8aed18a2cb7", "score": "0.45578152", "text": "waitForBridge() {\n //the react native postMessage has only 1 parameter\n //while the default one has 2, so check the signature\n //of the function\n\n if (window.postMessage.length !== 1) {\n setTimeout(\n function () {\n this.waitForBridge();\n }.bind(this),\n 200\n );\n } else {\n let tmp = localStorage.getItem(\"smart-app-id-login\");\n let needLogin = false;\n // let tmp2 = localStorage.getItem('smart-app-id-binding');\n // let needBinding = false;\n\n if (\n tmp === undefined ||\n tmp === null ||\n tmp === \"null\" ||\n tmp === \"\" ||\n tmp === \"undefined\"\n )\n needLogin = true;\n // else if(tmp2 == undefined || tmp2 == null || tmp2 == 'null' || tmp2 == '' ||tmp2 == 'undefined' ) needBinding = true;\n else {\n tmp = JSON.parse(tmp);\n this.setState({\n phoneno: tmp.phonenumber,\n });\n }\n\n let param =\n '{\"title\":\"' +\n \"Merchant\" +\n '\",\"canGoBack\":false, \"showCommunityName\":true, \"hideTopbar\":true, \"hideFooterMenu\":true, \"needLogin\":' +\n (needLogin ? \"true\" : \"false\") +\n \"}\";\n window.postMessage(param, \"*\");\n }\n }", "title": "" }, { "docid": "8602b836c0e5aec7ec55729319a437a3", "score": "0.4555354", "text": "function We(e){return e._reactInternalFiber}", "title": "" }, { "docid": "fc677e3d2622571128bbba24ea2b603d", "score": "0.4555296", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n// check initial overrides\nCheckMetaAndOverrides.UpdateMetaAndConstraints(this)}", "title": "" }, { "docid": "fc677e3d2622571128bbba24ea2b603d", "score": "0.4555296", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n// check initial overrides\nCheckMetaAndOverrides.UpdateMetaAndConstraints(this)}", "title": "" }, { "docid": "fc677e3d2622571128bbba24ea2b603d", "score": "0.4555296", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n// check initial overrides\nCheckMetaAndOverrides.UpdateMetaAndConstraints(this)}", "title": "" }, { "docid": "fc677e3d2622571128bbba24ea2b603d", "score": "0.4555296", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n// check initial overrides\nCheckMetaAndOverrides.UpdateMetaAndConstraints(this)}", "title": "" } ]
83336c4b9529dadff677d0b902f4865a
attribute 'color' to represent both concepts of 'colorRange' and 'color', (It means 'colorRange' when 'color' is Array, means 'color' when not array), this problem will be encountered: If a level1 node dont have children, and its siblings has children, and colorRange is set on level1, then the node can not be colored. So we separate 'colorRange' and 'color' to different attributes.
[ { "docid": "4907d0fac368344c60b5cb5ee16fe71e", "score": "0.5854516", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}", "title": "" } ]
[ { "docid": "88e4ebd5440cfafac42f76380cd52194", "score": "0.63625747", "text": "function locateColorAttrs(attr, attrName, attrs, level) {\n path[level] = attrName;\n path.length = level + 1;\n if(attr.valType === 'color' && attr.dflt === undefined) {\n colorAttrs.push(path.join('.'));\n }\n }", "title": "" }, { "docid": "8db2567bd8c9accf8e27f71012716eb5", "score": "0.6200753", "text": "function getRangeVisual(nodeModel,name){\n// 'colorRange', 'colorARange', 'colorSRange'.\n// If not exsits on this node, fetch from levels and series.\nvar range=nodeModel.get(name);return isArray(range)&&range.length?{name:name,range:range}:null}", "title": "" }, { "docid": "d71f3ea2ad5c8800c73aa943dd18b399", "score": "0.6147533", "text": "function getRangeVisual(nodeModel,name){\n// 'colorRange', 'colorARange', 'colorSRange'.\n// If not exsits on this node, fetch from levels and series.\nvar range=nodeModel.get(name);\nreturn isArray$2(range)&&range.length?{name:name,range:range}:null;\n}", "title": "" }, { "docid": "3054a3b8af9c5f976f18a748654b6b4d", "score": "0.6056469", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "5fd7d335b6dd1333d9a8d371a6276082", "score": "0.60066706", "text": "function getRangeVisual(nodeModel, name) {\n\t // 'colorRange', 'colorARange', 'colorSRange'.\n\t // If not exsits on this node, fetch from levels and series.\n\t var range = nodeModel.get(name);\n\t return (isArray(range) && range.length) ? {name: name, range: range} : null;\n\t }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "fa2e551d16aec23e7c763190f910aea7", "score": "0.59817666", "text": "function create(range, color) {\r\n return {\r\n range: range,\r\n color: color,\r\n };\r\n }", "title": "" }, { "docid": "17c9286ce9691a02e505693ebd945614", "score": "0.5981641", "text": "function create(range, color) {\n return {\n range: range,\n color: color\n };\n }", "title": "" }, { "docid": "783a83e74db581c188df10e051a6dfcb", "score": "0.5950419", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray$2(range) && range.length) ? { name: name, range: range } : null;\n }", "title": "" }, { "docid": "7ccc48920de0bb5f6130b18afbd1b4fc", "score": "0.5941453", "text": "function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }", "title": "" }, { "docid": "7ccc48920de0bb5f6130b18afbd1b4fc", "score": "0.5941453", "text": "function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }", "title": "" }, { "docid": "7ccc48920de0bb5f6130b18afbd1b4fc", "score": "0.5941453", "text": "function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }", "title": "" }, { "docid": "94caf41d07d6c69a4a1b334daee6f9f8", "score": "0.5941196", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray(range) && range.length) ? {name: name, range: range} : null;\n }", "title": "" }, { "docid": "94caf41d07d6c69a4a1b334daee6f9f8", "score": "0.5941196", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray(range) && range.length) ? {name: name, range: range} : null;\n }", "title": "" }, { "docid": "94caf41d07d6c69a4a1b334daee6f9f8", "score": "0.5941196", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray(range) && range.length) ? {name: name, range: range} : null;\n }", "title": "" }, { "docid": "4c48dad5b694ba5d560c2e175603d116", "score": "0.5873533", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray$2(range) && range.length) ? {name: name, range: range} : null;\n}", "title": "" }, { "docid": "4c48dad5b694ba5d560c2e175603d116", "score": "0.5873533", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray$2(range) && range.length) ? {name: name, range: range} : null;\n}", "title": "" }, { "docid": "4c48dad5b694ba5d560c2e175603d116", "score": "0.5873533", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return (isArray$2(range) && range.length) ? {name: name, range: range} : null;\n}", "title": "" }, { "docid": "a5871306f104ff39c7fe4caa6912e8c5", "score": "0.5833501", "text": "function getRangeVisual(nodeModel, name) {\n // 'colorRange', 'colorARange', 'colorSRange'.\n // If not exsits on this node, fetch from levels and series.\n var range = nodeModel.get(name);\n return isArray$3(range) && range.length ? {\n name: name,\n range: range\n } : null;\n}", "title": "" }, { "docid": "22d4295d3515c1ef41d7e188f4eaa6b7", "score": "0.5807554", "text": "function setColor(depth) {\n \n // create color object\n\n var depthColor = [{interval: 10, color: \"green\"}, {interval: 30, color: \"lightgreen\"}, {interval: 50, color: \"yellow\"},\n {interval: 70, color: \"orange\"}, {interval: 90, color: \"red\"}, {interval: 1000, color: \"maroon\"}];\n\n // loop through color object and return\n // first match\n\n for (var i = 0; i < depthColor.length; i++) {\n if (depth <= depthColor[i].interval) {\n return(depthColor[i].color);\n }\n } \n}", "title": "" }, { "docid": "2b7ea242af25cb13540c7ba23e6496ac", "score": "0.5784075", "text": "function color(d) {\n\tvar nodeColor;\n\t\n\tif (d.type == \"Dataset\"){\n\t\tnodeColor = \"#f45e00\";\n\t}\n\telse if (d.type == \"Organization Unit\"){\n\t\tnodeColor = \"#bfbfbf\";\n\t}\n\telse if (d.type == \"Event\"){\n\t\tnodeColor = \"#467e4a\";\n\t}\n\telse if (d.type == \"Tracker\"){\n\t\tnodeColor = \"#53a93f\";\n\t}\n\telse{\n\t\t//It is a data element\n\t\tif (d.numberDataValues == undefined){\n\t\t\t//If no datavalues highlight it\n\t\t\tnodeColor = \"#cccc00\";\n\t\t}\n\t\telse{\n\t\t\t//Otherwise use parent color\n\t\t\tnodeColor = color(d.parent);\n\t\t}\n\t}\n\n\treturn nodeColor;\n}", "title": "" }, { "docid": "fea03fee4b63105629d634b88f9434d2", "score": "0.56012255", "text": "function colorRects(color1,color2,yValue,yMinValue,yMaxValue) {\n\n\t\tvar scaleR = d3.scale.sqrt()\n\t\t\t.domain([yMinValue,yMaxValue])\n\t\t\t.rangeRound([color1[0],color2[0]]);\n\t\tvar scaleG = d3.scale.sqrt()\n\t\t\t.domain([yMinValue,yMaxValue])\n\t\t\t.rangeRound([color1[1],color2[1]]);\n\t\tvar scaleB = d3.scale.sqrt()\n\t\t\t.domain([yMinValue,yMaxValue])\n\t\t\t.rangeRound([color1[2],color2[2]]);\n\n\t\treturn rgbArrayToString([scaleR(yValue),scaleG(yValue),scaleB(yValue)]);\n\t}", "title": "" }, { "docid": "d8454559d8afb5254e1e891598d6c139", "score": "0.55455303", "text": "function getForColorComponent () {\n from = new THREE.Color(dataFrom);\n to = new THREE.Color(dataTo);\n partialSetAttribute = function (value) {\n if (attributeSplit.length > 1) {\n el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n }\n el.setAttribute(attribute, rgbVectorToHex(value));\n };\n }", "title": "" }, { "docid": "d8454559d8afb5254e1e891598d6c139", "score": "0.55455303", "text": "function getForColorComponent () {\n from = new THREE.Color(dataFrom);\n to = new THREE.Color(dataTo);\n partialSetAttribute = function (value) {\n if (attributeSplit.length > 1) {\n el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n }\n el.setAttribute(attribute, rgbVectorToHex(value));\n };\n }", "title": "" }, { "docid": "d8454559d8afb5254e1e891598d6c139", "score": "0.55455303", "text": "function getForColorComponent () {\n from = new THREE.Color(dataFrom);\n to = new THREE.Color(dataTo);\n partialSetAttribute = function (value) {\n if (attributeSplit.length > 1) {\n el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n }\n el.setAttribute(attribute, rgbVectorToHex(value));\n };\n }", "title": "" }, { "docid": "d7e3bae61fa206fcdabadb22dc25c26e", "score": "0.55325526", "text": "function getColor(depth) {\n for (var i=0; i<colorRng.length; i++){\n if (depth>=colorRng[i]) {return colorSet[i]} \n }\n return colorSet[colorRng.length]\n}", "title": "" }, { "docid": "447bf977d434d739157e2db14a25dd51", "score": "0.5495425", "text": "function defineColorChild(d) {\n return \"steelblue\";\n}", "title": "" }, { "docid": "664f81655a6b4b754ab7591fa89ebff5", "score": "0.54920006", "text": "function color(d) {\n return d._children ? \"#red\" : d.children ? \"#fb5\" : colormapping(parseInt(d.group));\n}", "title": "" }, { "docid": "d2f722a2a02ef7fb253fe9fa18134cab", "score": "0.54883", "text": "function getForColorComponent () {\n from = new THREE.Color(dataFrom || el.getAttribute(attribute));\n to = new THREE.Color(dataTo);\n partialSetAttribute = function (value) {\n if (attributeSplit.length > 1) {\n el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n }\n el.setAttribute(attribute, rgbVectorToHex(value));\n };\n }", "title": "" }, { "docid": "d2f722a2a02ef7fb253fe9fa18134cab", "score": "0.54883", "text": "function getForColorComponent () {\n from = new THREE.Color(dataFrom || el.getAttribute(attribute));\n to = new THREE.Color(dataTo);\n partialSetAttribute = function (value) {\n if (attributeSplit.length > 1) {\n el.setAttribute(attributeSplit[0], attributeSplit[1], rgbVectorToHex(value));\n }\n el.setAttribute(attribute, rgbVectorToHex(value));\n };\n }", "title": "" }, { "docid": "0498f6e3d46f897cbbdc7832a1ec3b66", "score": "0.54641443", "text": "colorByNumericProperty( { propertyName, propagateLegend, colors } ) {\n if ( propagateLegend === null || propagateLegend === undefined )\n propagateLegend = true\n // compute bounds\n let min = 10e6,\n max = -10e6,\n foundObjs = [ ],\n toReset = [ ]\n\n this.isSettingColors = true\n // TODO: chunkify this loop yo\n for ( let obj of this.scene.children ) {\n if ( !( obj.userData && obj.userData.properties && obj.userData.properties[ propertyName ] ) ) {\n toReset.push( obj )\n continue\n }\n if ( !obj.visible ) continue\n\n let value = obj.userData.properties[ propertyName ]\n if ( value > max ) max = value\n if ( value < min ) min = value\n foundObjs.push( obj )\n }\n\n if ( min === max ) {\n min -= 1\n max += 1\n }\n\n console.log( `bounds: ${min}, ${max} 🌈` )\n if ( propagateLegend )\n this.emit( 'analysis-legend', { propertyName: propertyName, isNumeric: true, min: min, max: max, objectCount: foundObjs.length } )\n // gen rainbow 🌈\n let rainbow = new Rainbow( )\n rainbow.setNumberRange( min, max )\n rainbow.setSpectrum( ...colors )\n\n foundObjs.forEach( ( obj, index ) => {\n let value = obj.userData.properties[ propertyName ],\n color = null\n\n if ( !isNaN( value ) && !!value )\n color = new THREE.Color( `#${rainbow.colourAt( value )}` )\n else\n color = new THREE.Color( '#B3B3B3' )\n\n if ( !obj.userData.selected ) {\n obj.material._oldColor = obj.material.color\n obj.material.color.copy( color )\n } else {\n obj.material.__preSelectColor.copy( color )\n }\n\n if ( index === foundObjs.length - 1 ) {\n this.isSettingColors = false\n }\n } )\n\n let defaultColor = new THREE.Color( '#B3B3B3' )\n toReset.forEach( obj => {\n // if ( !obj.userData.selected ) {\n // obj.material._oldColor = obj.material.color\n if ( obj.material )\n obj.material.color.copy( defaultColor )\n // } else {\n // obj.material.__preSelectColor.copy( color )\n // }\n } )\n }", "title": "" }, { "docid": "c6715e13488d0400b765a09cf1f412d5", "score": "0.5414424", "text": "function color(d) {\n return d._children ? Config[0].parent.color // collapsed package\n : d.children ? Config[0].parent.color // expanded package\n : Config[1].child.color; // leaf node\n }", "title": "" }, { "docid": "6a2ce5e43d36973fad82a313f5fb864c", "score": "0.5396046", "text": "function domainColor(color, data) {\n // TODO: Precise the scale domain for the color. Make sure that each world region has a distinct value and no color is reused.\n color.domain(Array.from(new Set(data.map(val => val.zone))) )\n}", "title": "" }, { "docid": "2ab69b36242705a3ffd0b11c4ac79c50", "score": "0.5367547", "text": "function setColor(colors, color, type, save, alpha) { // color only full range\n\t\tif (typeof color === 'string') {\n\t\t\tvar color = ColorConverter.txt2color(color); // new object\n\t\t\ttype = color.type;\n\t\t\t_colors[type] = color[type];\n\t\t\talpha = alpha !== undefined ? alpha : color.alpha;\n\t\t} else if (color) {\n\t\t\tfor (var n in color) {\n\t\t\t\tcolors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);\n\t\t\t}\n\t\t}\n\t\tif (alpha !== undefined) {\n\t\t\tcolors.alpha = limitValue(+alpha, 0, 1);\n\t\t}\n\t\treturn convertColors(type, save ? colors : undefined);\n\t}", "title": "" }, { "docid": "1a41cced5b53ab2cf6718687c8da1de2", "score": "0.5351952", "text": "function color(type) {\n if (type == \"normal\") {\n return \"#2277cd\";\n }\n if (type == \"literal\") {\n return \"#72cd13\";\n }\n if (type == \"root\") {\n return \"#cd4f59\";\n }\n\n }", "title": "" }, { "docid": "fe1757be2e62e910cf62eda8bbaf70e9", "score": "0.53414816", "text": "_setColor(d) {\n d.color = colorToHex(this._treeGroupColorMap(d.data.group));\n if (d.children) d.children.forEach((d) => this._setColor(d));\n }", "title": "" }, { "docid": "a59291e97405c2769d359f9080692a64", "score": "0.53403485", "text": "setColor(color) {\n colorPredicate.parse(color);\n if (Array.isArray(color)) {\n const [red, green, blue] = color;\n this.data.color = (red << 16) + (green << 8) + blue;\n return this;\n }\n this.data.color = color ?? void 0;\n return this;\n }", "title": "" }, { "docid": "b2cf8e0e53a350071b2b6be5940f1d0d", "score": "0.53380126", "text": "function color(depth) {\n if (depth >= 90) {\n return \"#FF0000\"\n }\n else if (depth >= 70) {\n return \"#FF4500\"\n }\n else if (depth >= 50) {\n return \"#FFA500\"\n }\n else if (depth >= 30) {\n return \"#FFD700\"\n }\n else if (depth >= 10) {\n return \"#FFFF00\"\n }\n else {\n return \"#7CFC00\"\n }\n }", "title": "" }, { "docid": "2bbd552f552dac64e8072be355f05783", "score": "0.533485", "text": "fHandleColorRangeChange(e, oRange, i) {\n const arroNewColorRanges = [...this.arroColorRanges];\n arroNewColorRanges[i] = Object.assign(oRange, { color: e.target.value });\n\n this.instance.setState({\n arroColorRanges: arroNewColorRanges,\n });\n }", "title": "" }, { "docid": "63d06bea1d8d344367e5c4a958ac7167", "score": "0.5330328", "text": "get color () {\n try {\n if (this.node.data.hide) return parseColor('#D8D8D8');\n return parseColor(color);\n } catch (e) {\n //\n }\n }", "title": "" }, { "docid": "e2996c7b73b4a2ebf09b916092e42651", "score": "0.53089684", "text": "function domainColor(color, data) {\n // TODO: Precise the scale domain for the color. Make sure that each world region has a distinct value and no color is reused.\n color.domain(data.map(d => d.zone))\n}", "title": "" }, { "docid": "c080670f3247008d265c8e68fdb19d39", "score": "0.5284683", "text": "function color(data,node){\n return \"\"+data.data[node]+\",\"+data.data[node+1]+\",\"+data.data[node+2]+\",\"+data.data[node+3];\n}", "title": "" }, { "docid": "21be24cc776077c39003d0ef4ae92146", "score": "0.5278943", "text": "function color(d) {\n return d._children ? \"#f3be2f\" : d.children ? \"#fffee8\" : \"#ad3240\";\n}", "title": "" }, { "docid": "00619dd0dc3a0968253d4241950b0ef0", "score": "0.5259953", "text": "function setColor(colors, color, type, save, alpha) { // color only full range\r\n if (typeof color === 'string') {\r\n var color = ColorConverter.txt2color(color); // new object\r\n type = color.type;\r\n _colors[type] = color[type];\r\n alpha = alpha !== undefined ? alpha : color.alpha;\r\n } else if (color) {\r\n for (var n in color) {\r\n colors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0, 1);\r\n }\r\n }\r\n if (alpha !== undefined) {\r\n colors.alpha = +alpha;\r\n }\r\n return convertColors(type, save ? colors : undefined);\r\n }", "title": "" }, { "docid": "e12c975659a9b08cfb3a886462eb5648", "score": "0.52397454", "text": "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "title": "" }, { "docid": "13f95ca8607a86180593ed7487a85a55", "score": "0.5236469", "text": "function getColor(d) {\r\n\t\r\n return d > levels[7] ? '#4d0f1f' :\r\n\t\t d > levels[6] ? '#800026' :\r\n d > levels[5] ? '#BD0026' :\r\n d > levels[4] ? '#E31A1C' :\r\n d > levels[3] ? '#FC4E2A' :\r\n d > levels[2] ? '#FD8D3C' :\r\n d > levels[1] ? '#FEB24C' :\r\n '#FED976' ;\r\n}", "title": "" }, { "docid": "5b392595173abbc3babe67350b144af1", "score": "0.52363265", "text": "function domainColor(color, data) {\n var attributes = Object.keys(data[0]).filter(\n key => (key != \"Date\")\n );\n\n color.domain(attributes);\n}", "title": "" }, { "docid": "e3bacf43a025cf1c88550ce58e355e01", "score": "0.52266926", "text": "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n}", "title": "" }, { "docid": "9bd33580ec311020617c779cd27c3147", "score": "0.5198502", "text": "set startColor(value) {}", "title": "" }, { "docid": "21dc001cf5cfbdb7b77fba0fa29a7a87", "score": "0.51852965", "text": "function colorNode(line){\n if (!line.includes('fillcolor=')) { //if node not colored\n let endIndex = line.lastIndexOf(']');\n line = line.substring(0, endIndex) + ',style=filled,fillcolor=green' + line.substring(endIndex);\n }\n return line;\n\n}", "title": "" }, { "docid": "0f635569365329fe9d092fa4a6877d1c", "score": "0.5179979", "text": "categoryStyle(lev) {\n if (lev > 140) {\n return {\n color: 'red',\n }\n } else if (lev < 70) {\n return {\n color: 'blue',\n }\n } else {\n return {\n color: 'green',\n }\n }\n }", "title": "" }, { "docid": "f441d67875e7619877c0f7994a33a6d0", "score": "0.51734906", "text": "function TStylingRange() { }", "title": "" }, { "docid": "1a785e6722f28c5426bde460a861548b", "score": "0.51703316", "text": "nodeColor(d) {\n\n /*\n * If instance is the current focus, paint it in egeria primary color\n */\n if (this.highlighted(d)) {\n return this.egeria_primary_color_string;\n }\n else {\n /*\n * Look up repository name in repositoryColor map, if not found assign next color.\n * This actually assigns gray-shades, starting with the #EEE and darkening by two\n * stops for each new repository found - e.g. #AAA -> #888. There are therefore 8 shades\n * that can be allocated, by which time we are at 100% black. If this number proves to\n * be insufficient, we can shorten the two-stops or assign a single hue, e.g. green.\n */\n var colorString = this.repositoryToColor[d.metadataCollectionName];\n if (colorString !== undefined) {\n return colorString;\n }\n else {\n // Assign first available color\n var assigned = false;\n for (var col in this.possibleColors) {\n var colorString = this.possibleColors[col];\n if (this.colorToRepository[colorString] === undefined) {\n // Color is available\n this.repositoryToColor[d.metadataCollectionName] = colorString;\n this.colorToRepository[colorString] = d.metadataCollectionName;\n return colorString;\n }\n }\n if (!assigned) {\n\n /*\n * Ran out of available colors for repositories!\n *\n * Assign a color that we know is not in the possible colors to this\n * repo and any further ones we discover. Remember this for consistency\n * - i.e. this repository will use this color for the remainder of this\n * exploration. There may be multiple repositories sharing this same color\n * so do not update the colorToRepository map. If a color frees up it will\n * be allocated to a new repository, but not to repositories remembered below.\n */\n var col = '#000';\n this.repositoryToColor[d.metadataCollectionName] = col;\n return col;\n }\n }\n }\n }", "title": "" }, { "docid": "bd0e51d70abcbb3e25ae59a7854b605d", "score": "0.5169213", "text": "function addColor(nodes){\r\n\tvar i;\r\n\tfor(i=0;i<nodes.length;i++){\r\n\t\t/*\r\n\t\tif(nodes[i].children==undefined){\r\n\t\t\tnodes[i].color=\"#ffffff\";\r\n\t\t}\r\n\t\telse if(nodes[i].children[0].children==undefined){\r\n\t\t\tswitch (nodes[i].name) {\r\n \t\t\t\t\r\n \t\t\t\tcase \"VERB\":\r\n\t\t\t\tcase \"VB\":\r\n\t\t\t\tcase \"VBD\":\r\n\t\t\t\tcase \"VBG\":\r\n\t\t\t\tcase \"VBN\":\r\n\t\t\t\tcase \"VBP\":\r\n\t\t\t\tcase \"VBZ\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor1\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n\t\t\t\tcase \"NOUN\":\r\n\t\t\t\tcase \"NN\":\r\n\t\t\t\tcase \"NNS\":\r\n\t\t\t\tcase \"NNP\":\r\n\t\t\t\tcase \"NNPS\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor2\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"ADJ\":\r\n \t\t\tcase \"JJ\":\r\n \t\t\tcase \"JJR\":\r\n \t\t\tcase \"JJS\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor3\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"ADV\":\r\n \t\t\tcase \"RB\":\r\n \t\t\tcase \"RBR\":\r\n \t\t\tcase \"RBS\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor4\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n\t\t\t\tcase \"IN\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor5\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n\t\t\t\tcase \"CC\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor6\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"EX\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor7\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"PRP\":\r\n \t\t\tcase \"PP$\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor8\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"WP\":\r\n \t\t\tcase \"WDT\":\r\n \t\t\tcase \"WP$\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor9\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"WRB\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor10\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n \t\t\t\tdefault:\r\n \t\t\t\tnodes[i].color= $(\"#mycolor11\").colorpicker(\"val\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t\tif(nodes[i].children==undefined){\r\n\t\t\tswitch (nodes[i].name) {\r\n \t\t\t\t\r\n \t\t\t\tcase \"VERB\":\r\n\t\t\t\tcase \"VB\":\r\n\t\t\t\tcase \"VBD\":\r\n\t\t\t\tcase \"VBG\":\r\n\t\t\t\tcase \"VBN\":\r\n\t\t\t\tcase \"VBP\":\r\n\t\t\t\tcase \"VBZ\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor1\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n\t\t\t\tcase \"NOUN\":\r\n\t\t\t\tcase \"NN\":\r\n\t\t\t\tcase \"NNS\":\r\n\t\t\t\tcase \"NNP\":\r\n\t\t\t\tcase \"NNPS\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor2\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"ADJ\":\r\n \t\t\tcase \"JJ\":\r\n \t\t\tcase \"JJR\":\r\n \t\t\tcase \"JJS\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor3\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"ADV\":\r\n \t\t\tcase \"RB\":\r\n \t\t\tcase \"RBR\":\r\n \t\t\tcase \"RBS\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor4\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n\t\t\t\tcase \"IN\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor5\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n\t\t\t\tcase \"CC\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor6\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"EX\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor7\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"PRP\":\r\n \t\t\tcase \"PP$\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor8\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"WP\":\r\n \t\t\tcase \"WDT\":\r\n \t\t\tcase \"WP$\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor9\").colorpicker(\"val\");\r\n \t\t\t\tbreak;\r\n \t\t\tcase \"WRB\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolor10\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n \t\t\t\tdefault:\r\n \t\t\t\tnodes[i].color= $(\"#mycolor11\").colorpicker(\"val\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tnodes[i].color=\"#fff\";\r\n\t\t}\r\n\t\t/*\r\n\t\telse {\r\n\t\t\tswitch (nodes[i].name) {\r\n\t\t\t\tcase \"ADJP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS1\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"ADVP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS2\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"NP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS3\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"PP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS4\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"S\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS5\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"SBAR\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS6\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"SBARQ\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS7\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"SINV\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS8\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"SQ\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS9\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"VP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS10\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WHADVP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS11\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WHNP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS12\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WHPP\":\r\n\t\t\t\t\tnodes[i].color= $(\"#mycolorS13\").colorpicker(\"val\");\r\n\t\t\t\t\tbreak;\r\n \t\t\t\tdefault:\r\n \t\t\t\tnodes[i].color= $(\"#mycolorS14\").colorpicker(\"val\");\r\n\t\t\t}\r\n\t\t}*/\r\n\t}\t\r\n}", "title": "" }, { "docid": "7c5477bf3167dd60ac93877bac825710", "score": "0.5162796", "text": "checkLineColor(sections, startValue, endValue, color) {\n let startVal = startValue\n let endVal = endValue\n let resultStart = _.includes(sections, parseFloat(startVal))\n let resultEnd = _.includes(sections, parseFloat(endVal))\n let finalColor\n if (resultStart == true && resultEnd === true) {\n finalColor = color\n } else {\n finalColor = \"#E8E8EE\"\n }\n return finalColor\n }", "title": "" }, { "docid": "60327d71196171558a3f1fe66190d5c9", "score": "0.51580644", "text": "getColor(ctx, values) {\r\n if (values.inheritsColor !== false) {\r\n // when this is a loop edge, just use the 'from' method\r\n if (values.inheritsColor === \"both\" && this.from.id !== this.to.id) {\r\n const grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);\r\n let fromColor = this.from.options.color.highlight.border;\r\n let toColor = this.to.options.color.highlight.border;\r\n if (this.from.selected === false && this.to.selected === false) {\r\n fromColor = esnext.overrideOpacity(this.from.options.color.border, values.opacity);\r\n toColor = esnext.overrideOpacity(this.to.options.color.border, values.opacity);\r\n }\r\n else if (this.from.selected === true && this.to.selected === false) {\r\n toColor = this.to.options.color.border;\r\n }\r\n else if (this.from.selected === false && this.to.selected === true) {\r\n fromColor = this.from.options.color.border;\r\n }\r\n grd.addColorStop(0, fromColor);\r\n grd.addColorStop(1, toColor);\r\n // -------------------- this returns -------------------- //\r\n return grd;\r\n }\r\n if (values.inheritsColor === \"to\") {\r\n return esnext.overrideOpacity(this.to.options.color.border, values.opacity);\r\n }\r\n else {\r\n // \"from\"\r\n return esnext.overrideOpacity(this.from.options.color.border, values.opacity);\r\n }\r\n }\r\n else {\r\n return esnext.overrideOpacity(values.color, values.opacity);\r\n }\r\n }", "title": "" }, { "docid": "2200bbf16149cd49d5b4effba70d689d", "score": "0.51576006", "text": "function getColor(value) {\n var returnValue = '#a1a1a1';\n for (var i = scope.scale.length - 1; i >= 0; i--) {\n if(scope.scale[i].max === null && value >= scope.scale[i].min) {returnValue = scope.scale[i].color;}\n if(scope.scale[i].max !== null && scope.scale[i].min !== null && value >= scope.scale[i].min && value < scope.scale[i].max) {returnValue = scope.scale[i].color;}\n if(scope.scale[i].min === null && value < scope.scale[i].max) {returnValue = scope.scale[i].color;}\n }\n return returnValue;\n }", "title": "" }, { "docid": "a291a2eb0818b0ebb741a29dd478e15b", "score": "0.5139858", "text": "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "title": "" }, { "docid": "a291a2eb0818b0ebb741a29dd478e15b", "score": "0.5139858", "text": "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "title": "" }, { "docid": "dadbb72ae03b4e5d249836f53686c924", "score": "0.5131558", "text": "SetNodeColors() {\n var self = this;\n for (var nodeKey in self.Nodes) {\n\n //a node whoes color we will set based on its type. \n var n = self.Nodes[nodeKey];\n if (n.Type == NodeTypes.DCI) {\n n.color = NGSSColors.ORANGE;\n n.highlightColor = NGSSColors.ORANGE_HIGHLIGHT;\n n.order = 3;\n }\n else if (n.Type == NodeTypes.SEP) {\n n.color = NGSSColors.BLUE;\n n.highlightColor = NGSSColors.BLUE_HIGHLIGHT;\n n.order = 5\n }\n else if (n.Type == NodeTypes.CC) {\n n.color = NGSSColors.GREEN;\n n.highlightColor = NGSSColors.GREEN_HIGHLIGHT;\n n.order = 4;\n }\n else if (n.Type == NodeTypes.PE) {\n n.color = NGSSColors.GREY;\n n.highlightColor = NGSSColors.GREY_HIGHLIGHT;\n n.order = 2;\n }\n else if (n.Type == NodeTypes.TOPIC) {\n n.color = NGSSColors.PURPLE;\n n.highlightColor = NGSSColors.PURPLE_HIGHLIGHT;\n n.order = 1;\n }\n else if (n.Type == NodeTypes.CC_CATEGORY) {\n n.color = NGSSColors.GREEN;\n n.highlightColor = NGSSColors.GREEN_HIGHLIGHT;\n }\n else if (n.Type == NodeTypes.SEP_CATEGORY) {\n n.color = NGSSColors.BLUE;\n n.highlightColor = NGSSColors.BLUE_HIGHLIGHT;\n }\n else if (n.Type == NodeTypes.DCI_CATEGORY) {\n n.color = NGSSColors.ORANGE;\n n.highlightColor = NGSSColors.ORANGE_HIGHLIGHT;\n }\n else if (n.Type == NodeTypes.TOPIC_GRADEBAND) {\n n.color = NGSSColors.PURPLE;\n n.highlightColor = NGSSColors.PURPLE_HIGHLIGHT;\n }\n else if (n.Type == NodeTypes.RESOURCE) {\n //get the provider for that node and add the correct color and shape\n var prov = DataStoreObj.Providers[n.Provider]\n n.color = prov.color;\n n.highlightColor = prov.highlightColor;\n n.shape = prov.shape;\n }\n }\n }", "title": "" }, { "docid": "73228aed6ae3c297addf8697a651f3c2", "score": "0.51266074", "text": "function makeColors(data, kind, range) {\n\n var colors = [];\n\n if (kind === \"hex\") {\n data.forEach(function (record) {\n // Only prominent colors\n colors.push(record.colors[0].color);\n });\n }\n\n if (kind === \"hue\") {\n data.forEach(function (record) {\n // Only prominent hues\n colors.push(record.colors[0].hue);\n });\n }\n\n return colors;\n}", "title": "" }, { "docid": "6c8e5640b3c6a1a8af99b1fbd75b7155", "score": "0.51212955", "text": "function gradientColors(startColor, steps, endColor) {\n\nif (startColor && endColor) { // && !args2js.colors && args2js.colors.length != args2js.data.length)\n\n\tvar colors = new Array();\n\tif (!startColor.length) // We give up coloring task for the CSS declarations over here\n\t\treturn '';\n\n\tvar csteps = 0;\n\tif (!endColor) {\n\t\tvar acolor = d3.hsl(startColor);\n\t\t// Defining proper lightness change step\n\t\tif (acolor.l > 0.5) { // Starting color is over 50% from all lightness => going to darken it\n\t\t\tcsteps = acolor.l / (steps); // Target range: (startColor lightness ... black/0)\n\t\t\tssteps = acolor.s / steps;\n\t\t} else { // ... or brighten up\n\t\t\tcsteps = (1-acolor.l) / (steps); // Target range: (startColor lightness ... white/1)\n\t\t\tssteps = (1-acolor.s) / steps;\n\t\t}\n\t\t// Generating colors (without endColor given)\n\t\tvar thecolor = acolor;\n\t\tfor (i=0; i<steps; i++) {\n\t\t\tcolors.push(thecolor.toString());\n\t\t\t// console.info(acolor.l);\n\t\t\t// thecolor = d3.hsl(d3.hsl(thecolor).h, d3.lab(thecolor).s+ssteps, d3.lab(thecolor).l+csteps);\n\t\t\tif (acolor.l > 0.49)\n\t\t\t\tthecolor = thecolor.darker(csteps*4);\n\t\t\telse\n\t\t\t\tthecolor = thecolor.brighter(csteps*4);\n\t\t}\n\t} else { \n\t\t// Here we have start and end color traveling from => to by using steps of given color changes\n\t\t// We encode start and end colors by using Lab's color model's components from HTML's color strings\n\t\tvar startColor = d3.lab(startColor);\n\t\tvar Lab_start = new Array(startColor.l, startColor.a, startColor.b);\n\t\tvar endColor = d3.lab(endColor);\n\t\tvar Lab_end = new Array(endColor.l, endColor.a, endColor.b);\n\n\t\tsteps = steps - 1;\n\t\t// Time to define (L,a,b) linear steps for each components change and build result\n\t\tvar L_step = (-Lab_start[0]+Lab_end[0]) / steps;\n\t\tvar a_step = (-Lab_start[1]+Lab_end[1]) / steps;\n\t\tvar b_step = (-Lab_start[2]+Lab_end[2]) / steps;\n\t\t// Generating color ramp by using these steps together from start to end color\n\t\tvar thecolor = startColor;\n\t\tfor (i=0; i<steps+1; i++) {\n\t\t\tcolors.push(thecolor.toString());\n\t\t\tthecolor = d3.lab(d3.lab(thecolor).l+L_step, d3.lab(thecolor).a+a_step, d3.lab(thecolor).b+b_step);\n\t\t}\n\t\t// Why use D3's Lab (vs HSL) model here: 'father of all humans coloring models :-)':\n\t\t// *** http://www.photozone.de/colorimetric-systems-and-color-models\n\t}\n\n\treturn colors;\n} else\n\treturn new Array(); // empty array\n} // gradientColors", "title": "" }, { "docid": "4f909d6050a7a73fc474199b3e4f8bfc", "score": "0.512079", "text": "function nodeColorFunc(d) {\n if (d == selected_node) {\n return {\"fill\": \"yellowgreen\", \"stroke\": \"green\", \"stroke-width\": \"2px\"};\n } else if (d.is_root) {\n return {\"fill\": \"lightcoral\", \"stroke\": \"red\", \"stroke-width\": \"1.5px\"};\n } else if (d.children) {\n return {\"fill\": \"#fff\", \"stroke\": \"steelblue\", \"stroke-width\": \"1.5px\"};\n } else if (d.n_children == 0) {\n return {\"fill\": \"mediumpurple\", \"stroke\": \"purple\", \"stroke-width\": \"1.5px\"};\n } else {\n return {\"fill\": \"lightsteelblue\", \"stroke\": \"steelblue\", \"stroke-width\": \"1.5px\"};\n }\n }", "title": "" }, { "docid": "668d1e28e42d117b7f53e97eb4bf6801", "score": "0.5113566", "text": "get lColor() { return this.color && this.color.toRgb() || \"\"; }", "title": "" }, { "docid": "2e6609494d90907ada0e279eb63f2152", "score": "0.51118195", "text": "function getColor(depth) {\n return depth < 10 ? \"#A3F600\" :\n depth < 30 ? \"#DCF400\" :\n depth < 50 ? \"#F7DB11\" :\n depth < 70 ? \"#FDB72A\" :\n depth < 90 ? \"#FCA35D\" :\n depth >= 90 ? \"#FF5F65\" : \"000000\";\n}", "title": "" }, { "docid": "3302a031fd9b98dbe5b8531b636eec78", "score": "0.51098627", "text": "function recursiveColoring(graphLines,coloredNode, coloredNode_line){\n //if the colored node is condition\n if (isCond(coloredNode_line)){\n graphLines=recursiveColorCondition(coloredNode_line,graphLines,coloredNode);\n\n }\n //normal colored node\n else{\n graphLines=recursiveColorNormal(graphLines,coloredNode);\n }\n return graphLines;\n}", "title": "" }, { "docid": "134f06ae01261976cc058a19db25b8de", "score": "0.5109487", "text": "function color(d) {\n return d._children ? \"#3182bd\" : d.children ? \"#c6dbef\" : \"#fd8d3c\";\n }", "title": "" }, { "docid": "55dd19c5b801c9920cc9e9e2b08f99d2", "score": "0.5108534", "text": "function fcColor(d) \n{\n\tif(d.IsRoot)\n\t\treturn \"#dd6d2c\";\n\tif(d.size > 1)\n\t\treturn \"#70a0cf\";\n\tif(d._children)\n\t\treturn \"#3182bd\";\n\treturn \"#c6dbef\";\n}", "title": "" }, { "docid": "74a6274af758ef20a51e3660e4c83483", "score": "0.51023555", "text": "function colors(d){\r\n try{\r\n while(colorDicc[d.data.name] == undefined){\r\n d = d.parent;\r\n }\r\n return colorDicc[d.data.name];\r\n }catch{\r\n ;\r\n }\r\n }", "title": "" }, { "docid": "51876cbe009d5d5170f215b42b794153", "score": "0.5066461", "text": "function choropleth(props, colorScale){\n \t\t//make sure attribute value is a number\n \t\tvar val = parseFloat(props[expressed]);\n \t\t//if attribute value exists, assign a color; otherwise assign red\n \t\tif (val && val != NaN){\n \t\treturn colorScale(val);\n \t\t} else {\n \t\treturn \"#e34a33\";\n \t\t//return \"#2ca25f\";\n \t\t};\n\t\t}", "title": "" }, { "docid": "a0b03db016d864dd1391fc6a7da0e137", "score": "0.50628704", "text": "function updateColor(data, d) {\n\t\tvar line;\n\n\t\tlevelColorRange[d.id] = d.value;\n\t\tlevelColorScale.range(levelColorRange);\n\n\t\tline = svg.selectAll(\"line\")\n\t\t\t.data(data, function(d, i) {\n\t\t\t\treturn i;\n\t\t\t});\n\n\t\tline.style(\"stroke\", function(d) {\n\t\t\t\treturn levelColorScale(d.level);\n\t\t\t});\n\t}", "title": "" }, { "docid": "c5e936e6939ed891fc26b1d98e74026d", "score": "0.5054294", "text": "getColorDomainRangeMax(option) {\n const hasProp = (p) => option && option[p]\n const isArray = Array.isArray(option[COLOR_LINEAR_RANGE])\n\n // if option is an array, the domain are the Object.values\n const domain = hasProp(COLOR_LINEAR_RANGE)\n ? isArray\n ? Object.values(option[COLOR_LINEAR_RANGE])\n : Object.keys(option[COLOR_LINEAR_RANGE]).map((k) => parseInt(k))\n : []\n\n // if option is an array, the range are empty\n const range = hasProp(COLOR_LINEAR_RANGE)\n ? isArray\n ? []\n : Object.values(option[COLOR_LINEAR_RANGE])\n : []\n\n // if option is an array, the range are empty\n const colorScheme = option[COLOR_SCHEME]\n\n const max = option[COLOR_MAX] || d3.max(domain)\n\n return {\n colorDomain: domain.map((d) => d / max),\n colorRange: range && range.length > 0 ? range : colorScheme,\n colorMax: max\n }\n }", "title": "" }, { "docid": "c5e936e6939ed891fc26b1d98e74026d", "score": "0.5054294", "text": "getColorDomainRangeMax(option) {\n const hasProp = (p) => option && option[p]\n const isArray = Array.isArray(option[COLOR_LINEAR_RANGE])\n\n // if option is an array, the domain are the Object.values\n const domain = hasProp(COLOR_LINEAR_RANGE)\n ? isArray\n ? Object.values(option[COLOR_LINEAR_RANGE])\n : Object.keys(option[COLOR_LINEAR_RANGE]).map((k) => parseInt(k))\n : []\n\n // if option is an array, the range are empty\n const range = hasProp(COLOR_LINEAR_RANGE)\n ? isArray\n ? []\n : Object.values(option[COLOR_LINEAR_RANGE])\n : []\n\n // if option is an array, the range are empty\n const colorScheme = option[COLOR_SCHEME]\n\n const max = option[COLOR_MAX] || d3.max(domain)\n\n return {\n colorDomain: domain.map((d) => d / max),\n colorRange: range && range.length > 0 ? range : colorScheme,\n colorMax: max\n }\n }", "title": "" }, { "docid": "5685fa1b716fe9e89691dfa3b0b24cd1", "score": "0.5045588", "text": "function createColorSet(color) {\n const colorCool = {\n r: colorValLimit(color.r - 90),\n g: colorValLimit(color.g - 20),\n b: colorValLimit(color.b - 10),\n };\n\n const colorWarm = {\n r: colorValLimit(color.r - 10),\n g: colorValLimit(color.g - 20),\n b: colorValLimit(color.b - 90),\n };\n\n const base = {\n r: colorValLimit(color.r),\n g: colorValLimit(color.g),\n b: colorValLimit(color.b),\n };\n\n return {\n base: {\n obj: base,\n str: `rgb(${base.r}, ${base.g}, ${base.b})`,\n },\n cool: {\n obj: colorCool,\n str: `rgb(${colorCool.r}, ${colorCool.g}, ${colorCool.b})`,\n },\n warm: {\n obj: colorWarm,\n str: `rgb(${colorWarm.r}, ${colorWarm.g}, ${colorWarm.b})`,\n },\n };\n}", "title": "" }, { "docid": "74b25cbbfd8747a119d59318c8079513", "score": "0.5045575", "text": "function changeValuesOfColor(attributeToChange, color) {\n let manipulatedColor = Object.assign({}, color)\n let lightnessVal = Math.random() * 0.85 + 0.15\n let saturationVal = Math.random() * 0.65 + 0.15\n\n switch (attributeToChange) {\n case 'LIGHTNESS':\n manipulatedColor.l = lightnessVal.toFixed(2)\n break\n case 'SATURATION':\n manipulatedColor.s = saturationVal.toFixed(2)\n break\n case 'LIGHTNESS_SATURATION':\n manipulatedColor.l = lightnessVal.toFixed(2)\n manipulatedColor.s = saturationVal.toFixed(2)\n break\n default:\n throw new 'Oops, seems like the randomizer messed something up.'\n }\n\n return manipulatedColor\n}", "title": "" }, { "docid": "639953e5bbf9daa5a3f7189b21ea7bd2", "score": "0.50428015", "text": "setupColors () {\n let _tempCol = d3.scale.category20().range()\n if (this.colNames.length > _tempCol.length) {\n let _l = _tempCol.length\n for (let i = 0; i < this.colNames.length - _l; i++) {\n _tempCol.push(_tempCol[i])\n }\n }\n return _tempCol\n }", "title": "" }, { "docid": "d40d9ea422e7b310fd899f8a8c33e519", "score": "0.5040148", "text": "function choropleth(props, colorScale){\n //make sure attribute value is a number\n var val = parseFloat(props[expressed]);\n\t\t\t\tconsole.log(parseFloat(props[expressed]));\n //if attribute value exists, assign a color; otherwise assign gray\n if (typeof val == 'number' && val > 0){\n return colorScale(val);\n } else {\n return \"#fafafa\";\n };\n}", "title": "" }, { "docid": "fc1e626b65c613021b24dfa1eec1ca7a", "score": "0.5039953", "text": "function getColor(data, index){\n return data.color;\n }", "title": "" }, { "docid": "e63c3da798859a86c344e20d5a4f1f05", "score": "0.50390035", "text": "function getColor(depth) {\n switch (true) {\n case depth > 90:\n return \"#ea2c2c\";\n case depth > 70:\n return \"#ea822c\";\n case depth > 50:\n return \"#ee9c00\";\n case depth > 30:\n return \"#eecc00\";\n case depth > 10:\n return \"#d4ee00\";\n default:\n return \"#98ee00\";\n }\n }", "title": "" }, { "docid": "6c31c707288adf7e6a21dc6f811abf7f", "score": "0.5032787", "text": "function legendsRange(nodeValuesNum){\n if(!isEmpty(nodeValuesNum)){\n if(!nodeValuesNum.includes(\"empty\")){\n var nodesMin = nodeValuesNum.reduce(function(a, b) {\n return parseFloat(Math.min(a, b).toFixed(2));\n });\n if(nodesMin > 0){\n nodesMin = -1;\n }\n else if(nodesMin >= 0){\n nodesMin = -1.0;\n }\n var nodesMax = nodeValuesNum.reduce(function(a, b) {\n return parseFloat(Math.max(a, b).toFixed(2));\n });\n if(nodesMax < 0){\n nodesMax = 1;\n }\n\n if(nodesMax <= 0){\n nodesMax = 1.0;\n }\n else if(isNaN(nodesMin) && isNaN(nodesMax)){\n nodesMin = \"false\";\n nodesMax = \"true\";\n }\n }\n }\n else if(isEmpty(nodeValuesNum)){\n var nodesMin = \"false\";\n var nodesMax = \"true\";\n }\n return [nodesMin, nodesMax]\n}", "title": "" }, { "docid": "b12f2299be89ec1344d0c67fa09a4562", "score": "0.50301474", "text": "get color () { return this._color }", "title": "" }, { "docid": "173656314b1b46d864f206538c1133c9", "score": "0.502651", "text": "function getRange(hexColor) {\r\n const end = \"#fff\";\r\n return [chroma(hexColor).darken(1.4).hex(), hexColor, end];\r\n}", "title": "" }, { "docid": "94378cde0a5dfe79fb9495a371d01300", "score": "0.5023951", "text": "function colorByDistance(distances) {\n var allNodes = Svg.selectAll(\".node\");\n allNodes.select(\"circle\")\n .style(\"fill\", function(d) {\n if(distances[d.id] == -1) {\n return \"red\";\n } else if(distances[d.id] <= 1) {\n return \"green\";\n } else if(distances[d.id] <= 2) {\n return \"blue\";\n } else {\n return \"yellow\";\n }\n });\n}", "title": "" }, { "docid": "fe4b3e81740f32179f2ede7b315f1d03", "score": "0.5011515", "text": "function type2color(type){\n if(type==\"f\") return d3.schemeCategory20[0]\n if(type==\"b\"||type==\"c\") return d3.schemeCategory20[1]\n if(type==\"a\") return d3.schemeCategory20[2]\n return \"black\"\n }", "title": "" }, { "docid": "39b09444ed697a8d59a6ab2c10caa214", "score": "0.50107783", "text": "function setColorScale() {\r\n\tswitch(model) {\r\n\t\tcase \"comFr\":\r\n\t\tcase \"wattsA\":\r\n\t\tcase \"wattsB\":\r\n\t\tcase \"gilbert\":\r\n\t\tcase \"barab\":\r\n\t\t\tcolor = d3.scaleLinear()\r\n\t\t\t\t.domain([0, d3.max(nodes, radius)])\r\n\t\t\t\t.range([\"black\", \"white\"]);\r\n\t\t\tinitColor = d3.scaleLinear()\r\n\t\t\t\t.domain([0, d3.max(nodes, radius)])\r\n\t\t\t\t.range([\"red\", \"white\"]);\r\n\t\t\tbreak;\r\n\t\tcase \"minor\":\r\n\t\t\tcolor = d3.scaleOrdinal()\r\n\t\t\t\t.domain([\"minor\", \"major\"])\r\n\t\t\t\t.range([\"orange\",\"lightblue\"]);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsole.log(\"Wrong model in setColorScale: \" + model)\r\n\t\t\tbreak;\r\n\t}\r\n }", "title": "" }, { "docid": "9e19462f63effe47714e6977b4a08a52", "score": "0.5009244", "text": "function choropleth(props, colorScale){\n \n //make sure attribute value is a number\n var val = parseFloat(props[expressed]);\n //if attribute value exists, assign a color; otherwise assign gray\n if (typeof val == 'number' && !isNaN(val)){\n return colorScale(val);\n } else {\n\n return \"#CCC\";\n };\n}", "title": "" }, { "docid": "d66e7fffeddd5a5873ae8f79365ec29c", "score": "0.50076336", "text": "function setColor(d) {\n var name = d.data.name;\n d.color = color.domain().indexOf(name) >= 0 ? color(name) : d.parent ? d.parent.color : null;\n if (d.children) d.children.forEach(setColor);\n}", "title": "" }, { "docid": "e727d4decca4c82f1edcc119abf6c2c0", "score": "0.49887744", "text": "function uvColor () {\n var uvIndex = uv.textContent.slice(9);\n if(uvIndex < 2){\n uv.setAttribute('class', 'safe');\n } else if (uvIndex < 8) {\n uv.setAttribute('class', 'concern');\n } else if (uvIndex > 8) {\n uv.setAttribute('class', 'danger');\n }\n}", "title": "" } ]
36e9bd9bd72b0500454a25568a466346
Den Query zusammenstellen und mit sendRequest(query) an den Server weitergeben
[ { "docid": "1f40d88faca6b1906cec701024945aca", "score": "0.0", "text": "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 }", "title": "" } ]
[ { "docid": "44dabeac633e2802a855d1ed8f43b33e", "score": "0.7341942", "text": "query() { }", "title": "" }, { "docid": "fd7c0a60bcaf2acd64f86aee6d1260b2", "score": "0.7287378", "text": "async query(query) {\n\n }", "title": "" }, { "docid": "558a89675919ed0eb8415dd0649326ea", "score": "0.720816", "text": "function sendQuery(){\n \n if(APP && APP.network){\n var netStat = APP.network()\n , info = '';\n if(!netStat){\n info = '网络错误,请检查网络连接。'\n callError(info);\n return;\n }\n }\n \n var xhr = new XMLHttpRequest()\n , url = 'http://bistulib.dmdgeeker.com/search?key=' + context.key + '&match=' + context.match;\n \n xhr.onreadystatechange = function(){\n var response = null;\n if(xhr.readyState === 4){\n if((xhr.status >= 200 && xhr.status < 300)|| xhr.status === 304){\n response = xhr.responseText;\n pageState.success(response);\n }\n else {\n var serverError = '服务器出错了:' + xhr.status;\n callError(serverError);\n }\n }\n else {\n // pageState.loading();\n }\n };\n \n xhr.onprogress = function(evt){\n if(evt.lengthComputable){\n //loadProgress.innerText = Math.round(100*evt.loaded/evt.total) + '%';\n }\n };\n \n xhr.timeout = 70000;\n xhr.ontimeout = function(){\n var timeoutError = '加载超时,请检查网络连接。';\n callError(timeoutError);\n xhr.abort();\n };\n \n xhr.open('GET', url);\n xhr.send(null);\n }", "title": "" }, { "docid": "2a5a27f0c7e5c333d22f7b9afe339f8f", "score": "0.7000663", "text": "function executeRequest(query) {\n console.log('entering executeRequest', query);\n var request = new Request(query, function(err) {\n\n if (err) {\n console.log('>>>>error encountered');\n console.log(err);\n } else {\n console.log('>>>>request successfully handled');\n console.log('redirecting to Survey');\n res.redirect('/survey');\n }\n\n });\n console.log('request about to execute');\n connection.execSql(request);\n\n }", "title": "" }, { "docid": "c0ee3003b41c30de617a8b66eaea3b35", "score": "0.68582827", "text": "async query (verb, query) {\n await this.connecting()\n return this.connection.request(verb, query)\n }", "title": "" }, { "docid": "36f7d97857c43970db60b9a61e834010", "score": "0.68331426", "text": "function QueryExec(param)\r\n{\r\n \r\n if (is_r() && $v('service') == '')\r\n {\r\n alert('You must specify \"Query Service Endpoint\"!');\r\n return;\r\n }\r\n // if it is compile, clear the etalon\r\n if (param == 'c')\r\n $('etalon').innerHTML = '';\r\n $('res_area').innerHTML = 'Sending query...';\r\n\r\n // Determine format, if it is table the we need json results\r\n var format = $v('format');\r\n if (!format) format = 'text/html';\r\n if (format == 'application/isparql+table')\r\n format = 'application/sparql-results+json'; \r\n var content_type = 'application/x-www-form-urlencoded';\r\n \r\n var ReqHeaders = {'Accept':format,'Content-Type':content_type};\r\n\r\n // generate the request body\r\n var body = function()\r\n {\r\n var body = '';\r\n \r\n // parameters we will send\r\n var params = ['default-graph-uri','query','format','maxrows'];\r\n // if it is remote add service endpoint\r\n if (is_r())\r\n params.push('service');\r\n else\r\n params.push('should-sponge');\r\n \r\n for(var i = 0; i < params.length; i++)\r\n {\r\n if (!(params[i] == 'default-graph-uri' && $v('default-graph-uri') == '') && // Patch ot skip default graph if it is empty;\r\n !($(params[i]).type == 'checkbox' && !$(params[i]).checked)) // Skip unchecked checkboxes\r\n {\r\n if (body != '') \r\n body += '&'; \r\n body += params[i] + '=';\r\n if (params[i] == 'format') // If it is format get the overwritten value\r\n {\r\n body += encodeURIComponent(format); \r\n }\r\n else if ($(params[i]).type == 'radio')\r\n {\r\n for(var n = 0; n < $(params[i]).form.elements[$(params[i]).name].length;n++)\r\n if ($(params[i]).form.elements[$(params[i]).name][n].checked)\r\n body += encodeURIComponent($(params[i]).form.elements[$(params[i]).name][n].value); \r\n }\r\n else\r\n body += encodeURIComponent($v(params[i])); \r\n }\r\n }\r\n \r\n // get all checked named_graphs from named graphs tab\r\n named_graphs = document.getElementsByName('named_graph_cbk');\r\n \r\n if(named_graphs && named_graphs.length > 0)\r\n {\r\n for(var n = 0; n < named_graphs.length; n++)\r\n {\r\n // if it is checked, add to params too\r\n if (named_graphs[n].checked)\r\n {\r\n var named_graph_value = $v('named_graph_'+named_graphs[n].value);\r\n if (named_graph_value != '')\r\n {\r\n if (body != '') \r\n body += '&'; \r\n body += 'named-graph-uri=';\r\n body += encodeURIComponent(named_graph_value); \r\n }\r\n }\r\n }\r\n }\r\n \r\n return body;\r\n };\r\n\r\n //RESULT PROCESSING\r\n var callback = function(data,headers) \r\n { \r\n // Clear the tabls\r\n OAT.Dom.unlink($('res_container'));\r\n OAT.Dom.unlink($('result'));\r\n OAT.Dom.unlink($('request'));\r\n OAT.Dom.unlink($('response'));\r\n\r\n $('res_area').innerHTML = '';\r\n var tabres_html = '';\r\n \r\n // Make the tabs \r\n tabres_html += '<ul id=\"tabres\">';\r\n tabres_html += '<li id=\"tabres_result\">Result</li><li id=\"tabres_request\">Raw Request/Permalinks</li><li id=\"tabres_response\">Raw Response</li>';\r\n tabres_html += '</ul>';\r\n tabres_html += '<div id=\"res_container\"></div>';\r\n tabres_html += '<div id=\"result\">' + data + '</div>';\r\n $('res_area').innerHTML += tabres_html;\r\n \r\n var body_str = body();\r\n var request = '';\r\n request += '<div id=\"request\"><pre>';\r\n request += 'POST ' + endpoint + ' HTTP 1.1\\r\\n';\r\n request += 'Host: ' + window.location.host + '\\r\\n';\r\n if (ReqHeaders) {\r\n\t\t for (var p in ReqHeaders) {\r\n\t\t request += p + ': ' + ReqHeaders[p] + '\\r\\n';\r\n\t\t }\r\n\t\t}\r\n request += 'Content-Length: ' + body_str.length + '\\r\\n';\r\n request += '\\r\\n';\r\n request += body_str.replace(/&/g,'&amp;').replace(/</g,'&lt;');\r\n request += '<br/><br/><a href=\"'+endpoint+body_str+'\">direct link to result</a>&nbsp;-&nbsp;<a href=\"http://tinyurl.com/create.php?url=http://'+window.location.host+endpoint+body_str+'\"><i>create tinyurl</i></a>'; \r\n if (!body_str.match(/format=application%2Fsparql-results%2Bxml/))\r\n { request += '<br/><a href=\"'+endpoint+body_str.replace(/format=.*(&|$)/,'format=application%2Fsparql-results%2Bxml').replace(/\\?maxrows=.*/,'')+'\">direct link to query results as sparql/xml (no max rows)</a>';\r\n request += '&nbsp;-&nbsp;<a href=\"http://tinyurl.com/create.php?url=http://'+window.location.host+endpoint+body_str.replace(/format=.*(&|$)/,'format=application%2Fsparql-results%2Bxml').replace(/\\?maxrows=.*/,'')+'\"><i>create tinyurl</i></a>'}\r\n request += '<br/><a href=\"'+body_str.replace(/query/,'?query')+'\">direct link to query form filled with this query</a>'; \r\n request += '&nbsp;-&nbsp;<a href=\"http://tinyurl.com/create.php?url=http://'+window.location.host+endpoint+body_str+'\"><i>create tinyurl</i></a>'; \r\n request += '<br/><a href=\"'+body_str.replace(/query/,'?query')+'&go=1\">direct link to query form filled with this query and immediately run query</a>'; \r\n request += '&nbsp;-&nbsp;<a href=\"http://tinyurl.com/create.php?url=http://'+window.location.host+endpoint+body_str+'&go=1\"><i>create tinyurl</i></a>'; \r\n request += '</div>';\r\n// request += '</pre></div>'; \r\n $('res_area').innerHTML += request; \r\n\r\n var response = '';\r\n response += '<div id=\"response\"><pre>';\r\n response += headers;\r\n response += '\\r\\n';\r\n response += data.replace(/&/g,'&amp;').replace(/</g,'&lt;');\r\n response += '</pre></div>'; \r\n $('res_area').innerHTML += response; \r\n\r\n var tabres = new OAT.Tab (\"res_container\");\r\n tabres.add (\"tabres_result\",\"result\");\r\n tabres.add (\"tabres_request\",\"request\");\r\n tabres.add (\"tabres_response\",\"response\");\r\n tabres.go(0);\r\n\r\n //if it is a special format and param is empty then we postprocess json to draw a table\r\n if ($v('format') == '' && !param)\r\n {\r\n $('result').innerHTML += '<div id=\"grid\"></div>'; \r\n table = find_child_element($('result'),'table');\r\n var grid = new OAT.Grid(\"grid\",0);\r\n load_grid(grid,table);\r\n table.parentNode.removeChild(table);\r\n grid.ieFix();\r\n\t if (typeof grid2 != 'undefined')\r\n grid2.ieFix();\r\n }\r\n else\r\n {\r\n // it is either and error or compile\r\n if (param)\r\n {\r\n $('result').innerHTML = data;\r\n // result too big to post process, just show it\r\n } else if (data.length > 10 * 1024) {\r\n \r\n $('result').innerHTML = '<pre>' + data.replace(/</g,'&lt;') + '</pre>';\r\n // ry to postprocess it \r\n } else {\r\n var shtype = 'xml';\r\n if ($v('format') == 'application/sparql-results+json' || \r\n $v('format') == 'application/javascript' )\r\n shtype = 'javascript';\r\n else if ($v('format') == 'text/html')\r\n shtype = 'html';\r\n $('result').innerHTML = '<textarea name=\"code\" class=\"' + shtype + '\">' + data + '</textarea>';\r\n dp.SyntaxHighlighter.HighlightAll('code',0,0);\r\n }\r\n }\r\n\r\n };\r\n \r\n var endpoint = '';\r\n // it it is not remote or compile send to local sparql endpoint\r\n if (!is_r() && !param)\r\n endpoint = '/sparql/?'\r\n // if it is compile \r\n else if (param == 'c')\r\n endpoint = 'explain.vsp?';\r\n // it must be remote then\r\n else \r\n endpoint = '/library/php/remote.php?';\r\n \r\n\toptObj = {\r\n\t\theaders:ReqHeaders,\r\n\t\ttype:OAT.AJAX.TYPE_TEXT,\r\n\t\t//in case of an error exec the callback also, but give a parameter er\r\n\t\tonerror:function(xhr)\r\n {\r\n var status = xhr.getStatus();\r\n var response = xhr.getResponseText();\r\n\t\t\tvar headers = xhr.getAllResponseHeaders();\r\n\t\t\tvar data = '';\r\n param = 'er';\r\n if (!response)\r\n {\r\n response = 'There was a problem with your request! The server returned status code: ' + status + '<br/>\\n';\r\n response += 'Unfortunately your browser does not allow us to show the error. ';\r\n response += 'This is a known bug in the Opera Browser.<br/>\\n';\r\n response += 'However you can click this link which will open a new window with the error: <br/>\\n';\r\n response += '<a target=\"_blank\" href=\"/sparql/?' + body() + '\">/sparql/?' + body() + '</a>';\r\n }\r\n else \r\n {\r\n data = response.replace(/&/g,'&amp;').replace(/</g,'&lt;');\r\n }\r\n callback('<pre>' + data + '</pre>',headers);\r\n }\r\n\t}\r\n \r\n OAT.AJAX.POST(endpoint, body(), callback, optObj);\r\n}", "title": "" }, { "docid": "702b9a97865ca960d47ea7c3303cd5f0", "score": "0.67704016", "text": "function runQuery(query) {\n connection.query(query, function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n // console.log response as JSON\n console.log(JSON.stringify(res[i]));\n }\n runSearch();\n });\n}", "title": "" }, { "docid": "cad116cc718db7abbffb4aa39418163d", "score": "0.6755931", "text": "function runQuery( queryString , res){\r\n var query = db.query( queryString, function(err, result){\r\n if(err){\r\n console.log('Error in query: ' + err);\r\n } else {\r\n sendJSON(result, res);\r\n } \r\n });\r\n}", "title": "" }, { "docid": "993be7d240a604bd02314b78cc9fc1bd", "score": "0.6720939", "text": "query(oracleId, queryFee, queryTtl, responseTtl, fee, query) {\n // if (this.oracle) {\n let data = {\n 'target': 'oracle',\n 'action': 'query',\n 'payload': {\n 'type': 'OracleQueryTxObject',\n 'vsn': 1,\n 'oracle_pubkey': oracleId,\n 'query_fee': queryFee,\n 'query_ttl': {'type': 'delta', 'value': queryTtl},\n 'response_ttl': {'type': 'delta', 'value': responseTtl},\n 'fee': fee,\n 'query': typeof query.toString !== 'undefined' ? query.toString(): query\n }\n }\n this.webSocket.send (JSON.stringify (data))\n return data\n }", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.67186373", "text": "function TQuery() {}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.67186373", "text": "function TQuery() {}", "title": "" }, { "docid": "c4c36ad51609b958dedc9c9b90bc0d5e", "score": "0.67186373", "text": "function TQuery() {}", "title": "" }, { "docid": "31f155a035c8acdc9dcd24b973892b22", "score": "0.6711042", "text": "function TQueries() {}", "title": "" }, { "docid": "31f155a035c8acdc9dcd24b973892b22", "score": "0.6711042", "text": "function TQueries() {}", "title": "" }, { "docid": "31f155a035c8acdc9dcd24b973892b22", "score": "0.6711042", "text": "function TQueries() {}", "title": "" }, { "docid": "5100678354940a6dca64cbd0efc1dc88", "score": "0.66969335", "text": "executeQuery(res, query){ \n sql.connect(dbConfig, function (err) {\n if (err) { \n console.log(\"Error while connecting database :- \" + err);\n res.send(err);\n }\n else {\n // create Request object\n var request = new sql.Request();\n // query to the database\n request.query(query, function (err, res) {\n if (err) {\n console.log(\"Error while querying database :- \" + err);\n res.send(err);\n }\n else {\n res.send(res);\n }\n });\n }\n }); \n }", "title": "" }, { "docid": "9c62d5f4abb59f48e37351cb84c41502", "score": "0.6687764", "text": "run(){\n let [q, ...args] = this._getQuery();\n return this.client._query(q, args, {emitter: this}).then(data => {\n this.emit('data', data);\n return data;\n });\n }", "title": "" }, { "docid": "477d0afabf716dbecd60475df3b5e2cb", "score": "0.66093665", "text": "function TQueries(){}", "title": "" }, { "docid": "e78b72af6ccde4010fbaed8ed76997a1", "score": "0.66089505", "text": "function queryCheck() {\n var queryLog = document.querySelector(\".query\");\n var query = response.query;\n console.log(query);\n\n queryLog.innerHTML += query;\n }", "title": "" }, { "docid": "7a281c252ec7839ef010351a53f580af", "score": "0.6599221", "text": "function TQuery() { }", "title": "" }, { "docid": "7a281c252ec7839ef010351a53f580af", "score": "0.6599221", "text": "function TQuery() { }", "title": "" }, { "docid": "c262444c1bee8f96182d9754dd74332e", "score": "0.65786636", "text": "function ______MA_Query() {}", "title": "" }, { "docid": "9f20bff7109ade392ddbb6d0da8f6571", "score": "0.65288717", "text": "function queryRequest(query){\n\t/* Process Request Modified from CS 290 Lecture \n\t http://eecs.oregonstate.edu/ecampus-video/CS290/core-content/hello-node/express-forms.html */\n\tvar qParams = [];\n\tfor (var p in query){ /* Loop through request query */\n\t\tqParams.push({'name':p,'value':query[p]})\n\t}\n\treturn qParams; /* Add requrest to context object */\n\t//return context;\n}", "title": "" }, { "docid": "7ba01316283ab0bc84f9722d45952745", "score": "0.65085906", "text": "function LQuery() {}", "title": "" }, { "docid": "7ba01316283ab0bc84f9722d45952745", "score": "0.65085906", "text": "function LQuery() {}", "title": "" }, { "docid": "7ba01316283ab0bc84f9722d45952745", "score": "0.65085906", "text": "function LQuery() {}", "title": "" }, { "docid": "273e9f2cc751746f59f2ff2da74ba6ea", "score": "0.6504723", "text": "function TQuery(){}", "title": "" }, { "docid": "3189eeebf289ee48a1c5b733601d915c", "score": "0.6501564", "text": "function Query(port) {\n let http = require('http');\n\n //We need a function which handles requests and send response\n function handleRequest(request, response){\n let param = request.url.split(\"/\");\n let action = param[param.length - 1];\n if(action == \"serverInfo\") {\n let server_config = JSON.parse(g_server.config);\n let server_info = GetServer();\n\n let data = {\n name: server_info.serverName,\n maxPlayers: server_info.maxPlayers,\n serverMode: server_config.mode,\n serverMap: server_config.map,\n playersOnline: g_players.length\n };\n return response.end(JSON.stringify(data));\n return response.end(msg);\n }\n else if(action == \"playersList\") {\n let players = [];\n let msg = \"\";\n for(let p of g_players) {\n players.push({id: p.client.networkId, name: p.name});\n }\n return response.end(JSON.stringify(players));\n return response.end(msg);\n }\n return response.end(\"/serverInfo - Server info\\n/playerList - List of players\");\n }\n\n let server = http.createServer(handleRequest);\n server.listen(port, function(){\n console.log(\"Server listening on: http://localhost:%s\", port);\n });\n}", "title": "" }, { "docid": "004acc3d8508c3622b1e616166e45e88", "score": "0.6489128", "text": "function LQuery() { }", "title": "" }, { "docid": "004acc3d8508c3622b1e616166e45e88", "score": "0.6489128", "text": "function LQuery() { }", "title": "" }, { "docid": "4988666cdf706b4cfb650abfb00dd42b", "score": "0.64779484", "text": "query(...params) {\n this.connection.query(...params);\n }", "title": "" }, { "docid": "438896e625d2d6e1fdaf48928cc49b58", "score": "0.64471835", "text": "function TQueries() { }", "title": "" }, { "docid": "438896e625d2d6e1fdaf48928cc49b58", "score": "0.64471835", "text": "function TQueries() { }", "title": "" }, { "docid": "406e43e487aedf82b2b8bc7f12cdf12a", "score": "0.64450705", "text": "function send_request_query (str_name_namespace, str_value_query, callback_function) {\n var query = new XMLHttpRequest ();\n\n query.open (\"GET\", \"/query?name=\" + str_name_namespace + \"&value=\" + str_value_query);\n query.responseType = \"text\";\n query.onload = function (e) {\n\ttick_last_response = tick;\n callback_function (this.response);\n }\n query.send (); // TODO? Implement error checking?\n}", "title": "" }, { "docid": "f7fa77d2342c7427da21454c7c319cf8", "score": "0.643632", "text": "function LQuery(){}", "title": "" }, { "docid": "bfaf5ea8773f3334299947692d7a1d15", "score": "0.64015204", "text": "_query(connection, query) {\n return new Promise((resolve, reject) => {\n const rows = [];\n const request = this._makeRequest(query, (err, count) => {\n if (err) {\n return reject(err);\n }\n\n query.response = rows;\n\n process.nextTick(() => this._chomp(connection));\n\n resolve(query);\n });\n\n request.on('row', (row) => {\n debug('request::row');\n rows.push(row);\n });\n\n this._assignBindings(request, query.bindings);\n this._enqueueRequest(request, connection);\n });\n }", "title": "" }, { "docid": "72d4ec05d8d90f0aa8889844b963355b", "score": "0.6367447", "text": "function sendQuery( mysql_conn, queryString ) {\n\t\n\tif( mysql_conn == null)\n\t{\n\t\tthrow \"The mysql connection argument cannot be null\"; \n\t}\n\n\tfunction queryExec(resolve, reject) {\n\n\t\tmysql_conn.query( queryString, \tfunction( error, results) {\n\t\t\tif(error ){\n\t\t\t\treturn reject(error); \n\t\t\t}\n\t\t\telse \n\t\t\t{ \n\t\t\t\tconsole.log(\"Quering geodb: \" + queryString ); \n\t\t\t\t//console.log(results);\n\t\t\t\tresolve(results); \n\t\t\t}\n\t\t} );\n\t};\n\n\treturn new Promise( queryExec ); \n}", "title": "" }, { "docid": "97ed0070332f0f7af7b4c085d1a6c227", "score": "0.6360565", "text": "function LQueries() {}", "title": "" }, { "docid": "97ed0070332f0f7af7b4c085d1a6c227", "score": "0.6360565", "text": "function LQueries() {}", "title": "" }, { "docid": "97ed0070332f0f7af7b4c085d1a6c227", "score": "0.6360565", "text": "function LQueries() {}", "title": "" }, { "docid": "a7bd53d9aa7e615e79d67085c2771a60", "score": "0.6359804", "text": "query(params)\n {\n return this.doRequest({method: 'GET'}, null, params);\n }", "title": "" }, { "docid": "a8310e0ff7097772921bf5443a5b8be0", "score": "0.63501585", "text": "function runGenericQuery(query)\n{\n return new Promise((resolve, reject) => {\n var connection = new Connection(config);\n connection.on('connect', function(err) {\n if (err) {\n console.log(err);\n reject(err);\n } else {\n request = new Request(query.query, function(err) {\n if (err) {\n console.log(err);\n reject(new Error(err));\n } else {\n resolve(\"Operation successful\");\n }\n connection.close();\n }); \n \n query.params.forEach(function(param) {\n request.addParameter(param.paramName, param.paramType, param.paramValue);\n });\n\n connection.execSql(request);\n }\n });\n });\n}", "title": "" }, { "docid": "8cfdd27c1bc316257d220805d1acd570", "score": "0.6332704", "text": "function doQuery() {\n // Clear the results from a previous query\n resultsLyr.removeAll();\n /*********************************************\n *\n * Set the where clause for the query. This can be any valid SQL expression.\n * In this case the inputs from the three drop down menus are used to build\n * the query. For example, if \"Elevation\", \"is greater than\", and \"10,000 ft\"\n * are selected, then the following SQL where clause is built here:\n *\n * params.where = \"ELEV_ft > 10000\";\n *\n * ELEV_ft is the field name for Elevation and is assigned to the value of the\n * select option in the HTML below. Other operators such as AND, OR, LIKE, etc\n * may also be used here.\n *\n **********************************************/\n params.where = field + stateName.value;\n // executes the query and calls getResults() once the promise is resolved\n // promiseRejected() is called if the promise is rejected\n qTask.execute(params)\n .then(getResults)\n .otherwise(promiseRejected);\n }", "title": "" }, { "docid": "f35fb36367d02db31bd0131e676fdd86", "score": "0.6330516", "text": "function LQueries(){}", "title": "" }, { "docid": "af601577bcd84f8f8fb8eeec1c13e60f", "score": "0.6311181", "text": "function sendQuery(queryText) {\n // Post to my querying service\n var query_data = $('#queryTerms').val();\n\n if ($('#location').val() == \"\") {\n $.ajax({\n type: 'POST',\n url: 'http://localhost:1111/query/' + query_data,\n complete: function () {\n fillQueries();\n }\n });\n }\n else {\n $.ajax({\n type: 'POST',\n url: 'http://localhost:1111/query/' + query_data + '/' + $('#location').val(),\n complete: function () {\n fillQueries();\n }\n });\n }\n\n // Clear the input box\n $('#queryTerms').val(\"\");\n $('#location').val(\"\");\n $(\"#searchLocation\").removeAttr(\"checked\");\n }", "title": "" }, { "docid": "3ee2d87148d87d03dc4e9e93cb812b25", "score": "0.6268676", "text": "function _request(model, query64, _t){\n\t\t\t\t$.getJSON(_.template(model.API, { network: options.network || \"umg.fyre.co\" , query: query64} ), requestParams, \n\t\t\t\t\t\t_.bind(self.handleResponse, self, {requestCount:_batches.length, _batch: batch}, callback));\n\t\t\t}", "title": "" }, { "docid": "b2e15a9cc593b4f5cebd74de2702b179", "score": "0.6259047", "text": "query(rawQuery, ...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.connection && this.connection.isConnected) {\n return this.connection.query(rawQuery, args);\n }\n throw new ts_framework_common_1.BaseError('Connection is not available for query runner');\n });\n }", "title": "" }, { "docid": "971f3970db9ce0f2c78eff3f07c58042", "score": "0.6250438", "text": "function query() {\n //** 1 url process\n var url = $(\"#rtc-server-address\").val() + \"/sparql\";\n\n if ($.trim(url).length < 1) {\n showMsg('Please input the server address!', true);\n }\n\n //** 2 process spqral\n var sparql = $.trim($(\"#rtc-sparql\").val());\n sparql = filter(sparql);\n if (sparql === 0) {\n return;\n }\n $('#' + c.TABLE_RESULTS + ' treeitem').remove();\n\n //** 3 send request and receive response\n $.ajax({\n type: 'GET',\n headers: {\n Accept: \"application/sparql-results+json\"\n },\n url: url,\n data: {'query': sparql},\n dataType: \"json\",\n crossDomain: true,\n success: function(data) {\n fillList(data);\n json = JSON.stringify(data);\n },\n error: function(jqXHR, textStatus, errorThrown) {\n showMsg(\"SPARQL querying failure: \" + textStatus, true);\n console.log(errorThrown);\n console.log(jqXHR);\n }\n });\n}", "title": "" }, { "docid": "ec911682d54458d14f984792fd5097d7", "score": "0.6242253", "text": "query(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, queryOperationSpec);\n }", "title": "" }, { "docid": "ec911682d54458d14f984792fd5097d7", "score": "0.6242253", "text": "query(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, queryOperationSpec);\n }", "title": "" }, { "docid": "2cc6c374f7c2a9e8bc7cef3965fd2015", "score": "0.6242171", "text": "function RunDatabaseRequest(query, args, req, res, callback) {\n logRoute(req._parsedUrl.path);\n connpool.getConnection(function(err, conn) {\n if (err) {\n handleMysqlConnErr(err, res);\n } else {\n conn.query(query, args, function(err, response) {\n conn.release();\n if (err) {\n handleMysqlQueryErr(err, res);\n } else {\n res.status(200);\n res.type('json');\n callback(response);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "79c05323494166b72b1d709c41dc2fb1", "score": "0.6234696", "text": "constructor (query) {\n this.query = query\n }", "title": "" }, { "docid": "2fcf08fa87209d082e4f262670f9c9c8", "score": "0.62280613", "text": "async executeQuery({ query, removePrefix = true, queryName }) {\n await this.isServiceAvailable();\n const startTime = Date.now();\n const result = await this.g.query(query);\n logger.perfLog(startTime, 200, queryName);\n return formatResult(result, removePrefix);\n }", "title": "" }, { "docid": "b275e2c65e616cc3256e59e38ac0572d", "score": "0.62110263", "text": "function query(queryString, callback) {\n/*\n if (isConnected()) {\n connection.query(queryString, callback);\n } else {\n connect();\n query(queryString, callback);\n //callback(\"Not connected!\", null, null);\n }\n*/\n connection.query(queryString, callback);\n}", "title": "" }, { "docid": "35b8062e0e4dc1c77a2707f543988fdd", "score": "0.6209403", "text": "function sendToDb(query, res) {\r\n db.query(query, function(err, result, fields) {\r\n if (err) throw err;\r\n res.send(JSON.stringify(result));\r\n });\r\n}", "title": "" }, { "docid": "285f4ee737ad8ea1252efdfe3a7e7d20", "score": "0.61651176", "text": "function query()\n{\n return query_start(0, -1)\n}", "title": "" }, { "docid": "55d92e4132c787167cec3d0531d3c97b", "score": "0.6137505", "text": "addQuery(text) {}", "title": "" }, { "docid": "0da0e6b8b8e620a3356846bd33bdbb93", "score": "0.6124192", "text": "function doQuery(target, q){\n\t\tsetValue(target, q);\n\t}", "title": "" }, { "docid": "a297cd98c234310c827ce882a6b1dfd0", "score": "0.61013633", "text": "function sendSearchQuery(){\n lastAction = \"search\";\n if(!stopped){\n data = {};\n data['instance'] = collection;\n data['string_query'] = 'true';\n data['vector_query'] = 'false';\n query = $(\"div.task\"+currentTask).find('input[name=\"query\"]').val();\n data['query'] = query;\n data['vector_query'] = JSON.stringify(getCurrentVectorQuery());\n $(\".relevance-feedback-search-results\").show();\n $(\".relevance-feedback-search-results\").html(\"Loading...\");\n $.post(\"src/php/similarsentences/similarsentences.php\",\n data,\n handleResults);\n } else {\n startTimedTask(currentTask);\n sendSearchQuery();\n }\n logActivity({\n instance:collection,\n participant: getParticipant(),\n task_number: currentTask,\n activity: \"search\",\n search_query: query,\n num_relevant : -1,\n num_irrelevant: -1,\n })\n}", "title": "" }, { "docid": "825b22db6c18019532614b1fb3c61d7a", "score": "0.6098578", "text": "function querySearch (query) {\n\t\t\t\t\t\t \t//var results = $rootScope.clients;\n\t\t\t\t\t\t\t var results = query ? $rootScope.clients.filter(createFilterFor(query)) : $rootScope.clients,\n\t\t\t\t\t\t deferred;\n\t\t\t\t \t\t\treturn results;\n\t\t\t\t\t\t\t \n//\t\t\t\t\t\t \tvar urlClients = protocol_url + appHost + \"/client/operator/list\"\n//\t\t\t\t\t\t\t var data = {domain:appFirmDomain}\n//\t\t\t\t\t\t return httpService.GET(urlClients,data).then(\n//\t\t\t\t\t\t \t\tfunction(response) {\n//\t\t\t\t\t\t \t\t\tvar results = response.data;\n//\t\t\t\t\t\t \t\t\treturn results;\n//\t\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t }", "title": "" }, { "docid": "4814dd3e5d70152924d5291e64314a92", "score": "0.6097577", "text": "function LQueries() { }", "title": "" }, { "docid": "4814dd3e5d70152924d5291e64314a92", "score": "0.6097577", "text": "function LQueries() { }", "title": "" }, { "docid": "c4f65f356379d1534495e74e0b41d897", "score": "0.6092905", "text": "getFixedQuery() {}", "title": "" }, { "docid": "e3bdad5e9b07668b143ece9ba93bcafa", "score": "0.607545", "text": "power(query, req, res) {\n\n\t\t// Since the database field names are usually not case sensitive,\n\t\t// we can add lowercase to the parameters of the query, e.g.:\n\t\t//\t\tquery.formName => query.formname\n\t\tnoapi.params.attachLowerCase(query);\n\t}", "title": "" }, { "docid": "82008c34d8067c2e9dc3765ca64d9827", "score": "0.6074673", "text": "query(store, type, query) {\n let { backend, id } = query;\n return this.ajax(this._url(backend, id), 'GET', { data: { list: true } }).then(resp => {\n resp.id = id;\n resp.backend = backend;\n return resp;\n });\n }", "title": "" }, { "docid": "b13ed7e10cb0c5ab8e7bfa3155bdef45", "score": "0.604899", "text": "async selectingStatement(query){\n return HTTP.get(this.getConfig('database', '') + this._buildSelectUrl(query));\n }", "title": "" }, { "docid": "f629136814b762e30f2853bf240ae3a9", "score": "0.6043265", "text": "function doQuery(target, q){\n setValue(target, q, true);\n }", "title": "" }, { "docid": "9eb7c5bf02156beeb51e8e631415b6a3", "score": "0.60338646", "text": "function doQuery(target, q) {\n setValue(target, q);\n }", "title": "" }, { "docid": "9eb7c5bf02156beeb51e8e631415b6a3", "score": "0.60338646", "text": "function doQuery(target, q) {\n setValue(target, q);\n }", "title": "" }, { "docid": "796553b30ce63a4edd30557b8f2fa209", "score": "0.6030236", "text": "function sendQuery(queryString){\n console.log('Sending query with:')\n console.log(gcpProjectId)\n console.log(datasetId)\n\n var request = gapi.client.bigquery.jobs.query({\n 'query': queryString,\n 'timeoutMs': 1000,\n 'datasetId': datasetId,\n 'projectId': gcpProjectId,\n 'useLegacySql':false\n });\n request.execute(response => checkJobStatus(response.jobReference.jobId));\n }", "title": "" }, { "docid": "09ec1562dfc75a18292ba0d047a8a98a", "score": "0.6008419", "text": "executeQuery(query) {\n\n query = query.toQuery();\n\n debugQuery(query.text);\n\n return new Promise((resolve, reject) => {\n\n this.connection\n .then(driver => driver.executeQuery(query))\n .then(resolve);\n });\n }", "title": "" }, { "docid": "574e19afbb885c56fe6d5472e2ca392a", "score": "0.6006701", "text": "function queryRequested (queryString, queryParams, callBack) {\n pool.getConnection(function (err, connection) {\n if (err) {\n console.log(err)\n }\n if (queryParams !== null) {\n connection.query(queryString, queryParams, callBack)\n connection.release()\n } else {\n connection.query(queryString, callBack)\n connection.release()\n }\n })\n}", "title": "" }, { "docid": "7c40379b444ae1abc24d0ff16a88a97d", "score": "0.6006261", "text": "constructor(query, queryStr){\n this.query = query;\n this.queryStr = queryStr;\n }", "title": "" }, { "docid": "e700880375450d45283232f998eb59c5", "score": "0.6001023", "text": "sendQuery(host, params, callback) {\n\t fetch(host + params)\n\t .then((response) => {\n\t if (response.status !== 200) {\n\t callback(void 0, response.status);\n\t return;\n\t }\n\t return response.json();\n\t })\n\t .then((data) => {\n\t if (data === void 0) {\n\t // Return from previous then() without Promise\n\t return;\n\t }\n\t if (typeof data !== 'object' || data === null) {\n\t // Error\n\t callback(void 0, null);\n\t return;\n\t }\n\t // Store cache and complete\n\t callback(data);\n\t })\n\t .catch((err) => {\n\t callback(void 0, err === null || err === void 0 ? void 0 : err.errno);\n\t });\n\t }", "title": "" }, { "docid": "5bb019c37cc7de316cb76f1b30440701", "score": "0.5994834", "text": "function doQuery(target, q){\n\t\tsetValue(target, q, true);\n\t}", "title": "" }, { "docid": "30d4969843cfe3a31ceab68b01d2562d", "score": "0.59922254", "text": "function execute(query) \n{\n\ttic();\n \n\tworker.onmessage = function(event) \n {\n\t\tvar results = event.data.results;\n\t\ttoc(\"Executing SQL\");\n\n\t\ttic();\n\t\toutputElm.innerHTML = \"\";\n \n\t\tfor (var i = 0; i < results.length; i++) \n {\n\t\t\toutputElm.appendChild(tableCreate(results[i].columns, results[i].values));\n\t\t}\n \n\t\ttoc(\"Displaying results\");\n\t}\n \n\tworker.postMessage({action:'exec', sql:query});\n\toutputElm.textContent = \"Fetching results...\";\n}", "title": "" }, { "docid": "a915581cec8a4c837d656a994fae1198", "score": "0.5988554", "text": "getRequests() {\n return this.query(`SELECT * FROM request`);\n }", "title": "" }, { "docid": "e12ab50bae872f26cebbd4b558710f6f", "score": "0.5983568", "text": "function SendQuery(url,callbackFunction,method,cache,request)\n{\n\t// Init Object\n\tInitialize();\n\n\tif ( (req!=null) )\n\t{\n\t\treq.onreadystatechange = function()\n\t\t{\n\t\t\t// only if req shows \"complete\"\n\t\t\tif (req.readyState == 4)\n\t\t\t{\n\t\t\t\t// only if \"OK\"\n\t\t\t\tif (req.status == 200)\n\t\t\t\t{\n\t\t\t\t\t// Process\n\t\t\t\t\teval(callbackFunction);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t// Cache data or not , default is yes(1)\n\t\tif ( cache != 1 )\n\t\t{\n\t\t\turl += \"&rand=\"+Math.random()*1000;\n\t\t}\n\n\t\t// Use POST or GET method , default is GET\n\t\tif ( method == 'POST' )\n\t\t{\n\t\t\treq.open(\"POST\", url, true);\n\t\t\treq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\treq.send(request);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treq.open(\"GET\", url , true);\n\t\t\treq.send(null);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f44e19b44f043c2acf910cc3866eaf64", "score": "0.5981623", "text": "function do_query(){\r\n\t\t\tthat.qh.handler(service, query, add_label);\r\n\t\t\tbtn.innerText = \"hide\" + enlbl;\r\n\t\t}", "title": "" }, { "docid": "1a3abe2788d56cae325fdc72dc020184", "score": "0.59790015", "text": "static sendQuery(querySql, values) {\n\t\t// if (!PRODUCTION) console.log(querySql);\n\t\t// console.log(querySql, values);\n\t\treturn new Promise((conResolve, conReject) => {\n\t\t\tDatabase.pgPool\n\t\t\t\t.connect()\n\t\t\t\t.then((client) => {\n\t\t\t\t\tclient\n\t\t\t\t\t\t.query(querySql, values)\n\t\t\t\t\t\t.then((res) => {\n\t\t\t\t\t\t\tclient.release();\n\t\t\t\t\t\t\tif (typeof res === 'undefined') conReject(DBerror(UndefinedResponseFromDBerror(querySql)));\n\t\t\t\t\t\t\telse conResolve(res);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((err) => {\n\t\t\t\t\t\t\tclient.release();\n\t\t\t\t\t\t\tconReject(DBerror(err));\n\t\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t\t.catch((err) => conReject(DBerror(err)));\n\t\t});\n\t}", "title": "" }, { "docid": "429fb4083de33e8fd1e919da9c06a437", "score": "0.5972538", "text": "executeQuery(query, params, callback) {\n this.pool.connect((conErr, client, done) => {\n if (conErr) {\n console.error('Error fetching client from pool. ' + conErr);\n return callback(conErr);\n }\n\n client.query(query, params, callback);\n\n done();\n });\n }", "title": "" }, { "docid": "ede52daf035c5e4bef5089813d8684e0", "score": "0.59694886", "text": "function queryServer(q) {\n didRespond = false;\n // Ask the server\n socket.emit('query', q);\n\n // No response in var=TIMEOUT amount of seconds\n setTimeout(function() {\n if (!didRespond) {\n\n TEXTBOX.disabled = false;\n TEXTBOX.value = '';\n TEXTBOX.focus();\n\n alert('The server appears to have cancer. ReBeatal the bot may have escaped his confines, the world is at risk.');\n\n // Keep this variable assignment at the bootom\n THINKING = false;\n }\n }, TIMEOUT * 1000);\n}", "title": "" }, { "docid": "4d83aefa2fe8dae361826b58b3f2f202", "score": "0.59368014", "text": "function addQuery(query){\n databaseAccess(dbAdd, {'query': query, 'when': new Date()}, function(results){});\n}", "title": "" }, { "docid": "7d05b6866e7f0d2dc3715fa7b8aa6df4", "score": "0.59242284", "text": "function queryUsers(query) {\n con.connect(function(err) {\n console.log(\"Connected!\");\n\n con.query(query, function (err, result) {\n console.log(`Made query: ${query}`);\n for (var i in result) {\n console.log(result[i].msgid);\n sendMessage(sg24HourForecast, result[i].msgid, sgRainMessage);\n sendCovidMessage(result[i].msgid, covidMessage, undefined);\n }\n });\n });\n}", "title": "" }, { "docid": "1b7c656e6ed814cefeaaf48f481c9c7a", "score": "0.59141576", "text": "query(store, type, query) {\n let url = this.buildURL(type.modelName, null, null, 'query', query);\n return this.ajax(url, 'GET');\n }", "title": "" }, { "docid": "51472e881d10fc2670c50f9c1e66d5d2", "score": "0.59051406", "text": "function queryTransport(transport, next) {\n\t if (options.query) {\n\t options.query = transport.formatQuery(query);\n\t }\n\n\t transport.query(options, function (err, results) {\n\t if (err) {\n\t return next(err);\n\t }\n\n\t next(null, transport.formatResults(results, options.format));\n\t });\n\t }", "title": "" }, { "docid": "71d4be89a0552f989d6536e2b200b3d5", "score": "0.5902353", "text": "function queryServiceNow()\n{\n RMPApplication.debug(\"begin queryServiceNow: sn_query = \", sn_query);\n c_debug(dbug.query, \"=> queryServiceNow: sn_query = \", sn_query);\n $(\"#id_spinner_search_top\").show();\n $(\"#id_spinner_search_bottom\").show();\n clearOrderDataTable();\n clearTaskDataTable();\n \n var input = {};\n var option = {};\n input.query = sn_query;\n c_debug(dbug.query, \"=> queryServiceNow: input = \", input);\n id_get_work_order_list_api.trigger(input, option, order_ok, order_ko);\n\n RMPApplication.debug(\"end queryServiceNow\");\n}", "title": "" }, { "docid": "6b980affaac924429432ef6c9f32c6a8", "score": "0.5899133", "text": "function checkQuery() {\n if(window.icResponseUrl) {\n post(window.icResponseUrl, {response: JSON.stringify(window.icResponse)});\n }\n}", "title": "" }, { "docid": "b592e42b124c6bf8fc999960c078f6d1", "score": "0.5896473", "text": "async exec() {\n try {\n // generate queryString\n this.buildQuery();\n // eslint-disable-next-line prefer-destructuring\n const values = this.values;\n // eslint-disable-next-line prefer-destructuring\n const queryString = this.queryString;\n\n // send query to database\n const { rows, rowCount } = await this.DB.query(queryString, values);\n\n // end the transaction!\n this.end(); // This resets all properties in this class (except `this.relation`);\n\n // send a response\n return {\n queryString,\n values,\n rows,\n rowCount,\n };\n } catch (error) {\n console.log(error.stack, error.message);\n return `Unable to complete this transaction: ${error}`;\n }\n }", "title": "" }, { "docid": "cc0460a94149025aac61e998c0067fe4", "score": "0.5892203", "text": "_queryStream( query, params ) {\n if ( util.types.isArray( query ) ) {\n query = query.join( \" \\n\" );\n }\n\n return this._query( query, params || {} );\n }", "title": "" }, { "docid": "31b8c3ea544afd3f13ef2e87a4374bcc", "score": "0.5885894", "text": "function querySearch(query) {\n\t\t\t\t\t\t\treturn $http(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tmethod : 'POST',\n\t\t\t\t\t\t\t\t\t\turl : 'http://localhost/imsui/api/inv/getByName',\n\t\t\t\t\t\t\t\t\t\tdata : $.param( {\n\t\t\t\t\t\t\t\t\t\t\tq : query,\n\t\t\t\t\t\t\t\t\t\t\thead : $scope.cart.head\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\theaders : {\n\t\t\t\t\t\t\t\t\t\t\t'Content-Type' : 'application/x-www-form-urlencoded'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}).then(function(response) {\n\t\t\t\t\t\t\t\treturn response.data;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}", "title": "" }, { "docid": "23c28cf25baa9043bee4a450791e9858", "score": "0.5878249", "text": "function requestTransaction(orgTkn,amount)\n{\n var recivedData ='';\n\n \n console.log(\"query sended: \"+Query);\n\n const data = JSON.stringify({\n query: Query\n })\n \n \n}", "title": "" }, { "docid": "46891082b384900c661029a348bde96f", "score": "0.58645266", "text": "function queryDatabase(path, request) {\r\n $.get(path, request, function (information) {\r\n if (information.errno === undefined) {\r\n //we only want the first result so if there are more only grab the first\r\n var info = information[0] === undefined ? information : information[0];\r\n //add a location marker and move to it\r\n SetMarker({ lat: info.latlng[0], lng: info.latlng[1] }, information.name);\r\n //clear and show new information text\r\n $(\"div#information\").empty();\r\n $(\"div#information\").append(ConstructResult(info));\r\n //if query good hide possibly visible error\r\n $(\"p#resultError\").css('visibility', 'hidden');\r\n $(\"p#resultError\").css('height', '0px');\r\n $(\"p#resultError\").css('margin-bottom', '0px');\r\n } else {\r\n //show warning if query returns error\r\n $(\"p#resultError\").css('visibility', 'visible');\r\n $(\"p#resultError\").css('height', '24px');\r\n $(\"p#resultError\").css('margin-bottom', '16px');\r\n }\r\n });\r\n}", "title": "" }, { "docid": "904c3420a81d921f3a053e620f163037", "score": "0.585271", "text": "function Query(applicationId, path, ql, options, success, failure) {\n if (path.lastIndexOf(\"/\", 0) !== 0) {\n path = \"/\" + path;\n }\n path = \"/\" + self.currentOrganization + \"/\" + applicationId + path;\n var client = self;\n var self = this;\n var query = {};\n var start_cursor = null;\n var next_cursor = null;\n var prev_cursor = null;\n\n function getServiceParams() {\n var params = {};\n if (ql) {\n params['ql'] = ql;\n }\n if (start_cursor) {\n params['cursor'] = start_cursor;\n }\n if (prev_cursor) {\n params['prev'] = prev_cursor;\n }\n if (options) {\n for (var name in options) {\n params[name] = options[name];\n }\n }\n return params;\n }\n this.getServiceParams = getServiceParams;\n\n function hasPrevious() {\n return prev_cursor != null;\n }\n this.hasPrevious = hasPrevious;\n\n function getPrevious() {\n start_cursor = null;\n next_cursor = null;\n if (prev_cursor) {\n start_cursor = prev_cursor.pop();\n send(\"GET\", null);\n }\n }\n this.getPrevious = getPrevious;\n\n function hasNext() {\n return next_cursor && start_cursor;\n }\n this.hasNext = hasNext;\n\n function getNext() {\n if (next_cursor && start_cursor) {\n prev_cursor = prev_cursor || [];\n prev_cursor.push(start_cursor);\n start_cursor = next_cursor;\n next_cursor = null;\n send(\"GET\", null);\n }\n }\n this.getNext = getNext;\n\n function send(method, data) {\n var params = getServiceParams();\n prev_cursor = null;\n next_cursor = null;\n start_cursor = null;\n apiRequest(method, path, params, data, function (data) {\n if (data.entities && data.entities.length > 1) {\n start_cursor = data.entities[0].uuid;\n if (data.params) {\n if (data.params.prev) {\n prev_cursor = data.params.prev;\n }\n if (data.params.cursor) {\n start_cursor = data.params.cursor[0];\n }\n }\n next_cursor = data.cursor;\n }\n if (success) {\n success(data, self);\n }\n }, function (data) {\n if (failure) {\n failure(data, self);\n }\n });\n }\n this.send = send;\n\n function post(obj) {\n if (obj) {\n send(\"POST\", JSON.stringify(obj));\n }\n }\n this.post = post;\n\n function put(obj) {\n if (obj) {\n send(\"PUT\", JSON.stringify(obj));\n }\n }\n this.put = put;\n\n function delete_() {\n send(\"DELETE\", null);\n }\n this.delete_ = delete_;\n }", "title": "" }, { "docid": "37a155e36f0d8611a7a0e3d311f24008", "score": "0.5841497", "text": "function execute(query)\n{\n console.log(query);\n var result = db.exec(query);\n printResult(result);\n}", "title": "" }, { "docid": "d09246ca2b8a01aa3b014a70d003cece", "score": "0.5829085", "text": "getAllQueries(req, callback) {\n var self = this;\n var reqObj = req.body;\n\n var errorResponseObj = {\n status: false,\n data: {},\n message: \"not able to list the queries data\",\n };\n var responseObject = {},\n queryTable = \"query\";\n\n var criteria = {\n condition: {\n sender_id: reqObj.userID,\n curriculumCode: reqObj.curriculumCode,\n status: reqObj.status ? reqObj.status : { $in: [0, 1, 2] },\n }\n };\n if (reqObj[\"limit\"]) {\n criteria[\"limit\"] = reqObj[\"limit\"];\n }\n self.apiServiceInstance.findDataAll(\n queryTable,\n criteria,\n function (err, queriesData) {\n if (queriesData) {\n responseObject[\"status\"] = true;\n responseObject[\"data\"] = queriesData;\n callback(null, responseObject);\n } else {\n errorResponseObj['error'] = err;\n callback(err, errorResponseObj);\n }\n }\n );\n }", "title": "" }, { "docid": "7eded6746542e9e9e2b410c5ba199cbf", "score": "0.58269775", "text": "function run_query(arg) {\n query[arg.key] = arg.value;\n if(arg.key === \"State\") {\n dispatch.state(query);\n set_url(query);\n return;\n }\n query.result = query.Phase === \"all\"\n ? counts.Court[query.Court]\n : query.result = counts.Phase[query.Court][query.Phase]\n ;\n if(query.result) {\n dispatch.display(query);\n set_url(query);\n }\n return;\n }", "title": "" }, { "docid": "fcde5b21d900b5e5d0fb2185e6647f3c", "score": "0.5825048", "text": "function send(config, query) {\n if (!config.url) {\n return Promise.reject(new Error('config.url is required'));\n }\n const results = {\n data: [],\n };\n return fetch(\n `${config.url}/?user=${config.user}&password=${config.password}&database=${config.database}`,\n {\n method: 'POST',\n body: query,\n headers: getHeaders(config),\n }\n )\n .then((response) =>\n response.ok ? response.text() : { error: response.text() }\n )\n .then((statement) => handleStatementAndGetMore(results, statement, config));\n}", "title": "" }, { "docid": "3a0491b79a393e32ea3db2ad07971c07", "score": "0.5800943", "text": "function getQuery() {\n queryString = document.getElementById(\"query-input\").value;\n if (queryString != \"\")\n {\n saveQuery();\n displayQuery();\n }\n else\n {\n frontend.noInput();\n }\n}", "title": "" }, { "docid": "c323791376494d1f81b34635da9207b8", "score": "0.57979804", "text": "getQuery(msg, params = {}) {\n var me = this;\n //return a promise resolve value is result of query\n return new Promise((resolve, reject) => {\n this.init();\n this.connection.connect();\n //send query\n this.connection.query(msg, params, function (error, results, fields) {\n //catch error and reject\n if (error) reject(error);\n //stop connection\n me.connection.end();\n //resolve if successful\n resolve(results);\n });\n })\n }", "title": "" }, { "docid": "737a76dfc3fef57365f0070c98ff3820", "score": "0.57974696", "text": "query(store, type, query) {\n\t\tif (type.proto()._isRPC) {\n\t\t\treturn this.queryRPC(store, type, query);\n\t\t} else {\n\t\t\treturn this._super(...arguments);\n\t\t}\n\t}", "title": "" } ]
fdcb05779c0ace3b92cc4f3c99e48cf4
Write a uint64 (technically supports up to 53 bits per JS number representation).
[ { "docid": "cee730004521fdf510fbae3c355ba29e", "score": "0.7208058", "text": "function writeUInt64BE(buffer, value, offset) {\n const high = value / BITWISE_OVERFLOW | 0;\n const low = value % BITWISE_OVERFLOW;\n offset = buffer.writeUInt32BE(high, offset); // first half of uint64\n return buffer.writeUInt32BE(low, offset); // second half of uint64\n}", "title": "" } ]
[ { "docid": "da6a00cca69624bd7da923ee72ad6806", "score": "0.7101254", "text": "function writeUint64LE(value, out, offset) {\n if (out === void 0) out = new Uint8Array(8);\n if (offset === void 0) offset = 0;\n writeUint32LE(value >>> 0, out, offset);\n writeUint32LE(value / 4294967296 >>> 0, out, offset + 4);\n return out;\n}", "title": "" }, { "docid": "c85afb8ededd1785cd6a6da2bef0462f", "score": "0.7044459", "text": "function uint64ToString(input) {\n const value = typeof input === \"number\" ? math_1.Uint64.fromNumber(input) : math_1.Uint64.fromString(input);\n return value.toString();\n}", "title": "" }, { "docid": "ac444be2948b0bf3557b7423eb7a97dd", "score": "0.70362896", "text": "function encodeUInt64( v, buf, pos ) {\n return encodeInt64(v, buf, pos);\n}", "title": "" }, { "docid": "4d34cd2f11c1ee85d6af3dd65d5a84b6", "score": "0.68471617", "text": "function UInt64(numberStr) {\r\n\t this.low = 0;\r\n\t this.high = 0;\r\n\t this.low = parseInt(numberStr, 10);\r\n\t }", "title": "" }, { "docid": "cb74bd426696f2f226d637871cc17b6c", "score": "0.68033665", "text": "writeBigUint64(value) {\n this.ensureAvailable(8);\n this._data.setBigUint64(this.offset, value, this.littleEndian);\n this.offset += 8;\n this._updateLastWrittenByte();\n return this;\n }", "title": "" }, { "docid": "b1d85d324dfb303e1bde8d6ee6b340ef", "score": "0.6786491", "text": "function writeUint64BE(value, out, offset) {\n if (out === void 0) out = new Uint8Array(8);\n if (offset === void 0) offset = 0;\n writeUint32BE(value / 4294967296 >>> 0, out, offset);\n writeUint32BE(value >>> 0, out, offset + 4);\n return out;\n}", "title": "" }, { "docid": "aa827d5d03d1dc8f81ada18da480c119", "score": "0.6555483", "text": "function integers_uint64_marshal(writer, v, sizes) {\n caml_int64_marshal(writer, v.value, sizes);\n}", "title": "" }, { "docid": "bcfbeff6440cfa34ba620c69e20d9795", "score": "0.64608246", "text": "function integers_uint64_to_string(i) {\n return caml_int64_format(caml_new_string(\"%u\"), i.value);\n}", "title": "" }, { "docid": "b43d97593d9938456727c9dfe49145a2", "score": "0.642949", "text": "writeBigInt64(value) {\n this.ensureAvailable(8);\n this._data.setBigInt64(this.offset, value, this.littleEndian);\n this.offset += 8;\n this._updateLastWrittenByte();\n return this;\n }", "title": "" }, { "docid": "a3c8f7fca86657f7bd06073302fa36d5", "score": "0.64258516", "text": "writeUInt(value) {\n const buf = Buffer.alloc(4);\n buf.writeUInt32BE(value);\n this.write(buf);\n }", "title": "" }, { "docid": "da3d9080229d269059b521595d868b30", "score": "0.6410604", "text": "writeInt64(addr, int64) {\n hax[1] = Add(addr, 0x10).asDouble();\n victim.pointer = int64.asJSValue();\n }", "title": "" }, { "docid": "ff06da4d421aad54d215eeda682649fc", "score": "0.6390944", "text": "function u64(h, l) {\n this.hi = h >>> 0;\n this.lo = l >>> 0;\n}", "title": "" }, { "docid": "750ae031429cf560b7fe926472fb45b7", "score": "0.6373628", "text": "function wuint64(value, endian, buffer, offset)\n{\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (!(value instanceof Array))\n\t\tthrow (new Error('value must be an array'));\n\n\tif (value.length != 2)\n\t\tthrow (new Error('value must be an array of length 2'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 7 >= buffer.length && buffer instanceof Buffer)\n\t\tthrow (new Error('Trying to write beyond buffer length'));\n\n\tprepuint(value[0], 0xffffffff);\n\tprepuint(value[1], 0xffffffff);\n\n\tif (endian == 'big') {\n\t\twuint32(value[0], endian, buffer, offset);\n\t\twuint32(value[1], endian, buffer, offset+3);\n\t} else {\n\t\twuint32(value[0], endian, buffer, offset+3);\n\t\twuint32(value[1], endian, buffer, offset);\n\t}\n}", "title": "" }, { "docid": "9f249bf8625ec931601d99f0c2ff7909", "score": "0.6327727", "text": "writeInt64(addr, int64) {\n hax[1] = Add(addr, 0x10).asDouble();\n victim.pointer = int64;\n }", "title": "" }, { "docid": "abe68a4972be484223634ffbb59860a4", "score": "0.63001615", "text": "function integers_uint64_of_int64(i) {\n return new UInt64(caml_int64_create_lo_mi_hi(i.lo, i.mi, i.hi >>> 0));\n}", "title": "" }, { "docid": "49af77aff47fb2c66b6abefa48ddeeae", "score": "0.6184627", "text": "function uint64ToNumber(input) {\n const value = typeof input === \"number\" ? math_1.Uint64.fromNumber(input) : math_1.Uint64.fromString(input);\n return value.toNumber();\n}", "title": "" }, { "docid": "376571ade7054ad0e34a34176b605e4d", "score": "0.6122551", "text": "function i64ToString({high, low}) {\n const convert = a => (a >>> 0).toString(16).padStart(8, \"0\");\n return `0x${convert(high)}${convert(low)}`;\n}", "title": "" }, { "docid": "0f4e51dece2486297a3237d2b75f0799", "score": "0.60510385", "text": "function setUint64(view, offset, value) {\n var high = value / 4294967296;\n var low = value; // high bits are truncated by DataView\n view.setUint32(offset, high);\n view.setUint32(offset + 4, low);\n}", "title": "" }, { "docid": "633286a875b90d2e776df02bcedee129", "score": "0.6002375", "text": "function readUInt64BE(buffer, offset) {\n const high = buffer.readUInt32BE(offset);\n const low = buffer.readUInt32BE(offset + 4);\n return high * BITWISE_OVERFLOW + low;\n}", "title": "" }, { "docid": "27619bdf9565bf76db5c40d7557e28a7", "score": "0.5937445", "text": "function integers_uint64_unmarshal(reader, size){\n return new UInt64(caml_int64_unmarshal(reader, size));\n}", "title": "" }, { "docid": "cf8d86c598533a9176d355a2ba3761b7", "score": "0.59248257", "text": "function encodeInt64( v, buf, pos ) {\n if (v < 0) return encodeVarint64(v, buf, pos);\n encodeUInt32(v & 0xffffffff, buf, pos);\n encodeUInt32(v / 0x100000000, buf, pos);\n}", "title": "" }, { "docid": "b36808bfbba6a24450faf06ae52c78b7", "score": "0.59217554", "text": "function integers_uint64_of_int(i) {\n return new UInt64(caml_int64_of_int32(i));\n}", "title": "" }, { "docid": "4274550d9b5c055c1ba11f76a1e66ec6", "score": "0.58793056", "text": "function integers_uint64_shift_right(x, y) {\n return new UInt64(caml_int64_shift_right_unsigned(x.value, y));\n}", "title": "" }, { "docid": "13ae1bd60223b4691073d90fe8e2651d", "score": "0.5877416", "text": "readBigUint64() {\n const value = this._data.getBigUint64(this.offset, this.littleEndian);\n this.offset += 8;\n return value;\n }", "title": "" }, { "docid": "b8ceb8cba5e79b61b5a6c4e8c946259f", "score": "0.58710635", "text": "getUint64() {\n\n\t\tlet low, high;\n\n\t\tif ( this.littleEndian ) {\n\n\t\t\tlow = this.getUint32();\n\t\t\thigh = this.getUint32();\n\n\t\t} else {\n\n\t\t\thigh = this.getUint32();\n\t\t\tlow = this.getUint32();\n\n\t\t}\n\n\t\treturn high * 0x100000000 + low;\n\n\t}", "title": "" }, { "docid": "ff9779fda457f6df7d8a9ee7551873a4", "score": "0.5855727", "text": "function convertTo64x64(val) {\n two = BigNumber(\"2\").pow(64);\n valBN = BigNumber(val);\n one = BigNumber(\"1\");\n valBN = valBN.times(two);\n\n if (!valBN.toFixed().includes(\".\")) {\n return ethers.BigNumber.from(valBN.toFixed());\n }\n\n return ethers.BigNumber.from(valBN.plus(one).toFixed().split(\".\")[0]);\n}", "title": "" }, { "docid": "b182d71c16c0eab32e953b47c789fcc8", "score": "0.5854664", "text": "getUint64() {\n\n\t\t\tlet low, high;\n\n\t\t\tif (this.littleEndian) {\n\n\t\t\t\tlow = this.getUint32();\n\t\t\t\thigh = this.getUint32();\n\n\t\t\t} else {\n\n\t\t\t\thigh = this.getUint32();\n\t\t\t\tlow = this.getUint32();\n\n\t\t\t}\n\n\t\t\treturn high * 0x100000000 + low;\n\n\t\t}", "title": "" }, { "docid": "57730f49bb54f58e4ca89e013b55dfaa", "score": "0.584914", "text": "function getUint64(intelHexMap, address) {\n\t var uint64Data = intelHexMap.slicePad(address, 8, 0xff); // Typed arrays use the native endianness, force little endian with DataView\n\n\t return new DataView(uint64Data.buffer).getUint32(0, true\n\t /* little endian */\n\t );\n\t}", "title": "" }, { "docid": "5bd8b607f734ac61c9402a47fb18d9c2", "score": "0.58321285", "text": "uint64_to_little_endian(num) {\n const buf = Buffer.alloc(8);\n buf.writeUIntLE(num, 0, 6);\n return buf;\n }", "title": "" }, { "docid": "0c858d253375b4dad6c350fe7b52e779", "score": "0.57514995", "text": "function readUint64LE(array, offset) {\n if (offset === void 0) offset = 0;\n var lo = readUint32LE(array, offset);\n var hi = readUint32LE(array, offset + 4);\n return hi * 4294967296 + lo;\n}", "title": "" }, { "docid": "600f6d6e1b6505862da1c5e729456791", "score": "0.57462144", "text": "function setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}", "title": "" }, { "docid": "b95e81e8f41d84cdd0fc78e4d67f3bde", "score": "0.57409555", "text": "function integers_uint64_to_int64(i) {\n i = i.value;\n return caml_int64_create_lo_mi_hi(i.lo, i.mi, i.hi | 0);\n}", "title": "" }, { "docid": "cca05c1e2f6a1016039a9ebae34597ca", "score": "0.5702539", "text": "function setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const wh = Number((value >> 32n) & 0xffffffffn);\n const wl = Number(value & 0xffffffffn);\n const [h, l] = isLE ? [4, 0] : [0, 4];\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}", "title": "" }, { "docid": "b6935f4ad507557cc8e225415ac0de4d", "score": "0.5695931", "text": "writeUInt(value) {\n let buff = [(value & 0xff000000) >> 24, (value & 0x00ff0000) >> 16, (value & 0x0000ff00) >> 8, value & 0x000000ff];\n this.flush(buff);\n }", "title": "" }, { "docid": "b6935f4ad507557cc8e225415ac0de4d", "score": "0.5695931", "text": "writeUInt(value) {\n let buff = [(value & 0xff000000) >> 24, (value & 0x00ff0000) >> 16, (value & 0x0000ff00) >> 8, value & 0x000000ff];\n this.flush(buff);\n }", "title": "" }, { "docid": "5af37d37969f5bcac675589f32056f72", "score": "0.5653142", "text": "function readUint64BE(array, offset) {\n if (offset === void 0) offset = 0;\n var hi = readUint32BE(array, offset);\n var lo = readUint32BE(array, offset + 4);\n return hi * 4294967296 + lo;\n}", "title": "" }, { "docid": "1982c11f72be98e7659ae69e12194155", "score": "0.5651922", "text": "function writeUInt32LE(uint, pos) {\n this[pos] = uint&0xFF;\n this[pos+1] = (uint&0xFF00)>>8;\n this[pos+2] = (uint&0xFF0000)>>16;\n this[pos+3] = (uint&0xFF000000)>>24;\n}", "title": "" }, { "docid": "dcaaa794648bf9d0893454e94ae25046", "score": "0.55969805", "text": "function integers_uint64_of_string(s) {\n var max_val = caml_int64_create_lo_mi_hi(0xffffff, 0xffffff, 0xffff);\n return new UInt64(integers_uint_of_string(s, max_val));\n}", "title": "" }, { "docid": "5fbc2f3d75c9b50d7374a024981d7804", "score": "0.55804586", "text": "function integers_uint64_max(unit) {\n var x = caml_int64_create_lo_mi_hi(0xffffff, 0xffffff, 0xffff);\n x.hi = x.hi >>> 0;\n return new UInt64(x);\n}", "title": "" }, { "docid": "193bfc8e99aa383da39a23c227372af2", "score": "0.5566205", "text": "function wsint64(value, endian, buffer, offset)\n{\n\tvar vals = new Array(2);\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (!(value instanceof Array))\n\t\tthrow (new Error('value must be an array'));\n\n\tif (value.length != 2)\n\t\tthrow (new Error('value must be an array of length 2'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 7 >= buffer.length && buffer instanceof Buffer)\n\t\tthrow (new Error('Trying to write beyond buffer length'));\n\n\tprepsint(value[0], 0x7fffffff, -0xf0000000);\n\tprepsint(value[1], 0xffffffff, -0xffffffff);\n\n\t/* Fix negative numbers */\n\tif (value[0] < 0 || value[1] < 0) {\n\t\tvals[0] = 0xffffffff - Math.abs(value[0]);\n\t\tvals[1] = 0x100000000 - Math.abs(value[1]);\n\t\tif (vals[1] == 0x100000000) {\n\t\t\tvals[1] = 0;\n\t\t\tvals[0]++;\n\t\t}\n\t} else {\n\t\tvals[0] = value[0];\n\t\tvals[1] = value[1];\n\t}\n\n\tif (endian == 'big') {\n\t\twuint32(vals[0], endian, buffer, offset);\n\t\twuint32(vals[1], endian, buffer, offset+4);\n\t} else {\n\t\twuint32(vals[0], endian, buffer, offset+4);\n\t\twuint32(vals[1], endian, buffer, offset);\n\t}\n}", "title": "" }, { "docid": "bb87e761738087530cf30152c63c1c51", "score": "0.55539894", "text": "function encodeVarint64( n, buf, pos ) {\n if (n >= 0) return encodeUVarint(n, buf, pos);\n\n n = -n - 1;\n var v1 = (0xFFFFFFFF ^ n) >>> 0;\n var v2 = (0xFFFFFFFF ^ (n / 0x100000000)) >>> 0;\n\n while (v2 > 0) {\n buf[pos.p++] = 0x80 | (v1 & 0x7f);\n v1 = ((v2 & 0x7f) << (32 - 7)) | (v1 >>> 7);\n v2 = v2 >>> 7;\n }\n while (v1 >= 0x100000000) { buf[pos.p++] = 0x80 | (v1 & 0x7f); v1 /= 128; }\n while (v1 >= 128) { buf[pos.p++] = 0x80 | (v1 & 0x7f); v1 >>>= 7; }\n buf[pos.p++] = v1 & 0x7f;\n}", "title": "" }, { "docid": "73ff4977ae6552cd5331d226fe683f46", "score": "0.55495626", "text": "function wgint64(value, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\twgint32(value[0], endian, buffer, offset);\n\t\twgint32(value[1], endian, buffer, offset+4);\n\t} else {\n\t\twgint32(value[0], endian, buffer, offset+4);\n\t\twgint32(value[1], endian, buffer, offset);\n\t}\n}", "title": "" }, { "docid": "73ff4977ae6552cd5331d226fe683f46", "score": "0.55495626", "text": "function wgint64(value, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\twgint32(value[0], endian, buffer, offset);\n\t\twgint32(value[1], endian, buffer, offset+4);\n\t} else {\n\t\twgint32(value[0], endian, buffer, offset+4);\n\t\twgint32(value[1], endian, buffer, offset);\n\t}\n}", "title": "" }, { "docid": "2651c98ce45dfae4a1494e81e2b72ab2", "score": "0.5494575", "text": "function dataview_write64(addr, value)\n{\n oobArray[float_array_buf_idx] = i2f(addr);\n return data_view.setFloat64(0, f2i(value), True);\n}", "title": "" }, { "docid": "bc8a59be2040333b45728fadbeeceb2d", "score": "0.54107016", "text": "function b64ToUint6(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:e===43?62:e===47?63:0}", "title": "" }, { "docid": "2981226761008b9a8361a2171500175d", "score": "0.5349081", "text": "function get64binary(int) {\n if (int>=0)\n return int\n .toString(2)\n .padStart(36, \"0\");\n // else\n return (-int-1)\n .toString(2)\n .replace(/[01]/g, function(d){return +!+d;}) // hehe: inverts each char\n .padStart(36, \"1\");\n}", "title": "" }, { "docid": "7ced1eb358329f693199c605da2f017f", "score": "0.53327143", "text": "readBigInt64() {\n const value = this._data.getBigInt64(this.offset, this.littleEndian);\n this.offset += 8;\n return value;\n }", "title": "" }, { "docid": "22add296968e7489835826ce435cad7e", "score": "0.53147703", "text": "function writeUInt32(uint8array, num, offset) {\n uint8array[offset] = (num & 0xff000000) >> 24;\n uint8array[offset + 1] = (num & 0x00ff0000) >> 16;\n uint8array[offset + 2] = (num & 0x0000ff00) >> 8;\n uint8array[offset + 3] = num & 0x000000ff;\n}", "title": "" }, { "docid": "5227c9c480baaa531f3f06aea5478721", "score": "0.529544", "text": "function Int64(v) {\n // The underlying byte array.\n var buff = new ArrayBuffer(8);\n var bytes = new Uint8Array(buff);\n var dv = new DataView(buff);\n switch (typeof v) {\n case 'number':\n v = '0x' + Math.floor(v).toString(16);\n case 'string':\n if (v.startsWith('0x'))\n v = v.substr(2);\n if (v.length % 2 == 1)\n v = '0' + v;\n\n var bigEndian = unhexlify(v, 8);\n bytes.set(Array.from(bigEndian).reverse());\n break;\n case 'object':\n if (v instanceof Int64) {\n bytes.set(v.bytes());\n } else {\n if (v.length != 8)\n throw TypeError(\"Array must have excactly 8 elements.\");\n bytes.set(v);\n }\n break;\n case 'undefined':\n break;\n default:\n throw TypeError(\"Int64 constructor requires an argument.\");\n }\n\n // Return a double whith the same underlying bit representation.\n this.asDouble = function() {\n // Check for NaN\n if (bytes[7] == 0xff && (bytes[6] == 0xff || bytes[6] == 0xfe))\n throw new RangeError(\"Integer can not be represented by a double\");\n\n return Struct.unpack(Struct.float64, bytes);\n };\n\n\n\n // Return the underlying bytes of this number as array.\n this.bytes = function() {\n return Array.from(bytes);\n };\n\n // Return the byte at the given index.\n this.byteAt = function(i) {\n return bytes[i];\n };\n\n // Return the value of this number as unsigned hex string.\n this.toString = function() {\n return '0x' + hexlify(Array.from(bytes).reverse());\n };\n\n this.setUpper32 = function(a){\n dv.setInt32(4, a, true);\n }\n this.setLower32 = function(a){\n dv.setInt32(0, a, true);\n }\n this.getUpper32 = function() {\n return dv.getUint32(4, true);\n }\n this.getLower32 = function() {\n return dv.getUint32(0, true);\n }\n\n // Basic arithmetic.\n // These functions assign the result of the computation to their 'this' object.\n\n // Decorator for Int64 instance operations. Takes care\n // of converting arguments to Int64 instances if required.\n function operation(f, nargs) {\n return function() {\n if (arguments.length != nargs)\n throw Error(\"Not enough arguments for function \" + f.name);\n for (var i = 0; i < arguments.length; i++)\n if (!(arguments[i] instanceof Int64))\n arguments[i] = new Int64(arguments[i]);\n return f.apply(this, arguments);\n };\n }\n\n // this = -n (two's complement)\n this.assignNeg = operation(function neg(n) {\n for (var i = 0; i < 8; i++)\n bytes[i] = ~n.byteAt(i);\n\n return this.assignAdd(this, Int64.One);\n }, 1);\n\n // this = a + b\n this.assignAdd = operation(function add(a, b) {\n var carry = 0;\n for (var i = 0; i < 8; i++) {\n var cur = a.byteAt(i) + b.byteAt(i) + carry;\n carry = cur > 0xff | 0;\n bytes[i] = cur;\n }\n return this;\n }, 2);\n\n // this = a - b\n this.assignSub = operation(function sub(a, b) {\n var carry = 0;\n for (var i = 0; i < 8; i++) {\n var cur = a.byteAt(i) - b.byteAt(i) - carry;\n carry = cur < 0 | 0;\n bytes[i] = cur;\n }\n return this;\n }, 2);\n}", "title": "" }, { "docid": "6059e879322d73fb6307225319308727", "score": "0.52792805", "text": "function writeUintLE(bitLength, value, out, offset) {\n if (out === void 0) out = new Uint8Array(bitLength / 8);\n if (offset === void 0) offset = 0;\n // TODO(dchest): implement support for bitLengths non-divisible by 8\n if (bitLength % 8 !== 0) throw new Error(\"writeUintLE supports only bitLengths divisible by 8\");\n if (!int_1.isSafeInteger(value)) throw new Error(\"writeUintLE value must be an integer\");\n var div = 1;\n for(var i = offset; i < offset + bitLength / 8; i++){\n out[i] = value / div & 255;\n div *= 256;\n }\n return out;\n}", "title": "" }, { "docid": "9877d0de12657ea060a09d808024b5c0", "score": "0.5267405", "text": "function integers_uint32_of_int64(i) {\n return new UInt32(caml_int64_to_int32(i));\n}", "title": "" }, { "docid": "0820e8a53f1d6bae8be21369591d93d6", "score": "0.5263851", "text": "function toApprox64(val)\n{\n\tif (val === undefined)\n\t\tthrow (new Error('missing required arg: value'));\n\n\tif (!Array.isArray(val))\n\t\tthrow (new Error('value must be an array'));\n\n\tif (val.length != 2)\n\t\tthrow (new Error('value must be an array of length 2'));\n\n\treturn (Math.pow(2, 32) * val[0] + val[1]);\n}", "title": "" }, { "docid": "0820e8a53f1d6bae8be21369591d93d6", "score": "0.5263851", "text": "function toApprox64(val)\n{\n\tif (val === undefined)\n\t\tthrow (new Error('missing required arg: value'));\n\n\tif (!Array.isArray(val))\n\t\tthrow (new Error('value must be an array'));\n\n\tif (val.length != 2)\n\t\tthrow (new Error('value must be an array of length 2'));\n\n\treturn (Math.pow(2, 32) * val[0] + val[1]);\n}", "title": "" }, { "docid": "1d15ca677344202349ad3966e2700602", "score": "0.52624047", "text": "function int64(h, l) {\n this.h = h;\n this.l = l;\n //this.toString = int64toString;\n }", "title": "" }, { "docid": "0b8f76a7dd2603553114082a47bf6d74", "score": "0.5249008", "text": "function verifuint (value, max) {\n assert(typeof value == 'number', 'cannot write a non-number as a number')\n assert(value >= 0,\n 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "0b8f76a7dd2603553114082a47bf6d74", "score": "0.5249008", "text": "function verifuint (value, max) {\n assert(typeof value == 'number', 'cannot write a non-number as a number')\n assert(value >= 0,\n 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "0b8f76a7dd2603553114082a47bf6d74", "score": "0.5249008", "text": "function verifuint (value, max) {\n assert(typeof value == 'number', 'cannot write a non-number as a number')\n assert(value >= 0,\n 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "0b8f76a7dd2603553114082a47bf6d74", "score": "0.5249008", "text": "function verifuint (value, max) {\n assert(typeof value == 'number', 'cannot write a non-number as a number')\n assert(value >= 0,\n 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "0b8f76a7dd2603553114082a47bf6d74", "score": "0.5249008", "text": "function verifuint (value, max) {\n assert(typeof value == 'number', 'cannot write a non-number as a number')\n assert(value >= 0,\n 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "0b8f76a7dd2603553114082a47bf6d74", "score": "0.5249008", "text": "function verifuint (value, max) {\n assert(typeof value == 'number', 'cannot write a non-number as a number')\n assert(value >= 0,\n 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "6ca0345e04c7fc471e66421adb0bd0dc", "score": "0.5248659", "text": "function ReadVarInt64 (ta_struct) {\n var cursor = ta_struct.cursor\n var nVal = 0\n var nShift = 0\n var nByte\n\n while (true) {\n nByte = ta_struct.buffer[cursor]\n if ((nByte & 0x80) === 0) {\n cursor++\n ta_struct.cursor = cursor\n return nVal | (nByte << nShift)\n }\n nVal = nVal | (nByte & 0x7f) << nShift\n cursor++\n nShift += 7\n }\n}", "title": "" }, { "docid": "994525ab1283045527b457784ea3e91b", "score": "0.524271", "text": "function writeUInt32(uint8array, num, offset){\n\t\tuint8array[offset] = (num & 0xff000000) >> 24;\n\t\tuint8array[offset + 1] = (num & 0x00ff0000) >> 16;\n\t\tuint8array[offset + 2] = (num & 0x0000ff00) >> 8;\n\t\tuint8array[offset + 3] = (num & 0x000000ff);\n\t}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "98e50679e282d27cb9cf15dfdac23fee", "score": "0.52227724", "text": "function verifuint (value, max) {\n assert(typeof value === 'number', 'cannot write a non-number as a number')\n assert(value >= 0, 'specified a negative value for writing an unsigned value')\n assert(value <= max, 'value is larger than maximum value for type')\n assert(Math.floor(value) === value, 'value has a fractional component')\n}", "title": "" }, { "docid": "92849031030b4fccfbcd9a10fcce8e2e", "score": "0.52170163", "text": "function toApprox64(val) {\n if(val === undefined)\n throw (new Error('missing required arg: value'));\n\n if(!( val instanceof Array))\n throw (new Error('value must be an array'));\n\n if(val.length != 2)\n throw (new Error('value must be an array of length 2'));\n\n return (Math.pow(2, 32) * val[0] + val[1]);\n}", "title": "" }, { "docid": "cae5f69303dba9ab5ff965faec8d7477", "score": "0.5212317", "text": "writeFloat64(value) {\n this.ensureAvailable(8);\n this._data.setFloat64(this.offset, value, this.littleEndian);\n this.offset += 8;\n this._updateLastWrittenByte();\n return this;\n }", "title": "" }, { "docid": "6096e8e2c65646847d596542e77fe34d", "score": "0.51909333", "text": "function writeUint32LE(value, out, offset) {\n if (out === void 0) out = new Uint8Array(4);\n if (offset === void 0) offset = 0;\n out[offset + 0] = value >>> 0;\n out[offset + 1] = value >>> 8;\n out[offset + 2] = value >>> 16;\n out[offset + 3] = value >>> 24;\n return out;\n}", "title": "" }, { "docid": "6af2501b640aa6d0637e2b6788bd81b7", "score": "0.51756954", "text": "function writeFloat64LE(value, out, offset) {\n if (out === void 0) out = new Uint8Array(8);\n if (offset === void 0) offset = 0;\n var view = new DataView(out.buffer, out.byteOffset, out.byteLength);\n view.setFloat64(offset, value, true);\n return out;\n}", "title": "" } ]
3b33e0a64f1ead134eade61696dbfc7e
Check if a content is valid
[ { "docid": "690237a3454a2c70638c8d755f938e23", "score": "0.7034701", "text": "function _isValidContent(content)\n\t{\n\t\treturn ((content instanceof jQuery) || typeof content === 'function' || (typeof content === 'string' && $.trim(content).length > 0));\n\t}", "title": "" } ]
[ { "docid": "58ba3c43f440857113fd504b8ac15f09", "score": "0.77107567", "text": "function validContent(content){\n const filter = new Filter();\n if(content.length > 300){\n return false;\n } else if(filter.isProfane(content)){\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "e4df9617cc95362ba0d435079c018a07", "score": "0.70496696", "text": "function validateForm() {\n return content.length > 0;\n }", "title": "" }, { "docid": "62d43dc20c2103c9a9c6ac7d9de83f6e", "score": "0.68456393", "text": "checkContent(t) {\n\t\t\tvar r = false;\n\t\t\tvar b = [\"'\", \"\\\\\", \";\", \"\\\"\"];\n\t\t\tfor (var i in b) {\n\t\t\t\tr |= (t.indexOf(b[i]) !== -1);\n\t\t\t}\n\t\t\tthis.set(\"badContent\", r);\n\t\t}", "title": "" }, { "docid": "cf35213d9f3bddce787c053a2ba66eca", "score": "0.6645935", "text": "function hasContent(content) {\n if (content !== \"none\" && content !== \"normal\" && content !== \"counter\" && content !== \"\\\"\\\"\" && content !== \"\\\" \\\"\") {//content is not empty\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "084e69ec983869649aef1bd088b7a106", "score": "0.65965897", "text": "function isValidTag(content) {\n return _isAValidTag(content);\n }", "title": "" }, { "docid": "56fda43dab2721f2907b692d0e269af3", "score": "0.65012264", "text": "function isContentAvailable (input)\n {\n if ((input === \"\") || (input === false) || (strpos(input, 'error') !== false)) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "da7e88dafafa636c98e0b1858acb0445", "score": "0.62828344", "text": "function validate() {\n return validate_title() && validate_content() && validate_tags();\n}", "title": "" }, { "docid": "a53e3ba0a7b05af9cc42041883e2dab2", "score": "0.62473047", "text": "function ValidateSwalContent() {\n //ensure only the swal content is validated\n var swalRoot = $('#swal2-content');\n var errors = 0;\n\n if (!ValidateAllRequired(swalRoot)) {\n errors += 1;\n }\n\n if (!ValidateAllWithValues(swalRoot)) {\n errors += 1;\n }\n\n if (errors == 0) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "694884f958c0f0554389663dbd8b9112", "score": "0.62386894", "text": "validateDateContent() {\n const content = this.state.content.value.trim()\n if (content.length === 0) {\n return '*Date content is required'\n }\n }", "title": "" }, { "docid": "64b6e3a99f4d4e8a6fae5f4ba18c4aeb", "score": "0.6139962", "text": "function valid(data, options) {\n if (options === void 0) { options = { lowerCaseTagName: false, comment: false }; }\n var stack = html_2.base_parse(data, options);\n return Boolean(stack.length === 1);\n }", "title": "" }, { "docid": "cc49bf6d4917f92e8d294e0bca9fbc60", "score": "0.61388934", "text": "function checkContents() {\n\n var content = document.getElementById(\"content\");\n\n if (typeof(content) !== 'undefined' && content !== null) {\n return checkContent = true;\n }\n else {\n return checkContent = false;\n }\n}", "title": "" }, { "docid": "ab79f6328b37139df999431babc340c8", "score": "0.6071036", "text": "contentRequired() {\n return Boolean(this.content);\n }", "title": "" }, { "docid": "c94c83ab8c1a114c68303cf8e95fb452", "score": "0.59918875", "text": "function validateEntry() {\n if (result.innerHTML.length != 0 && result.innerHTML.search(re) === -1) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "32b69ea1b7ff9dd718ae83f6afe3ae04", "score": "0.59343445", "text": "function checkInputFormat(domElement, inputContent, inputPattern){\n\tvar typeOfInput = domElement.id;\n\tvar fieldNotice = document.getElementById('invalid'+ucFirst(typeOfInput)+'Item') ;\n\tif(!fieldNotice){\n\t\tfieldNotice = document.createElement('p');\n\t\tfieldNotice.id = 'invalid'+ucFirst(typeOfInput)+'Item' ;\n\t\tfieldNotice.classList.add(\"error\");\n\t\tfieldNotice.innerHTML = 'Le contenu du champ <em>'+typeOfInput+'</em> est invalide.' ;\n\t}\n\tif(inputContent && !(inputPattern.test(inputContent))){\n\t\tfieldNotice.style.display = 'block' ;\n\t\tdomElement.classList.remove('valid');\n\t\tdomElement.classList.add('invalid');\n\t\tinsertAfter(fieldNotice, domElement);\n\t} else{\n\t\tif(inputContent){\n\t\t\tdomElement.classList.add('valid');\n\t\t\tdomElement.classList.remove('invalid');\n\t\t} else {\n\t\t\tdomElement.classList.remove('valid');\n\t\t}\n\t\tfieldNotice.style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "af26d5f2bf0a40b4e823a0bd76f863fb", "score": "0.58361715", "text": "function validateInput() {\n\t\n\tif ($.request.method !== $.net.http.POST) {\n\t\t$.response.status = $.net.http.NOT_ACCEPTABLE;\n\t\t$.response.setBody(\"Only POST is supported!!\");\n\t\treturn false;\n\t}\n\t\n\tvar file_entity_index;\n\t\n\t// Get entity header which contains the file content\n\tfor (file_entity_index = 0; file_entity_index < $.request.entities.length; file_entity_index++) {\n\t\tif ($.request.entities[file_entity_index].headers.get(\"~content_name\") === \"fup_data\") {\n\t\t\tcontentType = $.request.entities[file_entity_index].headers.get(\"content-type\");\n\t\t\tif (contentType === 'text/csv') {\n\t\t\t\t$.response.status = $.net.http.ACCEPTED;\n\t\t\t\tfileContent = $.request.entities[0].body.asString();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\t$.response.status = $.net.http.NOT_ACCEPTABLE;\n\t$.response.setBody(\"File is NOT a CSV!\");\n\treturn false;\n\n}", "title": "" }, { "docid": "01d0cc42566668d5cbdeb71c70fa3420", "score": "0.575635", "text": "@api \n checkValidity() {\n return this.data && this.data.length > 0;\n }", "title": "" }, { "docid": "9be4189a35616b843afbf503afa6bad2", "score": "0.5734464", "text": "function validate(data) {\n if (data.title.length < 1) {\n window.alert('It is necessery to write the title');\n return false;\n }\n if (data.author < 1) {\n window.alert('It is necessery to write an author');\n return false;\n }\n if (data.category === undefined) {\n window.alert('It is necessery to select category');\n return false;\n }\n if (data.priority === undefined) {\n window.alert('It is necessery to choose a book priority');\n return false;\n };\n return true;\n }", "title": "" }, { "docid": "9cd563331e6b5212612cc8dbd1321962", "score": "0.573392", "text": "function WithoutContent(ss) \n{\n\tif(ss.length > 0) { return false; }\n\treturn true;\n}", "title": "" }, { "docid": "a6f1bca77d1e8fa87b1da6cfe04f39d2", "score": "0.569419", "text": "function isMixedContent(url){\n if(typeof url === 'undefined' ||\n url === null)\n return false;\n \n var urlObj = getURLObject(url); \n if (urlObj['protocol'] === 'http:' &&\n window.location.protocol === 'https:')\n return true;\n \n return false;\n}", "title": "" }, { "docid": "a83bc9202be0409e2efcf560455fbf03", "score": "0.5679405", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "2b0c795824ec6177b24357a431972b4e", "score": "0.5671134", "text": "get hasContent() {\n if (this.moreResults) {\n return true;\n }\n // Space characters (e.g. space, tab, EOL) don't count as having content\n const nodes = this.contentSlot && this.contentSlot.assignedNodes() || [];\n return nodes.some(({ nodeType, textContent }) => nodeType === Node.ELEMENT_NODE || (textContent && textContent.search(/\\S/) >= 0)); // If node is element always return true\n }", "title": "" }, { "docid": "5d0c965931a37832a53720bf724fb25f", "score": "0.5652371", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n timers.setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "3c9889dedfd60b52871b762772c632b0", "score": "0.56355655", "text": "validateForm() {\n return this.state.content.length && this.state.subject.length > 0;\n }", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "0239335cd08a0df591ebce951d09cebd", "score": "0.5617349", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t if (!util.isBuffer(chunk) &&\n\t !util.isString(chunk) &&\n\t !util.isNullOrUndefined(chunk) &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t process.nextTick(function() {\n\t cb(er);\n\t });\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "626165885b1f8001509413b64dd8b43e", "score": "0.5610484", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n setImmediate(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "8180d3d558111a3a4e0f8782e8a04771", "score": "0.56040025", "text": "function validateContentAndEnableButton(){\n\tvar title = document.getElementById(\"title\");\n\tvar content = document.getElementById(\"content\");\n\tvar button = document.getElementById(\"submitButton\");\n\tif(title.value.trim().length > 0 && content.value.trim().length > 0){\n\t\tif(title.value.trim().length < 191){\n\t\t\tbutton.disabled = false;\n\t\t}\n\t}else{\n\t\tbutton.disabled = true;\n\t}\n\n\tif(content.value.trim().length > 65500){\n\t\tcontent.style.border = \"1px solid red\";\n\t\t$(\"#errorForContent\").text(\"Too long text for content\");\n\t\tbutton.disabled = true;\n\t}else{\n\t\tcontent.style.border = \"1px solid #ced4da\";\n\t\t$(\"#errorForContent\").text(\"\");\n\t}\n}", "title": "" }, { "docid": "cf0b728409052ad41e4afe9446cad36d", "score": "0.56024736", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!(Buffer.isBuffer(chunk)) &&\n\t typeof chunk !== 'string' &&\n\t chunk !== null &&\n\t chunk !== undefined &&\n\t !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "405f763e34bdc255ef0aef99738115a5", "score": "0.55944836", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "7b6f8e6b98ffd0b124a8ab84efe30ddf", "score": "0.55931675", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!Buffer.isBuffer(chunk) &&\n 'string' !== typeof chunk &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function () {\n cb(er);\n });\n valid = false;\n }\n return valid;\n }", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "ce66964d2924dfc21091a1d7343ab70a", "score": "0.55857134", "text": "function validChunk(stream, state, chunk, cb) {\n var valid = true;\n if (!util.isBuffer(chunk) &&\n !util.isString(chunk) &&\n !util.isNullOrUndefined(chunk) &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n process.nextTick(function() {\n cb(er);\n });\n valid = false;\n }\n return valid;\n}", "title": "" }, { "docid": "7087d63495a29a3b405ef9db51ef76c2", "score": "0.55851555", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "7087d63495a29a3b405ef9db51ef76c2", "score": "0.55851555", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\t\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" }, { "docid": "5ab43dc9f6f5a7e75c4ac37efba71888", "score": "0.55791485", "text": "async function validateTemplate() {\n // Get item sub type\n const itemSubType = getItemSubType();\n core.info(`validateTemplate: itemSubType: ${itemSubType}`);\n\n // Compose message\n const message = composeMessage({ requireTemplate: true });\n\n // If issue type could not be determined\n if (itemSubType === undefined) {\n // Post error comment\n await postComment(message);\n return false;\n }\n\n // Ensure required headlines\n const patterns = template[itemSubType].headlines.map(h => {\n return { regex: h };\n });\n\n // If validation failed\n if (validatePatterns(patterns, itemBody).filter(v => !v.ok).length > 0) {\n core.info('Required headlines are missing.');\n\n // Post error comment\n await postComment(message);\n return false;\n }\n\n core.info('Required headlines were found.');\n return true;\n}", "title": "" }, { "docid": "413e02d8b0f7ded78b32770b84d500ed", "score": "0.5574515", "text": "function validChunk(stream, state, chunk, cb) {\n\t var valid = true;\n\n\t if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {\n\t var er = new TypeError('Invalid non-string/buffer chunk');\n\t stream.emit('error', er);\n\t processNextTick(cb, er);\n\t valid = false;\n\t }\n\t return valid;\n\t}", "title": "" } ]
75d9f21290a7737483c44bf4aeec55dc
generateOverlay() Description: Generates a message for the overlay box. Params: title the title of the message text the body of the message Return: none
[ { "docid": "c9b004672e005157e975dfcb087b2522", "score": "0.7563534", "text": "function generateOverlay(title, text){\r\n\tdocument.getElementById(\"overlayClose\").innerHTML = \"X\";\r\n\tdocument.getElementById(\"login\").style.display = \"none\";\r\n\tdocument.getElementById(\"overlayTitle\").innerHTML = title;\r\n\tdocument.getElementById(\"overlayText\").innerHTML = text;\r\n\tdocument.getElementById(\"overlay\").style.width = \"100%\";\r\n}", "title": "" } ]
[ { "docid": "5211835ef66c82fb832a7ba04d927833", "score": "0.6818968", "text": "function displayOverlayMessage(message) {\n\tvar overlay = $('#confirm-overlay');\n\n\toverlay.empty();\n\tvar overlay_content = '<h2 class=\"martini-confirm__container__overlay__title\">' + message + '</h2>';\n\toverlay.append(overlay_content);\n}", "title": "" }, { "docid": "26a7d28853d971d5e65b8dfc98c3d5fe", "score": "0.659356", "text": "appendtoOverlay(winOrLose, h1Message, pMessage){\n const overLay = document.getElementById('overlay');\n const h1 = document.querySelector('#game-over-message');\n const p = document.querySelector('#pmessage');\n overLay.className = winOrLose;\n overLay.style.display = 'flex';\n h1.textContent = h1Message;\n overLay.appendChild(h1);\n if(this.missed === 0){\n p.textContent = `Well done! You got a perfect score!`;\n overLay.appendChild(p);\n } else{\n p.textContent = pMessage;\n overLay.appendChild(p);\n }\n }", "title": "" }, { "docid": "0796b3232c0eab88a73232b0ec6a74e5", "score": "0.65154135", "text": "function overlayModal(title, body) {\n overlay(title, body);\n}", "title": "" }, { "docid": "440b480022573c70c084e8d19bb36550", "score": "0.6387515", "text": "function addTitle(overlay)\n\t{\n\t google.maps.event.addListener(overlay, \"mousemove\", function(event){\n\t if(map.rightClick == null)\n\t {\n\t if (map.highlight != null && map.highlight != overlay)\n\t {\n\t if(overlay.title)\n\t {\n overlay.title.setMap(null)\n overlay.title = null\n\t }\n\t overlay = map.highlight;\n\t }\n \t if(overlay.title)\n \t {\n overlay.title.pos = event.latLng;\n overlay.title.redraw(); \t \n \t }\n \t else\n \t {\n \t var div = document.createElement(\"Div\");\n div.style.backgroundColor = \"yellow\";\n div.style.color = \"blue\";\n div.style.position = \"absolute\";\n div.innerHTML = overlay.name;\n div.style.width = (overlay.name.length - overlay.name.length/3) + \"em\";\n \n overlay.title = new CustomeOverlay(event.latLng, div, true);\n \t }\n\t }\n\t });\n\t google.maps.event.addListener(overlay, \"mouseout\", function(){\n\t if(overlay.title)\n\t {\n \t overlay.title.setMap(null);\n \t overlay.title = null;\n\t }\n });\n google.maps.event.addListener(overlay, \"rightclick\", function(){\n if(overlay.title)\n {\n overlay.title.setMap(null);\n overlay.title = null;\n }\n });\n\t}", "title": "" }, { "docid": "1b6f1464178a1e359532b4e07f306c02", "score": "0.6065745", "text": "function showOverlay(message) {\r\n\tvar o = document.getElementById('overlay');\r\n\to.style.visibility = 'visible';\r\n\tdocument.getElementById('loadingMessage').innerHTML = message;\r\n}", "title": "" }, { "docid": "53b88d404c07f4de82af1d6c7bfdca83", "score": "0.5959665", "text": "function generateOverlayLogin(){\r\n\tdocument.getElementById(\"overlayClose\").innerHTML = \"\";\r\n\tdocument.getElementById(\"overlayTitle\").innerHTML = \"Welcome!\";\r\n\tdocument.getElementById(\"overlayText\").innerHTML = \r\n\t\t\"Please enter your first and last name.\";\r\n\tdocument.getElementById(\"login\").style.display = \"block\";\r\n\tdocument.getElementById(\"overlay\").style.width = \"100%\";\r\n}", "title": "" }, { "docid": "a85bf12650ca45933d51cca70b98109a", "score": "0.5944218", "text": "gameOver(message) {\n const overlayDiv = document.getElementById('overlay');\n overlayDiv.style.display = 'block';\n document.getElementById('game-over-message').textContent = message;\n\n if (this.missed >= 5) {\n const phrase = this.activePhrase.phrase;\n const lostGameMsg = document.createElement('h1');\n const span = document.createElement('span');\n\n lostGameMsg.id = \"another-message\";\n lostGameMsg.textContent = \"The mystery phrase was: \";\n span.textContent = `\"${phrase}\"`;\n\n lostGameMsg.appendChild(span);\n document.getElementById('overlay').appendChild(lostGameMsg);\n\n overlayDiv.className = 'lose';\n $('.key').prop('disabled', true);\n \n } else {\n overlayDiv.className = 'win';\n $('.key').prop('disabled', true);\n \n }\n\n\n }", "title": "" }, { "docid": "41a0dec0373ef7bcd19da53063de79bc", "score": "0.59430647", "text": "function display_overlay_message(msg, className) {\n let msg_box = document.getElementById('message');\n\n // Save previous message (if there)\n if (msg_box.childElementCount !== 0) {\n let elem;\n if (msg_box.childElementCount === 1) {\n elem = msg_box.removeChild(msg_box.firstChild);\n } else {\n elem = document.createElement('div');\n elem.append(...msg_box.childNodes);\n }\n messages.push([msg_box.className, elem]);\n }\n\n // Show new message\n if (typeof msg === 'string') {\n msg_box.innerHTML = msg;\n } else {\n //msg_box.replaceChildren(msg);\n msg_box.textContent = '';\n msg_box.appendChild(msg);\n }\n msg_box.className = className;\n\n // Display\n document.getElementById('overlay').style.display = 'block';\n}", "title": "" }, { "docid": "a1128e2d48e716990bd904089fabaae8", "score": "0.5926434", "text": "function _addOverlay() {\n\t var overlayDiv = $(Constants.DIV_COMP, {\n\t \"class\": Constants.OVERLAY_STYLE\n\t });\n\t overlayDiv(_createOverlayNode({\n\t width: Utils.getFullWindowWidth() + Constants.PX,\n\t height: Utils.getFullWindowHeight() + Constants.PX,\n\t top: 0,\n\t left: 0\n\t }));\n\t overlayDiv.appendTo(Components.ui);\n\t}", "title": "" }, { "docid": "d41452a6a33b49a4fe6ed57973dc7b2b", "score": "0.58766073", "text": "handleCreateOverlay() {\n this.props.overlay();\n }", "title": "" }, { "docid": "f39562ebef2f85c21c05fb08e3227c02", "score": "0.58723575", "text": "function _buildOverlay() {\n if (options.isDebug) console.log('%c %s', 'color: #32da94; font-style: italic;', 'CANVI: Build overlay...');\n\n // If overlay is true, add\n if (!content.querySelector('.canvi-overlay')) {\n overlay = document.createElement('div');\n overlay.className = 'canvi-overlay';\n content.appendChild(overlay);\n }\n\n // Add close event to the overlay\n overlay.addEventListener('click', closeCanvi);\n\n _setTransitionSpeed();\n }", "title": "" }, { "docid": "05cb1b4c08765685fafa7c77ea18d4dc", "score": "0.585482", "text": "function createTitle(msg){\n\tcontext2.fillStyle = \"#000000\";\n context2.globalAlpha = .4;\n context2.fillRect(40,canvas2.height - 40,canvas2.width-80,40);\n context2.fillStyle = \"#FFFFFF\";\n context2.globalAlpha = 1;\n context2.textAlign = \"center\";\n context2.textBaseline = \"middle\";\n context2.font = \"20px Arial\";\n context2.fillText(msg,canvas2.width / 2,canvas2.height - 20);\n}", "title": "" }, { "docid": "b32fda3dc14f7ab28039b1e36a39fe85", "score": "0.5837644", "text": "function _insertOverlay() {\n $content = $content.find('.content-wrapper:first');\n Drupal.gazprom.openInOverlay($content);\n }", "title": "" }, { "docid": "d7122fee6ba5ef5797b1060ed14d1af0", "score": "0.5814112", "text": "function displayOverlay(text) {\n $(\"<table id='overlay'><tbody><tr><td>\" + text + \"</td></tr></tbody></table>\").css({\n \"position\": \"fixed\",\n \"top\": \"30%\",\n \"left\": \"30%\",\n \"width\": \"40%\",\n \"height\": \"25%\",\n \"margin\": \"0 auto\",\n \"background-color\": \"rgba(0,0,0,.7)\",\n \"z-index\": 10000,\n \"vertical-align\": \"middle\",\n \"text-align\": \"center\",\n \"color\": \"#fff\",\n \"font-size\": \"100px\",\n \"font-weight\": \"bold\",\n \"border-radius\": \"4px\",\n \"font-family\": \"Roboto, sans-serif\",\n \"padding\": \"15px\",\n }).appendTo(\"body\");\n}", "title": "" }, { "docid": "e562730dc6d498845b53ba32caa8ba61", "score": "0.5788", "text": "function Overlay(titleText, descriptionText, bodyText, outerContainer,\n transparent) {\n this.outerContainer = outerContainer;\n var clazz = this.outerContainer.getAttribute('class');\n this.outerContainerClass = (clazz == null) ? \"\" : clazz;\n this.transparent = transparent;\n var clazz = this.transparent.getAttribute('class');\n this.transparentClass = (clazz == null) ? \"\" : clazz;\n this.head = document.createElement('div');\n this.head.setAttribute('id', 'overlay_head');\n this.head.setAttribute('class', 'overlay_head');\n this.button = document.createElement('div');\n this.button.setAttribute('id', 'overlay_close');\n this.button.setAttribute('class',\n 'overlay_close round_button mod_button_grey');\n this.button.innerHTML = 'x';\n this.title = document.createElement('h1');\n this.title.setAttribute('class', 'heading');\n this.title.innerHTML = titleText;\n this.description = document.createElement('p');\n this.description.setAttribute('class',\n 'description description_yellow overlay_description');\n this.description.innerHTML = descriptionText;\n this.head.appendChild(this.button);\n this.head.appendChild(this.title);\n this.head.appendChild(this.description);\n this.body = document.createElement('div');\n this.body.setAttribute('id', 'overlay_body');\n this.body.setAttribute('class', 'overlay_body');\n this.body.innerHTML = bodyText;\n this.container = document.createElement('div');\n this.container.setAttribute('id', 'overlay_container');\n this.container.setAttribute('class', 'message_overlay');\n this.container.appendChild(this.head);\n this.container.appendChild(this.body);\n}", "title": "" }, { "docid": "1252407fffd62faf263c0bac504f86e3", "score": "0.57863665", "text": "function creaPopUp(evento) {\n //RECOJO LA INFORMACION DE LA FEATURE SELECCIONADA\n var selectedFeature = evento.selected[0];\n if (selectedFeature) {\n ////LE DIGO QUE LA POSICION DEL POPUP SERA AL LADO DE LA FEATURE SELECCIONADA\n var posicion = selectedFeature.getGeometry().getExtent();\n overlay.setPosition([0.5 * (posicion[0] + posicion[2]), (0.5 * posicion[1] + posicion[3])]);\n var pais = selectedFeature.get(\"name\");\n\n //CONSTRUIR EL TEXTO A MOSTRAR DENTRO DE LA PROPIEDAD INNERHTML DEL CONTENEDOR OVERLAY\n var texto = \"<p><strong>Pais:</strong> \" + pais + \"<br/>\"\n document.getElementById(\"overlay\").innerHTML = texto;\n } else {\n overlay.setPosition(undefined);\n }\n}", "title": "" }, { "docid": "98d574a26c0d1b785f315ddbaf318c08", "score": "0.57783383", "text": "function _modifyOverlay() {\n\t var overlays = Utils.getElesFromClassName(Constants.OVERLAY_STYLE);\n\t if (Utils.hasELement(overlays)) {\n\t if (overlays.length !== 1) {\n\t overlays.remove();\n\t var overlay = _createOverlayNode({\n\t width: Utils.getFullWindowWidth() + Constants.PX,\n\t height: Utils.getFullWindowHeight() + Constants.PX,\n\t top: 0,\n\t left: 0\n\t });\n\t overlay.appendTo(Components.ui);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "3a6e01f4cef013f5ce75fa4eb5c79b4d", "score": "0.57663894", "text": "function ME_Alert(title, body){\r\n if(title==\"\"){\r\n var title_txt=\"Alert !\";\r\n }else{\r\n var title_txt=\"Alert !\";\r\n }\r\n $('body').append('<div id=\"alert_box\" class=\"alert_contant\" ><div class=\"alert_title\">'+title_txt+'</div>'+body+'<div class=\"alert_footer\"><div class=\"alert_ok_btn\" onclick=\"alert_box_close()\">OK</div></div></div>');\r\n $('body').append('<div class=\"MEAlert_shadow\"></div>');\r\n}", "title": "" }, { "docid": "7285d0e422791c653ca61889ba5423cf", "score": "0.57575023", "text": "gameOver(message) { \n $('#overlay').fadeIn(1000);\n document.getElementById('overlay').style.display = 'block';\n document.getElementById('game-over-message').innerHTML = message;\n document.getElementById('btn__reset').textContent = 'Try Again!';\n }", "title": "" }, { "docid": "25cda964ab1d6c87cde398c68a461428", "score": "0.57565486", "text": "function createItemOverlay() {\n var overlay = document.createElement(\"div\");\n overlay.classList.add(\"record-title-overlay\");\n return overlay;\n }", "title": "" }, { "docid": "fe69b78da489e71ff07531f7f5fddc9e", "score": "0.5755109", "text": "setOverlayMessage(message) {\r\n if (this.overlay === null) {\r\n return;\r\n }\r\n\r\n // Get overlay message container\r\n let msg_container = this.overlay.querySelector(\"#overlay_message\");\r\n if (msg_container === null || msg_container === undefined) {\r\n console.log(\r\n \"setOverlayMessage ERROR: Message container was not found. Returning.\"\r\n );\r\n return;\r\n }\r\n\r\n // Set overlay message\r\n msg_container.innerHTML = message;\r\n }", "title": "" }, { "docid": "85cf1a45c8de8520db71566c770ff4d7", "score": "0.57349116", "text": "gameOver() {\n const overlay = document.querySelector('#overlay');\n const message = document.querySelector('#game-over-message');\n\n // clear out previous message and display the overlay\n message.textContent = '';\n overlay.style.display = 'flex';\n\n // determine which overlay style and message to display\n if (this.missed > 4) {\n overlay.className = 'lose';\n message.insertAdjacentHTML('beforeend', `You Ran Out of Lives<br>Better Luck Next Time!<br>&#128531;`);\n } else {\n overlay.className = 'win';\n message.insertAdjacentHTML('beforeend', `You Guessed the Phrase:<br>${this.activePhrase.phrase}!<br>&#128518;`);\n }\n\n this.ready = false;\n }", "title": "" }, { "docid": "2254b3430a434eee728ae9425640c155", "score": "0.57220256", "text": "function customAlert(){\n this.render=function(dialog){\n var windH = window.innerHeight;\n var windW = window.innerWidth;\n var overlay = document.getElementById('overlay');\n var alertbox = document.getElementById('alertbox');\n \n overlay.style.display = \"block\";\n overlay.style.height = windH+\"px\";\n \n alertbox.style.left = (windW/2) - (550 * .5)+\"px\";\n\t\t\talertbox.style.top = \"100px\";\n\t\t\talertbox.style.display = \"block\";\n \n document.getElementById(\"alertheader\").innerHTML = \"Aknowledge this message\";\n\t\t\tdocument.getElementById(\"alertbody\").innerHTML = dialog;\n\t\t\tdocument.getElementById(\"alertfooter\").innerHTML = \"<input type='button' value='try again!!' onclick='alert(0)'>\";\n \n }\n this.ok=function(){\n overlay.style.display = \"none\";\n alertbox.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "5aefb46c32198f541edebc19ee469372", "score": "0.57121205", "text": "function createOverlay() {\n\t\tif (overlay == 0) {\n\t\t\toverlay = document.createElement(\"canvas\");\n\t\t\t//overlay.style = \"width:\" + canvas.style.width + \"; height:\" + canvas.style.height;\n\t\t\toverlay.style.width = canvas.style.width;\t\t// this way keeps IE happy\n\t\t\toverlay.style.height = canvas.style.height;\n\t\t\toverlay.style.position = \"absolute\";\n\t\t\toverlay.style.zIndex = canvas.style.zIndex + NLAYER;\n\t\t\t//console.log(\"overlay zIndex=\" + overlay.style.zIndex);\n\t\t\toverlay.style.pointerEvents = \"none\";\n\t\t\toverlay.style.overflow = \"hidden\";\n\t\t\toverlay.style.display = \"block\";\n\t\t\toverlay.style.left = canvas.offsetLeft + \"px\";\n\t\t\toverlay.style.top = canvas.offsetTop + \"px\";\n\t\t\toverlay.width = canvas.width;\n\t\t\toverlay.height = canvas.height;\n\t\t\tcanvas.parentNode.appendChild(overlay); // expects to append to a <body> or <div> element\n\t\t\toverlayCtx = overlay.getContext(\"2d\");\n\t\t}\n\t}", "title": "" }, { "docid": "3e6d5e3117db81e9e83627333f82e4dd", "score": "0.57099754", "text": "function drawOverlayGameOver() {\n privateContext.font = \"35px Arial Black\";\n privateContext.fillStyle = \"white\";\n privateContext.textAlign = \"center\";\n privateContext.fillText(\"Game Over.\", GAME_WIDTH / 2, GAME_HEIGHT * 0.35);\n }", "title": "" }, { "docid": "6db7d51e3fd4bba97a404249e15afa7d", "score": "0.5702522", "text": "showOverlay(createComponent, overlayTitle) {\n this.props.dispatch(showBottomBar())\n return new Promise((resolve, reject) => {\n this.setState({\n overlayContent: createComponent(resolve, reject),\n overlayTitle,\n overlayVisible: true,\n overlayCancel: () => reject(),\n })\n })\n .finally(this.closeOverlay)\n }", "title": "" }, { "docid": "50b03de7acd85173d869c91872610700", "score": "0.5690093", "text": "function addProcessingOverlay() {\n var imageWrapper;\n\n // Add overlay\n document.getElementById('SOWrap').appendChild(document.createElement('div')).id = 'wtg-overlay';\n\n // Add popup overlay\n imageWrapper = document.getElementById('SOWrap').appendChild(document.createElement('div'));\n imageWrapper.id = 'wtg-overlay-popup';\n imageWrapper.appendChild(document.createElement('img')).src = 'http://static.conquerclub.com/loading.gif';\n imageWrapper.appendChild(document.createElement('span')).appendChild(document.createTextNode('Processing watched games'));\n}", "title": "" }, { "docid": "d8c34992d2e88b45bafff03ad62fbd2c", "score": "0.56890845", "text": "function createResponse(text) {\n const overlayElement = document.createElement(\"div\");\n overlayElement.classList.add(\"overlay\");\n\n const template = document.querySelector(\"#responseTemplate\");\n overlayElement.innerHTML = template.innerHTML;\n\n const closeElement = overlayElement.querySelector(\".overlay__btn\");\n closeElement.addEventListener(\"click\", function () {\n body.removeChild(overlayElement);\n document.body.style.overflow = 'initial';\n });\n\n const wrapElement = overlayElement.querySelector(\".overlay__container\");\n wrapElement.addEventListener(\"click\", function () {\n body.removeChild(overlayElement);\n document.body.style.overflow = 'initial';\n });\n\n const messageElement = overlayElement.querySelector(\".overlay__message\");\n messageElement.innerHTML = text;\n\n return overlayElement;\n}", "title": "" }, { "docid": "d9acab84c3b739491141e57bc759a877", "score": "0.56758493", "text": "function alertBox (alertTitle, alertMessage, colour) {\n \n let createBox = document.createElement('div');\n let styleSheet = document.styleSheets[0];\n let styleSheetEnd = styleSheet.cssRules.length;\n styleSheet.insertRule(`.alert-box > h1 {background-color:${colour}; width:100%; color:white; padding: 5px 0; border-radius: 5px; font-size: 1.5em; letter-spacing: 1px;}`, styleSheetEnd -5);\n createBox.innerHTML = `<div class=\"alert-box\">\n <h1>${alertTitle}</h1>\n ${alertMessage}\n <button type=\"button\" data-type=\"close-alert\" class=\"btn btn--close\">\n <span>Close</span>\n </button>\n </div>`;\n createBox.classList.add('underlay'); \n\n let parent = document.getElementsByClassName(\"game-area\")[0].parentNode;\n parent.insertBefore(createBox, parent.childNodes[0]);\n document.getElementsByClassName('btn--close')[0].addEventListener(\"click\", closeAlert);\n\n}", "title": "" }, { "docid": "827c3be4df7889b6176bc9b37916ca23", "score": "0.56543225", "text": "function __showMessage(params) \n{ //alert(__isArray(params));\n\tif(!__isArray(params))\n\t{\n\t\ttemp_params = params;\n\t\tparams = {\"message\":\"<image id='__loader' src='../../core/style/images/loading_bubble.gif'>\", \"buttons\": false,\"level\":false};\n\t}\n\t\n\tvar options = true;\n\tvar margin_top = document.body.scrollTop - 120;\n\tvar margin_left = document.body.scrollLeft - 150;\n\t\n\tif(typeof(params.options)==\"undefined\" || typeof(params.options)==\"null\" || params.options == \"\" || params.options == false || params.options.lenght == 0)\n\t{\n\t\tparams.options = {\"Ok\":function(){ __closeMessage(); } }; \n\t\toptions = false;\n\t}\n\t\n\t__addOverlayMessage();\n\t\n\tvar i = 1;\n\tfor(var x in params.options){\n\t\tvar btn = $(\"#__overlayAction_\"+i);\n\t\tbtn.html(__T(x));\n\n\t\t(function(actions){\n\t\t\tbtn.unbind(\"click\");\n\t\t\tbtn.bind(\"click\", actions);\n\t\t})(params.options[x]);\n\n\t\t//btn.attr('click'onClick',buttons[x]);\n\t\t//btn.click(function(){eval(buttons[x]);closeMessage();});\n\n\t\tbtn.css(\"display\",\"inline-block\");\n\t\ti++;\n\t}\n\t\n\t$(\"#__close\").unbind(\"click\"); \n\t$(\"#__close\").click(function(){\n\t\t__closeMessage();\n\t});\n\t\n\t$(\"#__overlay\").css(\"margin-top\", margin_top+\"px\");\n\t$(\"#__overlay\").css(\"margin-left\", margin_left+\"px\");\n\t$(\"#__overlayShadow\").css(\"width\", \"100%\"); \n\t\n\t$(\"#__overlayContent\").html(__T(params.message));\n\t$(\"#__overlayAction\").show();\n\t$(\"#__overlayShadow\").show();\n\t$(\"#__overlay\").show(\"puff\"); \n\t\n\t//effects 'blind','bounce','clip','drop','explode','fold','highlight','pulsate','scale','shake','slide','puff'\n\t__actionMessageKey(options);\n}", "title": "" }, { "docid": "431e5b8d1b113b51895e8e0a06e0b99e", "score": "0.56472117", "text": "createPopUp(){\n let my = this.__private__;\n let message = \"\"\n let cls =\"\"\n if(my.gameWon){ // Victory Message\n message = \"YOU ARE VICTORIOUS!\"\n cls = \"game-popup-victory\";\n }\n else{ // Defeat Message\n message = \"YOU ARE DEFEATED!\"\n cls = \"game-popup-victory\";\n }\n let popUp = $(`<div class=\"game-popup-bg\"><div class=\"game-popup ${cls}\">\n <div class=\"game-title-xlg\">${message}</div>\n <div class=\"flx flx-row\">${this.calculateScore()}</div> \n <div><div>`);\n\n $(\"#game-viewport\").append(popUp);\n }", "title": "" }, { "docid": "4eb44d2b6c04c6e5771470fb154b841d", "score": "0.5615409", "text": "function createOverlay(childElement, strLabel) {\n\n\t\t// create document fragment\n\t\tvar docFrag = document.createDocumentFragment();\n\n\t\tlockBody();\n\n\t\t// create empty overlay <div>\n\t\telOverlay = document.createElement('div');\n\n\t\t// set data-overlay attribute as passed strLabel value\n\t\telOverlay.setAttribute('data-overlay', strLabel);\n\n\t\t// append passed child elements\n\t\tif (childElement) {\n\t\t\telOverlay.appendChild(childElement);\n\t\t}\n\n\t\t// append the [data-overlay] to the document fragement\n\t\tdocFrag.appendChild(elOverlay);\n\n\t\t// empty document fragment into <body>\n\t\telBody.appendChild(docFrag);\n\n\t\tfadeIn(elOverlay);\n\n\t}", "title": "" }, { "docid": "03f1ba04300ea3d03e075da7caa75dbe", "score": "0.5599457", "text": "showOverlay(show = true, message = null) {\r\n if (this.overlay === null) {\r\n return;\r\n }\r\n\r\n if (show) {\r\n this.overlay.classList.remove(\"hidden\");\r\n } else {\r\n this.overlay.classList.add(\"hidden\");\r\n }\r\n\r\n if (message !== null) {\r\n this.setOverlayMessage(message);\r\n }\r\n }", "title": "" }, { "docid": "6b8ef4c30bc3ea350f3dc086afeeae2a", "score": "0.55966187", "text": "function createAlert(title, text, image, overwrite = false) {\n if (alertStatus) {\n if (overwrite) {\n alertQueue = []\n alertTitle.innerHTML = title.trim();\n alertDesc.innerHTML = text.trim();\n alertImage.src = image;\n alertModal.style.display = \"inline-block\";\n } else {\n var temp = '{\"title\":\"' + title + '\",\"text\":\"' + text + '\",\"image\":\"' + image + '\",\"script\":\"' + overwrite + '\"}'\n alertQueue.push(temp)\n }\n } else {\n alertStatus = true\n alertTitle.innerText = title.trim();\n alertDesc.innerHTML = text.trim();\n alertImage.src = image;\n alertModal.classList.remove('alertout')\n alertModal.classList.add('alertin')\n }\n}", "title": "" }, { "docid": "72b6a42ce5c475a3b2cf9d4e9f54b35f", "score": "0.5587786", "text": "create(options) {\n return overlays.createOverlay('ion-alert', options);\n }", "title": "" }, { "docid": "16e5ef17456144a0a8b6e1d5e9d518e4", "score": "0.55670893", "text": "function message(heightOfMessageBox) {\n\tnoStroke();\n\trectMode(CENTER)\n\tfill('rgba(54, 245, 82, 0.83)') //light green\n\trect(width/2, heightOfMessageBox/2, 300, heightOfMessageBox);\n\ttextSize(15);\n\tfill(0);\n textAlign(CENTER);\n textStyle(BOLD);\n text(\"Happy October! \\n\\n Refresh the Page to Generate a Slightly Different Image :)\", width/2, 50, 250, 72);\n}", "title": "" }, { "docid": "7f2481b05df595acef3dec42246e3360", "score": "0.5562537", "text": "function display_error_message(msg) {\n document.body.innerHTML = `<div id=\"overlay\"><div id=\"message\" class=\"error\">${msg}</div></div>`;\n}", "title": "" }, { "docid": "a05afc1b6caf2c76be991bb874538499", "score": "0.5561691", "text": "function create($src, opts) {\n \n // prevents adding multiple overlays to a container\n $src.addClass('overlay-trigger');\n \n // create the overlay and add it to the dom\n var iTop = 0;\n if($.browser.mozilla && opts.container.toString() === 'body') { \n iTop = $('html').scrollTop();\n } else {\n iTop = $(opts.container).scrollTop();\n } // end if/else\n \n var overlay = $('<div></div>')\n .addClass('overlay')\n .css({\n background: opts.color,\n opacity: opts.opacity,\n top: opts.container.toString() === 'body' ? iTop : $(opts.container).offset().top,\n left: $(opts.container).offset().left,\n width: opts.container === 'body' ? '100%' : $(opts.container).width(),\n height: opts.container === 'body' ? '100%' : $(opts.container).height(),\n\tposition: opts.show == 'viewport' ? 'absolute' : 'fixed',\n /* position: 'fixed', */\n zIndex: 1000,\n display: 'none',\n\toverflow: opts.show == 'viewport' ? 'hidden' : 'visible'\n /*overflow: 'hidden'*/\n });\n\n // if specified, apply the gloss\n if(opts.glossy) {\n applyGloss(opts, overlay); \n } // end if\n \n // setup the event handlers for closing the overlay\n if(opts.closeOnClick) {\n $(overlay).click(function() {\n close(overlay, opts);\n $src.removeClass('overlay-trigger');\n });\n } // end if\n\n \n // finally add the overlay\n $(opts.container).append(overlay);\n \n return overlay;\n \n }", "title": "" }, { "docid": "76b800ae4560c2ba93ecfab6d04b2116", "score": "0.5547199", "text": "function buildOverlay( getOption, close ) {\n\t return Elem.make( getOption(\"parent\") )\n\t .clazz(\"pico-overlay\")\n\t .clazz( getOption(\"overlayClass\", \"\") )\n\t .stylize({\n\t display: \"none\",\n\t position: \"fixed\",\n\t top: \"0px\",\n\t left: \"0px\",\n\t height: \"100%\",\n\t width: \"100%\",\n\t zIndex: 10000\n\t })\n\t .stylize(getOption('overlayStyles', {\n\t opacity: 0.5,\n\t background: \"#000\"\n\t }))\n\t .onClick(function () {\n\t if ( getOption('overlayClose', true) ) {\n\t close();\n\t }\n\t });\n\t }", "title": "" }, { "docid": "df8fc72fe12e4023cbc34702bc8d41c9", "score": "0.5542805", "text": "function _Overlay() {\r\n\t\t/**\r\n\t\t * Prepare the overlay for showing.\r\n\t\t */\r\n\t\tvar _prepareOverlay = function() {\r\n\t\t\tvar overlayWrapper\t\t\t= $('<div />', {'id': 'overlay_wrapper'}).appendTo(document.body).css('display', 'none');\r\n\t\t\tvar overlayBackground\t\t= $('<div />', {'id': 'overlay_background'}).appendTo(overlayWrapper);\r\n\t\t\tvar overlayPanelContainer\t= $('<div />', {'id': 'overlay_panel_container'}).appendTo(overlayWrapper);\r\n\t\t\tvar overlayPanelHeader\t\t= $('<div />', {'id': 'overlay_panel_header'}).appendTo(overlayPanelContainer);\r\n\t\t\tvar overlayPanelCloseButton\t= $('<span />', {'id': 'overlay_panel_close'}).appendTo(overlayPanelHeader).html('&times;');\r\n\t\t\tvar overlayPanelTitle\t\t= $('<span>', {'id': 'overlay_panel_title'}).appendTo(overlayPanelHeader);\r\n\t\t\tvar overlayPanelContent\t\t= $('<div />', {'id': 'overlay_panel_content'}).appendTo(overlayPanelContainer);\r\n\t\t\t\r\n\t\t\tvar hide = function() {\r\n\t\t\t\toverlayWrapper.fadeOut(_this.Helper.getAnimationDuration(), function() {\r\n\t\t\t\t\toverlayPanelTitle.empty();\r\n\t\t\t\t\toverlayPanelContent.empty();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\toverlayBackground.click(hide);\r\n\t\t\toverlayPanelCloseButton.click(hide);\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * Show a overlay.\r\n\t\t * \r\n\t\t * @param\t{string}\ttitle\r\n\t\t * The title of the overlay.\r\n\t\t * @param\t{mixed}\t\tcontent\r\n\t\t * The content of the overlay. e.g. jQuery, jQuery[], text, html\r\n\t\t * @param\t{function}\tcallback\r\n\t\t * A callback to be called after appending the content.\r\n\t\t */\r\n\t\tthis.show = function(title, content, callback) {\r\n\t\t\tif($('#overlay_wrapper').length == 0) {\r\n\t\t\t\t_prepareOverlay();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$('#overlay_panel_title').empty().text(title);\r\n\t\t\t$('#overlay_panel_content').empty();\r\n\r\n\t\t\tif(content) {\r\n\t\t\t\t$('#overlay_panel_content').append(content);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(callback) {\r\n\t\t\t\tcallback($('#overlay_panel_content'));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$('#overlay_wrapper').fadeIn(_this.Helper.getAnimationDuration());\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Hide the overlay.\r\n\t\t */\r\n\t\tthis.hide = function() {\r\n\t\t\t$('#overlay_panel_close').click();\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "3259586389d56f001287eec109b565d9", "score": "0.55385697", "text": "function addLobbySettingsOverlay() {\n addOverlay('lobby settings', {\n width: 400,\n height: 250,\n text: 'Lobby settings',\n draw: () => {\n noStroke();\n fill(255);\n \n textAlign(CENTER);\n textSize(30);\n text(lobbyName, 200, 40);\n\n textSize(20);\n x = 250;\n\n textAlign(RIGHT);\n y = 80;\n for (let setting of lobbySettingsText) {\n text(`${setting.name}: `, x, y);\n y += 30;\n }\n\n textAlign(LEFT);\n y = 80;\n for (let setting of lobbySettingsText) {\n text(setting.value, x, y);\n y += 30;\n }\n }\n })\n .addButton({\n position: { x: 200, y: 220 },\n width: 250,\n height: 30,\n text: 'CHANGE LOBBY SETTINGS',\n textSize: 20,\n onClick: () => {\n closeOverlay();\n if (host == myid) {\n openOverlay('change lobby settings');\n } else {\n addGameMessage('Only the host of this lobby can change the game settings.');\n sounds.message.play();\n }\n }\n })\n}", "title": "" }, { "docid": "98104710a1cfc33c50c301f6624b84f5", "score": "0.54957116", "text": "gameOver(result, message){\n const overlay = document.getElementById('overlay');\n const heading = document.getElementById('game-over-message');\n overlay.style.display ='block';\n overlay.className = `${result}`;\n heading.textContent = `${message}`;\n\n this.resetGame();\n }", "title": "" }, { "docid": "b8334271c84ef29fef2d3f1ea339f603", "score": "0.5481225", "text": "function ShowExampleAppSimpleOverlay(p_open) {\n const corner = STATIC(UNIQUE(\"corner#63044b6f\"), 0);\n const io = ImGui.GetIO();\n let window_flags = ImGui.WindowFlags.NoDecoration | ImGui.WindowFlags.AlwaysAutoResize | ImGui.WindowFlags.NoSavedSettings | ImGui.WindowFlags.NoFocusOnAppearing | ImGui.WindowFlags.NoNav;\n if (corner.value !== -1) {\n const PAD = 10.0;\n const viewport = ImGui.GetMainViewport();\n const work_pos = viewport.WorkPos; // Use work area to avoid menu-bar/task-bar, if any!\n const work_size = viewport.WorkSize;\n const window_pos = new ImGui.Vec2();\n const window_pos_pivot = new ImGui.Vec2();\n window_pos.x = (corner.value & 1) ? (work_pos.x + work_size.x - PAD) : (work_pos.x + PAD);\n window_pos.y = (corner.value & 2) ? (work_pos.y + work_size.y - PAD) : (work_pos.y + PAD);\n window_pos_pivot.x = (corner.value & 1) ? 1.0 : 0.0;\n window_pos_pivot.y = (corner.value & 2) ? 1.0 : 0.0;\n ImGui.SetNextWindowPos(window_pos, ImGui.Cond.Always, window_pos_pivot);\n window_flags |= ImGui.WindowFlags.NoMove;\n }\n ImGui.SetNextWindowBgAlpha(0.35); // Transparent background\n if (ImGui.Begin(\"Example: Simple overlay\", p_open, window_flags)) {\n IMGUI_DEMO_MARKER(\"Examples/Simple Overlay\");\n ImGui.Text(\"Simple overlay\\nin the corner of the screen.\\n(right-click to change position)\");\n ImGui.Separator();\n if (ImGui.IsMousePosValid())\n ImGui.Text(`Mouse Position: (${io.MousePos.x.toFixed(1)},${io.MousePos.y.toFixed(1)})`);\n else\n ImGui.Text(\"Mouse Position: <invalid>\");\n if (ImGui.BeginPopupContextWindow()) {\n if (ImGui.MenuItem(\"Custom\", null, corner.value === -1))\n corner.value = -1;\n if (ImGui.MenuItem(\"Top-left\", null, corner.value === 0))\n corner.value = 0;\n if (ImGui.MenuItem(\"Top-right\", null, corner.value === 1))\n corner.value = 1;\n if (ImGui.MenuItem(\"Bottom-left\", null, corner.value === 2))\n corner.value = 2;\n if (ImGui.MenuItem(\"Bottom-right\", null, corner.value === 3))\n corner.value = 3;\n if (p_open && ImGui.MenuItem(\"Close\"))\n p_open(false);\n ImGui.EndPopup();\n }\n }\n ImGui.End();\n }", "title": "" }, { "docid": "6941d793e36b2d9d3adebeda5c9b80d1", "score": "0.54746807", "text": "function gameOver() {\n overlay.firstElementChild.innerHTML = 'GAME OVER'\n overlay.firstElementChild.style.color = 'red'\n overlay.style.display = 'flex'\n }", "title": "" }, { "docid": "259d155dcb3d9a1f5bfc8a1f542c4328", "score": "0.5472554", "text": "function initializeOverlay() {\n\t breakOverlay = _video2.default.dom.createEl('div', {\n\t className: 'vjs-break-overlay',\n\t innerHTML: \"<div class='vjs-break-overlay-text'></div>\"\n\t });\n\t Object.keys(setting.breakOverlay.style).forEach(function (key) {\n\t if (breakOverlay) {\n\t breakOverlay.style[key] = setting.breakOverlay.style[key];\n\t }\n\t });\n\t player.el().appendChild(breakOverlay);\n\t overlayIndex = NULL_INDEX;\n\t }", "title": "" }, { "docid": "d96bc050e31706e419cf928d52553913", "score": "0.5461154", "text": "function createSuccessAlert(message) {\n let controls = g_map.controls[google.maps.ControlPosition.TOP_CENTER];\n if(controls.j) {\n if(controls.j.length > 0) {\n $(\"#success-alert\").remove();\n controls.j.length = 0;\n }\n }\n // Get the alert template, copy it and put the message in it.\n let t_alert = document.querySelector(\"#alert-success-template\");\n let alert = document.importNode(t_alert.content,true);\n let alertdiv = document.createElement('div');\n alertdiv.setAttribute(\"id\",\"success-alert\");\n alertdiv.appendChild(alert);\n g_map.controls[google.maps.ControlPosition.TOP_CENTER].push(alertdiv);\n $(alertdiv).find(\"#success-alert-content\").html(message);\n // Add animation\n $(alertdiv).delay(2000).fadeOut(1000);\n}", "title": "" }, { "docid": "1bbcfc39d4d9622072a1492e837ed60c", "score": "0.5443668", "text": "function createCustomAlert(txt) {\r\n\td = document;\r\n\r\n\tif(d.getElementById(\"modalContainer\")) return;\r\n\r\n\tmObj = d.getElementsByTagName(\"body\")[0].appendChild(d.createElement(\"div\"));\r\n\tmObj.id = \"modalContainer\";\r\n\tmObj.style.backgroundColor = \"rgba(0, 0, 0, 0.3)\";\r\n\tmObj.style.position=\"absolute\";\r\n\tmObj.style.top=\"0\";\r\n\tmObj.style.width=\"100%\";\r\n\tmObj.style.height=d.documentElement.scrollHeight + \"px\";\r\n\tmObj.style.left=\"0px\";\r\n\tmObj.style.zIndex=\"10000\";\r\n \r\n\talertObj = mObj.appendChild(d.createElement(\"div\"));\r\n\talertObj.id = \"alertBox\";\r\n\tif(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + \"px\";\r\n\talertObj.style.left = \"33%\";\r\n\talertObj.style.visiblity=\"visible\";\r\n\talertObj.style.position=\"relative\";\r\n\talertObj.style.width=\"33%\";\r\n\talertObj.style.height=\"120px\";\r\n\talertObj.style.marginTop=\"50px\";\r\n\talertObj.style.border=\"2px solid #fff\";\r\n\talertObj.style.backgroundColor=\"#fff\";\r\n\talertObj.style.backgroundRepeat=\"no-repeat\";\r\n\talertObj.style.top=\"10%\";\r\n\r\n\th1 = alertObj.appendChild(d.createElement(\"h1\"));\r\n\th1.appendChild(d.createTextNode(modalTitle));\r\n\th1.style.margin = \"0\";\r\n\th1.style.font=\"bold 2em Raleway,arial\";\r\n\th1.style.backgroundColor=\"#cf1717\";\r\n\th1.style.color=\"#FFF\";\r\n\th1.style.borderBottom=\"1px solid #cf1717\";\r\n\th1.style.padding=\"10px 0 10px 5px\";\r\n\r\n\tmsg = alertObj.appendChild(d.createElement(\"p\"));\r\n\t//msg.appendChild(d.createTextNode(txt));\r\n\tmsg.innerHTML = txt;\r\n\tmsg.style.textAlign = \"center\";\r\n\tmsg.style.margin = \"10px\";\r\n\tmsg.style.font=\"1.5em Raleway,arial\";\r\n\r\n\tbtn = alertObj.appendChild(d.createElement(\"a\"));\r\n\tbtn.id = \"closeBtn\";\r\n\tbtn.appendChild(d.createTextNode(\"Okay\"));\r\n\tbtn.href = \"#\";\r\n\tbtn.focus();\r\n\tbtn.onclick = function() { removeCustomAlert();return false; }\r\n\tbtn.style.display=\"block\";\r\n\tbtn.style.position=\"absolute\";\r\n\tbtn.style.padding=\"7px\";\r\n\tbtn.style.width=\"10%\";\r\n\tbtn.style.textTransform=\"uppercase\";\r\n\tbtn.style.textAlign=\"center\";\r\n\tbtn.style.color=\"#FFF\";\r\n\tbtn.style.backgroundColor=\"#cf1717\";\r\n\tbtn.style.textDecoration=\"none\";\r\n\tbtn.style.bottom = \"0\";\r\n\tbtn.style.left = \"45%\";\r\n\tbtn.style.font=\"1.5em Raleway,arial\";\r\n\talertObj.style.display = \"block\";\r\n \r\n}", "title": "" }, { "docid": "47a572e1357cf35f33182cd2fc829ee1", "score": "0.5427074", "text": "function showMessage(type, message, delay) {\n\tvar title;\n\tif ($.isPlainObject(type)) {\n\t\tvar obj = type;\n\t\ttype = obj.type;\n\t\ttitle = obj.title;\n\t\tmessage = obj.message;\n\t\tdelay = obj.delay;\n\t}\n\ttitle = title || \"\";\n\tvar pane = $(\"#messagePanel\");\n\tswitch(type.toLowerCase()) {\n\tcase \"error\": type = \"Error\"; break;\n\tcase \"warn\": type = \"Warning\"; break;\n\tdefault: type = \"Information\"; break;\n\t}\n\tdelay = delay || 0;\n\tpane.children(\"img\")[0].src = \"css/images/\" + type.toLowerCase() + \".png\";\n\tpane.children(\".dialog-title\").empty().append(type).append(title);\n\tpane.children(\".dialog-message\").empty().append(message);\n\t\n\tvar ovr = $(\"#messagePanel\").overlay({\n\t\twidth: '412px',\n\t\tcloseOnClick: false,\n\t\toneInstance: false,\n\t\tapi: true\n\t});\n\tsetTimeout(function() {\n\t\tovr.load();\n\t\tpane.find(\".close\").focus();\n\t}, delay);\n}", "title": "" }, { "docid": "095e3bd3f27a4f4dfe59b5ddb7cd1837", "score": "0.5425004", "text": "function showOverlay(html) {\n var d = document.getElementById('overlay');\n if(d == null) {\n return;\n }\n d.style.display = 'block';\n d.innerHTML = '<div class=\"overlay_shadow\"></div>'\n +'<div class=\"overlay_contents\"><button onclick=\"hideOverlay()\">Close</button>'\n +html+'</div>';\n}", "title": "" }, { "docid": "41d1c8301459278f92df06d6588cee32", "score": "0.5422842", "text": "showOverlay(additionalHTML = \"\") {\n const overlay = document.createElement(\"div\");\n overlay.id = \"o_askblocker\";\n overlay.style.position = \"fixed\";\n overlay.style.top = 0;\n overlay.style.left = 0;\n overlay.style.right = 0;\n overlay.style.bottom = 0;\n overlay.style.zIndex = 2147483647;\n overlay.style.opacity = 0;\n overlay.style.backgroundColor = \"rgba(0, 0, 0, 0.8)\";\n overlay.style.transition = \"opacity 0.1s, backgroundColor 0.1s\";\n\n const overlayInner = document.createElement(\"div\");\n overlayInner.style.position = \"fixed\";\n overlayInner.style.top = \"50%\";\n overlayInner.style.left = \"50%\";\n overlayInner.style.color = \"#fff\";\n overlayInner.style.fontSize = \"26px\";\n overlayInner.style.fontFamily = \"'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif\";\n overlayInner.style.transform = \"translate(-50%, -50%)\";\n overlayInner.innerHTML = `<p>Click \"Allow\" to grant the permission. Once you do, the page will reload.</p>${additionalHTML}`;\n overlay.appendChild(overlayInner);\n\n (document.body || document.documentElement).appendChild(overlay);\n setTimeout(function() {\n overlay.style.opacity = 1;\n }, 0);\n }", "title": "" }, { "docid": "a351491051e8a634442ca3641368f077", "score": "0.53957033", "text": "function drawOverlayButton(conf) {\n if (conf.show) {//if have to show the overlay button\n //createw a span for back button\n //add the text\n //set border color onclick function etc.\n var back = document.createElement('span');\n back.innerHTML = conf.message ? conf.message : \"Back\";\n back.style.border = '1px solid #' + (conf.borderColor ? conf.borderColor : \"7f8975\");\n back.style.backgroundColor = '#' + (conf.bgColor ? conf.bgColor : \"edefec\");\n back.style.fontFamily = conf.font ? conf.font : \"Verdana\";\n back.style.color = '#' + conf.fontColor ? conf.fontColor:\"49563a\";\n back.style.fontSize = (conf.fontSize ? conf.fontSize : '10') + 'px';\n back.style.padding = (conf.padding ? conf.padding : '3') + 'px';\n back.style.fontWeight = parseInt(conf.bold, 10) === 0 ? 'normal' : 'bold';\n back.style.position = 'absolute';\n back.style.top = '1px';\n back.style.right = '1px';\n back.style._cursor = 'hand';\n back.style.cursor = 'pointer';\n back.onclick = (function (sender) {\n return function () {\n global.raiseEvent('OverlayButtonClick', {}, sender.FusionCharts);\n };\n }(this));\n document.getElementById(this.id).childNodes[0].appendChild(back);\n }\n }", "title": "" }, { "docid": "62acb809db8f293edd497a7a2fc6bbf9", "score": "0.5395266", "text": "function initializeOverlay() {\n breakOverlay = $(\"<div class='vjs-break-overlay'><div class='vjs-break-overlay-text'></div></div>\").css(setting.breakOverlay.style);\n videoWrapper.append(breakOverlay);\n overlayIndex = -1;\n }", "title": "" }, { "docid": "c8354da6ab0facf4b1d3a08cd33c17a4", "score": "0.53915274", "text": "function addTip(overlay, tip)\n\t{\n\t\tvar div = document.createElement(\"Div\");\n\t\tdiv.style.backgroundColor = \"yellow\";\n\t\tdiv.style.color = \"blue\";\n\t\tdiv.style.position = \"absolute\";\n\t\t\n\t\tdiv.innerHTML = tip + \" \";\n\t\toverlay.tip = new CustomeOverlay(overlay.getPath().getAt(0), div, false);\n\t}", "title": "" }, { "docid": "6d16c0918576e17031e415f318dfb705", "score": "0.5390486", "text": "display(){\n\n fill(this.color);\n rect(this.x,this.y,this.size,this.size);\n text(this.name, this.x, this.y-10);\n\n if(this.overlay == true){\n fill(127,127);\n rect(this.x,this.y,this.size,this.size);\n }\n }", "title": "" }, { "docid": "5cf960dc848cc5e6a037f20944cc210b", "score": "0.53880244", "text": "_makeOverlay(id) {\n var $overlay = $('<div></div>')\n .addClass('reveal-overlay')\n .appendTo('body');\n return $overlay;\n }", "title": "" }, { "docid": "a363b636cfc268957f0d2a87317597ac", "score": "0.53811437", "text": "function openOverlay() {\n\t// Create markup for an overlay with an image\n\t// Use `this` for the image\n\tconst overlayMarkup = `<div id=\"overlay\">\n\t\t<figure>\n\t\t\t${this.outerHTML}\n\t\t\t<figcaption>${this.alt}</figcaption>\n\t\t</figure>\n\t</div>`;\n\n\t// Add the overlay before the closing of the body tag\n\tbody.insertAdjacentHTML(`beforeend`, overlayMarkup);\n\n\t// Get the overlay from the page\n\tconst overlay = document.querySelector(`#overlay`);\n\n\t// Add an event to the overlay when clicked\n\toverlay.addEventListener(`click`, listenForCloseClick);\n\n\t// Add an event for whenever a key is pressed\n\tdocument.addEventListener(`keyup`, listenForCloseKeypress);\n}", "title": "" }, { "docid": "60b7ac53a4f02b2b01ed58b8c03b8f38", "score": "0.53780776", "text": "function displayMessage(){\n\tif (level < 11 && lives > 0) {\n\t\tvar title = new Element('h2', {\n\t\t\tid: 'message_title',\n\t\t\ttext: 'Level ' + level,\n\t\t});\n\n\t\tvar subtitle = new Element ('p', {\n\t\t\tid: 'message_subtitle',\n\t\t\ttext: 'Press Enter to start',\n\t\t});\n\t} else if(level > 10) {\n\t\tvar title = new Element('h2', {\n\t\t\tid: 'message_title',\n\t\t\ttext: 'Victory',\n\t\t});\n\n\t\tvar subtitle = new Element ('p', {\n\t\t\tid: 'message_subtitle',\n\t\t\ttext: 'Well done! Refresh to play again',\n\t\t});\n\t} else if(lives < 1){\n\t\tvar title = new Element('h2', {\n\t\t\tid: 'message_title',\n\t\t\ttext: 'Defeat',\n\t\t});\n\n\t\tvar subtitle = new Element ('p', {\n\t\t\tid: 'message_subtitle',\n\t\t\ttext: 'Refresh to try again',\n\t\t});\n\t}\n\n\ttitle.inject(game);\n\tsubtitle.inject(game);\n}", "title": "" }, { "docid": "b4ea94594e967a20808c51494e6e09f8", "score": "0.5375051", "text": "function display_waiting_message() {\n display_overlay_message(MSG_WELCOME, 'waiting');\n}", "title": "" }, { "docid": "fc43b48274a5e683b415c391a33e6fa2", "score": "0.5373801", "text": "function initializeOverlay() {\n breakOverlay = _video2.default.createEl('div', {\n className: 'vjs-break-overlay',\n innerHTML: \"<div class='vjs-break-overlay-text'></div>\"\n });\n Object.keys(setting.breakOverlay.style).forEach(function (key) {\n if (breakOverlay) {\n breakOverlay.style[key] = setting.breakOverlay.style[key];\n }\n });\n player.el().appendChild(breakOverlay);\n overlayIndex = NULL_INDEX;\n }", "title": "" }, { "docid": "23a801f0dd05c9aa5ef532aeb45d54ae", "score": "0.53693134", "text": "function createInGameMessages(scene) {\n scoreText = scene.add.text(16, 16, \"Score: 0\", {\n fontSize: \"32px\",\n fill: \"#fff\"\n });\n highScoreText = scene.add.text(gameWidth - 540, 16, getHighScoreMessage(), {\n fontSize: \"32px\",\n fill: \"#fff\"\n });\n}", "title": "" }, { "docid": "2d8c73f8474e533fee7fcd3ea19608bc", "score": "0.5351735", "text": "_makeOverlay(id) {\n var $overlay = $('<div></div>')\n .addClass('reveal-overlay')\n .attr({'tabindex': -1, 'aria-hidden': true})\n .appendTo('body');\n return $overlay;\n }", "title": "" }, { "docid": "896f1f89bc2eadb7ef2b91bf631a7cbe", "score": "0.5349065", "text": "renderOverlay() {\n\t\tconst show = this.props.view !== 'files';\n\n\t\tglobal.ui.overlay( show );\n\n\t\tif ( ! show ) {\n\t\t\treturn '';\n\t\t} else {\n\t\t\tlet content;\n\n\t\t\tif ( this.props.view === 'logs' ) {\n\t\t\t\tcontent = <Logs />;\n\t\t\t} else {\n\t\t\t\tcontent = <Settings />;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<Overlay hasClose={ false }>\n\t\t\t\t\t{ content }\n\t\t\t\t</Overlay>\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "0d18cd3fcb1a917d0337aca4ac3e7ec2", "score": "0.5348315", "text": "initializeOverlay() {\n this.breakOverlay = videojs.dom.createEl('div', {\n className: 'vjs-break-overlay',\n innerHTML: \"<div class='vjs-break-overlay-text'></div>\"\n });\n Object.keys(this.setting.breakOverlay.style).forEach(key => {\n if (this.breakOverlay) {\n this.breakOverlay.style[key] = this.setting.breakOverlay.style[key];\n }\n });\n this.player.el().appendChild(this.breakOverlay);\n this.overlayIndex = NULL_INDEX;\n }", "title": "" }, { "docid": "b51bb1dfd36ecb5941c8dbb904173ec9", "score": "0.5326612", "text": "function popup(title, options){\n\tvar id = \"popup_\" + (options.id || (new Date()).getTime());\n\tvar _popup = \"#\"+id;\n\tif(!$(_popup).length){\n\t\tvar content = \"\";\n\t\tif (options.content) {\n\t\t\tif(options.content.indexOf(\"#\") == 0){\n\t\t\t\tcontent = $(options.content).html();\n\t\t\t\t$(options.content).remove();//Avoid id confliction.\n\t\t\t}else if(options.content.indexOf(\"/\") == 0){\n\t\t\t\t$.get(options.content, options.data, function(data){\n\t\t\t\t\toptions.content = data;\n\t\t\t\t\tpopup(title, options);\n\t\t\t\t\tif (options.callback) {\n\t\t\t\t\t\teval(options.callback);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\tcontent = options.content;\n\t\t\t}\n\t\t}\n\t popHolder(id, title, content, options.cssClass).appendTo($(document.body));\n\t\tvar jqmOptions = options.jqm || {overlay: 0, modal:false};\n\t\tvar modal = $(_popup).jqm(jqmOptions)\n\t\tif (options.drag) {\n\t\t\tmodal = modal.jqDrag(\".pop-title\");\n\t\t}\n\t\tif (options.resize) {\n\t\t\tmodal.jqResize();\n\t\t}\n\t\tif(options.position){\n\t\t\t$(_popup).css(options.position);\n\t\t}else{\n\t\t $(_popup).css({\"margin-top\":-($(_popup).height()/2)});\t\n\t\t}\n\t\tif (options.timeout>0) {\n\t\t $(_popup).attr(\"timeout\",options.timeout);\n\t\t autoClose(id);\n\t\t}\t\t\n\t}\n\t$(_popup).jqmShow();\n}", "title": "" }, { "docid": "1f4fe6c1a5d7cac626e0700095240a55", "score": "0.53242517", "text": "function showMessage(msg, removable)\n{\n\tvar background = new Kinetic.Rect({\n x: 0,\n y: 0,\n strokeEnabled: false,\n fill: 'black',\n opacity: 0.4,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n shadowEnabled: false,\n });\n\tvar box = new Kinetic.Rect({\n x: STAGE_WIDTH/3,\n y: STAGE_HEIGHT/3,\n stroke: ATTRIBBOX_BORDER_COLOUR,\n strokeWidth: ATTRIBBOX_BORDER_WIDTH,\n fill: ATTRIBBOX_FILL,\n width: STAGE_WIDTH/3,\n height: STAGE_HEIGHT/3,\n shadowEnabled: ATTRIBBOX_SHADOW,\n shadowColor: ATTRIBBOX_SHADOW_COLOUR,\n shadowBlur: ATTRIBBOX_SHADOW_BLUR,\n shadowOffset: ATTRIBBOX_SHADOW_OFFSET,\n shadowOpacity: ATTRIBBOX_SHADOW_OPACITY,\n cornerRadius: ATTRIBBOX_CORNER_RADIUS\n });\n\tvar message = new Kinetic.Text({\n x: box.getX(),\n y: box.getY(),\n text: msg,\n fontSize: ATTRIBBOX_LARGE_FONT,\n fontFamily: ATTRIBBOX_FONT_FAMILY,\n fontStyle: ATTRIBBOX_FONT_STYLE,\n fill: 'black',\n strokeEnabled: ATTRIBBOX_FONT_OUTLINE,\n stroke: ATTRIBBOX_FONT_OUTLINE_COLOUR,\n align: 'center',\n padding: box.getHeight()*0.3,\n width: box.getWidth(),\n height: box.getHeight()\n\t});\n\tvar submessage = new Kinetic.Text({\n x: box.getX(),\n y: box.getY() + box.getHeight() - 30,\n text: \"Click anywhere to continue.\",\n fontSize: ATTRIBBOX_SMALL_FONT,\n fontFamily: ATTRIBBOX_FONT_FAMILY,\n fontStyle: 'italic',\n fill: 'aaaaaa',\n strokeEnabled: ATTRIBBOX_FONT_OUTLINE,\n stroke: ATTRIBBOX_FONT_OUTLINE_COLOUR,\n align: 'center',\n padding: 0,\n width: box.getWidth(),\n height: box.getHeight()\n\t});\n\t\n\tmessageLayer.add(background);\n\tmessageLayer.add(box);\n\tmessageLayer.add(message);\n\tif (removable)\n\t\tmessageLayer.add(submessage);\n\tmessageLayer.draw();\n\t\n\tif (removable)\n\t{\n\t\tmessageLayer.on('mouseup', function(evt){\n\t\t\tmessageLayer.removeChildren();\n\t\t\tmessageLayer.draw();\n\t\n\t\t\tif (taskCompleted)\n\t\t\t\twindow.location.href = URL_CONTINUE;\n\t\t});\n\t}\n}", "title": "" }, { "docid": "e7fddf2d4d5a817236832dbc80ce32d1", "score": "0.5315479", "text": "gameOver(gameWon) {\n document.getElementById(\"overlay\").style.display = \"flex\";\n // document.querySelector('#overlay').style.visibility = 'visible';\n // document.getElementById(\"btn__reset\").style.display = \"none\";\n const message = document.getElementById(\"game-over-message\");\n if ( gameWon){\n message.innerText = \"congrats\";\n document.getElementById(\"overlay\").className = \"win\"; \n\n // player won\n\n } else {\n // player lost\n message.innerText = \"sorry you lose\";\n document.getElementById(\"overlay\").className = \"lose\";\n }\n }", "title": "" }, { "docid": "37d71949e2eb2148135d3148e6899080", "score": "0.5311084", "text": "function showOverlayBox() {\n //if box is not set to open then don't do anything\n if( isOpen == false ) return;\n // set the properties of the overlay box, the left and top positions\n jQuery('.overlayBox').css({\n display:'block',\n left:( jQuery(window).width() - jQuery('.overlayBox').width() )/2,\n top: '0',\n position:'absolute'\n });\n // set the window background for the overlay. i.e the body becomes darker\n jQuery('.bgCover').css({\n display:'block',\n width: jQuery(window).width(),\n height:\"100%\"\n });\n}", "title": "" }, { "docid": "bd21d73a5d98be711520d19fa0f41b81", "score": "0.5303519", "text": "function createOverlay(json) {\n document.getElementById(\"instruction\").style.display = \"block\";\n document.getElementById(\"overlay\").style.display = \"block\";\n var i;\n for (i = 0; i < Object.keys(json).length; i++) {\n const card = createCard();\n document.getElementById(\"overlay_contents\").appendChild(card);\n card.setAttribute(\"id\", json[i].id);\n card.getElementsByClassName(\"container\")[0].getElementsByTagName(\"h4\")[0].appendChild(document.createTextNode(json[i].title));\n card.getElementsByTagName(\"img\")[0].setAttribute(\"src\", \"http://mangadex.org\" + json[i].cover);\n card.addEventListener(\"click\", getRecommended);\n }\n document.getElementById(\"loading\").style.display = \"none\";\n }", "title": "" }, { "docid": "476f034d6544676cf58807a3ecbee7f1", "score": "0.53028333", "text": "_createOverlay(config) {\n const overlayConfig = this._getOverlayConfig(config);\n return this._overlay.create(overlayConfig);\n }", "title": "" }, { "docid": "7f076fcce405358e8d9d84c1a2bce508", "score": "0.52946347", "text": "function alert_message(msg, className) {\n if (typeof className === 'undefined') { className = 'alert'; }\n let form = document.createElement('form');\n form.style.textAlign = 'center';\n form.appendChild(document.createElement('div')).innerHTML = msg;\n let ok = form.appendChild(make_ok((e) => {\n e.preventDefault();\n dismiss_overlay_message(className);\n }));\n display_overlay_message(form, className);\n ok.focus();\n}", "title": "" }, { "docid": "e1963fb347af52f075666ea60465219d", "score": "0.5292161", "text": "function Overlay(){\n\tthis.letter = \"A\";\n\tthis.hide =\tfalse;\n\tthis.drawed = false;\n\tthis.draw = function(){\n\t\tif (!this.hide && !this.drawed){\n\t\t\t//this.context.globalAlpha = 0.7;\n\t\t\tthis.context.beginPath();\n\t\t\tthis.context.strokeStyle = \"rgba(0,0,0,1)\";\n\t\t\tthis.context.fillStyle = \"rgba(255,255,255,0.9)\";\n\t\t\tthis.context.rect(this.x-5, this.y-this.height+5, this.width, this.height);\n\t\t\tthis.context.stroke();\n\t\t\tthis.context.fill();\n\t\t\tthis.context.closePath();\n\t\t\tthis.context.fillStyle = \"black\";\n\t\t\tthis.context.font = \"30px Arial\";\n\t\t\tthis.context.fillText(this.letter,this.x,this.y);\n\t\t\tthis.drawed = true;\n\t\t}\n\t\telse if(this.hide && this.drawed){\n\t\t\tthis.context.clearRect(this.x-6, this.y-this.height+4, this.width+10, this.height+10);\n\t\t\tthis.drawed = false;\n\t\t}\n\t};\n }", "title": "" }, { "docid": "4447bf0af4d2b5018a526d58b121a972", "score": "0.527915", "text": "function attachMessage(holonObjectId, rectangleFromFactory) {\n\tgoogle.maps.event.addListener(rectangleFromFactory, 'click', function(event) {\t\n\t\tif(connectHolonObjectToPowerLineMode)\n\t\t{\n\t\t\tconnectPowerSourceOrHolonObjectToPowerLine(event.latLng,holonObjectId,\"HolonObject\");\n\t\t}else if(areConnectedMode){\n\t\t\tif(isConnectedFirst==\"\" && isConnectedSecond==\"\")\n\t\t\t\t{\n\t\t\t\tisConnectedFirst=holonObjectId;\n\t\t\t\t}\n\t\t\telse if(isConnectedFirst!=\"\" && isConnectedSecond==\"\")\n\t\t\t\t{\n\t\t\t\t isConnectedSecond=holonObjectId;\n\t\t\t\t areHolonObjectsConnected(isConnectedFirst,isConnectedSecond);\n\t\t\t\t isConnectedFirst=\"\";\n\t\t\t\t isConnectedSecond=\"\";\n\t\t\t\t}\n\t\t\telse \n\t\t\t\t{\n\t\t\t\talert(\"Please close the isConnected Mode\" );\n\t\t\t\t}\n\t\t\t\n\t\t}/*else if(disasterModeDelete){\n\t\t\tvar disasterId=holonObjectId;\n\t\t\tvar disasterMarker= globalDisasterList.get(disasterId);\n\t\t\tshowInfoWindowForDisater(disasterId,disasterMarker);\n\t\t\t\n\t\t}*/else{\n\t\t\tvar dataAttributes={\n\t\t\t\t\tholonObjectId:holonObjectId\t\n\t\t\t};\n ajaxRequest(\"getHolonObjectInfoWindow\", dataAttributes, getHolonInfoWindowCallBack, {});\t\t\n\t\t}\n\t\t\n\t });\n}", "title": "" }, { "docid": "e02cfdc9067884431b2894bf730c7bc3", "score": "0.52773845", "text": "createNewOverlay(options) {\r\n return $('<div class=\"overlay-backdrop\" />').attr({\r\n id: options.id,\r\n }).addClass(options.classes).css({\r\n background: options.theme == 'dark' ? 'rgba(0, 0, 0, ' + options.opacity + ')' : 'rgba(255, 255, 255, 0.5)',\r\n zIndex: options.zIndex,\r\n });\r\n }", "title": "" }, { "docid": "283f8910da73ad5c2d7e3d446241a860", "score": "0.52738184", "text": "function showGameOverInfo(){\n //creating game over info and adding it to the main el\n const element = document.getElementsByClassName('wrapper');\n const gameOverText = document.createElement('p');\n gameOverText.classList.add('gameOverText');\n gameOverText.innerText=`Game over. Your score is ${ball4.scoreText}`;\n element[0].appendChild(gameOverText);\n // creating main btn\n createStartBtn();\n}", "title": "" }, { "docid": "ef52c85913410063aedaaf5970efcbd2", "score": "0.526241", "text": "function CustomeOverlay(pos, div, isTitle)\n\t{\n\t\tthis.pos = pos;\n\t\tthis.div = div;\n\t\tthis.setMap(map);\n\t\tthis.isTitle = isTitle;\n\t}", "title": "" }, { "docid": "37f0dd69c1acbc2f84a453e630ceb57e", "score": "0.5261656", "text": "function gameMessage(title, messageText, messageButton, buttonFunction){\n $('body').append('<div class=\"messageBox\"><label class=\"lblMessageTitle\">' \n + title + '</label><label class=\"lblMessage\">'\n + messageText + '</label><button class=\"btnMessage\"> '\n + messageButton + '</button></div>');\n \n $('.btnMessage').on ('click', buttonFunction);\n}", "title": "" }, { "docid": "83edae11c795d516c77778854de6a5c2", "score": "0.5255557", "text": "function drawOverlay() {\n\tif (currentGame.overlay) {\n\t\tcurrentGame.overlay.forEach( element => {\n\t\t\tdrawElement(element);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "aa4d829b959eccfaded80a298d1af4ea", "score": "0.5251995", "text": "function dialogue(content, title) {\n content = $('<div />', {\n 'class': 'dialogue clearfix'\n }).append(content);\n\n $.iLightBox([\n {\n URL: content,\n type: \"html\",\n title: (title) ? title : null\n }\n ],\n {\n skin: 'metro-white ilightbox-dialogue',\n minScale: 1,\n innerToolbar: true,\n show: {\n effect: false\n },\n hide: {\n effect: false\n },\n overlay: {\n blur: false\n },\n controls: {\n fullscreen: false\n },\n callback: {\n // Hide the iLightBox when any buttons in the dialogue are clicked\n onRender: function(api) {\n $('.btn', api.currentElement).click(function(){\n $('.btn', api.currentElement).unbind('click');\n api.hide();\n });\n },\n // Hide the iLightBox when any buttons in the dialogue are clicked\n onShow: function(api) {\n $('.btn-primary', api.currentElement).focus();\n }\n }\n });\n }", "title": "" }, { "docid": "4ff1fd9735e5a46c3db596188c10c3cc", "score": "0.52504647", "text": "_createOverlay() {\n if (this._overlayRef) {\n return this._overlayRef;\n }\n const scrollableAncestors = this._scrollDispatcher.getAncestorScrollContainers(this._elementRef);\n // Create connected position strategy that listens for scroll events to reposition.\n const strategy = this._overlay.position()\n .flexibleConnectedTo(this._elementRef)\n .withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`)\n .withFlexibleDimensions(false)\n .withViewportMargin(this._viewportMargin)\n .withScrollableContainers(scrollableAncestors);\n strategy.positionChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.takeUntil)(this._destroyed)).subscribe(change => {\n this._updateCurrentPositionClass(change.connectionPair);\n if (this._tooltipInstance) {\n if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance.isVisible()) {\n // After position changes occur and the overlay is clipped by\n // a parent scrollable then close the tooltip.\n this._ngZone.run(() => this.hide(0));\n }\n }\n });\n this._overlayRef = this._overlay.create({\n direction: this._dir,\n positionStrategy: strategy,\n panelClass: `${this._cssClassPrefix}-${PANEL_CLASS}`,\n scrollStrategy: this._scrollStrategy()\n });\n this._updatePosition(this._overlayRef);\n this._overlayRef.detachments()\n .pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.takeUntil)(this._destroyed))\n .subscribe(() => this._detach());\n return this._overlayRef;\n }", "title": "" }, { "docid": "f0055c7b3dda7aa93ead016a8f31f1ef", "score": "0.5250123", "text": "function alertBoxNewGame (alertTitle) {\n let createBox = document.createElement('div');\n let parent = document.getElementsByClassName(\"game-area\")[0].parentNode;\n createBox.innerHTML = `<div class=\"alert-box\">\n <h1 style=\"background-color:green ; width:100%; color:white; padding: 5px 0; border-radius: 5px; font-size: 1.5em; letter-spacing: 1px;\">${alertTitle}</h1>\n <br><p style=\"text-align:center;\">Can you reassemble the periodic table?</p>\n <br><p style=\"text-align:center;\">Enter your name and start a new game!</p>\n <label for=\"user-name\">Player Name:</label>\n <input type=\"text\" id=\"user-name\" name=\"user-name\">\n <button type=\"button\" data-type=\"close-alert\" class=\"btn btn--close btn--new\" >\n <span>Start</span>\n </button>\n </div>`;\n createBox.classList.add('underlay'); \n parent.insertBefore(createBox, parent.childNodes[0]);\n\n document.getElementsByClassName('btn--close')[0].addEventListener(\"click\", closeAlertNewGame);\n document.getElementById('user-name').onkeypress = function(event){\n let key = event.keyCode;\n return ((key >= 65 && key <= 90) || (key >= 95 && key <= 122) || key == 32);\n };\n\n}", "title": "" }, { "docid": "8bd74e194876e14ed1c30d1dde555384", "score": "0.5248764", "text": "function CustomAlert() {\n this.render = function(dialog) {\n let winH = window.innerHeight;\n let dialogoverlay = document.getElementById('dialogoverlay');\n let dialogbox = document.getElementById('dialogbox');\n dialogoverlay.style.display = \"block\";\n dialogoverlay.style.height = winH + \"px\";\n dialogbox.style.top = \"100px\";\n dialogbox.style.display = \"block\";\n document.getElementById('dialogboxhead').innerHTML = \"<strong>Your message to us...</strong>\";\n document.getElementById('dialogboxbody').innerHTML = dialog;\n document.getElementById('dialogboxfoot').innerHTML = '<button class=\"btn btn-danger\" onclick=\"Alert.ok()\"><i class=\"far fa-times-circle\"></i> Close</button>';\n };\n this.ok = function() {\n document.getElementById('dialogbox').style.display = \"none\";\n document.getElementById('dialogoverlay').style.display = \"none\";\n };\n}", "title": "" }, { "docid": "afc270136ae8a41747ef03d0789110e8", "score": "0.5242349", "text": "function onOverlayClick() {\n onClose();\n }", "title": "" }, { "docid": "cd2c267bf2c58697807bf24a3142efef", "score": "0.5239711", "text": "create(opts) {\n return createOverlay(this.doc.createElement('ion-alert'), opts);\n }", "title": "" }, { "docid": "7aefd3721717d1f18142e70e492b6a29", "score": "0.52218217", "text": "function popAlert(title, msg) {\n\t$(\"#dialog-message\").text(msg);\n\t$(\"#dialog-message\").dialog({\n\t\ttitle: title,\n\t\tmodal: true,\n\t\tposition : ['center','center'],\n\t\tbuttons: {\n\t\t\tOk: function() {\n\t\t\t\t$(this).dialog( \"close\" );\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "c4d6daf883f51be4af78d20abed6e558", "score": "0.5218255", "text": "function popBox(title, html,closeCall) {\n\t$(\"#dialog-message\").html(html);\n\treturn $(\"#dialog-message\").dialog({\n\t\ttitle\t: title,\n\t\tmodal\t: false,\n\t\tposition : ['center','center'],\n\t\tzIndex \t: 999999,\n\t\tclose \t: function(){\n\t\t\tvar temp = closeCall != undefined ? closeCall() : null;\n\t\t\t$(\"#dialog-message\").dialog('destroy');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a107659aad4c42add654b79e8b0aa68a", "score": "0.52132046", "text": "function buildOverlay() {\n const {\n overlay,\n overlayFrame,\n overlayVodChat,\n overlayButtonsContainer,\n } = TC_CLASSES\n const {\n toHide,\n display,\n vodChatListWrapper,\n chatScrollableArea,\n } = TW_CLASSES\n\n let container = document.createElement('div')\n container.className = overlay\n container.style.display = 'none'\n\n if (isLive) {\n const channel = window.location.pathname.substr(1)\n\n let frame = document.createElement('iframe')\n frame.className = overlayFrame\n frame.src = `https://www.twitch.tv/popout/${channel}/chat`\n frame.height = '100%'\n frame.width = '100%'\n frame.onload = function () {\n let frameDoc = this.contentWindow.document\n toHide.forEach(className => {\n elementReady(`.${className}`, frameDoc).then(el =>\n display.forEach(displayClass =>\n el.classList.remove(displayClass)\n )\n )\n })\n elementReady(`.${overlayButtonsContainer}`, document).then(el => {\n updateThemeStyles()\n updateChatStyles()\n translateOverlayPosition()\n frameDoc.body\n .querySelector('.chat-input')\n .classList.add('chat-input__hide')\n addOverlayFunctions(container, el, frameDoc.body)\n })\n elementReady(`.${chatScrollableArea}`, frameDoc).then(chatEl => {\n observeLiveChat(chatEl)\n })\n }\n container.prepend(frame)\n } else {\n elementReady(`.${vodChatListWrapper} ul`, document).then(el => {\n let wrapper = document.querySelector(`.${vodChatListWrapper}`)\n let clone = wrapper.cloneNode(true)\n clone.classList.add(overlayVodChat)\n observeVodChat(wrapper)\n container.prepend(clone)\n })\n }\n\n let buttons = buildOverlayButtons()\n container.appendChild(buttons)\n\n if (!isLive)\n elementReady(`.${overlayVodChat}`, document).then(el => {\n updateThemeStyles()\n updateChatStyles()\n translateOverlayPosition()\n addOverlayFunctions(container, buttons, null)\n })\n\n return container\n}", "title": "" }, { "docid": "9b08f2263417e7910c2e95f30b7367bb", "score": "0.52131164", "text": "_createOverlayElements() {\n const offcanvasMenu = OffcanvasMenuPlugin._getOffcanvasMenu();\n\n if (offcanvasMenu) {\n this._placeholder = OffcanvasMenuPlugin._createPlaceholder(offcanvasMenu);\n this._overlay = OffcanvasMenuPlugin._createNavigationOverlay(offcanvasMenu);\n }\n }", "title": "" }, { "docid": "3bcff447b3b4d6de271bd91bd9982330", "score": "0.5212096", "text": "function displayMessage(msgHead, msgContent, msgWarning) {\r\n // Display result\r\n var $gameover = $(\"#gameover\");\r\n $gameover.empty();\r\n $(\"<h2>\").text(msgHead).addClass(\"warning\").appendTo($gameover);\r\n $(\"<p>\").text(\" \").appendTo($gameover);\r\n $(\"<p>\").text(msgContent).addClass(\"warning\").appendTo($gameover);\r\n $(\"<p>\").text(\" \").appendTo($gameover);\r\n $(\"<p>\").text(msgWarning).addClass(\"warning\").appendTo($gameover);\r\n $(\"<p>\").text(\" \").appendTo($gameover);\r\n $(\"<button>\").text(\"Back To Home\").on(\"click\", onHome).addClass(\"btn btn-default marginH\").appendTo($gameover);\r\n $(\"<p>\").text(\" \").appendTo($gameover);\r\n locateGameOver();\r\n $gameover.fadeIn(1000);\r\n}", "title": "" }, { "docid": "87a5e0e9adead9d09b1fd0e5974be590", "score": "0.52054054", "text": "function updateoverlay(){\n\n blocktitle.html(title);\n\n content.find(\">:first-child\").addClass('vbox-figlio').css({\n 'width': framewidth,\n 'height': frameheight,\n 'padding': border,\n 'background': bgcolor\n });\n\n $('img.vbox-figlio').on('dragstart', function(event) {\n event.preventDefault();\n });\n\n updateOL();\n\n content.animate({\n 'opacity': '1'\n },'slow', function(){\n $preloader.hide();\n });\n option.cb_content_loaded(obj, gallIndex, thenext, theprev);\n }", "title": "" }, { "docid": "35c8b48105d2aa3e35507e6fe685f511", "score": "0.52006674", "text": "gameOver(message) {\n //Selects the overlay elemnt\n let overlay = document.getElementById(\"overlay\");\n //If the receibed message is equals \"You win\" then:\n //Overlay style is replaced to the win style\n //The massage is changed\n if (message == \"You win\") {\n overlay.classList.replace(\"start\", \"win\");\n message = `You win the phrase was <br>\"${this.activePhrase.phrase}\"`\n //If the message receibed is not equals \"You win\" then:\n //Change overlay style to lose \n } else {\n overlay.classList.replace(\"start\", \"lose\");\n }\n //Change overlay style to block (visible)\n //Change the game-over-message to the message\n //change the btn__reset text\n overlay.style.display = 'block';\n document.getElementById('game-over-message').innerHTML = message;\n document.getElementById('btn__reset').textContent = 'Reset Game';\n }", "title": "" }, { "docid": "d35d587c04f5f41907312feb0da7b611", "score": "0.5198898", "text": "render_() {\n const messageEl = create(\"div\", {\n classname: cssClass.TOOLTIP_MESSAGE,\n copy: this.message_,\n });\n\n for (const key in this.styles_) {\n if (Object.prototype.hasOwnProperty.call(this.styles_, key)) {\n this.style[key] = this.styles_[key];\n }\n }\n\n this.appendChild(messageEl);\n }", "title": "" }, { "docid": "73ab373149432508d6a1f1bcd3dcc464", "score": "0.5195286", "text": "function showMessageWithTitlePopup(contentId, title, w, h) {\r\n var dlgid = 'msgwithtitle-container-' + contentId;\r\n var msgid = 'msgwithtitle-' + contentId;\r\n if ($(dlgid).length == 0) {\r\n var jq = $(msgwithtitletemplate2)\r\n .appendTo(document.body);\r\n jq.attr('id', dlgid);\r\n jq.find('div').attr('id', msgid);\r\n }\r\n if (w) {\r\n $('#' + dlgid + ', #' + msgid).css('width', w + 'px');\r\n }\r\n if (h) {\r\n $('#' + dlgid + ', #' + msgid).css('height', h + 'px');\r\n }\r\n if ($('#' + msgid + ' #' + contentId).length == 0) {\r\n $('#' + msgid).html('');\r\n if (contentId) {\r\n $('#' + contentId).appendTo($('#' + msgid));\r\n }\r\n else {\r\n }\r\n }\r\n showPopup(dlgid, null, null, title, msgid);\r\n}", "title": "" }, { "docid": "e8df924abbd2da61c1b0df9b2173ac65", "score": "0.5188326", "text": "createOverlay(config) {\n const overlayConfig = new OverlayConfig({\n hasBackdrop: config.hasBackdrop,\n backdropClass: this.getBackdropClass(config),\n maxWidth: '100%',\n panelClass: config.overlayPanelClass,\n scrollStrategy: this.overlay.scrollStrategies.block(),\n positionStrategy: this.overlay.position().global()\n });\n return this.overlay.create(overlayConfig);\n }", "title": "" }, { "docid": "039322bf62c9102b1ebf40ba81e9c3d7", "score": "0.51738405", "text": "async generateAlert(title,options,message = null) {\n\n const alert = new Alert()\n alert.title = title\n if (message) alert.message = message\n\n for (const option of options) {\n alert.addAction(option)\n }\n\n const response = await alert.presentAlert()\n return response\n }", "title": "" }, { "docid": "5537790a3090c4389b63be8ad1878393", "score": "0.51583254", "text": "function loadOverlay(day,month,year){\n var backOverlay = document.createElement('div');\n backOverlay.setAttribute('id','blackOverlay');\n backOverlay.setAttribute('style','width:100%;' +\n 'height:100%;position:fixed;background-color:rgba(0,0,0,0.5);'+\n 'z-index:2;top:0;left:0;');\n backOverlay.setAttribute('onclick','removeOverlay1()');\n var eventInfo = document.createElement('div');\n eventInfo.setAttribute('id','overlayEventInfo');\n eventInfo.setAttribute('onclick','dontRemoveOverlay(event)')\n var closeButt = document.createElement('div');\n closeButt.setAttribute('class','closeButton');\n closeButt.setAttribute('onclick','removeOverlay2(event)');\n eventInfo.appendChild(closeButt);\n var dateDiv = document.createElement('div');\n dateDiv.setAttribute('class','evInfDa');\n dateDiv.innerText = day +'.'+month+'.'+year;\n eventInfo.appendChild(dateDiv);\n var mainEventList = eventLoad(year,month);\n var eventDateList= mainEventList[1];\n var i=0;\n while (i<eventDateList.length){\n var j = eventDateList.indexOf(day,i);\n if ( (j==-1)){\n break;\n } else {\n var titleDiv = document.createElement('div');\n titleDiv.setAttribute('class','evInfTit');\n var infDiv = document.createElement('div');\n infDiv.setAttribute('class','evInfInf');\n titleDiv.innerHTML = mainEventList[0][j][1];\n infDiv.innerHTML = mainEventList[0][j][2];\n var eventInfoWrapper = document.createElement('div');\n eventInfoWrapper.appendChild(titleDiv);\n eventInfoWrapper.appendChild(infDiv);\n eventInfo.appendChild(eventInfoWrapper);\n i=j+1;\n }\n }\n backOverlay.appendChild(eventInfo);\n var bodyTag = document.getElementsByTagName('body')[0];\n bodyTag.insertBefore(backOverlay,bodyTag.childNodes[0]);\n\n}", "title": "" }, { "docid": "26242662c94565fde15c1038948fd313", "score": "0.5155392", "text": "function create_popup(container) {\n var popup_title = document.createElement('div');\n popup_title.id = 'popup_title';\n popup_title.className = 'popuptext';\n container.appendChild(popup_title);\n\n var popup_overall = document.createElement('div');\n popup_overall.id = 'popup_overall';\n popup_overall.className = 'popuptext';\n container.appendChild(popup_overall);\n\n var overall_graphic = document.createElement('div');\n overall_graphic.id = 'overall_graphic';\n overall_graphic.className = 'popuptext';\n container.appendChild(overall_graphic);\n\n var popup_difficulty = document.createElement('div');\n popup_difficulty.id = 'popup_difficulty';\n popup_difficulty.className = 'popuptext';\n container.appendChild(popup_difficulty);\n\n var difficulty_graphic = document.createElement('div');\n difficulty_graphic.id = 'difficulty_graphic';\n difficulty_graphic.className = 'popuptext';\n container.appendChild(difficulty_graphic);\n\n var popup_again = document.createElement('div');\n popup_again.id = 'popup_again';\n popup_again.className = 'popuptext';\n container.appendChild(popup_again);\n\n var again_graphic = document.createElement('div');\n again_graphic.id = 'again_graphic';\n again_graphic.className = 'popuptext';\n container.appendChild(again_graphic);\n\n var popup_tags = document.createElement('div');\n popup_tags.id = 'popup_tags';\n popup_tags.className = 'popuptext';\n container.appendChild(popup_tags);\n\n var popup_num = document.createElement('div');\n popup_num.id = 'popup_num';\n popup_num.className = 'popuptext';\n container.appendChild(popup_num);\n\n var popup_link = document.createElement('div');\n popup_link.id = 'popup_link';\n popup_link.className = 'popuptext';\n container.appendChild(popup_link);\n\n // Loading bar occupies same place as popup while loading\n var loading_bar = document.createElement('div');\n loading_bar.id = 'loading_bar';\n loading_bar.innerText = 'Loading: 50%';\n loading_bar.style.width = '50%';\n popup_tags.appendChild(loading_bar);\n}", "title": "" }, { "docid": "e3f22b98295c8b5efad1c7d1327dc653", "score": "0.51484424", "text": "function printOverlay(targetID){\n\tvar targetDIV = \"overlay-holder\";\t\t\t\t\n\tvar targetELE = document.getElementsByClassName(targetDIV);\n\tvar content = \" \";\n\tvar navNum = [\t\n\t\t\t\t\t[0],\n\t\t\t\t\t[0],\n\t\t\t\t\t[0,3,3,0,0,2,0,2,0,0,2],\n\t\t\t\t\t[0,2,3,2,0,4]\n\t\t\t\t];\n\n\tvar tempA = targetID.split('.');\n\tvar targetClass = tempA[1];\n\n\tvar type = targetID[8];// Get the type letter\n\tvar temp = targetID.split('overlay'+type);\n\tvar overlayID = parseInt(temp[1]);// Get overlay ID (int)\n\tvar imgFolder;\n\tvar typeIndex = getTypeIndex(type);\n\n\tvar imgCaptions = [[\"\"],[\"\"],[\"\"],[\"\"]];\n\timgCaptions[2][1] = \"Lolita Dress\";\n\timgCaptions[2][2] = \"Illustration for Pokemon fan zine(2016)\" ;\n\timgCaptions[2][3] = \"Pokemon Poster card print\" ;\n\timgCaptions[2][4] = \"Illustration for Pokemon fan zine(2014)\" ;\n\timgCaptions[2][5] = \"Front cover illustration for Pokemon fan zine(2014)\";\n\timgCaptions[2][6] = \"Illustration for Fire Emblem fan zine(2018)\";\n\timgCaptions[2][7] = \"Front cover and back cover illustration for original art zine\";\n\timgCaptions[2][8] = \"Sticker design\";\n\timgCaptions[2][9] = \"Pokemon Poster Illustration For Pokemon Event(2015)\";\n\timgCaptions[2][10] = \"Illustration for Touken Ranbu fan zine(2015)\";\n\n\timgCaptions[3][1] = \"Donuts rendered using Blennder\"\n\timgCaptions[3][2] = \"3D Character modeled using Blender and rigged using PMXE\"\n\timgCaptions[3][3] = \"3D Character modeled using Blender and PMXE\"\n\timgCaptions[3][4] = \"3D Character modeled using Blender\"\n\timgCaptions[3][5] = \"Voxel Room rendered using MagicaVoxel\"\n\n\n\tcontent += \"<section class='overlay \"+targetClass+\"' aria-hidden='true'>\";\n\tcontent += \"<div class='bigCloseArea close-overlay' id='\"+targetClass+\"' ></div>\";\n\n\n\tif(type == \"A\" || type == \"B\"){\n\t\t//-----------------------------------------\n\t\t// Print text type overlay fo type A, B\n\t\t//-----------------------------------------\n\t\tcontent += \"<div id='txt-page'>\";\n\t\tcontent += \"<div class='closeBT close-overlay' id='\"+targetClass+\"' ></div>\";\n\t\tcontent += \"<div class='preview'></div>\"\n\t\tcontent += \"<div class='title'>\"+titlesB[overlayID]+\"</div>\";\n\t\tcontent += \"<div class='des'>\"+desB1[overlayID]+\"</div>\";\n\t\tcontent += \"<a target='_blank' href='\"+imgFolderName[typeIndex]+\"/\"+webPName[overlayID]+\"/\"+webPName[overlayID]+\".html'>\";\n\t\tcontent += \"<div class='viewBT'>View Demo</div></a>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='jump-overlay toPrev'></div>\";\n\t\tcontent += \"<div class='jump-overlay toNext'></div>\";\n\t\tcontent += \"</section>\";\n\t\ttargetELE[0].innerHTML = content;\n\n\t\t$(\".preview\").css(\"background\", \"url(\"+imgFolderName[typeIndex]+\"/\"+webPName[overlayID]+\"/\"+webPName[overlayID]+\".png) center top\");\n\t\t$(\".preview\").css(\"background-size\", \"cover\");\n\n\t}\n\telse if (type == \"C\" || type == \"D\"){\n\t\t//-----------------------------------------\n\t\t// Print image type overlay fo type C, D\n\t\t//-----------------------------------------\n\t\tcontent += \"<div id='img-page'>\";\n\t\tcontent += \"<div class='closeBT close-overlay' id='\"+targetClass+\"' ></div>\";\n\n\t\tif(navNum[typeIndex][overlayID] != 0){\n\t\t\tcontent += \"<div class='img-holder multi-img'>\";\n\t\t\tcontent += \"<img id='img-display' src='images/\"+imgFolderName[typeIndex]+\"/\"+overlayID+\"-1.png'>\";\n\t\t\tcontent += \"</div>\";\n\t\t\tcontent += \"<ul class='img-nav'>\";\n\t\t\tfor(var j=1; j<=navNum[typeIndex][overlayID]; j++)\n\t\t\t\tcontent += \"<li><img src='images/\"+imgFolderName[typeIndex]+\"/\"+overlayID+\"-\"+j+\".png'></li>\"\n\t\t\tcontent += \"</ul>\";\n\t\t}else{\n\t\t\tcontent += \"<div class='img-holder single-img'>\";\n\t\t\tcontent += \"<img id='img-display' src='images/\"+imgFolderName[typeIndex]+\"/\"+overlayID+\"-1.png'>\";\n\t\t\tcontent += \"</div>\";\n\t\t}\n\n\t\tcontent += \"<div class='img-cap'><div id='capbox'>\";\n\t\tcontent += imgCaptions[typeIndex][overlayID];\n\t\tcontent += \"</div></div>\";\n\t\tcontent += \"</div>\";\n\n\t\tcontent += \"<div class='jump-overlay toPrev'></div>\";\n\t\tcontent += \"<div class='jump-overlay toNext'></div>\";\n\t\tcontent += \"</section>\";\n\t\ttargetELE[0].innerHTML = content;\n\t}\n\n\n\n}", "title": "" }, { "docid": "f21a1a6654b7de9c254a9f4ebde0a381", "score": "0.5144432", "text": "function TriggerPopOver(content, title) {\n\n $('.BCSPopOver').popover({\n container: 'body',\n placement: 'right',\n html: 'true',\n title: '<span class=\"text-info\"><strong>' + title + '</strong></span> <button type=\"button\" id=\"close\" class=\"close\" onclick=\"ClosePopOver(&apos;BCSPopOver&apos;)\">&times;</button></span>',\n content: content,\n trigger: 'click'\n });\n}", "title": "" }, { "docid": "3dba4451a41fa835401eb9bb8415c397", "score": "0.51434195", "text": "function displayPopup(message) {\n popupContent.innerHTML = message;\n\n overlay.setAttribute('data-shown', true);\n popup.setAttribute('data-shown', true);\n popupContent.setAttribute('data-shown', true);\n}", "title": "" }, { "docid": "86c3a37d5c144d741762bcc5dbbfeda1", "score": "0.51415056", "text": "gameOver() {\n //calls the Game Over display\n if (this.missed === 5) {\n //Message\n document.querySelector(\"#overlay p\").innerHTML = \"You LOST!\";\n document.querySelector(\"#btn__reset\").textContent = \"Try again?\";\n\n document.querySelector(\"h2[class = 'title']\").textContent = \"Game Over\";\n document.querySelector(\"#overlay\").style.display = \"flex\";\n document.querySelector(\"#overlay\").className = \"lose\";\n }\n }", "title": "" } ]
1244d6e0c2d014d2bb00023cc891afe2
Funcion para validar el formulario
[ { "docid": "a6c16eac6b3a2ca1c74382590a815de8", "score": "0.0", "text": "function validacion(iden){\n var i;\n var ok=0;\nvar opt=document.getElementsByName(iden[0].name);\n//var opt=document.getElementsByName(iden);\n for(i=0; i<opt.length;i++){\n\tif(opt[i].checked)\n {\n ok=1\n // alert(opt[i].attributes[2].value);\n //alert(opt[i].getAttribute(\"correcta\"));\n } \n }\n\n if(ok==1)\n return true\n\telse{\n\t\t//alert(\"Debes seleccionar una opcion\");\n\treturn false\t}\n}", "title": "" } ]
[ { "docid": "aad1f7722ef9ef28c113dd072f55dbf9", "score": "0.7853057", "text": "function validarForm(){\n\t\tvar valid_input_nombre = validarInput(\"nombre\");\n\t\t//var valid_input_direccion = validarInput(\"direccion\");\n\t\t//var valid_select_categoria = validarSelect(\"categoria\");\n\t\tvar valid_dato_geometrico = obtenerDatosGeometricos();\n\t\tif( valid_input_nombre && valid_dato_geometrico ){\n\t\t\t$('form').submit();\n\t\t}\n\n\t}", "title": "" }, { "docid": "43a6ebede6d617089b78e0a4825cd8b2", "score": "0.7841955", "text": "function validar(formObj) {\r\n\r\nif ( (formObj.nombre.value) == \"\") { \r\nalert (\"Debe indicar su nombre\");\r\nreturn false;\r\n}\r\n\r\nif ( (formObj.correo.value) == \"\") { \r\nalert (\"No indico su correo electronico\");\r\nreturn false;\r\n}\r\n\r\nif ( (formObj.pais.value) == -1) { \r\nalert (\"Debe seleccionar su pais\");\r\nreturn false;\r\n}\r\n\r\nif ( (formObj.ciudad.value) == -1) { \r\nalert (\"Seleccione su ciudad por favor\");\r\nreturn false;\r\n}\r\n\r\n/** Revision de terminacion de Correo Electronico */\r\n\r\nif ( formObj.correo.value.match(/\\.com|\\.net|\\.gov|\\.org|\\.mx|\\.es|\\.cl|\\.co|\\.pe/) == null) { \r\nalert (\"No esta correcto su correo electronico, por favor reviselo\");\r\nreturn false;\r\n}\r\n\r\n}", "title": "" }, { "docid": "a32e2adbe415fc2c2309aec83611c6eb", "score": "0.76401436", "text": "function validarFormulario(){\n var txtNombre = document.getElementById('detcompNombre').value;\n var txtCantidad = document.getElementById('detcompCant').value;\n var txtValor = document.getElementById('detcompValor').value;\n var txtTotal = document.getElementById('detcompTotal').value;\n //Test campo obligatorio\n if(txtNombre == null || txtNombre.length == 0 || /^\\s+$/.test(txtNombre)){\n alert('ERROR: El campo nombre no debe ir vacío o con espacios en blanco');\n document.getElementById('detcompNombre').focus();\n return false;\n }\n if(txtCantidad == null || txtCantidad.length == 0 || /^\\s+$/.test(txtCantidad)){\n alert('ERROR: El campo cantidad no debe ir vacío o con espacios en blanco');\n document.getElementById('detcompCant').focus();\n return false;\n }\n if(txtValor == null || txtValor.length == 0 || /^\\s+$/.test(txtValor)){\n alert('ERROR: El campo valor no debe ir vacío o con espacios en blanco');\n document.getElementById('detcompValor').focus();\n return false;\n }\n if(txtTotal == null || txtTotal.length == 0 || /^\\s+$/.test(txtTotal)){\n alert('ERROR: El campo total no debe ir vacío o con espacios en blanco');\n document.getElementById('detcompTotal').focus();\n return false;\n } \n return true;\n }", "title": "" }, { "docid": "150ce32a84a971e5afa799f5c6fe12ec", "score": "0.76128244", "text": "function validarFormulario() { \r\n if (vacio('Nombre')) {\r\n document.getElementById(\"avisos\").innerHTML = \"<p> Error: Debe introducir su nombre de usuario</p>\";\r\n return false;\r\n }\r\n else if (!comprobar_maxcaracteres('Nombre', 20)) {\r\n document.getElementById(\"avisos\").innerHTML = \"<p>Error: Debe introducir un nombre de 20 caracteres como máximo</p>\";\r\n return false;\r\n }\r\n else if (vacio('Email')) {\r\n document.getElementById(\"avisos\").innerHTML = \"<p>Error: Debe introducir su email</p>\";\r\n return false;\r\n }\r\n else if (!comprobar_email('Email')) {\r\n document.getElementById(\"avisos\").innerHTML = \"<p>Error: Introduzca una dirección de correo electrónico válida</p>\";\r\n return false;\r\n }\r\n else if (vacio('Consulta')) {\r\n document.getElementById(\"avisos\").innerHTML = \"<p>Error: Introduzca su consulta por favor</p>\";\r\n return false;\r\n }\r\n document.getElementById(\"avisos\").innerHTML = \"\";\r\n return true;\r\n}", "title": "" }, { "docid": "fd1e27f34dac5c0d7aa51e601e5c7aa1", "score": "0.7566225", "text": "function validar_formulario() {\r\n var ok = true;\r\n var id = $(\"#id_usuario\").val();\r\n var nombre = $(\"#nombre_usuario\").val();\r\n var usuario = $(\"#usuario_usuario\").val();\r\n var clave = $(\"#clave_usuario\").val();\r\n if (id === \"\") {\r\n mostrar_mensaje('Mensaje del Sistema', 'ERROR: Campo ID vacio', 'Aceptar', '');\r\n $(\"#id_usuario\").focus();\r\n ok = false;\r\n } else if (nombre === \"\") {\r\n mostrar_mensaje('Mensaje del Sistema', 'ERROR: Campo NOMBRE vacio', 'Aceptar', '');\r\n $(\"#nombre_usuario\").focus();\r\n ok = false;\r\n } else if (usuario === \"\") {\r\n mostrar_mensaje('Mensaje del Sistema', 'ERROR: Campo USUARIO vacio', 'Aceptar', '');\r\n $(\"#usuario_usuario\").focus();\r\n ok = false;\r\n } else if (clave === \"\") {\r\n mostrar_mensaje('Mensaje del Sistema', 'ERROR: Campo CONTRASEÑA vacio', 'Aceptar', '');\r\n $(\"#clave_usuario\").focus();\r\n ok = false;\r\n }\r\n return ok;\r\n}", "title": "" }, { "docid": "8030ebba9dbc3a2776f4f70805455d86", "score": "0.75266516", "text": "function validateForm() {\n nameValid = validate(\"name\");\n commentValid = validate(\"comment\");\n return (nameValid && commentValid);\n} // end of function to validate Form", "title": "" }, { "docid": "d63b456fcf26f0ea07224e66ff05d547", "score": "0.750166", "text": "function validarForm(e){\r\n error.innerHTML = '';\r\n error.style.display = 'block';\r\n validarNombre(e);\r\n validarApellido(e);\r\n validarCorreo(e);\r\n validarContra1(e);\r\n validarContra2(e);\r\n validarContrasIguales(e);\r\n}", "title": "" }, { "docid": "e0e53a52fb4d76198bac959a5f47cbc4", "score": "0.74863076", "text": "function validaForm(formulario) { \r\n if( tieneVacio(formulario.usuario.value) == false ) { \r\n Ext.example.msg('Datos incompletos', 'Por favor, ingrese el nombre de usuario.');\r\n formulario.usuario.focus() \r\n return false \r\n } else \r\n \tif (tieneVacio(formulario.clave.value) == false ) { \r\n Ext.example.msg('Datos incompletos', 'Por favor, ingrese la contrase\\u00f1a.');\r\n formulario.clave.focus() \r\n return false \r\n }else{\r\n \tformulario.clave.value = hex_md5(formulario.clave.value);\r\n return true; \r\n } \r\n \r\n}", "title": "" }, { "docid": "0c928977dee4b6e641cbb2aada0013a4", "score": "0.7454861", "text": "function validarFormulario()\n{\n nombreRemitente = formApp.children[1].value;\n apellidoRemitente = formApp.children[2].value;\n telefonoRemitente = formApp.children[3].value;\n emailRemitente = formApp.children[4].value;\n\n nombreReceptor = formApp.children[6].value;\n apellidoReceptor = formApp.children[7].value;\n telefonoReceptor = formApp.children[8].value;\n emailReceptor = formApp.children[9].value;\n\n nombreProducto = formApp.children[11].value;\n cantidadPallet = formApp.children[12].value;\n valorProducto = formApp.children[13].value;\n pesoProducto = formApp.children[14].value;\n \n if ((nombreRemitente == \"\") || (apellidoRemitente == \"\") || (telefonoRemitente == \"\") || (emailRemitente == \"\"))\n {\n alert(\"Por favor complete todos los campos del 'Remitente'.\")\n return\n }\n else if ((nombreReceptor == \"\") || (apellidoReceptor == \"\") || (telefonoReceptor == \"\") || (emailReceptor == \"\"))\n {\n alert(\"Por favor complete todos los campos del 'Receptor'.\")\n return\n }\n else if((nombreProducto == \"\") || (cantidadPallet == \"\") || (valorProducto == \"\") || (pesoProducto == \"\"))\n {\n alert(\"Por favor complete todos los campos de 'Producto a Enviar'.\")\n return\n }\n else if ((cantidadPallet > 20) || (pesoProducto > 28))\n {\n alert(\"Maximo 20 pallet o 28 tn. Usted requiere más de 1 equipo. Por favor contactarse con Logística.\")\n }\n else if (provincia.value == \"\")\n {\n alert(\"Por favor elija un destino.\")\n }\n}", "title": "" }, { "docid": "c171b3860ba834e5007823c4d5f511dc", "score": "0.74300486", "text": "function validarForm() {\n // Campos de texto\n if ($(\"#titulo\").val() == \"\") {\n $(\"#titulo\").focus().addClass(\"alert alert-danger\");\n return false;\n }\n if ($(\"#subtitulo\").val() == \"\") {\n $(\"#subtitulo\").addClass(\"alert alert-danger\");\n $(\"#subtitulo\").focus();\n return false;\n }\n\n if ($(\"#descripcion\").val() == \"\") {\n $(\"#descripcion\").addClass(\"alert alert-danger\");\n $(\"#descripcion\").focus();\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "dad47ea63f7ba0cb1e8ef3d729460c32", "score": "0.7410713", "text": "function validarRegistro(form) {\n\n var todoLLeno = true; //usado para saber si queda algún campo vacío\n var lleno = true; //usado para saber si un campo en particular está vacío\n\n for (var i = 0; i < form.elements.length; i++) {\t\t//recorre todos los elementos del formulario\n switch (form.elements[i].name) {\n \n case \"dni\":\n var dni = comprobarDni(form.elements[i]);\n break;\n case \"telefono\":\n var telefono = comprobarTelefono(form.elements[i]);\n break;\n case \"email\":\n var email = comprobarEmail(form.elements[i]);\n break;\n case \"codigoPostal\":\n var codigoPostal = comprobarCP(form.elements[i]);\n break;\n case \"clave\":\n var contrasena = comprobarLLeno(form.elements[i]);\n var valorContrasena= form.elements[i].value;\n break;\n case \"repetirClave\":\n var repetirContrasena = comprobarRepetirContrasena(form.elements[i], valorContrasena);\n break;\n \n default:\n lleno = comprobarLLeno(form.elements[i]);\n if (todoLLeno && lleno == false) {\t\t//con este if se comprueba si todos los campos afectados por el método comprobarLLeno están llenos.\n todoLLeno = false;\n }\n break;\n\n\n }\n\n }\n if (todoLLeno && telefono && email && codigoPostal && dni && contrasena && repetirContrasena) {\t\t//Retornará True al formulario si todas las validaciones son satisfactorias\n return true;\n } else {\n alert(aviso);\n aviso = \"\";\n return false;\n\n }\n}", "title": "" }, { "docid": "49c4f1180f9a8097dd4d734b656696d5", "score": "0.73526114", "text": "function validarCampos() { //Función para validar campos\n\n if (this.value == '') { //Si el valor del formulario esta vació situandose en el evento de nombre, en este caso en formulario para a mandar una alerta.\n errorDiv.style.display = 'block';\n errorDiv.innerHTML = \"Este campo es obligatorio\";\n this.style.border = '1px solid red';\n errorDiv.style.border = '1px solid red';\n } else {\n errorDiv.style.display = 'none';\n this.style.border = '1px solid #cccccc';\n }\n }", "title": "" }, { "docid": "1a913547756501fabc9b97ebface3119", "score": "0.7310227", "text": "function validarFormulario(e) {\n error.innerHTML = \"\"; //Resetea los errores para evitar que se dupliquen.\n validarCorreo(e);\n validarPassword(e);\n }", "title": "" }, { "docid": "1a913547756501fabc9b97ebface3119", "score": "0.7310227", "text": "function validarFormulario(e) {\n error.innerHTML = \"\"; //Resetea los errores para evitar que se dupliquen.\n validarCorreo(e);\n validarPassword(e);\n }", "title": "" }, { "docid": "389ae5517d756c9a34d8cec8964531a6", "score": "0.72841895", "text": "function validarForm(e){\n switch (e.target.name) {\n case \"nombre\":\n case \"apellido\":\n if((/^[a-zA-ZÀ-ÿ\\s]{1,40}$/).test(e.target.value)){\n e.target.classList.remove(\"error\");\n validaNombre = true; \n validaApellido = true;\n mostrarBoton()\n }else{\n e.target.classList.add(\"error\");\n validaNombre = false;\n validaApellido = false;\n mostrarBoton()\n }\n break;\n case \"email\":\n if((/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/).test(e.target.value)){\n e.target.classList.remove(\"error\");\n validaEmail = true;\n mostrarBoton()\n }else{\n e.target.classList.add(\"error\");\n validaEmail = false;\n mostrarBoton()\n }\n break;\n case \"telefono\":\n if((/^\\d{7,14}$/).test(e.target.value)){\n e.target.classList.remove(\"error\");\n validaTelefono = true;\n mostrarBoton()\n }else{\n e.target.classList.add(\"error\");\n validaTelefono = false;\n mostrarBoton()\n }\n break;\n case \"fecha\":\n let fechas = document.getElementById(\"fechaForm\");\n if(e.target.value !== \"\"){\n fechas.classList.remove(\"error\");\n validaFecha = true;\n mostrarBoton()\n }else{\n fechas.classList.add(\"error\"); \n validaFecha = false;\n mostrarBoton()\n }\n break;\n case \"horarios\":\n let horas = document.getElementById(\"horariosForm\");\n if(e.target.value !== \"0\"){\n horas.classList.remove(\"error\");\n validaHora = true;\n mostrarBoton()\n }else{ \n validaHora = false;\n mostrarBoton()\n }\n break; \n }\n}", "title": "" }, { "docid": "cd0041d3969bf31c5ef963e5a36b6784", "score": "0.7275696", "text": "function validarFormulario(){\n var txtRut = document.getElementById('rut').value;\n //var txtPassword = document.getElementById('password').value;\n // campo obligatorio\n if(txtRut == null || txtRut.length == 0 || /^\\s+$/.test(txtRut)){\n alert('ERROR: El campo rut no debe ir vacío o con espacios en blanco');\n document.getElementById('rut').focus();\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "8f1f375a69ab9705e208247142c9b316", "score": "0.7211425", "text": "function validar(){\n\tvar inputnombrepro = document.getElementsByTagName(\"input\")[0];\n\tvar selectScrum = document.getElementsByTagName(\"select\")[0];\n\tvar selectProduct = document.getElementsByTagName(\"select\")[1];\n\tvar selectGrupo = document.getElementsByTagName(\"select\")[2];\n\tif (inputnombrepro.value == \"\" && selectScrum.value == \"Elige una opcion\" && selectProduct.value == \"Elige una opcion\" && selectGrupo.value == \"Elige una opcion\"){\n\t\taddMessageError(\"Nombre del proyecto vacio \\n Ningun Scrum Master seleccionado \\n Ningun Produc Owner seleccionado \\n Ningun Grupo de Developers seleccionado\",true);\n\t}else if (inputnombrepro.value == \"\") {\n\t\taddMessageError(\"Nombre del proyecto vacio\",true);\n\t}else if (selectScrum.value == \"Elige una opcion\") {\n\t\taddMessageError(\"Ningun Scrum Master seleccionado\",true);\n\t}else if (selectProduct.value == \"Elige una opcion\") {\n\t\taddMessageError(\"Ningun Produc Owner seleccionado\",true);\n\t}else if (selectGrupo.value == \"Elige una opcion\") {\n\t\taddMessageError(\"Ningun Grupo de Developers seleccionado\",true);\n\t}else{\n\t\tdocument.getElementById('formulario').submit();\n\t}\n}", "title": "" }, { "docid": "e43ff51afcd7a38cca51a56e630097bb", "score": "0.7187661", "text": "function formValidation(){\r\n\tvar flag = false;\r\n\tif(validateOnlyLetter('first_name', 'lbl', 'nome_txt_error', 20)){\r\n\t\tif(validateOnlyLetter('sur_name', 'lbl1', 'cognome_txt_error', 20)){\r\n\t\t\tif(validateEmail('email', 'lbl2', 'mail_err')){\r\n\t\t\t\tif(validatePassword('pwd', 'lbl3', 'pwd_err')){\t\t\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif(flag){\r\n\t\treturn true;\r\n\t}else{\r\n\t\talert(\"Ci stanno uno o piu' campi che presentano degli errori!! Non si puo' proseguire\");\r\n\t\tevent.preventDefault();\t//utilizzo per bloccare invio submit anche se ritorna false\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "7e980e5659af417e6aa0413d07483751", "score": "0.71822286", "text": "function validarFormCl(){\n if ($(\"#codigo\").val()!=\"\"&&$(\"#clNombre\").val()!=\"\"&&$(\"#clTel\").val()!=\"\"&&$(\"#clMail\").val()) {\n return true\n }\n else{\n alert(\"faltan campos por completar\")\n return false\n }\n}", "title": "" }, { "docid": "a50cb7d09f59d8d909d29c870c1a2a03", "score": "0.7152612", "text": "function validateFields(){\r\n if (document.getElementById('codigo').value==\"\"){\r\n alert('Ingrese el Codigo');\r\n return false;\r\n }\r\n if (document.getElementById('descripcion').value==\"\"){\r\n alert('Ingrese el nombre');\r\n return false;\r\n }\r\n if (document.getElementById('precio').value==\"\"){\r\n alert('Ingrese el precio del producto');\r\n return false;\r\n }\r\n /* if (document.getElementById('imagen').value==\"\"){\r\n alert('Ingrese una imagen');\r\n return false;\r\n }*/\r\n return true;\r\n}", "title": "" }, { "docid": "c7a6f1b323867fa99d5f46833829d372", "score": "0.7146472", "text": "function Validar(){\r\n //reiniciamos el error para que se carge sin ningun mensaje\r\n error.innerHTML='';\r\n if(txtNom.value==\"\" || txtNom.value==null){\r\n LlamarClase(\"Por favor ingrese su nombre y apellido\");\r\n LlamarClase(\"Por favor ingrese su número de contacto\");\r\n LlamarClase(\"Por favor ingrese su dirección\");\r\n LlamarClase(\"Por favor ingrese su pedido\");\r\n LlamarClase(\"Por favor seleccione su metodo de pago\");\r\n }else if(txtCon.value==\"\" || txtCon.value==null){\r\n LlamarClase(\"Por favor ingrese su número de contacto\");\r\n LlamarClase(\"Por favor ingrese su dirección\");\r\n LlamarClase(\"Por favor ingrese su pedido\");\r\n LlamarClase(\"Por favor seleccione su metodo de pago\");\r\n txtApe.focus();\r\n }else if(txtDir.value==\"\" || txtDir.value==null){\r\n LlamarClase(\"Por favor ingrese su dirección\");\r\n LlamarClase(\"Por favor ingrese su pedido\");\r\n LlamarClase(\"Por favor seleccione su metodo de pago\");\r\n txtApe.focus();\r\n }else if(txtPed.value==\"\" || txtPed.value==null){\r\n LlamarClase(\"Por favor ingrese su pedido\");\r\n LlamarClase(\"Por favor seleccione su metodo de pago\");\r\n txtCor.focus();\r\n }else if(rbEfec.checked==false && rbTrans.checked==false &&rbTar.checked==false){\r\n LlamarClase(\"Por favor seleccione su metodo de pago\");\r\n rbMas.focus();\r\n }else{\r\n error.style.display='none';\r\n }\r\n //llamando a las validaciones\r\n // ValidarNombre();\r\n // ValidarApellido();\r\n // ValidarCorreo();\r\n // ValidarSexo();\r\n // ValidarEstado();\r\n}", "title": "" }, { "docid": "7754b3a17623464fbe3b832fc044abf9", "score": "0.7141821", "text": "function validateForm(info) {\n\tif (info[0] == \"\") {\n\t\talert(\"El camp DNI esta buit\")\n\t\treturn false\n\t} else if (info[1] == \"\") {\n\t\talert(\"El camp Nom esta buit\")\n\t\treturn false\n\t} else if (info[2] == \"\") {\n\t\talert(\"El camp Llinatges esta buit\")\n\t\treturn false\n\t} else if (info[3] == \"\") {\n\t\talert(\"El camp Data de naixement esta buit\")\n\t\treturn false\n\t} else if (info[4] == \"\") {\n\t\talert(\"El camp Telèfon esta buit\")\n\t\treturn false\n\t} else if (info[5] == \"\") {\n\t\talert(\"El camp Email esta buit\")\n\t\treturn false\n\t} else if (info[6] == \"\") {\n\t\talert(\"El camp Compte corrent esta buit\")\n\t\treturn false\n\t} else if (validateDNI(info[0])) {\n\t\tif (validateDate(info[3])) {\n\t\t\tif (validatePhone(info[4])) {\n\t\t\t\tif (validateEmail(info[5])) {\n\t\t\t\t\treturn true\n\t\t\t\t} else { alert(\"Has de posar un email valid\") }\n\t\t\t} else { alert(\"Has de posar un telèfon valid\") }\n\t\t} else { alert(\"Has de posar una data valida\") }\n\t} else { alert(\"Has de posar un DNI valid\") }\n}", "title": "" }, { "docid": "f0c44c5426afa4a4271a3241b3d14102", "score": "0.7110603", "text": "validarFormulario() {\n let campo = this.state.campo;\n let error = {};\n let formularioValido = true;\n\n // Nombre de EP \n if (!campo[\"nombreEP\"]) {\n formularioValido = false;\n error[\"nombreEP\"] = \"Por favor, ingresa el nombre del paciente.\";\n }\n\n // Apellido de EP \n if (!campo[\"apellidoEP\"]) {\n formularioValido = false;\n error[\"apellidoEP\"] = \"Por favor, ingresa el apellido del paciente.\";\n }\n\n // Sexo de EP \n if (!campo[\"sexoEP\"]) {\n formularioValido = false;\n error[\"sexoEP\"] = \"Por favor, selecciona el sexo del paciente.\";\n }\n\n // Fecha de Nacimiento de EP \n if (!campo[\"nacimientoEP\"]) {\n formularioValido = false;\n error[\"nacimientoEP\"] = \"Por favor, ingresa la fecha de nacimiento del paciente.\";\n }\n\n // Telefono de EP \n if (!campo[\"telefonoEP\"]) {\n formularioValido = false;\n error[\"telefonoEP\"] = \"Por favor, ingresa el telefono del paciente.\";\n }\n\n // Provincia de EP \n if (!campo[\"provinciaEP\"]) {\n formularioValido = false;\n error[\"provinciaEP\"] = \"Por favor, selecciona la provincia del paciente.\";\n }\n\n // Localidad de EP \n if (!campo[\"localidadEP\"]) {\n formularioValido = false;\n error[\"localidadEP\"] = \"Por favor, selecciona la localidad del paciente.\";\n }\n\n // Municipio de EP \n if (!campo[\"municipioEP\"]) {\n formularioValido = false;\n error[\"municipioEP\"] = \"Por favor, selecciona el municipio del paciente.\";\n }\n\n // Calle de EP \n if (!campo[\"calleEP\"]) {\n formularioValido = false;\n error[\"calleEP\"] = \"Por favor, ingresa la calle del paciente.\";\n }\n\n // Numero de EP \n if (!campo[\"numeroEP\"]) {\n formularioValido = false;\n error[\"numeroEP\"] = \"Por favor, ingresa el numero de casa del paciente.\";\n }\n\n // Vivienda de EP \n if (!campo[\"viviendaEP\"]) {\n formularioValido = false;\n error[\"viviendaEP\"] = \"Por favor, selecciona tipo de vivienda del paciente.\";\n }\n\n // Piso de EP \n if (!campo[\"pisoEP\"]) {\n formularioValido = false;\n error[\"pisoEP\"] = \"Por favor, ingresa el piso del paciente.\";\n }\n\n // Maxima escolaridad de EP \n if (!campo[\"escolaridadEP\"]) {\n formularioValido = false;\n error[\"escolaridadEP\"] = \"Por favor, selecciona el nivel de escolaridad alcanzado por el paciente.\";\n }\n\n // Ocupacion previa de EP \n if (!campo[\"ocupacionPEP\"]) {\n formularioValido = false;\n error[\"ocupacionPEP\"] = \"Por favor, selecciona la ocupación previa del paciente.\";\n }\n\n // Ocupacion actual de EP \n if (!campo[\"ocupacionAEP\"]) {\n formularioValido = false;\n error[\"ocupacionAEP\"] = \"Por favor, selecciona la ocupacion actual del paciente.\";\n }\n\n // Nombre de R \n if (!campo[\"nombreR\"]) {\n formularioValido = false;\n error[\"nombreR\"] = \"Por favor, ingresa el nombre del referente.\";\n }\n\n // Apellido de R \n if (!campo[\"apellidoR\"]) {\n formularioValido = false;\n error[\"apellidoR\"] = \"Por favor, ingresa el apellido del referente.\";\n }\n\n // Sexo de R\n if (!campo[\"sexoR\"]) {\n formularioValido = false;\n error[\"sexoR\"] = \"Por favor, selecciona el sexo del referente.\";\n }\n\n // Fecha de Nacimiento de R \n if (!campo[\"nacimientoR\"]) {\n formularioValido = false;\n error[\"nacimientoR\"] = \"Por favor, ingresa la fecha de nacimiento del referente.\";\n }\n\n // Telefono de R\n if (!campo[\"telefonoR\"]) {\n formularioValido = false;\n error[\"telefonoR\"] = \"Por favor, ingresa el telefono del referente.\";\n }\n\n // Parentesco de R con EP\n if (!campo[\"parentescoR\"]) {\n formularioValido = false;\n error[\"parentescoR\"] = \"Por favor, selecciona el parentesco.\";\n }\n\n // Provincia de R \n if (!campo[\"provinciaR\"]) {\n formularioValido = false;\n error[\"provinciaR\"] = \"Por favor, selecciona la provincia del referente.\";\n }\n\n // Localidad de R \n if (!campo[\"localidadR\"]) {\n formularioValido = false;\n error[\"localidadR\"] = \"Por favor, selecciona la localidad del referente.\";\n }\n\n // Municipio de R\n if (!campo[\"municipioR\"]) {\n formularioValido = false;\n error[\"municipioR\"] = \"Por favor, selecciona el municipio del referente.\";\n }\n\n // Calle de R\n if (!campo[\"calleR\"]) {\n formularioValido = false;\n error[\"calleR\"] = \"Por favor, ingresa la calle del referente.\";\n }\n\n // Numero de R\n if (!campo[\"numeroR\"]) {\n formularioValido = false;\n error[\"numeroR\"] = \"Por favor, ingresa el numero de casa del referente.\";\n }\n\n // Vivienda de R\n if (!campo[\"viviendaR\"]) {\n formularioValido = false;\n error[\"viviendaR\"] = \"Por favor, selecciona tipo de vivienda del referente.\";\n }\n\n // Piso de EP \n if (!campo[\"pisoR\"]) {\n formularioValido = false;\n error[\"pisoR\"] = \"Por favor, ingresa el piso del referente.\";\n }\n\n\n\n // Seteo el estado de error \n this.setState({\n error: error\n });\n\n return formularioValido;\n }", "title": "" }, { "docid": "8aba2e27c9372fb90a9f38b9be7c9acc", "score": "0.71105087", "text": "function isDistrikFormValid(){\n return(NamaField.isValid());\n }", "title": "" }, { "docid": "39cf138b3e19eca491c6b5bda1c94e0c", "score": "0.7110432", "text": "function validaFormulario(campoValida, acaoFormulario){\n\tvar cpf\t\t= document.getElementById(campoValida);\n\tvar erro\t= 0;\n\t\n\t\tif(cpf.value==\"\"){\n\t\t\talert('CPF obrigatório.');\n\t\t\terro = 1;\n\t\t}\n\t\t\n\t\tif(Verifica_CPF(cpf.value)==1){\n\t\t\talert(\"CPF inválido\");\n\t\t\tcpf.focus();\n\t\t\terro = 1;\n\t\t}\n\t\tif(erro==0){\n\t\t\teval(acaoFormulario);\n\t\t}\n}", "title": "" }, { "docid": "ff1392d7f6f4eca4a531be3fadf96e6f", "score": "0.71028584", "text": "function validarTipoVehiculo(){\r\n\tvar mensaje=\"\";\r\n\tvar tipoVehiculo = document.getElementById(\"tipoVehiculo\");\r\n\tvar valid = true;\r\n \r\n valid = valid && tipoVehiculo.value!= \"\";\r\n\t\r\n\t\r\n\tif(!valid){\r\n\t\tmensaje = \"El tipo de vehículo no puede estar vacío\";\r\n\t}\r\n tipoVehiculo.setCustomValidity(mensaje);\r\n\treturn mensaje;\r\n}", "title": "" }, { "docid": "f227dabb4d79de044fbffd2998e93d8b", "score": "0.7077848", "text": "function validar_campos_form(){\n //Para escribir solo letras\n if($('#nombre')) $('#nombre').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéáéíóú');\n if($('#apellido')) $('#apellido').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéíóú');\n if($('#profesion')) $('#profesion').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéíóú');\n if($('#localidad')) $('#localidad').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéíóú');\n if($('#apenom')) $('#apenom').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéíóú');\n if($('#modelos__nombre')) $('#modelos__nombre').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéíóú');\n\n if($('#caratula')) $('#caratula').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéiou-,.');\n if($('#descripcion')) $('#descripcion').validCampoFranz(' abcdefghijklmnñopqrstuvwxyzáéíóú-,.');\n \n //Para escribir solo numeros \n if($('#dni')) $('#dni').validCampoFranz('0123456789');\n if($('#celular')) $('#celular').validCampoFranz('0123456789');\n if($('#telefono')) $('#telefono').validCampoFranz('0123456789');\n if($('#legajo')) $('#legajo').validCampoFranz('0123456789');\n if($('#numero')) $('#numero').validCampoFranz('0123456789'); // se refiere a Nro Expediente\n if($('#hora_alarma')) $('#hora_alarma').validCampoFranz('0123456789:'); // se refiere a Nro Expediente\n if($('#monto')) $('#monto').validCampoFranz('0123456789.');\n if($('#monto_desde')) $('#monto_desde').validCampoFranz('0123456789.');\n if($('#monto_hasta')) $('#monto_hasta').validCampoFranz('0123456789.');\n\n //No permitir ningun tipo de caracter\n if($('#fecha_ingreso')) $('#fecha_ingreso').validCampoFranz('');\n if($('#fecha_nacimiento')) $('#fecha_nacimiento').validCampoFranz('');\n if($('#fecha_inicio')) $('#fecha_inicio').validCampoFranz('');\n if($('#fecha_presentacion')) $('#fecha_inicio').validCampoFranz('');\n if($('#fecha_finalizacion')) $('#fecha_finalizacion').validCampoFranz('');\n if($('#fecha_desde')) $('#fecha_desde').validCampoFranz('');\n if($('#fecha_hasta')) $('#fecha_hasta').validCampoFranz('');\n}", "title": "" }, { "docid": "9b7db9e149a49ad5475d50be6fb1950b", "score": "0.70633954", "text": "function validarFormulario1(event){\n\n const $form1 = document.querySelector('#formulario1');\n\n const anioActual = $form1['anio-actual'].value;\n const anioNacimiento = $form1['anio-nacimiento'].value;\n\n\n const errorAnioActual = validarAnioActual(anioActual);\n const errorAnioNacimiento = validarAnioNacimiento(anioNacimiento);\n\n const errores1 = {\n anioActual : errorAnioActual,\n anioNacimiento : errorAnioNacimiento,\n }\n\n manejarErrores1(errores1);\n \n event.preventDefault();\n\n }", "title": "" }, { "docid": "e5395815b8fbdbfc97a5299635ee6bfa", "score": "0.7054316", "text": "function validarContacto() {\r\n if (validarFormulario()) {\r\n guardarConsulta();\r\n }\r\n}", "title": "" }, { "docid": "d2f797b2e4371397804196b273091d0a", "score": "0.7053312", "text": "function validarCampos(){\n\t\tif (this.value === \"\") {\n\t\t\terrorDiv.style.display = \"block\"\n\t\t\terrorDiv.innerHTML = \"Este campo es obligatorio\"\n\t\t\tthis.style.border = \"1px solid red\"\n\t\t\terrorDiv.style.border = \"1px solid red\"\n\t\t}\n\t\telse\n\t\t{\n\t\t\terrorDiv.style.display = \"none\"\n\t\t\tthis.style.border = \"1px solid #ccc\"\n\t\t}\n\t}", "title": "" }, { "docid": "d608d1204990815a7428392a1e45b671", "score": "0.7051487", "text": "function validarForm() {\n var formulario = document.getElementById('frmSave');\n var mensaje = \"Los siguientes campos no deben estar vacíos: \\n\\n\";\n var faltaCampo=false;\n\n if($(\"#nombre\").val()==\"\"){\n faltaCampo=true;\n mensaje += \"- Nombre \\n\";\n }\n\n if($(\"#capitulo\").val()==\"\"){\n faltaCampo=true;\n mensaje += \"- Capitulo \\n\";\n }\n\n if(faltaCampo){\n Swal.fire({\n type: 'info',\n title: mensaje,\n //text: mensaje,\n });\n //alert(mensaje);\n return false;\n }\n else{\n return true;\n }\n}", "title": "" }, { "docid": "4206dcd40228f1cbfbef0a80054ad477", "score": "0.70495814", "text": "function validarTodoFormulario() {\n let esNombreCorrecto = comprobarNombre();\n let esEmailCorrecto = comprobarEmail();\n let esContraseñaCorrecto = comprobarContraseña();\n let esContraseñaConfirmadaCorrecto = comprobarContraseñaConfirmar();\n let esGeneroCorrecto = comprobarGenero();\n let esCheckBoxCorrecto = comprobarCheck();\n let esAgeCorrecto = comprobarAge();\n\n if (esNombreCorrecto && esEmailCorrecto && esContraseñaCorrecto && esContraseñaConfirmadaCorrecto && esGeneroCorrecto && esCheckBoxCorrecto && esAgeCorrecto) {\n let formulario = document.getElementById(\"formulario\");\n formulario.submit();\n } else {\n $('#modal').modal('toggle');\n }\n\n}", "title": "" }, { "docid": "be1a7423974f6722d4bf4cda5f8155b4", "score": "0.702667", "text": "function controlForm () {\r\n // outils de contrôle Regex des inputs //\r\n let regexNumber = /[0-9]/;\r\n let regexEmail = /^(([^<>()\\[\\]\\\\.,;:\\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,}))$/;\r\n let regexSymbols = /[§!@#$%^&*().?\":{}|<>]/;\r\n let regexBlank = /^[\\s]/;\r\n // Message fin de contrôle //\r\n let validForm = \"\";\r\n // Récupération des inputs //\r\n let inputLastName = document.getElementById(\"lastName\").value;\r\n let inputFirstName = document.getElementById(\"firstName\").value;\r\n let inputEmail = document.getElementById(\"email\").value;\r\n let inputAdress = document.getElementById(\"address\").value;\r\n let inputCity = document.getElementById(\"city\").value;\r\n // Tests des différents inputs du formulaire //\r\n // Test du nom //\r\n if (\r\n regexNumber.test(inputLastName) == true ||\r\n regexSymbols.test(inputLastName) == true ||\r\n regexBlank.test(inputLastName) == true ||\r\n inputLastName == \"\"\r\n ) {\r\n validForm = validForm + \"\\n\" + \"La syntaxe de votre nom n’est pas valide. Merci de bien vouloir la vérifier.\";\r\n } else {\r\n console.log(\"Nom validé\");\r\n }\r\n // Test du prénom //\r\n if (\r\n regexNumber.test(inputFirstName) == true ||\r\n regexSymbols.test(inputFirstName) == true ||\r\n regexBlank.test(inputFirstName) == true ||\r\n inputFirstName == \"\"\r\n ) {\r\n validForm = validForm + \"\\n\" + \"La syntaxe de votre prénom n’est pas valide. Merci de bien vouloir la vérifier.\";\r\n } else {\r\n console.log(\"Prénom validé\");\r\n }\r\n // Test de l'email //\r\n if (\r\n regexEmail.test(inputEmail) == false ||\r\n regexBlank.test(inputEmail) == true \r\n ) {\r\n validForm = validForm + \"\\n\" + \"La syntaxe de votre email n’est pas valide. Merci de bien vouloir la vérifier.\";\r\n } else {\r\n console.log(\"Email validé\");\r\n }\r\n // Test de l'adresse //\r\n if (\r\n regexSymbols.test(inputAdress) == true ||\r\n regexBlank.test(inputAdress) == true ||\r\n inputAdress == \"\"\r\n ) {\r\n validForm = validForm + \"\\n\" + \"La syntaxe de votre adresse n’est pas valide. Merci de bien vouloir la vérifier.\";\r\n } else {\r\n console.log(\"Adresse validée\");\r\n }\r\n // Test de la ville //\r\n if (\r\n regexSymbols.test(inputCity) == true ||\r\n regexNumber.test(inputCity) == true ||\r\n regexBlank.test(inputCity) == true ||\r\n inputCity == \"\"\r\n ) {\r\n validForm = validForm + \"\\n\" + \"La syntaxe de votre ville n’est pas valide. Merci de bien vouloir la vérifier.\";\r\n } else {\r\n console.log(\"Ville validée\");\r\n }\r\n // Si un des champs n'est pas conforme => message d'alerte //\r\n if (validForm != \"\") {\r\n alert(\"Attention certaines données ne peuvent être validées :\" + \"\\n\" + validForm);\r\n }\r\n // Si le formulaire est validé => construction de l'objet \"contact\" // \r\n else {\r\n contact = {\r\n lastName: inputLastName,\r\n firstName: inputFirstName,\r\n address: inputAdress,\r\n city: inputCity,\r\n email: inputEmail,\r\n };\r\n console.log(\"contact\", contact);\r\n return contact;\r\n }\r\n}", "title": "" }, { "docid": "303bc1c74d5cf46166d4874c5ebd66e4", "score": "0.7026302", "text": "function validateForm() {\n\t\t\tvar form \t= document.forms.commentForm,\n\t\t\t\tx \t\t= form.author.value,\n\t\t\t\ty \t\t= form.email.value,\n\t\t\t\tz \t\t= form.comment.value,\n\t\t\t\tflag \t= true,\n\t\t\t\td1 \t\t= document.getElementById(\"d1\"),\n\t\t\t\td2 \t\t= document.getElementById(\"d2\"),\n\t\t\t\td3 \t\t= document.getElementById(\"d3\");\n\t\t\t\t\n\t\t\tif (x === null || x === \"\") {\n\t\t\t\td1.innerHTML = single_obj.i18n.name_is_required;\n\t\t\t\tflag = false;\n\t\t\t} else {\n\t\t\t\td1.innerHTML = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif (y === null || y === \"\") {\n\t\t\t\td2.innerHTML = single_obj.i18n.email_is_required;\n\t\t\t\tflag = false;\n\t\t\t} else {\n\t\t\t\td2.innerHTML = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif (z === null || z === \"\") {\n\t\t\t\td3.innerHTML = single_obj.i18n.comment_is_required;\n\t\t\t\tflag = false;\n\t\t\t} else {\n\t\t\t\td3.innerHTML = \"\";\n\t\t\t}\n\t\t\t\n\t\t\treturn flag;\n\t\t\t\n\t\t}", "title": "" }, { "docid": "70a92fb8994f752596c5e5da1619215b", "score": "0.70236266", "text": "function formValidation(formObj){ \n\n // validate all the \"Required\" text fields for blank input\n if(ValidateForm(formObj) == false){\n // if one of the required fields was blank, return to the product form\n return false;\n } \n else{\n // check for max-length\n \n }\n}", "title": "" }, { "docid": "3bb28124da6810878b5ef483c4f4dbbd", "score": "0.7023446", "text": "function validarCampo(){\n // console.log('dentro del input');\n\n //se valida la longitud del texo y que no este vacio\n validarLongitud(this); //this campo actual\n //validar unicamente el email\n if(this.type === 'email'){\n validarEmail(this);\n }\n\n let errores = document.querySelectorAll('.error');\n if (email.value !== '' && asunto.value !== '' && mensaje.value !== '') {\n if(errores.length === 0){\n btnEnviar.disabled = false;\n }\n }\n}", "title": "" }, { "docid": "fe3309659b57d335ac0e4f0f05c20c84", "score": "0.7017932", "text": "function validarFormulario (idForm){\n\t\tvar valido = true;\n\t\t$('#'+idForm + ' input.obrigatorio:visible').each(function(){\n\t\t\tvalido = valido && validarCampo($(this));\n\t\t\tif($(this).attr(\"tipo\") == \"email\"){\n\t\t\t\tvalido = valido && validarCampoEmail($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"tipo\") == \"data\"){\n\t\t\t\tvalido = valido && validarCampoData($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"tipo\") == \"semespecial\"){\n\t\t\t\tvalido = valido && validarCampoCaracEspecial($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"maxlength\") != undefined){\n\t\t\t\tvalido = valido && validarQtdMaxCaracCampo($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"minlength\") != undefined){\n\t\t\t\tvalido = valido && validarQtdMinCaracCampo($(this));\n\t\t\t}\n\t\t});\n\t\t\n\t\tif(valido){\n\t\t\t$('#'+idForm + ' .select2-container:visible').each(function(){\n\t\t\t\tif($('#'+$(this).attr('id').split('_')[1]).hasClass('obrigatorio')){\n\t\t\t\t\tvalido = valido && validarCampoSelect($(this));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif(valido){\n\t\t\t$('#'+idForm + ' textarea.obrigatorio:visible').each(function(){\n\t\t\t\tvalido = validarCampo($(this));\n\t\t\t\tif($(this).attr(\"tipo\") == \"semespecial\"){\n\t\t\t\t\tvalido = valido && validarCampoCaracEspecial($(this));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn valido;\n\t}", "title": "" }, { "docid": "b3f3f5fd1d15ebf4ef71bfa4daeab734", "score": "0.70136833", "text": "function validarFormNuevoIngreso(accion) {\n var correcto = true, msg = '';\n if (accion === 1) {\n NuevoIgresoAltaJSON = {\n IdPaciente: IdPacienteNIngresoGLOBAL,\n Clave: claveTestGLOBAL,\n Archivo: 'SD',\n TestJson: {},\n Diagnostico: \"--\",\n };\n } else if (accion === 2) {\n if (ArchivoDocNuevoIngreso === undefined) {\n correcto = false;\n msg = \"No ha seleccionado un <b>Archivo</b>\";\n } else if ($('#modalNuevoIngresoDiagnostico').val() === \"\") {\n $('#modalNuevoIngresoDiagnostico').focus();\n correcto = false;\n msg = \"Escriba un <b>Resultado de Diagnóstico</b>\";\n } else {\n NuevoIgresoAltaJSON = {\n IdPaciente: IdPacienteNIngresoGLOBAL,\n Clave: claveTestGLOBAL,\n Archivo: claveTestGLOBAL + \"_\" + IdPacienteNIngresoGLOBAL.toString() + \".\" + ArchivoDocNuevoIngresoDATA.Extension,\n TestJson: 'SD',\n Diagnostico: $('#modalNuevoIngresoDiagnostico').val().toUpperCase(),\n };\n }\n }\n if (!correcto) {\n MsgAlerta(\"Atención!\", msg, 1800, \"default\");\n }\n return correcto;\n}", "title": "" }, { "docid": "5bc4eda0164f14e2109f6ab0e00409a2", "score": "0.70089835", "text": "function Validar(){\n ValidarNombre();\n ValidarApellido();\n ValidarCorreo();\n ValidarSexo();\n ValidarEstado();\n}", "title": "" }, { "docid": "ea898a62d11bdf90e945c225f8e5ec9d", "score": "0.7007497", "text": "function validar() {\n var expNombre = /^[A-Za-z]+$/;\n var expAsunto = /^[A-Za-z0-9\\s]+$/;\n var expCorreo = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n var expconsulta = /^[A-Za-z0-9\\s]+$/; \n var nombre = document.getElementById(\"nombre\").value;\n var asunto = document.getElementById(\"asunto\").value;\n var correo = document.getElementById(\"correo\").value;\n var consulta = document.getElementById(\"consulta\").value;\n var errNom = document.getElementById(\"errNom\");\n var errAsun = document.getElementById(\"errAsun\");\n var errEmail = document.getElementById(\"errEmail\");\n var errConsul = document.getElementById(\"errConsul\");\n var error = true;\n if (nombre === null || nombre === '') {\n errNom.innerHTML = ('Agregar nombre');\n error = false;\n }else if( expNombre.test(nombre) ){\n error = true;\n }else{\n errNom.innerHTML = ('El nombre no es correcto');\n error = false;\n }\n if (asunto === null || asunto === '' ) {\n errAsun.innerHTML = ('Agregar asunto');\n error = false;\n }else if( expAsunto.test(asunto) ){\n error = true;\n }else{\n errAsun.innerHTML = ('El asunto no es correcto');\n error = false;\n }\n if (correo === null || correo === '' ) {\n errEmail.innerHTML = ('Agregar correo');\n error = false;\n }else if (expCorreo.test(correo)) {\n error = true;\n }else{\n errEmail.innerHTML = ('El correo no es correcto');\n error = false;\n }\n if (consulta === null || consulta === '' ) {\n errConsul.innerHTML = ('Agregar consulta');\n error = false;\n }else if ( expconsulta.test(consulta) ) {\n error = true;\n }else{\n errConsul.innerHTML = ('La consulta no es correcta');\n error = false;\n }\n return error;\n }", "title": "" }, { "docid": "78c8cd02b3a5b22a5b3a98d0e84ce24d", "score": "0.7001339", "text": "function validarForms() {\n var errores=0; \n errores+=onkeyupnombre();\n errores+=onkeyupapellido();\n errores+=onkeyupemail();\n errores+=onkeyuppassword();\n errores+=onkeyuprpassword();\n errores+=onkeyuptelefono();\n errores+=onkeyupdireccion(); \n if(errores==0){ \n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "e512b8c100e3447beee2c8193b3339e6", "score": "0.69999087", "text": "function validaForm(){\n\tvar spaPar=document.myForm.inputPartenza.value;\n\tvar spaArr=document.myForm.inputArrivo.value;\n\n\t// controlla inserimento dello Spazioporto di partenza\n\tif(spaPar==\"nessuno\"){\n\n\t\t$(document).off('.alert.data-api');\n\t\treturn false;\n\t}\n\n\t// controlla inserimento dello Spazioporto di arrivo\n\tif(spaArr==\"nessuno\"){\n\t\twindow.alert(\"Inserire uno Spazioporto di arrivo\");\n\t\treturn false;\n\t}\n\n\tvar data1=document.myForm.dataPart.value;\n\tvar data2=document.myForm.dataArr.value;\n\n\t// controlla data partenza deve essere < data di ritorno\n\tif(data2<data1 && ritorno!=null){\n\t\twindow.alert(\"Data non valida\");\n\t\treturn false;\n\t}\n\n\t// controllo che il coupon dell'area di testo che ci siamo nascosti sia uguale a quello\n\t// che la persona inserisce nell'input text \"coupon\" e inoltre controllo anche la dimensione\n\tif(!document.myForm.cparea.value.includes(document.myForm.coupon.value) || document.myForm.coupon.value.length!=10){\n\t\twindow.alert(\"Coupon non valido\");\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "a6477ad18acbd0ecf08c7a7d88314169", "score": "0.6997282", "text": "function validate (form) {\n fail = fieldEmpty(form.name.value, \"Name is empty.\\n\") \n fail += fieldEmpty(form.address.value, \"Address is empty.\\n\")\n\tfail += fieldEmpty(form.city.value, \"City is empty.\\n\")\n\tfail += validateState(form.state.value)\n\tfail += fieldEmpty(form.zip.value, \"Zip is empty.\\n\")\n\tfail += validateEmail(form.email.value)\n fail += validateAge(form.age.value)\n\tfail += radioButtonSelected(form.version, \"version not selected.\\n\")\n\tfail += checkboxesSelected(form.genres, \"Atleast two genres to be selected.\\n\")\n fail += radioButtonSelected(form.use, \"your opinion on this app is not selected.\\n\")\n if (fail == \"\") return true\n else { alert(fail); return false }\n}", "title": "" }, { "docid": "ec821a110e50aaa5644ca990a83d1b70", "score": "0.6995987", "text": "function validaForm()\n\t{\n\t\tif ( localStorage.getItem('id_curs_actual')=='' ) return false;\n\n\t\tvar empty_fields=false;\n\t\tvar numeric_error=false;\n\n\t\t//Si estoy logeado se envía directamente la sol. info sin validar ningun dato más \n\t\tif( $(\"#party_id\").val()!=null && $(\"#party_id\").val()!=\"\" ) return true;\n\n\t\t\n\t\t$('.required:visible').each(function() {\n\t\t if($(this).attr(\"value\")==\"\")\n\t\t\t{\n\t\t\t $(this).addClass(\"errorbg\");\n\t\t\t empty_fields=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $(this).removeClass(\"errorbg\");\n\t\t\t}\n\t\t});\t\n\t\tif($('#pais').prop(\"selectedIndex\")==0)\n\t {\n\t\t $('#pais').parent().addClass(\"errorbg\");\n\t\t empty_fields=true;\n\t }\t\t\t \n\t else\n\t {\n\t $('#pais').parent().removeClass(\"errorbg\");\n\t } \n\t\tif(empty_fields)\n\t\t{\n\t\t\tdoAlert( $._( 'error_omplir_camps' ) );\n\t\t\t$('.errorbg')[0].focus();\n\t\t\treturn false;\n\t\t}\n\t\t$('.number:visible').each(function() {\n\t\t\tif(isNaN( $(this).attr(\"value\") ))\n\t\t\t{\n\t\t\t $(this).addClass(\"errorbg\");\n\t\t\t numeric_error=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $(this).removeClass(\"errorbg\");\n\t\t\t}\n\t\t});\t\n\t\tif(numeric_error)\n\t\t{\n\t\t\tdoAlert( $._( 'error_numeric' ) );\n\t\t\t$('.errorbg')[0].focus();\n\t\t\treturn false;\n\t\t}\n\t\tif($(\"#postal:visible\").length>0)\n\t\t{\n\t\t\t if ( !( \n\t\t\t\t\t\t( $(\"#postal\").val().match(/^[0-9]{5}$/)?true:false ) && \n\t\t\t\t\t\tparseInt($(\"#postal\").val(),10)<53000 \n\t\t\t\t\t\t&& parseInt($(\"#postal\").val(),10)>1000 \n\t\t\t\t\t\t&& parseInt($(\"#postal\").val(),10)%1000 \n\t\t\t\t\t) )\n\t\t\t {\n\t\t\t\t $('#postal').addClass(\"errorbg\");\n\t\t\t\t doAlert( $._( 'error_postal_invalido' ) );\n\t\t\t\t $('#postal').focus();\t\n\t\t\t\t return false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#postal').removeClass(\"errorbg\");\n\t\t\t}\t\n\t\t}\n\t\tif($(\"#pais\").val()==\"ES\")\n\t\t{\n\t\t\tif(!(/^[9876][0-9]{8}$/.test($('#phone').attr(\"value\")))\t)\t\t\n\t\t\t{\n\t\t\t\t$('#phone').addClass(\"errorbg\");\t\t\t\t\n\t\t\t\tdoAlert( $._( 'error_telefono_invalido' ) );\n\t\t\t\t$('#phone').focus();\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#phone').removeClass(\"errorbg\");\n\t\t\t}\n\t\t}\n\t\tif($('#email').attr(\"value\")!=\"\" && !(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/.test($('#email').attr(\"value\")) ))\n\t\t{\n\t\t\t$('#email').addClass(\"errorbg\");\n\t\t\tdoAlert( $._( 'error_email_invalido' ) );\n\t\t\t$('#email').focus();\t\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$('#email').removeClass(\"errorbg\");\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "title": "" }, { "docid": "051adad0e79a712b895fb19c39518278", "score": "0.6995806", "text": "function validateForm() {\n let cse = $('#js-cse').val()\n let apiKey = $('#js-api-key').val()\n let destiny = $('#js-destiny').val()\n let search = $('#js-search').val()\n let errors = new Array();\n if (!cse) {\n errors.push('Tienes que insertar un CSE ID')\n }\n if (!apiKey) {\n errors.push('Tienes que insertar un API Key')\n }\n if (!destiny) {\n errors.push('Tienes que elegir una carpeta de destino')\n }\n if (!search) {\n errors.push('Tienes que introducir un término de búsqueda')\n }\n if (errors.length) {\n showError(errors.join(\"<br/>\"))\n return false\n }\n return true\n}", "title": "" }, { "docid": "ea9e35e02f0186f80e1829fa18a3a5d5", "score": "0.69929963", "text": "function validarFormularioRecomendacion(e) {\r\n e.preventDefault();\r\n var nombre = document.getElementById('nombre').value;\r\n if (nombre.length < 4) {\r\n alert(\"No ha escrito un nombre valido\");\r\n return;\r\n }\r\n var text = document.getElementById('textAreaDos').value;\r\n if (text.length < 10) {\r\n alert(\"Ha escrito una recomendacion muy corta o vacia\");\r\n return;\r\n }\r\n this.submit();\r\n}", "title": "" }, { "docid": "ffd05e573d42da0906c2b3820d90d17e", "score": "0.69899863", "text": "function validarForm() {\r\n\r\n\tvar verificar = true;\r\n\tvar expRegEmail = /^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$/;\r\n\r\n\tif (!deTxt.value) {\r\n\t\talert(\"El campo 'De' es requerido.\");\r\n\t\tmailFrm.focus();\r\n\t\tverificar = false;\r\n\t} else if (!expRegEmail.exec(deTxt.value)) {\r\n\t\talert(\"La dirección de correo 'De' no es válida.\");\r\n\t\tdeTxt.focus();\r\n\t\tverificar = false;\r\n\t} else if (!paraTxt.value) {\r\n\t\talert(\"El campo 'Para' es requerido.\");\r\n\t\tparaTxt.focus();\r\n\t\tverificar = false;\r\n\t} else if (!expRegEmail.exec(paraTxt.value)) {\r\n\t\talert(\"La dirección de correo 'Para' no es válida.\");\r\n\t\tparaTxt.focus();\r\n\t\tverificar = false;\r\n\t} else if (!asuntoTxt.value) {\r\n\t\talert(\"El campo 'Asunto' es requerido.\");\r\n\t\tasuntoTxt.focus();\r\n\t\tverificar = false;\r\n\t} else if (!archivoFls.value) {\r\n\t\talert(\"El campo 'Adjuntar' es requerido.\");\r\n\t\tarchivo_Fls.focus();\r\n\t\tverificar = false;\r\n\t} else if (!mensajeTxa.value) {\r\n\t\talert(\"El campo 'Mensaje' es requerido.\");\r\n\t\tmensajeTxa.focus();\r\n\t\tverificar = false;\r\n\t}\r\n\r\n\tif (verificar) {\r\n\t\tmailFrm.submit();\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "3de973ea0ced8eb13a1ef3a7e48c0bf4", "score": "0.69817543", "text": "function validar() {\r\n \r\n // Validacion de campos del formulario\r\n var gerente, cliente, email, telefono, comentario, expresion; // los campo a validar deben ser los valores de los ID\r\n gerente=document.getElementById(\"gerente\").value,\r\n cliente=document.getElementById(\"cliente\").value;\r\n email = document.getElementById(\"email\").value;\r\n telefono = document.getElementById(\"telefono\").value;\r\n comentario= document.getElementById(\"comentario\").value;\r\n expresion = /\\w+@\\w+\\.+[a-z]/; //expresion regular \r\n \r\n if(gerente == '') { \r\n alert('Campos gerente es obligatorios, por favor llenar.');\r\n return false;\r\n }\r\n else if(gerente.length >30) { \r\n alert('Nombre del gerente es mayor a 30 caracteres.');\r\n return false;\r\n }\r\n else if(cliente == '') { \r\n alert('Campos cliente es obligatorios, por favor llenar.');\r\n return false;\r\n }\r\n else if(cliente.length >30) { \r\n alert('Nombre del cliente es mayor a 30 caracteres.');\r\n return false;\r\n }\r\n else if(telefono == '') { \r\n alert('Verificar, numero telefonico es obligatorio, por favor llenar');\r\n return false;\r\n }\r\n else if(isNaN(telefono)) { \r\n alert('Verificar, numero de telefono debe ser numerico');\r\n return false;\r\n }\r\n else if(telefono.length >10) { \r\n alert('Verificar, numero telefonico muy largo');\r\n return false;\r\n } \r\n else if(email == '') { \r\n alert('Campos email es obligatorios, por favor llenar.');\r\n return false;\r\n }\r\n else if(!expresion.test(email)) { \r\n alert('Correo utilizado, no es valido.');\r\n return false;\r\n } \r\n else if(telefono.length >10) { \r\n alert('Verificar, numero telefonico muy largo');\r\n return false;\r\n }\r\n else if(comentario.length >50) { \r\n alert('Comentario muy largo');\r\n return false;\r\n }\r\n \r\n}", "title": "" }, { "docid": "0e343c9b9a04fdb40a464f2644c3d99c", "score": "0.6977209", "text": "function iniciarValidacionFormularioEditarFicha() {\n let formNuevaFicha = $('#formEditarFicha');\n return formNuevaFicha.valid();\n}", "title": "" }, { "docid": "2814d3d37fbb749d7002a4dcc4c4d3c4", "score": "0.6967519", "text": "function validacion_fields(validacion){\n\n if ( typeof validacion == \"object\" ) {\n\n for (var i = 0; i < validacion.length; i++) {\n var valores = jQuery('#'+validacion[i]).val();\n if (valores == \"\" || valores == 0 || valores == \"null\") {\n jQuery('#'+validacion[i]).parent().parent().addClass('has-error');\n toastr.error( 'Favor de verificar los campos de color rojo!' , title );\n // pnotify('Campos Vacios','Favor de verificar los campos de color rojo!','error');\n return 'error';\n }else{\n jQuery('#'+validacion[i]).parent().parent().removeClass('has-error');\n }\n };\n\n }\n\n\n }", "title": "" }, { "docid": "f1f40deffff9bb69de79f5d229226f24", "score": "0.6967104", "text": "function validarAltaProv()\r\n{\r\n\r\n\tvar bValido = true;\r\n\tvar sError = \"\";\r\n\r\n\t//campo cif\r\n\tvar sCif = formAltaProv.cifProv.value.trim();\r\n\tformAltaProv.cifProv.value = formAltaProv.cifProv.value.trim();\r\n\tvar oExpReg = /^[a-zA-Z]\\d{8}$/i;\r\n\r\n\tif (oExpReg.test(sCif) == false)\r\n\t{\r\n\t\tformAltaProv.cifProv.classList.add(\"error\");\r\n\t\tformAltaProv.cifProv.focus();\r\n\t\tbValido = false;\r\n\t\tsError = \"El CIF tiene que tener una letra y 8 numeros. <br>\"; \r\n\t} else {\r\n\t\tformAltaProv.cifProv.classList.remove(\"error\");\r\n\t}\r\n\r\n\t//campo nombre\r\n\tvar sNombre = formAltaProv.nomProv.value.trim();\r\n\tformAltaProv.nomProv.value = formAltaProv.nomProv.value.trim();\r\n\tvar oExpReg = /^[a-zA-Z\\s]{1,40}$/i;\r\n\r\n\tif (oExpReg.test(sNombre) == false)\r\n\t{\r\n\t\tformAltaProv.nomProv.classList.add(\"error\");\r\n\t\tformAltaProv.nomProv.focus();\r\n\t\tbValido = false;\r\n\t\tsError += \"Escriba un nombre.<br>\"; \r\n\t} else {\r\n\t\tformAltaProv.nomProv.classList.remove(\"error\");\r\n\t}\r\n\r\n\t//campo direccion\r\n\tvar sDireccion = formAltaProv.dirProv.value.trim();\r\n\tformAltaProv.dirProv.value = formAltaProv.dirProv.value.trim();\r\n\toExpReg = /^[\\w\\s]{1,40}$/i;\r\n\r\n\tif (oExpReg.test(sDireccion) == false)\r\n\t{\r\n\t\tformAltaProv.dirProv.classList.add(\"error\");\r\n\t\tformAltaProv.dirProv.focus();\r\n\t\tbValido = false;\r\n\t\tsError += \"Debe escribir una direccion. Ejemplo: Calle Arroz 6. <br>\"; \r\n\t} else {\r\n\t\tformAltaProv.dirProv.classList.remove(\"error\");\r\n\t}\r\n\r\n\r\n\t//campo telefono\r\n\tvar nTelefono = formAltaProv.telProv.value.trim();\r\n\tformAltaProv.telProv.value = formAltaProv.telProv.value.trim();\r\n\tvar oExpReg = /^[6|7][0-9]{8}$/;\r\n\r\n\tif (oExpReg.test(nTelefono) == false)\r\n\t{\r\n\t\tformAltaProv.telProv.classList.add(\"error\");\r\n\t\tformAltaProv.telProv.focus();\r\n\t\tbValido = false;\r\n\t\tsError += \"El telefono tiene que empezar por 6 o 7 y tiene que tener 9 cifras.\"; \r\n\t} else {\r\n\t\tformAltaProv.telProv.classList.remove(\"error\");\r\n\t}\r\n\r\n\tif (bValido == false) \r\n\t{\r\n\t\t$(\"#mensaje\").empty();\r\n\t\t$(\"#mensaje\").append('<div class=\"alert alert-danger\"><a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>'+sError+'</div>');\r\n\t\t\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "508ed4918e8a4620afbef6c0217154da", "score": "0.6953951", "text": "function validarFormInventario() {\n var correcto = true, msg = \"\";\n if (!$('#modalInventarioCodigoAut').is(\":checked\") && $('#modalInventarioCodigo').val() === \"\") {\n $('#modalInventarioCodigo').focus();\n correcto = false;\n msg = \"Coloque el <b>Código</b>\";\n } else if ($('#modalInventarioNombre').val() === \"\") {\n $('#modalInventarioNombre').focus();\n correcto = false;\n msg = \"Coloque el <b>Nombre</b>\";\n } else if ($('#modalInventarioPresentacion').val() === \"\") {\n $('#modalInventarioPresentacion').focus();\n correcto = false;\n msg = \"Coloque la <b>Presentación</b>\";\n } else if ($('#modalInventarioPrecioCompra').val() === \"\") {\n $('#modalInventarioPrecioCompra').focus();\n correcto = false;\n msg = \"Coloque el <b>Precio de Compra</b>\";\n } else if (parseFloat($('#modalInventarioPrecioCompra').val()) < 0) {\n $('#modalInventarioPrecioCompra').focus();\n correcto = false;\n msg = \"Coloque el <b>Precio de Compra</b>\";\n } else if (isNaN(parseFloat($('#modalInventarioPrecioCompra').val()))) {\n $('#modalInventarioPrecioCompra').focus();\n correcto = false;\n msg = \"<b>Precio de Compra</b> NO válido\";\n } else if ($('#modalInventarioPrecioVenta').val() === \"\") {\n $('#modalInventarioPrecioVenta').focus();\n correcto = false;\n msg = \"Coloque el <b>Precio de Venta</b>\";\n } else if (parseFloat($('#modalInventarioPrecioVenta').val()) < 0) {\n $('#modalInventarioPrecioVenta').focus();\n correcto = false;\n msg = \"Coloque el <b>Precio de Venta</b>\";\n } else if (isNaN(parseFloat($('#modalInventarioPrecioVenta').val()))) {\n $('#modalInventarioPrecioVenta').focus();\n correcto = false;\n msg = \"<b>Precio de Venta</b> NO válido\";\n } else if ($('#modalInventarioExistencias').val() === \"\") {\n $('#modalInventarioExistencias').focus();\n correcto = false;\n msg = \"Coloque las <b>Existencias</b>\";\n } else if (parseFloat($('#modalInventarioExistencias').val()) < 0) {\n $('#modalInventarioExistencias').focus();\n correcto = false;\n msg = \"Coloque las <b>Existencias</b>\";\n } else if (isNaN(parseFloat($('#modalInventarioExistencias').val()))) {\n $('#modalInventarioExistencias').focus();\n correcto = false;\n msg = \"<b>Cantidad de Existencias</b> NO válido\";\n } else if ($('#modalInventarioStock').val() === \"\") {\n $('#modalInventarioStock').focus();\n correcto = false;\n msg = \"Coloque el <b>Stock</b>\";\n } else if (parseFloat($('#modalInventarioStock').val()) < 0) {\n $('#modalInventarioStock').focus();\n correcto = false;\n msg = \"Coloque el <b>Stock</b>\";\n } else if (isNaN(parseFloat($('#modalInventarioStock').val()))) {\n $('#modalInventarioStock').focus();\n correcto = false;\n msg = \"<b>Cantidad de Stock</b> NO válido\";\n } else {\n InventarioAltaJSON = {\n IdArticuloInventario: IdArticuloInventarioGLOBAL,\n Codigo: ($('#modalInventarioCodigo').val() !== \"\") ? $('#modalInventarioCodigo').val() : \"--\",\n Nombre: $('#modalInventarioNombre').val().toUpperCase(),\n Presentacion: $('#modalInventarioPresentacion').val().toUpperCase(),\n PrecioCompra: parseFloat($('#modalInventarioPrecioCompra').val()),\n PrecioVenta: parseFloat($('#modalInventarioPrecioVenta').val()),\n Existencias: parseFloat($('#modalInventarioExistencias').val()),\n Stock: parseFloat($('#modalInventarioStock').val()),\n Area: $('#modalInventarioArea').val(),\n CodigoAuto: $('#modalInventarioCodigoAut').is(\":checked\"),\n };\n }\n if (!correcto) {\n MsgAlerta(\"Atención!\", msg, 3000, \"default\");\n }\n return correcto;\n}", "title": "" }, { "docid": "c8ca8a17d9161bdd78fabd256f625c4e", "score": "0.6953652", "text": "function validateForm()\n{\n var form = this;\n var yearPat = /^\\d{4}$/;\n var numPat = /^\\d{1,6}$/;\n var countPat= /^\\d{1,2}$/;\n\n var msg = \"\";\n if (form.RegYear)\n {\n if ((form.RegYear.value.length > 0) && \n form.RegYear.value.search(yearPat) == -1)\n msg = \"Year is not 4 digit number. \";\n }\n else\n msg = \"RegYear field missing from input form. \";\n if (form.RegNum)\n {\n if ((form.RegNum.value.length > 0) &&\n form.RegNum.value.search(numPat) == -1)\n msg += \"Number is not a valid number. \";\n }\n else\n msg = \"RegNum field missing from input form. \";\n if ((form.Count !== undefined) &&\n (form.Count.value.length > 0) &&\n (form.Count.value.search(countPat) == -1))\n msg += \"Count is not a 1 or 2 digit number. \";\n\n if (msg != \"\")\n {\n alert(msg);\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "88273f35604d64ba1f988f96cd20346e", "score": "0.6947222", "text": "function validate_form()\n{\n\tvar validation_errors = 0;\n\t$('.required input, .required textarea',this).each(function(i){\n\t\tif(this.value == null || this.value == \"\")\n\t\t{\n\t\t\tvalidation_errors++;\n\t\t\t$(this).addClass(\"error\");\n\t\t\t$(this).bind('blur',check_required_field);\n\t\t}\n\t\telse\n\t\t\t$(this).removeClass(\"error\");\n\t});\n\t\n\treturn !(validation_errors);\n}", "title": "" }, { "docid": "30cc5b87a7993cca522726ea87912cfb", "score": "0.69460374", "text": "function _formValidation() {\n var regex = /^(([^<>()\\[\\]\\\\.,;:\\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\n if (vm.form_data.first_name === '' ||\n vm.form_data.last_name === '' ||\n vm.form_data.address === '' ||\n vm.form_data.postal_code === '' ||\n vm.form_data.city === '' ||\n vm.form_data.country === '' ||\n !regex.test(vm.form_data.email) ||\n vm.form_data.phone.length === 0) {\n\n return true;\n }\n }", "title": "" }, { "docid": "33abd3df8da696beb889ac4873df1f7c", "score": "0.6943672", "text": "validarDatosForm(form){\n\t\tlet elements = document.getElementById(form).elements;\n\t\tlet msj = 'ok';\n\t\tfor(let i = 0; i < elements.length; i++) { \n\t\t\tlet field_type = elements[i].type.toLowerCase();\n\t\t\tswitch(field_type) {\n\t\t\t\tcase \"text\": \n\t\t\t\tcase \"textarea\":\n\t\t\t case \"hidden\":\n\t\t\t\t\tif(elements[i].value.length == 0)\n\t\t\t\t\t\tmsj = 'Los campos deben contener texto'; \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"password\": \n\t\t\t\t\tif(elements[i].value.length < 5)\n\t\t\t\t\t\tmsj = 'El password debe tener al menos cinco caracteres'; \n\t\t\t\t\tbreak;\n\t\t\t case \"email\":\n\t\t\t \tif(!this.isEmail(elements[i].value))\n\t\t\t\t\t\tmsj = 'No es un correo electronico valido'; \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"select-one\":\n\t\t\t\tcase \"select-multi\":\n\t\t\t\t\tif(elements[i].selectedIndex < 0)\n\t\t\t\t\t\tmsj = 'Debe seleccionar una opción'; \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"number\": \n\t\t\t\t\tif(elements[i].value < 1)\n\t\t\t\t\t\tmsj = 'Debe digitar un numero positivo, mayor a cero'; \n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: \n\t\t\t\t\tbreak;\n\t\t\t}\n\t }\n\t return msj;\n\t}", "title": "" }, { "docid": "6191b8008182af90f704d03fba866e16", "score": "0.6942054", "text": "function validar(e) {\n if (validaNombre() && validaTelefono() && validaFecha() && validaCheck() && confirm(\"Pulsa Aceptar si deseas enviar el formulario\")) {\n return true;\n } else {\n e.preventDefault();\n return false;\n }\n}", "title": "" }, { "docid": "5f12843c412374c232d1f771ccac69e4", "score": "0.6936595", "text": "function validarCampo(){\n if(calle.value.length > 0 && numero_ext.value.length > 0 && num_int.value.length > 0 && colonia.value.length > 0 && alcaldia.value.length > 0 && estado.value.length > 0 && pais.value.length > 0 && cp.value.length > 0 && celular.value.length > 0 && telefono.value.length > 0 && referencias.value.length > 0){\n let aceptar = boton_aceptar;\n aceptar.disabled = false;\n } else {\n // alert('Todos los campos son obligatorios');\n }\n}", "title": "" }, { "docid": "a2b112960ea7f49880f969fae7fca38f", "score": "0.6925778", "text": "function isNuevaPersonaValid() {\n\n // formulario de validacion\n var form = document.getElementById('frmPersona');\n \n // chequea la validacion\n if (form.checkValidity() === false) {\n\n form.classList.add('was-validated');\n return false;\n }\n \n // valid\n return true;\n}", "title": "" }, { "docid": "62af57cc7a81d6d374b392092a25d721", "score": "0.69162756", "text": "function DetHandleValidation() {\n let fields = detFields;\n let errors = {};\n let formIsValid = true;\n\n //kode_barang\n if(!fields[\"kode_barang\"]){\n formIsValid = false;\n errors[\"kode_barang\"] = \"Cannot be empty\";\n }\n\n //jumlah\n if(!jumlah){\n formIsValid = false;\n errors[\"jumlah\"] = \"Cannot be empty\";\n }\n\n if(jumlah > stkBrg){\n formIsValid = false;\n errors[\"jumlah\"] = \"Peminjaman melebihi stock\";\n }\n\n //gedung\n if(!fields[\"gedung\"]){\n formIsValid = false;\n errors[\"gedung\"] = \"Cannot be empty\";\n }\n\n //ruang\n if(!fields[\"ruang\"]){\n formIsValid = false;\n errors[\"ruang\"] = \"Cannot be empty\";\n }\n\n SetDetErrors(errors);\n return formIsValid;\n }", "title": "" }, { "docid": "143c97b8982360e658ea38c3d7584026", "score": "0.6912368", "text": "function validarCampoInformativo(){\n\t\n\tconst informativo = document.getElementById(\"informativo\").value\n\n\tif(informativo.trim() == \"\"){\n\t\tabrirModalAlerta(\"Preencha o campo informativo!\")\n\t}\n\telse if(informativoRecuperadoBD == informativo){\n\t\tabrirModalAlerta(\"Mensagem não foi alterada!\")\n\t}\n\telse{\n\t\tabrirModalProgress()\n\t\tsalvarDadosInformativo(informativo)\n\t}\n}", "title": "" }, { "docid": "02830b70647ba4e93a6bb1d21d84366a", "score": "0.69110155", "text": "function valform(_form){\n clear_log();\n if (typeof _form === \"undefined\" || _form === null){\n _form=\"#form_\";\n }\n var valido=true;\n jQuery(_form+' .validar').each(function(){\n var id = jQuery(this).prop('id');\n if(!jQuery(this).hasClass(\"table\")){\n valido = valido && validate(id); \n }\n if(jQuery(this).hasClass(\"numeric\") && jQuery(this).hasClass(\"positive\")){\n valido = valido && IsNumber(id,true);\n }else if (jQuery(this).hasClass(\"numeric\")){\n valido = valido && IsNumber(id);\n }else if(jQuery(this).hasClass(\"dates\")){\n valido = valido && IsDate(id);\n }else if(jQuery(this).hasClass(\"list\")){\n valido = valido && list(id);\n }else if(jQuery(this).hasClass(\"rut\")){\n valido = valido && IsRut(id);\n }else if(jQuery(this).hasClass(\"mail\")){\n valido = valido && validMail(id);\n }else if(jQuery(this).hasClass(\"table\")){\n valido = valido && count_row(id,\"label\");\n }\n });\n return valido;\n}", "title": "" }, { "docid": "0064eba7946d054596215d1cadb07c64", "score": "0.6910559", "text": "function validateForm(){\n var validateDateBegin = dateBegin.value;\n var validateDateEnd = dateEnd.value;\n var validateQuery = query.value;\n var validateQuantity = quantity.value;\n if (validateQuery==null || validateQuery==\"\" || validateQuantity==null || validateQuantity==\"\" || validateDateBegin==null || validateDateBegin==\"\" || validateDateEnd==null ||validateDateEnd==\"\") {\n return(null);\n } else {\n return(true);\n }\n}", "title": "" }, { "docid": "7f97ad5567978a38e9119b084beb4ed3", "score": "0.691001", "text": "function checkForm(){\n //Name validation\n var validation = $(\"#db_nome\").val().replace(/(^\\s+|\\s+$)/g, '');\n if(!validation || validation == ''){\n checkError(\"Inserisci un nome\");\n return;\n }\n \n //Surname validation\n validation = $(\"#db_cognome\").val().replace(/(^\\s+|\\s+$)/g, '');\n if(!validation || validation == ''){\n checkError(\"Inserisci un cognome\");\n return;\n }\n \n //Email validation\n validation = $(\"#db_email\").val().replace(/(^\\s+|\\s+$)/g, '');\n if(!validation || validation == ''){\n checkError(\"Inserisci un'email\");\n return;\n }\n var reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n if(reg.test($(\"#db_email\").val()) == false) {\n checkError(\"Inserisci un'email valida\");\n return;\n }\n \n //Group validation\n if(($(\"#radioAuto\").attr(\"checked\")!= true && $(\"#radioAuto\").attr(\"checked\") != 'checked') && ($(\"#radioMoto\").attr(\"checked\")!= true && $(\"#radioMoto\").attr(\"checked\") != 'checked') && ($(\"#radioIndustria\").attr(\"checked\")!= true && $(\"#radioIndustria\").attr(\"checked\") != 'checked')){\n checkError(\"Seleziona un gruppo\");\n return;\n }\n \n //Agree validation\n if($(\"#consenso\").attr(\"checked\")!= true && $(\"#consenso\").attr(\"checked\") != 'checked'){\n checkError(\"Devi autorizzare il trattamento dei dati\");\n return;\n }\n $(\"#subscribeform\").submit();\n}", "title": "" }, { "docid": "180290c7ffec4a85c607fa128ee417b8", "score": "0.69098014", "text": "function validarCampos() {\n if (this.value == '') {\n errorDiv.style.display = 'block';\n errorDiv.innerHTML = \"Este campo es obligatorio!!!\";\n this.style.border = '1px solid #fe4918';\n errorDiv.style.textAlign = 'center';\n errorDiv.style.border = '1px solid #fe4918';\n errorDiv.style.color = 'white';\n errorDiv.style.background = '#fe4918';\n } else {\n errorDiv.style.display = 'none';\n this.style.border = '1px solid #cccccc';\n }\n }", "title": "" }, { "docid": "4762367c9e2186efdc9c143189935662", "score": "0.69021344", "text": "function checkForm(form) {\n\n if (form.id == 'editUserForm') {\n\n var name = document.getElementById(\"name\").value;\n // does not check for illegal chars (but this is done on server side)\n if (!validateName(name, 30, false, false)) {\n return false;\n }\n\n // TO-DO: validation\n return true;\n }\n else if (form.id == 'editCalorieForm') {\n\n var name = document.getElementById(\"\").value;\n var description = document.getElementById(\"description\").value;\n\n if (!validateName(name, 80, false, false)) {\n return false;\n }\n \n if (!validateDescription(description, maxlength, false)) {\n\n return false;\n }\n\n // TO-DO: validation\n\n return true;\n }\n else if (form.id == 'editUserTypeForm') {\n\n var name = document.getElementById(\"name\").value;\n\n if (!validateName(name, 100, false, false)) {\n return false; \n }\n\n // TO-DO: validation\n\n return true;\n }\n else if (form.id == 'addCalorieForm') {\n\n var name = document.getElementById(\"name\").value;\n \n if (!validateName(name, 80, true, true)) {\n return false;\n }\n\n return true;\n }\n else if (form.id == 'addUserForm') {\n\n // TO-DO: validation\n }\n else if (form.id == 'addUserTypeForm') {\n\n // TO-DO: validation\n }\n else {\n\n window.alert(\"Sorry, this action is not supported yet.\")\n return false;\n }\n}", "title": "" }, { "docid": "a08c190184b45c57b26362250ba8e07f", "score": "0.68990815", "text": "function validateForm() {\r\n var fName = getFormValueByName(\"fname\");\r\n var lName = getFormValueByName(\"lname\");\r\n var YearOBirth = GetYear(getFormValueByName(\"bd\"));\r\n var password = getFormValueByName(\"pass\");\r\n var mail = getFormValueByName(\"mail\");\r\n var phone = getFormValueByName(\"phone\");\r\n var passConf = getFormValueByName(\"passConf\");\r\n const hebrew = new RegExp(/^[\\u0590-\\u05FF ,.'-]+$/i);\r\n const english = new RegExp(/^[a-zA-Z]+$/i);\r\n const userNameRule = new RegExp(/^[a-zA-Z0-9_]+$/i);\r\n\r\n var validPasswordConfirmation = (password != passConf);\r\n var isError = checkElem(\"passConf\", validPasswordConfirmation, false);\r\n\r\n\r\n var validFName = !hebrew.test(fName);\r\n isError = checkElem(\"fName\", validFName, isError);\r\n\r\n var validGender = document.getElementById('gender_Male').checked == false && document.getElementById('gender_Female').checked == false && document.getElementById('gender_Other').checked == false;\r\n isError = checkElem(\"gender\", validGender, isError);\r\n var validLName = !hebrew.test(lName);\r\n isError = checkElem(\"lName\", validLName, isError);\r\n\r\n var validBirthDate = YearOBirth < 1960 || isNaN(YearOBirth) && YearOBirth.length != 4;\r\n isError = checkElem(\"db\", validBirthDate, isError);\r\n\r\n var validPassword = checkPassword(password, english, userNameRule);\r\n isError = checkElem(\"pass\", validPassword, isError);\r\n\r\n var validMail = !validateMail(mail);\r\n isError = checkElem(\"mail\", validMail, isError);\r\n\r\n var validPhone = !(phone.length == 10 && !isNaN(phone));\r\n if (phone == \"\" || phone == \"No data\") {\r\n validPhone = false;\r\n }\r\n\r\n isError = checkElem(\"phone\", validPhone, isError);\r\n\r\n if (!isError) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "e252967bda10796326c2ab7c9f8e9632", "score": "0.6886689", "text": "function validarFormNuevoCargoAdicional() {\n var correcto = true, msg = \"\";\n if ($('#modalImporteCargoAdicional').val() === \"\" || parseFloat($('#modalImporteCargoAdicional').val()) < 1 || isNaN(parseFloat($('#modalImporteCargoAdicional').val()))) {\n correcto = false;\n $('#modalImporteCargoAdicional').focus();\n msg = \"El Importe es <b>Incorrecto</b> o <b>Inválido</b>\";\n } else if ($('#modalDescripcionCargoAdicional').val() === \"\") {\n correcto = false;\n $('#modalDescripcionCargoAdicional').focus();\n msg = \"Coloque la <b>Descripción</b>\";\n }\n if (!correcto) {\n MsgAlerta(\"Atención!\", msg, 3000, \"default\");\n }\n return correcto;\n}", "title": "" }, { "docid": "3478ce5ad41882380df7e8eb2b1b42a2", "score": "0.6884628", "text": "function validarRegistro() {\n\n expEmail=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$/g;\n expClave=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])[A-Za-z\\d$@$!%*?&]{8,15}$/g;\n\n return expEmail.test(form[\"email\"].value) && expClave.test(form[\"clave\"].value) && form[\"nombre\"].value !== \"\" &&\n form[\"clave\"].value === form[\"Rclave\"].value;\n\n}", "title": "" }, { "docid": "5c63fa084f9aa0eb57b4101f3ee0a10a", "score": "0.6880154", "text": "function validar(){\n\t\n\t\n\n\tif(document.getElementById(\"idCodigo\").value == \"\"){\n\t\talert(\"Hace falta ingresar el código del producto!\");\n\t\treturn false;\n\t}\n\n\tif(document.getElementById(\"idNombre\").value == \"\"){\n\t\talert(\"Hace falta ingresar el nombre del producto!\");\n\t\treturn false;\n\t}\n\n\tif(document.getElementById(\"idPrecio\").value == \"\"){\n\t\talert(\"Hace falta ingresar el Precio del producto!\");\n\t\treturn false;\n\t}\n\n\tif (document.getElementById(\"idImagen\").value == \"\") {\n\t\talert(\"Hace falta ingresar el Precio del producto!\");\n\t\treturn false;\n\t}\n\n}", "title": "" }, { "docid": "fe34b8d688ac51011af9df71435441ce", "score": "0.6878021", "text": "async validateFormFields() {\n console.log(\"to do - validiate form\");\n }", "title": "" }, { "docid": "f1d0f25b6e33aeff26d0ab0883440399", "score": "0.6868263", "text": "function doValidation() {\n // If the form is valid, return true\n // Otherwise return false\n // We can get all the inputs in the form by doing the following:\n // $('input')\n // And loop through them using an each loop (http://api.jquery.com/each/)\n return true;\n}", "title": "" }, { "docid": "4acba90d3737f62e4d076b10b1d4d781", "score": "0.6859463", "text": "function validaForm() {\r\n\tif( $('input[name=\"nome\"]').val().length == 0 || $('input[name=\"password\"]').val().length == 0) {\r\n\t\t$(\"p#loginErr\").text(\"Impossibile inviare il form, campi mancanti\");\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n\t\t$(\"p#loginErr\").text(\"\")\r\n\t\treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "c832f2714daf90a004b63533e53d31df", "score": "0.68480855", "text": "function validarTarjeta() {\n var datosTarj = document.getElementsByClassName(\"reqTarj\");\n var formValid = true;\n\n for (var i = 0; i < datosTarj.length; i++) {\n formValid = formValid && datosTarj[i].value != \"\";\n }\n if (formValid == false) {\n return false;\n } else {\n return true;\n };\n}", "title": "" }, { "docid": "d8413aff1c70e6abd520f99d22abdcd0", "score": "0.68303144", "text": "function validate(isValid) {\n var firstName = document.getElementById(\"firstName\").value;\n if(firstName == \"\") {\n return false;\n }\n \n var lastName = document.getElementById(\"lastName\").value;\n if(lastName == \"\") {\n return false;\n }\n \n var number = document.getElementById(\"phoneNr\").value;\n if(number == \"\") {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "3d53dccc45625b0607de8a9f7123b7cf", "score": "0.68301153", "text": "function validarDatosEnvio() {\n var addrElem = document.getElementsByClassName(\"req\");\n var formValid = true;\n\n for (var i = 0; i < addrElem.length; i++) {\n formValid = formValid && addrElem[i].value != \"\";\n }\n if (formValid == false) {\n document.getElementById(\"error-datos-envio\").innerHTML = \"Debe completar todos los campos\";\n return false;\n } else {\n document.getElementById(\"error-datos-envio\").innerHTML = \"\"\n return true;\n };\n}", "title": "" }, { "docid": "ebf709253430831f651b996c605b0d39", "score": "0.68277955", "text": "function validar() {\r\n //obtengo el valor de cada campo\r\n var name = document.getElementById(\"name\").value;\r\n var lastname = document.getElementById(\"lastname\").value;\r\n var email = document.getElementById(\"email\").value;\r\n var ci = document.getElementById(\"ci\").value;\r\n var dep = document.getElementById(\"dep\").value;\r\n var loc = document.getElementById(\"loc\").value;\r\n var term = document.getElementById(\"terminos\");\r\n //la variable expresion expresa la regulacion del correo\r\n var expresion = /\\w+@\\w+\\.+[a-z]/;\r\n //error en un inicio es falso ya que aun no se ha detectado\r\n var error = false;\r\n\r\n //validacion del nombre\r\n //si el campo es vacío salta error \r\n if (name === \"\") {\r\n document.getElementById(\"name\").style.borderColor = \"red\";\r\n document.getElementById(\"errorName\").innerHTML =\r\n \"El campo no puede estar vacío\";\r\n error = true;\r\n\r\n }\r\n\r\n //si el campo esta escrito pero con solo 1 o 2 caracteres salta error\r\n if (name.length > 0 && name.length < 3) {\r\n document.getElementById(\"name\").style.borderColor = \"red\";\r\n document.getElementById(\"errorName\").innerHTML =\r\n \"El nombre no cumple los caracteres requeridos\";\r\n error = true;\r\n }\r\n //validacion del apellido\r\n //si el campo es vacío salta error\r\n if (lastname === \"\") {\r\n document.getElementById(\"lastname\").style.borderColor = \"red\";\r\n document.getElementById(\"errorLastname\").innerHTML =\r\n \"El campo no puede estar vacío\";\r\n error = true;\r\n }\r\n //si el campo esta escrito pero con solo 1 o 2 caracteres salta error\r\n if (lastname.length > 0 && lastname.length < 3) {\r\n document.getElementById(\"lastname\").style.borderColor = \"red\";\r\n document.getElementById(\"errorLastname\").innerHTML =\r\n \"El apellido no cumple con la cantidad de caracteres requeridos\";\r\n error = true;\r\n }\r\n //validacion del email\r\n //si no cumple con la expresión salta error\r\n if (!expresion.test(email)) {\r\n document.getElementById(\"email\").style.borderColor = \"red\";\r\n document.getElementById(\"errorEmail\").innerHTML =\r\n \"Complete el campo correctamente\";\r\n error = true;\r\n } //si es vacío salta error\r\n if (email === \"\") {\r\n document.getElementById(\"email\").style.borderColor = \"red\";\r\n document.getElementById(\"errorEmail\").innerHTML =\r\n \"El campo no puede estar vacío\";\r\n error = true;\r\n }\r\n //validacion de la cedula\r\n //si no cumple con lo requerido en la function validarCedula() salta error\r\n if (validarCedula(ci) === false) {\r\n document.getElementById(\"ci\").style.borderColor = \"red\";\r\n document.getElementById(\"errorCI\").innerHTML =\r\n \"La C.I introducida no es válida\";\r\n error = true;\r\n } //si el campo esta vacío salta error\r\n if (ci === \"\") {\r\n document.getElementById(\"ci\").style.borderColor = \"red\";\r\n document.getElementById(\"errorCI\").innerHTML =\r\n \"El campo no puede estar vacío\";\r\n error = true;\r\n } //validacion de departamento\r\n if (dep === \"\") {\r\n document.getElementById(\"dep\").style.borderColor = \"red\";\r\n document.getElementById(\"errorDep\").innerHTML = \"Seleccione una opción\";\r\n error = true;\r\n } //validacion de localidad\r\n if (loc == \"\") {\r\n document.getElementById(\"loc\").style.borderColor = \"red\";\r\n document.getElementById(\"errorLoc\").innerHTML = \"Seleccione una opción\";\r\n error = true;\r\n } //validacion de bases y condiciones\r\n if (!term.checked) {\r\n document.getElementById(\"errorCheck\").style.color = \"red\";\r\n error = true;\r\n }\r\n return !error;\r\n}", "title": "" }, { "docid": "03642d673ef27f0990f75a4b12c17ffb", "score": "0.68257916", "text": "function addAFormValidate() {\n Validation.addAllThese([\n ['hankaku', '', function(v,elm) {\n elm.value = elm.value.toHankaku();\n return true;\n }],\n\n ['required', 'This is a required field.', function(v,elm) {\n if( !Validation.get('IsEmpty').test(v) ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('empty', elm, v);\n return false;\n }\n }],\n\n ['validate-length', 'Length', function(v,elm) {\n var max_length = elm.readAttribute('validate_max_length');\n v = v.replace(/\\r/g, \"\");\n v = v.replace(/\\n/g, \"\");\n if( v.length <= max_length ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('max_length_error', elm, v);\n return false;\n }\n }],\n\n ['validate-email', 'Please enter a valid email address. For example [email protected] .', function (v,elm) {\n if( Validation.get('IsEmpty').test(v) || /^([*+!.&#$|\\'\\\\%\\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\\.)+[0-9a-z]{2,})$/i.test(v) ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('email_format_error', elm, v);\n return false;\n }\n }],\n\n ['validate-url', 'Please enter a valid URL.', function (v,elm) {\n if( Validation.get('IsEmpty').test(v) || /^(http|https|ftp):\\/\\/(([A-Z0-9][A-Z0-9_-]*)(\\.[A-Z0-9][A-Z0-9_-]*)+)(:(\\d+))?\\/?/i.test(v) ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('url_format_error', elm, v);\n return false;\n }\n }],\n\n ['validate-tel', 'Please use only numbers (0-9) or '-' in this field.', function(v,elm) {\n if( Validation.get('IsEmpty').test(v) || /^[0-9\\-]+$/.test(v) ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('tel_format_error', elm, v);\n return false;\n }\n }],\n\n ['validate-zipcode', 'Please enter a valid zipcode. For example 999-9999.', function(v,elm) {\n if( Validation.get('IsEmpty').test(v) || /^[0-9]{3}-[0-9]{4}$/.test(v) ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('zipcode_format_error', elm, v);\n return false;\n }\n }],\n\n ['validate-selection', 'Please make a selection', function(v,elm){\n if( !Validation.get('IsEmpty').test(v) ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('not_selected', elm, v);\n return false;\n }\n }],\n\n ['validate-one-required', 'Please select one of the above options.', function(v,elm) {\n var field_id = elm.name.match(/^aform-field-[0-9]+/);\n var reg = new RegExp( field_id );\n var options = elm.form.getElementsByTagName('INPUT');\n var check = $A(options).any(function(option) {\n if( option.name.search(reg) == -1 ){\n return '';\n }\n return $F(option);\n });\n if( check ){\n hideAFormAdvice(elm);\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('empty', elm, v);\n return false;\n }\n }],\n\n ['validate-privacy', 'Please check this privacy policy.', function(v,elm) {\n var field_id = elm.name.match(/^aform-field-[0-9]+/);\n var reg = new RegExp( field_id );\n var options = elm.form.getElementsByTagName('INPUT');\n var check = $A(options).any(function(option) {\n if( option.name.search(reg) == -1 ){\n return '';\n }\n return $F(option);\n });\n if( check ){\n removeAFormInputErrorTitle(elm);\n return true;\n }else{\n addAFormInputErrorTitle(elm);\n postAFormErrorLog('privacy_error', elm, v);\n return false;\n }\n }]\n ]);\n}", "title": "" }, { "docid": "24415661964ba6155e22bf4cc982cb63", "score": "0.6824474", "text": "function validarFormBusquedaFichaPendientes() {\n let formBusquedaFichaPendiente = $('#formBusquedaFichaPendiente');\n return formBusquedaFichaPendiente.valid();\n}", "title": "" }, { "docid": "942ed9a249ab6c848f5ecf3e5dcddc84", "score": "0.68216944", "text": "function validateFields(event) {\n event.preventDefault();\n // Is sio veiksmo pasiemam reiksmes is paciu laukeliu\n var fname = event.target.firstname.value;\n var lname = event.target.lastname.value;\n var email = event.target.email.value;\n\n // Pasitikrinam ar bent vienas is siu kintamuju yra tuscias\n if (fname === \"\" || lname === \"\" || email === \"\") {\n // Stabdom formos siuntima\n // Sukuriam nauja div elementa\n messageElement(\"Please, fill in form fields\", \"danger\");\n return;\n }\n\n sendMail();\n }", "title": "" }, { "docid": "bc458f470a5391bd4b67cbda5572b706", "score": "0.6815802", "text": "function validate (form)\n{\n\treturn (\n\tcheckString (form.elements[\"f_imie\"].value, 'imię') &&\n\tcheckString (form.elements[\"f_nazwisko\"].value, 'nazwisko') &&\n\tcheckEmail (form.elements[\"f_email\"].value) &&\n\tcheckPostalCode (form.elements[\"f_kod_pocztowy\"].value) &&\n\tcheckString (form.elements[\"f_ulica\"].value, 'ulica/osiedle') &&\n\tcheckString (form.elements[\"f_miasto\"].value, 'miasto') )\n}", "title": "" }, { "docid": "c775cb7922592cdce8bb91d0e45ee134", "score": "0.681431", "text": "function validation() {\r\n\tif (form.name.value == \"\") {\r\n\t\terror();\r\n\t\treturn false;\r\n\r\n\t} else if (form.email.value == \"\") {\r\n\t\terror();\r\n\t\treturn false;\r\n\t} \r\n\r\n\treturn true;\r\n}", "title": "" }, { "docid": "17201b0b94f02f3e5b05af0b95de42ba", "score": "0.6809118", "text": "function valida(){ \n\t\n var f = new Date();\n\t\tvar dia= f.getDate(); if(dia<10) dia= \"0\"+dia;\n\t\tvar mes= f.getMonth() + 1; if(mes<10) mes= \"0\"+mes;\n\t\tvar anio= f.getFullYear();\n var hoy=(anio + \"-\" + mes + \"-\" + dia);\t \n\t valor = document.getElementById(\"titulo\").value;\n\t \tif (valor.length < 3) {\n\t\t\talert ('ERROR! Debe ingresar un título válido!');\n\t\t\treturn false;\n\t\t}\n\t\tvalor = document.getElementById(\"direccion\").value;\n\t\tif (valor.length < 3) {\n\t\t\talert ('ERROR! Debe ingresar una dirección válida!');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (document.getElementById(\"cantidadxxx\").value==''){\n\t\t\talert ('ERROR! Debe tener una cantidad');\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t\n\t\tif (document.getElementById(\"cantidadxxx\").value==0){\n\t\t\talert ('ERROR! Debe tener al menos una cantidad mayor a 0 (cero)!');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n\t\tif (!document.getElementById(\"fecha_inicio\").value){\n\t\t\talert ('ERROR! Debe seleccionar una fecha de inicio!');\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\t\t\n\t\tif (document.getElementById(\"fecha_inicio\").value < hoy){\t\t\t\n\t\t\talert ('ERROR! La fecha de inicio debe ser igual o posterior a hoy!');\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\t\n\t\tif (document.getElementById(\"fecha_inicio\").value>=document.getElementById(\"fecha_fin\").value\n\t\t && document.getElementById(\"fecha_fin\").value!=\"\"\n\t\t){\n\t\t\talert ('ERROR! La fecha de fin debe ser mayor a la de inicio!');\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\tif (!document.getElementById(\"tipo\").value){\n\t\t\talert ('ERROR! Debe seleccionar una categoría!');\n\t\t\treturn false;\n\t\t}\n\t\tif (!document.getElementById(\"provincia\").value){\n\t\t\talert ('ERROR! Debe seleccionar una provincia!');\n\t\t\treturn false;\n\t\t}\n\t\tif (!document.getElementById(\"ciudad\").value){\n\t\t\talert ('ERROR! Debe seleccionar una ciudad!');\n\t\t\treturn false;\n\t\t} \n\t\tif (document.getElementById(\"total_img\").value==0 && document.getElementById(\"fotoss\").value=='cambiar'){\n\t\t\talert ('ERROR! Debe tener al menos una foto!');\n\t\t\treturn false;\n\t\t} \n \n\t\t\n\t\tvalor = document.getElementById(\"descripcion\").value;\n\t\tif (valor.length < 3) {\n\t\t\talert ('ERROR! Debe ingresar una descripción!');\n\t\treturn false;\n\t\t}\n\t\t\n\tdocument.getElementById('enviar_todo').value= \"si\";\n\tdocument.registro.submit();\n\t}", "title": "" }, { "docid": "64dd05ff671af3c71afdf9a23a4c2fbb", "score": "0.6803033", "text": "function validateFormInput() {\n var fName = $(\"#fName\"),\n fNameEr = $(\"#fNameError\"),\n lName = $(\"#lName\"),\n lNameEr = $(\"#lNameError\"),\n birthDate = $(\"#birthDate\"),\n birthDateEr = $(\"#birthDateError\"),\n hireDate = $(\"#hireDate\"),\n hireDateEr = $(\"#hireDateError\"),\n isValid = true,\n myColor = \"#FF6F6F\";\n\n if (!validateName(fName.val())) {\n fName.css({\"border-color\": myColor});\n fNameEr.css({\"visibility\": \"visible\"});\n isValid = false;\n }\n\n if (!validateName(lName.val())) {\n lName.css({\"border-color\": myColor});\n lNameEr.css({\"visibility\": \"visible\"});\n isValid = false;\n }\n\n if (!validateDate(birthDate.val())) {\n birthDate.css({\"border-color\": myColor});\n birthDateEr.css({\"visibility\": \"visible\"});\n isValid = false;\n }\n\n if (!validateDate(hireDate.val())) {\n hireDate.css({\"border-color\": myColor});\n hireDateEr.css({\"visibility\": \"visible\"});\n isValid = false;\n }\n\n return isValid;\n }", "title": "" }, { "docid": "e78663c0044d7973c504177315ead460", "score": "0.6799989", "text": "function validarNovoDependente() {\n\n if (document.getElementById(\"nome\").value == \"\") {\n alert(\"Digite um NOME Valido.\");\n document.getElementById(\"nome\").focus();\n exit;\n }\n if (document.getElementById(\"nascimento\").value == \"\") {\n alert(\"Digite a DATA DE NASCIMENTO\");\n document.getElementById(\"nascimento\").focus();\n exit;\n }\n\n document.forms[\"frmnovodependente\"].submit();\n alert(\"O dependente \" + document.getElementById(\"nome\").value + \" \\nfoi cadastrado com sucesso!\");\n\n}", "title": "" }, { "docid": "6f67545c7431faa8ba1e488ef8207787", "score": "0.6795092", "text": "function validateEntreprise() {\n var entreprise = document.forms[\"formEntreprise\"][\"user_name\"];\n var ville = document.forms[\"formEntreprise\"][\"ville\"];\n var inputEntreprise = document.getElementById(\"nameEntreprise\");\n var inputVille = document.getElementById(\"ville\");\n if (entreprise.value == \"\" || entreprise.value.length < 2) {\n var e = document.getElementById(\"errorentreprise\");\n error(inputEntreprise);\n styleColorRed(e);\n e.innerHTML = \"Veuillez entrez un nom valide avec 2carcatères minimum\";\n entreprise.focus();\n return false;\n } else {\n document.getElementById(\"errorentreprise\").innerHTML = \"\";\n succes(inputEntreprise);\n }\n if (ville.value == \"\" || ville.value.length < 3) {\n var e = document.getElementById(\"errorville\");\n error(inputVille);\n styleColorRed(e);\n e.innerHTML = \"Veuillez entrez une ville valide avec 2 caractères minimum\";\n ville.focus();\n return false;\n } else {\n document.getElementById(\"errorville\").innerHTML = \"\";\n succes(inputVille);\n }\n return true;\n}", "title": "" }, { "docid": "0b082fd46f55e325dd71d1866d74f9a0", "score": "0.678709", "text": "function validate_ad_form(thisform)\r\n\t{\r\n\twith (thisform)\r\n\t{\r\n\t\t\tif (validate_required(name,\"Name must be filled out!\")==false)\r\n \t \t\t{\r\n\t\t name.focus();return false;\r\n\t\t\t}\r\n\t\t\tif (validate_required(type,\"Type must be filled out!\")==false)\r\n \t\t\t{\r\n\t\t type.focus();return false;\r\n\t\t\t}\r\n\t\t\tif (validate_required(syntax,\"Syntax Must Be Filled Out\")==false)\r\n \t\t\t{\r\n\t\t syntax.focus();return false;\r\n\t\t\t}\r\n\t\t\tif (validate_required(code,\"Code Must Be Filled Out\")==false)\r\n \t\t\t{\r\n\t\t code.focus();return false;\r\n\t\t\t}\r\n\t}\r\n\t}", "title": "" }, { "docid": "188fef456ffffb8a31b05320cf7474f9", "score": "0.6781593", "text": "function validarFormularioContacto(e) {\r\n e.preventDefault();\r\n var nombre = document.getElementById('formNombre').value;\r\n if (nombre.length < 4) {\r\n alert(\"No ha escrito un nombre correcto\");\r\n return false;\r\n }\r\n var apellido = document.getElementById('formApellido').value;\r\n if (apellido.length < 4) {\r\n alert(\"No ha escrito un apellido valido\");\r\n return;\r\n }\r\n\r\n var mail = document.getElementById('formMail').value;\r\n var expReg = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;\r\n var mailValido = expReg.test(mail)\r\n if (mailValido == false) {\r\n alert(\"No has escrito un mail valido\");\r\n return;\r\n }\r\n\r\n var text = document.getElementById('textAreaUno').value;\r\n if (text.length == 0) {\r\n alert(\"Ha escrito un mensaje muy corto o vacio\");\r\n return;\r\n }\r\n this.submit();\r\n}", "title": "" }, { "docid": "f13945ce87c0fadd2f55cdf2b03113c4", "score": "0.678127", "text": "function validaParte(){ \n \n\t valor = document.getElementById(\"titulo\").value;\n\t \tif (valor.length < 3) {\n\t\t\talert ('ERROR! Debe ingresar un título válido!');\n\t\t\treturn false;}\n\t\n\t\n if (document.getElementById(\"total_img\").value==0 && document.getElementById(\"fotoss\").value=='cambiar'){\n\t\t\talert ('ERROR! Debe tener al menos una foto!');\n\t\t\treturn false;} \n\t\t \n\t\t\n\t\tvalor = document.getElementById(\"descripcion\").value;\n\t\tif (valor.length < 3) {\n\t\t\talert ('ERROR! Debe ingresar una descripción!');\n\t\treturn false;}\n\t\t\n\t\t\n\t document.getElementById('enviar_todo').value= \"si\";\n\t document.registro.submit();\n\t}", "title": "" }, { "docid": "9bcbf420185c2101a1ae162a0d8ced94", "score": "0.678013", "text": "function validarFormPagoPaciente() {\n var correcto = true, msg = \"\";\n if ($('#modalPacienteRegistroPago').val() === \"\") {\n $('#modalPacienteRegistroPago').focus();\n msg = \"Coloque <b>Monto a pagar</b>\";\n correcto = false;\n } else if (isNaN($('#modalPacienteRegistroPago').val())) {\n $('#modalPacienteRegistroPago').focus();\n msg = \"Cantidad inválida\";\n correcto = false;\n } else if (parseFloat($('#modalPacienteRegistroPago').val()) <= 0) {\n $('#modalPacienteRegistroPago').focus();\n msg = \"El <b>Monto a pagar</b> es incorrecto\";\n correcto = false;\n } else if ($('#modalPacienteTipoPago').val() === \"-1\") {\n msg = \"Seleccione <b>Tipo de pago</b>\";\n correcto = false;\n } else if (parseFloat($('#modalPacienteRegistroPago').val()) > parseFloat($('#modalPacienteMontoActual').text())) {\n $('#modalPacienteRegistroPago').focus();\n msg = \"El <b>Monto a pagar</b> es superior al <b>Monto Actual</b>\";\n correcto = false;\n } else if (parseInt($('#modalPacienteTipoPago').val()) > 0 && parseInt($('#modalPacienteTipoPago').val()) !== 1 && $('#modalTxtReferenciaPago').val() === \"\") {\n $('#modalTxtReferenciaPago').focus();\n msg = \"Coloque <b>Referencia, Folio o Descripción</b>\";\n correcto = false;\n }\n\n if (!correcto) {\n MsgAlerta(\"Atención!\", msg, 3000, \"default\");\n }\n return correcto;\n}", "title": "" }, { "docid": "97b223e539d8a63e20a51699c12d5af6", "score": "0.67732644", "text": "function formvalidate(){\n var date=document.gform.day.value;\n var months=document.gform.month.value;\n var years=document.gform.year.value;\n var ind= document.gform.fname.value\n var gend= document.getElementsByName(\"gender\");\n\n if( date==\"\"||months==\"\"||years==\"\"||ind==\"\" ||gend==\"\"){\n alert( \"Please fill out all the fields in the form!\" );\n document.myForm.day.focus() ;\n return false;\n }\n \n else{\n return true ;\n }\n\n}", "title": "" }, { "docid": "56ff25aaebd4a46b6df4ed8e42d6441c", "score": "0.6772848", "text": "function valid_form(el, regex, error) {\n // récupérationd de la valeur\n let value = el.value\n // si la valeur récupérée n'est pas vide\n if(value !== '') {\n // si la valeur ne match pas la regex\n if(!value.match(regex)) {\n // message d'erreur\n error.innerHTML = 'Caractère incorrect'\n } else {\n // on efface le message d'erreur\n error.innerHTML = ''\n }\n } else {\n // message d'erreur\n error.innerHTML = 'Champs vide'\n }\n}", "title": "" }, { "docid": "8b3735052f885b37705bc68e68264342", "score": "0.67661476", "text": "function taskValidation(form) {\n \n if(form.name.value == '')\n {\n alert(\"Please Enter a Valid Task Name\");\n return false;\n }\n else if (form.date.value == '') \n {\n alert(\"Please Choose A Date\");\n return false\n } \n else if (form.desc.value == '') \n {\n alert(\"Please Add the Description\");\n return false\n } \n }", "title": "" }, { "docid": "b907b956719a5daff716e6b3a8400e24", "score": "0.6766118", "text": "function validateForm() {\n\t\tvar $form = $(\"#myform\");\n\t\t$form.removeData('validator');\n\t\tvar validator = $form.validate({\n\t\t\trules : {\t\t\t\t\t\n\t\t\t\ttxtcode : {\n\t\t\t\t\trequired : true,\n\t\t\t\t\tminlength: 8\n\t\t\t\t},\n\t\t\t\ttxtname : {\n\t\t\t\t\trequired : true,\n\t\t\t\t\tminlength: 8\n\t\t\t\t},\n\t\t\t\ttxtsex : {\n\t\t\t\t\trequired : true,\n\t\t\t\t\tminlength: 8\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tif ( validator.form() ){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "ad624654836d35231fa1409047993eb5", "score": "0.6762881", "text": "function validarNombreAndMarca(valor,mensaje,campoForm){\n if(valor == \"seleccione\"){\n toastr.error(mensaje);\n //document.getElementById(campoForm).value = \"\";\n return false; \n\t\t}else{\n return true; \n\t\t}\n }", "title": "" }, { "docid": "caa08b16f91af1e955b7ed842fdc25d6", "score": "0.67605585", "text": "isFormValid() {\n const fieldToMinLengthMapping = {\n first_name: 1,\n last_name: 1,\n username: 5,\n about: 3,\n };\n\n let errors = false;\n Object.keys(fieldToMinLengthMapping).forEach((field) => {\n const fieldLength = this.getFieldLength(field);\n const minLength = fieldToMinLengthMapping[field];\n if (getValidationState(fieldLength, minLength) === 'error') {\n const title = `${field.replace('_', ' ')} validation error`;\n const message = `This field must have atleast\n ${minLength} ${pluralize('character', minLength)}`;\n this.addNotification(title, message);\n errors = true;\n }\n });\n\n if (errors) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "1ac23ef60c755472edcae98edb8abf99", "score": "0.6758216", "text": "function validateForm() {\n var result = true;\n //(isNotEmpty (\"name\", \"Please enter a name.\")\n // && isChecked(\"color\", \"Please choose a color.\")\n // && isDate(\"id_start_date\", \"Enter a date as dd/mm/yyyy\")\n // && isStartTime(\"id_start_time\", \"Enter a start time as HH:MM\")\n // && isNumeric(\"id_lesson_count\", \"Enter the number of events in the series.\")\n // && isChecked(\"checkbox\", \"Please check at least one day\")\n //);\n if (result){\n loadData();\n }\n}", "title": "" }, { "docid": "777211a02ab38c53dd372cb6bb831149", "score": "0.675634", "text": "function validarFormularioVisualizacao (selector){\n\t\tvar valido = true;\n\t\tselector.each(function(){\n\t\t\tvalido = valido && validarCampo($(this));\n\t\t\tif($(this).attr(\"tipo\") == \"email\"){\n\t\t\t\tvalido = valido && validarCampoEmail($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"tipo\") == \"data\"){\n\t\t\t\tvalido = valido && validarCampoData($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"tipo\") == \"semespecial\"){\n\t\t\t\tvalido = valido && validarCampoCaracEspecial($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"maxlength\") != undefined){\n\t\t\t\tvalido = valido && validarQtdMaxCaracCampo($(this));\n\t\t\t}\n\t\t\tif($(this).attr(\"minlength\") != undefined){\n\t\t\t\tvalido = valido && validarQtdMinCaracCampo($(this));\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn valido;\n\t}", "title": "" }, { "docid": "32e79c084fd53e6151e93fd1af26168d", "score": "0.6754783", "text": "function validateForm() {\n var isValidEmail = validateEmail();\n var isValidPhone = validatePhone();\n var isValidMessage = validateMessage();\n return isValidEmail && isValidPhone && isValidMessage;\n }", "title": "" }, { "docid": "214c4ff588181df70e4529941a391b96", "score": "0.675283", "text": "function formIsValid() {\n return $scope.userInfo.email && $scope.userInfo.email !== '';\n }", "title": "" }, { "docid": "1ffc8f4ba6e04f98cc6ee0a6cbe22c3b", "score": "0.6751946", "text": "function validarFormPublicar(){\n\nvar nombreOferta;\n\nvar descripcionOferta;\n\nvar salarioOf;\n\nvar salarioConv;\n\nvar fechaCont;\n\nvar cantVac;\n\nvar provinciaOf;\n\nvar ciudadOf;\n\nvar area_select;\n\nvar subareasCand;\n\nvar jornadaOf;\n\nvar escolaridadOf;\n\nvar edadMinOf;\n\nvar edadMaxOf;\n\nvar select_array_idioma;\n\nvar anosexp;\n\nvar dispOf;\n\nvar licenciaOf;\n\nvar residenciaOf;\n\nvar discapacidadOf;\n\nvar confidencialOf;\n\nvar ofertaUrgenteOf\n\nvar primerEmpleoOf\n\n if($('#nombreOferta').length){\n\n nombreOferta = $('#nombreOferta');\n\n }\n\n if($('#descripcionOferta').length){\n\n descripcionOferta = $('#descripcionOferta');\n\n }\n\n if($('#salarioOf').length){\n\n salarioOf = $('#salarioOf');\n\n }\n\n if($('#salarioConv').length){\n\n salarioConv = $('#salarioConv');\n\n }\n\n if($('#fechaCont').length){\n\n fechaCont = $('#fechaCont');\n\n }\n\n if($('#cantVac').length){\n\n cantVac = $('#cantVac');\n\n }\n\n if($('#provinciaOf').length){\n\n provinciaOf = $('#provinciaOf');\n\n }\n\n if($('#ciudadOf').length){\n\n ciudadOf = $('#ciudadOf');\n\n }\n\n if($('#area_select').length){\n\n area_select = $('#area_select');\n\n }\n\n if($('#subareasCand').length){\n\n subareasCand = $('#subareasCand');\n\n }\n\n if($('#jornadaOf').length){\n\n jornadaOf = $('#jornadaOf');\n\n }\n\n if($('#escolaridadOf').length){\n\n escolaridadOf = $('#escolaridadOf');\n\n }\n\n if($('#edadMinOf').length){\n\n edadMinOf = $('#edadMinOf');\n\n }\n\n if($('#edadMaxOf').length){\n\n edadMaxOf = $('#edadMaxOf');\n\n }\n\n if($('#select_array_idioma').length){\n\n select_array_idioma = $('#select_array_idioma');\n\n }\n\n if($('#anosexp').length){\n\n anosexp = $('#anosexp');\n\n }\n\n if($('#dispOf').length){\n\n dispOf = $('#dispOf');\n\n }\n\n if($('#licenciaOf').length){\n\n licenciaOf = $('#licenciaOf');\n\n }\n\n if($('#residenciaOf').length){\n\n residenciaOf = $('#residenciaOf');\n\n }\n\n if($('#discapacidadOf').length){\n\n discapacidadOf = $('#discapacidadOf');\n\n }\n\n if($('#confidencialOf').length){\n\n if($('#confidencialOf').val() == 0){\n\n $('#confidencialOf').next().text(\"Su información se mostrará a los candidatos\");\n\n }\n\n else{\n\n $('#confidencialOf').next().text(\"Su información no se mostrará a los candidatos\");\n\n }\n\n confidencialOf = $('#confidencialOf');\n\n }\n\n if($('#ofertaUrgenteOf').length){\n\n ofertaUrgenteOf = $('#ofertaUrgenteOf');\n\n }\n\n if($('#primerEmpleoOf').length){\n\n primerEmpleoOf = $('#primerEmpleoOf');\n\n }\n\n\n\n // nombreOferta.on('blur', function(){\n\n // console.log(\"eder\");\n\n // })\n\n// ------------------------------------------------------------------\n\n var mensajes = \"\";\n\n if(nombreOferta.val() != \"\"){\n\n if(nombreOferta.val().length <= 250){\n\n if(!validarTituloEmpresa(nombreOferta.val())){\n\n crearMensajeError(nombreOferta, \"No se aceptan carac. especiales.\");\n\n mensajes += \"- Campo titulo: Escriba un título válido\";\n\n }\n\n else{\n\n eliminarMensajeError(nombreOferta);\n\n }\n\n }\n\n else{\n\n crearMensajeError(nombreOferta, \"Longitud máxima de caracteres 250.\");\n\n mensajes += \"- Campo titulo: Longitud máxima de caracteres 250\";\n\n }\n\n }\n\n else{\n\n crearMensajeError(nombreOferta, \"Rellene este campo.\");\n\n mensajes += \"- Campo título no puede ser vacío\";\n\n }\n\n// ------------------------------------------------------------------\n\n if($('#descripcionOferta').val() == \"\"){\n\n crearMensajeError(descripcionOferta, \"Rellene este campo\");\n\n mensajes += \"\\n- El campo descripción no puede ser vacío\";\n\n }\n\n else{\n\n eliminarMensajeError(descripcionOferta);\n\n }\n\n\n\n\n\n// ------------------------------------------------------------------\n\n if(salarioOf.val() != \"\"){\n\n var permitidosFloat = /^[0-9.]+$/;\n\n if(!validarFloat(salarioOf.val())){\n\n crearMensajeError(salarioOf, \"Formato incorrecto, 00.00\");\n\n mensajes += \"\\n-Campo salario: Ingrese un valor válido, 00.00\";\n\n }\n\n else{\n // if(salarioOf.val() <= 0){\n // crearMensajeError(salarioOf, \"Ingrese un valor válido. Min. $1\");\n // }\n // else{\n eliminarMensajeError(salarioOf);\n // }\n }\n\n }\n\n else{\n\n crearMensajeError(salarioOf, \"Rellene este campo\");\n\n mensajes += \"\\n-El campo salario no puede ser vacío\";\n\n }\n\n\n\n// ------------------------------------------------------------------\n\n if(salarioConv.val() == \"\"){\n\n crearMensajeError(salarioConv, \"Seleccione una opción\");\n\n mensajes += \"\\n-Campo salario a convenir: seleccione una opción\";\n\n }\n\n else{\n\n eliminarMensajeError(salarioConv);\n\n }\n\n// ------------------------------------------------------------------\n\n if(fechaCont.val() != \"\"){\n\n if(validarFecha(fechaCont.val())){\n\n if(!fechaMayor(fechaCont.val())){\n\n crearMensajeError(fechaCont, 'Ingrese una fecha válida (mayor a la actual)');\n\n mensajes += \"\\n- Campo fecha contratación: Ingrese una fecha mayor a la actual\";\n\n }\n\n else{\n\n eliminarMensajeError(fechaCont);\n\n }\n\n }\n\n else{\n\n crearMensajeError(fechaCont, \"Ingrese una fecha válida\");\n\n mensajes += \"\\n- Ingrese una fecha válida\"\n\n }\n\n }\n\n else{\n\n crearMensajeError(fechaCont, \"Rellene este campo\");\n\n mensajes += \"\\n- El campo fecha contratación no puede estar vacío\";\n\n }\n\n\n\n// ------------------------------------------------------------------\n\nif(cantVac.val() != \"\"){\n\n if(!validarVacante(cantVac.val())){\n\n crearMensajeError(cantVac, \"Superó número máximo de vacantes\");\n\n mensajes += \"\\n- Campo Cantidad vacante: Superó número máximo de vacantes\";\n\n }\n\n else{\n\n eliminarMensajeError(cantVac);\n\n }\n\n}\n\nelse{\n\n crearMensajeError(cantVac, \"Rellene este campo\");\n\n mensajes += \"\\n- El campo cantidad de vacantes no puede ser vacío\";\n\n}\n\n\n\n// ------------------------------------------------------------------\n\nif(provinciaOf.val() == \"\" || provinciaOf.val() == null){\n\n crearMensajeError(provinciaOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo provincia: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(provinciaOf);\n\n}\n\n\n\n// ------------------------------------------------------------------\n\nif(ciudadOf.val() == \"\" || ciudadOf.val() == null){\n\n crearMensajeError(ciudadOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo ciudad: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(ciudadOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(subareasCand.val() == \"\" || subareasCand.val() == null){\n\n crearMensajeError(subareasCand, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo subarea: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(subareasCand);\n\n}\n\n\n\n// ------------------------------------------------------------------\n\nif(jornadaOf.val() == \"\" || jornadaOf.val() == null){\n\n crearMensajeError(jornadaOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo jornada: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(jornadaOf);\n\n}\n\n\n\n// ------------------------------------------------------------------\n\nif(escolaridadOf.val() == \"\" || escolaridadOf.val() == null){\n\n crearMensajeError(escolaridadOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo escolaridad: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(escolaridadOf);\n\n}\n\n\n\n// ------------------------------------------------------------------\n\nif(edadMinOf.val() != \"\"){\n\n var edadmayor = parseInt($('#edadMaxOf').val());\n\n var edadmenor = parseInt($('#edadMinOf').val());\n\n if(edadmenor != \"\"){\n\n if(edadmenor >= 18 && edadmenor < 101){\n\n if($(edadmenor != \"\")){\n\n if(edadmenor > edadmayor){\n\n crearMensajeError($('#edadMaxOf'), \"Verifique la edad\");\n\n mensajes+= \"\\n- Verifique el campo Edad mínima\";\n\n }\n\n else{\n\n eliminarMensajeError($(edadMinOf));\n\n }\n\n }\n\n }\n\n else{\n\n crearMensajeError($(this), \"Mín: 18 años , Máx: 100 años\");\n\n mensajes+= \"\\n- Verifique el campo Edad mínima\";\n\n }\n\n }\n\n else{\n\n crearMensajeError($(this), \"Rellene este campo\");\n\n mensajes+= \"\\n- Verifique el campo Edad mínima\";\n\n }\n\n}\n\nelse{\n\n crearMensajeError(edadMinOf, \"Rellene este campo\");\n\n mensajes+= \"\\n- Verifique el campo Edad mínima\";\n\n}\n\n// // ------------------------------------------------------------------\n\nif(edadMaxOf.val() != \"\"){\n\n var edadmayor = parseInt($('#edadMaxOf').val());\n\n var edadmenor = parseInt($('#edadMinOf').val());\n\n if(edadmayor != \"\"){\n\n if(edadmayor >= 18 && edadmayor < 101){\n\n if($(edadmayor != \"\")){\n\n if(edadmenor > edadmayor){\n\n crearMensajeError($('#edadMaxOf'), \"Verifique la edad\");\n\n mensajes+= \"\\n- Verifique el campo Edad mayor\";\n\n }\n\n else{\n\n eliminarMensajeError($(edadMaxOf));\n\n }\n\n }\n\n }\n\n else{\n\n crearMensajeError($(this), \"Mín: 18 años , Máx: 100 años\");\n\n mensajes+= \"\\n- Verifique el campo Edad mayor\";\n\n }\n\n }\n\n else{\n\n crearMensajeError($(this), \"Rellene este campo\");\n\n mensajes+= \"\\n- Verifique el campo Edad mayor\";\n\n }\n\n}\n\nelse{\n\n crearMensajeError(edadMaxOf, \"Rellene este campo\");\n\n mensajes += \"\\n- Verifique el campo edad máxima\";\n\n}\n\n\n\n\n\nif(select_array_idioma.val() == \"\" || select_array_idioma.val() == null){\n\n crearMensajeError($('#listadoIdiomas'), \"Seleccione un idioma\");\n\n mensajes += \"\\n- Campo idioma: Seleccione al menos un idioma\";\n\n}\n\nelse{\n\n eliminarMensajeError($('#listadoIdiomas'));\n\n}\n\n//\n\n// descripcionOferta.on('blur', function(){\n\n// console.log(contenido);\n\n// })\n\n// ------------------------------------------------------------------\n\nif(anosexp.val() == \"\" || anosexp.val() == null){\n\n crearMensajeError(anosexp, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo años experiencia: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(anosexp);\n\n}\n\n// ------------------------------------------------------------------\n\nif(dispOf.val() == \"\" || dispOf.val() == null){\n\n crearMensajeError(dispOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo disponibilidad para viajar: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(dispOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(licenciaOf.val() == \"\" || licenciaOf.val() == null){\n\n crearMensajeError(licenciaOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo licencia: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(licenciaOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(residenciaOf.val() == \"\" || residenciaOf.val() == null){\n\n crearMensajeError(residenciaOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo cambio de residencia: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(residenciaOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(discapacidadOf.val() == \"\" || discapacidadOf.val() == null){\n\n crearMensajeError(discapacidadOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo discapacidad: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(discapacidadOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(confidencialOf.val() == \"\" || confidencialOf.val() == null){\n\n crearMensajeError(confidencialOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo confidencial: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(confidencialOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(ofertaUrgenteOf.val() == \"\" || ofertaUrgenteOf.val() == null){\n\n crearMensajeError(ofertaUrgenteOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo oferta urgente: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(ofertaUrgenteOf);\n\n}\n\n// ------------------------------------------------------------------\n\nif(primerEmpleoOf.val() == \"\" || primerEmpleoOf.val() == null){\n\n crearMensajeError(primerEmpleoOf, \"Seleccione una opción\");\n\n mensajes += \"\\n- Campo primer empleo: Seleccione una opción\";\n\n}\n\nelse{\n\n eliminarMensajeError(primerEmpleoOf);\n\n}\n\nif(mensajes != \"\"){\n\n mensajeErrorAlert(mensajes);\n\n}\n\n\n\n}", "title": "" } ]
708a76b0525580e1332e10c9a557e4bf
findUserTeam(query: JSON, params: JSON): [UserTeam!]
[ { "docid": "6923f0c7eeddbc20ec8dfb3b611b9b71", "score": "0.67662364", "text": "findUserTeam(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast, { query: { $sort: { teamId: 1, userId: 1 } } });\n return userTeams.find(feathersParams).then(paginate(content)).then(extractAllItems);\n }", "title": "" } ]
[ { "docid": "f57af87d38c5e2903a9661d1218109a3", "score": "0.6586591", "text": "async find (params) {\n const team = params.primary;\n assert(team && team.id, 'Team is not exists.');\n\n // Only invitations sent out by current user will be listed.\n const svcFeedsActivities = this.app.service('feeds/activities');\n return svcFeedsActivities.find({\n primary: `user:${params.user.id}`,\n query: {\n verb: 'team.invite',\n actor: `user:${params.user.id}`,\n object: `team:${team.id}`,\n state: 'PENDING',\n ...params.query\n }\n });\n }", "title": "" }, { "docid": "94e8b08d4dd95b9e907c80af5948fef9", "score": "0.64288324", "text": "static list(userId) {\n\t\treturn Team.find({ 'members': { $elemMatch: { 'userId': userId } } })\n\t\t\t.then((teams) => {\n\t\t\t\treturn teams;\n\t\t\t});\n\t}", "title": "" }, { "docid": "afa52c09d023667bedbf7aa56927e183", "score": "0.63283247", "text": "async function queryTeam(teamId) {\n const result = await query(\"queryTeam\",teamId);\n return result;\n}", "title": "" }, { "docid": "bdeae2740113347d14320ae128743b9e", "score": "0.6296439", "text": "async function getUserTeams(userName){\n const users = await User.findOne({where:{userName: userName}, include: Team });\n console.log(JSON.stringify(users.Teams.map(a=>a.teamName), null, 2));\n}", "title": "" }, { "docid": "fbedf021d37776f2a1b622090ca9aa1c", "score": "0.62153023", "text": "async find (params) {\n const team = params.primary;\n assert(team, 'Team is not exists');\n\n const groups = fp.map(fp.prop('id'), params.user.groups);\n const exists = fp.find(fp.idEquals(team.id), groups || []);\n if (!exists) {\n throw new Error('Only members of the team can get the activity feed.');\n }\n\n const svcFeedsActivities = this.app.service('feeds/activities');\n return svcFeedsActivities.find({\n ...params,\n primary: `team:${team.id}`\n });\n }", "title": "" }, { "docid": "0b1d45e49cc4f1e656d8e50b5750275b", "score": "0.6212437", "text": "function getMyTeams(req, res){\n Team.find({users: req.userid}, (err, teams)=>{\n if(err) return res.status(500).send({message: `Ha ocurrido un error al realizar la consulta ${err}`})\n if(!teams) return res.status(404).send({message: 'No existen equipos'})\n res.status(200).send({teams})\n })\n}", "title": "" }, { "docid": "33164ee1a676e92fe8f21a40a41658f5", "score": "0.6202011", "text": "findTeam(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast, { query: { $sort: { name: 1 } } });\n return teams.find(feathersParams).then(paginate(content)).then(extractAllItems);\n }", "title": "" }, { "docid": "985ddc4dab209fede531be86b0285397", "score": "0.6140497", "text": "async function getAllTeamMembers(req, res) {\n const { teamID } = req.params;\n console.log(teamID);\n try {\n const team = await teamsSchema_1.default.findOne({ _id: teamID });\n console.log('team', team);\n if (team) {\n const { members } = team;\n return res.status(200).json({\n message: `All members in ${team.teamName} team`,\n members: members,\n // team: team,\n });\n }\n }\n catch (err) {\n return res.status(400).json({\n error: err.message,\n });\n }\n}", "title": "" }, { "docid": "0f8bd894d9d2d726e4953a175addde5c", "score": "0.61062396", "text": "async getTeamByUserAndSeason(ctx) {\n await Model.team\n .findOne({ \n season: ctx.params.season,\n $or: [ { driver_a: ctx.params.user }, { driver_b: ctx.params.user } ] \n })\n .exec()\n .then(result => {\n if(result) { ctx.body = result; }\n else if(!result) { ctx.body = \"Team not found\"; }\n else { throw \"Error getting teams by user\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "4d8bc4a012e2fda1c32f3fa93fd147b0", "score": "0.6083095", "text": "async function getTeamUsers(teamName){\n const teams = await Team.findOne({where:{teamName: teamName}, include: User });\n console.log(JSON.stringify(teams.Users.map(a=>a.userName), null, 2));\n}", "title": "" }, { "docid": "efcdc286793b6f1d208862935b541d34", "score": "0.606823", "text": "getUserTeam(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return userTeams.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "d67763626499fca54e944ecba97fdbc5", "score": "0.6020224", "text": "async getTeammates() {\n const teammates = await this.monday.api(\"{users{name,id,email,photo_original}}\").then(res => {\n return res;\n });\n return teammates ? teammates[\"data\"][\"users\"] : [];\n }", "title": "" }, { "docid": "9b5a9b388358aa20f1686efadc856eb8", "score": "0.59780437", "text": "function getUserTeamList(req, res){\n var userTeams = [];\n dbTeam.teams.find({active:true}, function(err, docs){\n for(var x = 0; x < docs.length; x++){\n if(docs[x].members.map(function(e) { return e.username; }).indexOf(req.user.username) > -1){ //imp to note\n userTeams.push(docs[x].name);\n }\n }\n res.json(userTeams);\n });\n}", "title": "" }, { "docid": "52eb32e2d9e97a61874396d8f5c09337", "score": "0.59626216", "text": "function getTeamById() {\n return new Promise(function(resolve, reject) {\n // Ambil nilai query parameter (?id=)\n const 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(response => {\n if (response) {\n response.json().then(data => {\n generateTeam(data);\n // Kirim objek data hasil parsing json agar bisa disimpan ke indexed db\n resolve(data);\n });\n }\n });\n }\n\n fetch(base_url + \"teams/\" + idParam, {\n headers: {\n 'X-Auth-Token': auth_token\n },\n })\n .then(status)\n .then(json)\n .then(data => {\n generateTeam(data);\n // Kirim objek data hasil parsing json agar bisa disimpan ke indexed db\n resolve(data);\n });\n });\n}", "title": "" }, { "docid": "0e83c14a0a9eb9b31ae0e40dbd5e2179", "score": "0.5953723", "text": "async getTeamsByUser(ctx) {\n await Model.team\n .find({ $or: [ { driver_a: ctx.params.user }, { driver_b: ctx.params.user } ] })\n .populate('driver_a')\n .populate('driver_b')\n .exec()\n .then(result => {\n if(result.length > 0) { ctx.body = result; }\n else if(result.length == 0) { ctx.body = []; }\n else { throw \"Error getting teams by user\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "025766bc2a86b0dd7ef74fd3241cb8d3", "score": "0.5942157", "text": "function getUsersForTeam(req,res){\n db.admins.find({active:true, show:true},{name:1, username:1, _id:0},function(err, docs){\n res.json(docs);\n });\n}", "title": "" }, { "docid": "511f10c8d8224bef243a344a3d638ad9", "score": "0.59237194", "text": "async find (params) {\n params = { query: {}, ...params };\n const group = params.primary;\n assert(group && group.id, 'target group is not exists');\n params.query.groups = {\n $elemMatch: { group: group.id }\n };\n const svcUsers = this.app.service('users');\n return svcUsers.find(params);\n }", "title": "" }, { "docid": "13e9a951dcf91ee793985586785c2998", "score": "0.58850306", "text": "function getTeams(keyword) {\n return fetch(\n `https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${keyword}`\n )\n .then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json();\n })\n .then((response) => {\n if (response.Response === 'False') {\n throw new Error(response.Error);\n }\n return response.teams;\n });\n}", "title": "" }, { "docid": "ec079885ed3be1b72a32f1d19e6a2c88", "score": "0.58775914", "text": "static getTeamById(id) {\n return db.any(`select * from users inner join teams on users.teamid = teams.id where users.id = $1`, [id])\n .then(allUsers => {\n return allUsers[0].name;\n })\n }", "title": "" }, { "docid": "0f890f071dc2e980a4c19be4d7b5ae77", "score": "0.5856134", "text": "async function getTeamById(teamId) {\n // console.log(\"TEAM ID \"+teamId)\n var teams = await Team.findById(teamId);\n if (!teams) throw new HttpError(404, \"Team ressource not found\");\n return teams;\n}", "title": "" }, { "docid": "cf9d34bba2c76db38e1bcf28fecf8cbc", "score": "0.5855269", "text": "function getPlayers(team) {\r\n\r\n }", "title": "" }, { "docid": "44cfa0a75fa47a845a6cfa595dfdf859", "score": "0.5837614", "text": "teamList() {\n //list of teams the user is a member of\n let t = Team.find({ Members: Meteor.userId() });\n if (!t) {\n return [];\n }\n let lst = t.fetch();\n\n return lst;\n }", "title": "" }, { "docid": "4fbd94012166e6d5670dc58d21bca2bc", "score": "0.57924587", "text": "function getPlayerListByTeam(team) {\n const players = room.getPlayerList();\n\n const results = [[], [], []];\n\n players.forEach(p => results[p.team].push(p));\n\n return typeof team === `number` ? results[team] : results;\n}", "title": "" }, { "docid": "54f27effb0e51c0d61c2acfcd459cdc9", "score": "0.5746295", "text": "find(query) {\n return this.get(this.ACTIONS.FIND, ``, { params: query || {} });\n }", "title": "" }, { "docid": "8d0982f0025949daeb71a3e1289d490c", "score": "0.57331425", "text": "get_teams(force = false) {\n if (!force && this.teams) {\n return Promise.resolve(this.teams);\n }\n return this.api('get', 'teams').then(teams => {\n this.teams = teams;\n return teams;\n });\n }", "title": "" }, { "docid": "2ae5b7b2a684d6583b9dd9abcd8f1d46", "score": "0.57055724", "text": "async getTeamsBySeason(ctx) {\n await Model.team\n .find({ season: ctx.params.season })\n .populate('driver_a')\n .populate('driver_b')\n .exec()\n .then(result => {\n if(result.length > 0) { ctx.body = result; }\n else if(result.length == 0) { ctx.body = []; }\n else { throw \"Error getting teams by user\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "3158ea6788fed85075175cad6db1f69e", "score": "0.57033014", "text": "findOne(req, res) {\n return Team\n .findOne({\n where: {\n teamId : req.params.id\n }\n })\n .then(teams => res.status(201).send([teams]))\n .catch(error => res.status(400).send(error));\n }", "title": "" }, { "docid": "007b85c8d87a1c1e5c9a37a2bb7d2aba", "score": "0.56804115", "text": "async function selectEmployeesByTeamId(teamId) {\n const results = await query(`select * from employee where team_id = ${teamId}`)\n //console.log(rows)\n return results\n}", "title": "" }, { "docid": "4a2f8b4109b35b4b3491eb78cec6962d", "score": "0.5655742", "text": "getVideo(req, res) {\n const query = {\n user_id: req.body.id, // Recently Changed to Params\n };\n\n Video.find((query), (err, video) => {\n if (err) {\n res.status(500).json({\n status: 'error',\n message: err.message,\n });\n } else {\n res.status(200).json({\n status: 'success',\n data: {\n video,\n },\n });\n }\n });\n }", "title": "" }, { "docid": "a454ff4665f4381b12ced1be9571d361", "score": "0.5614703", "text": "async getAllTeams(ctx) {\n await Model.team\n .find({})\n .then(result => {\n if(result) { ctx.body = result; }\n else { throw \"No teams found\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "08db11ef9bfde8683f035eae29beb7cb", "score": "0.56110686", "text": "async findByUserName({query}) {\n if(query == undefined)\n return []\n else\n return User.find({\"user_name\": query});\n }", "title": "" }, { "docid": "80506e43b8cbd616e6d660b8b05d347c", "score": "0.5593722", "text": "getTeam(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return teams.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "a71dd5aa92900d7ce29446cd29665d7a", "score": "0.55910766", "text": "function queryHockeyTeams(type, query) {\n\tvar url = \"hockeyteams.xml?time=\" + new Date().getTime();\n\tvar req = getXmlHttpRequestObject();\n\n\t// Erase all hints\n\teraseAll(type);\n\t\n\t// Delete extra spaces entered by user.\n\tquery = jQuery.trim( query );\n\tif (debug) alert(\"Looking for: \" + query + \" of type: \" + type);\t\n\t\n\t// Open the request\n\treq.open(\"GET\", url, true);\n\n\t// Set the request processing function\n\treq.onreadystatechange=function() { searchTeams(req, type, query) };\n\n\t// Send the Request\n\treq.send(null);\n}", "title": "" }, { "docid": "ffc0379930ed7f6ea70ebb63a518de50", "score": "0.5584913", "text": "function searchTeams(req, type, query) {\n\t\n\t// If the request state had data to process.\n\tif (req.readyState == 4) {\n\t\t\n\t\t// If the request status is 'OK'\n\t\tif (req.status == 200) {\n\t\t\tvar xmlTree = req.responseXML;\n\t\t\tvar data = xmlTree.getElementsByTagName(\"team\");\n\t\t\tvar foundNode = false;\n\n\t\t\tif (type == \"team\") {\n\n\t\t\t\t// search on Team 'name' type.\n\t\t\t\ttype = \"name\";\n\t\t\t\t\n\t\t\t\t// Find the node searched for and display it\n\t\t\t\tfoundNode = searchByChildType(type, query, data);\n\t\t\t\tdisplayTeamCity(query, foundNode);\n\t\t\t} else if (type == \"city\") {\n\t\t\t\t\n\t\t\t\t// Find the node searched for and display it\n\t\t\t\tfoundNode = searchByChildType(type, query, data);\n\t\t\t\tdisplayTeamName(query, foundNode);\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Display error status.\n\t\t\t\talert(\"Unexpected query: \" + query);\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t// Display error status.\n\t\t\talert(\"Error Status Code: \" + req.status);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0406870dfd58694ce4e0eabe80af91eb", "score": "0.554463", "text": "fetchTeams({org}) {\n return this.getData({path:`/orgs/${org}/teams`})\n .then(response => {\n return response.data;\n });\n }", "title": "" }, { "docid": "1f769a173d43728737d6a9c8521d4400", "score": "0.5501495", "text": "getTeams(userId) {\n axios.get(`/getTeams/${userId}`)\n .then((results) => {\n this.setState({\n teams: results.data\n })\n })\n }", "title": "" }, { "docid": "aa07efb7f73ee0ea12af08cb2521a759", "score": "0.5495479", "text": "function getTSActiveTeams(userId) {\n\n if(!userId)\n {\n throw new Error('Error: Missing TeamSnap userId.');\n }\n \n\n var service = getTSAuthService_();\n if (!service.hasAccess()) {\n throw new Error('Error: Missing TeamSnap authorization.');\n }\n var url = 'https://apiv3.teamsnap.com/v3/teams/active?user_id=' + userId;\n var response = UrlFetchApp.fetch(url, {\n headers: {\n Authorization: 'Bearer ' + service.getAccessToken()\n }\n });\n var cJson = JSON.parse(response.getContentText());\n \n var teams = [];\n \n cJson.collection.items.forEach(function (di){\n \n teams.push({\"id\": findValueInCollectionJson(di, \"id\") , \"name\": findValueInCollectionJson(di, \"name\") });\n \n });\n \n \n return teams;\n}", "title": "" }, { "docid": "6257b66b5b0ce722a134479519f5a209", "score": "0.54945755", "text": "function getDataByUser(query, callback){\n\n var userToLookFor = query.name;\n\n data.find({name:userToLookFor}).toArray(function(error,data){\n if(!error){\n console.log(\"GOT DATA FOR: \"+userToLookFor);\n callback(null,data);\n }else{\n console.log(\"ERROR FINDING DATA FOR: \"+userToLookFor);\n callback(error, null);\n }\n });\n}", "title": "" }, { "docid": "63ca19563a41d16056bc6f34a8326a82", "score": "0.54800767", "text": "getListTeams() {\n return Http.get(API_ENDPOINT.GETLISTTEAM);\n }", "title": "" }, { "docid": "500e96909eb66b6b09ace29763d02da8", "score": "0.5473684", "text": "getGameListByTeam(team_id) {\n return this.http.get(gameUrl + '?teamid=' + team_id);\n }", "title": "" }, { "docid": "1ff6507dc5bbfa43c72581bac616ffec", "score": "0.5469693", "text": "getPlayersByTeamPromise(teamid){\n var parameters = {};\n parameters['teamid']=teamid;\n return this.GetPromise('/v3/soccer/scores/{format}/PlayersByTeam/{teamid}', parameters);\n }", "title": "" }, { "docid": "8759cde1ed49f7b4b2ab2531199fa967", "score": "0.54517233", "text": "static getProjectTeamByPId(id){\r\n return fetch(API_END_POINT+`project/team/${id}`, {\r\n method: 'GET'\r\n })\r\n }", "title": "" }, { "docid": "68299f9e5678b0603e09107a92692678", "score": "0.54503006", "text": "function doFind() {\n const found = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n\n console.log(found);\n}", "title": "" }, { "docid": "8d2d6dd6c8994a15342fc301ce33f68d", "score": "0.54468226", "text": "async findOne(params) {\n const usersauths = await this.ctx.model.UsersAuths.findOne(params);\n if (!usersauths) {\n this.ctx.throw(404, 'user not found');\n }\n return usersauths;\n }", "title": "" }, { "docid": "968ca9597ac6b1e5c8ca20010f1f0275", "score": "0.54371876", "text": "function getTeamListForTransfer(req,res){\n dbTeam.teams.find({active:true},{name:1, _id:0}, function(err, teamList){\n res.json(teamList);\n });\n}", "title": "" }, { "docid": "6d32d1eff7efb54dc38cd120abd5cd55", "score": "0.54365116", "text": "get(role = 'member', callback) {\n api.get(\n 'teams',\n { role },\n null,\n result.$createListener(callback)\n );\n }", "title": "" }, { "docid": "5188fd264d140ae91fa36f0300021a49", "score": "0.5435033", "text": "function GetPerson(params){\r\n for(i in people) {\r\n let person = people[i];\r\n if(person.id == params.id){\r\n return person;\r\n }\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "b57351a8bce163c6f9e4d70e1c005706", "score": "0.5423524", "text": "async function getCricketTeamByLeagueId(req,res){\n var league_id = req.param('teams_id');\n await config.query(\"select Cricket_Teams_Id as Team_Id, Cricket_Teams_Name as Team_Name, Cricket_Teams_Initials as Team_Initial, Cricket_Teams_Logo as Team_Logo, Cricket_League_Id as League_Id from Cricket_Teams where Cricket_League_id = ?\",[league_id], (err,rows,fields)=>{\n if(!err)\n {\n var contype = req.headers['content-type'];\n if (!contype || contype.indexOf('application/json') !== 0)\n {\n res.send('Invalid parameters');\n }\n else\n {\n res.setHeader('Content-Type', 'application/json');\n res.send(JSON.stringify(rows));\n }\n }\n else\n console.log(err);\n })\n }", "title": "" }, { "docid": "c895bbc00fa22c08eaaecac4a18f6ddb", "score": "0.5421595", "text": "function searchHockeyTeams(type, query) {\n\tvar postParams = \"time=\" + new Date().getTime();\n\tvar url = \"hockeyteams.xml\";\n\tvar req = getXmlHttpRequestObject();\n\n\t// Erase all hints\n\teraseAll(type);\n\n\t// Delete extra spaces entered by user.\n\tquery = jQuery.trim( query );\n\tif (debug) alert(\"Looking for: \" + query + \" of type: \" + type);\n\t\t\n\t// Open the request\n\treq.open(\"POST\", url, true);\n\n\t// Set the request processing function\n\treq.onreadystatechange=function() { searchTeams(req, type, query) };\n\n\t// Set the HTTP Request header to specify form data will be sent.\n\treq.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\n\t// Send the Request\n\treq.send(postParams);\n}", "title": "" }, { "docid": "596884b67e56b4505075afc428fb415d", "score": "0.54135823", "text": "static find( data ) {\n // Find a user by username [AND] password\n return User.findOne( data )\n .then( user => {\n return user;\n } );\n }", "title": "" }, { "docid": "42092b33fd7726dfe62ff489ee3c119a", "score": "0.54105365", "text": "find(query, by = \"name\", page = 0) {\n return http.get(`?${by}=${query}&page=${page}`);\n }", "title": "" }, { "docid": "7f04a2ab556ab4fbfb17fe5c5a60b1d4", "score": "0.54008234", "text": "getAllTeams(organization){\n var url = MainData.ballerinaGitHubURL + \"gitHub/getTeams?organization=\" + organization;\n \n return axios.get(\n url\n )\n .then(function (response) {\n \n return(response.data) ;\n \n })\n .catch(function (error) {\n return([{id:\" \",\"name\":\" \"}])\n });\n }", "title": "" }, { "docid": "1085520d5e22ba5759df0edc7bb25212", "score": "0.53952026", "text": "static async getUsers(params) {\n let cursor;\n let id = params.userid;\n if(id){\n try {\n cursor = await users.find({\"user_id\": id});\n } catch (e) {\n console.error('Unable to find specified user at id ' + id + \" \" + e);\n return { usersList: []}\n }\n } else {\n try {\n cursor = await users.find();\n } catch (e) {\n console.error('Unable to find users ' + e);\n return { usersList: []}\n }\n }\n\n try {\n const usersList = await cursor.toArray();\n return { usersList }\n } catch (e) {\n console.error('Unable to create recipesList for some reason ' + e);\n }\n }", "title": "" }, { "docid": "95c7469ec80b79831da964fbcc7fb107", "score": "0.5394449", "text": "function getApi(query) {\n console.log(\"query: \", query);\n return fetch(`https://api.github.com/search/users?q=${query}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((response) => response.json())\n .catch((error) => {\n throw error;\n });\n}", "title": "" }, { "docid": "8b270fa09637ea07be5684b0670efaf6", "score": "0.53934264", "text": "function queryTweets(tweets, player, team, query_params){\n var all_tweets = []\n var player_name = String(player).replace(/[^0-9a-z]/gi, '').toLowerCase();\n var team_name = String(team).replace(/[^0-9a-z]/gi, '').toLowerCase();\n\n for (var i = 0; i < tweets.statuses.length; i++) {\n var tweet = tweets.statuses[i];\n date_and_time = helper.getDateAndTime(tweet.created_at)\n tweet_dict = helper.array2Dict([query_params, player_name, team_name, tweet.id_str,\n tweet.user.screen_name, date_and_time[1], date_and_time[0], tweet.text, tweet.retweet_count, tweet.favorite_count])\n all_tweets.push(tweet_dict)\n }\n return all_tweets;\n}", "title": "" }, { "docid": "1432acf17225c70dcd7631f508daa08a", "score": "0.53835773", "text": "function findSomething() {\n nbaPlayers.find(player => player.name === 'Kevin Durant'); \n \n // output -> { name: 'Kevin Durant',number: 35, team: 'New Jersey Nets', style: 'Can do it all, All-Star' }, \n }", "title": "" }, { "docid": "a53e422fb724b4e21cb7ec64562f7b7c", "score": "0.5380624", "text": "function query(filterBy = '') {\n const games = HttpService.get('game', '', filterBy);\n return games\n}", "title": "" }, { "docid": "c6b242f601326964c09a78356768abdb", "score": "0.53768617", "text": "function findTeamsByName(name) {\n\t\tvar deferred = q.defer()\n\t\tTeam.findOne({ title: name }, function (err, team) {\n\t\t\tif (err) {\n\t\t\t\tdeferred.reject(err)\n\t\t\t} else {\n\t\t\t\tdeferred.resolve(team._id)\n\n\t\t\t}\n\t\t})\n\t\treturn deferred.promise;\n\t}", "title": "" }, { "docid": "9db74469d0b64776d15ba42b7d7edb97", "score": "0.5372183", "text": "async show(req, res) {\n try {\n const team = await Team.findById(req.params.id).populate(['owner','members','projects']);\n return res.json(team); \n } catch (error) {\n return res.status(400).send({ error: 'Error showing team'});\n }\n }", "title": "" }, { "docid": "c6107655dc178cd7ccc7982e1d4ff666", "score": "0.53653425", "text": "function getPeople(query){\n // this will use the query passed in, but if no query is passed in we're going to instead pass an empty object which will find all documents in the contactInfo (Person) collection\n Person.find(query || {}, (err, people)=>{\n if (err){\n console.log(\"couldn't find person\", err);\n }else{\n console.log(people)\n }\n })\n}", "title": "" }, { "docid": "c5a5b928e6441f4cbdd499fc3b2ddbc4", "score": "0.53545415", "text": "buildQuery () {\n\t\tif (!this.request.query.teamId) {\n\t\t\treturn this.errorHandler.error('parameterRequired', { info: 'teamId' });\n\t\t}\n\t\tlet query = {\n\t\t\tteamId: decodeURIComponent(this.request.query.teamId).toLowerCase()\n\t\t};\n\t\tif (this.request.query.ids) {\n\t\t\t// you can specify particular IDs, but they must all be from the same team\n\t\t\tlet ids = decodeURIComponent(this.request.query.ids).toLowerCase().split(',');\n\t\t\tquery.id = this.data.repos.inQuerySafe(ids);\n\t\t}\n\t\treturn query;\n\t}", "title": "" }, { "docid": "4f4573648169614b6c19b6da2fc9eaaa", "score": "0.5351156", "text": "function teams() {\r\n\t\t\treturn $http.get(HygieiaConfig.local ? testTeams : buildTeams)\r\n\t\t\t\t\t.then(function(response) {\r\n\t\t\t\t\t\treturn response.data;\r\n\t\t\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "c499d7e31e70699cc9f37fc71fb42d27", "score": "0.53465533", "text": "function isTeam(req, res, next) {\n const {id, name} = req.body\n Team.findOne({\n where: {\n name: name\n }\n })\n .then(team => {\n if (team) return res.status(404).send({msg: 'team exist in our db'})\n next()\n })\n .catch(next)\n}", "title": "" }, { "docid": "9f354abb276021bba669d1450f412aa8", "score": "0.5339318", "text": "static findByToken( token ) {\n return User.findByToken( token )\n .then( data => {\n return data;\n } );\n }", "title": "" }, { "docid": "f51ab46b4e70394631b042f97d033d72", "score": "0.5332942", "text": "async getTeamByName(ctx) {\n await Model.team\n .findOne({ name: ctx.params.name })\n .populate('driver_a')\n .populate('driver_b')\n .exec()\n .then(result => {\n if(result) { ctx.body = result; }\n else { throw \"Team not found\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "b7bd0068e8565e8ab99e212f1343b05d", "score": "0.53306997", "text": "static async get(params = {}){\n const characterId = parseInt(params.characterId);\n const comicId = parseInt(params.comicId);\n\n if(!characterId && !comicId) { throw new TypeError(\"A valid characterId or comicId must be passed in\") }\n if(characterId && comicId) { throw new TypeError(\"A characterId and comicId cannot both be passed in\") }\n\n let query;\n let project;\n\n if(characterId){\n query = { characterId: characterId };\n project = {characterId: true, _id: false};\n } else if(comicId){\n query = { comicId: comicId };\n project = {comicId: true, _id: false};\n }\n\n const results = await db.favorites().find(query, project).toArray()\n return results.length > 0 ? results[0] : {};\n }", "title": "" }, { "docid": "e9e5c94ba5ebb49b06a5ba82eeb6a115", "score": "0.5329839", "text": "listrequestedplayers(team_id){\n return this.knex.select().from('requests').where('team_id',team_id)\n .then((players)=>{\n return players;\n })\n .catch(err=>console.log(err));\n }", "title": "" }, { "docid": "5143c2cab8459f013d648a7434c1fa05", "score": "0.53170633", "text": "function getTeamsInLeague(leagueName) {\n\n //Given the passed leagueName, return all the teams in that league.\n // leagueName must be one of:\n // \"MLB\" - Mayor League Baseball (US).\n // \"NBA\" - National Basketball Association (US)\n // \"NFL\" - National Football League (US) \n // \"NHL\" - National Hockey League (US) \n\n //event.preventDefault(); // Prevent default form processing.\n\n var queryURL = \"https://www.thesportsdb.com/api/v1/json/1/search_all_teams.php?l=\" + leagueName;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n renderTeamsCallback(response);\n });\n\n}", "title": "" }, { "docid": "485a9208088613fcec798abf002401f8", "score": "0.5314075", "text": "async function getPlayersByTeam(team_id) {\r\n\r\n let player_ids_list = await getPlayerIdsByTeam(team_id);\r\n let players_info = await getPlayersInfo(player_ids_list);\r\n return players_info;\r\n}", "title": "" }, { "docid": "e75cb5388abcc0ebbb49122edad4ef47", "score": "0.53099656", "text": "function getTeamDetail(teamID) {\n return fetch(\n `https://www.thesportsdb.com/api/v1/json/1/lookupteam.php?id=${teamID}`\n )\n .then((response) => response.json())\n .then((team) => team.teams[0]);\n}", "title": "" }, { "docid": "57a38d67b9841e257d67b0e7a4b7b01a", "score": "0.53035635", "text": "find (filters) {\n let response = api.get(this.endpoints.find, { params: filters })\n return response\n }", "title": "" }, { "docid": "3f3e75f1fd2606b1aff4f7eeb3d8bb82", "score": "0.53019786", "text": "find(userLogin, callbackSuccess, callbackFailed){\n return new Promise((resolve, reject) => {\n\n db.query(\"SELECT * FROM users WHERE login = ? LIMIT 1\", [userLogin], (err, rows) => {\n if(err){\n return reject(err);\n }\n \n let user = null;\n\n if(rows.length > 0){\n user = User.Parse(rows[0]);\n } else {\n return reject(\"User not found\");\n }\n \n if(user !== null){\n return resolve(user);\n } else {\n return reject(\"User not found\");\n }\n });\n\n });\n }", "title": "" }, { "docid": "f5efd5cee0836afbc98b8288b8a5df1c", "score": "0.5294832", "text": "function findTeamsByNames(n1,n2) {\n\t\tvar status = {}\n\t\tvar deferred = q.defer()\n\t\tTeam.find({ title: { \"$in\": [n1, n2] }}, function (err, team) {\n\t\t\tif (err) {\n\t\t\t\tdeferred.reject(err)\n\t\t\t} else {\n\t\t\t\tdeferred.resolve(team)\n\n\t\t\t}\n\t\t})\n\t\treturn deferred.promise;\n\t}", "title": "" }, { "docid": "bcd27a152f42cf932fd01aa08788cebc", "score": "0.5284368", "text": "async get_teams(force = false) {\n if (!force && this.teams) {\n return this.teams;\n }\n this.teams = await this.api(\"get\", \"teams\");\n return this.teams;\n }", "title": "" }, { "docid": "53705cf6c3fdb383bba3343aef81aad3", "score": "0.52797836", "text": "getUsers() {\n const query = users.getUsers\n return new Promise((resolve, reject) => {\n client\n .query({\n query: query,\n })\n .then(data => {\n let users = data.data ? data.data.users : []\n resolve(clone(users))\n })\n .catch(err => reject(err))\n })\n }", "title": "" }, { "docid": "67ac592d682e89be161d113e01816c91", "score": "0.52616584", "text": "function teamListForTicket(req,res){\n var sendTeam = [];\n dbTeam.teams.find({active:true}, function(err, docs){\n for (var x = 0; x < docs.length;x++){\n var isLead = false;\n var members = [];\n var value = docs[x].name;\n var display = docs[x].name + \" (Leads: \";\n for(var y = 0; y < docs[x].leads.length; y++){\n if(docs[x].leads[y].username == req.user.username){\n isLead = true;\n members = docs[x].members;\n }\n if(y == docs[x].leads.length-1){\n display = display + docs[x].leads[y].name + \")\";\n }else{\n display = display + docs[x].leads[y].name + \", \";\n }\n }\n sendTeam[x] = {display:display, value:value, isLead:isLead, members:members};\n }\n res.json(sendTeam);\n });\n}", "title": "" }, { "docid": "5be04e0edbb47110be87e7df1c79c920", "score": "0.5256317", "text": "function getAll() {\n return teams;\n }", "title": "" }, { "docid": "1763a01f710c722e8a8ed5d67e1a9f7b", "score": "0.5254795", "text": "async function selectEmployeesBriefInfoByTeamId(teamId) {\n const results = await query(`select name,phone from employee where team_id = ${teamId}`)\n return results\n}", "title": "" }, { "docid": "775bef7bd04991a558be40cae80dcb01", "score": "0.52527773", "text": "apiUsersGetuserbynameGet$Json(params) {\n return this.apiUsersGetuserbynameGet$Json$Response(params).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"map\"])((r) => r.body));\n }", "title": "" }, { "docid": "9f0f3f6c2e39589c6fe4fa9e8a49f8e6", "score": "0.5252659", "text": "find(args){\r\n return new Promise((resolve, reject) => {\r\n this.connection.query(`SELECT * FROM ${this.name} WHERE ?`, args).then(result => {\r\n const results_array = new Array();\r\n result.forEach(r => {\r\n const stringified_result = JSON.stringify(r);\r\n results_array.push(JSON.parse(stringified_result));\r\n })\r\n resolve(results_array);\r\n }).catch(err => {\r\n return reject(err);\r\n })\r\n })\r\n }", "title": "" }, { "docid": "ba207eaf058583a5f63f17987ff26dbe", "score": "0.5248217", "text": "async function search(req){\r\n \r\n let player_name = req.query.name;\r\n let player_team = req.query.team_name;\r\n let player_position = req.query.position;\r\n let season_id = await league_utils.getCurrentSeason(); \r\n let playerList = await getAllLeaguePlayers(season_id);\r\n \r\n if(player_position || player_name || player_team){\r\n\r\n playerList = searchRelevantPlayers(playerList,player_name,player_team,player_position);\r\n \r\n }\r\n if(playerList.length === 0 ){\r\n return(\"no players\")\r\n }\r\n return playerList ;\r\n\r\n}", "title": "" }, { "docid": "6842b829134c9310968ddfe8d1417a70", "score": "0.52430147", "text": "async function getFriend(userParam) {\n let friendList = await userFactory.getFriend(userParam.accountId);\n return friendList;\n}", "title": "" }, { "docid": "35f8da7ebc31c3d684de2976baf7ab57", "score": "0.52386147", "text": "async getTeamByID(ctx) {\n await Model.team\n .findOne({ _id: ctx.params.id })\n .populate('driver_a')\n .populate('driver_b')\n .exec()\n .then(result => {\n if(result) { ctx.body = result; }\n else { throw \"Team not found\"; }\n })\n .catch(error => {\n throw new Error(error);\n });\n }", "title": "" }, { "docid": "394243396e7927449e799d44376d7df3", "score": "0.52342933", "text": "static async getTeams() {\n let response = await axios.get(`${BASE_URL}/api/teams`, {\n withCredentials: true,\n });\n\n return response.data.teams;\n }", "title": "" }, { "docid": "8131190f80f43e94a8d109307f50ced9", "score": "0.5231267", "text": "function findUser(req, res) {\r\n res.json(users[req.params.id]);\r\n}", "title": "" }, { "docid": "7280b5396c6fc040551dd68017db616d", "score": "0.5223566", "text": "async getGamesByUser(req, res) {\n try {\n const selectResult = await pool.query(\n 'SELECT game.gameId, field.fieldId, title, startDate, endDate, maxPlayers, maxTeamSize, qntMaxEquipment, description, equipmentType, field.name, field.address, field.city, field.state, field.site FROM game INNER JOIN attend ON game.gameId = attend.gameId INNER JOIN users ON users.userId = attend.userId INNER JOIN field ON field.fieldId = game.fieldId WHERE attend.userId = $1;',\n [req.userId]\n );\n\n return res.json(selectResult.rows);\n } catch (error) {\n return res.status(500).send({ error: 'Error' });\n }\n }", "title": "" }, { "docid": "407f67695f847e489b56e00fcbf1e99b", "score": "0.52158046", "text": "getRoster(teamId) {\n return this.get(`json/named.roster_40.bam?team_id=${teamId}`);\n }", "title": "" }, { "docid": "9d239e5adab388fc427f1e67435fc0cd", "score": "0.5197116", "text": "async function selectEmployeeByInfo(employeeInfo) {\n const results = await query(`select id,team_id from employee where phone = \\'${employeeInfo.phone}\\' and passwd = \\'${employeeInfo.passwd}\\'`)\n return results\n}", "title": "" }, { "docid": "95d58ec28dd786d99b5d5de638187530", "score": "0.51967514", "text": "function getTeamByName({org, name}) {\n return this.fetchTeams({org:org})\n .then(teams => {\n return teams.find(team => {\n return team.name == name\n })\n })\n}", "title": "" }, { "docid": "f240461341247dd6524bcea13130bf8d", "score": "0.5196731", "text": "function getById(id) {\n return new Promise(function (resolve, reject) {\n dbPromised\n .then(function (db) {\n const tx = db.transaction(\"teams\", \"readonly\");\n const store = tx.objectStore(\"teams\");\n return store.get(id);\n })\n .then(function (team) {\n resolve(team);\n })\n .catch(error => {\n reject(error);\n })\n });\n}", "title": "" }, { "docid": "61ddd4e8fe99f7ebce4483f3af5d5ab0", "score": "0.5192584", "text": "getMembershipsByTeamActivePromise(teamid){\n var parameters = {};\n parameters['teamid']=teamid;\n return this.GetPromise('/v3/soccer/scores/{format}/MembershipsByTeam/{teamid}', parameters);\n }", "title": "" }, { "docid": "3f4493ea9109f604f5bfcfa1592814e5", "score": "0.5190676", "text": "function fetchTeams() {\n return fetch(`${BASE_URL}/trainers`)\n .then(function(response) {\n return response.json()\n })\n}", "title": "" }, { "docid": "5bc47062a38160966f90a26dea585b4e", "score": "0.5186751", "text": "getAllTeams() {\n teamOutput = [];\n let teamData = this.state.teamFeed;\n teamOutput = teamData.filter(item => item);\n }", "title": "" }, { "docid": "2fd99c578c77684ed725b530566225b3", "score": "0.51793814", "text": "_find (params, getFilter = filterQuery) {\n const { query, filters } = getFilter(params.query || {});\n const map = _select(params);\n let values = _.values(this.store);\n\n if (this._matcher) {\n values = values.filter(this._matcher(query));\n } else {\n values = sift(query, values);\n }\n\n const total = values.length;\n\n if (filters.$sort) {\n values.sort(this._sorter(filters.$sort));\n }\n\n if (filters.$skip) {\n values = values.slice(filters.$skip);\n }\n\n if (typeof filters.$limit !== 'undefined') {\n values = values.slice(0, filters.$limit);\n }\n\n return Promise.resolve({\n total,\n limit: filters.$limit,\n skip: filters.$skip || 0,\n data: map(values)\n });\n }", "title": "" }, { "docid": "f7114c9f9826708c2cf3968d2427fc4e", "score": "0.51781243", "text": "apiUsersGetuserbynameGet$Json$Response(params) {\n const rb = new _request_builder__WEBPACK_IMPORTED_MODULE_3__[\"RequestBuilder\"](this.rootUrl, UsersService.ApiUsersGetuserbynameGetPath, 'get');\n if (params) {\n rb.query('user', params.user, {});\n }\n return this.http.request(rb.build({\n responseType: 'json',\n accept: 'text/json'\n })).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"filter\"])((r) => r instanceof _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpResponse\"]), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_4__[\"map\"])((r) => {\n return r;\n }));\n }", "title": "" }, { "docid": "43fd09553b0d535864e82daa33fe9a7f", "score": "0.51767373", "text": "static async getUser({\n userName = \"jasonthany\",\n userEmail = \"[email protected]\",\n userPassword = \"Password123\",\n } = {}) {\n let query\n query = {\n $and:\n [\n { \"user_name\" : { $eq : userName } },\n { \"email\" : { $eq : userEmail } },\n { \"password\" : { $eq : userPassword } },\n ]\n }\n\n let cursor\n try {\n cursor = await users.findOne(query)\n } catch (e) {\n console.error(`Unable to issue find command, ${e}`)\n return { }\n }\n\n try {\n return { cursor }\n } catch (e) {\n console.error(`Unable to convert to array or problem counting documents, ${e}`)\n return { }\n }\n }", "title": "" }, { "docid": "bf1b60210d3fd1024da590583a742306", "score": "0.51744944", "text": "static searchUsers(query) {\n \n }", "title": "" }, { "docid": "5e9de9f6b562b677bff7478791fd3f12", "score": "0.51684403", "text": "getUsersById({ params }, res) {\n Users.findOne({ _id: params.id })\n .populate({ path: 'thoughts', select: '-__v' })\n .populate({ path: 'friends', select: '-__v' })\n .select('-__v')\n .then(dbUsersData => {\n if (!dbUsersData) {\n res.status(404).json({ message: 'No User with this particular ID!' });\n return;\n }\n res.json(dbUsersData)\n })\n .catch(err => {\n console.log(err);\n res.status(400).json(err)\n })\n }", "title": "" }, { "docid": "7dbb5d6fac7cdcc73cd77df6d1c98a02", "score": "0.516591", "text": "function findUser2(req, res) {\r\n if(!users.hasOwnProperty(req.params.id)) {\r\n res.send(404);\r\n }\r\n else {\r\n res.json(users[req.params.id]);\r\n }\r\n}", "title": "" }, { "docid": "5dcdda8613c266304649ab963ec5bfd4", "score": "0.51658964", "text": "static read(id) {\n\t\treturn Team.findById(id)\n\t\t\t.then((team) => {\n\t\t\t\treturn team;\n\t\t\t});\n\t}", "title": "" } ]
bb67fe2fc6721b43e6aca22255ce3ea6
when a part upload success, update the Parts property of cacheData
[ { "docid": "cbea51c3cf034949eac239f4d0ea689a", "score": "0.6548702", "text": "updateParts({ uuid, partNumber, etag }) {\n const { Parts } = this.cacheData[uuid].process;\n const index = Parts.findIndex(item => item.partNumber === partNumber);\n if (index > -1) {\n Parts.splice(index, 1, { partNumber, etag });\n } else {\n Parts.push({ partNumber, etag });\n }\n }", "title": "" } ]
[ { "docid": "c37a48f3777322065254fa7aa1c5ae9e", "score": "0.6262295", "text": "async multipartListPart({ uuid }) {\n if (\n this.cacheData[uuid].process.Parts\n && this.cacheData[uuid].process.Parts.length\n ) {\n return;\n }\n const { Bucket, Region, Key } = this.cacheData[uuid].object;\n const { UploadId } = this.cacheData[uuid].process;\n const Part = [];\n const params = {\n Bucket,\n Region,\n Key,\n UploadId,\n };\n while (true) {\n const {\n Part: SomePart = [],\n NextPartNumberMarker,\n IsTruncated,\n } = await this.cosSdkInstance.multipartListPartRetry({\n ...params,\n });\n Part.push(...SomePart);\n if (IsTruncated === 'true') {\n params.PartNumberMarker = NextPartNumberMarker;\n } else {\n break;\n }\n }\n this.cacheData[uuid].process.Parts = Part.map(({ PartNumber, ETag }) => ({\n partNumber: parseInt(PartNumber, 10),\n etag: ETag,\n }));\n }", "title": "" }, { "docid": "f9c964e4e03141e9a2e8fc74d2244f29", "score": "0.61434376", "text": "update() {\n this.parts.forEach((part) => {\n part.update();\n })\n }", "title": "" }, { "docid": "4e95dc79717f9a31d3e7cd1b8d4ba506", "score": "0.6013887", "text": "changePartTo(part) { \n return this.updateAndCopy({ part: part });\n }", "title": "" }, { "docid": "6eac95bb669b7fcfb3e0c1a33b3576dc", "score": "0.58855724", "text": "async multipartInit({ uuid }) {\n if (this.cacheData[uuid].process.UploadId) {\n return;\n }\n const { Bucket, Region, Key, ContentLength, ...multipartInitParams } = this.cacheData[uuid].object;\n if (this.mode === 'NEW_UPLOAD_ID_ONLY') {\n const { UploadId } = await this.cosSdkInstance.multipartInitRetry({\n Bucket,\n Region,\n Key,\n ...multipartInitParams,\n });\n this.cacheData[uuid].process.UploadId = UploadId;\n } else {\n const { Upload = [] } = await this.cosSdkInstance.multipartListRetry({\n Bucket,\n Region,\n Prefix: Key,\n });\n const uploadIds = Upload.filter(item => item.Key === Key).map(item => item.UploadId);\n if (uploadIds.length) {\n this.cacheData[uuid].process.UploadId = uploadIds[0];\n } else {\n const { UploadId } = await this.cosSdkInstance.multipartInitRetry({\n Bucket,\n Region,\n Key,\n ...multipartInitParams,\n });\n this.cacheData[uuid].process.UploadId = UploadId;\n }\n }\n this.cacheData[uuid].process.Parts = [];\n }", "title": "" }, { "docid": "c6698d79cc031db7f171b7039c382366", "score": "0.5872199", "text": "completeMultiUpload() {\n var self = this;\n var outputTag = [];\n /*\n here we are constructing the Etag data in the required format.\n */\n self.etag.forEach((data, index) => {\n const obj = {\n ETag: data,\n PartNumber: ++index\n };\n outputTag.push(obj);\n });\n\n var params = {\n Bucket: 'ankurself', // required\n Key: self.filename, // required\n UploadId: self.uploadId, // required\n MultipartUpload: {\n Parts: outputTag\n }\n };\n\n self.s3.completeMultipartUpload(params, function(err, data) {\n if (err) {\n console.log(err, err.stack);\n } // an error occurred\n else {\n self.saveVideoURL(data.Location);\n // initialize variable back to normal\n self.etag = [];\n self.recordedChunks = [];\n self.uploadId = '';\n self.booleanStop = false;\n // self.disableAllButton();\n // self.removeLoader();\n alert('we have successfully saved the questionaire..');\n }\n });\n }", "title": "" }, { "docid": "387de963145ab37408b6eecf73a6178a", "score": "0.55581975", "text": "partLoaded(part) {\n this.partsLoaded++;\n if (this.partsLoaded == this.partCount) {\n console.log(\"all \" + this.partCount + \" parts of \" + this.name + \" loaded\")\n this.fullyLoaded();\n }\n }", "title": "" }, { "docid": "19ee8dc98af7d13c65ce4347327d9a2d", "score": "0.5527625", "text": "cacheFile(data) {\n \n this.setData({ cpbooks: data })\n }", "title": "" }, { "docid": "4c7e34b5c8be23ac42ed71d2b8f8a87e", "score": "0.54756576", "text": "function updatePartPosition(data) {\n for (let id_part in data) {\n let element = $('[data-id_recipe_part=' + id_part + ']');\n element.removeClass('recipe-part-item-' + element.data('position'))\n element.data('position', data[id_part])\n element.attr('data-position', data[id_part])\n element.addClass('recipe-part-item-' + element.data('position'))\n }\n}", "title": "" }, { "docid": "4fee8e14a146ec063f451eb285d388b4", "score": "0.54351115", "text": "finishUploadImages(file) {\n let fileResponse = file.xhr.response;\n let fileResult = JSON.parse(fileResponse);\n this.coursePictures.push({\n id: fileResult.file_id,\n file_name: fileResult.file_name,\n path_to_file: fileResult.path_to_file\n });\n\n this.uploadImages = 0;\n }", "title": "" }, { "docid": "6c0c59996512401e0b5df67a1b4b9e41", "score": "0.54345924", "text": "function uploadModifiedProduct(product) {\n service.product = $.extend({}, product);\n setModifiedProductProperties();\n var firstPhoto = new Image();\n firstPhoto.onload = function () {\n service.product.main_photo_width = this.width;\n service.product.main_photo_height = this.height;\n uploadData(); // Need to wait for the image to be loaded because only then it's possible to get the main photo's width and height.\n };\n firstPhoto.src = URL.createObjectURL(service.product.photos[0]);\n }", "title": "" }, { "docid": "762496f1bddcc6d7d2e7c7ae10ad2042", "score": "0.5398199", "text": "continueMultiUpload(audioBlob, PartNumber, uploadId, key, bucketName) {\n var self = this;\n var params = {\n Body: audioBlob,\n Bucket: 'ankurself',\n Key: key,\n PartNumber: PartNumber,\n UploadId: uploadId\n };\n console.log(params);\n self.s3.uploadPart(params, function(err, data) {\n if (err) {\n console.log(err, err.stack);\n } // an error occurred\n else {\n /*\n Once the part of data is uploaded we get an Entity tag for the uploaded object(ETag).\n which is used later when we complete our multipart upload.\n */\n self.etag.push(data.ETag);\n if (self.booleanStop == true) {\n self.completeMultiUpload();\n }\n }\n });\n }", "title": "" }, { "docid": "f4cf7933652fed841b7bc9b564bdf26c", "score": "0.5371822", "text": "uploadProgress(file, progress, bytesSent) {\n if (file.type == \"application/pdf\" || \n file.type == \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" \n || file.type == \"image/jpeg\" || file.type == \"image/png\" || \n file.type == \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" \n || file.type == \"application/vnd.ms-excel\" && file.size <= 10000000) {\n console.log(\"File Upload Progress\", progress);\n this.tempAttachments.map(attachment => {\n if (attachment.title === file.name) {\n attachment.progress = `${Math.floor(progress)}`;\n }\n });\n }\n }", "title": "" }, { "docid": "6f7250a27613ff4f0faa2df76a42692b", "score": "0.5330032", "text": "updateData(result) {\n const data = result.data;\n this.setState({data: data});\n for(let i = 0; i < data.length; i++){\n let filename = data[i].additional_files;\n filename = filename.split(',')[1];\n\n //Find and check if image has been uploaded\n let found = false;\n let j = 0;\n while(!found && j < this.state.img.length){\n if(filename == this.state.img[j].fileName){\n found = true;\n let slice = new SliceModel(\n data[i].dataset_name, data[i].info, this.state.img[j].imageUrl, \n data[i].start_e, data[i].start_n, data[i].end_e, data[i].end_n, \n data[i].start_depth, data[i].end_depth, data[i].related_links);\n slices.push(slice);\n }\n j++;\n }\n }\n \n this.setState({\n slices: slices,\n })\n }", "title": "" }, { "docid": "fe37ff37e7dee17baa95b0cde5de3d31", "score": "0.53140336", "text": "updateParts(data) {\n this.targets = data;\n this.remove();\n }", "title": "" }, { "docid": "ee380d3dbf4e09cfee6a6220db1b6a8b", "score": "0.5273817", "text": "function incParts(res,store,keys,index,size)\n{\n\tdata = JSON.parse(store[keys[index]]);\n\t_id = new ObjectID(keys[index]);\n\t//Update the current part's amount checked out\n\tdb.collection('inventory').update({_id:_id},{$inc:{amountCheckedOut:parseInt(data.amountToCheckOut,10)}}).then(function(result){\n\t\t//Once we have looped through actually add the checkOut data to the checkout collection\n\t\tif(size==index)\n\t\t{\n\t\t\tdb.collection('checkOut').insert(store).then(function(){\n\t\t\t\t\tres.end();\n\t\t\t\t}).catch(function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t}\n\t\t//More parts need to have the amount checked out incremented\n\t\telse\n\t\t{\n\t\t\t\tindex = index + 1;\n\t\t\t\tincParts(res,store,keys,index,size);\n\t\t}\n\t}).catch(function(error) {\n\t\t\tconsole.log(error);\n\t\t});\n}", "title": "" }, { "docid": "902584f070c5c24de27509ddc0eae885", "score": "0.5262582", "text": "increase_is_part() {\n this.isPart_count ++;\n }", "title": "" }, { "docid": "fbb96654bd464270b9faad1ccdf7d284", "score": "0.5249254", "text": "onFileUploadSucess() {\n this.loadDatasets(function() {\n this.postDatasetFetch();\n }.bind(this));\n }", "title": "" }, { "docid": "6aa1942c1012da555d1bac2d85064dff", "score": "0.52490634", "text": "function success(){\n if($scope.files.length > 0){\n\n var ultimoArchivoSubido = $scope.files[0];\n salvarEnStorage(ultimoArchivoSubido);\n $scope.files.splice(0, 1);\n $timeout(function(){$scope.uploadFileInBlocks();}, 2000); \n }\n }", "title": "" }, { "docid": "f6e10dcec361c198e62b56d2f4a0f678", "score": "0.52169067", "text": "function setProductPhotos() {\n ProductPhotos.downloadPhotos($scope.product);\n for (var i = 0; i < ProductPhotos.photosNum($scope.product); i++) {\n $scope.productPhotosStatus.push(\"loading\");\n $scope.photosURLs.push($rootScope.DEFAULT_PRODUCT_PHOTO_URL);\n }\n $scope.$on('downloaded-photo-' + $scope.product.id, function (event, args) {\n var data = args.data;\n var index = data.photoIndex - 1;\n if (args.success) {\n $scope.photosURLs[index] = data.url;\n $scope.productPhotosStatus[index] = \"doneLoading\";\n if (!$scope.firstPhotoSelected) {\n $scope.selectPhoto(0);\n $scope.firstPhotoSelected = true;\n }\n $scope.$apply();\n } else {\n console.log(\"Photos number \" + data.photoIndex + \" failed to download: \\n\" + data.message);\n $scope.productPhotosStatus[index] = \"failed\";\n }\n });\n }", "title": "" }, { "docid": "342533c7a06f4f9a6cef50e94649797a", "score": "0.5210684", "text": "async upload(partNumber, offset) {\n debug('upload(partNumber=%d, offset=%d): %s', partNumber, offset, this.source.key)\n\n const { partSize, parts } = this\n const { contentLength } = this.source\n const { s3 } = this.session\n const range = { start: 0, end: offset + partSize }\n\n if (offset > 0) {\n range.start = offset + 1\n }\n\n if (contentLength < offset + partSize) {\n range.end = contentLength - 1\n }\n\n const params = {\n CopySourceRange: `bytes=${range.start}-${range.end}`,\n CopySource: `${this.source.bucket}/${this.source.key}`,\n PartNumber: partNumber,\n UploadId: this.id,\n Bucket: this.destination.bucket,\n Key: this.destination.key,\n }\n\n this.dispatch.push(async (next) => {\n let { retries } = this.session.config\n\n try {\n if (this.session.aborted) {\n throw new SESSION_ABORTED_ERR()\n }\n\n const part = await uploadPartCopy()\n\n this.progress = Math.floor(100 * (1 - (this.pending / this.total)))\n\n if (0 === this.pending--) {\n this.pending = 0\n this.progress = 100\n const res = await this.complete()\n }\n\n part.upload = this\n return next(null, part)\n } catch (err) {\n debug(err)\n return next(err)\n }\n\n async function uploadPartCopy() {\n try {\n debug('uploadPartCopy(%j)', params)\n const res = await s3.uploadPartCopy(params).promise()\n const part = new Part(partNumber, res.ETag)\n parts[partNumber - 1] = part\n return part\n } catch (err) {\n debug(err)\n\n if (--retries) {\n return uploadPartCopy()\n } else {\n throw err\n }\n }\n }\n })\n }", "title": "" }, { "docid": "162e5b0e7fdd6ddf16b1c4d3b630eb9e", "score": "0.5205961", "text": "doneHost(e, data, self) {\n self.get('notify').success(self.get('i18n').t('notify.fileUploaded'));\n\n // Push the created photo in the store, then add the photo in the host\n let normalizedPhoto = self.get('store').normalize('photo', data.result.photo);\n self.get('store').push(normalizedPhoto);\n self.get('model').reload();\n }", "title": "" }, { "docid": "587e5d9986ba93d0a32215415b5a5d09", "score": "0.5199775", "text": "checkPart({ uuid, partNumber }) {\n const { Parts } = this.cacheData[uuid].process;\n const item = Parts.find(item => item.partNumber === partNumber);\n return item && item.etag;\n }", "title": "" }, { "docid": "b59c9f2343cfb33640f647358e5057ae", "score": "0.5173023", "text": "function updateImages(){ queue = Data.images.get() }", "title": "" }, { "docid": "3d5cfa14a75a09b3274c6308d7baaa75", "score": "0.51720434", "text": "function updateUploading(entry) {\n $.ajax({\n url: ConfigStore.apiLocation + \"entries/\" + entry.id,\n method: \"GET\"\n })\n .done(entry => {\n let processing = false;\n entry.components.forEach(comp => {\n processing = !!comp.data.processing || processing;\n })\n //recheck for updates\n if(processing) setTimeout(updateUploading.bind(null, entry), 400);\n //Always show updates\n dispatcher.dispatch({\n type: constants.UPDATE_ENTRY,\n entry, id: entry.id\n });\n })\n}", "title": "" }, { "docid": "09cfc8d5c0949f33bbe7fe653ec9f836", "score": "0.5143334", "text": "_update(data = this.data, onReady = null) {\n this.inProgress = true\n this.data = data\n // always overwrite onReady with latest function - to avoid race conditions\n this.onReady = onReady\n\n this.updateLayers(data)\n this.updateImages(data)\n this.updateTilesets(data)\n\n // this should trigger only if there is no loading images or all images come from cache\n if (this.toLoad === this.loaded) {\n this._onReady()\n }\n }", "title": "" }, { "docid": "c1dfe2765abb087c7adcda967d6267d9", "score": "0.5137219", "text": "_onCompleteUpload(){\n // reload device\n this._listDevice() ;\n\n }", "title": "" }, { "docid": "fe46941d23d8bfd95c3db0276f126463", "score": "0.5133053", "text": "uploadSaved(original) {\r\n this.state.selected.forEach(i => {\r\n const imgString = this.state.savedGlitches[i];\r\n const imgFile = base64ToImage(imgString);\r\n const formData = new FormData();\r\n formData.append('image', imgFile);\r\n formData.append('original', original);\r\n fetch('/api/image/glitch', {\r\n method: 'POST',\r\n body: formData\r\n })\r\n .then(response => {\r\n if (!response.ok) {\r\n throw new Error(response.status_text);\r\n } else {\r\n const newSaved = this.state.savedGlitches;\r\n newSaved.splice(i);\r\n this.setState({ savedGlitches: newSaved });\r\n this.setState({ saveLoading: false });\r\n }\r\n })\r\n .catch(err => console.log(err));\r\n });\r\n }", "title": "" }, { "docid": "f85e6f9f307a0080c5dd7416b2f72e4e", "score": "0.5128534", "text": "function refreshFileEntry() {\n getFiles()\n .then(files => {\n window.fileList = files;\n })\n\n .done(function() { \n $('.entry-wrapper').load(' .art-entry');\n })\n}", "title": "" }, { "docid": "6579316fb343201a51af0cd781df62bc", "score": "0.51210815", "text": "function cacheOrderData(context, complete, modules) {\n\n console.log(\"***INSIDE CACHERORDERDATA***\");\n\n const dataStore = modules.dataStore();\n const cacheCollection = dataStore.collection('ordercache');\n\n\n\n function getCollectionData(collectionName) {\n // if we want to just pull Active records, we can uncomment these two lines\n //const query = new modules.Query();\n //query.equalTo('Active', 'true');\n const collection = dataStore.collection(collectionName);\n\n return new Promise((resolve, reject) => {\n console.log(`finding ${collectionName}`);\n collection.find(null, (err, result) => {\n if (err) {\n return reject(err);\n }\n\n console.log(`found ${collectionName}`);\n\n return resolve(result);\n });\n });\n }\n\n const promise = Promise.props({\n // pull both orderheader records and order detail records\n //\n orderheader: getCollectionData('orderheader'),\n orderdetail: getCollectionData('orderdetail')\n });\n\n\n promise.then((results) => {\n // create a mapping where the OrderID and OrderDeviceID are indexes into the array, for fast\n // retireval of the records when joining with the header records\n //\n const detailsMap = {};\n\n for (var i = 0, len = results.orderdetail.length; i < len; i++) {\n if (!detailsMap[results.orderdetail[i].OrderID + results.orderdetail[i].OrderDeviceID]) {\n\n\n detailsMap[results.orderdetail[i].OrderID + results.orderdetail[i].OrderDeviceID] = [];\n }\n detailsMap[results.orderdetail[i].OrderID + results.orderdetail[i].OrderDeviceID].push(results.orderdetail[i]);\n }\n\n for (var j = 0, len = results.orderheader.length; j < len; j++) {\n\n if (detailsMap[results.orderheader[j].OrderID + results.orderheader[j].DeviceID]) {\n\n results.orderheader[j].OrderDetails = detailsMap[results.orderheader[j].OrderID + results.orderheader[j].DeviceID];\n }\n }\n console.log(results.orderheader);\n console.log(results.orderheader.length);\n\n function saveme(entity, doneCallback) {\n // persist the joined records back to the ordercache collection\n //\n cacheCollection.save(entity, (err, savedResult) => {\n\n if (err) {\n console.log('******ERROR*****');\n console.log(err);\n return doneCallback(err);\n } else {\n return doneCallback();\n }\n });\n\n };\n\n \n async.eachLimit(results.orderheader, 5, saveme, (err) => { \n\n if (err) {\n console.log('error writing');\n console.log(err);\n return complete().setBody(err).runtimeError().done();\n } else {\n console.log(\"complete\");\n return complete().setBody().ok().done();\n }\n });\n }).catch((error) => {\n console.log('final catch');\n console.log(error);\n complete(error).runtimeError().done();\n });\n }", "title": "" }, { "docid": "5ec813514d020ef461a838567ddc3d6b", "score": "0.5115316", "text": "async complete() {\n if (this.session.aborted) {\n throw new SESSION_ABORTED_ERR()\n }\n\n const { s3 } = this.session\n const params = {\n MultipartUpload: { Parts: this.parts.map((part) => part.toJSON()) },\n UploadId: this.id,\n Bucket: this.bucket,\n Key: this.key\n }\n\n return s3.completeMultipartUpload(params).promise()\n }", "title": "" }, { "docid": "64cd9446019181d5ff5c307d2f04ccb2", "score": "0.5103636", "text": "function fetchUpload() {\n}", "title": "" }, { "docid": "69197510093c2caaa4c7f35a7f255ce7", "score": "0.5090853", "text": "onUploadSuccess(files) {\n const args = { action: 'Upload', result: files };\n this.trigger('success', args);\n this.itemData = [Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"])(this.pathId[this.pathId.length - 1], this.feParent)];\n read(this, pathChanged, this.path);\n this.onFileUploadSuccess({ count: 1 });\n if (typeof Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"])('onSuccess', this.uploadEventArgs.ajaxSettings) === 'function') {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"getValue\"])('onSuccess', this.uploadEventArgs.ajaxSettings)();\n }\n }", "title": "" }, { "docid": "7b81ea432eaaa6797c8d2bbe44114651", "score": "0.5070737", "text": "function updateProduct() {\n formDataUd.append('prname', $('#pr-name-ud').val());\n formDataUd.append('total', $('#total-pr-ud').val());\n formDataUd.append('importprice', covertToString($('#import-price-ud').val()));\n formDataUd.append('price', covertToString( $('#sale-price-ud').val()));\n formDataUd.append('oldprice', covertToString($('#pr-oldprice-ud').val()));\n\n formDataUd.append('mnday', $('#mn-day-ud').val());\n formDataUd.append('expirydate', $('#ex-day-ud').val());\n formDataUd.append('lineprid', parseInt($('#sl-lnpr-ud').val()));\n\n if (listFileUd.length > 0) {\n for (var i = 0; i < listFileUd.length; i++) {\n formDataUd.append(\"files\", listFileUd[i]);\n }\n }\n if (listFileUdOld.length > 0) {\n for (var j = 0; j < listFileUdOld.length; j++) {\n formDataUd.append(\"filesolds\", JSON.stringify(listFileUdOld[j]));\n }\n }\n $.ajax({\n type: \"POST\",\n url: 'https://localhost:44337/api/file/UpdateProduct',\n data: formDataUd,\n processData: false,\n contentType: false,\n cache: false,\n enctype: 'multipart/form-data',\n success: function (data) {\n $('#myModal-ud').modal('toggle');\n bootbox.alert(\"Update item success!\");\n callAjax(tp.get, \"products/GetByLine?id=\" + lnid, null, bindingPdtByLine);s\n },\n error: function (err) {\n bootbox.alert(\"Error: \" + err);\n }\n });\n}", "title": "" }, { "docid": "15757f05a5e263ecedcd1914186468e8", "score": "0.50689954", "text": "queueDespatchNext() {\n //So something failed so stop uploading\n if(this.queue.failed > 0) {\n return;\n }\n\n //queue is stopped\n if(!this.queue.start) {\n return;\n }\n\n var despatching = this.queue.last + 1;\n\n //No parts left\n if (despatching > this.numParts) {\n //No active parts\n if(this.queue.active === 0) {\n this.completeMultipartUpload();\n }\n \n return;\n }\n\n //Info on what's being uploaded\n var blob = this.queue.blobs[despatching];\n var curBlobPart = this.file.slice(blob.start, blob.end);\n\n //New Chunk objects\n var newChunk = new S3BlobChunk(this, despatching, blob, curBlobPart);\n\n //Add the chunk for reference\n this.queue.blobs[despatching].chunk = newChunk;\n this.queue.last = despatching;\n\n //Up the count\n this.queue.active += 1;\n\n //start it\n newChunk.start();\n\n //Send another part if not completely active\n if(this.queue.active < this.opts.simultaneous) {\n this.queueDespatchNext();\n }\n }", "title": "" }, { "docid": "f462f8a956baddd1ed5cfb0b722b8101", "score": "0.5061975", "text": "function addParts() {\n parts++;\n updateText();\n}", "title": "" }, { "docid": "d5e8a5d74d315e5756abdcce03e6fef2", "score": "0.5053743", "text": "finishUploadVideos(file) {\n let fileResponse = file.xhr.response;\n let fileResult = JSON.parse(fileResponse);\n this.courseVideos.push({\n id: fileResult.file_id,\n file_name: fileResult.file_name,\n path_to_file: fileResult.path_to_file\n });\n\n this.uploadVideos = 0;\n }", "title": "" }, { "docid": "faa4165b9591ff09a0e9832feb5afe4a", "score": "0.50244987", "text": "function updateStorage() {\n \n }", "title": "" }, { "docid": "5e228e42016622ca758bf0831a09a618", "score": "0.5010151", "text": "function fileSuccess(file, message)\n {\n // Iterate through the media list, find the one we\n // are added as a temp and replace its data\n // Normally you would parse the message and extract\n // the uploaded file data from it\n angular.forEach(vm.product.images, function (media, index)\n {\n if ( media.id === file.uniqueIdentifier )\n {\n // Normally you would update the media item\n // from database but we are cheating here!\n var fileReader = new FileReader();\n fileReader.readAsDataURL(media.file.file);\n fileReader.onload = function (event)\n {\n\n var c = document.getElementById(\"wmCanvas\");\n var ctx = c.getContext(\"2d\");\n\n var sourceImg = new Image();\n\n sourceImg.src = event.target.result;\n\n sourceImg.onload = function () {\n\n c.width = sourceImg.width;\n c.height = sourceImg.height;\n\n ctx.drawImage(sourceImg, 0, 0, c.width, c.height);\n\n ctx.globalAlpha = 0.5;\n\n var wmImg = document.getElementById(\"wmImg\");\n\n var wmSize = Math.max(c.width , c.height) * 0.10;\n\n ctx.drawImage(wmImg, (c.width/2 )- (wmSize/2), (c.height/2)-(wmSize/2), wmSize,wmSize);\n\n var dataURL = c.toDataURL();\n\n media.url = dataURL;\n\n }\n\n };\n\n // Update the image type so the overlay can go away\n media.type = 'image';\n\n\n }\n });\n }", "title": "" }, { "docid": "cd5db0c1a7ba7273dd8d174c6a3f8504", "score": "0.49970472", "text": "uploadSuccess() {\n\n if (this.listErr.length != 0) {\n\n this.showLoadingProgress(false);\n this.refs['popup'].getWrappedInstance().show(this.listErr[0]);\n return;\n }\n\n // tien hanh update\n const data = {\n RegID: this.state.RegID, \n RegCode: this.state.RegCode,\n ImageInfo: this.listId.join(',')\n };\n \n api.updateRegistrationImage(data, (isSuccess, data, msg) => {\n\n this.showLoadingProgress(false);\n \n if (isSuccess) {\n // Lay callback tu nativgation\n // const refreshData = this.props.navigation.getParam('refreshData');\n\n // Callback refresh data\n // refreshData && refreshData();\n\n // Tro ve trang details customer\n setTimeout(() => {\n this.props.navigation.goBack();\n }, 500);\n \n return;\n } else {\n this.refs['popup'].getWrappedInstance().show(msg.message);\n }\n });\n }", "title": "" }, { "docid": "b2c3d558214e7c5bb2a62b2f773dacb8", "score": "0.4988326", "text": "function updateDetails(details){\n details.currentPackage++;\n var fileDetails = setFile(self.fileId,details.fileId,details.token,details.currentPackage);\n \n\t\t\tsetDetails(fileDetails);\n }", "title": "" }, { "docid": "1a279a2b8e9cab079a9742fbd4248317", "score": "0.49722892", "text": "onChunkUploadSuccess(event) {\n if (event.target.status === 200) {\n\n this.uploaded += Math.min(this.statics.CHUNK_SIZE, this.size - this.uploaded);\n if (this.uploaded === this.size) {\n const response = JSON.parse(event.target.responseText);\n\n if (!response.error) {\n this.finalizeUpload(response);\n }\n else {\n this.setUploadError(response.error[0], 200);\n }\n\n }\n else {\n if(typeof this.onProgress === \"function\") {\n this.onProgress('Uploading', (this.uploaded / this.size), FileUploader.msToHumanDuration(((this.size - this.uploaded) / this.statics.CHUNK_SIZE) * ((new Date()).getTime() - this.timeStamp)));\n }\n else {\n console.log('Uploading '+((this.uploaded / this.size) * 100).toFixed(0));\n }\n this.uploadNextChunk();\n }\n }\n else {\n this.setUploadError(event.target.responseText, event.target.status);\n }\n }", "title": "" }, { "docid": "c9167943bdcdfd6a5e50f9d7b981c19f", "score": "0.49636075", "text": "fetch() {\n this.project =\n JSON.parse(localStorage.getItem(this.localStorage_key)) || [];\n this.bus.trigger(\"collectionUpdated\");\n }", "title": "" }, { "docid": "9f9089c05899111f40e959f3c5217613", "score": "0.49632347", "text": "async init() {\n const { destination, session, source } = this\n const params = { Bucket: destination.bucket, Key: destination.key }\n let { partSize } = this\n const { s3 } = session\n\n if (session.aborted) {\n throw new SESSION_ABORTED_ERR()\n }\n\n let partNumber = 0\n const context = await s3.createMultipartUpload(params).promise()\n\n await source.ready()\n await destination.ready()\n\n let total = Math.floor(source.contentLength / partSize)\n\n if (total > MAX_PARTS) {\n partSize = computePartSize(source.contentLength)\n // recompute\n total = Math.ceil(source.contentLength / partSize) - 1\n }\n\n this.partSize = partSize\n this.pending = total\n this.bucket = context.Bucket\n this.total = total\n this.key = context.Key\n this.id = context.UploadId\n\n for (let offset = 0; offset < source.contentLength; offset += partSize) {\n this.upload(++partNumber, offset)\n }\n }", "title": "" }, { "docid": "7e009c7391f38c00f2f4fa464ebf9635", "score": "0.49547288", "text": "function uploadDone () {}", "title": "" }, { "docid": "ad6db9a284400fdc8a09787e80db0423", "score": "0.4946428", "text": "function update_data(data,access_token) {\n \n return new Promise((resolve, reject) => {\n\n var dbx = new Dropbox({ accessToken: access_token }); \n var content = [JSON.stringify(data,null,'\\t')];\n\n update = new File(content, 'db.json', {type: 'text/json;charset=utf-8'}); \n dbx.filesUpload({path: '/' + update.name, \n contents: update,\n mode:'overwrite'})\n .then(function(response) {\n resolve(response);\n })\n .catch(function(error) {\n console.error(error);\n reject(error);\n });\n });\n}", "title": "" }, { "docid": "c3e67be10bbfe92f0912a1290a62cb80", "score": "0.4941466", "text": "push(slice) {\n // Do sanity checks of the slice - if something is weird we abort the transfer.\n // This could be replaced with progressive hashing.\n var hash = md5(slice.data);\n console.log(\"hash: \" + hash);\n if (slice.data == null || slice.datahash != hash) {\n console.log(\"Something wrong with a slice of data for file: \" + this.id + \" - Aborting.\")\n console.log(\"Slice hash: \" + slice.datahash + \" Calculated hash: \" + hash)\n this.endUpload(false);\n return -1;\n }\n\n //this.data.push(slice.data);\n this.data[slice.sliceID] = slice.data;\n this.slices++;\n\n console.log(\"id: \" + this.id + \" slices: \" + this.slices + \" sliceSize: \" + this.sliceSize)\n\n if (this.slices * this.sliceSize <= this.size) {\n console.log(\"requesting next slice\");\n this.requestNextSlice();\n } else {\n //File upload is finished!\n this.mongoID = new mongoose.Types.ObjectId();\n this.endUpload(true);\n this.saveFile();\n this.broadcastMessageToRoom();\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "d192104c65c9a97628a4ee321de43a12", "score": "0.49365136", "text": "function uploadChunk() {\n\tvar blob = document.getElementById(\"fileToUploadID\").files[0];\t\t\t\t\t\n\tif (blob) {\n\t\tif ( chunkPropObj.getChunkEnd() == 0 ) {\n\t\t\tchunkPropObj.setChunkStart(0);\n\t\t\tchunkPropObj.setChunkEnd(filePropObj.getFileBlock());\n\t\t}\n\n\t\tvar chunk = false;\n\t\tif ( blob.slice ) {\n\t\t\tchunk = blob.slice(chunkPropObj.getChunkStart(), filePropObj.getFileBlock());\t ///only few browser support this\n\t\t} else if ( blob.mozSlice ) {\n\t\t\tchunk = blob.mozSlice(chunkPropObj.getChunkStart(), chunkPropObj.getChunkEnd());\n\t\t} else if ( blob.webkitSlice) {\n\t\t\tchunk = blob.webkitSlice(chunkPropObj.getChunkStart(), chunkPropObj.getChunkEnd());\n\t\t} else {\n\t\t\talert(\"No support\");\n\t\t\treturn false;\n\t\t}\n\n\t\txhrReq.create();\n\t\tvar xhrobj = xhrReq.getRequest();\n\n\t\txhrobj.open(\"POST\", \"/account/upload/doUpload/\", \"true\");\t\t\t\t\n\t\tvar fd = new FormData();\n\t\tfd.append(\"file\", chunk);\n\t\tfd.append(\"chunk\", chunkPropObj.getChunkPosition());\n\t\tfd.append(\"chunks\", filePropObj.getFileChunks());\n\t\tfd.append(\"name\", filePropObj.getFileUploadTime()+filePropObj.getFileName());\n\t\tfd.append(\"uploaderType\", 1);\n\t\txhrobj.send(fd);\t\t\t\n\t}\n}", "title": "" }, { "docid": "8a273c08f6936215e5191331faca6253", "score": "0.49329358", "text": "updateUpload(uploadInfo, completed=false, failed=false){\n var stateToSet = {};\n if (completed){\n stateToSet.uploadStatus = 'Upload complete';\n stateToSet.upload = null;\n stateToSet.file = null;\n this.finishRoundTwo();\n this.setState(stateToSet);\n }else if(failed){\n var destination = this.state.keyComplete[this.state.currKey];\n var payload = JSON.stringify({ 'status':'upload failed' });\n // set status to upload failed for the file\n ajax.promise(destination, 'PATCH', {}, payload).then((data) => {\n // doesn't really matter what response is\n stateToSet.uploadStatus = 'Upload failed';\n stateToSet.upload = null;\n this.setState(stateToSet);\n });\n }else{ // must be the initial run\n // Calculate the md5sum for the file held in state and save it to the md5\n // field of the current key's context (this can only be a file due to the\n // submission process). Resets file and md5Progess in state after running.\n var file = this.state.file;\n // md5 calculation should ONLY occur when current type is file\n if(file === null) return;\n getLargeMD5(file, this.modifyMD5Progess).then((hash) => {\n // perform async patch to set md5sum field of the file\n var destination = this.state.keyComplete[this.state.currKey];\n var payload = JSON.stringify({ 'md5sum': hash });\n ajax.promise(destination, 'PATCH', {}, payload).then((data) => {\n if(data.status && data.status == 'success'){\n console.info('HASH SET TO:', hash, 'FOR', destination);\n stateToSet.upload = uploadInfo;\n stateToSet.md5Progress = null;\n stateToSet.uploadStatus = null;\n this.setState(stateToSet);\n }else if(data.status && data.title && data.status == 'error' && data.title == 'Conflict'){\n // md5 key conflict\n stateToSet.uploadStatus = 'MD5 conflicts with another file';\n stateToSet.md5Progress = null;\n this.setState(stateToSet);\n }else{\n // error setting md5\n stateToSet.uploadStatus = 'MD5 calculation error';\n stateToSet.md5Progress = null;\n this.setState(stateToSet);\n }\n });\n\n }).catch((error) => {\n stateToSet.uploadStatus = 'MD5 calculation error';\n stateToSet.file = null;\n stateToSet.md5Progress = null;\n this.setState(stateToSet);\n });\n }\n }", "title": "" }, { "docid": "c06e6d951b592e0a8adfb6f0f880c4f1", "score": "0.49317855", "text": "function processItem(item) {\n if (item) {\n //asset name from the file name to compare it with the allowedFiles\n assetName = item.filename.substring(0, item.filename.lastIndexOf(\".\"));\n //check if we if the entry has a valid name\n if (allowedFiles.indexOf(assetName) !== -1) {\n //get the entry blob content\n item.getData(new ZipJS.BlobWriter(), function f1852(blob) {\n\n files._getAssetName(blob, item.filename, function f1853(SHA1, originalFileName, blobContent) {\n //original file name without extension\n var noExtOriginalFileName = originalFileName.substring(0, originalFileName.lastIndexOf(\".\"));\n var creativeWrapperId = SHA1.replace(/\\..*/, '');\n //set to repo the file type (look at allowedFiles for availible types)\n repo.updatePropertyObject(record.id, 'creativeWrapper', creativeWrapperId, {\n type: noExtOriginalFileName,\n path: null\n });\n\n var updateRepoAfterUpload = function f1854(uploadResponse ) {\n\n // take only the relative path for the uploded file, drop the /publishers/XX/course/YYY\n var filePath = \"/media/\" + uploadResponse.filePath.split(\"/media/\")[1];\n var fileSha1 = creativeWrapperId;\n\n //if we doesn't update the repo object with the SHA1 index as key we log it as error (not a real ERROR!!!)\n\n if (!record.data.creativeWrapper[fileSha1]) {\n logger.error(logger.category.GENERAL, 'Can\\'t set creative wrapper,' + fileSha1 + ' not exists');\n }\n\n //get the relative course path (without the filesystem://.../persistent/);\n var obj = require('cgsUtil').cloneObject(record.data.creativeWrapper[fileSha1]);\n obj.path = filePath;\n repo.updatePropertyObject(record.id, 'creativeWrapper', fileSha1, obj);\n\n //if the asset name is thumbnail update the view with the image\n if (record.data.creativeWrapper[fileSha1] && record.data.creativeWrapper[fileSha1].type === 'thumbnail') {\n var editor = repo_controllers.get(record.id);\n if (editor && editor.view && typeof editor.view.update_wrapper_thumbnail == 'function') {\n editor.view.update_wrapper_thumbnail(record.data.creativeWrapper[fileSha1].path);\n }\n }\n\n //reverse the object from\n\n /*\n object[SHA1] = { type: *, path: * }\n\n to:\n\n object[type] = path;\n */\n repo.updatePropertyObject(record.id, 'creativeWrapper', record.data.creativeWrapper[fileSha1].type, record.data.creativeWrapper[fileSha1].path);\n\n //delete the old pointer from the repo\n repo.deletePropertyObject(record.id, 'creativeWrapper', fileSha1);\n\n processItem(entries.shift());\n\n }.bind(creativeWrapperId);\n\n //save the blob content as real file\n assets.uploadImageBlob(blobContent, updateRepoAfterUpload);\n });\n })\n }\n else {\n processItem(entries.shift());\n }\n }\n else {\n busy.stop();\n repo.endTransaction();\n if (typeof callback == 'function') callback();\n }\n }", "title": "" }, { "docid": "09a96524105b1d0f7348bf3123e2b641", "score": "0.49284822", "text": "function postInitialize() {\n return umbRequestHelper.postMultiPartRequest(\n Umbraco.Sys.ServerVariables[\"articulate\"][\"articulateImportBaseUrl\"] + \"PostInitialize\",\n //something needs to be here (dummy data)\n { key: \"temp\", value: \"nothing\" },\n function (data, formData) {\n //assign the file data to the request\n formData.append(file.name, file);\n }).then(\n function (data, status, headers, config) {\n vm.status = \"Please wait... Importing \" + data.data.count + \" blog posts...\";\n return $q.resolve(data.data.tempFile);\n },\n function (data, status, headers, config) {\n return $q.reject('Failed to initialize');\n });\n }", "title": "" }, { "docid": "0f5cfe385f296c21576b99f1c6536fe8", "score": "0.49033937", "text": "function onSuccessItem(response) {\n if ($scope.picFile && $scope.comment) {\n vm.fileSelected = false;\n vm.progress = 0;\n var fileAttached = {\n fileURL: response.pathFile,\n mimetype: $scope.picFile.type,\n origFileName: $scope.picFile.name,\n weight: $scope.picFile.size,\n height: $scope.picFile.$ngfHeight,\n width: $scope.picFile.$ngfWidth\n };\n\n threadPost = {\n content: {\n fileAttached: fileAttached,\n comment: $scope.comment\n },\n specialID: vm.thread.getSpecialID(true, vm.thread.number),\n isOP: true,\n name: $scope.name\n };\n vm.thread = Object.assign(vm.thread, threadPost);\n }\n // Create a new post, or update the current instance\n vm.thread.createOrUpdate()\n .then(successCallback)\n .catch(errorCallback);\n }", "title": "" }, { "docid": "ae6df9b65910b29f868b0aad52876428", "score": "0.4884006", "text": "updateHandler(index, value) {\n let lines = this.state.lines;\n let translated = this.state.translated;\n let i = -1;\n for (let t of translated) {\n if (t.index === index) {\n i = index;\n }\n }\n if (i != -1) {\n translated[i].content = value;\n } else {\n translated.push({ index: translated.length, content: value });\n }\n\n lines[index][\"line_translation\"] = value;\n this.numOfTranslation += 1;\n this.uploadTranslation.push({ line_at: index, translation: value });\n\n this.setState({\n translated: translated,\n lines: lines\n });\n // Do the uploading\n if (this.numOfTranslation > 0) {\n this.setState({ isloaded: false });\n this.setState({ msg: \"Saving...\", isloaded: true });\n $.post(\n settings.getURL(\"update/translation\"),\n {\n userID: this.state.userID,\n sid: this.state.songInfo.sid,\n data: JSON.stringify(this.uploadTranslation)\n },\n data => {\n this.setState({ msg: \"All changes have been saved\", isloaded: true });\n console.log(\"Updated\");\n }\n ).fail(() => {\n this.setState({ msg: \"Error uploading translation\" });\n });\n this.numOfTranslation = 0;\n this.uploadTranslation = [];\n }\n }", "title": "" }, { "docid": "69405ce83aac27bad5c66cc6c98ed1aa", "score": "0.48838386", "text": "function getFilesUploaded() {\n var data = null; // Data as reponse to the call.\n var dataNew = null;\n // This call to service returns the media object, which consists the file data.\n commonServices.getAllMedia(ticketId).then(function(fileData) {\n var x = fileData.ticketsiteIdsList[6]\n if (typeof x != 'undefined') {\n $scope.poTicketID = '';\n $scope.poTicketID = x[0];\n data = fileData.allMedia[6]; // 4 is the stage number, to get the files for a particular stage.\n displayMedia(data);\n } else {\n data = fileData.allMedia[6]; // 4 is the stage number, to get the files for a particular stage.\n displayMedia(data); // Call the function which prepares the final data.\n\n }\n $scope.$broadcast(\"poTicketID\");\n\n }).catch(function(error) {\n console.log('error fetching files');\n });\n }", "title": "" }, { "docid": "b340a6b0ea8d9f906d287a9ffbbea8b9", "score": "0.4879845", "text": "function updateCache() {\n BookingSvc.getRoomData($scope.booking.roomId, {date:$scope.booking.start}, function() {\n $timeout(validate)\n });\n }", "title": "" }, { "docid": "6cb48f47c04a9388e82701311e0387f9", "score": "0.48764783", "text": "function onPhotoURISucPart(imageURI)\n{\n\n // alert('onPhotoURISuccess'+imageURI);\n var userId = localStorage.getItem(\"userId\");\n var siteName = localStorage.getItem(\"siteName\");\n\n /** File upload code */\n window.resolveLocalFileSystemURL(imageURI, function (fileEntry) {\n\n fileEntry.file(function (fileObj) {\n //1 megabyte (Mb) = 1024 kb = 1,048,576 bytes\n\n if (fileObj.size < 5242880) // size should be less then 5 mb\n {\n\n var fileName = fileObj.localURL;\n var options = new FileUploadOptions();\n options.fileKey = \"ReferenceName\";\n\n var file_Name = fileName.substr(fileName.lastIndexOf('/') + 1);\n\n\n\n options.fileName = file_Name;\n options.mimeType = fileObj.type;\n options.chunkedMode = false;\n\n var privateStatus = localStorage.getItem(\"PrivatePic\");\n\n\n var ft = new FileTransfer();\n\n var fullURL = siteName + \"/wp-content/plugins/dsp_dating/m1/dspUploadPartnerPic.php?user_id=\" + userId + \"&private=\" + privateStatus;\n // alert(fullURL);\n ft.upload(fileName, fullURL, uploadPartSuccess, uploadFail, options);\n }\n else\n {\n var alertText = get_tranalation_by_code(\"DSP_UPLOAD_IMAGE_SIZE_ERROR\");\n alertText = alertText || 'Image size should be less then 5 MB!';\n navigator.notification.alert(\n alertText,\n null,\n null,\n 'ok'\n );\n }\n });\n });\n}", "title": "" }, { "docid": "72776eb056965a29e39ca61d8601232d", "score": "0.485736", "text": "resetAttachments() {\n this.$scope.$storage.submission.attachments = [];\n this.submission.attachments = this.$scope.$storage.submission.attachments;\n }", "title": "" }, { "docid": "7666541364b9eef418cdd36980643244", "score": "0.4856186", "text": "function newPart() {\n var partId = parts.length + 1,\n partFileName = path.resolve(path.join(mpu.tmpDir, 'mpu-' + this.objectName + '-' + random_seed() + '-' + (mpu.uploadId || Date.now()) + '-' + partId)),\n partFile = !mpu.noDisk && fs.createWriteStream(partFileName),\n part = {\n id: partId,\n stream: partFile,\n fileName: partFileName,\n length: 0,\n data: ''\n };\n\n parts.push(part);\n return part;\n }", "title": "" }, { "docid": "df6afcd9d89d672bb15b1dc3724cef58", "score": "0.48519522", "text": "function uploadComplete(evt) {\n\t/* This event is raised when the server send back a response */\n\tchunkPropObj.setChunkStart(chunkPropObj.getChunkEnd());\n\tchunkPropObj.setChunkEnd(chunkPropObj.getChunkStart() + filePropObj.getFileBlock());\n\txhrReq.endRequest();\n\tchunkPos = chunkPropObj.getChunkPosition();\n\tchunkPos++;\n\tvar percentComplete = Math.floor( chunkPos * 100 / filePropObj.getFileChunks() );\n\tjQuery(document).ready(function() {\n\t\t$(\"#pb1\").progressBar(parseInt(percentComplete));\n\t});\n\t\n\tif ( chunkPropObj.getChunkStart() < filePropObj.getFileSize() && chunkPropObj.getChunkPosition() < filePropObj.getFileChunks() ) {\n\t\tvar pos = chunkPropObj.getChunkPosition();\n\t\tpos ++;\n\t\tchunkPropObj.setChunkPosition(pos);\n\t\tuploadChunk();\n\t} else {\n\t\t$(\"#uploadStatus\").val(\"\");\t\n\t\treturn false;\n\t}\n\t\t\t\t\n\t\t\t\t\n}", "title": "" }, { "docid": "0dc488367b9d15dc00f4265c36535d27", "score": "0.484856", "text": "function processPutResultAndEtag(path, results, successCallback) {\n\n // If things went OK, write out the new etag unless we are in transfer mode.\n if (processPutResult(path, results) && !inTransferMode()) {\n\n writeEtag(path, results.response.headers.etag)\n\n // Looking good - call the succes callback if there is one.\n successCallback && successCallback(path)\n }\n}", "title": "" }, { "docid": "bac7b1f9c47b3677035f269bd2451b30", "score": "0.48477235", "text": "function upload(obj) { \n var s = obj.data(\"DUploadSettings\"); \n \n \tuuid = eos.core.genId(); // generate random progress-id \n \n /* codigo arquivo */\n cacheDUploadObj[uuid] = obj; \n \n /* timer */\n \tcacheDUploadInterval[uuid] = window.setInterval(function(){ // seta interval de atualizacao para 1000 ms\n progress(uuid,obj);\n }, 500);\n \n /* Upload Frame */\n var uploadframe = document.createElement(\"iframe\");\n uploadframe.id = \"uploadframe_\"+uuid; \n uploadframe.name = \"uploadframe_\"+uuid; \n uploadframe.src = \"about:blank\";\n \n document.querySelector(\"#CAD\").appendChild(uploadframe); // adiciona frame de upload no documento\n /*\n var form = document.createElement(\"form\");\n form.id = \"uploadform_\"+uuid;\n form.name = \"uploadform_\"+uuid;\n form.method = \"POST\";\n form.enctype = \"multipart/form-data\";\n form.target = \"uploadframe_\"+uuid;\n form.action = \"/sys/upload/DUpload.cgi?X-Progress-ID=\"+uuid;\n */\n var form = document.createElement(\"div\");\n form.id = \"uploadform_\"+uuid;\n form.name = \"uploadform_\"+uuid;\n \n /* monta formulario de upload \n if(s.serializeForm) {\n ($(\"#CAD\").serialize().split('&')).forEach(function(v) {\n // campos\n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = v.split('=')[0];\n field.value = v.split('=')[1];\n \n form.appendChild(field); // adiciona campo\n });\n }\n */\n \n /* adiciona campo ID */\n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"ID\";\n field.value = document.querySelector(\"#AUX input[name=ID]\").value;\n form.appendChild(field);\n \n /* adiciona campo do upload */\n /*\n var fieldupload = obj.clone().prop({\n id : \"DUpload_\"+uuid,\n name : \"DUpload\"\n }).show();\n form.appendChild(fieldupload[0]);\n */\n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"DUpload\";\n field.value = obj.prop(\"name\");\n form.appendChild(field);\n \n /* adiciona campo descrp do upload */\n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"DUpload_descrp\";\n field.value = obj.parent().find(\"input[type=text]\").val();\n form.appendChild(field);\n \n \n /* adiciona campo uuid */\n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"uuid\";\n field.value = uuid;\n form.appendChild(field);\n \n \n /* link, campos para vinculo do upload */\n if(eos.core.is.object(s.link)) { // vinculo especifico\n \n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"link\";\n field.value = s.link.tbl;\n form.appendChild(field);\n \n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"link_codigo\";\n field.value = s.link.codigo;\n form.appendChild(field);\n \n \n } else if(s.link) { // vinculo padrao\n \n var field = document.createElement(\"input\");\n field.type = \"hidden\";\n field.name = \"link\";\n field.value = s.link;\n form.appendChild(field); \n }\n \n \n // document.querySelector(\"body\").appendChild(form); // adiciona formulario ao documento\n var t = document.querySelector(\"#CAD\"); // adiciona formulario ao documento\n t.appendChild(form);\n t.method = \"POST\";\n t.enctype = \"multipart/form-data\";\n t.target = \"uploadframe_\"+uuid;\n t.action = \"/sys/upload/DUpload.cgi?X-Progress-ID=\"+uuid;\n t.submit();\n \n // limpa form property apos submeter\n t.appendChild(form);\n t.method = \"\";\n t.enctype = \"\";\n t.target = \"\";\n t.action = \"\"; \n }", "title": "" }, { "docid": "0065ba3a35c751b835d979a58d88a431", "score": "0.48455596", "text": "onSuccessfulUpload() {\n this.setState({\n canUpload: false,\n uploads: []\n });\n }", "title": "" }, { "docid": "1997cc87903f81ea1f8457d6bdbf3b03", "score": "0.4843651", "text": "loadParts(whenIntegrated) {\n MeshFactory.getInstance().scene.name = this.name;\n // remember the callback for finalizing the integration - see integratePart\n this.whenIntegrated = whenIntegrated;\n for (var partsIndex in this.parts) {\n var part = this.parts[partsIndex];\n // integratePart will be called when finished\n part.load();\n }\n }", "title": "" }, { "docid": "a350d504393687684679255bfde9b3f6", "score": "0.48381868", "text": "function fileKMZUploadBehavior() {\n $(document).on('change', '.btn-file :file', function() {\n //START upload\n console.log(this.files[0]);\n var file = this.files[0];\n var xhr = new XMLHttpRequest();\n xhr.file = file; // not necessary if you create scopes like this\n \n //Listen for upload progress\n xhr.addEventListener('progress', function(e) {\n var done = e.position || e.loaded, total = e.totalSize || e.total;\n console.log('xhr progress: ' + (Math.floor(done/total*1000)/10) + '%');\n }, false);\n\n //Handle upload progress\n if (xhr.upload) {\n xhr.upload.onprogress = function(e) {\n var done = e.position || e.loaded, total = e.totalSize || e.total;\n\n var percentage = Math.floor(done/total*1000)/10;\n //console.log('xhr.upload progress: ' + done + ' / ' + total + ' = ' + percentage + '%');\n\n if (!$('#kmzprogressbar').hasClass('active')) {\n $('#kmzprogressbar').addClass('active').addClass('progress-bar-striped');\n }\n $('#kmzprogressbar').css('width', percentage+'%').attr('aria-valuenow', percentage).html(percentage+'%');\n };\n }\n \n //Listen for upload complete\n xhr.onreadystatechange = function(e) {\n if ( 4 == this.readyState ) {\n //console.log(['xhr upload complete', e]);\n $('#kmzprogressbar').removeClass('active').removeClass('progress-bar-striped');\n $('#kmzprogressbar').css('width', '100%').attr('aria-valuenow', 100).html('KMZ Uploaded');\n }\n };\n\n xhr.open('POST', 'kmz/kmzextract.php', true);\n\n var fd = new FormData();\n fd.append(\"file\", file);\n xhr.send(fd);\n\n xhr.onload = function() {\n if (this.status == 200) {\n //console.log(this.response);\n\n var resp = JSON.parse(this.response);\n\n //console.log('Server got:', resp);\n\n //Show KML\n showUploadedKMZ(resp.datetime);\n\n //move layer to displayed layers sortable list\n var thisLiElement = $('#kmzLayer');\n $('#displayedLayersList').append(thisLiElement);\n listUpdated();\n };\n };\n //END upload\n\n\n var input = $(this);\n var numFiles = input.get(0).files ? input.get(0).files.length : 1;\n var label = input.val().replace(/\\\\/g, '/').replace(/.*\\//, '');\n //Force trigger fileselect\n input.trigger('fileselect', [numFiles, label]);\n });\n\n //Handle file selection\n $('.btn-file :file').on('fileselect', function(event, numFiles, label) {\n //Adjust UI buttons\n if ($('.fileinput-remove-button').length == 0) {\n $('.btn-file').before('<button type=\"button\" class=\"btn btn-default fileinput-remove fileinput-remove-button\"> <i class=\"glyphicon glyphicon-ban-circle\"></i> </button>');\n }\n\n //Handle filename text\n var input = $(this).parents('.input-group').find(':text');\n var log = numFiles > 1 ? numFiles + ' files selected' : label;\n\n //Handle remove file behavior\n $('.fileinput-remove-button').click(function() {\n input.val('');\n $(this).remove();\n $('#kmzprogressbar').css('width', '0%').attr('aria-valuenow', 0).html('');\n });\n\n if(input.length) {\n input.val(log);\n }\n else {\n if(log) {\n alert(log);\n }\n }\n });\n }", "title": "" }, { "docid": "c063b9516a338712fa0db18953982495", "score": "0.48334014", "text": "updatePartially(correlationId, id, data, callback) {\n if (data == null || id == null) {\n if (callback)\n callback(null, null);\n return;\n }\n let newItem = data.getAsObject();\n newItem = this.convertFromPublicPartial(newItem);\n let objectId = this.generateBucketId(id);\n // Todo: repeat until update is successful\n this._bucket.get(objectId, (err, result) => {\n if (err || result == null || result.value == null) {\n callback(err, null);\n return;\n }\n let objectValue = _.assign(result.value, newItem);\n this._bucket.replace(objectId, objectValue, { cas: result.cas }, (err, result) => {\n if (!err)\n this._logger.trace(correlationId, \"Updated partially in %s with id = %s\", this._bucketName, id);\n if (callback) {\n newItem = err == null ? this.convertToPublic(objectValue) : null;\n callback(err, newItem);\n }\n });\n });\n }", "title": "" }, { "docid": "6d5fc9a0e64e69d6023b9b64cd51800d", "score": "0.48318836", "text": "function fileComplete(progress, cacheKey, success, totalLoaded, totalFiles) \n{\n\tconsole.log(\"File Complete: \" + progress + \"% - \" + totalLoaded + \" out of \" + totalFiles);\n\n\n console.log(\"image key \" + cacheKey);\n\n var tile = findServerTileById(cacheKey);\n if (tile != null)\n {\n console.log(\"found tile for this id, setting sprite id\");\n var index = tile.index;\n index += TILE_MAX_W+1;\n spriteArray[index].loadTexture(cacheKey);\n\n }\n\n/*\n\ttext.setText(\"File Complete: \" + progress + \"% - \" + totalLoaded + \" out of \" + totalFiles);\n\n\tvar newImage = game.add.image(x, y, cacheKey);\n\n\tnewImage.scale.set(0.3);\n\n\tx += newImage.width + 20;\n\n\tif (x > 700)\n\t{\n\t\tx = 32;\n\t\ty += 332;\n\t}\n*/\n\n}", "title": "" }, { "docid": "4830cda738117487b5001cf4e5702976", "score": "0.48258504", "text": "function handleDataAvailable(e) {\n recordedChunks.push(e.data);\n}", "title": "" }, { "docid": "a0113c55b581c4695c0047ae4a818fa0", "score": "0.482016", "text": "setUploading(video, uploadedSize, fileSize, f) {\n video.status = 'UPLOADING';\n video.uploadedSize = uploadedSize;\n video.fileSize = fileSize;\n video.save(f);\n }", "title": "" }, { "docid": "86b699d677bc9bd47dbac6131b44ab74", "score": "0.48200148", "text": "async PreparePrimalPackage(progress, newEpoch) {\n //Fetch content we have stored locally\n if (this.manager.db != null) {\n //Fetch. This also contains data for other types\n var datas = await this.manager._GetContentFromDatabase(this.mod_id);\n\n //Loop all\n for (var i = 0; i < datas.length; i += 1) {\n //Get\n var content = datas[i];\n\n //Check type and add\n if (content.PackageType == this.type) {\n this.content[content.ContentClassname] = content.ContentPayload;\n }\n }\n }\n\n //Download updates if needed\n if (this.entity_count > 0) {\n //Download\n var items = await this.DownloadContent(progress);\n\n //Add\n for (var i = 0; i < items.length; i += 1) {\n this.content[items[i].classname] = items[i];\n }\n\n //Write to database\n if (this.manager.db != null) {\n await this.manager._WriteContentChunkToDatabase(this.mod_id, this.type, items);\n }\n }\n\n //Set epoch\n if (this.manager.db != null) {\n await this.manager.SetLastEpoch(this.mod_id, this.type, newEpoch);\n }\n }", "title": "" }, { "docid": "375a0da4d1ee013b86659c11b33f1b8e", "score": "0.48166057", "text": "function uploadFiles(submission, files, progressCallback) {\r\n\r\n var promises = submission.data.files.map(function(file) {\r\n\r\n var deferred = $q.defer();\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('PUT', file.preSignedUploadUrl, true);\r\n xhr.setRequestHeader('Content-Type', file.mediaType);\r\n\r\n xhr.upload.addEventListener('progress', function(oEvent) {\r\n if (oEvent.lengthComputable) {\r\n var percentComplete = oEvent.loaded / oEvent.total\r\n // console.log(\"Completed \" + percentComplete)\r\n if (progressCallback && typeof progressCallback === 'function') {\r\n progressCallback.call(progressCallback, 'UPLOAD', {\r\n file: file.preSignedUploadUrl,\r\n progress: percentComplete*100\r\n })\r\n }\r\n // ...\r\n } else {\r\n // Unable to compute progress information since the total size is unknown\r\n }\r\n });\r\n\r\n // xhr version of the success callback\r\n xhr.onreadystatechange = function() {\r\n var status = xhr.status;\r\n if (((status >= 200 && status < 300) || status === 304) && xhr.readyState === 4) {\r\n $log.info('Successfully uploaded file');\r\n console.log('xhr response: ', xhr.responseText);\r\n\r\n // updateSubmissionStatus and then resolve?\r\n deferred.resolve();\r\n\r\n } else if (status >= 400) {\r\n $log.error('Error uploading to S3 with status: ' + status);\r\n toaster.pop('error', 'Whoops!', 'There was an error uploading your files. Please try again later.');\r\n deferred.reject(err);\r\n }\r\n };\r\n\r\n xhr.onerror = function(err) {\r\n $log.info('Error uploading to s3');\r\n toaster.pop('error', 'Whoops!', 'There was an error uploading your files. Please try again later.');\r\n deferred.reject(err);\r\n }\r\n xhr.send(files[file.type]);\r\n\r\n return deferred.promise;\r\n });\r\n return $q.all(promises)\r\n .then(function(response) {\r\n submission.data.files.forEach(function(f) {\r\n f.status = 'UPLOADED';\r\n });\r\n progressCallback.call(progressCallback, 'UPLOAD', 100);\r\n\r\n return updateSubmission(submission);\r\n })\r\n .catch(function(err) {\r\n console.log('error uploading to S3: ', err);\r\n progressCallback.call(progressCallback, 'ERROR', err)\r\n return err;\r\n });\r\n }", "title": "" }, { "docid": "82cbf4905432c5e85c0f1f55d72bb079", "score": "0.48051378", "text": "function prepareUpload(event) {\n\n temp.Data.LoadPdfOpt.file_pdf = new FormData();\n $.each(event.target.files, function (key, value) {\n temp.Data.LoadPdfOpt.file_pdf.append(key, value);\n });\n }", "title": "" }, { "docid": "8cd4349fc2b629aecaec9880921519c9", "score": "0.48046628", "text": "function toParts() {\n var method = arguments.length <= 0 || arguments[0] === undefined ? 'put' : arguments[0];\n var data = arguments[1];\n var designId = data.designId;\n var authToken = data.authToken;\n var apiEndpoint = data.apiEndpoint;\n\n var entries = data._entries || [];\n\n var authTokenStr = authToken ? '/?auth_token=' + authToken : '';\n var designUri = apiEndpoint + '/designs/' + designId;\n var partUri = designUri + '/parts';\n\n var fieldNames = ['id', 'name', 'description', 'uuid'];\n var mapping = {\n 'id': 'uuid',\n 'params': 'part_parameters'\n };\n\n /* \"binary_document_id\": null,\n \"binary_document_url\": \"\",\n \"source_document_id\": null,\n \"source_document_url\": \"\",]*/\n var requests = entries.map(function (entry) {\n var refined = (0, _ramda.pick)(fieldNames, (0, _utils.remapJson)(mapping, entry));\n var send = (0, _httpUtils.jsonToFormData)(refined);\n\n return {\n url: partUri + '/' + refined.uuid + authTokenStr,\n method: method,\n send: send,\n type: 'ymSave',\n typeDetail: 'parts',\n mimeType: null, // 'application/json'\n responseType: 'json',\n withCredentials: true\n };\n });\n return requests;\n}", "title": "" }, { "docid": "c501129973b79ed8b577a3557098cbb6", "score": "0.48017067", "text": "updateChunkDataOnChange( chunk ) {\n this.currentChunkObj = this.chunks[chunk];\n this.init = this.currentChunkObj.offsetInit;\n this.end = this.currentChunkObj.offsetEnd;\n this.isLastChunk = this.currentChunkObj.isLast;\n this.isFirstChunk = this.currentChunkObj.isFirst;\n }", "title": "" }, { "docid": "b107deee57b34559f8ac51726e812332", "score": "0.479415", "text": "function encryptAndUploadChunks() {\n\n // get file\n var file = $(\"#file-input\")[0].files[0];\n\n // Slice the chosen file.\n var slices = sliceFile(file);\n\n // Get the passphrase chosen by the user.\n passphrase = $('#passphrase').val();\n\n var encryptedSlices = [];\n var aesEncryptor = CryptoJS.algo.AES.createEncryptor(passphrase, { iv: iv });\n\n // initialize empty array of FileReaders\n var readerArray = [];\n\n // create a file reader for each chunk to encrypt\n for (var j = 0; j < slices.length; j++) {\n readerArray.push(new FileReader());\n }\n\n // for each file reader\n $.each(readerArray, function(index, value) {\n // when the file reader loaded a chunk into array buffer\n value.onload = function(e) {\n // convert to uint 8 array\n var ui8a = new Uint8Array(value.result);\n // convert to wordarray\n var wordarray = CryptoJS.enc.u8array.parse(ui8a);\n // encrypt, convert to Base64 string and push to encrypted slices array\n encryptedSlices.push(aesEncryptor.process(wordarray).toString(CryptoJS.enc.Base64));\n\n };\n // read the slice at the posttion of index into array buffer\n value.readAsArrayBuffer(slices[index]);\n\n // when the last filereader is done\n readerArray[readerArray.length - 1].onloadend = function(e) {\n // if the encrypted slices array is the same length as the unencrypted\n if (encryptedSlices.length == slices.length) {\n // add the finalizer\n encryptedSlices.push(aesEncryptor.finalize().toString(CryptoJS.enc.Base64));\n // for each encrypted slice, upload via xhr\n $.each(encryptedSlices, function(index, value) {\n // on last slice send lastRequest to pop csrf token\n if (index == encryptedSlices.length -1) {\n lastRequest = \"true\";\n }\n $.ajax({\n\n url: '/upload',\n type: 'POST',\n xhr: function() { // custom xhr\n var myXhr = $.ajaxSettings.xhr();\n if(myXhr.upload) { // check if upload property exists\n myXhr.upload.addEventListener('progress', progressHandler, false); // for handling the progress of the upload\n }\n return myXhr;\n },\n contentType: 'text/plain',\n //Ajax events\n success: successHandler,\n error: errorHandler,\n // Form data\n headers: {\n 'X-File-Content-Type' : \"application/octet-stream\",\n 'X-Csrf-Token' : csrfToken,\n 'X-Last-Request' : lastRequest,\n 'X-Chunk-Number' : index,\n 'X-Upload-Token' : uploadToken,\n 'X-Total-Chunks' : encryptedSlices.length // inform backend how much slices to expect\n },\n data: value, // encrypted chunk, base64\n processData: false,\n cache: false\n });\n\n });\n }\n };\n });\n}", "title": "" }, { "docid": "ff585eec07f6ba7525d259c26e023a08", "score": "0.4791129", "text": "function uploadDone() {\n}", "title": "" }, { "docid": "d0fe48ca065ee7a1eecf3d0ab8e2df28", "score": "0.47887045", "text": "function fileSelected() {\n\tvar file = document.getElementById(\"fileToUploadID\").files[0];\n\tif ( file ) {\n\t\tvar fileSize = 0;\n\t\tif ( file.size > 1024 * 1024 ) {\n\t\t\tfileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + \"MB\";\n\t\t} else {\n\t\t\tfileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + \"KB\";\n\t\t}\t\n\t\t\n\t\tdocument.getElementById(\"fileName\").innerHTML = file.name;\n\t\tdocument.getElementById(\"fileSize\").innerHTML = fileSize;\n\t\t\n\t\tjQuery(document).ready(function() {\n\t\t\t$(\"#pb1\").progressBar();\n\t\t\t$(\"#pb1\").progressBar(0);\n\t\t\t$(\"#uploadMain\").removeAttr(\"disabled\");\n\t\t\t$(\"#uploadCancel\").removeClass(\"ui-state-active\");\n\t\t\t$(\"#uploadResume\").removeClass(\"ui-state-active\");\n\t\t\t$(\"#uploadStatus\").val(\"Started\");\t\n\t\t});\n\t\t\n\t\txhrReq = new xmlRequest();\n\t\tfilePropObj = new fileProperties();\n\t\tchunkPropObj = new chunkProperties();\n\n\t\t\n\t\tfilePropObj.setFileName(file.name);\n\t\tfilePropObj.setFileSize(file.size);\n\t\tfilePropObj.setFileType(/[^.]+$/.exec(filePropObj.getFileName()));\n\t\t\n\t\tif ( !filePropObj.checkValidType(filePropObj.getFileType()) ) {\n\t\t\talert(\"Not supported\");\n\t\t\twindow.location.reload();\n\t\t\treturn false;\n\t\t}\n\t\tfilePropObj.setFileBlock(1000000);\n\t\tvar d = new Date();\n\t\tfilePropObj.setFileUploadTime(d.getTime());\n\t\tvar chunks = Math.floor(filePropObj.getFileSize() / filePropObj.getFileBlock());\n\t\tvar remChunks = Math.floor(filePropObj.getFileSize() % filePropObj.getFileBlock());\n\t\tif ( remChunks != 0 ) {\n\t\t\tchunks++;\n\t\t}\n\t\tfilePropObj.setFileChunks(chunks);\n\t\tdocument.getElementById(\"fileNameStored\").value = d.getTime() + filePropObj.getFileName();\n\t}\n}", "title": "" }, { "docid": "75df1d2b09f34de9c5e1e79a8d0bcde3", "score": "0.4787881", "text": "function uploadFile(mediaFile) {\n \n var ft = new FileTransfer(),\n path = mediaFile.fullPath,\n name = mediaFile.name;\n\n console.log('File : ' + path);\n \n var options = new FileUploadOptions();\n options.fileKey=\"comment[assets_attributes[0]][file]\";\n \n options.fileName=\"android.3gp\";\n options.mimeType=\"video/3gp\";\n \n var params = {\n \"authenticity_token\": token,\n \"comment[commentable_type]\": \"Topic\",\n \"comment[commentable_id]\": topicNumber,\n \"comment[assets_attributes[0]][type]\": \"Video\",\n \"comment[assets_attributes[0]][do_transcode]\": \"1\",\n \"comment[assets_attributes[0]][rotate]\" : \"0\"\n };\n \n options.params = params;\n \n var post_url = upd_base_url + \"videopinions/\" + slug + \"/comments.json?authenticity_token=\" + token;\n \n doLoading();\n \n var failedUpload = function(error){\n //alert(\"Upload error.\");\n endLoading();\n //console.log('Error uploading file ' + path + ': ' + error.code);\n navigator.notification.alert(\"An error happened while uploading.\", null, \"The Box Score\", \"OK\");\n };\n \n var winUpload = function(result){\n \n console.log('Server Upload Return : ' + JSON.stringify(result));\n \n //var obj = {offertext2:\"Cheat\", offerexpire:\"2012/03/19\", offer:\"http://youpluspreprod.com/offers/e01d09ece4a74b8ce940c08b1c5b4dd400fd008e\", offertext:\"Test Offer 1\", status:\"success\"};\n \n var rObj = '' + JSON.stringify(result.response);\n rObj = rObj.replace(/\\\\/g, '');\n \n if(rObj.substring(0,1) == '\"') rObj = rObj.substring(1, rObj.length);\n if(rObj.substring(rObj.length-1,rObj.length) == '\"') rObj = rObj.substring(0, rObj.length-1);\n \n var obj = jQuery.parseJSON(rObj);\n\n if(obj.status == \"success\")\n {\n if(obj.offerexpire)\n {\n saveCoupon(obj);\n }\n else\n {\n console.log('No Coupon return ================ ');\n endLoading();\n navigator.notification.alert(\"Thanks for responding, check the tab below for available offers.\", null, \"The Box Score\", \"OK\");\n }\n }\n else\n {\n failedUpload(1);\n }\n };\n //winUpload();\n ft.upload(path, post_url, winUpload, failedUpload, options); \n}", "title": "" }, { "docid": "ecf71b888d0176db31f167a6a0c7b25b", "score": "0.4782378", "text": "upload () {\r\n let uploadService = new UploadService();\r\n let self = this;\r\n\r\n return new Promise((resolve, reject) => {\r\n if (!this.doc.entryId) {\r\n // this is a new doc\r\n AccountService.hello()\r\n .then(function () {\r\n EntryService.save(self.doc)\r\n .then(function (updatedObj) {\r\n self.doc.entryId = updatedObj.entryId;\r\n uploadService.uploadFile(self.doc.folder, self.doc.entryId, self.loader.file,\r\n function ({loaded, total}) {\r\n self.loader.loaded = loaded;\r\n self.loader.total = total;\r\n })\r\n .then(function (result) {\r\n console.log('upload entry completed for parent entry.', result.parentEntry);\r\n resolve({default: result.uploadEntry.downloadLink});\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n reject(error);\r\n });\r\n })\r\n .catch(function (error) {\r\n reject(error);\r\n });\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n reject(error);\r\n });\r\n } else {\r\n return uploadService.uploadFile(self.doc.folder, self.doc.entryId, self.loader.file,\r\n function ({loaded, total}) {\r\n self.loader.loaded = loaded;\r\n self.loader.total = total;\r\n })\r\n .then(function (result) {\r\n console.log('upload entry completed for parent entry.', result.parentEntry);\r\n resolve({default: result.uploadEntry.downloadLink});\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n reject(error);\r\n });\r\n } \r\n });\r\n }", "title": "" }, { "docid": "8271aca4e0cbd87fe99c0c3b9931a050", "score": "0.4780741", "text": "function sendFile(file, j, k,id) {\n //var mainFileName = file.name.replace(/[&]/g, \"([@-@-@])\");\n //$(\"#divProgress\").attr(\"style\", \"width:30%\");\n //$(\"#uploadfilePercentage\").text(\"30%\");\n //$('#hdnFileName').val(file.name);\n //createCookie(\"fileName\", file.name, 1);\n hubEngine.server.hubstart($.connection.hub.id).done(function (flag) {\n if (filecount < flag) {\n $.ajax({\n url: 'FileUploader/FileUploader.ashx', //+ '&Extention=' + file.name.substr(file.name.lastIndexOf(\".\")),//server script to process data\n type: 'POST',\n xhr: function () {\n myXhr = $.ajaxSettings.xhr();\n if (myXhr.upload) {\n // $(\"#divProgress\").attr(\"style\", \"width:40%\");\n // $(\"#uploadfilePercentage\").text(\"40%\");\n myXhr.upload.addEventListener('progress', progressHandlingFunction, false);\n // $(\"#divProgress\").attr(\"style\", \"width:50%\");\n //$(\"#uploadfilePercentage\").text(\"50%\");\n }\n return myXhr;\n },\n success: function (result) {\n var now = new Date();\n now = now.getTime();\n\n\n if (file.name != \"\" && file.name != null && result != \"\" && result != null && id==\"file-5\") {\n file5Name = now + file.name; file5 = result;\n //ProductImageNames.push(now + file.name); ProductImages.push(result);\n }\n if (file.name != \"\" && file.name != null && result != \"\" && result != null && id == \"file-6\") {\n file6Name = now + file.name; file6 = result;\n //ProductImageNames.push(now + file.name); ProductImages.push(result);\n }\n\n if (k === j)\n ProductData();\n \n //BeginProcess(ProductImages, ProductImageNames.name, 0);\n },\n data: file,\n cache: false,\n contentType: false,\n processData: false\n });\n }\n //else {\n // //if (window.confirm(\"Infactum can currently save only 5 Sessions. Please delete at least one session to continue.\") == true) {\n // // $(\"#divProgress\").width(\"100%\");\n // // InvertScreen();\n // // $('#ancSessions').click();\n\n // //}\n // var control = $(\"#fileInput\");\n // control.replaceWith(control = control.clone(true));\n // $(\"#mySessionAlertModal\").modal(\"show\");\n\n //}\n\n\n\n function progressHandlingFunction(e) {\n if (e.lengthComputable) {\n var s = parseInt((e.loaded / e.total) * 100);\n //$(\"#progress\" + currFile).text(s + \"%\");\n //$(\"#divProgress\").width(s + \"%\");\n //$(\"#uploadfilePercentage\").text(s + \"%\");\n if (s == 100) {\n triggerNextFileUpload(id);\n }\n }\n }\n });\n}", "title": "" }, { "docid": "f60ab0702bb0da778751d7451349bd39", "score": "0.47775862", "text": "function initPartTypeSharedData(partTypeName, partDef, p4vData, localStore, flightInstanceId) {\n \n let sharedData = partDef.part.sharedData ? partDef.part.sharedData() : undefined;\n\n // TEMP KLUDGE - it should not be here ...\n // sharedData = Object.assign({ _isActive: false }, sharedData);\n \n let sharedDataExists = (sharedData !== undefined && Object.keys(sharedData).length > 0);\n \n if (sharedDataExists) {\n\n // Get the setters/getters for shared variables\n \n let partTypeSettersGetters = localStore.getPartTypeSettersGetters({ \n sharedVariables: sharedData,\n flightInstanceId: flightInstanceId\n });\n\n // Create a Part module in store for each instance of this Part Type\n // (this instance ID list is pulled from P4Vdata)\n \n const partInstanceIDs = Object.keys(p4vData.parts)\n .filter(partKey => p4vData.parts[partKey].type === partTypeName)\n .map(partKey => p4vData.parts[partKey].id);\n \n // Register each instance of this Part Type with the store\n\n partInstanceIDs.forEach(partId => {\n localStore.registerPart({\n sharedVariables: sharedData,\n partId: partId,\n flightInstanceId: flightInstanceId\n });\n });\n\n // Add shared variable setters and getters to \n // the component's .computed\n // TODO: Currently overwrites .computed -- should this be moved to a mixin?\n\n partDef.part.computed = partTypeSettersGetters; \n\n delete partDef.part.sharedData;\n }\n \n return partDef;\n }", "title": "" }, { "docid": "b462a57d59dd7ee728ad1492cc395819", "score": "0.47764695", "text": "set uploaded(value) {\n var changed = value !== this._uploaded;\n this._uploaded = value;\n if (changed) {\n this.onUploadedChanged();\n }\n }", "title": "" }, { "docid": "4c21b1ac82eaa89323589f98f4503d44", "score": "0.47747374", "text": "finishUploadVideos(file) {\n let fileResponse = file.xhr.response;\n let fileResult = JSON.parse(fileResponse);\n this.supervisorVideos.push({\n id: fileResult.file_id,\n file_name: fileResult.file_name,\n path_to_file: fileResult.path_to_file\n });\n\n this.uploadVideos = 0;\n }", "title": "" }, { "docid": "d8922ecc5308c2b3fc6665aa12ae8860", "score": "0.47737783", "text": "function blobloaded(blobdata) {\n let focalpoint = lightboxGetFocalPoint();\n uploadmedia(url, access_token, blobdata, focalpoint, onload, onerror, onabort);\n \tprint('uploading ' + lbcanvas.file.name + ' ...');\n }", "title": "" }, { "docid": "827f656deeba68bc434290e8b72c10ed", "score": "0.4771973", "text": "onComplete() {\n var data = this.data;\n if (latte._isArray(data) && data.length > 0 && data[0]) {\n this._fileRecord = (data[0]);\n }\n else {\n latte.log(\"Error uploading file: \" + this.response);\n }\n super.onComplete();\n }", "title": "" }, { "docid": "827f656deeba68bc434290e8b72c10ed", "score": "0.4771973", "text": "onComplete() {\n var data = this.data;\n if (latte._isArray(data) && data.length > 0 && data[0]) {\n this._fileRecord = (data[0]);\n }\n else {\n latte.log(\"Error uploading file: \" + this.response);\n }\n super.onComplete();\n }", "title": "" }, { "docid": "70ad31ecabff073adb3513ef08f3019c", "score": "0.4770029", "text": "function syncChunks(deferreds, chunks, chunkPrefix, details, setDetailsSeparateFromChunks) {\n\n var previousDeferredsCount = deferreds.length;\n\n $(chunks).each(function(index, chunk) {\n var itemToSave = {};\n\n // let's set details + chunk together\n if (!setDetailsSeparateFromChunks) {\n itemToSave[\"details\"] = details;\n }\n\n itemToSave[chunkPrefix + \"_\" + index + \"_\" + details.chunkId] = chunk;\n\n console.log(\"trying to sync.set json length: \", chunkPrefix + \"_\" + index + \"_\" + details.chunkId, chunk.length + \"_\" + JSON.stringify(chunk).length);\n\n var deferred = $.Deferred(function(def) {\n\n // firefox\n // noinspection JSDeprecatedSymbols\n if (!chrome.storage.sync.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE) {\n // noinspection JSDeprecatedSymbols\n chrome.storage.sync.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE = 1000000;\n }\n\n // to avoid problems with MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE let's spread out the calls\n var delay;\n var SYNC_OPERATIONS_BEFORE = 1; // .clear were done before\n // noinspection JSDeprecatedSymbols\n if (SYNC_OPERATIONS_BEFORE + previousDeferredsCount + chunks.length > chrome.storage.sync.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE) {\n delay = (previousDeferredsCount+index) * seconds(10); // makes only 6 calls per minute\n } else {\n delay = 0;\n }\n setTimeout(function() {\n chrome.storage.sync.set(itemToSave, function() {\n if (chrome.runtime.lastError) {\n var error = \"sync error: \" + chrome.runtime.lastError.message;\n logError(error);\n def.reject(error);\n } else {\n console.log(\"saved \" + chunkPrefix + \" \" + index);\n def.resolve(\"success\");\n }\n });\n }, delay);\n });\n deferreds.push(deferred);\n });\n }", "title": "" }, { "docid": "2a55797ad7c1d35f01e112c2c2b24643", "score": "0.4766332", "text": "function startActualUpload() {\n\t\tvar i, len, tbl = {}, chunksNotUploaded = [],\n\t\t\tfile = FileHandle, \n\t\t\tchunksAlreadyUploaded = FileChunksUploaded, \n\t\t\tchunkSize = getChunkSize(file.size), \n\t\t\tnumChunks = getNumChunks(file.size, chunkSize);\n\n\t\t// put chunks already uploaded in table for easy lookup\n\t\tfor (i = 0, len = chunksAlreadyUploaded.length; i < len; i++) {\n\t\t\ttbl[chunksAlreadyUploaded[i]] = true;\n\t\t}\n\n\t\t// compute chunks that actually need to be uploaded\n\t\tfor (i = 0; i < numChunks; i++) {\n\t\t\tif (!tbl[i]) { chunksNotUploaded.push(i); }\n\t\t}\n\n\t\tvar uploadIt = function(chunk) {\n\t\t\tvar url, offset = chunk * chunkSize; // chunkSize comes from outer context\n\t\t\t\n\t\t\turl = getUploadUrl(FileMD5, FileHandle.name);\n\n\t\t\tlog(\"Uploading chunk# \" + chunk);\n\t\t\tBrowserPlus.FileAccess.slice({file:file, offset:offset, size:chunkSize}, function(r1) {\n\n\t\t\t\tvar vars = {\n\t\t\t\t\tchunk: \"\"+chunk,\n\t\t\t\t\tchunks: \"\"+numChunks\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tBrowserPlus.FileTransfer.upload({ files: { \"file\": r1.value }, url: url, postvars: vars}, function(r2) {\n\t\t\t\t\tvar results;\n\t\t\t\t\tif (r2.success) {\n\t\t\t\t\t\tresults = JSON.parse(r2.value.body);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (results.status == \"partial\") {\n\t\t\t\t\t\t\tlog(\"Uploaded chunk#\" + chunk);\n\t\t\t\t\t\t\tFileChunksUploaded.push(chunk);\n\t\t\t\t\t\t\thighlightChunks([chunk]);\n\t\t\t\t\t\t} else if (results.status == \"complete\") {\n\t\t\t\t\t\t\tlog('File uploaded! <a href=\"' + results.value + '\">Download it</a>.');\n\t\t\t\t\t\t\tFileChunksUploaded.push(chunk);\n\t\t\t\t\t\t\thighlightChunks([chunk]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlog(\"Upload error: \" + results.value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(\"upload\", r2);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdoNextUpload(chunk);\n\t\t\t\t});\t\t\t\n\t\t\t});\n\t\t};\n\n\t\tvar doNextUpload = function(chunk) {\n\t\t\tif (UploadFlag && chunksNotUploaded.length > 0) {\n\t\t\t\tuploadIt(chunksNotUploaded.shift());\n\t\t\t} else {\n\t\t\t\tY.one(\"#b_stop\").set(\"disabled\", true);\n\t\t\t\tY.one(\"#b_start\").set(\"disabled\", !chunk || chunk == chunksNotUploaded.length);\n\t\t\t\tY.one(\"#b_file\").set(\"disabled\", false);\n\t\t\t}\n\t\t};\n\t\t\n\t\tdoNextUpload();\n\t}", "title": "" }, { "docid": "9321130ed47fd8388cbaa535d93c9e53", "score": "0.47658712", "text": "function doUpload(request){\t\n\tvar cryption = new Packages.jp.co.intra_mart.system.imtag.SecureParameterCryption();\n\tvar response = Web.getHTTPResponse();\n\tresponse.setContentType('text/plain; charset=utf-8');\n\t\n\ttry {\n\t\t// Creating a destination\n\t\tvar dir = 'upload';\n\t\tvar storedDirectory = new PublicStorage(dir);\n\t\t\n\t\tstoredDirectory.makeDirectories();\n\t\t// Save File data\n\t\tvar upfile = request.getParameter(\"local_file\");\n\t\tvar timestamp = new Date().getUTCMilliseconds();\n\t\tvar newFileName = timestamp+'_'+upfile.getFileName();\n\t\tupfile.openValueAsBinary(function(reader) {\n\t\t\tvar storage = new PublicStorage(dir, newFileName);\n\t\t\tstorage.createAsBinary(function(writer, err) {\n\t\t\t\tif (err) {\n\t\t\t\t\tLogger.getLogger().error(err.message);\n\t\t\t\t\tresponse.sendMessageBodyString(ImJson.toJSONString([{\n\t\t\t\t\t\t\"error\":MessageManager.getMessage(\"FILE.UPLOAD.ERROR.ID\")\n\t\t\t\t\t}]));\n\t\t\t\t}\n\t\t\t\treader.transferTo(writer);\n\t\t\t});\n\t\t});\n\t\t//Acquisition of data file that you saved\n\t\tvar storedFile = new PublicStorage(dir, newFileName);\n\t\tvar storedFileSize = storedFile.length();\n\t\tif (storedFileSize == null || storedFileSize == 0 || storedFileSize >= 2000000) {\n\t\t\tif (storedFile.exists()) {\n\t\t\t\tstoredFile.remove();\n\t\t\t}\n\t\t\tvar message;\n\t\t\tif (storedFileSize == null) {\n\t\t\t\tmessage = MessageManager.getMessage(\"GET.FILE.SIZE.ERROR.ID\");\n\t\t\t} else if (storedFileSize == 0) {\n\t\t\t\tmessage = MessageManager.getMessage(\"EMPTY.FILE.ERROR.ID\");\n\t\t\t} else if (storedFileSize >= 2000000) {\n\t\t\t\tmessage = MessageManager.getMessage(\"MAX.FILE.SIZE.LIMIT.ERROR.ID\");\n\t\t\t}\n\t\t\tresponse.sendMessageBodyString(ImJson.toJSONString([{\n\t\t\t\t\"error\":message\n\t\t\t}]));\n\t\t}\n\t\t\n\t\t//add files to array\n\t\tif(Client.get('imgArrSess')){\n\t\t\tvar imgArr = Client.get('imgArrSess');\n\t\t\tClient.remove('imgArrSess');\n\t\t}\n\t\telse{\n\t\t\tvar imgArr = [];\t\n\t\t}\n\t\timgArr.push(newFileName);\n\t\tClient.set('imgArrSess',imgArr);\n\t\tresponse.sendMessageBodyString(ImJson.toJSONString([{\n\t\t\t\"name\":upfile.getFileName(),\n\t\t\t\"size\":storedFileSize,\n\t\t\t\"deleteUrl\":'ib_issues/register/fileremove/' + URL.encode(cryption.encrypt(storedFile.getCanonicalPath()),\"UTF-8\"),\n\t\t\t\"deleteType\":'POST'\n\t\t}]));\n\t} \n\tcatch(e) {\n\t\t// Return the error information\n\t\tresponse.sendMessageBodyString(ImJson.toJSONString([{\n\t\t\t\"error\":e.message\n\t\t}]));\n\t}\n}", "title": "" }, { "docid": "13b1e3976743dc2c815a4e805f658580", "score": "0.47589874", "text": "function setPartCookie() {\n\t\tsetCookie(\"PARTID\",PARTHASH, 5);\n\t}", "title": "" }, { "docid": "39535e10482e080e93698709a24f74cd", "score": "0.47509733", "text": "static onLoaded(part) {\n part.loaded()\n }", "title": "" }, { "docid": "57805d8768e422867d675f18112265b0", "score": "0.47497213", "text": "function savePart() {\n let name = $('#name').val();\n\n let data = {};\n let tokenName = $(\"#csrfTokenName\").attr(\"value\");\n data[tokenName] = $(\"#csrfToken\").attr(\"value\");\n data['category'] = category;\n\n $.ajax({\n type: 'POST',\n url: '/repairs/parts',\n data: data,\n dataType: 'json',\n contentType: 'application/x-www-form-urlencoded',\n success: function (part) {\n addPartToDOM(part);\n }\n });\n}", "title": "" }, { "docid": "16efbe78546be2a004f36e0542c3a85b", "score": "0.4742706", "text": "function updateCache() {\n\tvar cache = document.getElementById(\"cache\");\n\twhile (cache.firstChild) {\n\t\tcache.removeChild(cache.firstChild);\n\t}\n\tfor (var i = 0; i < CACHE_PRELOAD_SIZE; i++) {\n\t\tvar img = document.createElement('img');\n\t\timg.setAttribute(\"src\", getJson(slideIndex + i + 1).file.url);\n\t\tcache.appendChild(img);\n\t}\n\tfor (var i = 0; i < CACHE_POSTLOAD_SIZE; i++) {\n\t\tvar json = getJson(slideIndex - i - 1);\n\t\tif (json != 0) {\n\t\t\tvar img = document.createElement('img');\n\t\t\timg.setAttribute(\"src\", json.file.url);\n\t\t\tcache.appendChild(img);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "024a96f3868bec6df867676259019996", "score": "0.47415188", "text": "function _save(){\n try{\n _storage_service.jStorage = json_encode(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n }catch(E7){/* probably cache is full, nothing is saved this way*/}\n }", "title": "" }, { "docid": "b9772f7f5f56b7f55f1f43683599a73c", "score": "0.47370535", "text": "function loadCacheAttachment(field, node, attachmentName) {\n const cachedDocument = self.connector.cache(nodeId + '/' + attachmentName);\n if (cachedDocument) {\n Object.assign(field, cachedDocument)\n } else {\n node.attachment(attachmentName).download(function (data) {\n const parsedData = JSON.parse(data);\n self.connector.cache(nodeId + '/' + attachmentName, parsedData);\n Object.assign(field, parsedData)\n })\n }\n //console.log(\"update \" + attachmentName + ' ' + self.name)\n }", "title": "" }, { "docid": "723367f80f7e2c0df367c249b335e0dc", "score": "0.47361422", "text": "processUploadImage() {\n this.showLoading(true);\n\n setTimeout(() => {\n const { imgListRs } = this.state;\n this.listErr = [];\n this.listId = [];\n\n for (i in imgListRs) {\n\n this.numProcess++;\n this._uploadImage(imgListRs[i]);\n }\n }, 0);\n \n }", "title": "" }, { "docid": "aa953774df44bdf267edfead2a433ec6", "score": "0.47346324", "text": "upload (userId, datasetName, fileList, metadata, progress, error) {\n this.total = fileList.length + 1;\n this.completed = 0;\n this.error = error;\n this.currentProjectId = null;\n this.progressStart = (filename) => {\n this.currentFiles.push(filename);\n progress({status: 'uploading', total: this.total, completed: this.completed, currentFiles: this.currentFiles});\n };\n this.progressEnd = (filename) => {\n let index = this.currentFiles.indexOf(filename);\n this.currentFiles.splice(index, 1);\n this.completed++;\n progress({status: 'uploading', total: this.total, completed: this.completed, currentFiles: this.currentFiles}, this.currentProjectId);\n };\n let existingProject = null;\n scitran.getProjects({authenticate: true}, (projects) => {\n for (let project of projects) {\n if (project.label === datasetName && project.group === userId) {\n project.children = project.files;\n existingProject = project;\n break;\n }\n }\n\n if (existingProject) {\n this.currentProjectId = existingProject._id;\n diff.datasets(fileList, existingProject.files, (newFiles, completedFiles) => {\n this.completed = this.completed + completedFiles.length + 1;\n progress({status: 'calculating', total: this.total, completed: this.completed, currentFiles: this.currentFiles});\n this.uploadFiles(datasetName, newFiles, this.currentProjectId, metadata);\n });\n } else {\n this.createContainer(crn.createProject, [userId, datasetName], (err, res) => {\n let projectId = res.body._id;\n scitran.addTag('projects', projectId, 'incomplete', () => {\n this.uploadFiles(datasetName, fileList, projectId, metadata);\n });\n });\n }\n });\n }", "title": "" }, { "docid": "1260a7cdf8cd0caa465c8618843aa53c", "score": "0.47317994", "text": "get uploaded() {\n return this._uploaded;\n }", "title": "" }, { "docid": "67ca55b5199de92aca07eb624ff5c2d9", "score": "0.4730489", "text": "function _updateData() {\n\t\t// New items and removal of unused items can take place here\n\t\t// when the version changes\n\t\tconst oldVersion = app.Utils.getInt('version');\n\t\tif (oldVersion < 2) {\n\t\t\tapp.Utils.set('version', DATA_VERSION);\n\t\t\t// remove unused variables\n\t\t\tlocalStorage.removeItem('lastEmail');\n\t\t\tlocalStorage.removeItem('lastUid');\n\t\t}\n\n\t\t_saveDefaults();\n\t}", "title": "" }, { "docid": "2ed9d3d0f5eb43b089ffb55d4554c64f", "score": "0.4725515", "text": "saveProgress(playerId, storyProgress, sanity) {\n let progress = this.gameData_[playerId];\n progress.storyProgress += storyProgress;\n progress.sanity += sanity;\n console.log('new progress', this.gameData_[playerId]);\n }", "title": "" }, { "docid": "080c4ac69dbcdd39dfb4c16ff4f15af9", "score": "0.4723344", "text": "function multipartUpload(file) {\n\n \"use strict\";\n\n var sharetypeValue = (document.getElementById('enable-email').checked) ? 'Email' : 'Link';\n var privatelinkValue = (document.getElementById('private-link-label').innerHTML == 'Disabled') ? 'No' : 'Yes';\n var privatelinkDuration = document.getElementById('timer').value;\n \n var fileNamesList = [];\n var fileList;\n var totalEmails;\n var totalLinks;\n var emailToList = [];\n var emailTo;\n var emailToSend;\n var emailFrom;\n var emailMessage;\n\n\n /* Get email lists */\n if (sharetypeValue == 'Email') { \n emailTo = document.getElementsByName('send-to[]');\n emailFrom = document.getElementById('send-from').value;\n emailMessage = document.getElementById('message').value;\n \n for (var i = 0; i < emailTo.length; i++) { \n emailToList.push(emailTo[i].value); \n }\n \n emailTo = emailToList.join('\\n');\n emailToSend = emailToList.join(',');\n totalEmails = emailToList.length;\n totalLinks = 0;\n\n } else {\n emailTo = ' ';\n emailFrom = ' ';\n emailMessage = ' ';\n totalEmails = 0;\n totalLinks = Object.keys(fileDownloadLinks).length;\n }\n\n /* Get the list of file names*/\n for (var key in fileIDs) {\n fileNamesList.push(pond.getFile(key).filename); \n }\n\n /* Add new line character for each filename */\n if (fileNamesList.length > 1) {\n fileList = fileNamesList.join('\\n');\n } else {\n fileList = fileNamesList.join();\n }\n\n\n var chunkSize = parseInt(document.getElementById('chunk').value);\n this.PART_SIZE = chunkSize * 1024 * 1024; // Minimum part size defined by aws s3 is 5 MB, maximum 5 GB\n this.SERVER_LOC = 'MultipartUpload.php'; // Location of the server\n this.completed = false;\n this.file = file;\n this.fileInfo = {\n name: this.file.name,\n type: this.file.type,\n size: this.file.size\n };\n\n this.sendBackData = null; // XHR server side return data\n this.uploadXHR = [];\n this.totalParts = null; // Total number of file parts\n this.blobs = []; // Array of file blobs split by chunk size\n\n this.fileTableData = {\n name: this.file.name,\n type: this.file.type,\n size: this.file.size,\n sharetype: sharetypeValue\n };\n\n this.sharesTableData = {\n sharetype: sharetypeValue,\n filequantity: Object.keys(fileIDs).length,\n filenames: fileList,\n senderemail: emailFrom,\n receiveremail: emailTo,\n message: emailMessage,\n privatelink: privatelinkValue,\n expirationtime: privatelinkDuration\n }\n\n this.emailData = {\n emailFrom: emailFrom,\n emailTo: emailToSend,\n emailMessage: emailMessage, \n filequantity: Object.keys(fileIDs).length\n }\n \n // Upload Progress monitoring\n this.byterate = []\n this.lastUploadedSize = []\n this.lastUploadedTime = []\n this.loaded = [];\n this.total = [];\n\n}", "title": "" }, { "docid": "b0b83b1a65dc7aaeab6bf60f2f98db15", "score": "0.47123268", "text": "function editTimeline(followeruID, followeduID, copy) {\n promises = []\n //Get user that has been followed mixes\n const mixes = getSubCollection(followeduID, 'mixes', false)\n \n //Add them to the user doing the 'following's timeline\n\n return mixes.get().then(response => {\n console.log('new')\n for (i in response.docs()) {\n mix = response[i]\n console.log(mix + ' mix')\n console.log(mix.data + ' mix.data')\n console.log(mix.data()+' mix.data()')\n if (copy) {\n\n addMix = {\n 'dateUploaded': mix.dateUploaded,\n 'series' : mix.series,\n 'title': mix.title,\n 'tracklist' : mix.tracklist,\n 'uID': mix.uID,\n 'producer': mix.producer,\n 'likeCount' : mix.likeCount ,\n }\n\n setter = database.collection('users').doc(followeruID).collection('timeline').doc(mix.id).set(addMix)\n } else {\n setter = database.collection('users').doc(followeruID).collection('timeline').doc(mix.id).delete()\n }\n promises.push(setter)\n }\n return promises\n }).then(response => {\n return Promise.all(promises)\n })\n}", "title": "" } ]
6434d4be54b87ba721d259a749604b04
called automatically from within initPathTracingShaders() function above
[ { "docid": "389b40bebba6849f046862c9c9df1f7d", "score": "0.63630664", "text": "function createPathTracingMaterial() {\r\n\r\n fileLoader.load('shaders/PathTracing_Rendering_Fragment.glsl', function (shaderText) {\r\n\r\n pathTracingFragmentShader = shaderText;\r\n\r\n pathTracingMaterial = new THREE.ShaderMaterial({\r\n uniforms: pathTracingUniforms,\r\n defines: pathTracingDefines,\r\n vertexShader: pathTracingVertexShader,\r\n fragmentShader: pathTracingFragmentShader,\r\n depthTest: false,\r\n depthWrite: false\r\n });\r\n\r\n pathTracingMesh = new THREE.Mesh(pathTracingGeometry, pathTracingMaterial);\r\n pathTracingScene.add(pathTracingMesh);\r\n\r\n // the following keeps the large scene ShaderMaterial quad right in front \r\n // of the camera at all times. This is necessary because without it, the scene \r\n // quad will fall out of view and get clipped when the camera rotates past 180 degrees.\r\n worldCamera.add(pathTracingMesh);\r\n\r\n });\r\n\r\n} // end function createPathTracingMaterial()", "title": "" } ]
[ { "docid": "1a94701f61fea954a8b6ad350f37a2a8", "score": "0.76669073", "text": "function initPathTracingShaders() {\r\n\r\n /* array of vectors */\r\n\r\n // scene/demo-specific uniforms go here\r\n pathTracingUniforms = {\r\n\r\n tPreviousTexture: { type: \"t\", value: screenTextureRenderTarget.texture },\r\n t_PerlinNoise: { type: \"t\", value: PerlinNoiseTexture },\r\n\r\n uCameraIsMoving: { type: \"b1\", value: false },\r\n uCameraJustStartedMoving: { type: \"b1\", value: false },\r\n\r\n uEPS_intersect: { type: \"f\", value: EPS_intersect },\r\n uCameraUnderWater: { type: \"f\", value: 0.0 },\r\n uTime: { type: \"f\", value: 0.0 },\r\n uSampleCounter: { type: \"f\", value: 0.0 },\r\n uFrameCounter: { type: \"f\", value: 1.0 },\r\n uULen: { type: \"f\", value: 1.0 },\r\n uVLen: { type: \"f\", value: 1.0 },\r\n uApertureSize: { type: \"f\", value: 0.0 },\r\n uFocusDistance: { type: \"f\", value: focusDistance },\r\n\r\n uResolution: { type: \"v2\", value: new THREE.Vector2() },\r\n\r\n uRandomVector: { type: \"v3\", value: new THREE.Vector3() },\r\n uSunDirection: { type: \"v3\", value: new THREE.Vector3() },\r\n\r\n uCameraMatrix: { type: \"m4\", value: new THREE.Matrix4() },\r\n\r\n uShortBoxInvMatrix: { type: \"m4\", value: new THREE.Matrix4() },\r\n uShortBoxNormalMatrix: { type: \"m3\", value: new THREE.Matrix3() },\r\n\r\n uTallBoxInvMatrix: { type: \"m4\", value: new THREE.Matrix4() },\r\n uTallBoxNormalMatrix: { type: \"m3\", value: new THREE.Matrix3() },\r\n\r\n uCeilInvMatrix: { type: \"m4\", value: new THREE.Matrix4() },\r\n uCeilNormalMatrix: { type: \"m3\", value: new THREE.Matrix3() },\r\n \r\n uMovableSpherePos1: { type: \"v3\", value: new THREE.Vector3(0.0, -2000.0, -500.0) },\r\n uMovableSpherePos2: { type: \"v3\", value: new THREE.Vector3(0.0, -2000.0, -500.0) }\r\n // uMovableSpherePos: { type: \"v3\", value: new THREE.Vector3(0.0, 200.0, -500.0) }\r\n };\r\n\r\n pathTracingDefines = {\r\n //NUMBER_OF_TRIANGLES: total_number_of_triangles\r\n };\r\n\r\n // load vertex and fragment shader files that are used in the pathTracing material, mesh and scene\r\n fileLoader.load('shaders/common_PathTracing_Vertex.glsl', function (shaderText) {\r\n pathTracingVertexShader = shaderText;\r\n\r\n createPathTracingMaterial();\r\n });\r\n\r\n} // end function initPathTracingShaders()", "title": "" }, { "docid": "3b0b8c0a680e118ceef68d7f20e7eaa1", "score": "0.6781784", "text": "constructor(gl, vsPath, fsPath, vsSource, fsSource, vsSubs, fsSubs) {\nvar a, i, j, k, ref, ref1, shprog, sz, u, vsfsStr;\nthis.gl = gl;\nthis.vsPath = vsPath;\nthis.fsPath = fsPath;\nthis.vsSource = vsSource;\nthis.fsSource = fsSource;\nthis.vsSubs = vsSubs;\nthis.fsSubs = fsSubs;\n//----------\nthis._prog = null; // WebGL program.\nthis._vs = null; // WebGL vertex shader.\nthis._fs = null; // WebGL fragment shader.\nthis._nUniforms = -1; // Number of uniforms.\nthis._uniforms = {}; // Uniform locations.\nthis._nAttributes = -1; // Number of attributes.\nthis._attributes = {}; // Attribute locations.\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Max Vert Uniforms: ${this.gl.getParameter(this.gl.MAX_VERTEX_UNIFORM_VECTORS)}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Max Frag Uniforms: ${this.gl.getParameter(this.gl.MAX_FRAGMENT_UNIFORM_VECTORS)}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Vert source: ${this.vsSource}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Frag source: ${this.fsSource}`);\n}\n// Load vertex and fragment shaders, performing substitutions if any.\nthis._vs = this._loadShader(this.vsPath, this.vsSource, this.vsSubs);\nthis._fs = this._loadShader(this.fsPath, this.fsSource, this.fsSubs);\n// Create and link the program\nshprog = this.gl.createProgram();\nif (this._vs && this._fs) {\nthis.gl.attachShader(shprog, this._vs);\nif (this._fs) {\nthis.gl.attachShader(shprog, this._fs);\n}\n// Keep Chrome happy\nthis.gl.bindAttribLocation(shprog, 0, \"BindPos\");\nthis.gl.linkProgram(shprog);\n}\nvsfsStr = `VrtxS=${this.vsPath} FragS=${this.fsPath}`;\nif (this.gl.getProgramParameter(shprog, this.gl.LINK_STATUS)) {\nif (typeof lggr.info === \"function\") {\nlggr.info(`Shader: Program using: ${vsfsStr} created`);\n}\nthis._prog = shprog;\n} else {\nlggr.warn(`Shader: Program using: ${vsfsStr} failed to link: ${this.gl.getProgramInfoLog(shprog)}`);\nthis.gl.deleteProgram(shprog);\nthis._vs = this._fs = null;\n}\nif (this._prog) {\n// Grab uniforms.\nthis._nUniforms = this.gl.getProgramParameter(this._prog, this.gl.ACTIVE_UNIFORMS);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${this._nUniforms} Uniform Variables used ####`);\n}\nsz = 0;\nfor (i = j = 0, ref = this._nUniforms; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {\nu = this.gl.getActiveUniform(this._prog, i);\nthis._uniforms[u.name] = this.gl.getUniformLocation(this._prog, u.name);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${u.name} size ${(this.gl.getActiveUniform(this._prog, i)).size}`);\n}\nsz += (this.gl.getActiveUniform(this._prog, i)).size;\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${sz} Shader Uniforms used ####`);\n}\n// Grab attributes.\nthis._nAttributes = this.gl.getProgramParameter(this._prog, this.gl.ACTIVE_ATTRIBUTES);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${this._nAttributes} Active Attributes`);\n}\nfor (i = k = 0, ref1 = this._nAttributes; (0 <= ref1 ? k < ref1 : k > ref1); i = 0 <= ref1 ? ++k : --k) {\na = this.gl.getActiveAttrib(this._prog, i);\nthis._attributes[a.name] = this.gl.getAttribLocation(this._prog, a.name);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${a.name}: ${this._attributes[a.name]}`);\n}\n}\n}\nthis.DO_CHECK_LOC_NAME = false;\n}", "title": "" }, { "docid": "e4aa6074f4422fa4c2e8902cb4ace7ba", "score": "0.6667663", "text": "function initShaders() { \n no_light_shaderProgram=loadShaders(\"nolighting_shader-fs\",\"nolighting_shader-vs\",false);\n shaderProgram=loadShaders( \"shader-fs\",\"shader-vs\",true);}", "title": "" }, { "docid": "f13bb55a4e13b44c79e94a3ee467217d", "score": "0.6524899", "text": "function setupShaders() {\n __shaders.vertexShader_normal = document.getElementById(\"vertexShader_normal\").text;\n __shaders.fragmentShader_normal = document.getElementById(\"fragmentShader_normal\").text;\n}", "title": "" }, { "docid": "26254842641a1ccf829f0a779dbb8394", "score": "0.6397624", "text": "constructor(vertexShaderPath, fragmentShaderPath) {\r\n // instance variables\r\n // Convention: all instance variables: mVariables\r\n this.mCompiledShader = null; // reference to the compiled shader in webgl context \r\n this.mVertexPositionRef = null; // reference to VertexPosition within the shader\r\n this.mPixelColorRef = null; // reference to the pixelColor uniform in the fragment shader\r\n this.mModelMatrixRef = null; // reference to model transform matrix in vertex shader\r\n this.mCameraMatrixRef = null; // reference to the View/Projection matrix in the vertex shader\r\n\r\n let gl = glSys.get();\r\n // \r\n // Step A: load and compile vertex and fragment shaders\r\n this.mVertexShader = compileShader(vertexShaderPath, gl.VERTEX_SHADER);\r\n this.mFragmentShader = compileShader(fragmentShaderPath, gl.FRAGMENT_SHADER);\r\n\r\n // Step B: Create and link the shaders into a program.\r\n this.mCompiledShader = gl.createProgram();\r\n gl.attachShader(this.mCompiledShader, this.mVertexShader);\r\n gl.attachShader(this.mCompiledShader, this.mFragmentShader);\r\n gl.linkProgram(this.mCompiledShader);\r\n\r\n // Step C: check for error\r\n if (!gl.getProgramParameter(this.mCompiledShader, gl.LINK_STATUS)) {\r\n throw new Error(\"Shader linking failed with [\" + vertexShaderPath + \" \" + fragmentShaderPath +\"].\");\r\n return null;\r\n }\r\n\r\n // Step D: Gets a reference to the aVertexPosition attribute within the shaders.\r\n this.mVertexPositionRef = gl.getAttribLocation(this.mCompiledShader, \"aVertexPosition\");\r\n\r\n // Step E: Gets references to the uniform variables\r\n this.mPixelColorRef = gl.getUniformLocation(this.mCompiledShader, \"uPixelColor\");\r\n this.mModelMatrixRef = gl.getUniformLocation(this.mCompiledShader, \"uModelXformMatrix\");\r\n this.mCameraMatrixRef = gl.getUniformLocation(this.mCompiledShader, \"uCameraXformMatrix\");\r\n }", "title": "" }, { "docid": "277e725c9cc239276bac8ba462f62479", "score": "0.6369481", "text": "function left_foot_initShaders() {\n left_foot_shaderProgram=loadShaders(left_foot_gl, \"shader-fs\",\"shader-vs\",true); \n left_foot_no_light_shaderProgram=loadShaders(left_foot_gl, \"nolighting_shader-fs\",\"nolighting_shader-vs\",false);}", "title": "" }, { "docid": "b3576683980db017719aa919ae72625a", "score": "0.6308239", "text": "function u$3(u,c){const p=u.vertex.code,v=u.fragment.code;1!==c.output&&3!==c.output||(u.include(r$9,{linearDepth:!0}),u.include(t$b,c),u.include(e$9,c),u.include(e$7,c),u.include(c$6,c),u.vertex.uniforms.add(\"cameraNearFar\",\"vec2\"),u.varyings.add(\"depth\",\"float\"),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),p.add(t$i`void main(void) {\nvpos = calculateVPos();\nvpos = subtractOrigin(vpos);\nvpos = addVerticalOffset(vpos, localOrigin);\ngl_Position = transformPositionWithDepth(proj, view, vpos, cameraNearFar, depth);\nforwardTextureCoordinates();\n}`),u.include(r$h,c),v.add(t$i`\n void main(void) {\n discardBySlice(vpos);\n ${c.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputDepth(depth);\n }\n `)),2===c.output&&(u.include(r$9,{linearDepth:!1}),u.include(o$8,c),u.include(l$5,c),u.include(t$b,c),u.include(e$9,c),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),u.vertex.uniforms.add(\"viewNormal\",\"mat4\"),u.varyings.add(\"vPositionView\",\"vec3\"),p.add(t$i`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n ${0===c.normalType?t$i`\n vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n forwardTextureCoordinates();\n }\n `),u.include(c$6,c),u.include(r$h,c),v.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${c.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n\n ${3===c.normalType?t$i`\n vec3 normal = screenDerivativeNormal(vPositionView);`:t$i`\n vec3 normal = normalize(vNormalWorld);\n if (gl_FrontFacing == false) normal = -normal;`}\n gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);\n }\n `)),4===c.output&&(u.include(r$9,{linearDepth:!1}),u.include(t$b,c),u.include(e$9,c),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),p.add(t$i`void main(void) {\nvpos = calculateVPos();\nvpos = subtractOrigin(vpos);\nvpos = addVerticalOffset(vpos, localOrigin);\ngl_Position = transformPosition(proj, view, vpos);\nforwardTextureCoordinates();\n}`),u.include(c$6,c),u.include(r$h,c),u.include(r$e),v.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${c.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputHighlight();\n }\n `));}", "title": "" }, { "docid": "93c98ebf7cf8916ce06e902e8ace7545", "score": "0.6291827", "text": "function initGL() {\r\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\r\n gl.useProgram(prog);\r\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\r\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\r\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\r\n u_projection = gl.getUniformLocation(prog, \"projection\");\r\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\r\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\r\n u_lightPositionA= gl.getUniformLocation(prog, \"lightPositionA\");\r\n u_lightPositionB= gl.getUniformLocation(prog, \"lightPositionB\");\r\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\r\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\r\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\r\n u_color = gl.getUniformLocation(prog, \"color\");\r\n u_spotLightDir = gl.getUniformLocation(prog, \"spotLightDir\");\r\n u_day = gl.getUniformLocation(prog, \"day\");\r\n a_coords_buffer = gl.createBuffer();\r\n a_normal_buffer = gl.createBuffer();\r\n index_buffer = gl.createBuffer();\r\n gl.enable(gl.DEPTH_TEST);\r\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5);\r\n gl.uniform4f(u_diffuseColor, 1, 1, 1, 1);\r\n gl.uniform1f(u_specularExponent, 10); \r\n gl.uniform4f(u_lightPosition, lightPositions[0][0], lightPositions[0][1], lightPositions[0][2], lightPositions[0][3]); \r\n gl.uniform4f(u_lightPositionA, lightPositions[1][0], lightPositions[1][1], lightPositions[1][2], lightPositions[1][3]);\r\n gl.uniform4f(u_lightPositionB, lightPositions[2][0], lightPositions[2][1], lightPositions[2][2], lightPositions[2][3]);\r\n}", "title": "" }, { "docid": "05226c16d8ab7c6da89606b8989c0e46", "score": "0.6233258", "text": "function j$2(j){const E=new n$8,O=E.vertex.code,_=E.fragment.code;return E.vertex.uniforms.add(\"proj\",\"mat4\").add(\"view\",\"mat4\").add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\"),E.include(o$7),E.varyings.add(\"vpos\",\"vec3\"),E.include(e$9,j),E.include(n$9,j),E.include(t$f,j),0!==j.output&&7!==j.output||(E.include(o$8,j),E.include(r$9,{linearDepth:!1}),j.offsetBackfaces&&E.include(e$8),j.instancedColor&&E.attributes.add(\"instanceColor\",\"vec4\"),E.varyings.add(\"vNormalWorld\",\"vec3\"),E.varyings.add(\"localvpos\",\"vec3\"),j.multipassTerrainEnabled&&E.varyings.add(\"depth\",\"float\"),E.include(t$b,j),E.include(a$5,j),E.include(r$7,j),E.include(r$6,j),E.vertex.uniforms.add(\"externalColor\",\"vec4\"),E.varyings.add(\"vcolorExt\",\"vec4\"),O.add(t$i`\n void main(void) {\n forwardNormalizedVertexColor();\n vcolorExt = externalColor;\n ${j.instancedColor?\"vcolorExt *= instanceColor;\":\"\"}\n vcolorExt *= vvColor();\n vcolorExt *= getSymbolColor();\n forwardColorMixMode();\n\n if (vcolorExt.a < ${t$i.float(o$f)}) {\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n }\n else {\n vpos = calculateVPos();\n localvpos = vpos - view[3].xyz;\n vpos = subtractOrigin(vpos);\n vNormalWorld = dpNormal(vvLocalNormal(normalModel()));\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n ${j.offsetBackfaces?\"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, camPos);\":\"\"}\n }\n ${j.multipassTerrainEnabled?t$i`depth = (view * vec4(vpos, 1.0)).z;`:\"\"}\n forwardLinearDepth();\n forwardTextureCoordinates();\n }\n `)),7===j.output&&(E.include(c$6,j),E.include(r$h,j),j.multipassTerrainEnabled&&(E.fragment.include(a$6),E.include(r$c,j)),E.fragment.uniforms.add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\").add(\"opacity\",\"float\").add(\"layerOpacity\",\"float\"),E.fragment.uniforms.add(\"view\",\"mat4\"),j.hasColorTexture&&E.fragment.uniforms.add(\"tex\",\"sampler2D\"),E.fragment.include(i$7),_.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${j.multipassTerrainEnabled?t$i`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${j.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n ${j.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:t$i`vec4 texColor = vec4(1.0);`}\n ${j.attributeColor?t$i`\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:t$i`\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\n `}\n\n gl_FragColor = vec4(opacity_);\n }\n `)),0===j.output&&(E.include(c$6,j),E.include(l$4,j),E.include(o$6,j),E.include(r$h,j),j.receiveShadows&&E.include(i$9,j),j.multipassTerrainEnabled&&(E.fragment.include(a$6),E.include(r$c,j)),E.fragment.uniforms.add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\").add(\"ambient\",\"vec3\").add(\"diffuse\",\"vec3\").add(\"opacity\",\"float\").add(\"layerOpacity\",\"float\"),E.fragment.uniforms.add(\"view\",\"mat4\"),j.hasColorTexture&&E.fragment.uniforms.add(\"tex\",\"sampler2D\"),E.include(r$a,j),E.include(a$4,j),E.fragment.include(i$7),_.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${j.multipassTerrainEnabled?t$i`terrainDepthTest(gl_FragCoord, depth);`:\"\"}\n ${j.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n ${j.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:t$i`vec4 texColor = vec4(1.0);`}\n vec3 viewDirection = normalize(vpos - camPos);\n ${1===j.pbrMode?\"applyPBRFactors();\":\"\"}\n float ssao = evaluateAmbientOcclusionInverse();\n ssao *= getBakedOcclusion();\n\n float additionalAmbientScale = _oldHeuristicLighting(vpos + localOrigin);\n vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n ${j.receiveShadows?\"float shadow = readShadowMap(vpos, linearDepth);\":1===j.viewingMode?\"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);\":\"float shadow = 0.0;\"}\n vec3 matColor = max(ambient, diffuse);\n ${j.attributeColor?t$i`\n vec3 albedo_ = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:t$i`\n vec3 albedo_ = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\n `}\n ${t$i`\n vec3 shadedNormal = normalize(vNormalWorld);\n albedo_ *= 1.2;\n vec3 viewForward = - vec3(view[0][2], view[1][2], view[2][2]);\n float alignmentLightView = clamp(dot(-viewForward, lightingMainDirection), 0.0, 1.0);\n float transmittance = 1.0 - clamp(dot(-viewForward, shadedNormal), 0.0, 1.0);\n float treeRadialFalloff = vColor.r;\n float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);\n additionalLight += backLightFactor * lightingMainIntensity;`}\n ${1===j.pbrMode||2===j.pbrMode?1===j.viewingMode?t$i`vec3 normalGround = normalize(vpos + localOrigin);`:t$i`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:t$i``}\n ${1===j.pbrMode||2===j.pbrMode?t$i`\n float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];\n vec3 shadedColor = evaluateSceneLightingPBR(shadedNormal, albedo_, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:\"vec3 shadedColor = evaluateSceneLighting(shadedNormal, albedo_, shadow, 1.0 - ssao, additionalLight);\"}\n gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);\n ${j.OITEnabled?\"gl_FragColor = premultiplyAlpha(gl_FragColor);\":\"\"}\n }\n `)),E.include(u$3,j),E}", "title": "" }, { "docid": "12707887bcb069db79ba667a4c4aef3b", "score": "0.6224798", "text": "function initShaders() {\n // Load the shaders and compile them (shaders are located in the HTML)\n var vertexShader = loadShader( gl.VERTEX_SHADER, document.getElementById('vshader').innerHTML );\n var fragmentShader = loadShader( gl.FRAGMENT_SHADER, document.getElementById('fshader').innerHTML );\n \n // Create the program object\n var programObject = gl.createProgram();\n gl.attachShader(programObject, vertexShader);\n gl.attachShader(programObject, fragmentShader);\n gl_program = programObject;\n \n // link the program\n gl.linkProgram(gl_program);\n \n // verify link\n var linked = gl.getProgramParameter(gl_program, gl.LINK_STATUS);\n if( !linked && !gl.isContextLost()) {\n var infoLog = gl.getProgramInfoLog(gl_program);\n window.console.log(\"Error linking program:\\n\" + infoLog);\n gl.deleteProgram(gl_program);\n return;\n }\n \n // Get the uniform/attribute locations\n gl_program_loc.uMVMatrix = gl.getUniformLocation(gl_program, \"uMVMatrix\");\n gl_program_loc.uPMatrix = gl.getUniformLocation(gl_program, \"uPMatrix\");\n gl_program_loc.uNMatrix = gl.getUniformLocation(gl_program, \"uNMatrix\");\n gl_program_loc.uColor = gl.getUniformLocation(gl_program, \"uColor\");\n gl_program_loc.uLighting = gl.getUniformLocation(gl_program, \"uLighting\");\n gl_program_loc.aPosition = gl.getAttribLocation(gl_program, \"aPosition\");\n}", "title": "" }, { "docid": "6e800d8a7c584b61ee02c3b21d5207b7", "score": "0.621403", "text": "cacheGLUniformLocations() {\nvar ssuLoc, ssuaLoc;\n//----------------------\nssuLoc = (unm) => {\nreturn this.skinningShader.getUniformLocation(unm);\n};\nssuaLoc = function(uanm) {\nreturn ssuLoc(`${uanm}[0]`);\n};\nthis.uniformMVMat = ssuLoc(\"ModelViewMat\");\nthis.uniformMVPMat = ssuLoc(\"ModelViewProjMat\");\nif (this.DO_TRX_BONE_UNIFORMS) {\nif (!this.TEST_CPU_TRX_TO_MAT) {\nif (this.USE_TEXTURES) {\nthis.uniformSkelXformsWidth = ssuLoc(\"SkelXformsWidth\");\nthis.uniformSkelXformsHeight = ssuLoc(\"SkelXformsHeight\");\nthis.uniformSkelXforms = ssuLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistWidth = ssuLoc(\"BoneTwistWidth\");\nthis.uniformBoneTwistHeight = ssuLoc(\"BoneTwistHeight\");\nthis.uniformBoneTwistData = ssuLoc(\"BoneTwistData\");\n}\n} else {\nthis.uniformSkelXforms = ssuaLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistData = ssuaLoc(\"BoneTwistData\");\n}\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\nthis.uniformMorphWeights = ssuLoc(\"MorphWeights\");\nreturn this.uniformTexture = ssuLoc(\"Texture\");\n}", "title": "" }, { "docid": "5accbf2e17ccc0f1e4c1ee412fb90608", "score": "0.6205531", "text": "function initShaders() {\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\tvar shaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\tif (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\t\talert(\"Could not initialise shaders\");\n\t}\n\tgl.useProgram(shaderProgram);\n\n\tconst attrs = {\n\t\taVertexPosition: OBJ.Layout.POSITION.key,\n\t\taVertexNormal: OBJ.Layout.NORMAL.key,\n\t\taTextureCoord: OBJ.Layout.UV.key,\n\t\taDiffuse: OBJ.Layout.DIFFUSE.key,\n\t\taSpecular: OBJ.Layout.SPECULAR.key,\n\t\taSpecularExponent: OBJ.Layout.SPECULAR_EXPONENT.key\n\t};\n\n\tshaderProgram.attrIndices = {};\n\tfor (const attrName in attrs) {\n\t\tif (!attrs.hasOwnProperty(attrName)) {\n\t\t\tcontinue;\n\t\t}\n\t\tshaderProgram.attrIndices[attrName] = gl.getAttribLocation(shaderProgram, attrName);\n\t\tif (shaderProgram.attrIndices[attrName] != -1) {\n\t\t\tgl.enableVertexAttribArray(shaderProgram.attrIndices[attrName]);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t'Shader attribute \"' +\n\t\t\t\tattrName +\n\t\t\t\t'\" not found in shader. Is it undeclared or unused in the shader code?'\n\t\t\t);\n\t\t}\n\t}\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n\n\tshaderProgram.applyAttributePointers = function(model) {\n\t\tconst layout = model.mesh.vertexBuffer.layout;\n\t\tfor (const attrName in attrs) {\n\t\t\tif (!attrs.hasOwnProperty(attrName) || shaderProgram.attrIndices[attrName] == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst layoutKey = attrs[attrName];\n\t\t\tif (shaderProgram.attrIndices[attrName] != -1) {\n\t\t\t\tconst attr = layout[layoutKey];\n\t\t\t\tgl.vertexAttribPointer(\n\t\t\t\t\tshaderProgram.attrIndices[attrName],\n\t\t\t\t\tattr.size,\n\t\t\t\t\tgl[attr.type],\n\t\t\t\t\tattr.normalized,\n\t\t\t\t\tattr.stride,\n\t\t\t\t\tattr.offset\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\treturn shaderProgram;\n}", "title": "" }, { "docid": "5187017a2f6af859fc57cda3fbc3cd5a", "score": "0.6205418", "text": "function main(){\n var vertices = getVertices();\n var indices = getIndices();\n\n const vertSource = getVertSource();\n const toySource = getToySource();\n const lightSource = getLightSource();\n\n const canvas = document.getElementById('glCanvas');\n const gl = canvas.getContext(\"webgl2\");\n\n if(!gl){\n alert(\"Could not initialize WebGL2!\");\n return;\n }\n\n canvas.onmousedown = handleMouseDown;\n document.onmousemove = handleMouseMove;\n document.onmouseup = handleMouseUp;\n\n\n gl.viewport(0, 0, 885, 885);\n gl.clearColor(0.1, 0.1, 0.1, 1.0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n\n view = mat4.lookAt(view,\n cameraPosition, //pos\n cameraTarget, //target\n cameraUp //up\n );\n projection = mat4.perspective(projection,\n Math.PI / 4,\n 895 / 895,\n 1.0,\n 100.0\n );\n\n const spToy = initShaders(gl, vertSource, toySource);\n const spLight = initShaders(gl, vertSource, lightSource);\n var vertBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n\n vao[0] = gl.createVertexArray();\n vao[1] = gl.createVertexArray();\n gl.bindVertexArray(vao[0]);\n var offset = 0;\n var stride = 8 * FLOAT_SIZE; //Number of floats per vertex * sizeof(float)\n //Shader location 0\n gl.enableVertexAttribArray(0);\n gl.vertexAttribPointer(0, 3, gl.FLOAT, false, stride, offset);\n offset = 3 * FLOAT_SIZE;\n //Shader location 1\n gl.enableVertexAttribArray(1);\n gl.vertexAttribPointer(1, 3, gl.FLOAT, false, stride, offset);\n offset = 6 * FLOAT_SIZE;\n //Shader location 2\n gl.enableVertexAttribArray(2);\n gl.vertexAttribPointer(2, 2, gl.FLOAT, false, stride, offset);\n\n gl.bindVertexArray(vao[1]);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertBuffer);\n\n gl.enableVertexAttribArray(0);\n gl.vertexAttribPointer(0, 3, gl.FLOAT, false, stride, 0);\n\n textureSpec = gl.createTexture();\n var imageSpec = document.getElementById(\"spec\");\n gl.bindTexture(gl.TEXTURE_2D, textureSpec);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imageSpec);\n gl.generateMipmap(gl.TEXTURE_2D);\n\n texture = gl.createTexture();\n var image = document.getElementById('texture');\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n gl.generateMipmap(gl.TEXTURE_2D);\n\n renderLoop(gl, spToy, spLight);\n}", "title": "" }, { "docid": "3ba59d6a74a4f12cd4a9e96fcecc99ba", "score": "0.61844224", "text": "init() {\n // Set up shader\n this.shader_loc =\n createProgram(gl, this.VERTEX_SHADER, this.FRAGMENT_SHADER);\n if (!this.shader_loc) {\n console.log(this.constructor.name +\n '.init() failed to create executable Shaders on the GPU.');\n return;\n }\n gl.program = this.shader_loc;\n\n this.vbo_loc = gl.createBuffer();\n if (!this.vbo_loc) {\n console.log(this.constructor.name +\n '.init() failed to create VBO in GPU.');\n return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo_loc);\n gl.bufferData(gl.ARRAY_BUFFER, this.vbo, gl.STATIC_DRAW);\n\n // Set up attributes\n this.attributes.forEach((attribute, i) => {\n attribute.location =\n gl.getAttribLocation(this.shader_loc, attribute.name);\n if (attribute.locaiton < 0) {\n console.log(this.constructor.name +\n '.init() Failed to get GPU location of ' +\n attribute.name);\n return;\n }\n });\n\n // Set up uniforms\n this.u_mvp_matrix_loc =\n gl.getUniformLocation(this.shader_loc, 'u_mvp_matrix_' + this.box_num);\n if (!this.u_mvp_matrix_loc) {\n console.log(this.constructor.name +\n '.init() failed to get GPU location for u_mvp_matrix_' + this.box_num + ' uniform');\n return;\n }\n\n // Set up texture for raytraced image\n if (this.box_num == 1) {\n this.u_texture_location = gl.createTexture();\n if (!this.u_texture_location) {\n console.log(this.constructor.name +\n '.init() failed to create the texture object');\n return;\n }\n\n this.u_sampler_location = gl.getUniformLocation(this.shader_loc, 'u_sampler_' + this.box_num);\n if (!this.u_sampler_location) {\n console.log(this.constructor.name +\n '.init() failed to get GPU location for u_sampler_' + this.box_num + ' uniform');\n return;\n }\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.u_texture_location);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, g_scene.buffer.width, g_scene.buffer.height, 0, gl.RGB, gl.UNSIGNED_BYTE, g_scene.buffer.iBuf);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n }\n }", "title": "" }, { "docid": "dbdaa2fd590a66f1b5fb0109a29282f6", "score": "0.6147522", "text": "getShaders() {\n return Object.assign({}, super.getShaders(), {\n // inject: https://github.com/uber/luma.gl/blob/master/docs/api-reference/shadertools/assemble-shaders.md\n inject: {\n 'vs:#decl': `\n uniform float coef;\n `,\n 'vs:#main-end': `\n if (coef > 0.0) {\n vec4 pct = vec4(segmentRatio);\n pct.a = step(coef, segmentRatio);\n vec4 colorA = instanceSourceColors;\n vec4 colorB = vec4(instanceTargetColors.r, instanceTargetColors.g, instanceTargetColors.b, 0.0);\n vec4 color = mix(colorA, colorB, pct) / 255.;\n vColor = color;\n }\n `,\n 'fs:#main-start': `\n if (vColor.a == 0.0) discard;\n `,\n },\n });\n }", "title": "" }, { "docid": "45ca36c7009fd137d25c74727b9afb23", "score": "0.61368763", "text": "function linkShaders() {\n console.log(`*** INFO: Linking shaders... ***`);\n let program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error(`*** ERROR linking program ***`, gl.getProgramInfoLog(program));\n return;\n }\n console.log(`*** INFO: Validating program... ***`);\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error(`*** ERROR validating program ***`, gl.getProgramInfoLog(program));\n return;\n }\n setupBuffers();\n linkAttributes(program);\n gl.useProgram(program);\n\n time_location = gl.getUniformLocation(program, `u_time`);\n resolution_location = gl.getUniformLocation(program, `u_resolution`);\n mouse_location = gl.getUniformLocation(program, `u_mouse`);\n colshift_location = gl.getUniformLocation(program, `u_colshift`);\n if (!started) {\n t0 = Date.now();\n }\n started = true;\n render(program); \n }", "title": "" }, { "docid": "2d268ec6065c1db17d5bec2ad0c596db", "score": "0.61164093", "text": "function generateTracerFragmentSource(objects) {\n return `\nprecision highp float;\n\nconst int MAX_RECURSION = 1;\nconst float EPSILON = 0.0001;\nconst float INFINITY = 100000.0;\nconst float PI = 3.1415926535897932384;\n\nuniform vec3 cameraPos;\nvarying vec3 primaryRayDir;\nuniform float time;\n`\n+ concat(objects, function(o){ return o.getGlobalCode(); }) +\n`\nfloat intersectSphere(vec3 rayOrigin, vec3 rayDir, float sphereRadius, \n mat4 sphereModel, mat4 sphereInvModel) {\n \n vec3 localRayOrigin = vec3(sphereInvModel * vec4(rayOrigin, 1.0));\n vec3 localRayDir = vec3(sphereInvModel * vec4(rayDir, 0.0));\n\n float a = dot(localRayDir, localRayDir);\n float b = 2.0 * dot(localRayOrigin, localRayDir);\n float c = dot(localRayOrigin, localRayOrigin) - sphereRadius * sphereRadius;\n float disc = b*b - 4.0*a*c;\n \n if (disc > 0.0) {\n float e = sqrt(disc);\n float denom = 2.0*a;\n \n float t = (-b - e) / denom; // smaller root\n if (t > 0.0) {\n //vec3 tPoint = localRayOrigin + localRayDir * t;\n //tPoint = vec3(sphereModel * vec4(tPoint, 1.0));\n //return distance(rayOrigin, tPoint);\n return t;\n }\n \n t = (-b + e) / denom; // larger root\n if (t > 0.0) {\n //vec3 tPoint = localRayOrigin + localRayDir * t;\n //tPoint = vec3(sphereModel * vec4(tPoint, 1.0));\n //return distance(rayOrigin, tPoint);\n return t;\n }\n }\n \n return INFINITY;\n}\n\nfloat intersectPlane(vec3 rayOrigin, vec3 rayDir, mat4 planeModel, mat4 planeInvModel) {\n vec3 localRayOrigin = vec3(planeInvModel * vec4(rayOrigin, 1.0));\n vec3 localRayDir = vec3(planeInvModel * vec4(rayDir, 0.0));\n \n vec3 planeNormal = vec3(0, 1, 0);\n float t = (dot(-localRayOrigin, planeNormal)) / dot(localRayDir, planeNormal);\n\t\n\tif(t > 0.0){\n\t\treturn t;\n\t}\n\t\n\treturn INFINITY;\n}\n\nfloat intersectRect(vec3 rayOrigin, vec3 rayDir, float rectA, float rectB, \n mat4 rectModel, mat4 rectInvModel) {\n \n vec3 localRayOrigin = vec3(rectInvModel * vec4(rayOrigin, 1.0));\n vec3 localRayDir = vec3(rectInvModel * vec4(rayDir, 0.0));\n \n vec3 rectAVec = vec3(rectA, 0, 0), rectBVec = vec3(0, 0, rectB);\n vec3 rectNormal = cross(rectAVec, rectBVec);\n \n float t = (dot(-localRayOrigin, rectNormal)) / dot(localRayDir, rectNormal);\n\t\n\tif(t > 0.0){\n\t vec3 d = localRayOrigin + localRayDir * t;\n\t \n\t float ddota = dot(d, rectAVec);\n\t float ddotb = dot(d, rectBVec);\n\t if (ddota > 0.0 && ddota < rectA*rectA && ddotb > 0.0 && ddotb < rectB*rectB) {\n\t return t;\n\t }\n\t}\n\t\n\treturn INFINITY;\n}\n\nfloat intersectCube(vec3 rayOrigin, vec3 rayDir, vec3 cubeMin, vec3 cubeMax, \n mat4 cubeModel, mat4 cubeInvModel) {\n \n vec3 localRayOrigin = vec3(cubeInvModel * vec4(rayOrigin, 1.0));\n vec3 localRayDir = vec3(cubeInvModel * vec4(rayDir, 0.0));\n \n vec3 tMin = (cubeMin - localRayOrigin) / localRayDir;\n vec3 tMax = (cubeMax - localRayOrigin) / localRayDir;\n vec3 t1 = min(tMin, tMax);\n vec3 t2 = max(tMin, tMax);\n float tNear = max(max(t1.x, t1.y), t1.z);\n float tFar = min(min(t2.x, t2.y), t2.z);\n \n if(tNear > 0.0 && tNear < tFar) {\n return tNear;\n }\n \n return INFINITY;\n}\n\nbool isZero(float x) {\n return (x > -1E-9 && x < 1E-9);\n}\n\nfloat cbrt(float x) {\n return (x > 0.0 ? pow(x, 1.0/3.0) : (x < 0.0 ? -pow(-x, 1.0/3.0) : 0.0));\n}\n\nint solveQuadric(float c[3], inout float s[2]) {\n float p, q, D;\n\n // normal form: x^2 + px + q = 0\n\n p = c[1] / (2.0 * c[2]);\n q = c[0] / c[2];\n\n D = p * p - q;\n\n if (isZero(D)) {\n \ts[0] = -p;\n \treturn 1;\n } else if (D > 0.0) {\n \tfloat sqrt_D = sqrt(D);\n \n \ts[0] = sqrt_D - p;\n \ts[1] = -sqrt_D - p;\n \treturn 2;\n }\n \n // else if (D < 0.0)\n return 0;\n}\n\nint solveCubic(float c[4], inout float s[3]) {\n int num;\n float sub;\n float A, B, C;\n float sq_A, p, q;\n float cb_p, D;\n\n // normal form: x^3 + Ax^2 + Bx + C = 0\n A = c[ 2 ] / c[ 3 ];\n B = c[ 1 ] / c[ 3 ];\n C = c[ 0 ] / c[ 3 ];\n\n // substitute x = y - A/3 to eliminate quadric term: x^3 +px + q = 0\n sq_A = A * A;\n p = 1.0/3.0 * (- 1.0/3.0 * sq_A + B);\n q = 1.0/2.0 * (2.0/27.0 * A * sq_A - 1.0/3.0 * A * B + C);\n\n // use Cardano's formula\n cb_p = p * p * p;\n D = q * q + cb_p;\n\n if (isZero(D)) {\n\t\tif (isZero(q)) { \n\t\t // one triple solution\n\t\t s[ 0 ] = 0.0;\n\t\t num = 1;\n \t} else { \n \t // one single and one double solution\n \t float u = cbrt(-q);\n \t s[ 0 ] = 2.0 * u;\n \t s[ 1 ] = - u;\n \t num = 2;\n\t }\n } else if (D < 0.0) { \n // Casus irreducibilis: three real solutions\n\t\tfloat phi = 1.0/3.0 * acos(-q / sqrt(-cb_p));\n\t\tfloat t = 2.0 * sqrt(-p);\n\n\t\ts[ 0 ] = t * cos(phi);\n\t\ts[ 1 ] = - t * cos(phi + PI / 3.0);\n\t\ts[ 2 ] = - t * cos(phi - PI / 3.0);\n\t\tnum = 3;\n } else { \n // one real solution\n\t\tfloat sqrt_D = sqrt(D);\n\t\tfloat u = cbrt(sqrt_D - q);\n\t\tfloat v = - cbrt(sqrt_D + q);\n\n\t\ts[ 0 ] = u + v;\n\t\tnum = 1;\n }\n\n // resubstitute\n sub = 1.0/3.0 * A;\n for (int i = 0; i < 3; ++i) {\n if (i >= num) break;\n\t s[ i ] -= sub;\n }\n\n return num;\n}\n\nint solveQuartic(float c[5], inout float s[4]) {\n float coeffs[4];\n float z, u, v, sub;\n float A, B, C, D;\n float sq_A, p, q, r;\n int num;\n\n // normal form: x^4 + Ax^3 + Bx^2 + Cx + D = 0\n A = c[ 3 ] / c[ 4 ];\n B = c[ 2 ] / c[ 4 ];\n C = c[ 1 ] / c[ 4 ];\n D = c[ 0 ] / c[ 4 ];\n\n // substitute x = y - A/4 to eliminate cubic term: x^4 + px^2 + qx + r = 0\n sq_A = A * A;\n p = - 3.0/8.0 * sq_A + B;\n q = 1.0/8.0 * sq_A * A - 1.0/2.0 * A * B + C;\n r = - 3.0/256.0*sq_A*sq_A + 1.0/16.0*sq_A*B - 1.0/4.0*A*C + D;\n\n if (isZero(r)) {\n\t\t// no absolute term: y(y^3 + py + q) = 0\n\t\tfloat cubeS[3];\n\t\t\n\t\tcoeffs[ 0 ] = q;\n\t\tcoeffs[ 1 ] = p;\n\t\tcoeffs[ 2 ] = 0.0;\n\t\tcoeffs[ 3 ] = 1.0;\n\t\t\n\t\tcubeS[ 0 ] = s[0];\n cubeS[ 1 ] = s[1];\n cubeS[ 2 ] = s[2];\n\n\t\tnum = solveCubic(coeffs, cubeS);\n\t\t\n\t\ts[ 0 ] = cubeS[ 0 ];\n\t\ts[ 1 ] = cubeS[ 1 ];\n\t\ts[ 2 ] = cubeS[ 2 ];\n\n // s[ num++ ] = 0.0\n for (int i = 0; i < 4; i++) {\n if (i == num) {\n s[ i ] = 0.0;\n num++;\n break;\n }\n }\n } else {\n\t\t// solve the resolvent cubic ...\n\t\tfloat cubeS[3];\n\t\t\n\t\tcoeffs[ 0 ] = 1.0/2.0 * r * p - 1.0/8.0 * q * q;\n\t\tcoeffs[ 1 ] = - r;\n\t\tcoeffs[ 2 ] = - 1.0/2.0 * p;\n\t\tcoeffs[ 3 ] = 1.0;\n\t\t\n cubeS[ 0 ] = s[0];\n cubeS[ 1 ] = s[1];\n cubeS[ 2 ] = s[2];\n \n\t\tsolveCubic(coeffs, cubeS);\n\t\t\n\t\ts[ 0 ] = cubeS[ 0 ];\n\t\ts[ 1 ] = cubeS[ 1 ];\n\t\ts[ 2 ] = cubeS[ 2 ];\n\n\t\t// ... and take the one real solution ...\n\t\tz = s[ 0 ];\n\n\t\t// ... to build two quadric equations\n\t\tu = z * z - r;\n\t\tv = 2.0 * z - p;\n\n\t\tif (isZero(u))\n\t\t u = 0.0;\n\t\telse if (u > 0.0)\n\t\t u = sqrt(u);\n\t\telse\n\t\t return 0;\n\n\t\tif (isZero(v))\n\t\t v = 0.0;\n\t\telse if (v > 0.0)\n\t\t v = sqrt(v);\n\t\telse\n\t\t return 0;\n\n float quadCoeffs[3];\n float quadS[2];\n \n\t\tquadCoeffs[ 0 ] = z - u;\n\t\tquadCoeffs[ 1 ] = q < 0.0 ? -v : v;\n\t\tquadCoeffs[ 2 ] = 1.0;\n\n quadS[ 0 ] = s[ 0 ];\n quadS[ 1 ] = s[ 1 ];\n \n\t\tnum = solveQuadric(quadCoeffs, quadS);\n\t\t\n\t\ts[ 0 ] = quadS[ 0 ];\n\t\ts[ 1 ] = quadS[ 1 ];\n\n\t\tquadCoeffs[ 0 ] = z + u;\n\t\tquadCoeffs[ 1 ] = q < 0.0 ? v : -v;\n\t\tquadCoeffs[ 2 ] = 1.0;\n\n for (int i = 0; i <= 2; i++) {\n if (i == num) {\n quadS[ 0 ] = s[ i ];\n quadS[ 1 ] = s[ i+1 ];\n break;\n }\n }\n \n\t\tint num2 = solveQuadric(quadCoeffs, quadS);\n\t\t\n\t\tfor (int i = 0; i <= 2; i++) {\n if (i == num) {\n s[ i ] = quadS[ 0 ];\n\t\t s[ i+1 ] = quadS[ 1 ];\n break;\n }\n }\n\t\t\n\t\tnum += num2;\n\t}\n\n // resubstitute\n sub = 1.0/4.0 * A;\n for (int i = 0; i < 4; ++i) {\n if (i >= num) break;\n\t\ts[ i ] -= sub;\n }\n\n return num;\n}\n\nfloat intersectTorus(vec3 rayOrigin, vec3 rayDir, float a, float b, \n mat4 torusModel, mat4 torusInvModel) {\n \n vec3 localRayOrigin = vec3(torusInvModel * vec4(rayOrigin, 1.0));\n vec3 localRayDir = vec3(torusInvModel * vec4(rayDir, 0.0));\n \n float x1 = localRayOrigin.x, y1 = localRayOrigin.y, z1 = localRayOrigin.z,\n d1 = localRayDir.x, d2 = localRayDir.y, d3 = localRayDir.z;\n \n float coeffs[5]; // coefficient array for the quartic equation\n float roots[4]; // solution array for the quartic equation\n \n // define the coefficients of the quartic equation\n\tfloat sum_d_sqrd \t= d1 * d1 + d2 * d2 + d3 * d3;\n\tfloat e\t\t\t = x1 * x1 + y1 * y1 + z1 * z1 - a * a - b * b;\n\tfloat f\t\t\t = x1 * d1 + y1 * d2 + z1 * d3;\n\tfloat four_a_sqrd\t= 4.0 * a * a;\n\t\n\tcoeffs[0] = e * e - four_a_sqrd * (b * b - y1 * y1); \t// constant term\n\tcoeffs[1] = 4.0 * f * e + 2.0 * four_a_sqrd * y1 * d2;\n\tcoeffs[2] = 2.0 * sum_d_sqrd * e + 4.0 * f * f + four_a_sqrd * d2 * d2;\n\tcoeffs[3] = 4.0 * sum_d_sqrd * f;\n\tcoeffs[4] = sum_d_sqrd * sum_d_sqrd; \t\t\t\t\t// coefficient of t^4\n\t\n\t// find roots of the quartic equation\n\tint num_real_roots = solveQuartic(coeffs, roots);\n \n if (num_real_roots > 0) {\n bool intersected = false;\n float t = INFINITY;\n \n // find the smallest root greater than 0, if any\n \t// the roots array is not sorted\n \tfor (int j = 0; j < 4; j++) {\n \t if (j >= num_real_roots) break;\n \t\tif (roots[j] > 0.0) {\n \t\t\tintersected = true;\n \t\t\tif (roots[j] < t) {\n \t\t\t\tt = roots[j];\n \t\t\t}\n \t\t}\n }\n \n if (intersected == true) {\n return t;\n }\n }\n \n return INFINITY;\n}\n\nfloat intersectCylinder(vec3 rayOrigin, vec3 rayDir, \n float cylBottom, float cylTop, float cylRadius, \n mat4 cylModel, mat4 cylInvModel) {\n \n vec3 localRayOrigin = vec3(cylInvModel * vec4(rayOrigin, 1.0));\n vec3 localRayDir = vec3(cylInvModel * vec4(rayDir, 0.0));\n \n float ox = localRayOrigin.x, oy = localRayOrigin.y, oz = localRayOrigin.z,\n dx = localRayDir.x, dy = localRayDir.y, dz = localRayDir.z;\n \n float a = dx * dx + dz * dz;\n float b = 2.0 * (ox * dx + oz * dz);\n float c = ox * ox + oz * oz - cylRadius * cylRadius;\n float disc = b * b - 4.0 * a * c;\n \n if (disc > 0.0) {\n float e = sqrt(disc);\n float denom = 2.0*a;\n \n float t0 = (-b - e) / denom; // smaller root\n float t1 = (-b + e) / denom; // larger root\n if (t0 > t1) {\n // swap t0 and t1\n float tmp = t0;\n t0 = t1;\n t1 = tmp;\n }\n \n float y0 = oy + t0 * dy;\n float y1 = oy + t1 * dy;\n \n if (y0 < cylBottom) {\n \tif (y1 >= cylBottom) {\n \t\t// hit the bottom cap\n \t\tfloat th = t0 + (t1-t0) * (y0 - cylBottom) / (y0-y1);\n \t\tif (th > 0.0) {\n \t\t // normal: vec3(0, -1, 0)\n \t\t return th;\n \t\t}\n \t}\n } else if (y0 >= cylBottom && y0 <= cylTop) {\n \t// hit the cylinder part\n \tif (t0 > 0.0) {\n \t return t0;\n \t}\n } else if (y0 > cylTop) {\n \tif (y1 <= cylTop) {\n \t\t// hit the top cap\n \t\tfloat th = t0 + (t1-t0) * (y0 - cylTop) / (y0-y1);\n \t\tif (th > 0.0) {\n \t\t // normal: vec3(0, 1, 0)\n \t\t return th;\n \t\t}\n \t}\n }\n }\n \n return INFINITY;\n}\n\nvec3 rayTrace(vec3 rayOrigin, vec3 rayDir) {\n vec3 colorMask = vec3(1.0);\n vec3 accumulatedColor = vec3(0.0);\n \n for (int i = 0; i < MAX_RECURSION; i++) {\n // find all intersections\n`\n+ concat(objects, function(o){ return o.getIntersectCode(); }) +\n`\n \n // find closest intersection\n float t = INFINITY;\n vec3 hitColor = vec3(0.0);\n`\n+ concat(objects, function(o){ return o.getClosestIntersectCode(); }) +\n`\n // intersection point\n vec3 hitPoint = rayOrigin + rayDir * t;\n \n // calculate color\n if (t < INFINITY) {\n accumulatedColor += colorMask * hitColor;\n }\n \n // next ray origin\n rayOrigin = hitPoint;\n }\n \n return accumulatedColor;\n}\n\nvoid main() {\n gl_FragColor = vec4(rayTrace(cameraPos, primaryRayDir), 1.0);\n}\n `;\n}", "title": "" }, { "docid": "e642762e4abb09a35d1cf45ed4b72eb0", "score": "0.61067986", "text": "function setUpShaders() {\n //\n var vertexShader = scene.assetManager.loadShader (\n ShaderType.VERTEX_SHADER,\n PositionColor.VERTEX_SHADER_SOURCE\n );\n\n var fragmentShader = scene.assetManager.loadShader (\n ShaderType.FRAGMENT_SHADER,\n PositionColor.FRAGMENT_SHADER_SOURCE\n );\n\n shaderProgram =\n shaderHelper.setUpShaderProgram(vertexShader, fragmentShader);\n\n vertexPositionAttributeLocation =\n scene.graphicsManager.getAttributeLocation(shaderProgram, 'vertexPosition');\n\n transformUniformLocation =\n scene.graphicsManager.getUniformLocation(shaderProgram, 'transform');\n }", "title": "" }, { "docid": "2263d16ecd49f1b2c3725c5b334883d6", "score": "0.61039567", "text": "function initShaders() { \n \n Shader = (function() {\n \n var UNIFORM_SETTER = {};\n\n // Return the number of elements for GL type\n var getTypeLength = function(type) {\n\n switch(type) {\n case gl.FLOAT_MAT4:\n return 4*4;\n case gl.FLOAT_MAT3:\n return 3*3;\n case gl.FLOAT_MAT2:\n return 2*2;\n case gl.FLOAT_VEC4:\n case gl.INT_VEC4:\n case gl.BOOL_VEC4:\n return 4;\n case gl.FLOAT_VEC3:\n case gl.INT_VEC3:\n case gl.BOOL_VEC3:\n return 3;\n case gl.FLOAT_VEC2:\n case gl.INT_VEC2:\n case gl.BOOL_VEC2:\n return 2;\n default:\n return 1;\n }\n \n }\n\n // Map GL type to a uniform setter method\n UNIFORM_SETTER[gl.FIXED] = gl.uniform1i;\n UNIFORM_SETTER[gl.SHORT] = gl.uniform1i;\n UNIFORM_SETTER[gl.UNSIGNED_BYTE] = gl.uniform1i;\n UNIFORM_SETTER[gl.BYTE] = gl.uniform1i;\n UNIFORM_SETTER[gl.INT] = gl.uniform1i;\n UNIFORM_SETTER[gl.UNSIGNED_INT] = gl.uniform1i;\n UNIFORM_SETTER[gl.FLOAT] = gl.uniform1f;\n UNIFORM_SETTER[gl.SAMPLER_2D] = gl.uniform1i;\n\n UNIFORM_SETTER[gl.FLOAT_MAT4] = gl.uniformMatrix4fv;\n UNIFORM_SETTER[gl.FLOAT_MAT3] = gl.uniformMatrix3fv;\n UNIFORM_SETTER[gl.FLOAT_MAT2] = gl.uniformMatrix2fv;\n\n UNIFORM_SETTER[gl.FLOAT_VEC2] = gl.uniform2fv;\n UNIFORM_SETTER[gl.FLOAT_VEC3] = gl.uniform3fv;\n UNIFORM_SETTER[gl.FLOAT_VEC4] = gl.uniform4fv;\n UNIFORM_SETTER[gl.INT_VEC2] = gl.uniform2iv;\n UNIFORM_SETTER[gl.INT_VEC3] = gl.uniform3iv;\n UNIFORM_SETTER[gl.INT_VEC4] = gl.uniform4iv;\n UNIFORM_SETTER[gl.BOOL] = gl.uniform1i;\n UNIFORM_SETTER[gl.BOOL_VEC2] = gl.uniform2iv;\n UNIFORM_SETTER[gl.BOOL_VEC3] = gl.uniform3iv;\n UNIFORM_SETTER[gl.BOOL_VEC4] = gl.uniform4iv;\n\n var defaultShader = null; // Default shader program\n var programCache = {}; // Store of all loading shader programs\n\n \n // Get and Compile and fragment or vertex shader by ID.\n // (shader source is currently embeded within HTML file)\n function getShader(gl, id) {\n var shaderScript = doc.getElementById(id);\n if (!shaderScript) {\n return null;\n }\n\n var str = \"\";\n var k = shaderScript.firstChild;\n while (k) {\n if (k.nodeType == 3) {\n str += k.textContent;\n }\n k = k.nextSibling;\n }\n\n var shader;\n if (shaderScript.type == \"x-shader/x-fragment\") {\n shader = gl.createShader(gl.FRAGMENT_SHADER);\n } else if (shaderScript.type == \"x-shader/x-vertex\") {\n shader = gl.createShader(gl.VERTEX_SHADER);\n } else {\n return null;\n }\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n return shader;\n }\n \n // Shader data object\n // - program: GL Shader program\n // - meta: list of metadata about GL Shader program (uniform names/types)\n function createShaderObj(shaderProgram) {\n return {\n program: shaderProgram,\n meta: getShaderData(shaderProgram)\n };\n }\n \n\n // Create, load and link a GL shader program \n function loadShaderProgram(v,f) {\n \n v = \"Shaders/vpBasic.cg\" // ab: temp \n //f = \"fpXRAY.cg\";\n \n v = v.split(\".cg\").join(\"\");\n f = f.split(\".cg\").join(\"\");\n \n var name = v+\"+\"+f;\n \n if (programCache[name]) {\n return programCache[name];\n }\n \n var fragmentShader = getShader(gl, f);\n var vertexShader = getShader(gl, v);\n \n if (!fragmentShader || !vertexShader) {\n console.error(\"missing shader \"+ name)\n return null;\n }\n \n var shaderProgram = gl.createProgram();\n \n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n console.error(\"LINK_STATUS error\")\n return null;\n }\n \n var shaderObj = createShaderObj(shaderProgram); \n var attribute = shaderObj.meta.attribute;\n\n gl.useProgram(shaderProgram);\n\n gl.enableVertexAttribArray(attribute.aVertexPosition.location);\n gl.enableVertexAttribArray(attribute.aTextureCoord.location);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, gl.box.vertexObject);\n gl.vertexAttribPointer(attribute.aVertexPosition.location, gl.box.vertexObject.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.box.texCoordObject);\n gl.vertexAttribPointer(attribute.aTextureCoord.location, gl.box.texCoordObject.itemSize, gl.FLOAT, false, 0, 0);\n\n shaderProgram = createShaderObj(shaderProgram)\n programCache[name] = shaderProgram;\n \n if (!defaultShader) {\n defaultShader = shaderObj;\n }\n \n return shaderObj;\n }\n\n // Create shader program metadata (uniform names/types)\n var getShaderData = function(shader) {\n \n var meta = {uniforms:[], uniform:{}, attribute:{}};\n\n var keys = [],i;\n for (i in gl) {\n keys.push(i);\n }\n keys = keys.sort();\n\n var rgl = {}\n\n keys.forEach(function(key) {\n rgl[gl[key]] = key;\n })\n\n var info;\n var i = 0;\n var len = gl.getProgramParameter(shader, gl.ACTIVE_UNIFORMS)\n \n while (i<len) {\n \n info = gl.getActiveUniform(shader,i);\n meta.uniforms.push(info.name);\n meta.uniform[info.name] = {\n name: info.name,\n glType: info.type,\n type: rgl[info.type],\n length: getTypeLength(info.type),\n idx: i,\n location: gl.getUniformLocation(shader, info.name)\n };\n \n i++;\n }\n\n len = gl.getProgramParameter(shader, gl.ACTIVE_ATTRIBUTES)\n i = 0;\n while (i<len) {\n info = gl.getActiveAttrib(shader,i);\n meta.attribute[info.name] = {\n name: info.name,\n glType: info.type,\n type: rgl[info.type],\n length: getTypeLength(info.type),\n idx: i,\n location: gl.getAttribLocation(shader, info.name)\n };\n i++;\n }\n \n return meta;\n\n }\n\n // (createShader maps to this method)\n return function(v,f) {\n \n var glShader = loadShaderProgram(v,f) || defaultShader;\n \n var shaderValues = {\n alpha: 1\n };\n \n var self = this;\n \n // Create getter/setters for all uniforms and textures on Shader object\n glShader.meta.uniforms.forEach(function(name) {\n var uniform = glShader.meta.uniform[name];\n var len = uniform.length;\n var name = uniform.name;\n var vals = shaderValues;\n (name != \"uMVMatrix\" && name != \"uMVMatrix\")&&Object.defineProperty(self, uniform.name, {\n get: function() {\n return vals[name];\n },\n set: function(v) {\n if (v && v.length !== len) {\n v.length = len;\n }\n vals[name] = v;\n }\n }); \n });\n \n // Draw leaf node\n // (mv matrix, primary texture passed in)\n // [internal method]\n this.__draw = function(gl, mv, imageTexture) {\n \n var usetter = UNIFORM_SETTER;\n var meta = glShader.meta;\n var uniform = meta.uniform;\n var uniforms = meta.uniforms;\n var name, val, u, i = uniforms.length;\n \n // Change shader program if different from last draw\n //if (gl.currentShaderProgram !== glShader) {\n gl.currentShaderProgram = glShader;\n gl.useProgram(glShader.program);\n gl.uniformMatrix4fv(uniform.uPMatrix.location, false, gl.perspectiveMatrixArray);\n //}\n \n // set mv matrix\n gl.uniformMatrix4fv(uniform.uMVMatrix.location, false, mv);\n \n // add primary texture to shader values\n var vals = shaderValues;\n \n if (imageTexture) {\n vals.texture = imageTexture;\n }\n\n var textureSlot = 0;\n \n // Iterate over uniforms and textures setting values from JS to shader program\n while (i--) { \n name = uniforms[i];\n val = vals[name];\n u = uniform[name];\n \n if (val !== undefined && val !== null) {\n if (u.glType === gl.SAMPLER_2D) { // if texture\n gl.activeTexture(gl['TEXTURE'+textureSlot]);\n gl.bindTexture(gl.TEXTURE_2D, val);\n val = textureSlot++;\n }\n usetter[u.glType].apply(gl, [u.location, val]); // uses uniform setter map to set value\n }\n }\n \n // Draw call\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n \n }\n \n this.__getShaderProgram = function() {\n return glShader.program;\n }\n\n }\n\n })(gl);\n \n var defaultShader = new Shader(\"Shaders/vpBasic.cg\", \"Shaders/fpAlphaTexture.cg\");\n\n\n }", "title": "" }, { "docid": "971ad7a0e90cc22522a6f90dcac35739", "score": "0.6100866", "text": "function initShaders() {\n //get shader source\n \n var fs_source = fragmentShaderSource;\n var vs_source = vertexShaderSource;\n\n //compile shaders \n vertexShader = makeShader(vs_source, gl.VERTEX_SHADER);\n fragmentShader = makeShader(fs_source, gl.FRAGMENT_SHADER);\n \n //create program\n glProgram_terreno = gl.createProgram();\n \n //attach and link shaders to the program\n gl.attachShader(glProgram_terreno, vertexShader);\n gl.attachShader(glProgram_terreno, fragmentShader);\n gl.linkProgram(glProgram_terreno);\n\n if (!gl.getProgramParameter(glProgram_terreno, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n\n //use program\n gl.useProgram(glProgram_terreno);\n \n\n glProgram_terreno.vertexPositionAttribute = gl.getAttribLocation(glProgram_terreno, \"aPosition\");\n gl.enableVertexAttribArray(glProgram_terreno.vertexPositionAttribute);\n\n glProgram_terreno.textureCoordAttribute = gl.getAttribLocation(glProgram_terreno, \"aUv\");\n gl.enableVertexAttribArray(glProgram_terreno.textureCoordAttribute);\n\n glProgram_terreno.vertexNormalAttribute = gl.getAttribLocation(glProgram_terreno, \"aNormal\");\n if (glProgram_terreno.vertexNormalAttribute != -1){ //Por optimizaciones del compilador que elimina variables no utilizadas\n gl.enableVertexAttribArray(glProgram_terreno.vertexNormalAttribute);\n }\n\n glProgram_terreno.pMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uPMatrix\");\n glProgram_terreno.mMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uMMatrix\");\n glProgram_terreno.vMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uVMatrix\");\n glProgram_terreno.nMatrixUniform = gl.getUniformLocation(glProgram_terreno, \"uNMatrix\");\n glProgram_terreno.traslacionTextura = gl.getUniformLocation(glProgram_terreno, \"traslacionTextura\");\n glProgram_terreno.samplerUniform = gl.getUniformLocation(glProgram_terreno, \"uSampler\");\n glProgram_terreno.useLightingUniform = gl.getUniformLocation(glProgram_terreno, \"uUseLighting\");\n glProgram_terreno.uColor = gl.getUniformLocation(glProgram_terreno, \"uAmbientColor\");\n glProgram_terreno.frameUniform = gl.getUniformLocation(glProgram_terreno, \"time\");\n glProgram_terreno.lightingDirectionUniform = gl.getUniformLocation(glProgram_terreno, \"uLightPosition\");\n glProgram_terreno.directionalColorUniform = gl.getUniformLocation(glProgram_terreno, \"uDirectionalColor\");\n\n glProgram_terreno.lightingDirectionUniform2 = gl.getUniformLocation(glProgram_terreno, \"uLightPosition2\");\n glProgram_terreno.directionalColorUniform2 = gl.getUniformLocation(glProgram_terreno, \"uDirectionalColor2\");\n //glProgram_terreno.uColor = gl.getUniformLocation(glProgram_terreno, \"uColor\");\n\n var fs_source2 = fragmentShaderSource2;\n var vs_source2 = vertexShaderSource2;\n\n //compile shaders \n vertexShader = makeShader(vs_source2, gl.VERTEX_SHADER);\n fragmentShader = makeShader(fs_source2, gl.FRAGMENT_SHADER);\n \n //create program\n glProgram_helicoptero = gl.createProgram();\n \n //attach and link shaders to the program\n gl.attachShader(glProgram_helicoptero, vertexShader);\n gl.attachShader(glProgram_helicoptero, fragmentShader);\n gl.linkProgram(glProgram_helicoptero);\n\n if (!gl.getProgramParameter(glProgram_helicoptero, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n\n //use program\n gl.useProgram(glProgram_helicoptero);\n \n glProgram_helicoptero.textureCoordAttribute = gl.getAttribLocation(glProgram_helicoptero, \"aUv\");\n gl.enableVertexAttribArray(glProgram_helicoptero.textureCoordAttribute);\n\n glProgram_helicoptero.vertexPositionAttribute = gl.getAttribLocation(glProgram_helicoptero, \"aPosition\");\n gl.enableVertexAttribArray(glProgram_helicoptero.vertexPositionAttribute);\n\n glProgram_helicoptero.vertexNormalAttribute = gl.getAttribLocation(glProgram_helicoptero, \"aNormal\");\n gl.enableVertexAttribArray(glProgram_helicoptero.vertexNormalAttribute); \n \n glProgram_helicoptero.uColor = gl.getUniformLocation(glProgram_helicoptero, \"uColor\");\n\n glProgram_helicoptero.lightingDirectionUniform = gl.getUniformLocation(glProgram_helicoptero, \"uLightPosition\");\n glProgram_helicoptero.directionalColorUniform = gl.getUniformLocation(glProgram_helicoptero, \"uDirectionalColor\");\n}", "title": "" }, { "docid": "ff46e498df68deb66ec1d9f013b61490", "score": "0.6091035", "text": "function setupShaders() {\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 aVertexPosition; // vertex position\n uniform mat4 upvmMatrix; // the project view model matrix\n\n void main(void) {\n \n // vertex position\n gl_Position = upvmMatrix * vec4(aVertexPosition, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n precision mediump float; // set float to medium precision\n \n // material properties\n uniform vec3 uDiffuse; // the diffuse reflectivity\n \n void main(void) {\n gl_FragColor = vec4(uDiffuse, 1.0); \n }\n `;\n \n try {\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n \n // locate and enable vertex attributes\n vPosAttribLoc = gl.getAttribLocation(shaderProgram, \"aVertexPosition\"); // ptr to vertex pos attrib\n gl.enableVertexAttribArray(vPosAttribLoc); // connect attrib to array\n \n // locate vertex uniforms\n pvmMatrixULoc = gl.getUniformLocation(shaderProgram, \"upvmMatrix\"); // ptr to pvmmat\n \n // locate fragment uniforms\n colorULoc = gl.getUniformLocation(shaderProgram, \"uDiffuse\"); // ptr to diffuse\n\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "title": "" }, { "docid": "f144053eb18b790699c2f8f2a92eccbd", "score": "0.60759616", "text": "function postInitShaders(sources) {\n\tshaders = [];\n\tprogramInfo = [];\n\tfor(i = 0; i < sources.length / 2; i++) {\n\t\tconst shaderProgram = initShaderProgram(gl, sources[i * 2], sources[i * 2 + 1]);\n\t\tconst info = {\n\t\t\tprogram: shaderProgram,\n\t\t\tattribLocations: {\n\t\t\t\tvertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'),\n\t\t\t\tintensity: gl.getAttribLocation(shaderProgram, 'aVertexColorIntensity'),\n\t\t\t\tfragNormals: gl.getAttribLocation(shaderProgram, 'fNormal'),\n\t\t\t},\n\t\t\tuniformLocations: {\n\t\t\t\tmousePosition: gl.getUniformLocation(shaderProgram, 'mousePosition'),\n\t\t\t\ttime: gl.getUniformLocation(shaderProgram, 'time'),\n\t\t\t\taspectRatio: gl.getUniformLocation(shaderProgram, 'aspectRatio'),\n\t\t\t\trgbSpeed: gl.getUniformLocation(shaderProgram, 'rgbSpeed'),\n\t\t\t\tlightPosition: gl.getUniformLocation(shaderProgram, \"lightPosition\"),\n\t\t\t\tisLightDirectional: gl.getUniformLocation(shaderProgram, \"isLightDirectional\"),\n\t\t\t\tmozaicEnabled: gl.getUniformLocation(shaderProgram, \"mozaicEnabled\"),\n\t\t\t\tmozaicMinDotAngle: gl.getUniformLocation(shaderProgram, \"mozaicMinDotAngle\"),\n\t\t\t\tmozaicTopLeftColor: gl.getUniformLocation(shaderProgram, \"mozaicTopLeftColor\"),\n\t\t\t\tmozaicTopRightColor: gl.getUniformLocation(shaderProgram, \"mozaicTopRightColor\"),\n\t\t\t\tmozaicBottomLeftColor: gl.getUniformLocation(shaderProgram, \"mozaicBottomLeftColor\"),\n\t\t\t\tmozaicBottomRightColor: gl.getUniformLocation(shaderProgram, \"mozaicBottomRightColor\"),\n\t\t\t}\n\t\t};\n\t\tshaders[i] = shaderProgram;\n\t\tprogramInfo[i] = info;\n\t}\n\tshadersInitialized = true;\n}", "title": "" }, { "docid": "fff26a655fe63a43832292d5deb1c825", "score": "0.6068689", "text": "function setupShaders() {\r\n \r\n // define fragment shader in essl using es6 template strings\r\n var fShaderCode = `\r\n precision mediump float;\r\n varying vec4 v_Color;\r\n void main(void) {\r\n gl_FragColor = v_Color; // all fragments are white\r\n }\r\n `;\r\n \r\n // define vertex shader in essl using es6 template strings\r\n var vShaderCode = `\r\n attribute vec3 vertexPosition;\r\n attribute vec3 diffuse;\r\n attribute vec3 ambient;\r\n attribute vec3 specular;\r\n varying vec4 v_Color;\r\n uniform mat4 uModelMatrix; // the model matrix\r\n uniform mat4 view; // the view matrix\r\n uniform mat4 projection;\r\n uniform mat4 modelMatrix;\r\n uniform mat4 viewMatrix;\r\n // Apply lighting effect\r\n attribute highp vec3 Norm;\r\n attribute highp vec3 Half;\r\n attribute highp vec3 Light;\r\n attribute highp float n;\r\n\r\n void main(void) {\r\n // position \r\n gl_Position = projection * view * uModelMatrix * vec4(vertexPosition, 1.0);\r\n //color\r\n float NdotL = dot(normalize(vec3(view * uModelMatrix * vec4(Norm, 0.0))), normalize(vec3(view * uModelMatrix * vec4(Light, 0.0))));\r\n float NdotH = dot(normalize(vec3(view * uModelMatrix * vec4(Norm, 0.0))), normalize(vec3(view * uModelMatrix * vec4(Half, 0.0))));\r\n float maxNdotL = max(NdotL, 0.0);\r\n float maxNdotH = max(NdotH, 0.0);\r\n v_Color = vec4(ambient, 1.0) + vec4(diffuse * maxNdotL, 1.0) + vec4(specular * pow(maxNdotH, n), 1.0);\r\n \r\n }\r\n `;\r\n \r\n try {\r\n // console.log(\"fragment shader: \"+fShaderCode);\r\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\r\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\r\n gl.compileShader(fShader); // compile the code for gpu execution\r\n\r\n // console.log(\"vertex shader: \"+vShaderCode);\r\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\r\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\r\n gl.compileShader(vShader); // compile the code for gpu execution\r\n \r\n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\r\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \r\n gl.deleteShader(fShader);\r\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\r\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \r\n gl.deleteShader(vShader);\r\n } else { // no compile errors\r\n var shaderProgram = gl.createProgram(); // create the single shader program\r\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\r\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\r\n gl.linkProgram(shaderProgram); // link program into gl context\r\n\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\r\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\r\n } else { // no shader program link errors\r\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\r\n vertexPositionAttrib = // get pointer to vertex shader input\r\n gl.getAttribLocation(shaderProgram, \"vertexPosition\"); \r\n modelMatrixULoc = gl.getUniformLocation(shaderProgram, \"uModelMatrix\"); // ptr to mmat\r\n view = gl.getUniformLocation(shaderProgram, \"view\"); // ptr to mmat\r\n projection = gl.getUniformLocation(shaderProgram, \"projection\"); // ptr to mmat\r\n\r\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\r\n //color\r\n diffuse = gl.getAttribLocation(shaderProgram, 'diffuse');\r\n gl.enableVertexAttribArray(diffuse);\r\n ambient = gl.getAttribLocation(shaderProgram, 'ambient');\r\n gl.enableVertexAttribArray(ambient);\r\n specular = gl.getAttribLocation(shaderProgram, 'specular');\r\n gl.enableVertexAttribArray(specular);\r\n\r\n //vectors\r\n Norm = gl.getAttribLocation(shaderProgram, 'Norm');\r\n gl.enableVertexAttribArray(Norm);\r\n Light = gl.getAttribLocation(shaderProgram, 'Light');\r\n gl.enableVertexAttribArray(Light);\r\n Half = gl.getAttribLocation(shaderProgram, 'Half');\r\n gl.enableVertexAttribArray(Half);\r\n n = gl.getAttribLocation(shaderProgram, 'n');\r\n gl.enableVertexAttribArray(n);\r\n } // end if no shader program link errors\r\n } // end if no compile errors\r\n } // end try \r\n \r\n catch(e) {\r\n console.log(e);\r\n } // end catch\r\n} // end setup shaders", "title": "" }, { "docid": "b221d223721f3a8ed088ac2fa5f0ea3c", "score": "0.6067385", "text": "bind() {\n if (this.renderer.currentProgram !== this.defaultShader.program) {\n this.useShader(this.defaultShader);\n }\n }", "title": "" }, { "docid": "233949a53aa9fc92f22faf3b418affaa", "score": "0.60655814", "text": "start() {\n this.renderer.state.setState(this.state);\n this.renderer.shader.bind(this.shader);\n if (WebGLSettings_1.WebGLSettings.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.geometry.bind(this.vaos[this.vertexCount]);\n }\n }", "title": "" }, { "docid": "af27a61e2d8655eadce6e906b2861852", "score": "0.6063114", "text": "setup() {\n if (this.compile()) {\n let shaderManager = GameManager.activeGame.getShaderManager();\n if (shaderManager) {\n shaderManager.useShader(this);\n } else {\n this._gl.useProgram(this._program);\n }\n\n // cache some script locations:\n this.cacheUniformLocations(Object.keys(this.uniforms));\n this.cacheAttributeLocations(Object.keys(this.attributes));\n } else {\n this._logger.error(\"Shader setup failed\");\n }\n }", "title": "" }, { "docid": "a68d74770ef401ca76ac6e244fa8a4d1", "score": "0.6062871", "text": "function initShaders() {\r\n var fragmentShader = getShader(gl, \"shader-fs\");\r\n var vertexShader = getShader(gl, \"shader-vs\");\r\n\r\n // Create the shader program\r\n shaderProgram = gl.createProgram();\r\n gl.attachShader(shaderProgram, vertexShader);\r\n gl.attachShader(shaderProgram, fragmentShader);\r\n gl.linkProgram(shaderProgram);\r\n\r\n // If creating the shader program failed, alert\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\r\n alert(\"Unable to initialize the shader program.\");\r\n }\r\n\r\n // start using shading program for rendering\r\n gl.useProgram(shaderProgram);\r\n\r\n // store location of aVertexPosition variable defined in shader\r\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n\r\n // turn on vertex position attribute at specified position\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n // store location of aVertexNormal variable defined in shader\r\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\r\n\r\n // store location of aTextureCoord variable defined in shader\r\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\r\n\r\n // store location of uPMatrix variable defined in shader - projection matrix\r\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\r\n // store location of uMVMatrix variable defined in shader - model-view matrix\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n // store location of uSampler variable defined in shader\r\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\r\n}", "title": "" }, { "docid": "f9406f1897f3a76df1f537d6f6dc2c85", "score": "0.6057591", "text": "function initShaders(data) {\r\n var gl = data.context;\r\n\r\n data.pShader = gl.createProgram();\r\n\r\n data.vShader = gl.createShader(gl.VERTEX_SHADER);\r\n gl.shaderSource(data.vShader, getVertexShader());\r\n gl.compileShader(data.vShader);\r\n gl.attachShader(data.pShader, data.vShader);\r\n\r\n data.fShader = gl.createShader(gl.FRAGMENT_SHADER);\r\n gl.shaderSource(data.fShader, getFragmentShader());\r\n gl.compileShader(data.fShader);\r\n gl.attachShader(data.pShader, data.fShader);\r\n\r\n gl.linkProgram(data.pShader);\r\n\r\n gl.useProgram(data.pShader);\r\n }", "title": "" }, { "docid": "cf9f23fe65352795e6e5a4d05dd1d21c", "score": "0.604331", "text": "constructor(_shader) {\n this.shader = _shader;\n // Creating vertex buffers.\n let vertices = new Float32Array([\n 1.0, 1.0, 0.0, // top right\n -1.0, 1.0, 0.0, // top left\n -1.0,-1.0, 0.0, // bottom left\n 1.0,-1.0, 0.0, // bottom right\n ]);\n let uvs = new Float32Array([\n 1.0, 0.0, \n 0.0, 0.0,\n 0.0, 1.0, \n 1.0, 1.0,\n ]);\n let indices = new Int8Array([\n 0,1,2,\n 0,2,3,\n ]);\n\n this.vertexBuffer = gl.createBuffer();\n this.uvBuffer = gl.createBuffer();\n this.indexBuffer = gl.createBuffer();\n\n // Create and bind new VAO\n this.vao = gl.createVertexArray();\n gl.bindVertexArray(this.vao);\n\n // Load indice data\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW, 0);\n\n // Load vertice data\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW, 0);\n let posLoc = this.shader.attribSpecs[\"a_Pos\"].location;\n gl.vertexAttribPointer(posLoc, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(posLoc);\n\n // Load UV data\n gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, uvs, gl.STATIC_DRAW, 0);\n let uvLoc = this.shader.attribSpecs[\"a_Texcoord\"].location;\n gl.vertexAttribPointer(uvLoc, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(uvLoc);\n\n gl.bindVertexArray(null);\n }", "title": "" }, { "docid": "a288da85a8d7f028b442912b78d2319e", "score": "0.60405624", "text": "enableShaderPass() {\n if(this.stacks.scenePasses.length && this.stacks.renderPasses.length === 0 && this.renderer.planes.length) {\n this.renderer.state.scenePassIndex = 0;\n this.renderer.bindFrameBuffer(this.stacks.scenePasses[0].target);\n }\n }", "title": "" }, { "docid": "88a0155f2b3b55858a4cc2f34f7754eb", "score": "0.6032407", "text": "constructor()\n\t{\n\t\t// Compile the shader program\n\t\tthis.prog = InitShaderProgram( modelVS, modelFS );\n\t\t// Get the ids of the uniform variables in the shaders\n\t\tthis.mvp = gl.getUniformLocation( this.prog, 'mvp' );\n\n\t\t// Get the ids of the vertex attributes in the shaders\n\t\tthis.vertPos = gl.getAttribLocation( this.prog, 'pos' );\n\n\t\tthis.txc = gl.getAttribLocation(this.prog,'txc');\n\n\n\n\t\tthis.mv_ = gl.getUniformLocation( this.prog, 'mv_' );\n\t\tthis.mv = gl.getAttribLocation( this.prog, 'mv' );\n\n\t\tthis.norm = gl.getUniformLocation( this.prog, 'norm' );\n\t\tthis.normals = gl.getAttribLocation( this.prog, 'normals' );\n\n\n\n\t\tthis.sampler = gl.getUniformLocation(this.prog,'tex');\n\n\t\tthis.swap = gl.getUniformLocation(this.prog,'swap');\n\n\t\tthis.toShow = gl.getUniformLocation(this.prog,'toShow');\n\n\n\t\tthis.x = gl.getUniformLocation(this.prog,'x');\n\t\tthis.y = gl.getUniformLocation(this.prog,'y');\n\t\tthis.z = gl.getUniformLocation(this.prog,'z');\n\t\tthis.shiny = gl.getUniformLocation(this.prog,'shiny');\n\n\t\tthis.vertbuffer = gl.createBuffer();\n\t\tthis.textureBuffer = gl.createBuffer();\n\t\tthis.normalBuffer = gl.createBuffer();\n\n\t}", "title": "" }, { "docid": "29a5d078d2e19847275648751db9f6af", "score": "0.60322636", "text": "function initShaders() {\n var fragmentShader = getShader(gl, \"shader-fs\");\n var vertexShader = getShader(gl, \"shader-vs\");\n \n // Create the shader program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n \n // If creating the shader program failed, alert\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n \n // start using shading program for rendering\n gl.useProgram(shaderProgram);\n \n // store location of aVertexPosition variable defined in shader\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n \n // turn on vertex position attribute at specified position\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n // store location of aTextureCoord variable defined in shader\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\n\n // turn on vertex texture coordinates attribute at specified position\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n // store location of uPMatrix variable defined in shader - projection matrix \n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n // store location of uMVMatrix variable defined in shader - model-view matrix \n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\n // store location of uSampler variable defined in shader\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n}", "title": "" }, { "docid": "e2c508329b4e29c7a9403580741b94d7", "score": "0.6024378", "text": "function setupterrianShaders(){\n var vertexShadert =loadShaderFromDOM(\"terrain-vs\");\n var fragmentShadert =loadShaderFromDOM(\"terrain-fs\");\n\n terrainProgram = gl.createProgram();\n gl.attachShader(terrainProgram, vertexShadert);\n gl.attachShader(terrainProgram, fragmentShadert);\n gl.linkProgram(terrainProgram);\n\n if (!gl.getProgramParameter(terrainProgram, gl.LINK_STATUS)){\n alert(\"Failed to setup terrainshaders\");\n }\n\n gl.useProgram(terrainProgram);\n\n terrainProgram.vertexNormalAttribute =gl.getAttribLocation(terrainProgram, \"aVertexNormalt\");\n console.log(\"Vex norm attrib: \", terrainProgram.vertexNormalAttribute);\n gl.enableVertexAttribArray(terrainProgram.vertexNormalAttribute);\n\n terrainProgram.vertexPositionAttribute = gl.getAttribLocation(terrainProgram, \"aVertexPositiont\");\n console.log(\"Vertex Position attrib: \", terrainProgram.vertexPositionAttribute);\n gl.enableVertexAttribArray(terrainProgram.vertexPositionAttribute);\n\n terrainProgram.textureCoordAttribute = gl.getAttribLocation(terrainProgram, \"aTexCoord\");\n gl.enableVertexAttribArray(terrainProgram.textureCoordAttribute);\n\n terrainProgram.mvMatrixUniform = gl.getUniformLocation(terrainProgram, \"uMVMatrixt\");\n terrainProgram.pMatrixUniform = gl.getUniformLocation(terrainProgram, \"uPMatrixt\");\n terrainProgram.nMatrixUniform = gl.getUniformLocation(terrainProgram, \"uNMatrixt\");\n terrainProgram.uniformLightPositionLoc = gl.getUniformLocation(terrainProgram, \"uLightPosition\"); \n terrainProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(terrainProgram, \"uAmbientLightColor\"); \n terrainProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(terrainProgram, \"uDiffuseLightColor\");\n terrainProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(terrainProgram, \"uSpecularLightColor\");\n terrainProgram.TextureSamplerUniform = gl.getUniformLocation(terrainProgram, \"uImage\");\n\n \n}", "title": "" }, { "docid": "35c8962b00af406bb6e9929ae83307aa", "score": "0.6022882", "text": "function initGL() {\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\n gl.useProgram(prog);\n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n a_texcoords_loc = gl.getAttribLocation(prog, \"a_texcoords\");\n\n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_lightPosition= gl.getUniformLocation(prog, \"lightPosition\");\n u_diffuseColor = gl.getUniformLocation(prog, \"diffuseColor\");\n u_specularColor = gl.getUniformLocation(prog, \"specularColor\");\n u_specularExponent = gl.getUniformLocation(prog, \"specularExponent\");\n u_lightPositions = gl.getUniformLocation(prog, \"lightPositions\");\n u_attenuation = gl.getUniformLocation(prog, \"attenuation\");\n u_lightDir = gl.getUniformLocation(prog, \"lightDir\");\n u_drawMode = gl.getUniformLocation(prog, \"drawMode\");\n u_lightAngleLimit = gl.getUniformLocation(prog, \"lightAngleLimit\");\n u_lightEnable = gl.getUniformLocation(prog, \"enable\");\n u_texture = gl.getUniformLocation(prog, \"texture\");\n\n gl.clearColor(0.0,0.0,0.0,1.0);\n gl.enable(gl.DEPTH_TEST);\n\n gl.uniform3f(u_specularColor, 0.5, 0.5, 0.5); \n gl.uniform1f(u_specularExponent, 10);\n texture0 = gl.createTexture();\n\n}", "title": "" }, { "docid": "4f545e7e7e5d69349315d1edbd03c3d0", "score": "0.60202456", "text": "function setupShaders() {\n vertexShader = loadShaderFromDOM(\"shader-vs\");\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Failed to setup shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.uniformLightPositionLoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\");\n shaderProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgram, \"uAmbientLightColor\");\n shaderProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgram, \"uDiffuseLightColor\");\n shaderProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgram, \"uSpecularLightColor\");\n shaderProgram.uniformShininessLoc = gl.getUniformLocation(shaderProgram, \"uShininess\");\n shaderProgram.uniformAmbientMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKAmbient\");\n shaderProgram.uniformDiffuseMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKDiffuse\");\n shaderProgram.uniformSpecularMaterialColorLoc = gl.getUniformLocation(shaderProgram, \"uKSpecular\");\n\n shaderProgram.uSkyboxSampler = gl.getUniformLocation(shaderProgram, \"uSkyboxSampler\");\n shaderProgram.ucheckSky = gl.getUniformLocation(shaderProgram, \"ucheckSky\");\n\n\n}", "title": "" }, { "docid": "b03dab17b57fcdeb78c223f8d10963b6", "score": "0.6009168", "text": "@autobind\n shaderLoad() {\n this.shadersLoaded++;\n\n if (this.shadersLoaded === 2) {\n this.loadColors();\n }\n }", "title": "" }, { "docid": "09968a91e9b18a722320593aa2258116", "score": "0.60084736", "text": "constructor({ isMorphing, isSkinning, isLighting, isDebugging, colorAttachmentsNumber }, encodedDepthRenderPass) {\n super(_webgl_shaders_ShadowMapDecodeClassicShader__WEBPACK_IMPORTED_MODULE_7__[\"default\"].getInstance(), \"ShadowMapDecodeClassicShading\"\n + (isSkinning ? '+skinning' : '')\n + (isLighting ? '' : '-lighting'), { isMorphing, isSkinning, isLighting });\n this.__encodedDepthRenderPass = encodedDepthRenderPass;\n const encodedDepthFramebuffer = encodedDepthRenderPass.getFramebuffer();\n if (encodedDepthFramebuffer == null) {\n console.error('encodedDepthRenderPass does not have framebuffer');\n return;\n }\n const encodedDepthTexture = encodedDepthFramebuffer.colorAttachments[colorAttachmentsNumber];\n const viewport = encodedDepthRenderPass.getViewport();\n viewport.setComponents(1, 1, viewport.z - 1, viewport.w - 1);\n encodedDepthRenderPass.setViewport(viewport);\n const shaderSemanticsInfoArray = [\n {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].LightViewProjectionMatrix, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Mat4, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].VertexShader, isSystem: true, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].EveryTime, soloDatum: false,\n initialValue: _math_MutableMatrix44__WEBPACK_IMPORTED_MODULE_17__[\"default\"].zero(), min: -Number.MAX_VALUE, max: Number.MAX_VALUE,\n },\n {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].ShadingModel, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Int,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: false,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](_definitions_ShadingModel__WEBPACK_IMPORTED_MODULE_6__[\"ShadingModel\"].Constant.index), min: 0, max: 3,\n },\n {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].Shininess, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: false,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](5), min: 0, max: Number.MAX_VALUE,\n },\n {\n semantic: ShadowMapDecodeClassicSingleMaterialNode.AllowableDepthError, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: false,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](0.0001), min: 0, max: 1,\n },\n {\n semantic: ShadowMapDecodeClassicSingleMaterialNode.ShadowColorCoefficient, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Vec4, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: false,\n initialValue: new _math_Vector4__WEBPACK_IMPORTED_MODULE_4__[\"default\"](0.5, 0.5, 0.5, 1), min: 0, max: 1,\n },\n {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].DiffuseColorFactor, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Vec4, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: false,\n initialValue: new _math_Vector4__WEBPACK_IMPORTED_MODULE_4__[\"default\"](1, 1, 1, 1), min: 0, max: 2,\n },\n {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].DepthTexture, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Texture2D, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Int,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].EveryTime,\n initialValue: [0, encodedDepthTexture], min: 0, max: Number.MAX_SAFE_INTEGER,\n },\n {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].DiffuseColorTexture, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Texture2D, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Int,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].EveryTime,\n initialValue: [1, _core_AbstractMaterialNode__WEBPACK_IMPORTED_MODULE_1__[\"default\"].__dummyWhiteTexture], min: 0, max: Number.MAX_SAFE_INTEGER,\n },\n {\n semantic: ShadowMapDecodeClassicSingleMaterialNode.zNearInner, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: true, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].EveryTime, soloDatum: false,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](0.1), min: 0.0001, max: Number.MAX_SAFE_INTEGER\n },\n {\n semantic: ShadowMapDecodeClassicSingleMaterialNode.zFarInner, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: true, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].EveryTime, soloDatum: false,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](10000.0), min: 0.0001, max: Number.MAX_SAFE_INTEGER\n }\n ];\n shaderSemanticsInfoArray.push({\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].PointSize, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].VertexShader, isSystem: true, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: true,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](30.0), min: 0, max: 100,\n }, {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].PointDistanceAttenuation, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Vec3,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].VertexShader, isSystem: true, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: true,\n initialValue: new _math_Vector3__WEBPACK_IMPORTED_MODULE_5__[\"default\"](0.0, 0.1, 0.01), min: 0, max: 1,\n });\n if (isSkinning) {\n this.__definitions += '#define RN_IS_SKINNING\\n';\n }\n if (isLighting) {\n this.__definitions += '#define RN_IS_LIGHTING\\n';\n }\n if (isMorphing) {\n this.__definitions += '#define RN_IS_MORPHING\\n';\n shaderSemanticsInfoArray.push({\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].MorphTargetNumber, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Int, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Scalar,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].VertexShader, isSystem: true, soloDatum: true,\n initialValue: new _math_Scalar__WEBPACK_IMPORTED_MODULE_13__[\"default\"](0), min: 0, max: _core_Config__WEBPACK_IMPORTED_MODULE_14__[\"default\"].maxVertexMorphNumberInShader, needUniformInFastest: true\n }, {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].DataTextureMorphOffsetPosition, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].ScalarArray, maxIndex: _core_Config__WEBPACK_IMPORTED_MODULE_14__[\"default\"].maxVertexMorphNumberInShader,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].VertexShader, isSystem: true, soloDatum: true,\n initialValue: new _math_VectorN__WEBPACK_IMPORTED_MODULE_12__[\"default\"](new Float32Array(_core_Config__WEBPACK_IMPORTED_MODULE_14__[\"default\"].maxVertexMorphNumberInShader)), min: -Number.MAX_VALUE, max: Number.MAX_VALUE, needUniformInFastest: true\n }, {\n semantic: _definitions_ShaderSemantics__WEBPACK_IMPORTED_MODULE_0__[\"ShaderSemantics\"].MorphWeights, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].ScalarArray, maxIndex: _core_Config__WEBPACK_IMPORTED_MODULE_14__[\"default\"].maxVertexMorphNumberInShader,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].VertexShader, isSystem: true, soloDatum: true,\n initialValue: new _math_VectorN__WEBPACK_IMPORTED_MODULE_12__[\"default\"](new Float32Array(_core_Config__WEBPACK_IMPORTED_MODULE_14__[\"default\"].maxVertexMorphNumberInShader)), min: -Number.MAX_VALUE, max: Number.MAX_VALUE, needUniformInFastest: true\n });\n }\n if (isDebugging) {\n this.__definitions += '#define RN_IS_DEBUGGING\\n';\n shaderSemanticsInfoArray.push({\n semantic: ShadowMapDecodeClassicSingleMaterialNode.DebugColorFactor, compositionType: _definitions_CompositionType__WEBPACK_IMPORTED_MODULE_2__[\"CompositionType\"].Vec4, componentType: _definitions_ComponentType__WEBPACK_IMPORTED_MODULE_3__[\"ComponentType\"].Float,\n stage: _definitions_ShaderType__WEBPACK_IMPORTED_MODULE_8__[\"ShaderType\"].PixelShader, isSystem: false, updateInterval: _definitions_ShaderVariableUpdateInterval__WEBPACK_IMPORTED_MODULE_9__[\"ShaderVariableUpdateInterval\"].FirstTimeOnly, soloDatum: false,\n initialValue: new _math_Vector4__WEBPACK_IMPORTED_MODULE_4__[\"default\"](1, 0, 0, 1), min: 0, max: 2,\n });\n }\n this.setShaderSemanticsInfoArray(shaderSemanticsInfoArray);\n }", "title": "" }, { "docid": "93182278791f6f47fa4bb01d491ba99e", "score": "0.6005098", "text": "function initShaders() {\n console.log('init shader');\n var vertexShaderSource = loadText(\"vertex.glsl\");\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexShaderSource);\n\n gl.compileShader(vertexShader);\n\n var fragmentShaderSource = loadText(\"fragment.glsl\");\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentShaderSource);\n\n gl.compileShader(fragmentShader);\n program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n gl.useProgram(program)\n}", "title": "" }, { "docid": "5848670d827ca48738e599fd0dff021b", "score": "0.6004435", "text": "function init() {\n\n // Init webgl and specify clipspace.\n var canvas = document.getElementById(\"gl-canvas\");\n gl = WebGLUtils.setupWebGL(canvas);\n if (!gl) {alert(\"Web gl is not available\");}\n gl.viewport(0, 0, 512, 512);\n gl.clearColor(0.6, 0.6, 0.6, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n // Set globals to their initial values.\n xDisp = yDisp = 0;\n xScale = yScale = 1.0;\n scaleStep = 0.01;\n dispStep = 0.01;\n rotationStep = 0.1;\n isRotatingX = isRotatingY = isRotatingZ = false;\n gamma = beta = alpha = 0.0;\n\n // Assign shape vertices.\n arrayOfVertices = getVertices();\n arrayOfVertextColors = getVertexColors();\n indexList = getIndexList();\n\n\n // Initialize shaders and start shader program.\n shaderProgram = initShaders(gl, \"vertex-shader\", \"fragment-shader\");\n gl.useProgram(shaderProgram);\n\n var indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array(indexList), gl.STATIC_DRAW);\n\n var vertexColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(arrayOfVertextColors), gl.STATIC_DRAW);\n\n var vertexColorLocation = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.vertexAttribPointer(vertexColorLocation, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vertexColorLocation);\n\n // Create and bind buffer.\n var vertexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(arrayOfVertices), gl.STATIC_DRAW);\n\n // Enable the vertex shader to access vertex position information.\n var vertexPositionLocation = gl.getAttribLocation(shaderProgram, \"vertexPosition\");\n gl.vertexAttribPointer(vertexPositionLocation, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vertexPositionLocation);\n\n render();\n}", "title": "" }, { "docid": "829b4cd3cbf2e892e7abea42d56b4bea", "score": "0.60040677", "text": "function LGraphShader()\n{\n this.uninstantiable = true;\n this.clonable = false;\n this.addInput(\"albedo\",\"vec3\", {vec3:1, vec4:1});\n this.addInput(\"normal\",\"vec3\", {vec3:1, vec4:1}); // tangent space normal, if written\n this.addInput(\"emission\",\"vec3\", {vec3:1, vec4:1});\n this.addInput(\"specular\",\"float\", {float:1}); // specular power in 0..1 range\n this.addInput(\"gloss\",\"float\", {float:1});\n this.addInput(\"alpha\",\"float\", {float:1});\n this.addInput(\"alpha clip\",\"float\", {float:1});\n this.addInput(\"refraction\",\"float\", {float:1});\n this.addInput(\"vertex offset\",\"float\", {float:1});\n\n\n //inputs: [\"base color\",\"metallic\", \"specular\", \"roughness\", \"emissive color\", \"opacity\", \"opacitiy mask\", \"normal\", \"world position offset\", \"world displacement\", \"tesselation multiplier\", \"subsurface color\", \"ambient occlusion\", \"refraction\"],\n// this.properties = { color:\"#ffffff\",\n// gloss:4.0,\n// displacement_factor:1.0,\n// light_dir_x: 1.0,\n// light_dir_y: 1.0,\n// light_dir_z: 1.0\n// };\n\n// this.options = {\n// gloss:{step:0.01},\n// displacement_factor:{step:0.01},\n// light_dir_x:{min:-1, max:1, step:0.01},\n// light_dir_y:{min:-1, max:1, step:0.01},\n// light_dir_z:{min:-1, max:1, step:0.01}\n// };\n\n this.size = [125,250];\n this.shader_piece = ShaderConstructor;\n}", "title": "" }, { "docid": "f7c21c7271f10272f2e7e77f4008460d", "score": "0.6001104", "text": "function setupShaders() {\n\n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 vertexPosition;\n attribute vec3 vertexNormal;\n attribute vec3 ambient;\n attribute vec3 diffuse;\n attribute vec3 specular;\n attribute float specularExponent;\n attribute float shapeNum;\n\n uniform vec3 eyePos;\n uniform vec3 lightPos;\n uniform vec3 lightColor;\n uniform mat4 projMatrix;\n uniform mat4 viewMatrix;\n uniform mat4 xformMatrix;\n uniform float currentShape;\n\n varying lowp vec4 vColor;\n\n void main(void) {\n vec3 N = normalize(vertexNormal); // normal vector\n vec3 L = normalize(lightPos - vertexPosition); // light vector\n vec3 V = normalize(eyePos - vertexPosition); // view vector\n vec3 H = normalize(L + V);\n \n vec3 color;\n for (int i = 0; i < 3; i++) {\n color[i] = ambient[i] * lightColor[0]; // ambient term\n color[i] += diffuse[i] * lightColor[1] * dot(N, L); // diffuse term\n color[i] += specular[i] * lightColor[2] * pow(dot(N, H), specularExponent); // specular term\n\n // Clamp color\n if (color[i] > 1.0) {\n color[i] = 1.0;\n } else if (color[i] < 0.0) {\n color[i] = 0.0;\n }\n }\n\n if (shapeNum == currentShape) {\n gl_Position = projMatrix * viewMatrix * xformMatrix * vec4(vertexPosition, 1.0); // use transform matrix\n } else {\n gl_Position = projMatrix * viewMatrix * mat4(1.0) * vec4(vertexPosition, 1.0); // use untransformed position\n }\n\n vColor = vec4(color, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n varying lowp vec4 vColor;\n\n void main(void) {\n gl_FragColor = vColor;\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n\n // Setup attributes\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); // get pointer to vertex shader input\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n\n vertexNormalAttrib = gl.getAttribLocation(shaderProgram, \"vertexNormal\");\n gl.enableVertexAttribArray(vertexNormalAttrib);\n\n vertexAmbientAttrib = gl.getAttribLocation(shaderProgram, \"ambient\");\n gl.enableVertexAttribArray(vertexAmbientAttrib);\n\n vertexDiffuseAttrib = gl.getAttribLocation(shaderProgram, \"diffuse\");\n gl.enableVertexAttribArray(vertexDiffuseAttrib);\n\n vertexSpecularAttrib = gl.getAttribLocation(shaderProgram, \"specular\");\n gl.enableVertexAttribArray(vertexSpecularAttrib);\n\n vertexSpecExpAttrib = gl.getAttribLocation(shaderProgram, \"specularExponent\");\n gl.enableVertexAttribArray(vertexSpecExpAttrib);\n\n vertexShapeNumAttrib = gl.getAttribLocation(shaderProgram, \"shapeNum\");\n gl.enableVertexAttribArray(vertexShapeNumAttrib);\n\n // Setup uniforms\n eyePosUniform = gl.getUniformLocation(shaderProgram, 'eyePos');\n gl.uniform3fv(eyePosUniform, eye);\n\n mat4.perspective(projectionMatrix, glMatrix.toRadian(90), 1, 0.1, 100);\n projMatrixUniform = gl.getUniformLocation(shaderProgram, 'projMatrix');\n gl.uniformMatrix4fv(projMatrixUniform, gl.FALSE, projectionMatrix);\n \n var center = vec3.create();\n vec3.add(center, eye, lookAt);\n mat4.lookAt(viewMatrix, eye, center, upVector);\n viewMatrixUniform = gl.getUniformLocation(shaderProgram, 'viewMatrix');\n gl.uniformMatrix4fv(viewMatrixUniform, gl.FALSE, viewMatrix);\n\n // mat4.identity(transformMatrix);\n xformMatrixUniform = gl.getUniformLocation(shaderProgram, 'xformMatrix');\n gl.uniformMatrix4fv(xformMatrixUniform, gl.FALSE, transformMatrix);\n\n lightPosUniform = gl.getUniformLocation(shaderProgram, 'lightPos');\n gl.uniform3fv(lightPosUniform, lightPos);\n\n lightColorUniform = gl.getUniformLocation(shaderProgram, 'lightColor');\n gl.uniform3fv(lightColorUniform, lightColor);\n\n currentShapeUniform = gl.getUniformLocation(shaderProgram, 'currentShape');\n gl.uniform1f(currentShapeUniform, shapeNum);\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "title": "" }, { "docid": "c81b0eef9432e7c08ddb5e94f9cad1ad", "score": "0.59932244", "text": "function d$2(o,r){o.include(o$7),o.vertex.include(r$b,r),o.varyings.add(\"vPositionWorldCameraRelative\",\"vec3\"),o.varyings.add(\"vPosition_view\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_RS\",\"mat3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_TH\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_TL\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromView_TH\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromView_TL\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_ViewFromCameraRelative_RS\",\"mat3\"),o.vertex.uniforms.add(\"uTransform_ProjFromView\",\"mat4\"),o.vertex.code.add(t$i`vec3 positionWorldCameraRelative() {\nvec3 rotatedModelPosition = uTransform_WorldFromModel_RS * positionModel();\nvec3 transform_CameraRelativeFromModel = dpAdd(\nuTransform_WorldFromModel_TL,\nuTransform_WorldFromModel_TH,\n-uTransform_WorldFromView_TL,\n-uTransform_WorldFromView_TH\n);\nreturn transform_CameraRelativeFromModel + rotatedModelPosition;\n}\nvec3 position_view() {\nreturn uTransform_ViewFromCameraRelative_RS * positionWorldCameraRelative();\n}\nvoid forwardPosition() {\nvPositionWorldCameraRelative = positionWorldCameraRelative();\nvPosition_view = position_view();\ngl_Position = uTransform_ProjFromView * vec4(vPosition_view, 1.0);\n}\nvec3 positionWorld() {\nreturn uTransform_WorldFromView_TL + vPositionWorldCameraRelative;\n}`),o.fragment.uniforms.add(\"uTransform_WorldFromView_TL\",\"vec3\"),o.fragment.code.add(t$i`vec3 positionWorld() {\nreturn uTransform_WorldFromView_TL + vPositionWorldCameraRelative;\n}`);}", "title": "" }, { "docid": "bf6bcc8f7f39f2b27a8523c8025bebe5", "score": "0.59847647", "text": "setup() {\n if (this.compile()) {\n let shaderManager = GameManager.activeGame.getShaderManager();\n if (shaderManager) {\n shaderManager.useShader(this);\n } else {\n this._gl.useProgram(this._program);\n }\n\n // cache some script locations:\n this.cacheUniformLocations(Object.keys(this.uniforms));\n this.cacheAttributeLocations(Object.keys(this.attributes));\n\n } else {\n debug.error(\"Shader setup failed\");\n }\n }", "title": "" }, { "docid": "f5740448a0ff4a6816b3ef0aaf29347b", "score": "0.59818417", "text": "function initGL() {\n var prog = createProgram(gl,\"vshader-source\",\"fshader-source\");\n gl.useProgram(prog);\n gl.enable(gl.DEPTH_TEST);\n \n a_coords_loc = gl.getAttribLocation(prog, \"a_coords\");\n a_normal_loc = gl.getAttribLocation(prog, \"a_normal\");\n gl.enableVertexAttribArray(a_coords_loc);\n gl.enableVertexAttribArray(a_normal_loc);\n \n u_modelview = gl.getUniformLocation(prog, \"modelview\");\n u_projection = gl.getUniformLocation(prog, \"projection\");\n u_normalMatrix = gl.getUniformLocation(prog, \"normalMatrix\");\n u_material = {\n diffuseColor: gl.getUniformLocation(prog, \"material.diffuseColor\"),\n specularColor: gl.getUniformLocation(prog, \"material.specularColor\"),\n emissiveColor: gl.getUniformLocation(prog, \"material.emissiveColor\"),\n specularExponent: gl.getUniformLocation(prog, \"material.specularExponent\")\n };\n u_lights = new Array(10);\n for (var i = 0; i < 10; i++) {\n u_lights[i] = {\n enabled: gl.getUniformLocation(prog, \"lights[\" + i + \"].enabled\"),\n position: gl.getUniformLocation(prog, \"lights[\" + i + \"].position\"),\n color: gl.getUniformLocation(prog, \"lights[\" + i + \"].color\"),\n spotDirection: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotDirection\"),\n spotCosineCutoff: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotCosineCutoff\"),\n spotExponent: gl.getUniformLocation(prog, \"lights[\" + i + \"].spotExponent\"),\n attenuation: gl.getUniformLocation(prog, \"lights[\" + i + \"].attenuation\")\n };\n }\n for (var i = 1; i < 10; i++) { // set defaults for lights\n gl.uniform1i( u_lights[i].enabled, 1 ); \n\n }\n\n //ambient light - off by default\n gl.uniform4f( u_lights[0].position, 0,0,0,1 ); \n gl.uniform3f( u_lights[0].color, 0.2,0.2,0.2 );\n \n}", "title": "" }, { "docid": "a4d4a69e4cfb0afce1c955655d6c62c2", "score": "0.5974175", "text": "function initShaders() {\n\n var fragmentShader = getShader(\"shader-frag\", gl.FRAGMENT_SHADER);\n var vertexShader = getShader(\"shader-vert\", gl.VERTEX_SHADER);\n\n scene.shader = {};\n\n var program = gl.createProgram();\n scene.shader['default'] = program;\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n program.vertexPositionAttribute = gl.getAttribLocation(program, \"aVertPosition\");\n\n program.texturePositionAttribute = gl.getAttribLocation(program, \"aTexPosition\");\n\n program.transformUniform = gl.getUniformLocation(program, \"uTransform\");\n program.samplerUniform = gl.getUniformLocation(program, \"sampler\");\n\n // it's the only one for now so we can use it immediately\n gl.useProgram(program);\n gl.enableVertexAttribArray(program.vertexPositionAttribute);\n gl.enableVertexAttribArray(program.texturePositionAttribute);\n}", "title": "" }, { "docid": "2a69ed3275332812acd4263c903fa20c", "score": "0.59507936", "text": "function n$7(n,a){const r=n.fragment;r.uniforms.add(\"normalTexture\",\"sampler2D\"),r.uniforms.add(\"normalTextureSize\",\"vec2\"),a.vertexTangets?(n.attributes.add(\"tangent\",\"vec4\"),n.varyings.add(\"vTangent\",\"vec4\"),2===a.doubleSidedMode?r.code.add(t$i`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;\nvec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`):r.code.add(t$i`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = vTangent.w;\nvec3 tangent = normalize(vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`)):(n.extensions.add(\"GL_OES_standard_derivatives\"),r.code.add(t$i`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {\nvec3 Q1 = dFdx(pos);\nvec3 Q2 = dFdy(pos);\nvec2 stx = dFdx(st);\nvec2 sty = dFdy(st);\nfloat det = stx.t * sty.s - sty.t * stx.s;\nvec3 T = stx.t * Q2 - sty.t * Q1;\nT = T - normal * dot(normal, T);\nT *= inversesqrt(max(dot(T,T), 1.e-10));\nvec3 B = sign(det) * cross(normal, T);\nreturn mat3(T, B, normal);\n}`)),0!==a.attributeTextureCoordinates&&(n.include(u$5,a),r.code.add(t$i`\n vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {\n vtc.uv = uv;\n ${a.supportsTextureAtlas?\"vtc.size = normalTextureSize;\":\"\"}\n vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;\n return tangentSpace * rawNormal;\n }\n `));}", "title": "" }, { "docid": "a65939e2dbf531ccff5c19a3b46a99f2", "score": "0.5948579", "text": "function n$9(e,i){i.instanced&&i.instancedDoublePrecision&&(e.attributes.add(\"modelOriginHi\",\"vec3\"),e.attributes.add(\"modelOriginLo\",\"vec3\"),e.attributes.add(\"model\",\"mat3\"),e.attributes.add(\"modelNormal\",\"mat3\")),i.instancedDoublePrecision&&(e.vertex.include(r$b,i),e.vertex.uniforms.add(\"viewOriginHi\",\"vec3\"),e.vertex.uniforms.add(\"viewOriginLo\",\"vec3\"));const n=[t$i`\n vec3 calculateVPos() {\n ${i.instancedDoublePrecision?\"return model * localPosition().xyz;\":\"return localPosition().xyz;\"}\n }\n `,t$i`\n vec3 subtractOrigin(vec3 _pos) {\n ${i.instancedDoublePrecision?t$i`\n vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);\n return _pos - originDelta;`:\"return vpos;\"}\n }\n `,t$i`\n vec3 dpNormal(vec4 _normal) {\n ${i.instancedDoublePrecision?\"return normalize(modelNormal * _normal.xyz);\":\"return normalize(_normal.xyz);\"}\n }\n `,t$i`\n vec3 dpNormalView(vec4 _normal) {\n ${i.instancedDoublePrecision?\"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);\":\"return normalize((viewNormal * _normal).xyz);\"}\n }\n `,i.vertexTangets?t$i`\n vec4 dpTransformVertexTangent(vec4 _tangent) {\n ${i.instancedDoublePrecision?\"return vec4(modelNormal * _tangent.xyz, _tangent.w);\":\"return _tangent;\"}\n\n }\n `:t$i``];e.vertex.code.add(n[0]),e.vertex.code.add(n[1]),e.vertex.code.add(n[2]),2===i.output&&e.vertex.code.add(n[3]),e.vertex.code.add(n[4]);}", "title": "" }, { "docid": "df8be4f68ce8118e04689fdd81bc11cf", "score": "0.594724", "text": "loadBuffers()\n {\n // Specify the vertex coordinates\n this.VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\n this.VertexPositionBuffer.itemSize = 3;\n this.VertexPositionBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\n \n // Specify normals to be able to do lighting calculations\n this.VertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\n gl.STATIC_DRAW);\n this.VertexNormalBuffer.itemSize = 3;\n this.VertexNormalBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\n \n // Specify faces of the terrain \n this.IndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\n gl.STATIC_DRAW);\n this.IndexTriBuffer.itemSize = 1;\n this.IndexTriBuffer.numItems = this.fBuffer.length;\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\n \n //Setup Edges \n this.IndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\n gl.STATIC_DRAW);\n this.IndexEdgeBuffer.itemSize = 1;\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\n \n console.log(\"triangulatedPlane: loadBuffers\");\n }", "title": "" }, { "docid": "df8be4f68ce8118e04689fdd81bc11cf", "score": "0.594724", "text": "loadBuffers()\n {\n // Specify the vertex coordinates\n this.VertexPositionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\n this.VertexPositionBuffer.itemSize = 3;\n this.VertexPositionBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\n \n // Specify normals to be able to do lighting calculations\n this.VertexNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\n gl.STATIC_DRAW);\n this.VertexNormalBuffer.itemSize = 3;\n this.VertexNormalBuffer.numItems = this.numVertices;\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\n \n // Specify faces of the terrain \n this.IndexTriBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\n gl.STATIC_DRAW);\n this.IndexTriBuffer.itemSize = 1;\n this.IndexTriBuffer.numItems = this.fBuffer.length;\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\n \n //Setup Edges \n this.IndexEdgeBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\n gl.STATIC_DRAW);\n this.IndexEdgeBuffer.itemSize = 1;\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\n \n console.log(\"triangulatedPlane: loadBuffers\");\n }", "title": "" }, { "docid": "82f61aa099e04fadaec14da6e7c24521", "score": "0.5943647", "text": "function initShaders (){\n\tvar vertexShader = createShaderFromScriptElement(gl, \"vertex-shader\");\n\tvar fragmentShader = createShaderFromScriptElement(gl, \"fragment-shader\");\n\tprogram = createProgram(gl, [vertexShader, fragmentShader]);\n\tgl.useProgram(program);\n\n\tvertexPositionAttribute = gl.getAttribLocation(program, \"aVertexPosition\");\n\tgl.enableVertexAttribArray(vertexPositionAttribute);\n\t\n\tvertexColorAttribute = gl.getAttribLocation(program, \"aVertexColor\");\n\tgl.enableVertexAttribArray(vertexColorAttribute);\n}", "title": "" }, { "docid": "e8f5d0efa143f330ae17a15f8f194600", "score": "0.5942986", "text": "function initializeShaders(){\n //Load shaders and initialize attribute buffers\n program = initShaders(gl, \"shader-vs\", \"shader-fs\");\n gl.useProgram(program);\n\n //Associate attributes to vertex shader\n _Pmatrix = gl.getUniformLocation(program, \"Pmatrix\");\n _Vmatrix = gl.getUniformLocation(program, \"Vmatrix\");\n _Mmatrix = gl.getUniformLocation(program, \"Mmatrix\");\n _Nmatrix = gl.getUniformLocation(program, \"normalMatrix\");\n\n //Bind vertex buffer with position attribute \n gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer);\n var _position = gl.getAttribLocation(program, \"position\");\n gl.vertexAttribPointer(_position, 3, gl.FLOAT, false,0,0);\n gl.enableVertexAttribArray(_position); \n\n //Attributes\n textureCoordAttribute = gl.getAttribLocation(program, \"aTextureCoord\");\n gl.enableVertexAttribArray(textureCoordAttribute);\n\n normalAttribute = gl.getAttribLocation(program, \"normal\");\n gl.enableVertexAttribArray(normalAttribute);\n}", "title": "" }, { "docid": "e2d61f31740a850c8d9a9e98647aa3fe", "score": "0.5938746", "text": "function setupShaders() {\n \n // define fragment shader in essl using es6 template strings\n // here you need to take care of color attibutes\n var fShaderCode = `#version 300 es\n precision highp float;\n\n out vec4 FragColor;\n in vec4 oColor;\n\n void main(void) {\n FragColor = oColor; // all fragments are white\n }\n `;\n \n // define vertex shader in essl using es6 template strings\n // have in/out for vertex colors \n var vShaderCode = `#version 300 es\n in vec3 vertexPosition;\n in vec3 vertexColor;\n\n out vec4 oColor;\n\n void main(void) {\n gl_Position = vec4(vertexPosition, 1.0); // use the untransformed position\n oColor = vec4(vertexColor, 1.0);\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); \n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n // set up vertexColorAttrib from vertexColor\n vertexColorAttrib = gl.getAttribLocation(shaderProgram, \"vertexColor\"); \n gl.enableVertexAttribArray(vertexColorAttrib)\n\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "title": "" }, { "docid": "e9cba5f5ec25da7bb897452630caf65d", "score": "0.5936667", "text": "function initShaders()\n{\n var vertexShader=get_shader(shader_vertex_source, gl.VERTEX_SHADER, \"VERTEX\");\n var fragmentShader=get_shader(shader_fragment_source, gl.FRAGMENT_SHADER, \"FRAGMENT\");\n\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))\n {\n alert(\"Could not initialise shaders\");\n }\n\n gl.useProgram(shaderProgram);\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n shaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n shaderProgram.sampler2Uniform = gl.getUniformLocation(shaderProgram, \"uSampler2\");\n shaderProgram.dualTex = gl.getUniformLocation(shaderProgram,\"uDualTex\")\n\n //lighting\n shaderProgram.useLightingUniform = gl.getUniformLocation(shaderProgram, \"uUseLighting\");\n shaderProgram.ambientColorUniform = gl.getUniformLocation(shaderProgram, \"uAmbientColor\");\n shaderProgram.pointLightingLocationUniform = gl.getUniformLocation(shaderProgram, \"uPointLightingLocation\");\n shaderProgram.pointLightingColorUniform = gl.getUniformLocation(shaderProgram, \"uPointLightingColor\");\n\n //transparency\n shaderProgram.alphaUniform = gl.getUniformLocation(shaderProgram, \"uAlpha\");\n shaderProgram.useBlending = gl.getUniformLocation(shaderProgram, \"uUseBlending\");\n\n}", "title": "" }, { "docid": "e503f1ba9ce2ba6b74d31a623b337d1f", "score": "0.5929692", "text": "constructor() {\n this.numLights = 100;\n this.extentMin = vec3.fromValues(-14, -1, -6);\n this.extentMax = vec3.fromValues(14, 20, 6);\n const extent = vec3.create();\n vec3.sub(extent, this.extentMax, this.extentMin);\n\n // layout:\n // vec4 position;\n // vec3 color; float radius;\n this.lightDataStride = 64; // offset 256 / 4 byte\n this.data = new Float32Array(this.numLights * this.lightDataStride);\n\n // init\n let offset = 0;\n for (let i = 0; i < this.numLights; i++) {\n offset = this.lightDataStride * i;\n //position\n for (let i = 0; i < 3; i++) {\n tmpVec4[i] = Math.random() * extent[i] + this.extentMin[i];\n }\n tmpVec4[3] = 1;\n this.setV4(this.data, offset, tmpVec4);\n // color\n tmpVec4[0] = Math.random() * 2;\n tmpVec4[1] = Math.random() * 2;\n tmpVec4[2] = Math.random() * 2;\n // radius\n tmpVec4[3] = 4.0;\n this.setV4(this.data, offset + 4, tmpVec4);\n }\n }", "title": "" }, { "docid": "c193ff90afda9695e26cda10198eaf0e", "score": "0.592606", "text": "function initScene() {\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.clearColor(0.3921, 0.5843, 0.9294, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n // INIT WEBGL SHADERS AND BUFFERS\n baseProgram = initShaders(gl, \"vertex-shader-base\", \"fragment-shader-base\");\n shadingProgram = initShaders(gl, \"vertex-shader-shading\", \"fragment-shader-shading\");\n\n // Attribute & uniform locations\n baseProgram.vPosition = gl.getAttribLocation(baseProgram, \"vPosition\");\n baseProgram.vColor = gl.getAttribLocation(baseProgram, \"vColor\");\n baseProgram.u_ProjectionMatrix = gl.getUniformLocation(baseProgram, 'u_ProjectionMatrix');\n baseProgram.u_ViewMatrix = gl.getUniformLocation(baseProgram, 'u_ViewMatrix');\n baseProgram.u_ModelMatrix = gl.getUniformLocation(baseProgram, 'u_ModelMatrix');\n\n shadingProgram.vPosition = gl.getAttribLocation(shadingProgram, \"vPosition\");\n shadingProgram.vColor = gl.getAttribLocation(shadingProgram, \"vColor\");\n shadingProgram.vNormal = gl.getAttribLocation(shadingProgram, \"vNormal\");\n shadingProgram.u_ProjectionMatrix = gl.getUniformLocation(shadingProgram, 'u_ProjectionMatrix');\n shadingProgram.u_ViewMatrix = gl.getUniformLocation(shadingProgram, 'u_ViewMatrix');\n shadingProgram.u_ModelMatrix = gl.getUniformLocation(shadingProgram, 'u_ModelMatrix');\n\n shadingProgram.light_position = gl.getUniformLocation(shadingProgram, \"light_position\");\n shadingProgram.u_kaLoc = gl.getUniformLocation(shadingProgram, \"ka\");\n shadingProgram.u_kdLoc = gl.getUniformLocation(shadingProgram, \"kd\");\n shadingProgram.u_ksLoc = gl.getUniformLocation(shadingProgram, \"ks\");\n shadingProgram.u_alphaLoc = gl.getUniformLocation(shadingProgram, \"alpha\");\n shadingProgram.intensity=gl.getUniformLocation(shadingProgram, \"intensity\");\n shadingProgram.u_NormalMatrix = gl.getUniformLocation(shadingProgram, 'u_NormalMatrix');\n\n\n shadingProgram.u_ShadowMap = gl.getUniformLocation(shadingProgram, 'u_ShadowMap');\n shadingProgram.u_MvpMatrixFromLight = gl.getUniformLocation(shadingProgram, 'u_MvpMatrixFromLight');\n\n // Buffers\n var vBuffer = gl.createBuffer();\n vBuffer.type = gl.FLOAT;\n vBuffer.num = 3;\n\n var cBuffer = gl.createBuffer();\n cBuffer.type = gl.FLOAT;\n cBuffer.num = 4;\n\n var nBuffer = gl.createBuffer();\n nBuffer.type = gl.FLOAT;\n nBuffer.num = 3;\n\n\n cubeBuffers.vBuffer = vBuffer;\n cubeBuffers.cBuffer = cBuffer;\n cubeBuffers.nBuffer = nBuffer;\n\n // POSITION CAMERA\n var eye = vec3(\n r * Math.sin(theta) * Math.sin(phi) + x,\n r * Math.cos(theta) + y,\n r * Math.sin(theta) * Math.cos(phi)\n );\n var at = vec3(x, y, 0.0);\n var up = vec3(0, 1, 0);\n viewMatrix = lookAt(eye, at, up);\n\n // CUBE & FACE LOOK UP MAP\n // Initialize a framebuffer object\n lookUpMapFbo = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, lookUpMapFbo);\n var renderbuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, canvas.width, canvas.height);\n\n lookUpTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, lookUpTexture);\n // gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, lookUpTexture, 0);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);\n\n var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n if (status !== gl.FRAMEBUFFER_COMPLETE) {\n alert('Framebuffer Not Complete');\n }\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n\n // INITIALIZE CUBES LIST AND DRAW SCENE\n allCubes.push(firstCube);\n allCubes = Array.from(chicken);\n\n // Draw current look up map\n drawCubes(allCubes, 1);\n\n // Draw cubes and shadows\n drawScene();\n}", "title": "" }, { "docid": "77fc985f5e0ffbdc77e42db5ac24d327", "score": "0.5924908", "text": "function initShaders( )\n{\n\n var fragmentShader = getShader( gl, \"shader-fs\" );\n var vertexShader = getShader( gl, \"shader-vs\" );\n\n shaderProgram = gl.createProgram( );\n gl.attachShader( shaderProgram, vertexShader );\n gl.attachShader( shaderProgram, fragmentShader );\n gl.linkProgram( shaderProgram );\n\n if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) )\n {\n\n console.error( \"Could not initialize shaders.\" );\n\n }\n\n gl.useProgram( shaderProgram );\n\n // Acquire handles to shader program variables in order to pass data to the shaders.\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation( shaderProgram, \"aVertexPosition\" );\n gl.enableVertexAttribArray( shaderProgram.vertexPositionAttribute );\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation( shaderProgram, \"aVertexColor\" );\n gl.enableVertexAttribArray( shaderProgram.vertexColorAttribute );\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation( shaderProgram, \"aVertexNormal\" );\n gl.enableVertexAttribArray( shaderProgram.vertexNormalAttribute );\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation( shaderProgram, \"uPMatrix\" );\n shaderProgram.mvMatrixUniform = gl.getUniformLocation( shaderProgram, \"uMVMatrix\" );\n shaderProgram.nMatrixUniform = gl.getUniformLocation( shaderProgram, \"uNMatrix\" );\n\n shaderProgram.ambientColorUniform = gl.getUniformLocation( shaderProgram, \"uAmbientColor\" );\n shaderProgram.pointLightLocationUniform = gl.getUniformLocation( shaderProgram, \"uPointLightLocation\" );\n shaderProgram.pointLightColorUniform = gl.getUniformLocation( shaderProgram, \"uPointLightColor\" );\n shaderProgram.screenSizeUniform = gl.getUniformLocation( shaderProgram, \"uSreenSize\" );\n\n}", "title": "" }, { "docid": "d07cd248c0e45f9c1ffc316fb596ecd7", "score": "0.5924507", "text": "vertex_glsl_code () {}", "title": "" }, { "docid": "90a0a3b2f0977cb56904d55589188c88", "score": "0.59228283", "text": "function P$2(P){const _=new n$8,S=_.vertex.code,$=_.fragment.code;return _.include(u$2,{name:\"Default Material Shader\",output:P.output}),_.vertex.uniforms.add(\"proj\",\"mat4\").add(\"view\",\"mat4\").add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\"),_.include(o$7),_.varyings.add(\"vpos\",\"vec3\"),_.include(e$9,P),_.include(n$9,P),_.include(t$f,P),0!==P.output&&7!==P.output||(_.include(o$8,P),_.include(r$9,{linearDepth:!1}),0===P.normalType&&P.offsetBackfaces&&_.include(e$8),_.include(n$7,P),_.include(l$5,P),P.instancedColor&&_.attributes.add(\"instanceColor\",\"vec4\"),_.varyings.add(\"localvpos\",\"vec3\"),_.include(t$b,P),_.include(a$5,P),_.include(r$7,P),_.include(r$6,P),_.vertex.uniforms.add(\"externalColor\",\"vec4\"),_.varyings.add(\"vcolorExt\",\"vec4\"),P.multipassTerrainEnabled&&_.varyings.add(\"depth\",\"float\"),S.add(t$i`\n void main(void) {\n forwardNormalizedVertexColor();\n vcolorExt = externalColor;\n ${P.instancedColor?\"vcolorExt *= instanceColor;\":\"\"}\n vcolorExt *= vvColor();\n vcolorExt *= getSymbolColor();\n forwardColorMixMode();\n\n if (vcolorExt.a < ${t$i.float(o$f)}) {\n gl_Position = vec4(1e38, 1e38, 1e38, 1.0);\n }\n else {\n vpos = calculateVPos();\n localvpos = vpos - view[3].xyz;\n vpos = subtractOrigin(vpos);\n ${0===P.normalType?t$i`\n vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n ${P.vertexTangets?\"vTangent = dpTransformVertexTangent(tangent);\":\"\"}\n gl_Position = transformPosition(proj, view, vpos);\n ${0===P.normalType&&P.offsetBackfaces?\"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, camPos);\":\"\"}\n }\n\n ${P.multipassTerrainEnabled?\"depth = (view * vec4(vpos, 1.0)).z;\":\"\"}\n forwardLinearDepth();\n forwardTextureCoordinates();\n }\n `)),7===P.output&&(_.include(c$6,P),_.include(r$h,P),P.multipassTerrainEnabled&&(_.fragment.include(a$6),_.include(r$c,P)),_.fragment.uniforms.add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\").add(\"opacity\",\"float\").add(\"layerOpacity\",\"float\"),P.hasColorTexture&&_.fragment.uniforms.add(\"tex\",\"sampler2D\"),_.fragment.include(i$7),$.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${P.multipassTerrainEnabled?\"terrainDepthTest(gl_FragCoord, depth);\":\"\"}\n ${P.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n ${P.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:t$i`vec4 texColor = vec4(1.0);`}\n ${P.attributeColor?t$i`\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:t$i`\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\n `}\n gl_FragColor = vec4(opacity_);\n }\n `)),0===P.output&&(_.include(c$6,P),_.include(l$4,P),_.include(o$6,P),_.include(r$h,P),P.receiveShadows&&_.include(i$9,P),P.multipassTerrainEnabled&&(_.fragment.include(a$6),_.include(r$c,P)),_.fragment.uniforms.add(\"camPos\",\"vec3\").add(\"localOrigin\",\"vec3\").add(\"ambient\",\"vec3\").add(\"diffuse\",\"vec3\").add(\"opacity\",\"float\").add(\"layerOpacity\",\"float\"),P.hasColorTexture&&_.fragment.uniforms.add(\"tex\",\"sampler2D\"),_.include(r$a,P),_.include(a$4,P),_.fragment.include(i$7),_.include(r$5,P),$.add(t$i`\n void main() {\n discardBySlice(vpos);\n ${P.multipassTerrainEnabled?\"terrainDepthTest(gl_FragCoord, depth);\":\"\"}\n ${P.hasColorTexture?t$i`\n vec4 texColor = texture2D(tex, vuv0);\n ${P.textureAlphaPremultiplied?\"texColor.rgb /= texColor.a;\":\"\"}\n discardOrAdjustAlpha(texColor);`:t$i`vec4 texColor = vec4(1.0);`}\n shadingParams.viewDirection = normalize(vpos - camPos);\n ${3===P.normalType?t$i`\n vec3 normal = screenDerivativeNormal(localvpos);`:t$i`\n shadingParams.normalView = vNormalWorld;\n vec3 normal = shadingNormal(shadingParams);`}\n ${1===P.pbrMode?\"applyPBRFactors();\":\"\"}\n float ssao = evaluateAmbientOcclusionInverse();\n ssao *= getBakedOcclusion();\n\n float additionalAmbientScale = _oldHeuristicLighting(vpos + localOrigin);\n vec3 additionalLight = ssao * lightingMainIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;\n ${P.receiveShadows?\"float shadow = readShadowMap(vpos, linearDepth);\":1===P.viewingMode?\"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);\":\"float shadow = 0.0;\"}\n vec3 matColor = max(ambient, diffuse);\n ${P.attributeColor?t$i`\n vec3 albedo_ = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:t$i`\n vec3 albedo_ = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));\n float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));\n `}\n ${P.hasNormalTexture?t$i`\n mat3 tangentSpace = ${P.vertexTangets?\"computeTangentSpace(normal);\":\"computeTangentSpace(normal, vpos, vuv0);\"}\n vec3 shadedNormal = computeTextureNormal(tangentSpace, vuv0);`:\"vec3 shadedNormal = normal;\"}\n ${1===P.pbrMode||2===P.pbrMode?1===P.viewingMode?t$i`vec3 normalGround = normalize(vpos + localOrigin);`:t$i`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:t$i``}\n ${1===P.pbrMode||2===P.pbrMode?t$i`\n float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * lightingMainIntensity[2];\n vec3 shadedColor = evaluateSceneLightingPBR(shadedNormal, albedo_, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:\"vec3 shadedColor = evaluateSceneLighting(shadedNormal, albedo_, shadow, 1.0 - ssao, additionalLight);\"}\n gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);\n ${P.OITEnabled?\"gl_FragColor = premultiplyAlpha(gl_FragColor);\":\"\"}\n }\n `)),_.include(u$3,P),_}", "title": "" }, { "docid": "05f1d8067daa86ac08ba2d558a0c7fb4", "score": "0.59212035", "text": "function SetUpShaders(gl) {\r\n DefaultShader=LoadShaderFromFiles(gl, \"shaders/default_vs.glsl\", \"shaders/default_fs.glsl\");\r\n IndexShader=LoadShaderFromFiles(gl, \"shaders/default_vs.glsl\", \"shaders/selection_fs.glsl\");\r\n DepthShader=LoadShaderFromFiles(gl, \"shaders/default_vs.glsl\", \"shaders/depth_fs.glsl\");\r\n\r\n //iconTextures[\"simple\"]=new CTexture(gl, \"images/iphonecopy.png\");\r\n iconTextures[\"Object\"]=new CTexture(gl, \"images/Object1.png\");\r\n iconTextures[\"PartWhole\"]=new CTexture(gl, \"images/PartWhole1.png\");\r\n iconTextures[\"Reference\"]=new CTexture(gl, \"images/Reference1.png\");\r\n iconTextures[\"Creative\"]=new CTexture(gl, \"images/Creative1.png\");\r\n}", "title": "" }, { "docid": "8433c375272dda882da4b88f12334074", "score": "0.5917079", "text": "async function init(){\n\t// retrieve shader using path\n\tvar path = window.location.pathname;\n\tvar page = path.split(\"/\").pop();\n\tbaseDir = window.location.href.replace(page, '');\n\tshaderDir = baseDir + \"shaders/\";\n\n\t// create canvas\n\tvar canvas = document.getElementById(\"c\");\n\tgl = canvas.getContext(\"webgl2\");\n\tconsole.log(gl);\n\tif (!gl) {\n\t\tdocument.write(\"GL context not opened\");\n\t\treturn;\n\t}\n\t\n\t// Loading the shaders and creating programs\n\tawait utils.loadFiles([shaderDir + 'texture_vs.vert', shaderDir + 'texture_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\ttextureProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_texcoord\", \"a_normal\"]);\n\t});\n\tawait utils.loadFiles([shaderDir + 'color_vs.vert', shaderDir + 'color_fs.frag'], function (shaderText) {\n\t\t// compiles a shader and creates setters for attribs and uniforms\n\t\tcolorProgramInfo = twgl.createProgramInfo(gl, [shaderText[0], shaderText[1]], [\"a_position\", \"a_normal\"]);\n\t});\n\n\t/*\n\t* Loading the obj models\n\t*/\n\tlet tailWrapper = new ObjectWrapper(baseDir + tailPath);\n\tlet bodyWrapper = new ObjectWrapper(baseDir + bodyPath);\n\tlet leftEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet rightEyeWrapper = new ObjectWrapper(baseDir + eyePath);\n\tlet hoursClockhandWrapper = new ObjectWrapper(baseDir + hoursClockhandPath);\n\tlet minutesClockhandWrapper = new ObjectWrapper(baseDir + minutesClockhandPath);\n\t// Set the local matrix for each object and the program to draw them\n\ttailWrapper.setLocalMatrix(tailLocalMatrix).setProgramInfo(colorProgramInfo);\n\tbodyWrapper.setLocalMatrix(bodyLocalMatrix).setProgramInfo(textureProgramInfo);\n\tleftEyeWrapper.setLocalMatrix(leftEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\trightEyeWrapper.setLocalMatrix(rightEyeLocalMatrix).setProgramInfo(textureProgramInfo);\n\thoursClockhandWrapper.setLocalMatrix(clockHand2LocalMatrix).setProgramInfo(colorProgramInfo);\n\tminutesClockhandWrapper.setLocalMatrix(clockHand1LocalMatrix).setProgramInfo(colorProgramInfo);\n\n\t// Save each object wrapper in a unique array of objects to draw\n\tobj = [tailWrapper, leftEyeWrapper, rightEyeWrapper, bodyWrapper, hoursClockhandWrapper, minutesClockhandWrapper];\n\n\tobj.forEach(async (wrapper) => { await wrapper.loadModel(); });\n\n\twindow.addEventListener(\"keydown\", keyFunctionDown, false);\n\n\tresetShaderParams();\n\tmain();\n}", "title": "" }, { "docid": "08c11ff75037d6221c110fc918b96c21", "score": "0.5915381", "text": "computeDrawPathBuffers() {\n const buffer = this._pathBuffer;\n let preview,current,next;\n const cList = $objs.cases_s;\n for (let i=0, l=buffer.length; i<l; i++) {\n const preview = buffer[i-1];\n const current = buffer[i ];\n const next = buffer[i+1];\n const preview_id = preview && cList.indexOf(preview);\n const current_id = current && cList.indexOf(current);\n const next_id = next && cList.indexOf(next);\n //TODO: FIXME: compute distance via global position for Math.hypot\n if(preview){\n current.pathConnexion[String(preview_id)] = Math.hypot(preview.x-current.x, preview.y-current.y);\n };\n if(next){\n current.pathConnexion[String(next_id)] = Math.hypot(next.x-current.x, next.y-current.y);\n };\n };\n console.log0('PathsBuffers: ', buffer);\n this._pathBuffer = [];\n this.refreshPath();\n }", "title": "" }, { "docid": "beca80c5958fc92d44967a3415f282f0", "score": "0.59048426", "text": "shared_glsl_code() // ********* SHARED CODE, INCLUDED IN BOTH SHADERS *********\r\n { return `precision mediump float;\r\n const int N_LIGHTS = 2; // We're limited to only so many inputs in hardware. Lights are costly (lots of sub-values).\r\n uniform float ambient, diffusivity, specularity, smoothness, animation_time, attenuation_factor[N_LIGHTS];\r\n uniform bool GOURAUD, COLOR_NORMALS, USE_TEXTURE; // Flags for alternate shading methods\r\n uniform vec4 lightPosition[N_LIGHTS], lightColor[N_LIGHTS], shapeColor;\r\n varying vec3 N, E; // Specifier \"varying\" means a variable's final value will be passed from the vertex shader \r\n varying vec2 f_tex_coord; // on to the next phase (fragment shader), then interpolated per-fragment, weighted by the \r\n varying vec4 VERTEX_COLOR; // pixel fragment's proximity to each of the 3 vertices (barycentric interpolation).\r\n varying vec3 L[N_LIGHTS], H[N_LIGHTS];\r\n varying float dist[N_LIGHTS];\r\n \r\n vec3 phong_model_lights( vec3 N )\r\n { vec3 result = vec3(0.0);\r\n for(int i = 0; i < N_LIGHTS; i++)\r\n {\r\n float attenuation_multiplier = 1.0 / (1.0 + attenuation_factor[i] * (dist[i] * dist[i]));\r\n float diffuse = max( dot(N, L[i]), 0.0 );\r\n float specular = pow( max( dot(N, H[i]), 0.0 ), smoothness );\r\n\r\n result += attenuation_multiplier * ( shapeColor.xyz * diffusivity * diffuse + lightColor[i].xyz * specularity * specular );\r\n }\r\n return result;\r\n }\r\n `;\r\n }", "title": "" }, { "docid": "a53728d84cb7dc68096a32537fdf7bfa", "score": "0.5901319", "text": "function Init ( esContext )\n{\n var userData = esContext.userData;\n var vShaderStr =\n 'uniform float u_offset; \\n\\\n attribute vec4 a_position; \\n\\\n attribute vec2 a_texCoord; \\n\\\n varying vec2 v_texCoord; \\n\\\n void main() \\n\\\n { \\n\\\n gl_Position = a_position; \\n\\\n gl_Position.x += u_offset;\\n\\\n v_texCoord = a_texCoord; \\n\\\n } \\n';\n\n var fShaderStr =\n 'precision mediump float; \\n\\\n varying vec2 v_texCoord; \\n\\\n uniform sampler2D s_texture; \\n\\\n void main() \\n\\\n { \\n\\\n gl_FragColor = texture2D( s_texture, v_texCoord );\\n\\\n } \\n';\n\n // Load the shaders and get a linked program object\n userData.programObject = esLoadProgram ( vShaderStr, fShaderStr );\n\n // Get the attribute locations\n userData.positionLoc = gl.getAttribLocation ( userData.programObject, \"a_position\" );\n userData.texCoordLoc = gl.getAttribLocation ( userData.programObject, \"a_texCoord\" );\n\n // Get the sampler location\n userData.samplerLoc = gl.getUniformLocation ( userData.programObject, \"s_texture\" );\n\n // Get the offset location\n userData.offsetLoc = gl.getUniformLocation( userData.programObject, \"u_offset\" );\n\n // Load the texture\n userData.textureId = CreateMipMappedTexture2D ();\n\n // Generate the VBOs\n var vVertices = new Float32Array(\n [ -0.5, 0.5, 0.0, 1.5, // Position 0\n 0.0, 0.0, // TexCoord 0\n -0.5, -0.5, 0.0, 0.75, // Position 1\n 0.0, 1.0, // TexCoord 1\n 0.5, -0.5, 0.0, 0.75, // Position 2\n 1.0, 1.0, // TexCoord 2\n 0.5, 0.5, 0.0, 1.5, // Position 3\n 1.0, 0.0 // TexCoord 3\n ]);\n var indices = new Uint16Array([ 0, 1, 2, 0, 2, 3 ]);\n\n userData.vertexObject = gl.createBuffer();\n gl.bindBuffer ( gl.ARRAY_BUFFER, userData.vertexObject );\n gl.bufferData ( gl.ARRAY_BUFFER, vVertices, gl.STATIC_DRAW );\n userData.vertexBytesPerElement = vVertices.BYTES_PER_ELEMENT;\n userData.indexObject = gl.createBuffer();\n gl.bindBuffer ( gl.ELEMENT_ARRAY_BUFFER, userData.indexObject );\n gl.bufferData ( gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW );\n\n\n gl.clearColor ( 0.0, 0.0, 0.0, 1.0 );\n return true;\n}", "title": "" }, { "docid": "a493b85a05b52f902251a29a60648006", "score": "0.59005314", "text": "loadBuffers()\r\n {\r\n // Specify the vertex coordinates\r\n this.VertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\r\n this.VertexPositionBuffer.itemSize = 3;\r\n this.VertexPositionBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\r\n \r\n // Specify normals to be able to do lighting calculations\r\n this.VertexNormalBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexNormalBuffer.itemSize = 3;\r\n this.VertexNormalBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\r\n \r\n // Specify faces of the terrain \r\n this.IndexTriBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexTriBuffer.itemSize = 1;\r\n this.IndexTriBuffer.numItems = this.fBuffer.length;\r\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\r\n \r\n //Setup Edges \r\n this.IndexEdgeBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexEdgeBuffer.itemSize = 1;\r\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\r\n \r\n console.log(\"triangulatedPlane: loadBuffers\");\r\n }", "title": "" }, { "docid": "a396586112c1a4c7df98cb70fe939663", "score": "0.588527", "text": "function setupReflectiveShader() {\n\n reflectVertex = loadShaderFromDOM(\"reflectshader-vs\");\n reflectFragment = loadShaderFromDOM(\"reflectshader-fs\");\n\n reflectProgram = gl.createProgram();\n gl.attachShader(reflectProgram, reflectVertex);\n gl.attachShader(reflectProgram, reflectFragment);\n gl.linkProgram(reflectProgram); \n \n gl.useProgram(reflectProgram);\n reflectProgram.vertexPositionAttribute = gl.getAttribLocation(reflectProgram, \"aVertexPosition\");\n gl.enableVertexAttribArray(reflectProgram.vertexPositionAttribute)\n \n reflectProgram.vertexNormalAttribute = gl.getAttribLocation(reflectProgram, \"aVertexNormal\");\n gl.enableVertexAttribArray(reflectProgram.vertexNormalAttribute);\n \n \n reflectProgram.mvMatrixUniform = gl.getUniformLocation(reflectProgram, \"uMVMatrix\");\n reflectProgram.pMatrixUniform = gl.getUniformLocation(reflectProgram, \"uPMatrix\");\n reflectProgram.nMatrixUniform = gl.getUniformLocation(reflectProgram, \"normalMatrix\");\n reflectProgram.invertMatrixUniform = gl.getUniformLocation(reflectProgram, \"inverseViewTransform\");\n}", "title": "" }, { "docid": "20068e91defc235cb4ba4c0e5683d802", "score": "0.58818847", "text": "enableShaderPass() {\n if(this.stacks.scenePasses.length && this.stacks.renderPasses.length === 0 && this.renderer.planes.length) {\n this.renderer.state.scenePassIndex = 0;\n this.renderer.bindFrameBuffer(this.renderer.shaderPasses[this.stacks.scenePasses[0]].target);\n }\n }", "title": "" }, { "docid": "5f545e9828520ed765ceb60cd8b73f9f", "score": "0.58750635", "text": "render() {\n const canvas = this.canvas;\n const dataset = this.currentDataset;\n\n canvas.width = dataset.width;\n canvas.height = dataset.height;\n\n let ids = null;\n if (this.expressionAst) {\n const idsSet = new Set([]);\n const getIds = (node) => {\n if (typeof node === 'string') {\n // ids should not contain unary operators\n idsSet.add(node.replace(new RegExp(/[+-]/, 'g'), ''));\n }\n if (typeof node.lhs === 'string') {\n idsSet.add(node.lhs.replace(new RegExp(/[+-]/, 'g'), ''));\n } else if (typeof node.lhs === 'object') {\n getIds(node.lhs);\n }\n if (typeof node.rhs === 'string') {\n idsSet.add(node.rhs.replace(new RegExp(/[+-]/, 'g'), ''));\n } else if (typeof node.rhs === 'object') {\n getIds(node.rhs);\n }\n };\n getIds(this.expressionAst);\n ids = Array.from(idsSet);\n }\n\n let program = null;\n\n if (this.gl) {\n const gl = this.gl;\n gl.viewport(0, 0, dataset.width, dataset.height);\n\n if (this.expressionAst) {\n const vertexShaderSourceExpressionTemplate = `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n uniform mat3 u_matrix;\n uniform vec2 u_resolution;\n varying vec2 v_texCoord;\n void main() {\n // apply transformation matrix\n vec2 position = (u_matrix * vec3(a_position, 1)).xy;\n // convert the rectangle from pixels to 0.0 to 1.0\n vec2 zeroToOne = position / u_resolution;\n // convert from 0->1 to 0->2\n vec2 zeroToTwo = zeroToOne * 2.0;\n // convert from 0->2 to -1->+1 (clipspace)\n vec2 clipSpace = zeroToTwo - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n // pass the texCoord to the fragment shader\n // The GPU will interpolate this value between points.\n v_texCoord = a_texCoord;\n }`;\n const expressionReducer = (node) => {\n if (typeof node === 'object') {\n if (node.op === '**') {\n // math power operator substitution\n return `pow(${expressionReducer(node.lhs)}, ${expressionReducer(node.rhs)})`;\n }\n if (node.fn) {\n return `(${node.fn}(${expressionReducer(node.lhs)}))`;\n }\n return `(${expressionReducer(node.lhs)} ${node.op} ${expressionReducer(node.rhs)})`;\n } else if (typeof node === 'string') {\n return `${node}_value`;\n }\n return `float(${node})`;\n };\n\n const compiledExpression = expressionReducer(this.expressionAst);\n\n // Definition of fragment shader\n const fragmentShaderSourceExpressionTemplate = `\n precision mediump float;\n // our texture\n uniform sampler2D u_textureScale;\n\n // add all required textures\n${ids.map(id => ` uniform sampler2D u_texture_${id};`).join('\\n')}\n\n uniform vec2 u_textureSize;\n uniform vec2 u_domain;\n uniform float u_noDataValue;\n uniform bool u_clampLow;\n uniform bool u_clampHigh;\n // the texCoords passed in from the vertex shader.\n varying vec2 v_texCoord;\n void main() {\n${ids.map(id => ` float ${id}_value = texture2D(u_texture_${id}, v_texCoord)[0];`).join('\\n')}\n float value = ${compiledExpression};\n\n if (value == u_noDataValue)\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))\n gl_FragColor = vec4(0, 0, 0, 0);\n else {\n float normalisedValue = (value - u_domain[0]) / (u_domain[1] - u_domain[0]);\n gl_FragColor = texture2D(u_textureScale, vec2(normalisedValue, 0));\n }\n }`;\n program = createProgram(gl, vertexShaderSource, fragmentShaderSourceExpressionTemplate);\n gl.useProgram(program);\n\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureScale'), 0);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.textureScale);\n for (let i = 0; i < ids.length; ++i) {\n const location = i + 1;\n const id = ids[i];\n const ds = this.datasetCollection[id];\n if (!ds) {\n throw new Error(`No such dataset registered: '${id}'`);\n }\n gl.uniform1i(gl.getUniformLocation(program, `u_texture_${id}`), location);\n gl.activeTexture(gl[`TEXTURE${location}`]);\n gl.bindTexture(gl.TEXTURE_2D, ds.textureData);\n }\n } else {\n program = this.program;\n gl.useProgram(program);\n // set the images\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureData'), 0);\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureScale'), 1);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, dataset.textureData);\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, this.textureScale);\n }\n const positionLocation = gl.getAttribLocation(program, 'a_position');\n const domainLocation = gl.getUniformLocation(program, 'u_domain');\n const displayRangeLocation = gl.getUniformLocation(\n program, 'u_display_range'\n );\n const applyDisplayRangeLocation = gl.getUniformLocation(\n program, 'u_apply_display_range'\n );\n const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');\n const noDataValueLocation = gl.getUniformLocation(program, 'u_noDataValue');\n const clampLowLocation = gl.getUniformLocation(program, 'u_clampLow');\n const clampHighLocation = gl.getUniformLocation(program, 'u_clampHigh');\n const matrixLocation = gl.getUniformLocation(program, 'u_matrix');\n\n gl.uniform2f(resolutionLocation, canvas.width, canvas.height);\n gl.uniform2fv(domainLocation, this.domain);\n gl.uniform2fv(displayRangeLocation, this.displayRange);\n gl.uniform1i(applyDisplayRangeLocation, this.applyDisplayRange);\n gl.uniform1i(clampLowLocation, this.clampLow);\n gl.uniform1i(clampHighLocation, this.clampHigh);\n gl.uniform1f(noDataValueLocation, this.noDataValue);\n gl.uniformMatrix3fv(matrixLocation, false, this.matrix);\n\n const positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n setRectangle(gl, 0, 0, canvas.width, canvas.height);\n\n // Draw the rectangle.\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n } else if (this.ctx) {\n const ctx = this.ctx;\n const w = canvas.width;\n const h = canvas.height;\n\n const imageData = ctx.createImageData(w, h);\n\n const trange = this.domain[1] - this.domain[0];\n const steps = this.colorScaleCanvas.width;\n const csImageData = this.colorScaleCanvas.getContext('2d').getImageData(0, 0, steps, 1).data;\n let alpha;\n\n const data = dataset.data;\n\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n const i = (y * w) + x;\n // TODO: Possible increase of performance through use of worker threads?\n\n let c = Math.floor(((data[i] - this.domain[0]) / trange) * (steps - 1));\n alpha = 255;\n if (c < 0) {\n c = 0;\n if (!this.clampLow) {\n alpha = 0;\n }\n } else if (c > 255) {\n c = 255;\n if (!this.clampHigh) {\n alpha = 0;\n }\n }\n // NaN values should be the only values that are not equal to itself\n if (data[i] === this.noDataValue || data[i] !== data[i]) {\n alpha = 0;\n } else if (this.applyDisplayRange\n && (data[i] < this.displayRange[0] || data[i] >= this.displayRange[1])) {\n alpha = 0;\n }\n\n const index = ((y * w) + x) * 4;\n imageData.data[index + 0] = csImageData[c * 4];\n imageData.data[index + 1] = csImageData[(c * 4) + 1];\n imageData.data[index + 2] = csImageData[(c * 4) + 2];\n imageData.data[index + 3] = Math.min(alpha, csImageData[(c * 4) + 3]);\n }\n }\n\n ctx.putImageData(imageData, 0, 0); // at coords 0,0\n }\n }", "title": "" }, { "docid": "58dc1d04dc861dedb38a45a5d7d73fbf", "score": "0.5858416", "text": "function setupShaders() {\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n \tprecision mediump float;\n\n \tvarying vec3 vColor;\n\n void main(void) {\n \t//gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); // all fragments are white\n gl_FragColor = vec4(vColor,1.0); // give the fragment that color\n }\n `;\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 vertexPosition;\n attribute vec3 vertexColor;\n\n uniform mat4 uMVMatrix;\n uniform mat4 uPMatrix;\n\n varying vec3 vColor;\n\n void main(void) {\n gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // use the untransformed position\n //gl_Position = vec4(vertexPosition, 1.0);\n vColor = vertexColor;\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n\n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); // get pointer to vertex shader input\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n console.log('before enable');\n vertexColorAttrib = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(vertexColorAttrib);\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n mat4.identity(mvMatrix);\n mat4.identity(perspective);\n //mat4.perspective(pMatrix, 90*(3.14/180), 600/600, 0.5, 1.5);\n //mat4.lookAt(mvMatrix, eye, lookAt, lookUp);\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "title": "" }, { "docid": "f178da06c4c3fdfa4c3472a90832b8e3", "score": "0.5853036", "text": "init(vertexShaderName, fragmentShaderName, textureName1) {\n let vertexShaderSource = document.getElementById(vertexShaderName).innerHTML;\n let fragmentShaderSource = document.getElementById(fragmentShaderName).innerHTML;\n this.shaderProgram = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);\n if (!this.shaderProgram) {\n console.log('Feil ved initialisering av shaderkoden.');\n } else {\n this.loadTexture(textureName1);\n }\n }", "title": "" }, { "docid": "828b21d30f7b78d34e295fbb6d0515a5", "score": "0.5850707", "text": "function initProgram(id) {\n var programShader = gl.createProgram();\n var vert = compileShader(id + \"-vs\");\n var frag = compileShader(id + \"-fs\");\n gl.attachShader(programShader, vert);\n gl.attachShader(programShader, frag);\n gl.linkProgram(programShader);\n if (!gl.getProgramParameter(programShader, gl.LINK_STATUS)) {\n alert(gl.getProgramInfoLog(programShader));\n return null;\n }\n return programShader;\n}", "title": "" }, { "docid": "f7f695d6624dc99e748a7b91150a1f61", "score": "0.5850542", "text": "function initShaders() {\n const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, VERTEX_SHADER_SOURCE);\n gl.compileShader(vertexShader);\n const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, FRAGMENT_SHADER_SOURCE);\n gl.compileShader(fragmentShader);\n\n // Create the shader program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n // If creating the shader program failed, alert\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n throw new Error('Unable to initialize the shader program!');\n }\n\n gl.useProgram(shaderProgram);\n\n vertexPositionAttribute = gl.getAttribLocation(shaderProgram, 'aVertexPosition');\n gl.enableVertexAttribArray(vertexPositionAttribute);\n\n textureCoordAttribute = gl.getAttribLocation(shaderProgram, 'aTextureCoord');\n gl.enableVertexAttribArray(textureCoordAttribute);\n}", "title": "" }, { "docid": "0ccf7c575315e0cf7f301591c1520435", "score": "0.5842635", "text": "function setupSkyboxBuffers(){\n //Generate the vertex positions \n loadVertices()\n\n //Generate the vertex Textures\n loadTextures()\n}", "title": "" }, { "docid": "325c5878ae571bd3182c9a6cc8fa811d", "score": "0.58423346", "text": "createShaders() {\n const gl = this.gl\n\n this.vertexShader = this.createShader(gl.VERTEX_SHADER)\n this.fragmentShader = this.createShader(gl.FRAGMENT_SHADER)\n }", "title": "" }, { "docid": "2cdfe9bd4cd75ae709da0307059a6222", "score": "0.584082", "text": "function main() {\n /////////////////////////////////\n // Set up the view environment //\n /////////////////////////////////\n canvas = document.getElementById('webgl'); // Retrieve <canvas> element\n gl = getWebGLContext(canvas,false); // Get the rendering context for WebGL\n if (!gl) { console.log('Failed to get the rendering context for WebGL'); return;} // Detect errors\n program = createProgram(gl, VSHADER_SOURCE, FSHADER_SOURCE); // Initialise shaders\n if (!program) { console.log('Failed to intialize shaders.'); return;} // Detect errors\n gl.clearColor(0.0, 0.0, 1, 0.4); // Set the clear color\n gl.enable(gl.DEPTH_TEST); // enable the depth test\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); // Set the type of blending us\n gl.enable(gl.BLEND); // Enable blending (for transparency)\n\n //////////////////////////////////////////////////\n //Get the storage locations of uniform variables//\n //////////////////////////////////////////////////\n gl.useProgram(program);\n\n program.u_ModelMatrix = gl.getUniformLocation(program, 'u_ModelMatrix'); // Model matrix\n program.u_MvpMatrix = gl.getUniformLocation(program, 'u_MvpMatrix'); // View projection matrix\n program.u_NormalMatrix = gl.getUniformLocation(program, 'u_NormalMatrix'); // Normal matrix\n program.u_AmbientLight = gl.getUniformLocation(program, 'u_AmbientLight'); // Amount of ambient light\n program.u_isTexture = gl.getUniformLocation(program, 'u_isTexture'); // Position of point light\n program.u_Alpha = gl.getUniformLocation(program, 'u_Alpha'); // Position of point light\n\n program.a_TexCoord = gl.getAttribLocation(program, 'a_TexCoord'); // Texture Attribute variable for each vertex\n program.a_Color = gl.getAttribLocation(program,'a_Color'); // Color Attribute variable for each vertex\n program.a_Normal = gl.getAttribLocation(program, 'a_Normal'); // Position Attribute variable for each vertex\n program.a_Position = gl.getAttribLocation(program, 'a_Position'); // Position Attribute variable for each vertex\n\n program.lightPositions = gl.getUniformLocation(program, 'lightPositions'); // Positions of lights\n program.lightColours = gl.getUniformLocation(program, 'lightColours'); // Colours of lights\n program.lightsOn = gl.getUniformLocation(program, 'lightsOn'); // Lights that are on\n\n //Detect errors\n if (!program.u_ModelMatrix || !program.u_MvpMatrix || !program.u_NormalMatrix || !program.lightPositions || !program.u_AmbientLight || !program.u_isTexture || !program.u_Alpha || !program.lightColours || !program.lightsOn) {\n console.log('Failed to get the storage location');\n return;\n }\n\n ///////////////////////////////////////////////////////////////////\n //Set the shapes used in the world and spawn the initial entities//\n ///////////////////////////////////////////////////////////////////\n generateShapes(gl);\n spawnEntity('cube');\n spawnEntity('cube');\n spawnEntity('sphere');\n\n /////////////////////////////////////////\n //Detect mouse movement and key presses//\n /////////////////////////////////////////\n var map = [];\n onkeydown = onkeyup = function(e){ // Detect key down/key up\n e = e || event; // to deal with IE\n map[e.keyCode] = e.type == 'keydown'; // Save the key to an array\n }\n\n document.onkeydown = function (e){ // Detect a key press\n toggles(e.keyCode);\n }\n\n document.onmousemove = function (e) { // Detect mouse movement\n dx = e.movementX || e.mozMovementX || e.webkitMovementX || 0, // Pixels moved in x direction\n \t\tdy = e.movementY || e.mozMovementY || e.webkitMovementY || 0; // Pixels moved in y direction\n theta += lookSpeed*dx;\n if(phi+lookSpeed*dy<Math.PI && phi+lookSpeed*dy>0){\n phi += lookSpeed*dy;\n }\n if(theta>2*Math.PI){\n theta-(2*Math.PI);\n }\n if(theta<0){\n theta+=(2*Math.PI);\n }\n }\n\n //Detect mouse clicks\n document.body.onclick = document.body.requestPointerLock ||\n document.body.mozRequestPointerLock ||\n document.body.webkitRequestPointerLock;\n\n\n //////////////////\n //Draw the scene//\n //////////////////\n var tick = function() { // Start drawing\n resize(gl); // Resize the canvas if the window is resized\n\t updateObjects(gl); // Update objects\n\t updateEntities(); // Update entities\n\t updatePlayer(map); // Update player based on key presses\n\t updateLights(gl); // Update lighting\n\t draw(gl); // Draw scene\n requestAnimationFrame(tick, canvas); // Refresh scene\n };\n tick();\n}", "title": "" }, { "docid": "7d4da06f54b89170e633b74ac7de5f66", "score": "0.58366656", "text": "function main() {\n \n //math2d_test();\n \n /**\n ** Initialize WebGL Components\n **/\n \n // Retrieve <canvas> element\n var canvas = document.getElementById('webgl');\n\n // Get the rendering context for WebGL\n var gl = getWebGLContext(canvas);\n if (!gl) {\n console.log('Failed to get the rendering context for WebGL');\n return;\n }\n\n // Initialize shaders\n if (!initShadersFromID(gl, \"vertex-shader\", \"fragment-shader\")) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n // create GL buffer objects\n\t\n vBuffer_Pnt = gl.createBuffer();\n if (!vBuffer_Pnt) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\n vBuffer_Line = gl.createBuffer();\n if (!vBuffer_Line) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\tvBuffer_Tri = gl.createBuffer();\n\tif (!vBuffer_Tri) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\tvBuffer_Quad = gl.createBuffer();\n\tif (!vBuffer_Quad) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\tvBuffer_Select = gl.createBuffer();\n\tif (!vBuffer_Select) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\n var skeleton=true;\n if(skeleton)\n {\n document.getElementById(\"App_Title\").innerHTML += \"-Skeleton\";\n }\n\n // \\todo create buffers for triangles and quads...\n\n // Specify the color for clearing <canvas>\n gl.clearColor(0, 0, 0, 1);\n\n // Clear <canvas>\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n // get GL shader variable locations\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n if (a_Position < 0) {\n console.log('Failed to get the storage location of a_Position');\n return -1;\n }\n\n var u_FragColor = gl.getUniformLocation(gl.program, 'u_FragColor');\n if (!u_FragColor) {\n console.log('Failed to get the storage location of u_FragColor');\n return;\n }\n\n /**\n ** Set Event Handlers\n **\n ** Student Note: the WebGL book uses an older syntax. The newer syntax, explicitly calling addEventListener, is preferred.\n ** See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n **/\n // set event handlers buttons\n document.getElementById(\"LineButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.DrawLines;\n });\n\n document.getElementById(\"TriangleButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.DrawTriangles;\n }); \n\tdocument.getElementById(\"QuadButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.DrawQuads;\n });\n\t\n\tdocument.getElementById(\"DeleteButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.Delete;\n });\n \n document.getElementById(\"ClearScreenButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.ClearScreen;\n // clear the vertex arrays\n\t\t\t\twhile (select_point.length > 0)\n select_point.pop();\n\t\t\t\twhile (select_verts.length > 0)\n select_verts.pop();\n while (points.length > 0)\n points.pop();\n while (line_verts.length > 0)\n line_verts.pop();\n while (tri_verts.length > 0)\n tri_verts.pop();\n\t\t\t\twhile(quad_verts.length>0)//added quad verts functionality\n\t\t\t\t\tquad_verts.pop();\n\n gl.clear(gl.COLOR_BUFFER_BIT);\n \n curr_draw_mode = draw_mode.DrawLines;\n });\n \n //\\todo add event handlers for other buttons as required.... \n\n // set event handlers for color sliders\n /* \\todo right now these just output to the console, code needs to be modified... */\n document.getElementById(\"RedRange\").addEventListener(\n \"input\",\n function () {\n console.log(\"RedRange:\" + document.getElementById(\"RedRange\").value);\n });\n document.getElementById(\"GreenRange\").addEventListener(\n \"input\",\n function () {\n console.log(\"GreenRange:\" + document.getElementById(\"GreenRange\").value);\n });\n document.getElementById(\"BlueRange\").addEventListener(\n \"input\",\n function () {\n console.log(\"BlueRange:\" + document.getElementById(\"BlueRange\").value);\n }); \n \n // init sliders \n // \\todo this code needs to be modified ...\n document.getElementById(\"RedRange\").value = 0;\n document.getElementById(\"GreenRange\").value = 100;\n document.getElementById(\"BlueRange\").value = 0;\n \n // Register function (event handler) to be called on a mouse press\n canvas.addEventListener(\n \"mousedown\",\n function (ev) {\n\t\t\t\tif(ev.button === 0){\n handleMouseDown(ev, gl, canvas, a_Position, u_FragColor);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ev.button === 2){\n\t\t\t\thandleMouseDown(ev, gl, canvas, a_Position, u_FragColor);\n\t\t\t\t//select=true;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\tcanvas.addEventListener('contextmenu', function(e) {\n if (e.button === 2) {\n e.preventDefault();\n return false;\n }\n }, false);\n}", "title": "" }, { "docid": "f13c9943246075e579dfc65608d592c8", "score": "0.58365893", "text": "function setupShadersReflection() {\r\n vertexShader = loadShaderFromDOM(\"reflection-vs\");\r\n fragmentShader = loadShaderFromDOM(\"reflection-fs\");\r\n\r\n shaderProgramReflection = gl.createProgram();\r\n gl.attachShader(shaderProgramReflection, vertexShader);\r\n gl.attachShader(shaderProgramReflection, fragmentShader);\r\n gl.linkProgram(shaderProgramReflection);\r\n\r\n if (!gl.getProgramParameter(shaderProgramReflection, gl.LINK_STATUS)) {\r\n alert(\"Failed to setup reflection shaders\");\r\n }\r\n\r\n gl.useProgram(shaderProgramReflection);\r\n\r\n shaderProgramReflection.vertexPositionAttribute = gl.getAttribLocation(shaderProgramReflection, \"aVertexPosition\");\r\n gl.enableVertexAttribArray(shaderProgramReflection.vertexPositionAttribute);\r\n\r\n shaderProgramReflection.vertexNormalAttribute = gl.getAttribLocation(shaderProgramReflection, \"aVertexNormal\");\r\n gl.enableVertexAttribArray(shaderProgramReflection.vertexNormalAttribute);\r\n\r\n shaderProgramReflection.mvMatrixUniform = gl.getUniformLocation(shaderProgramReflection, \"uMVMatrix\");\r\n\r\n shaderProgramReflection.nMatrixInverseUniform = gl.getUniformLocation(shaderProgramReflection, \"uNMatrixInverse\");\r\n\r\n shaderProgramReflection.pMatrixUniform = gl.getUniformLocation(shaderProgramReflection, \"uPMatrix\");\r\n shaderProgramReflection.nMatrixUniform = gl.getUniformLocation(shaderProgramReflection, \"uNMatrix\");\r\n shaderProgramReflection.uniformLightPositionLoc = gl.getUniformLocation(shaderProgramReflection, \"uLightPosition\");\r\n shaderProgramReflection.uniformAmbientLightColorLoc = gl.getUniformLocation(shaderProgramReflection, \"uAmbientLightColor\");\r\n shaderProgramReflection.uniformDiffuseLightColorLoc = gl.getUniformLocation(shaderProgramReflection, \"uDiffuseLightColor\");\r\n shaderProgramReflection.uniformSpecularLightColorLoc = gl.getUniformLocation(shaderProgramReflection, \"uSpecularLightColor\");\r\n shaderProgramReflection.uniformShininessLoc = gl.getUniformLocation(shaderProgramReflection, \"uShininess\");\r\n shaderProgramReflection.uniformAmbientMaterialColorLoc = gl.getUniformLocation(shaderProgramReflection, \"uKAmbient\");\r\n shaderProgramReflection.uniformDiffuseMaterialColorLoc = gl.getUniformLocation(shaderProgramReflection, \"uKDiffuse\");\r\n shaderProgramReflection.uniformSpecularMaterialColorLoc = gl.getUniformLocation(shaderProgramReflection, \"uKSpecular\");\r\n\r\n console.log(\"Reflection shaders succesfully set up.\");\r\n}", "title": "" }, { "docid": "d76a046af188ad5e50a9021f5e7c5582", "score": "0.58311737", "text": "updateShaders(time, obj) {\r\n\r\n let shader, x;\r\n\r\n obj = obj || {};\r\n\r\n for (x = 0; shader = this.runningShaders[x++];) {\r\n\r\n for (let uniform in obj.uniforms) {\r\n if (uniform in shader.material.uniforms) {\r\n shader.material.uniforms[uniform].value = obj.uniforms[uniform];\r\n }\r\n }\r\n\r\n if ('cameraPosition' in shader.material.uniforms && this.mainCamera) {\r\n\r\n shader.material.uniforms.cameraPosition.value = this.mainCamera.position.clone();\r\n\r\n }\r\n\r\n if ('viewMatrix' in shader.material.uniforms && this.mainCamera) {\r\n\r\n shader.material.uniforms.viewMatrix.value = this.mainCamera.matrixWorldInverse;\r\n\r\n }\r\n\r\n if ('time' in shader.material.uniforms) {\r\n\r\n shader.material.uniforms.time.value = time;\r\n\r\n }\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "13b597889d6b37e9f4e166807909303b", "score": "0.58311033", "text": "buildCircleNodeShader() {\n // For each primitive we need 4 attributes: x, y, color and size.\n let ATTRIBUTES_PER_PRIMITIVE = 4,\n nodesFS = [\n 'precision mediump float;',\n 'varying vec4 color;',\n 'void main(void) {',\n ' if ((gl_PointCoord.x - 0.5) * (gl_PointCoord.x - 0.5) + (gl_PointCoord.y - 0.5) * (gl_PointCoord.y - 0.5) < 0.25) {',\n ' gl_FragColor = color;',\n ' } else {',\n ' gl_FragColor = vec4(0);',\n ' }',\n '}'].join('\\n'),\n nodesVS = [\n 'attribute vec2 a_vertexPos;',\n // Pack color and size into vector. First elemnt is color, second - size.\n // Since it's floating point we can only use 24 bit to pack colors...\n // thus alpha channel is dropped, and is always assumed to be 1.\n 'attribute vec2 a_customAttributes;',\n 'uniform vec2 u_screenSize;',\n 'uniform mat4 u_transform;',\n 'varying vec4 color;',\n 'void main(void) {',\n ' gl_Position = u_transform * vec4(a_vertexPos/u_screenSize, 0, 1);',\n ' gl_PointSize = a_customAttributes[1] * u_transform[0][0];',\n ' float c = a_customAttributes[0];',\n ' color.b = mod(c, 256.0); c = floor(c/256.0);',\n ' color.g = mod(c, 256.0); c = floor(c/256.0);',\n ' color.r = mod(c, 256.0); c = floor(c/256.0); color /= 255.0;',\n ' color.a = 1.0;',\n '}'].join('\\n');\n let program,\n gl,\n buffer,\n locations,\n utils,\n nodes = new Float32Array(64),\n nodesCount = 0,\n canvasWidth,\n canvasHeight,\n transform,\n isCanvasDirty;\n return {\n /**\n * Called by webgl renderer to load the shader into gl context.\n */\n load(glContext) {\n gl = glContext;\n webglUtils = Viva.Graph.webgl(glContext);\n program = webglUtils.createProgram(nodesVS, nodesFS);\n gl.useProgram(program);\n locations = webglUtils.getLocations(program, ['a_vertexPos', 'a_customAttributes', 'u_screenSize', 'u_transform']);\n gl.enableVertexAttribArray(locations.vertexPos);\n gl.enableVertexAttribArray(locations.customAttributes);\n buffer = gl.createBuffer();\n },\n /**\n * Called by webgl renderer to update node position in the buffer array\n *\n * @param nodeUI - data model for the rendered node (WebGLCircle in this case)\n * @param pos - {x, y} coordinates of the node.\n */\n position(nodeUI, pos) {\n const idx = nodeUI.id;\n nodes[idx * ATTRIBUTES_PER_PRIMITIVE] = pos.x;\n nodes[idx * ATTRIBUTES_PER_PRIMITIVE + 1] = -pos.y;\n nodes[idx * ATTRIBUTES_PER_PRIMITIVE + 2] = nodeUI.color;\n nodes[idx * ATTRIBUTES_PER_PRIMITIVE + 3] = nodeUI.size;\n },\n /**\n * Request from webgl renderer to actually draw our stuff into the\n * gl context. This is the core of our shader.\n */\n render() {\n gl.useProgram(program);\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, nodes, gl.DYNAMIC_DRAW);\n if (isCanvasDirty) {\n isCanvasDirty = false;\n gl.uniformMatrix4fv(locations.transform, false, transform);\n gl.uniform2f(locations.screenSize, canvasWidth, canvasHeight);\n }\n gl.vertexAttribPointer(locations.vertexPos, 2, gl.FLOAT, false, ATTRIBUTES_PER_PRIMITIVE * Float32Array.BYTES_PER_ELEMENT, 0);\n gl.vertexAttribPointer(locations.customAttributes, 2, gl.FLOAT, false, ATTRIBUTES_PER_PRIMITIVE * Float32Array.BYTES_PER_ELEMENT, 2 * 4);\n gl.drawArrays(gl.POINTS, 0, nodesCount);\n },\n /**\n * Called by webgl renderer when user scales/pans the canvas with nodes.\n */\n updateTransform(newTransform) {\n transform = newTransform;\n isCanvasDirty = true;\n },\n /**\n * Called by webgl renderer when user resizes the canvas with nodes.\n */\n updateSize(newCanvasWidth, newCanvasHeight) {\n canvasWidth = newCanvasWidth;\n canvasHeight = newCanvasHeight;\n isCanvasDirty = true;\n },\n /**\n * Called by webgl renderer to notify us that the new node was created in the graph\n */\n createNode(node) {\n nodes = webglUtils.extendArray(nodes, nodesCount, ATTRIBUTES_PER_PRIMITIVE);\n nodesCount += 1;\n },\n /**\n * Called by webgl renderer to notify us that the node was removed from the graph\n */\n removeNode(node) {\n if (nodesCount > 0) { nodesCount -= 1; }\n if (node.id < nodesCount && nodesCount > 0) {\n // we do not really delete anything from the buffer.\n // Instead we swap deleted node with the \"last\" node in the\n // buffer and decrease marker of the \"last\" node. Gives nice O(1)\n // performance, but make code slightly harder than it could be:\n webglUtils.copyArrayPart(nodes, node.id * ATTRIBUTES_PER_PRIMITIVE, nodesCount * ATTRIBUTES_PER_PRIMITIVE, ATTRIBUTES_PER_PRIMITIVE);\n }\n },\n /**\n * This method is called by webgl renderer when it changes parts of its\n * buffers. We don't use it here, but it's needed by API (see the comment\n * in the removeNode() method)\n */\n replaceProperties(replacedNode, newNode) {},\n };\n }", "title": "" }, { "docid": "d6e07d930b5b6a6db4c03e83c7ce2c76", "score": "0.5829938", "text": "initGLSLBuffers() {\n var attributeBuffer = this.gl.createBuffer();\n var indexBuffer = this.gl.createBuffer();\n\n if (!attributeBuffer || !indexBuffer) {\n console.log(\"Failed to create buffers!\");\n return;\n }\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, attributeBuffer);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n }", "title": "" }, { "docid": "cae492d1cfb4300e9648198f0cbd7a66", "score": "0.5827135", "text": "function main() {\n \n //math2d_test();\n \n /**\n ** Initialize WebGL Components\n **/\n \n // Retrieve <canvas> element\n var canvas = document.getElementById('webgl');\n\n // Get the rendering context for WebGL\n var gl = getWebGLContext(canvas);\n if (!gl) {\n console.log('Failed to get the rendering context for WebGL');\n return;\n }\n\n // Initialize shaders\n if (!initShadersFromID(gl, \"vertex-shader\", \"fragment-shader\")) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n // create GL buffer objects\n vBuffer_Pnt = gl.createBuffer();\n if (!vBuffer_Pnt) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\n vBuffer_Line = gl.createBuffer();\n if (!vBuffer_Line) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\n var skeleton=true;\n if(skeleton)\n {\n document.getElementById(\"App_Title\").innerHTML += \"-Skeleton\";\n }\n\n vBuffer_Tri = gl.createBuffer();\n if (!vBuffer_Tri) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n \n vBuffer_Quad = gl.createBuffer();\n if (!vBuffer_Quad) {\n console.log('Failed to create the buffer object');\n return -1;\n }\n\n // Specify the color for clearing <canvas>\n gl.clearColor(0, 0, 0, 1);\n\n // Clear <canvas>\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n // get GL shader variable locations\n var a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n if (a_Position < 0) {\n console.log('Failed to get the storage location of a_Position');\n return -1;\n }\n\n var u_FragColor = gl.getUniformLocation(gl.program, 'u_FragColor');\n if (!u_FragColor) {\n console.log('Failed to get the storage location of u_FragColor');\n return;\n }\n\n /**\n ** Set Event Handlers\n **\n ** Student Note: the WebGL book uses an older syntax. The newer syntax, explicitly calling addEventListener, is preferred.\n ** See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n **/\n // set event handlers buttons\n document.getElementById(\"LineButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.DrawLines;\n });\n\n document.getElementById(\"TriangleButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.DrawTriangles;\n });\n \n document.getElementById(\"QuadButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.DrawQuads;\n });\n \n document.getElementById(\"ClearScreenButton\").addEventListener(\n \"click\",\n function () {\n curr_draw_mode = draw_mode.ClearScreen;\n // clear the vertex arrays\n while (points.length > 0)\n points.pop();\n while (line_verts.length > 0)\n line_verts.pop();\n while (tri_verts.length > 0)\n tri_verts.pop();\n\n gl.clear(gl.COLOR_BUFFER_BIT);\n \n curr_draw_mode = draw_mode.DrawLines;\n });\n \n \n document.getElementById(\"DeleteButton\").addEventListener(\"click\",\n \t\t\n \t\tfunction() { //Not working, might not be handling closest verts correctly\n \t\t\tif(closestLineVerts.length){\n \t\t\t\tfor(var i = 0; i < closestLineVerts.length; i++){\n \t\t\t\t\tline_verts.splice(line_verts.indexOf(closestLineVerts[i]),1);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\telse if(closestTriangleVerts.length){\n \t\t\t\tfor(var i = 0; i < closestTriangleVerts.length; i++){\n \t\t\t\t\ttri_verts.splice(tri_verts.indexOf(closestTriangleVerts[i]), 1);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t\telse if(closestQuadVerts.length){\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tdrawObjects(gl,a_Position, u_FragColor);\n \t\n });\n\n // set event handlers for color sliders\n document.getElementById(\"RedRange\").addEventListener(\n \"input\",\n function () { \n redSlider.min = 0;\n redSlider.max = 1;\n redSlider.step = 0.1;\n });\n document.getElementById(\"GreenRange\").addEventListener(\n \"input\",\n function () {\n greenSlider.min = 0;\n greenSlider.max = 1;\n greenSlider.step = 0.1;\n });\n document.getElementById(\"BlueRange\").addEventListener(\n \"input\",\n function () {\n blueSlider.min = 0;\n blueSlider.max = 1;\n blueSlider.step = 0.1;\n }); \n \n // init sliders \n redSlider = document.getElementById(\"RedRange\");\n document.getElementById(\"RedRange\").value = 0;\n greenSlider = document.getElementById(\"GreenRange\");\n document.getElementById(\"GreenRange\").value = 0;\n blueSlider = document.getElementById(\"BlueRange\");\n document.getElementById(\"BlueRange\").value = 0;\n \n //Remove context menu within the canvas to not obstruct view\n canvas.addEventListener('contextmenu', event => event.preventDefault());\n \n // Register function (event handler) to be called on a mouse press\n canvas.addEventListener(\n \"mousedown\",\n function (ev) {\n handleMouseDown(ev, gl, canvas, a_Position, u_FragColor);\n });\n}", "title": "" }, { "docid": "6095b791f6adb088b1bfffeed9f84bb5", "score": "0.5823612", "text": "init(context, sceneMatrix) {\n if(!this.isInit) {\n this.isInit = true;\n this.posBuffer = gl.createBuffer();\n this.colorBuffer = gl.createBuffer();\n this.sizeBuffer = gl.createBuffer();\n\n /*set the attributes uniforms*/\n this.a_position = gl.getAttribLocation(context.shader, 'a_position');\n this.a_color = gl.getAttribLocation(context.shader, 'a_color');\n this.a_size = gl.getAttribLocation(context.shader, 'a_size');\n this.u_modelView = gl.getUniformLocation(context.shader, 'u_modelView');\n this.u_projection = gl.getUniformLocation(context.shader, 'u_projection');\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.colorBuffer);\n gl.enableVertexAttribArray(this.a_color);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.posBuffer);\n gl.enableVertexAttribArray(this.a_position);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.sizeBuffer);\n gl.enableVertexAttribArray(this.a_size);\n\n this.wind = vec3.fromValues(0,0,0);\n\n this.moveVec = vec3.create();\n this.oldPos = this.getPosition(sceneMatrix);\n }\n }", "title": "" }, { "docid": "ff305e3551da266bff61624ddf67bca0", "score": "0.58199155", "text": "function initWebGL() {\n /* Add default pointer */\n var pointers = [];\n pointers.push(new Pointer());\n /* Get webGL context */\n\n var webGL = canvas.getContext('webgl2', defualts.DRAWING_PARAMS);\n var isWebGL2 = !!webGL;\n if (!isWebGL2) webGL = canvas.getContext('webgl', defualts.DRAWING_PARAMS) || canvas.getContext('experimental-webgl', defualts.DRAWING_PARAMS);\n /* Get color formats */\n\n var colorFormats = getFormats();\n /* Case support adjustments */\n\n if (isMobile()) defualts.behavior.render_shaders = false;\n\n if (!colorFormats.supportLinearFiltering) {\n defualts.behavior.render_shaders = false;\n defualts.behavior.render_bloom = false;\n }\n /* Make our shaders and shader programs */\n\n\n var SHADER = {\n baseVertex: compileShader(webGL.VERTEX_SHADER, defualts.SHADER_SOURCE.vertex),\n clear: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.clear),\n color: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.color),\n background: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.background),\n display: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.display),\n displayBloom: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloom),\n displayShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayShading),\n displayBloomShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloomShading),\n bloomPreFilter: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomPreFilter),\n bloomBlur: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomBlur),\n bloomFinal: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomFinal),\n splat: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.splat),\n advectionManualFiltering: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advectionManualFiltering),\n advection: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advection),\n divergence: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.divergence),\n curl: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.curl),\n vorticity: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.vorticity),\n pressure: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.pressure),\n gradientSubtract: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.gradientSubtract)\n };\n var programs = formShaderPrograms(colorFormats.supportLinearFiltering);\n /* Worker Classes and Functions */\n\n /**\n * Is It Mobile?:\n * Detects whether or not a device is mobile by checking the user agent string\n *\n * @returns {boolean}\n */\n\n function isMobile() {\n return /Mobi|Android/i.test(navigator.userAgent);\n }\n /**\n * Get Formats:\n * Enable color extensions, linear filtering extensions, and return usable color formats RGBA,\n * RG (Red-Green), and R (Red).\n *\n * @returns {{formatRGBA: {internalFormat, format}, supportLinearFiltering: OES_texture_half_float_linear,\n * formatR: {internalFormat, format}, halfFloatTexType: *, formatRG: {internalFormat, format}}}\n */\n\n\n function getFormats() {\n /* Color Formats */\n var formatRGBA;\n var formatRG;\n var formatR;\n var halfFloat;\n var supportLinearFiltering;\n /* Enables webGL color extensions and get linear filtering extension*/\n\n if (isWebGL2) {\n webGL.getExtension('EXT_color_buffer_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_float_linear');\n } else {\n halfFloat = webGL.getExtension('OES_texture_half_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_half_float_linear');\n }\n\n var HALF_FLOAT_TEXTURE_TYPE = isWebGL2 ? webGL.HALF_FLOAT : halfFloat.HALF_FLOAT_OES;\n /* Set color to black for when color buffers are cleared */\n\n webGL.clearColor(0.0, 0.0, 0.0, 1.0);\n /* Retrieve color formats */\n\n if (isWebGL2) {\n formatRGBA = getSupportedFormat(webGL.RGBA16F, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RG16F, webGL.RG, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.R16F, webGL.RED, HALF_FLOAT_TEXTURE_TYPE);\n } else {\n formatRGBA = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n }\n /** Get Supported Format\n * Using the specified internal format, we retrieve and return the desired color format to be\n * rendered with\n *\n * @param internalFormat: A GLenum that specifies the color components within the texture\n * @param format: Another GLenum that specifies the format of the texel data.\n * @returns {{internalFormat: *, format: *}|null|({internalFormat, format}|null)}\n */\n\n\n function getSupportedFormat(internalFormat, format, type) {\n var isSupportRenderTextureFormat;\n var texture = webGL.createTexture();\n /* Set texture parameters */\n\n webGL.bindTexture(webGL.TEXTURE_2D, texture);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MIN_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MAG_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_S, webGL.CLAMP_TO_EDGE);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_T, webGL.CLAMP_TO_EDGE);\n /* Specify a 2D texture image */\n\n webGL.texImage2D(webGL.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);\n /* Attach texture to frame buffer */\n\n var fbo = webGL.createFramebuffer();\n webGL.bindFramebuffer(webGL.FRAMEBUFFER, fbo);\n webGL.framebufferTexture2D(webGL.FRAMEBUFFER, webGL.COLOR_ATTACHMENT0, webGL.TEXTURE_2D, texture, 0);\n /* Check if current format is supported */\n\n var status = webGL.checkFramebufferStatus(webGL.FRAMEBUFFER);\n isSupportRenderTextureFormat = status === webGL.FRAMEBUFFER_COMPLETE;\n /* If not supported use fallback format, until we have no fallback */\n\n if (!isSupportRenderTextureFormat) {\n switch (internalFormat) {\n case webGL.R16F:\n return getSupportedFormat(webGL.RG16F, webGL.RG, type);\n\n case webGL.RG16F:\n return getSupportedFormat(webGL.RGBA16F, webGL.RGBA, type);\n\n default:\n return null;\n }\n }\n\n return {\n internalFormat: internalFormat,\n format: format\n };\n }\n\n return {\n formatRGBA: formatRGBA,\n formatRG: formatRG,\n formatR: formatR,\n halfFloatTexType: HALF_FLOAT_TEXTURE_TYPE,\n supportLinearFiltering: supportLinearFiltering\n };\n }\n /**\n * Compile Shader:\n * Makes a new webGL shader of type `type` using the provided GLSL source. The `type` is either of\n * `VERTEX_SHADER` or `FRAGMENT_SHADER`\n *\n * @param type: Passed to `createShader` to define the shader type\n * @param source: A GLSL source script, used to define the shader properties\n * @returns {WebGLShader}: A webGL shader of the parameterized type and source\n */\n\n\n function compileShader(type, source) {\n /* Create shader, link the source, and compile the GLSL*/\n var shader = webGL.createShader(type);\n webGL.shaderSource(shader, source);\n webGL.compileShader(shader);\n /* TODO: Finish error checking */\n\n if (!webGL.getShaderParameter(shader, webGL.COMPILE_STATUS)) throw webGL.getShaderInfoLog(shader);\n return shader;\n }\n /**\n * Form Shader Programs:\n * Assembles shaders into a webGl program we can use to write to our context\n *\n * @param supportLinearFiltering: A bool letting us know if we support linear filtering\n * @returns {{displayBloomProgram: GLProgram, vorticityProgram: GLProgram, displayShadingProgram: GLProgram,\n * displayBloomShadingProgram: GLProgram, gradientSubtractProgram: GLProgram, advectionProgram: GLProgram,\n * bloomBlurProgram: GLProgram, colorProgram: GLProgram, divergenceProgram: GLProgram, clearProgram: GLProgram,\n * splatProgram: GLProgram, displayProgram: GLProgram, bloomPreFilterProgram: GLProgram, curlProgram: GLProgram,\n * bloomFinalProgram: GLProgram, pressureProgram: GLProgram, backgroundProgram: GLProgram}}: Programs used to\n * render shaders\n *\n */\n\n\n function formShaderPrograms(supportLinearFiltering) {\n return {\n clearProgram: new GLProgram(SHADER.baseVertex, SHADER.clear, webGL),\n colorProgram: new GLProgram(SHADER.baseVertex, SHADER.color, webGL),\n backgroundProgram: new GLProgram(SHADER.baseVertex, SHADER.background, webGL),\n displayProgram: new GLProgram(SHADER.baseVertex, SHADER.display, webGL),\n displayBloomProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloom, webGL),\n displayShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayShading, webGL),\n displayBloomShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloomShading, webGL),\n bloomPreFilterProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomPreFilter, webGL),\n bloomBlurProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomBlur, webGL),\n bloomFinalProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomFinal, webGL),\n splatProgram: new GLProgram(SHADER.baseVertex, SHADER.splat, webGL),\n advectionProgram: new GLProgram(SHADER.baseVertex, supportLinearFiltering ? SHADER.advection : SHADER.advectionManualFiltering, webGL),\n divergenceProgram: new GLProgram(SHADER.baseVertex, SHADER.divergence, webGL),\n curlProgram: new GLProgram(SHADER.baseVertex, SHADER.curl, webGL),\n vorticityProgram: new GLProgram(SHADER.baseVertex, SHADER.vorticity, webGL),\n pressureProgram: new GLProgram(SHADER.baseVertex, SHADER.pressure, webGL),\n gradientSubtractProgram: new GLProgram(SHADER.baseVertex, SHADER.gradientSubtract, webGL)\n };\n }\n\n return {\n programs: programs,\n webGL: webGL,\n colorFormats: colorFormats,\n pointers: pointers\n };\n}", "title": "" }, { "docid": "f53a4ae618b9516daabe285f4505e26d", "score": "0.5811817", "text": "function e$7(e,o){e.fragment.include(a$9),3===o.output?(e.extensions.add(\"GL_OES_standard_derivatives\"),e.fragment.code.add(t$i`float _calculateFragDepth(const in float depth) {\nconst float SLOPE_SCALE = 2.0;\nconst float BIAS = 2.0 * .000015259;\nfloat m = max(abs(dFdx(depth)), abs(dFdy(depth)));\nfloat result = depth + SLOPE_SCALE * m + BIAS;\nreturn clamp(result, .0, .999999);\n}\nvoid outputDepth(float _linearDepth) {\ngl_FragColor = float2rgba(_calculateFragDepth(_linearDepth));\n}`)):1===o.output&&e.fragment.code.add(t$i`void outputDepth(float _linearDepth) {\ngl_FragColor = float2rgba(_linearDepth);\n}`);}", "title": "" }, { "docid": "9c39cd46b9971a83fbcda7643cc0a28d", "score": "0.58091897", "text": "loadBuffers()\r\n {\r\n // Specify the vertex coordinates\r\n this.VertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\r\n this.VertexPositionBuffer.itemSize = 3;\r\n this.VertexPositionBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\r\n\r\n // Specify normals to be able to do lighting calculations\r\n this.VertexNormalBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexNormalBuffer.itemSize = 3;\r\n this.VertexNormalBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\r\n\r\n // Specify faces of the terrain\r\n this.IndexTriBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexTriBuffer.itemSize = 1;\r\n this.IndexTriBuffer.numItems = this.fBuffer.length;\r\n console.log(\"Loaded \", this.IndexTriBuffer.numItems, \" triangles\");\r\n\r\n //Setup Edges\r\n this.IndexEdgeBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexEdgeBuffer.itemSize = 1;\r\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\r\n\r\n console.log(\"triangulatedPlane: loadBuffers\");\r\n }", "title": "" }, { "docid": "6e8a196c7210b94c62d3ff1d08356455", "score": "0.58073664", "text": "shared_glsl_code() // ********* SHARED CODE, INCLUDED IN BOTH SHADERS *********\n { return `precision mediump float;\n const int N_LIGHTS = 2; // We're limited to only so many inputs in hardware. Lights are costly (lots of sub-values).\n uniform float ambient, diffusivity, specularity, smoothness, animation_time, attenuation_factor[N_LIGHTS];\n uniform bool GOURAUD, COLOR_NORMALS, USE_TEXTURE; // Flags for alternate shading methods\n uniform vec4 lightPosition[N_LIGHTS], lightColor[N_LIGHTS], shapeColor;\n varying vec3 N, E; // Specifier \"varying\" means a variable's final value will be passed from the vertex shader \n varying vec2 f_tex_coord; // on to the next phase (fragment shader), then interpolated per-fragment, weighted by the \n varying vec4 VERTEX_COLOR; // pixel fragment's proximity to each of the 3 vertices (barycentric interpolation).\n varying vec3 L[N_LIGHTS], H[N_LIGHTS];\n varying float dist[N_LIGHTS];\n varying vec4 shadowPos;\n \n vec3 phong_model_lights( vec3 N )\n { vec3 result = vec3(0.0);\n for(int i = 0; i < N_LIGHTS; i++)\n {\n float attenuation_multiplier = 1.0 / (1.0 + attenuation_factor[i] * (dist[i] * dist[i]));\n float diffuse = max( dot(N, L[i]), 0.0 );\n float specular = pow( max( dot(N, H[i]), 0.0 ), smoothness );\n\n result += attenuation_multiplier * ( shapeColor.xyz * diffusivity * diffuse + lightColor[i].xyz * specularity * specular );\n }\n return result;\n }\n `;\n }", "title": "" }, { "docid": "511aadf6202c62e87086c8b5fb92b08f", "score": "0.58023244", "text": "setPoints (pointCoords) {\n let gl = this.renderer.gl;\n // Step1 - render points to texture\n // Bind the shaders\n this.scatterPlotShader = new glCore.GLShader(gl, this.vertexKdeSrc, this.fragmentKdeSrc);\n this.scatterPlotShader.bind();\n // set any uniforms in the shader(s) here\n //this.scatterPlotShader.uniforms.positions = 0;\n this.scatterPlotShader.uniforms.uSampler = 0;\n\n // Create a buffer for the drawing the point coordinates\n this.pointCoords = pointCoords;\n this.numPoints = pointCoords.length/2;\n let pointBuffer = new glCore.GLBuffer.createVertexBuffer(gl, pointCoords);\n // And index these (simply 0->n-1)\n let indices = new Uint16Array(pointCoords.length/2);\n for (let i = 0; i < indices.length; i++) {\n indices[i] = i;\n }\n let indexBuffer = new glCore.GLBuffer.createIndexBuffer(gl, indices);\n //Control everything via a Vertex Array Object\n this.vao = new glCore.VertexArrayObject(gl);\n // set the attributes\n this.vao.addAttribute(pointBuffer, this.scatterPlotShader.attributes.aVertexPosition);\n this.vao.addIndex(indexBuffer);\n\n // Step 1.5 - extract a single color from the float\n this.floatPackShader = new glCore.GLShader(gl, this.vertexFloatPackSrc, this.fragmentFloatPackSrc);\n this.floatPackShader.bind();\n\n\n let verts = new glCore.GLBuffer.createVertexBuffer(gl, this.vertCoords);\n let tex = new glCore.GLBuffer.createVertexBuffer(gl, this.texCoords);\n let inds = new glCore.GLBuffer.createVertexBuffer(gl, this.quadIndices);\n\n // Buffer for drawing the Quad to render th texture created in Step1\n this.vaoPackQuad = new glCore.VertexArrayObject(gl);\n this.vaoPackQuad.addAttribute(verts, this.floatPackShader.attributes.aVertexPosition);\n this.vaoPackQuad.addAttribute(tex, this.floatPackShader.attributes.aTextureCoord);\n this.vaoPackQuad.addIndex(inds);\n\n // Step2 - render texture to Quad\n this.declippingShader = new glCore.GLShader(gl, this.vertexDeclipSrc, this.fragmentDeclipSrc);\n this.declippingShader.bind();\n this.declippingShader.uniforms.uSampler = 0; // the texture number to sample\n\n let qverts = new glCore.GLBuffer.createVertexBuffer(gl, this.vertCoords);\n let qtex = new glCore.GLBuffer.createVertexBuffer(gl, this.texCoords);\n let qinds = new glCore.GLBuffer.createVertexBuffer(gl, this.quadIndices);\n\n // Buffer for drawing the Quad to render th texture created in Step1\n this.vaoQuad = new glCore.VertexArrayObject(gl);\n this.vaoQuad.addAttribute(qverts, this.declippingShader.attributes.aVertexPosition);\n this.vaoQuad.addAttribute(qtex, this.declippingShader.attributes.aTextureCoord);\n this.vaoQuad.addIndex(qinds);\n }", "title": "" }, { "docid": "f6c266db86c43ab0c30e0e15177e876c", "score": "0.58011574", "text": "function loadShader( _gl, _shaderSrc, canvas ) {\n\n\tvar vertString = \"\";\n\n\tif(_shaderSrc.vertURL){\n\t\tvertString = fetchHTTP( _shaderSrc.vertURL );\n\t} else {\n vertString =\n\"attribute mediump vec2 a_position;\\n\\\nattribute mediump vec2 a_texcoord;\\n\\\nvarying mediump vec2 CoronaTexCoord;\\n\\\nvoid main() {\\n\\\ngl_Position = vec4(a_position, 0.0, 1.0);\\n\\\nCoronaTexCoord = a_texcoord;\\n\\\n}\\n\\\n\";\n\t}\n\n\tvar fragString = \"\\\n#define P_DEFAULT highp\\n\\\n#define P_RANDOM highp\\n\\\n#define P_POSITION mediump\\n\\\n#define P_NORMAL mediump\\n\\\n#define P_UV mediump\\n\\\n#define P_COLOR lowp\\n\\\n#define FRAGMENT_SHADER_SUPPORTS_HIGHP 1\\n\\\nvarying mediump vec2 CoronaTexCoord; uniform P_RANDOM vec4 v_ColorScale; uniform P_RANDOM vec4 CoronaVertexUserData; uniform highp vec2 u_full_resolution;uniform sampler2D CoronaSampler0;uniform sampler2D CoronaSampler1;uniform highp vec2 u_mouse;uniform highp float CoronaTotalTime; \\\nhighp vec4 CoronaColorScale(highp vec4 c) { return v_ColorScale*c; } P_DEFAULT float CoronaDeltaTime=0.02; uniform P_UV vec4 CoronaTexelSize; P_POSITION vec2 CoronaContentScale = vec2(1.0,1.0); \\n\\\nP_COLOR vec4 FragmentKernel( P_UV vec2 position );\\nvoid main(){gl_FragColor = FragmentKernel(CoronaTexCoord);}\\n\";\n\n\terrorLineOffset = fragString.split(/\\r\\n|\\r|\\n/).length\n\n\n if (_shaderSrc.fragSTR){\n\t\tfragString += _shaderSrc.fragSTR;\n\t} else if(_shaderSrc.fragURL){\n\t\tfragString += fetchHTTP( _shaderSrc.fragURL );\n\t} else {\n\t\tfragString += \"P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord ){P_COLOR vec4 ret = vec4(texCoord.x, texCoord.y, abs(sin(CoronaTotalTime)), 1); return CoronaColorScale(ret);}\";\n\t}\n\n\tvar vertexShader = createShader(_gl, vertString, _gl.VERTEX_SHADER, canvas);\n\tvar fragmentShader = createShader(_gl, fragString , _gl.FRAGMENT_SHADER, canvas);\n\n\tif(!fragmentShader){\n\t\tfragmentShader = createShader(_gl, \"void main(){\\n\\\n\tgl_FragColor = vec4(1.0);\\n\\\n}\" , _gl.FRAGMENT_SHADER, canvas);\n\t}\n\n\t// Create and use program\n\tvar program = createProgram( _gl, [vertexShader, fragmentShader]);\n\t_gl.useProgram(program);\n\n\t// Delete shaders\n\t// _gl.detachShader(program, vertexShader);\n // _gl.detachShader(program, fragmentShader);\n // _gl.deleteShader(vertexShader);\n // _gl.deleteShader(fragmentShader);\n\n\treturn program;\n}", "title": "" }, { "docid": "465070cefd94e5726bbae8fbeea82cfb", "score": "0.58004373", "text": "function draw() {\n // Builds the actual object based off the control points from the 2D drawing mode\n initDrawPoints(cntrlPnts);\n buildSurfaceOfRevolution(cntrlPnts);\n \n \n // Associate the shader for normals of the vertices\n var verticesNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, verticesNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(vertexNormals), gl.DYNAMIC_DRAW);\n\n var vNormal = gl.getAttribLocation(programId, \"vNormal\");\n gl.vertexAttribPointer(vNormal, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vNormal);\n console.log(\"push normals\");\n\n\n // Associate the shader variable for position of the vertices\n var triangleBufferId = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, triangleBufferId );\n gl.bufferData(gl.ARRAY_BUFFER, flatten(vertices), gl.DYNAMIC_DRAW);\n \n var vPosition = gl.getAttribLocation(programId, \"vPosition\");\n gl.vertexAttribPointer(vPosition, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vPosition);\n console.log(\"push vertices\");\n\n \n // Associate the shader variable for the texture coordinates of the vertices\n var tBuffer = gl.createBuffer();\n gl.bindBuffer( gl.ARRAY_BUFFER, tBuffer );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(texCoordsArray), gl.STATIC_DRAW );\n \n var vTexCoord = gl.getAttribLocation( programId, \"vTexCoord\" );\n gl.vertexAttribPointer( vTexCoord, 2, gl.FLOAT, false, 0, 0 );\n gl.enableVertexAttribArray( vTexCoord );\n console.log(\"push normals\");\n\n\n // Initialize the view and rotation matrices\n findShaderVariables();\n viewMatrix = lookAt(vec3(0,2,3), vec3(0,0,0), vec3(0,1,0));\n rotationMatrix = mult(rotate(180, vec3(1,0,0)), mat4(1));\n \n updateModelView(mult(viewMatrix, rotationMatrix));\n\n updateProjection(perspective(getFOV(), 1, 0.01, 100));\n\n // Start continuous rendering\n render();\n}", "title": "" }, { "docid": "0d06bea85a53ef9985cb144154c6c671", "score": "0.57994294", "text": "function initGL() {\r\n var canvas = document.getElementById(\"webGLcanvas\");\r\n canvas.width = window.innerWidth - 30;\r\n canvas.height = Math.floor(window.innerHeight - 0.25 * window.innerHeight);\r\n try {\r\n gl = canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n } catch (e) {\r\n }\r\n if (!gl) {\r\n alert(\"cannot initialize webGL\");\r\n }\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = handleKeyUp;\r\n canvas.onmousedown = handleMouseDown;\r\n document.onmouseup = handleMouseUp;\r\n document.onmousemove = handleMouseMove;\r\n\r\n // fragprogram = initShaders(\"perfrag-shader-fs\", \"perfrag-shader-vs\");\r\n vertprogram = initShaders(\"shader-fs\", \"shader-vs\");\r\n currentProgram = vertprogram;\r\n gl.clearColor(0.13, 0.13, 0.13, 1);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n fpsInterval = 1000 / 15;\r\n then = Date.now();\r\n startTime = then;\r\n // initBuffer();\r\n cornerVertexPosBuffer = gl.createBuffer();\r\n pointLightPos = [\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n ];\r\n pointLightColor = [\r\n rand(0, 0.5),rand(0.4, 1),rand(0.4, 1),\r\n rand(0.4, 1),rand(0.4, 1),rand(0, 0.5),\r\n rand(0.4, 1),rand(0.4, 1),rand(0.4, 1),\r\n rand(0, 0.5),rand(0, 0.5),rand(0, 0.5),\r\n rand(0.4, 1),rand(0, 0.5),rand(0.4, 1),\r\n ];\r\n \r\n numPtLights = 5;\r\n\r\n animate();\r\n}", "title": "" }, { "docid": "81feb78fc570b233ff88585722f63178", "score": "0.5793025", "text": "function main(){\n\n\t// setup everything else\n\tvar canvas = document.getElementById(\"my-canvas\");\n\tcanvas.addEventListener(\"mousedown\", doMouseDown, false);\n\tcanvas.addEventListener(\"mouseup\", doMouseUp, false);\n\tcanvas.addEventListener(\"mousemove\", doMouseMove, false);\n\tcanvas.addEventListener(\"mousewheel\", doMouseWheel, false);\n\twindow.onresize = doResize;\n\tcanvas.width = window.innerWidth-16;\n\tcanvas.height = window.innerHeight-180;\n\n\ttry{\n\t\tgl= canvas.getContext(\"webgl2\");\n\t} catch(e){\n\t\tconsole.log(e);\n\t}\n\t\n\tif(gl){\n\t\t// Compile and link shaders\n\t\tprogram = gl.createProgram();\n\t\tvar v1 = gl.createShader(gl.VERTEX_SHADER);\n\t\tgl.shaderSource(v1, vs);\n\t\tgl.compileShader(v1);\n\t\tif (!gl.getShaderParameter(v1, gl.COMPILE_STATUS)) {\r\n\t\t\talert(\"ERROR IN VS SHADER : \" + gl.getShaderInfoLog(v1));\r\n\t\t}\r\n\t\tvar v2 = gl.createShader(gl.FRAGMENT_SHADER);\n\t\tgl.shaderSource(v2, fs)\n\t\tgl.compileShader(v2);\t\t\n\t\tif (!gl.getShaderParameter(v2, gl.COMPILE_STATUS)) {\r\n\t\t\talert(\"ERROR IN FS SHADER : \" + gl.getShaderInfoLog(v2));\r\n\t\t}\t\t\t\r\n\t\tgl.attachShader(program, v1);\n\t\tgl.attachShader(program, v2);\n\t\tgl.linkProgram(program);\t\t\t\t\n\t\t\n\t\tgl.useProgram(program);\n\n\t\t// Creates geometry\n\t\tbuildGeometry();\n\n\t\tdocument.getElementById(\"myRange\").value = BVH_FPS;\n//console.log(totMesh);\n//console.log(startVertex);\n//console.log(startIndex);\n//console.log(vertices);\n//console.log(indices);\n//console.log(colors);\n\t\tvertexBuffer = gl.createBuffer();\n\t\tvertices = new Float32Array(vertices);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n//console.log(vertices.byteLength);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, vertices.byteLength, gl.STATIC_DRAW);\n\t\tgl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);\n\n\t\tindexBuffer = gl.createBuffer();\n\t\tindices = new Uint16Array(indices);\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n//console.log(indices.byteLength);\n\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.byteLength, gl.STATIC_DRAW);\n\t\tgl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, indices);\t\n//\t\t\n//\t\tmesh = new OBJ.Mesh(objStr);\n//\t\tOBJ.initMeshBuffers(gl, mesh);\n\t\t\n\t\t// links mesh attributes to shader attributes\n\t\tprogram.vertexPositionAttribute = gl.getAttribLocation(program, \"in_pos\");\n\t\tgl.enableVertexAttribArray(program.vertexPositionAttribute);\n\t\t \n\t\tprogram.WVPmatrixUniform = gl.getUniformLocation(program, \"pMatrix\");\n\t\tprogram.lightDir1 = gl.getUniformLocation(program, \"lightDir1\");\n\t\tprogram.lightDir2 = gl.getUniformLocation(program, \"lightDir2\");\n\t\tprogram.lightDir3 = gl.getUniformLocation(program, \"lightDir3\");\n\t\tprogram.matcol = gl.getUniformLocation(program, \"matcol\");\n\t\t\n\t\t// prepares the world, view and projection matrices.\n\t\tvar w=canvas.clientWidth;\r\n\t\tvar h=canvas.clientHeight;\r\n\t\t\r\n\t\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\tgl.viewport(0.0, 0.0, w, h);\r\n\n\t\t// selects the mesh\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n\t\tgl.vertexAttribPointer(program.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);\n\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\t\t\n\t\t\n\t // turn on depth testing and back-face culling\n\t gl.enable(gl.DEPTH_TEST);\n\t\tgl.enable(gl.CULL_FACE);\n\t\tgl.cullFace(gl.BACK);\n\n\t\ts45 = 0.707106781186548;\n\t\ts30 = 0.5;\n\t\ts60 = 0.866025403784439;\n\n\t\tgLightDir1 = [ 0.0, s45, s45, 1.0];\n\t\tgLightDir2 = [ s60, s45,-s45*s30, 0.7];\n\t\tgLightDir3 = [-s60,-s45,-s45*s30, 0.5];\n\n\t\tdrawScene();\n\t}else{\n\t\talert(\"Error: WebGL not supported by your browser!\");\n\t}\n}", "title": "" }, { "docid": "456d4d56adb7410cd7536bec7c7f8309", "score": "0.57917815", "text": "updateRays() {\n\n // //console.log(th);\n var rays = [];\n\n function getBeam (X2, X1, Y1, Y2) {\n var u0 = (Y2 - Y1)/(X2 - X1);\n return { u: u0, z:X1, h: Y1};\n }\n\n var Y1 = this.data.Y1;\n var VO = this.data.VO; \n\n // create rays and then shift to front vertex \n\n\n\n var BW = this.BeamWidth;\n switch (this.Aiming) {\n case ENTRANCE_PUPIL:\n var VE1 = renderableLens.total.pupil.VE1;\n rays.push(getBeam(VE1, VO, Y1, +BW/2)); \n rays.push(getBeam(VE1, VO, Y1, 0)); \n rays.push(getBeam(VE1, VO, Y1, -BW/2)); \n break;\n\n case FRONT_VERTEX:\n rays.push(getBeam(0, VO, Y1, +BW/2)); \n rays.push(getBeam(0, VO, Y1, 0)); \n rays.push(getBeam(0, VO, Y1, -BW/2)); \n break;\n\n default:\n rays.push(getBeam(0, VO, Y1, +BW/2)); \n rays.push(getBeam(0, VO, Y1, 0)); \n rays.push(getBeam(0, VO, Y1, -BW/2)); \n\n\n }\n\n\n\n\n console.log(\"Original rays\");\n console.log(rays);\n console.log(this.data);\n console.log(renderableLens);\n\n\n rays = translateRays(rays, 0);\n\n this.inputRays = rays;\n\n //console.log(\"Input rays\");\n //console.log(rays);\n\n\n // trace them through (Fwd)\n this.raypath = Optics.calculateRayTrace(rays, renderableLens.elem);\n\n //console.log(\"Output rays\");\n //console.log (this.raypath);\n //console.log(renderableLens.elem);\n\n //this.drawAfocalConstruction ();\n }", "title": "" }, { "docid": "6702cc75d3efb5b9c8545e949e2b5c88", "score": "0.5784183", "text": "function loadTriangles(inputTriangles) {\n if (inputTriangles != String.null) { \n triBufferSize = 0;\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var coordArray = []; // 1D array of vertex coords for WebGL\n var colorArray = [];\n var colToAdd = vec3.create() //color to push to col array parametric calculation\n var indexArray = []; // 1D array for indeces\n var vtxBufferSize = 0; // number of vertices in the vertex buffer\n var vtxToAdd =[] // vtx coords to add to the coord array\n var indexOffset = vec3.create(); //the index offset in the current set\n var triToAdd = vec3.create()\n\n \n // loop over sets\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n // keep track of offset\n vec3.set(indexOffset, vtxBufferSize, vtxBufferSize, vtxBufferSize);\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++){\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n coordArray.push(vtxToAdd[0], vtxToAdd[1], vtxToAdd[2]);\n //coordArray = coordArray.concat(inputTriangles[whichSet].vertices[whichSetVert]);\n // console.log(inputTriangles[whichSet].vertices[whichSetVert]);\n var Ld = inputTriangles[whichSet].material.diffuse;\n colorArray.push(Ld[0], Ld[1], Ld[2]);\n }\n // add element to color array\n var La = inputTriangles[whichSet].material.ambient;\n var Ld = inputTriangles[whichSet].material.diffuse;\n var Ls = inputTriangles[whichSet].material.specular;\n var n = inputTriangles[whichSet].material.n;\n\n var BA = vec3.create(); \n var CA = vec3.create(); \n var N = vec3.create(); \n \n var V0 = vec3.fromValues(coordArray[whichSet], coordArray[whichSet+1], coordArray[whichSet+2]);\n var V1 = vec3.fromValues(coordArray[whichSet+3], coordArray[whichSet+4], coordArray[whichSet+5]);\n var V2 = vec3.fromValues(coordArray[whichSet+6], coordArray[whichSet+7], coordArray[whichSet+8]);\n \n //console.log(V0);\n vec3.sub(BA, coordArray[0], vtxToAdd[0]);\n vec3.sub(CA, vtxToAdd[2], vtxToAdd[0]);\n\n vec3.cross(N, BA, CA);\n\n var L = vec3.fromValues(-3, 1, 0.5);\n var L_norm = vec3.create();\n vec3.normalize(L_norm, L);\n\n var V = vec3.fromValues(0, 0, 1);\n \n var H = vec3.create();\n var H_norm = vec3.create();\n vec3.add(H, L, V);\n vec3.normalize(H_norm ,H);\n\n var NxL = vec3.dot(N, L_norm);\n var NxH = vec3.dot(N, H_norm);\n\n var KLa = vec3.create();\n vec3.scale(KLa, La, 0.2);\n\n var KLd = vec3.create();\n var LdxNxL = vec3.create();\n vec3.scale(LdxNxL, KLd, NxL);\n vec3.scale(KLd, LdxNxL, 0.6);\n\n var KLs = vec3.create();\n var LsxNxH = vec3.create();\n vec3.scale(LsxNxH, KLs, NxH);\n vec3.scale(KLs, LsxNxH, 0.2);\n\n var add1 = vec3.create();\n //var add2 = vec3.create();\n vec3.add(add1, KLa, KLd);\n vec3.add(colToAdd, add1, KLs); \n\n //colToAdd = KLa+ KLd + KLs;//change it up\n //console.log(colToAdd);\n //colorArray.push(colToAdd[0] ,colToAdd[1], colToAdd[2]);\n //colorArray.push(colToAdd[0] ,colToAdd[1], colToAdd[2]);\n //colorArray.push(colToAdd[0] ,colToAdd[1], colToAdd[2]);\n \n // set up triangle index array adjusting offset\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd, indexOffset, inputTriangles[whichSet].triangles[whichSetTri]);\n indexArray.push(triToAdd[0], triToAdd[1], triToAdd[2]);\n }\n\n // loop over inputTriangles[whichSet].triangles\n vtxBufferSize += inputTriangles[whichSet].vertices.length;\n triBufferSize += inputTriangles[whichSet].triangles.length;\n // keep track of vertex and traingle buffer sizes\n\n } // end for each triangle set \n triBufferSize *= 3;\n // console.log(coordArray.length);\n\n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n \n // send color indeces to webGL\n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(colorArray),gl.STATIC_DRAW); // coords to that buffer\n\n // send triangle indeces to webGL\n triangleBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indexArray), gl.STATIC_DRAW); // coords to that buffer\n\n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "f31ab6ab67a7ba04c302ac8ca736a7c9", "score": "0.57835174", "text": "function main() {\n // Retrieve <canvas> element\n canvas = document.getElementById('webgl');\n\n // Get the rendering context for WebGL\n gl = getWebGLContext(canvas);\n if (!gl) {\n console.log('Failed to get the rendering context \\'gl\\' for WebGL');\n return;\n }\n\n // Initialize shaders\n if (!initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n var n_vcount = initVertexBuffers(gl); // vertex count.\n if (n_vcount < 0) {\n console.log('Failed to set the vertex information: n_vcount false');\n return;\n }\n\n // Set texture\n if (!initTextures()) {\n console.log('Failed to intialize the texture.');\n return;\n }\n\n // Set the clear color and enable the depth test\n gl.clearColor(0.4, 0.4, 0.4, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n uLoc_eyePosWorld = gl.getUniformLocation(gl.program, 'u_eyePosWorld');\n uLoc_ModelMatrix = gl.getUniformLocation(gl.program, 'u_ModelMatrix');\n uLoc_ProjView = gl.getUniformLocation(gl.program, 'u_ProjView');\n uLoc_NormalMatrix = gl.getUniformLocation(gl.program, 'u_NormalMatrix');\n if (!uLoc_eyePosWorld ||\n !uLoc_ModelMatrix || !uLoc_ProjView || !uLoc_NormalMatrix) {\n console.log('Failed to get GPUs matrix storage locations');\n return;\n }\n\n for (var i = 0; i < 2; i++) {\n lamps.push(new LightsT()); \n lamps[i].u_pos = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].pos'); \n lamps[i].u_ambi = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].ambi');\n lamps[i].u_diff = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].diff');\n lamps[i].u_spec = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].spec');\n if( !lamps[i].u_pos || !lamps[i].u_ambi || !lamps[i].u_diff || !lamps[i].u_spec ) {\n console.log('Failed to get GPUs Lamps['+i+'] storage locations');\n return;\n }\n }\n\n u_isLit = gl.getUniformLocation(gl.program, 'u_isLit');\n if(!u_isLit) {\n console.log('Failed to get GPUs u_isLit storage locations');\n return;\n }\n\n u_isHeadLit = gl.getUniformLocation(gl.program, 'u_isHeadLit');\n if(!u_isLit) {\n console.log('Failed to get GPUs u_isHeadLit storage locations');\n return;\n }\n\n u_ShadingMode = gl.getUniformLocation(gl.program, 'u_ShadingMode');\n if(!u_ShadingMode) {\n console.log('Failed to get GPUs u_ShadingMode storage locations');\n return;\n }\n\n u_isPhong = gl.getUniformLocation(gl.program, 'u_isPhong');\n if(!u_isPhong) {\n console.log('Failed to get GPUs u_isPhong storage locations');\n return;\n }\n\n u_TexMode = gl.getUniformLocation(gl.program, 'u_TexMode');\n if(!u_TexMode) {\n console.log('Failed to get GPUs u_TexMode storage locations');\n return;\n }\n\n u_AttMode = gl.getUniformLocation(gl.program, 'u_AttMode');\n if(!u_AttMode) {\n console.log('Failed to get GPUs u_AttMode storage locations');\n return;\n }\n\n u_isDistort = gl.getUniformLocation(gl.program, 'u_isDistort');\n if(!u_isDistort) {\n console.log('Failed to get GPUs u_isDistort storage locations');\n return;\n }\n\n // ... for Phong material/reflectance:\n matl0.uLoc_Ke = gl.getUniformLocation(gl.program, 'u_MatlSet[0].emit');\n matl0.uLoc_Ka = gl.getUniformLocation(gl.program, 'u_MatlSet[0].ambi');\n matl0.uLoc_Kd = gl.getUniformLocation(gl.program, 'u_MatlSet[0].diff');\n matl0.uLoc_Ks = gl.getUniformLocation(gl.program, 'u_MatlSet[0].spec');\n matl0.uLoc_Kshiny = gl.getUniformLocation(gl.program, 'u_MatlSet[0].shiny');\n if(!matl0.uLoc_Ke || !matl0.uLoc_Ka || !matl0.uLoc_Kd \n || !matl0.uLoc_Ks || !matl0.uLoc_Kshiny\n ) {\n console.log('Failed to get GPUs Reflectance storage locations');\n return;\n }\n\n // Init World-coord. position & colors of first light source in global vars;\n // world light\n lamps[0].I_pos.elements.set([settings.lightX, settings.lightY, settings.lightZ]);\n var ambient = settings.ambient;\n lamps[0].I_ambi.elements.set([ambient[0]/255, ambient[1]/255, ambient[2]/255]);\n var diffuse = settings.diffuse;\n lamps[0].I_diff.elements.set([diffuse[0]/255, diffuse[1]/255, diffuse[2]/255]);\n var specular = settings.specular;\n lamps[0].I_spec.elements.set([specular[0]/255, specular[1]/255, specular[2]/255]);\n\n // head light\n lamps[1].I_pos.elements = eyePosWorld;\n lamps[1].I_ambi.elements.set([1.0, 1.0, 1.0]);\n lamps[1].I_diff.elements.set([1.0, 1.0, 1.0]);\n lamps[1].I_spec.elements.set([1.0, 1.0, 1.0]);\n\n // ( MOVED: set the GPU's uniforms for lights and materials in draw()\n // function, not main(), so they ALWAYS get updated before each\n // on-screen re-drawing)\n \n winResize();\n setupDatgui();\n\n window.onkeydown = function(ev){keydown(ev, gl)};\n window.onkeyup = function(ev){keyup(ev, gl)};\n\n var tick = function() {\n animate();\n draw();\n requestAnimationFrame(tick, canvas);\n };\n tick();\n}", "title": "" }, { "docid": "1625476dfe9e40be723051eb8c462da1", "score": "0.5780975", "text": "function webglDirectedNodeProgram() {\n var ATTRIBUTES_PER_VERTEX = 4; // primitive is Line with two points. Each has x,y,z and color = 3 * 2 attributes.\n var ATTRIBUTES_PER_PRIMITIVE = ATTRIBUTES_PER_VERTEX * 3; // 3 Vertices make an arrow head\n var BYTES_PER_NODE =\n 3 * (3 * Float32Array.BYTES_PER_ELEMENT + Uint32Array.BYTES_PER_ELEMENT); // ((3 vertices) nodes * (x,y + color))\n\n var nodesFS = [\n \"#version 300 es\",\n \"precision mediump float;\",\n \"in vec4 color;\",\n \"out vec4 outColor;\",\n \"void main(void) {\",\n \" outColor = color;\",\n \"}\"\n ].join(\"\\n\");\n var nodesVS = [\n \"#version 300 es\",\n \"in vec3 a_vertexPos;\",\n \"in vec4 a_color;\",\n\n \"uniform vec2 u_screenSize;\",\n \"uniform mat4 u_transform;\",\n\n \"out vec4 color;\",\n\n \"void main(void) {\",\n \" gl_Position = u_transform * vec4(a_vertexPos.xy/u_screenSize, -a_vertexPos.z, 1.0);\",\n \" color = a_color.abgr;\",\n \"}\"\n ].join(\"\\n\");\n\n var program;\n var gl;\n var buffer;\n var locations;\n var utils;\n var storage = new ArrayBuffer(16 * BYTES_PER_NODE);\n var positions = new Float32Array(storage);\n var colors = new Uint32Array(storage);\n var nodesCount = 0;\n var width;\n var height;\n var transform;\n var sizeDirty;\n var circleTexture;\n\n return {\n load: load,\n\n /**\n * Updates position of node in the buffer of nodes.\n *\n * @param idx - index of current node.\n * @param pos - new position of the node.\n */\n position: position,\n\n updateTransform: updateTransform,\n\n updateSize: updateSize,\n\n removeNode: removeNode,\n\n createNode: createNode,\n\n replaceProperties: replaceProperties,\n\n render: render,\n\n resetStorage: resetStorage\n };\n\n function resetStorage() {\n storage = new ArrayBuffer(16 * BYTES_PER_NODE);\n positions = new Float32Array(storage);\n colors = new Uint32Array(storage);\n }\n function ensureEnoughStorage() {\n // TODO: this is a duplicate of webglNodeProgram code. Extract it to webgl.js\n if (nodesCount * BYTES_PER_NODE > storage.byteLength) {\n // Every time we run out of space create new array twice bigger.\n // TODO: it seems buffer size is limited. Consider using multiple arrays for huge graphs\n var extendedStorage = new ArrayBuffer(storage.byteLength * 2),\n extendedPositions = new Float32Array(extendedStorage),\n extendedColors = new Uint32Array(extendedStorage);\n\n extendedColors.set(colors); // should be enough to copy just one view.\n positions = extendedPositions;\n colors = extendedColors;\n storage = extendedStorage;\n }\n }\n\n function load(glContext) {\n gl = glContext;\n utils = glUtils(glContext);\n\n program = utils.createProgram(nodesVS, nodesFS);\n gl.useProgram(program);\n locations = utils.getLocations(program, [\n \"a_vertexPos\",\n \"a_color\",\n \"u_screenSize\",\n \"u_transform\"\n ]);\n\n buffer = gl.createBuffer();\n }\n\n function position(nodeUI, pos) {\n var idx = nodeUI.id;\n\n var direction = nodeUI.gradient.direction;\n size = nodeUI.size;\n let parallel = {\n x: direction.x * (size / 2),\n y: direction.y * (size / 2)\n };\n\n var perpendicular = {\n x: (direction.y * size) / 4,\n y: (-direction.x * size) / 4\n };\n\n var magnitude = nodeUI.gradient.magnitude;\n\n var offset = idx * ATTRIBUTES_PER_PRIMITIVE;\n\n var centerVert = {\n x: pos.x + parallel.x,\n y: pos.y + parallel.y\n };\n\n var rightVert = {\n x: pos.x - parallel.x + perpendicular.x,\n y: pos.y - parallel.y + perpendicular.y\n };\n\n var leftVert = {\n x: pos.x - parallel.x - perpendicular.x,\n y: pos.y - parallel.y - perpendicular.y\n };\n\n // Center vertex\n positions[offset] = centerVert.x;\n positions[offset + 1] = -centerVert.y;\n positions[offset + 2] = nodeUI.depth;\n colors[offset + 3] = nodeUI.color;\n\n // Right vertex\n positions[offset + 4] = rightVert.x;\n positions[offset + 5] = -rightVert.y;\n positions[offset + 6] = nodeUI.depth;\n colors[offset + 7] = nodeUI.color;\n\n // Left vertex\n positions[offset + 8] = leftVert.x;\n positions[offset + 9] = -leftVert.y;\n positions[offset + 10] = nodeUI.depth;\n colors[offset + 11] = nodeUI.color;\n }\n\n function updateTransform(newTransform) {\n sizeDirty = true;\n transform = newTransform;\n }\n\n function updateSize(w, h) {\n width = w;\n height = h;\n sizeDirty = true;\n }\n\n function removeNode(node) {\n if (nodesCount > 0) {\n nodesCount -= 1;\n }\n\n if (node.id < nodesCount && nodesCount > 0) {\n // we can use colors as a 'view' into array array buffer.\n utils.copyArrayPart(\n colors,\n node.id * ATTRIBUTES_PER_PRIMITIVE,\n nodesCount * ATTRIBUTES_PER_PRIMITIVE,\n ATTRIBUTES_PER_PRIMITIVE\n );\n }\n }\n\n function createNode() {\n ensureEnoughStorage();\n nodesCount += 1;\n }\n\n function replaceProperties(/* replacedNode, newNode */) {}\n function render() {\n gl.enableVertexAttribArray(locations.vertexPos);\n gl.enableVertexAttribArray(locations.color);\n\n gl.useProgram(program);\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, storage, gl.DYNAMIC_DRAW);\n\n if (sizeDirty) {\n sizeDirty = false;\n gl.uniformMatrix4fv(locations.transform, false, transform);\n gl.uniform2f(locations.screenSize, width, height);\n }\n\n gl.vertexAttribPointer(\n locations.vertexPos,\n 3,\n gl.FLOAT,\n false,\n 4 * Float32Array.BYTES_PER_ELEMENT,\n 0\n );\n gl.vertexAttribPointer(\n locations.color,\n 4,\n gl.UNSIGNED_BYTE,\n true,\n 4 * Float32Array.BYTES_PER_ELEMENT,\n 3 * 4\n );\n gl.drawArrays(gl.TRIANGLES, 0, nodesCount * 3);\n\n frontArrowId = nodesCount - 1;\n }\n}", "title": "" }, { "docid": "dcb4cbb5b87a1aacdeeee149337770b1", "score": "0.5780374", "text": "render() {\n // Clear the geometry onscreen\n this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n\n for (var i = 0; i < this.scene.geometries.length; i++) {\n var geometry = this.scene.geometries[i];\n\n // Switch to shader attached to geometry\n this.gl.useProgram(geometry.shader.program);\n this.gl.program = geometry.shader.program;\n\n geometry.shader.setUniform(\"u_ViewMatrix\", this.camera.viewMatrix.elements);\n geometry.shader.setUniform(\"u_ProjectionMatrix\", this.camera.projectionMatrix.elements);\n //geometry.shader.setUniform(\"u_ModelMatrix\", this.camera.modelMatrix.elements);\n\n if(geometry.image != null) {\n if(!(geometry.image.src in this.textures)) {\n // Create a texture object and store id using its path as key\n this.textures[geometry.image.src] = this.gl.createTexture();\n this.loadTexture(this.textures[geometry.image.src], geometry.image);\n }\n else {\n // Enable texture unit0\n this.gl.activeTexture(this.gl.TEXTURE0);\n // Bind the texture object to the target\n this.gl.bindTexture(this.gl.TEXTURE_2D, this.textures[geometry.image.src]);\n }\n }\n\n // Callback function in the case user wants to change the\n // geometry before the draw call\n geometry.render();\n\n // Set attribute buffer with the geometry data\n this.sendVertexDataToGLSL(geometry.data, geometry.dataCounts, geometry.shader);\n\n // Passes the indices of a geometry to the index buffer a\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, geometry.indices, this.gl.STATIC_DRAW);\n\n // Draw geometries using current buffer data\n this.gl.drawElements(this.gl.TRIANGLES, geometry.indices.length, this.gl.UNSIGNED_SHORT, 0);\n }\n }", "title": "" }, { "docid": "a9c3133bc966c51976b6ef1bcc94e82f", "score": "0.5778654", "text": "function initShaders()\n{\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\t//create and link shader program\n\tshaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\tif(!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS))\n\t{\n\t\tconsole.log(\"Could not link shaders\");\n\t\treturn;\n\t}\n\n\t//register shader\n\tgl.useProgram(shaderProgram);\n\n\tshaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n\tgl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n\tshaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoordinate\");\n\tgl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n\n\tconsole.log(\"Initialized shaders\");\n}", "title": "" }, { "docid": "95cd9c8962068b170d26709a73ce7823", "score": "0.576731", "text": "initBuffers(gl) {\n // Create a buffer for the tree's vertex positions.\n const treePositionBuffer = gl.createBuffer();\n\n // Select the treePositionBuffer as the one to apply buffer\n // operations to from here out.\n gl.bindBuffer(gl.ARRAY_BUFFER, treePositionBuffer);\n\n // Now create an array of positions for the tree.\n const unit = this.treeSize / this.treeLOD;\n let i = 0, offset = 0, offsetX = 0, offsetY = this.treeSize, offsetZ = 0, one = 0, k = 0,\n skew = 1;\n one = (2 * Math.PI) / this.treeLOD;\n for (i = 0; i < this.treeLOD; i++) {\n offsetX = Math.sin(i * one) * this.treeSize / 24 + skew;\n offsetZ = Math.cos(i * one) * this.treeSize / 24 - skew;\n offsetY = this.treeOffset;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin((i + 1) * one) * this.treeSize / 24 + skew;\n offsetZ = Math.cos((i + 1) * one) * this.treeSize / 24 - skew;\n offsetY = this.treeOffset;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin(i * one) * this.treeSize / 48 + skew;\n offsetZ = Math.cos(i * one) * this.treeSize / 48 - skew;\n offsetY = this.treeOffset + this.treeSize;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin(i * one) * this.treeSize / 48 + skew;\n offsetZ = Math.cos(i * one) * this.treeSize / 48 - skew;\n offsetY = this.treeOffset + this.treeSize;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin((i + 1) * one) * this.treeSize / 48 + skew;\n offsetZ = Math.cos((i + 1) * one) * this.treeSize / 48 - skew;\n offsetY = this.treeOffset + this.treeSize;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin((i + 1) * one) * this.treeSize / 24 + skew;\n offsetZ = Math.cos((i + 1) * one) * this.treeSize / 24 - skew;\n offsetY = this.treeOffset;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n }\n\n // Branches\n for (i = 0; i < this.treeLOD; i++) {\n var height = this.treeSize * Math.random();\n\n offsetX = Math.sin(i * one) * this.treeSize / 24 + skew;\n offsetZ = Math.cos(i * one) * this.treeSize / 24 - skew;\n offsetY = this.treeOffset + height;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin((i + 1) * one) * this.treeSize / 24 + skew;\n offsetZ = Math.cos((i + 1) * one) * this.treeSize / 24 - skew;\n offsetY = this.treeOffset + height;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin((i + 1) * one) * this.treeSize / 3 + skew;\n offsetZ = Math.cos((i + 1) * one) * this.treeSize / 3 - skew;\n offsetY = this.treeOffset + height + this.treeSize / 6;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin(i * one) * this.treeSize / 48 + skew;\n offsetZ = Math.cos(i * one) * this.treeSize / 48 - skew;\n offsetY = this.treeOffset + height - this.treeSize / 24;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin(i * one) * this.treeSize / 48 + skew;\n offsetZ = Math.cos(i * one) * this.treeSize / 48 - skew;\n offsetY = this.treeOffset + height + this.treeSize / 24;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n\n offsetX = Math.sin((i + 1) * one) * this.treeSize / 3 + skew;\n offsetZ = Math.cos((i + 1) * one) * this.treeSize / 3 - skew;\n offsetY = this.treeOffset + height + this.treeSize / 6;\n this.sourcePositions[offset++] = offsetX;\n this.sourcePositions[offset++] = offsetY;\n this.sourcePositions[offset++] = offsetZ;\n }\n\n // Now pass the list of positions into WebGL to build the\n // shape. We do this by creating a Float32Array from the\n // JavaScript array, then use it to fill the current buffer.\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.sourcePositions), gl.STATIC_DRAW);\n const treeTextureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, treeTextureCoordBuffer);\n\n let treeTextureCoordinates = [];\n offset = 0;\n\n for (i = 0; i < this.treeLOD * 4; i++) {\n treeTextureCoordinates[offset++] = 0; // X\n treeTextureCoordinates[offset++] = 0; // Y\n\n treeTextureCoordinates[offset++] = 1 / this.treeSize; // X\n treeTextureCoordinates[offset++] = 0; // Y\n\n treeTextureCoordinates[offset++] = 2 / this.treeSize; // X\n treeTextureCoordinates[offset++] = this.treeSize; // Y\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(treeTextureCoordinates),\n gl.STATIC_DRAW);\n\n // Build the element array buffer; this specifies the indices\n // into the vertex arrays for each face's vertices.\n\n const treeIndexBuffer = gl.createBuffer();\n let start = 0, treeIndices = [];\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, treeIndexBuffer);\n\n // This array defines each face as two triangles, using the\n // indices into the vertex array to specify each triangle's\n // position.\n for (i = 0; i < this.treeLOD * 12; i++) {\n //for (i = 0; i < 3; i++) {\n treeIndices[i] = i;\n }\n\n // Now send the element array to GL\n\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n new Uint16Array(treeIndices), gl.STATIC_DRAW);\n\n this.buffers = {\n position: treePositionBuffer,\n textureCoord: treeTextureCoordBuffer,\n indices: treeIndexBuffer,\n };\n\n // Load the texture.\n this.loadTexture(gl, 'texture/tree.jpg');\n\n return this.buffers;\n }", "title": "" }, { "docid": "3e51dfc9f76782a312d70bb09131d576", "score": "0.576682", "text": "renderSSAO(scene, camera, { clear = true, draw = true } = { clear: true, draw: true }) {\n if (clear) {\n this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\n this.imgData = this.ctx.getImageData(0, 0, this.canvasWidth, this.canvasHeight)\n this.data = this.imgData.data\n this.zBuffer.fill(-Infinity)\n }\n\n let { imgData, data } = this\n\n // setup\n let { model, light } = scene\n let { shader } = model\n let { viewportTr } = camera\n\n shader.updateUniform({\n uniM: camera.uniM,\n lightDir: light.dir,\n })\n\n let renderingTime = new Date()\n let coords = []\n\n let width = camera.vW\n let height = camera.vH\n\n // first pass, using depth shader\n\n for (let fi = 0; fi < model.faces.length; fi++) {\n for (let vi = 0; vi < 3; vi++) {\n coords[vi] = shader.vertex(fi, vi)\n }\n triangleWithZBuffer(...coords, shader, this.zBuffer, data, this.canvasWidth, viewportTr, draw)\n }\n\n // second pass\n\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (this.zBuffer[(height - 1 - y) * width + x] < -1e5) continue\n\n let bufferIdx = (width - 1 - y) * width + x\n\n let total = 0\n // - 1e-4 for preventing extra round due to the float type\n // from ssloy's\n for (let deg = 0; deg < 2 * Math.PI - 1e-4; deg += Math.PI / 4) {\n let dx = Math.round(Math.cos(deg))\n let dy = Math.round(Math.sin(deg))\n\n let tx = x + dx\n let ty = y + dy\n let tIdx = (width - 1 - ty) * width + tx\n let diffZ = this.zBuffer[tIdx] - this.zBuffer[bufferIdx]\n\n if (diffZ < 0) {\n total += Math.PI / 2\n continue\n }\n let maxElevationAngle = Math.atan(diffZ / Math.sqrt(dx ** 2 + dy ** 2))\n total += Math.PI / 2 - maxElevationAngle\n }\n\n total /= Math.PI * 4\n total *= 255\n\n // total = Math.pow(total, 100) * 255\n data[bufferIdx * 4 + 0] = total\n data[bufferIdx * 4 + 1] = total\n data[bufferIdx * 4 + 2] = total\n }\n }\n\n console.log(\"render: \", new Date() - renderingTime, \"ms\")\n this.ctx.putImageData(imgData, 0, 0)\n }", "title": "" }, { "docid": "2402a060a23171e0aecc9fd21a1ae836", "score": "0.57598627", "text": "function loadTriangles() {\n var inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\"); console.log(inputTriangles);\n\n if (inputTriangles != String.null) { \n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var coordArray = []; // 1D array of vertex coords for WebGL\n var indexArray = []; // 1D array of vertex indices for WebGL\n var diffColorArray = []; //1D array of colors for WebGL\n var vtxBufferSize = 0; // the number of vertices in the vertex buffer\n var vtxToAdd = []; // vtx coords to add to the coord array\n var indexOffset = vec3.create(); // the index offset for the current set\n var triToAdd = vec3.create(); // tri indices to add to the index array\n \n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) {\n vec3.set(indexOffset,vtxBufferSize,vtxBufferSize,vtxBufferSize); // update vertex offset\n console.log(\"indexOffset:: \"+indexOffset);\n var colorToAdd = inputTriangles[whichSet].material.diffuse;\n // set up the vertex coord array\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++) {\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\n coordArray.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); \n diffColorArray.push(colorToAdd[0], colorToAdd[1], colorToAdd[2]);\t\n } // end for vertices in set\n //console.log(coordArray);\n // set up the triangle index array, adjusting indices across sets\n for (whichSetTri=0; whichSetTri<inputTriangles[whichSet].triangles.length; whichSetTri++) {\n vec3.add(triToAdd,indexOffset,inputTriangles[whichSet].triangles[whichSetTri]); console.log(\"triToAdd:: \"+triToAdd); \n indexArray.push(triToAdd[0],triToAdd[1],triToAdd[2]); console.log(\"indexArray:: \"+indexArray);\n } // end for triangles in set\n //console.log(indexArray);\n vtxBufferSize += inputTriangles[whichSet].vertices.length; // total number of vertices\n console.log(\"vtxBufferSize:: \"+vtxBufferSize);\n triBufferSize += inputTriangles[whichSet].triangles.length; // total number of tris\n console.log(\"triBufferSize:: \"+triBufferSize);\n\n //get diffused colors\n } // end for each triangle set \n triBufferSize *= 3; // now total number of indices\n console.log(\"triBufferSize:: \"+triBufferSize);\n //console.log('diffColorArray:: '+diffColorArray.length);\n //console.log(\"coordinates: \"+coordArray.length);\n // console.log(\"numverts: \"+vtxBufferSize);\n // console.log(\"indices: \"+indexArray.toString());\n // console.log(\"numindices: \"+triBufferSize);\n \n // send the vertex coords to webGL\n vertexBuffer = gl.createBuffer(); // init empty vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(coordArray),gl.STATIC_DRAW); // coords to that buffer\n console.log(coordArray);\n //send the diffuse colors to WebGL\n colorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(diffColorArray),gl.STATIC_DRAW);\n \n // send the triangle indices to webGL\n triangleBuffer = gl.createBuffer(); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffer); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(indexArray),gl.STATIC_DRAW); // indices to that buffer\n\n \n\n } // end if triangles found\n} // end load triangles", "title": "" }, { "docid": "a1b4223cf3a63fc6c574f451e1864620", "score": "0.5759715", "text": "function updateBuffers() {\n \n triangleVerticestop[0] = triangleVerticestop[0] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[3] = triangleVerticestop[3] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[6] = triangleVerticestop[6] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[9] = triangleVerticestop[9] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[12] = triangleVerticestop[12] -0.03*Math.sin(2*Math.PI*((framecount+5)/20)); //repeat vetex, should be the same pace with the bommon fan\n triangleVerticestop[15] = triangleVerticestop[15] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20));\n triangleVerticestop[18] = triangleVerticestop[18] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticestop[21] = triangleVerticestop[21] +0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n \n \n triangleVerticesmid[0] = triangleVerticesmid[0] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[3] = triangleVerticesmid[3] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[6] = triangleVerticesmid[6] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[9] = triangleVerticesmid[9] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[15] = triangleVerticesmid[15] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[12] = triangleVerticesmid[12] + 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0)); //repeat vetex, should be the same pace with the top fan\n triangleVerticesmid[18] = triangleVerticesmid[18] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n triangleVerticesmid[21] = triangleVerticesmid[21] - 0.03*Math.sin(2*Math.PI*((framecount+5)/20.0));\n\n //update the top buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffertop);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticestop), gl.DYNAMIC_DRAW);\n vertexPositionBuffertop.itemSize = 3;\n vertexPositionBuffertop.numberOfItems = 8;\n //update the bottom buffer new positions\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPositionBuffermid);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(triangleVerticesmid), gl.DYNAMIC_DRAW);\n vertexPositionBuffermid.itemSize = 3;\n vertexPositionBuffermid.numberOfItems = 8;\n}", "title": "" } ]
fd782957796185006d9993dc080fe038
comprobar longitud de campo
[ { "docid": "efd37cbe72c510e1ef9cc096c0911f19", "score": "0.5476987", "text": "function comprobarLongitud(input, min, max) {\n if(input.value.length < min) {\n showError(input, `El campo ${obtenerNombreCampo(input)} debe tener al menos ${min}`);\n } else if(input.value.length > max) {\n showError(input, `El campo ${obtenerNombreCampo(input)} debe tener menos de ${max}`);\n } else {\n showSuccess(input)\n }\n}", "title": "" } ]
[ { "docid": "b7fc67867c58112f2ac7a627c64b95c4", "score": "0.6838785", "text": "getLong () {\n\t\treturn this.longitud;\n\t}", "title": "" }, { "docid": "14384a28b0a3c6eec0dd63828437fdef", "score": "0.6087169", "text": "function longitud(field, minLength, maxLength) {\r\n if (field.value.length >= minLength && field.value.length < maxLength) {\r\n setValido(field);\r\n return true;\r\n } else if (field.value.length < minLength) {\r\n setInvalido(\r\n field,\r\n `${field.name} debe tener al menos ${minLength} caracteres`\r\n );\r\n return false;\r\n } else {\r\n setInvalido(\r\n field,\r\n `${field.name} debe tener menos de ${maxLength} caracteres`\r\n );\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "f515091e4ec7f59a8cd57b58eb0e9432", "score": "0.6038288", "text": "longitud(trayectoria) {\n let n = trayectoria.length - 1;\n trayectoria.unshift(n);\n }", "title": "" }, { "docid": "e186af620fb10c4e89b9bf0d04ce71ee", "score": "0.5935278", "text": "function long() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long'\n });\n }", "title": "" }, { "docid": "0878db5fad19d7af89783ca12fd312a7", "score": "0.5913704", "text": "function longitudID(field,maxLength) {\r\n if (field.value.length < maxLength) {\r\n setValido(field);\r\n return true;\r\n } else {\r\n setInvalido(\r\n field,\r\n `${field.name} debe tener menos de ${maxLength} caracteres`\r\n );\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "b733b7bebc0fd0e11b39304413e4122f", "score": "0.55790097", "text": "putLong(l) {\r\n let length = this.length;\r\n if (length + 8 > this.data.length) {\r\n this.enlarge(8);\r\n }\r\n let data = this.data;\r\n let i = l.getHighBits();\r\n data[length++] = (i >>> 24) & 256;\r\n data[length++] = (i >>> 16) & 256;\r\n data[length++] = (i >>> 8) & 256;\r\n data[length++] = i & 256;\r\n i = l.getLowBits();\r\n data[length++] = ((i >>> 24) & 256);\r\n data[length++] = ((i >>> 16) & 256);\r\n data[length++] = ((i >>> 8) & 256);\r\n data[length++] = (i & 256);\r\n this.length = length;\r\n return this;\r\n }", "title": "" }, { "docid": "8795ad62bfa93ce17c857ec701793349", "score": "0.55458724", "text": "function contar_2(){\n var max = 150; \n var cadena = document.getElementById(\"Descripcion_1\").value; \n var longitud = cadena.length; \n\n if(longitud <= max) { \n document.getElementById(\"Contador_2\").value = max-longitud; \n } else { \n document.getElementById(\"Descripcion_1\").value = cadena.subtring(0, max);\n } \n }", "title": "" }, { "docid": "1bbb5b05151f749e71ffc6fb593a32d7", "score": "0.55356014", "text": "function validar_longitud(campo,longitud)\n{\n var campo_sin_espacios = $.trim($(campo).val());\n if(campo_sin_espacios.length < longitud)\n {\n return false;\n }\n else\n return true\n}", "title": "" }, { "docid": "7cabc6cffab2d7114e80afbec9d4fd0a", "score": "0.5501551", "text": "function generalLong() {\n return doFormat(date, {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "title": "" }, { "docid": "118324afca0c63db5efc67a7c42542bf", "score": "0.5449538", "text": "function LONG (data) {\n return caching(DURATION.long, data);\n }", "title": "" }, { "docid": "5325e67a7cb1115cca14db5580340570", "score": "0.5422007", "text": "function daleDameLasCoordenadasDale(puntoEnPantalla) {\n var posActual = marker.getLatLng() \n const area = L.latLng(posActual.lat, posActual.lng).toBounds(2000); // podes usar esto para obtener los valores de Lat minimos y maximos y Long min y max.\n let minLong = area.getWest()\n let maxLong = area.getEast()\n let minLat = area.getSouth()\n let maxLat = area.getNorth()\n let maxX = 1600\n let maxY = 800\n // area en la que queremos dibujar el camino\n \n // primero se calcula el punto \n let misterioLat = ((puntoEnPantalla.x / maxX) * (maxLong - minLong)) + minLat\n let misterioLong = ((puntoEnPantalla.y / maxY) * (maxLat - minLat)) + minLong\n let puntoConLatLong = L.latLng(misterioLat,misterioLong)\n return puntoConLatLong;\n }", "title": "" }, { "docid": "143a11c6b6450ad061aaa3a73853404e", "score": "0.5395092", "text": "function timeLong() {\n return doFormat(date, {\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "title": "" }, { "docid": "cb4b86777a9d528d91689c53c248667a", "score": "0.5378484", "text": "function fullLong() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\n }", "title": "" }, { "docid": "36f31903c7fc96900cec0be8867363c8", "score": "0.534079", "text": "function lon(data) {\n const LON = 16;\n\n return parseFloat(data[LON]);\n }", "title": "" }, { "docid": "e31241ed960b83e7600cba0fbd79ffbb", "score": "0.53299373", "text": "function dePulgadasACentimetros(pulgadas) {\n return pulgadas * 2.54;\n}", "title": "" }, { "docid": "1f6332609616065ff4e2df09bffc7b10", "score": "0.5286551", "text": "function getPelnas1( pajamos1, nuostoliai1 ) {\n return pajamos1 - nuostoliai1;\n}", "title": "" }, { "docid": "d04300d38a15b1a3b327e453b37d6ef8", "score": "0.5259294", "text": "function ordenLexicografico(cadena1,cadena2){\n let longCadena1=cadena1.length;\n let longCadena2=cadena2.length;\n\n \n}", "title": "" }, { "docid": "623e475b4840c1decc0bc137c0d25ea1", "score": "0.5234647", "text": "function getAltura1(){\n\treturn plataformas.altura1;\n}", "title": "" }, { "docid": "6fd2de9e09b026119b1ca6b3b59e7de3", "score": "0.51801294", "text": "function validateLong(form) {\r\n\t\treturn validateAnyNumber(form, 'Long', 9223372036854775807);\r\n\t}", "title": "" }, { "docid": "26f181e970dc3d01b8312df69d9eced8", "score": "0.5170956", "text": "get longitude() {\n return this._long;\n }", "title": "" }, { "docid": "26f181e970dc3d01b8312df69d9eced8", "score": "0.5170956", "text": "get longitude() {\n return this._long;\n }", "title": "" }, { "docid": "0b68841df8f1ab3d3f541b84e81e9e54", "score": "0.5170925", "text": "getInt64() {\n\n \t\tlet low, high;\n\n \t\tif ( this.littleEndian ) {\n\n \t\t\tlow = this.getUint32();\n \t\t\thigh = this.getUint32();\n\n \t\t} else {\n\n \t\t\thigh = this.getUint32();\n \t\t\tlow = this.getUint32();\n\n \t\t}\n\n \t\t// calculate negative value\n \t\tif ( high & 0x80000000 ) {\n\n \t\t\thigh = ~ high & 0xFFFFFFFF;\n \t\t\tlow = ~ low & 0xFFFFFFFF;\n\n \t\t\tif ( low === 0xFFFFFFFF ) high = ( high + 1 ) & 0xFFFFFFFF;\n\n \t\t\tlow = ( low + 1 ) & 0xFFFFFFFF;\n\n \t\t\treturn - ( high * 0x100000000 + low );\n\n \t\t}\n\n \t\treturn high * 0x100000000 + low;\n\n \t}", "title": "" }, { "docid": "b2acf6e2883a37cd1c1f0099b296dc0d", "score": "0.51686704", "text": "function minorD(lat1, lat2, lon1, lon2) {\n\t\tlat1 = toRad(lat1);\n\t\tlat2 = toRad(lat2);\n\t\t//El radio del planeta -> :o\n\t\tvar R = 6371e3; // expresado en m\n\t\t//Delta latitud\n\t\tvar dLat = toRad((lat2-lat1));\n\t\t//Delta lingutyd\n\t\tvar dLon = toRad((lon2-lon1));\n\t\tvar a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n\t\t Math.cos(lat1) * Math.cos(lat2) *\n\t\t Math.sin(dLon/2) * Math.sin(dLon/2);\n\t\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\t\treturn R * c;\n\t\t//Se devuelve distancia en metros\n\t}", "title": "" }, { "docid": "d45385eb54eff785a02ed0f78ce39a5d", "score": "0.5165572", "text": "getLongId() {\n return this.form_.id_ + '-' + this.id_;\n }", "title": "" }, { "docid": "82171507bc6ba4f6716eee2eed41ad9e", "score": "0.5146787", "text": "function muestraDatosVacunaMadrid(dosis) {\n //poblacion total de la comunidad de madrid para calcular los porcentajes\n let poblacionMadrid = 6779888;\n //se formatea el numero para la cifra salga con punto\n let numeroFormateado = new Intl.NumberFormat().format(dosis[13].dosisEntregadas);\n //se calcula el porcentaje de dosis entregadas sobre la poblacion de madrid\n let porcentajeEntregadas = trunc((dosis[13].dosisEntregadas * 100) / poblacionMadrid, 3);\n //se formatea el numero para la cifra salga con punto\n let dosisAdministradas = new Intl.NumberFormat().format(dosis[13].dosisAdministradas);\n //se calcula el porcentaje de dosis administradas sobre la poblacion de madrid\n let porcentPoblacionMadridAdministradas = trunc((dosis[13].dosisAdministradas * 100) / poblacionMadrid, 3);\n //se calcula el porcentaje de adimistradas sobre las entregadas\n let porcentajeAdministradasSobreTotal = (dosis[13].dosisAdministradas * 100) / dosis[13].dosisEntregadas;\n porcentajeAdministradasSobreTotal = trunc(porcentajeAdministradasSobreTotal, 2);\n\n //se formatea el numero para la cifra salga con punto\n let dosDosis = new Intl.NumberFormat().format(dosis[13].dosisPautaCompletada);\n //porcentaje de dos dosis administradas sobre el total administradas (solo una dosis)\n let porcentajePautaCompletadas = trunc(((dosis[13].dosisPautaCompletada * 100) / dosis[13].dosisAdministradas), 2);\n //porcentaje de gente con la pauta completada sobre la poblacion de madrid\n let porcentajeCompletTotal = trunc(((dosis[13].dosisPautaCompletada * 100) / poblacionMadrid), 2);\n\n //se recogen los elementos html donde se van a mostrar los datos\n let dosisDistribuidas = document.getElementById(\"dosisDistribuidas\");\n let porcentajeDosisEntregadas = document.getElementById(\"porcentajeDosisEntregadas\");\n let dosisAdministradasTotal = document.getElementById(\"dosisAdministradas\");\n let porcentajeMadridAdministradas = document.getElementById(\"porcentajePoblacionAdministradas\");\n let porcentajeAdministradasTotal = document.getElementById(\"porcentajeAdministradasTotal\");\n let pautaCompleta = document.getElementById(\"pautaCompleta\");\n let porcentajeCompletas = document.getElementById(\"porcentajeCompletas\");\n let porcenSobreTotalCompletas = document.getElementById(\"porcenSobreTotalCompletas\");\n\n //se muestran los datos\n dosisDistribuidas.innerHTML = numeroFormateado;\n porcentajeDosisEntregadas.innerHTML = porcentajeEntregadas\n dosisAdministradasTotal.innerHTML = dosisAdministradas;\n porcentajeMadridAdministradas.innerHTML = porcentPoblacionMadridAdministradas;\n porcentajeAdministradasTotal.innerHTML = porcentajeAdministradasSobreTotal;\n pautaCompleta.innerHTML = dosDosis\n porcentajeCompletas.innerHTML = porcentajePautaCompletadas;\n porcenSobreTotalCompletas.innerHTML = porcentajeCompletTotal;\n\n}", "title": "" }, { "docid": "01a9ef1f81cb633912c485e1a82ee290", "score": "0.5137759", "text": "function calcularComponenteMayor(vComponentes){\r\n\tvar mayor = vComponentes[0];\r\n\tfor (var i in vComponentes){\r\n\t\tif(i!='unique'){\t\t\t\r\n\t\t\tif(parseFloat(vComponentes[i].VALOR) > parseFloat(mayor.VALOR)){\r\n\t\t\t\tmayor = vComponentes[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn mayor;\r\n}", "title": "" }, { "docid": "a302a8a5cba594d48a2b8049d5b04090", "score": "0.5132048", "text": "static formatLong(d) {\n let rv = ''\n let keys = Object.keys(d.data);\n let title = d.title.length>0?d.title+'<br>':'';\n let cDiv = Hive.popup.getColorDiv(d.attr);\n keys.forEach((item, i) => {\n rv += cDiv + `${item}: ${d.data[item]}${i==keys.length-1?'':'<br>'}`\n });\n return title + rv;\n }", "title": "" }, { "docid": "6d9977eb92d1ba8eba27a0dcdfabd9c7", "score": "0.51272696", "text": "function getLongitude() {\n\tvar lon = parseFloat(getValue('lon_degree')) + parseFloat(getValue('lon_minute') / 60) + parseFloat(getValue('lon_second') / 3600);\n\tif ( getValue('lon_ew') == \"W\" ) {\n\t\treturn -lon;\n\t}\n\treturn lon;\n}", "title": "" }, { "docid": "bc09c3e6e20b351aad684effca22c3d7", "score": "0.51193124", "text": "function perimetroCuadrado (lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "bc09c3e6e20b351aad684effca22c3d7", "score": "0.51193124", "text": "function perimetroCuadrado (lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "e718ed11ef6f413fae29d79784055dfe", "score": "0.50979793", "text": "posicionEnLimites() {\n //los limites son respecto la fila\n let fila = document.getElementById(this.posicionActualHeroe).parentNode.id;\n let limiteIzdaX = fila * 10;//el 10 es el size, quiza deberia sacarlo a un attr del tablero...\n let limiteDchaX = limiteIzdaX + 11;\n let limiteYUp = -Math.abs(((fila * 10) - parseInt(this.posicionActualHeroe)));\n let limiteYDown = ((100 - (fila * 10)) + parseInt(this.posicionActualHeroe));\n return { izquierda: limiteIzdaX, derecha: limiteDchaX, arriba: limiteYUp, abajo: limiteYDown };\n }", "title": "" }, { "docid": "92180b3fa87a3894a31c7e91bb9d5499", "score": "0.5093353", "text": "function fixLongitude(lng) {\n // return lng - (lng * 2);\n return '-' + lng;\n}", "title": "" }, { "docid": "46d3c6fcb89e326216fccc68bc0d17ca", "score": "0.50857157", "text": "function long2tile(lon,zoom) { return (Math.floor((lon+180)/360*Math.pow(2,zoom))); }", "title": "" }, { "docid": "0fae59c7646853e278653d354b9cc47d", "score": "0.50811857", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "0fae59c7646853e278653d354b9cc47d", "score": "0.50811857", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "0fae59c7646853e278653d354b9cc47d", "score": "0.50811857", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "99b59861cbf3a6f82095d78d6398f52a", "score": "0.50769585", "text": "function perimetroCuadrado(lado){ // usaremos la funcion para poder hacer más interactiva las unidades de las figuras, \n return lado * 4; //con el parametro lado determinaremos un valor\n}", "title": "" }, { "docid": "f469d4c1f18966a147eaea5dd4f3090f", "score": "0.5061175", "text": "function jsfGetLongDate(dd,mm,yy){\n\tdd=dd.toString()\n\tmm=mm.toString()\n\tyy=yy.toString()\n\treturn parseInt(yy+mm+dd)\n}", "title": "" }, { "docid": "bcd07ec67fe706e2ea1e325a85fbe434", "score": "0.5058275", "text": "function calculNbPanneaux(e) {\n\t\tvar LongueurCloture = parseFloat(form.longueur.value.replace(',', '.'));\n\t\tif(isNaN(LongueurCloture))\n\t\t\tLongueurCloture = 0\n\t\tvar nbPanneaux = Math.ceil(LongueurCloture / ((form.gamme.value == 'Eco')?2:2.5));\n\n\t\tlet nbPanneauxElt = document.getElementById(\"output_NbDePanneaux\")\n\t\tlet nbPoteauxElt = document.getElementById(\"output_NbDePoteaux\")\n\t\t//Check de la longueur Max\n\t\tif(LongueurCloture < 10000) {\n\t\t\tnbPanneauxElt.innerHTML = nbPanneaux;\n\t\t\tnbPoteauxElt.innerHTML = nbPanneaux + 1;\n\t\t} else {\n\t\t\talert('Veuillez saisir une longueur inférieure à 10000m')\n\t\t\tnbPanneauxElt.innerHTML = '0'\n\t\t\tnbPoteauxElt.innerHTML = '0'\n\t\t}\n\t}", "title": "" }, { "docid": "81fb2daea42bf8a7b017546a07e2a743", "score": "0.5044332", "text": "getUint64() {\n\n \t\tlet low, high;\n\n \t\tif ( this.littleEndian ) {\n\n \t\t\tlow = this.getUint32();\n \t\t\thigh = this.getUint32();\n\n \t\t} else {\n\n \t\t\thigh = this.getUint32();\n \t\t\tlow = this.getUint32();\n\n \t\t}\n\n \t\treturn high * 0x100000000 + low;\n\n \t}", "title": "" }, { "docid": "bd2813b3dc232237d847d4ab111ef6ea", "score": "0.50430137", "text": "function form_sync_length(myField)\n{\n\tvar temp = new Array();\n\ttemp = myField.name.split('_');\n\tvar name = temp[0];\n\tvar unit = temp[1];\n\tswitch(unit) {\n\t\tcase 'm':\n\t\t\tvar total_inches = Math.round(forceFloat(myField.value) * 39.37008);\n\t\t\tvar feet = Math.floor(total_inches / 12);\n\t\t\tvar inches = total_inches - (feet * 12);\n\t\t\tmyField.form[name + '_' + 'ft'].value = feet;\n\t\t\tmyField.form[name + '_' + 'in'].value = inches;\n\t\t\tbreak;\n\t\tcase 'ft':\n\t\t\tvar inches = forceFloat(myField.form[name + '_' + 'in'].value);\n\t\t\tvar total_inches = (forceFloat(myField.value) * 12) + inches;\n\t\t\tvar metres = total_inches * 0.0254;\n\t\t\tmyField.form[name + '_' + 'm'].value = Math.round(metres*100)/100;\n\t\t\tbreak;\n\t\tcase 'in':\n\t\t\tvar feet = forceFloat(myField.form[name + '_' + 'ft'].value);\n\t\t\tvar total_inches = forceFloat(myField.value) + (feet*12);\n\t\t\tvar metres = total_inches * 0.0254;\n\t\t\tmyField.form[name + '_' + 'm'].value = Math.round(metres*100)/100;\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "d3fd0f0afce7a2bca52c21d47c3d01bc", "score": "0.5038504", "text": "function perimetroCuadrado(lado) {\r\n return lado * 4;\r\n}", "title": "" }, { "docid": "c8bd1405c8085e60b464277e6538609f", "score": "0.50360537", "text": "function puntoLimiteVelocidad(lat, lng){ \n var posicion = null;\n posicion = evaluarPosicionParada(lat, lng);\n infowindow3.close();\n //funcion que ordena los puntos en la linea recibe latitud y longitud\n buscarDireccionPunto(\"puntoLimiteVelocidad\", posicion[1], posicion[2]);\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.50353867", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "53c0bb2ac05f9cd82ee54433258c2359", "score": "0.50353867", "text": "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "title": "" }, { "docid": "767de5fb36636abedbe9c92ae4396704", "score": "0.50050515", "text": "static decodeNumberFromLong(buffer, offset) {\n const low = buffer.readInt32LE(offset);\n const high = buffer.readInt32LE(offset + BitsUtil_1.BitsUtil.INT_SIZE_IN_BYTES);\n return high * TWO_PWR_32_DBL + (low >>> 0);\n }", "title": "" }, { "docid": "5bc91aff7722a5644bb436ecb2e2a8fc", "score": "0.49925604", "text": "function contar1() { \n var max = \"1000\"; \n var cadena = document.getElementById(\"resumenPro\").value; \n var longitud = cadena.length; \n\n if(longitud <= max) { \n document.getElementById(\"contadorUno\").value = max-longitud; \n } else { \n document.getElementById(\"resumenPro\").value = cadena.substr(0, max);\n } \n}", "title": "" }, { "docid": "9b9c18758fc0d977fdba2d2c977bf70b", "score": "0.49881232", "text": "function perimetrocuadrado(lado){\n return lado * 4;\n}", "title": "" }, { "docid": "c99322669ac9302ae21310a61ed8f3e6", "score": "0.49776068", "text": "function perimetroCuadrado (lado) {\n return lado*4;\n}", "title": "" }, { "docid": "73d6013f8d9aed3c111a81dfb14140dc", "score": "0.49764425", "text": "function perimetroCuadrado (lado){\n return lado * 4;\n}", "title": "" }, { "docid": "018b2d072e10a9d80b1a195df7b18dd8", "score": "0.49654445", "text": "getLongitude(i){\n return parseFloat(this.state.allPairs[i]['start longitude'])\n }", "title": "" }, { "docid": "f0356ad4abd55bb817847e3438ae4d08", "score": "0.495755", "text": "function short2long(hex) {\n\tif(hex.length == 4) {\n\t\tvar r = hex.substr(1, 1);\n\t\tvar g = hex.substr(2, 1);\n\t\tvar b = hex.substr(3, 1);\n\t\treturn('#'+r+r+g+g+b+b);\n\t}\n\treturn(hex);\n}", "title": "" }, { "docid": "08580e91cba376cb1cf1f863d7e126cc", "score": "0.49521327", "text": "function perimetroCuadrado(lado){\n return lado * 4\n}", "title": "" }, { "docid": "ebb6c6bf5c42328210f3c8548ce13c85", "score": "0.49499962", "text": "function campeonLiga(){\r\nvar cont=0, pos_arr=0;\r\n\r\n\tfor(var i=1;i<this.equiposLiga.length;i++){\r\n\tcont=i;\r\n\t\tif(this.equiposLiga[i].posicionLiga>this.equiposLiga[cont--].posicionLiga){\r\n\t\t\t\r\n\t\t\tpos_arr=cont;\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\r\n\t\t\tpos_arr=i;\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}\r\n\t\r\n\t\treturn this.equiposLiga[pos_arr];\r\n\r\n}", "title": "" }, { "docid": "46303b3608e4eb98c27971f3f9e77157", "score": "0.49456334", "text": "function minorD(lat1, lat2, lon1, lon2) {\n\t\tlat1 = toRad(lat1);\n\t\tlat2 = toRad(lat2);\n\t\t//El radio del planeta -> :o\n\t\tvar R = 6371; // expresado en km\n\t\t//Delta latitud\n\t\tvar dLat = toRad((lat2-lat1));\n\t\t//Delta lingutyd\n\t\tvar dLon = toRad((lon2-lon1));\n\t\tvar a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n\t\t Math.cos(lat1) * Math.cos(lat2) *\n\t\t Math.sin(dLon/2) * Math.sin(dLon/2);\n\t\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\t\treturn R * c;\n\t}", "title": "" }, { "docid": "ac976a596e3e53a34d88d40f60bd71cf", "score": "0.49359536", "text": "function long2tile(lon,zoom) {\n return (Math.floor((lon+180)/360*Math.pow(2,zoom)));\n}", "title": "" }, { "docid": "2671cc9ea171b57ab3e44eb2c0d30578", "score": "0.4918962", "text": "function actualizaExtent() {\n //COJO LOS DATOS DE LA VISTA ACTUAL EN FROMA ARRAY DE [X,Y,X,Y]\n //DE LAS ESQUINAS INF IZQ Y SUP DCHA\n //ADEMAS PONGO QUE SEA CON 2 DECIMALES Y LO LLEVO AL HTML\n var extent = mapa.getView().calculateExtent(mapa.getSize());\n document.getElementById(\"infizq\").innerHTML = extent[0].toFixed(2) + \",\" + extent[1].toFixed(2)\n document.getElementById(\"supdcha\").innerHTML = extent[2].toFixed(2) + \",\" + extent[3].toFixed(2)\n}", "title": "" }, { "docid": "4ec8d7c0f36890e7985a9b46145c1e8e", "score": "0.4913479", "text": "get lng() { return degrees(this.phi); }", "title": "" }, { "docid": "e4863c5ac2a72306b9275a4cf194e034", "score": "0.49116665", "text": "function operacion(monto,id){\r\n\tvar id= id.split(\"|\");\r\n\tvar partida = id[0];\r\n\tvar generica= id[1]; \r\n\t\r\n\tvar monto_detalle = new Number(setNumero(monto)); //alert(monto_detalle);\r\n\tvar monto_generica = new Number(setNumero(document.getElementById(generica).value));//alert('MontoGenerica=' + monto_generica);\r\n var monto_partida = new Number(setNumero(document.getElementById(partida).value));//alert('MontoPartida=' + monto_partida);\r\n\tvar monto_ajuste = new Number(setNumero(document.getElementById(\"montoAjustado\").value)); //alert('Monto Ajuste=' + monto_ajuste);\r\n\t\r\n}", "title": "" }, { "docid": "f8a2d503500c75879b0cfd51747ee736", "score": "0.49104977", "text": "function perimetroCuadrado(lado){\n return lado * 4;\n}", "title": "" }, { "docid": "f8a2d503500c75879b0cfd51747ee736", "score": "0.49104977", "text": "function perimetroCuadrado(lado){\n return lado * 4;\n}", "title": "" }, { "docid": "f8a2d503500c75879b0cfd51747ee736", "score": "0.49104977", "text": "function perimetroCuadrado(lado){\n return lado * 4;\n}", "title": "" }, { "docid": "f8a2d503500c75879b0cfd51747ee736", "score": "0.49104977", "text": "function perimetroCuadrado(lado){\n return lado * 4;\n}", "title": "" }, { "docid": "a8f18f5e308c5ce921f874b896fc795c", "score": "0.49075246", "text": "function calcMaxAndMinCord(c){\n if(latStart > limiteMax[0])\n limiteMax[0] = c[\"Lat\"];\n if(logStart > limiteMax[1])\n limiteMax[1] = c[\"Log\"];\n if(latStart < limiteMin[0])\n limiteMin[0] = c[\"Lat\"];\n if(logStart < limiteMin[1])\n limiteMin[1] = c[\"Log\"];\n\n}", "title": "" }, { "docid": "f68a7d3d05c99a620c4bf830f4d04b0c", "score": "0.48920926", "text": "function calcularComponenteMenor(vComponentes){\r\n\tvar menor = vComponentes[0];\r\n\tfor (var i in vComponentes){\r\n\t\tif(i!='unique'){\t\t\t\r\n\t\t\tif(parseFloat(vComponentes[i].VALOR) < parseFloat(menor.VALOR)){\r\n\t\t\t\tmenor = vComponentes[i];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn menor;\r\n}", "title": "" }, { "docid": "dbcdfe57ecbac9179cda1deb52c2a200", "score": "0.48882928", "text": "function areaCuadrado(lado) {\r\n return lado * lado;\r\n}", "title": "" }, { "docid": "78414f27e32a7bb94088a9dfee48bd97", "score": "0.48868206", "text": "function areaCuadrado (lado) {\n return lado * lado;\n}", "title": "" }, { "docid": "7bd476a55154ebec360ea50b755a897e", "score": "0.48849794", "text": "function unpack_glon(rows, key) {\n return rows.map(function(row) {\n let current_lon = parseFloat(row[key]);\n if (current_lon > 180.0) {\n current_lon -= 360.0;\n }\n return current_lon;\n });\n }", "title": "" }, { "docid": "267bc21007a722ab5ca144aeef8b125b", "score": "0.488094", "text": "newLong(value) {\r\n this.key.set$long(value);\r\n let result = this.get(this.key);\r\n if (result == null) {\r\n this.pool.putByte(ClassWriter.LONG).putLong(value);\r\n result = new Item(this.index, this.key);\r\n this.index += 2;\r\n this.put(result);\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "3ab0345355e288962206fe7ef06c6bc2", "score": "0.4872456", "text": "function perimetroCuadrado (ladoC) {\n return ladoC * 4 ;\n}", "title": "" }, { "docid": "5e9aba135c0e8bbacca56a37eac11f2d", "score": "0.48634058", "text": "function shortToLong(val1, val2) {\n let l1 = val1.length\n let l2 = val2.length\n if (l1 === l2) {\n return 0\n } else if (l1 > l2){\n return +1\n } else if (l1 < l2){\n return -1\n }\n}", "title": "" }, { "docid": "fb9ab15979097ae24a5d41300b0b5ca3", "score": "0.48531723", "text": "function make_duration(ms, type){\n if (type === 'sort') {\n return parseInt(ms);\n }\n if($('#nf-table-humanreadable').val() == 'false'){\n return ms;\n }\n if (ms == '-' || ms == 0){\n return ms;\n }\n return humanize(moment.duration( parseInt(ms) ));\n }", "title": "" }, { "docid": "883eb0a3780e6ba0a126a20c2d74d856", "score": "0.48367226", "text": "function areaCuadrado(lado) {\n return lado * lado;\n}", "title": "" }, { "docid": "106275d876b8aeab64a5226827ec80da", "score": "0.4836567", "text": "get ultimos13(){\n return this.asginados.slice(0,13);\n }", "title": "" }, { "docid": "9e1e01f670f47c91cdd324b25d121ce9", "score": "0.482951", "text": "coordenadasEnLimites(puntos, limites) {\n let coords = [];\n //mejor for in? \n for (let [posicion, valorPosicion] of Object.entries(puntos)) {\n //no es mejor usar hasownpropiertys? \n if (posicion == \"izquierda\" && (valorPosicion > limites.izquierda)) {\n coords.push(valorPosicion);\n } else if (posicion == \"derecha\" && valorPosicion < limites.derecha) {\n coords.push(valorPosicion);\n } else if (posicion == \"arriba\" && valorPosicion > limites.arriba && valorPosicion>0) {\n coords.push(valorPosicion);\n } else if (posicion == \"abajo\" && valorPosicion < limites.abajo) {\n coords.push(valorPosicion);\n }\n }\n return coords;\n }", "title": "" }, { "docid": "00f753d260fc3229d00c534816121eb5", "score": "0.48229575", "text": "function restar_caracteres(campo,campo2)\n{\n var value = $(campo).val().length;\n value = 400 - value;\n $(campo2).html(value);\n}", "title": "" }, { "docid": "e1551996ce30cb31a4c05ea1943f5cd5", "score": "0.48131067", "text": "function areatriangulo(lado3,altura){\n\n return (lado3*altura)/2;\n}", "title": "" }, { "docid": "605837b5a45832ab0d4abed3d86c2efa", "score": "0.47920078", "text": "toLongTimeString( ) : string {\n\t\treturn this.toLocaleTimeString({});\n\t}", "title": "" }, { "docid": "2f053d881ed55d008f78853d43cb91f7", "score": "0.4786917", "text": "cmConverter(length) {\n let result = Math.ceil((length) / (2.54))\n return result\n }", "title": "" }, { "docid": "c41f3309b812e1c5fc4f413e2de2d9ec", "score": "0.4783753", "text": "function tagIdToLatLong(tag){\n if(tag==\"110177\") return \"-19.66882,146.864\"; //Spring Creek\n else if(tag==\"110171\") return \"-19.66574,146.8462\"; //Double Barrel\n else if(tag==\"110163\") return \"-19.66872,146.8642\"; //Junction//-19.66872,146.8642\n }", "title": "" }, { "docid": "58c5c171bc4b341efec666391db89414", "score": "0.47826114", "text": "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }", "title": "" }, { "docid": "11b794a0a03d51f2e7a7b17ddcd799dc", "score": "0.4782455", "text": "function calcularModa(arreglo) {\n let listaObj = {};\n\n arreglo.map(function (elemento) {\n if (listaObj[elemento]) {\n listaObj[elemento] += 1;\n } else {\n listaObj[elemento] = 1;\n }\n });\n\n let arrayObj = Object.entries(listaObj);\n\n arrayObj.sort((a, b) => a[1] - b[1]);\n\n return (\n \"El numero de la lista que mas se repite es: \" +\n arrayObj[arrayObj.length - 1][0] +\n \" y se repite \" +\n arrayObj[arrayObj.length - 1][1] +\n \" veces\"\n );\n}", "title": "" }, { "docid": "3ce76b251d456a614aab9eb2aeedb284", "score": "0.47798648", "text": "function get_time(long) {var date=new Date().addHours(1);var hour=date.getHours();hour=(hour<10?\"0\":\"\")+hour;var min=date.getMinutes();min=(min<10?\"0\":\"\")+min;return hour+((long)?\":\":\"\")+min;}", "title": "" }, { "docid": "d3e0fe3b601e3c48f31912cb16b0bbf4", "score": "0.4778999", "text": "longToUint64(longValue) {\n return new UInt64([longValue.getLowBitsUnsigned(), longValue.getHighBitsUnsigned()]);\n }", "title": "" }, { "docid": "a576389dccddec48ee94086d1fd20a26", "score": "0.47758192", "text": "function getLatLong() {\n $scope.shows.forEach(show => {\n if (show.lat) {\n $scope.latLongArr.push(show);\n }\n else $scope.noLatLongArr.push(show);\n });\n }", "title": "" }, { "docid": "5d004541edf76243e5e9fe896eee8de1", "score": "0.47691816", "text": "function validarLongitud(campo) {\n\n if(campo.value.length > 0 ) {\n campo.style.border = '';\n campo.classList.remove('error');\n } else {\n campo.style.border = '1px solid red';\n campo.classList.add('error');\n }\n}", "title": "" }, { "docid": "8cf87ed3c928b6b33aac9fc6444a51a3", "score": "0.4767574", "text": "set$long(longVal) {\r\n this.type = ClassWriter.LONG;\r\n this.longVal = longVal;\r\n this.__hashCode = 2147483647 & (this.type + (longVal.getLowBits()));\r\n }", "title": "" }, { "docid": "62907ac9d9d6057d66407465879c3a7b", "score": "0.476681", "text": "function muestra()\n {\n document.getElementById ('limite')\n .addEventListener(\"keyup\", function(){maximo(this, 10)}); // funcion fantasma que llama a la funcion buena pero dando la longitud a buscar\n }", "title": "" }, { "docid": "fb96cf7f12a7ca52b6d7b8b95889381d", "score": "0.4765622", "text": "calcularValorDeLlamadaAPartirDeDatos(cantidadDeMinutosPorCobrarDeLaLlamada, valorDeLaLlamadaYaCobrado, horaDeInicio, minutoDeInicio,\n funcionCobradora,unaLlamada){\n //horaDeInicioa :: entero\n //minutoDeInicio :: entero\n //cantidadDeMinutosPorCobrarDeLaLlamada :: entero\n //valorDeLaLlamadaYaCobrado :: entero\n //unaLlamada :: llamada\n //funcionCobradora :: arrow function\n \n let horaDesdeLaQueSeCobra = horaDeInicio;\n let minutoDesdeElQueSeCobra = minutoDeInicio;\n let cantidadMinutosPorCobrar = cantidadDeMinutosPorCobrarDeLaLlamada;\n let valorFinalDellamada = valorDeLaLlamadaYaCobrado;\n \n while(cantidadMinutosPorCobrar > 0){\n valorFinalDellamada = funcionCobradora(valorFinalDellamada, horaDesdeLaQueSeCobra)\n \n cantidadMinutosPorCobrar--;\n minutoDesdeElQueSeCobra++;\n if(minutoDesdeElQueSeCobra > 59){\n minutoDesdeElQueSeCobra = 0;\n horaDesdeLaQueSeCobra++; if(horaDesdeLaQueSeCobra > 23){\n let siguienteDia = unaLlamada.diaEnQueSeRealizoLaLlamada.getDiaSiguiente()\n valorFinalDellamada = siguienteDia.indicarComoCalcularValorDeLlamada(unaLlamada, cantidadMinutosPorCobrar, valorFinalDellamada, 0, 0)\n break;\n }\n }\n }\n\n return Number(valorFinalDellamada.toFixed(2))\n }", "title": "" }, { "docid": "5c1d67ff90ea107fd203afdc6165880f", "score": "0.47642374", "text": "function getLength(d) {\n var i = 0;\n \n if(d.regione == \"EMILIA-ROMAGNA\")\n {\n i = d.regione.length * 6.5; \n }\n else if(d.regione == \"FRIULI-VENEZIA GIULIA\")\n {\n i = d.regione.length * 5.7; \n }\n else if(d.regione == \"SICILIA\")\n {\n i = d.regione.length * 5.6; \n }\n else if(d.regione == \"VALLE D'AOSTA\")\n {\n i = d.regione.length * 6.4; \n }\n else if(d.regione == \"MARCHE\")\n {\n i = d.regione.length * 7.4; \n }\n else if(d.regione == \"BASILICATA\")\n {\n i = d.regione.length * 6.2; \n }\n else if(d.regione == \"TRENTINO-ALTO ADIGE\")\n {\n i = d.regione.length * 6.2; \n }\n else if(d.regione == \"SARDEGNA\")\n {\n i = d.regione.length * 7.3; \n }\n else if(d.regione == \"VENETO\")\n {\n i = d.regione.length * 7.2;\n }\n else if(d.regione == \"TOSCANA\")\n {\n i = d.regione.length * 7.4; \n }\n else if(d.regione.length < 5){\n i = d.regione.length * 7;\n }\n else if(d.regione.length < 14){\n i = d.regione.length * 7;\n }\n else{\n i = d.regione.length * 6;\n }\n \n return x(d.totale) + i;\n }", "title": "" }, { "docid": "6c03ca37abadb14bee0fd9198fdd9ec5", "score": "0.47611207", "text": "function esMayor(a) {\n\n \n var numeroMayor = Math.max(...a)\n return numeroMayor\n\n}", "title": "" }, { "docid": "894a45ec8cf6d65533e2ee3b16066bd9", "score": "0.4760139", "text": "function get_time(long) {var date=new Date().addHours(2);var hour=date.getHours();hour=(hour<10?\"0\":\"\")+hour;var min=date.getMinutes();min=(min<10?\"0\":\"\")+min;return hour+((long)?\":\":\"\")+min;}", "title": "" }, { "docid": "cad0afc3e9095dde235b0a4bbdd4c684", "score": "0.4754605", "text": "function long2tile(lng, z) {\r\n return (Math.floor((lng + 180.0) / 360.0 * Math.pow(2.0, z)));\r\n}", "title": "" }, { "docid": "bb449f1ababacdab56e036f27d612564", "score": "0.47423986", "text": "getLetrasDePlaca() {\n return this.placa.substr(0, 3);\n }", "title": "" }, { "docid": "c68228e226a40393a91e0b78724e8b45", "score": "0.47396776", "text": "remainingDays(job) {\n\n //cálculo da quantidade de dias para realizar o projeto\n const remainingDays = (job[\"total-hours\"] / job[\"daily-hours\"]).toFixed(); //toFixed para arredondar\n\n //data do dia que o projeto foi cadastrado\n const createdDate = new Date(job.created_at);\n\n //dia do mes da data de entrega em milissegundos// getDate pega o dia\n const dueDay = createdDate.getDate() + Number(remainingDays);\n\n //criando a data de entrega do projeto\n const dueDate = createdDate.setDate(dueDay);\n\n //diferença em milissegundos da data final para a data atual , dias restantes\n const timeDiff = dueDate - Date.now();\n\n //tranformar um dia em milissegundos\n const dayInMs = 1000 * 60 * 60 * 24;\n\n //dias que faltam para a entrega //Math.floor retorna um Number arredondado para baixo\n const dayDiff = Math.ceil(timeDiff / dayInMs);\n\n return dayDiff\n }", "title": "" }, { "docid": "0fbeb473808673691547aab1e1c2549e", "score": "0.4739573", "text": "function converterParaMilhas(valor) {\r\n var v = $('#velocidade').text();\r\n v = v / valor;\r\n $('#velocidade').text(v);\r\n $('#uV').text('Mph');\r\n\r\n var d = $('#distancia').text();\r\n d = d / valor;\r\n $('#distancia').text(d);\r\n $('#uD').text('Milhas');\r\n\r\n var h = $('#hMax').text();\r\n h = h / 3.28;\r\n $('#hMax').text(h);\r\n $('#uH').text('Pés');\r\n}", "title": "" }, { "docid": "55f991c9716dd69b9fa2e32c9362efcd", "score": "0.47356418", "text": "function sicc_valida_numero_LE(strName, strMostrar, valorMinimo, valorMaximo, tipo, listName, posCol) {\n\tvar formulario_local = getFormularioSICC();\n\tvar datos = eval(listName + \".datos;\");\n\n\tfor (var contador = 0; contador < datos.length; contador++ ) {\n\t\t\t\t\tvar valorTest = datos[contador][posCol];\n\n\t\t\t\t\tif (valorTest != \"\") {\n\t\t\t\t\t\t\t\tvar strSepDec = \"\";\n\t\t\t\t\t\t\t\tvar strSepMil = \"\";\n\t\t\t\t\t\t\t\tvar strCantDec = \"\";\n\n\t\t\t\t\t\t\t\tswitch(tipo){\n\t\t\t\t\t\t\t\t\tcase \"Numerico\":\n\t\t\t\t\t\t\t\t\t\tstrCantDec=\"2\";\n\t\t\t\t\t\t\t\t\t\tstrSepDec = get(formulario_local+\".hSeparadorDecimalPais\");\n\t\t\t\t\t\t\t\t\t\tstrSepMil = get(formulario_local+\".hSeparadorMilesPais\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase \"Entero\":\n\t\t\t\t\t\t\t\t\t\tstrCantDec=\"0\";\n\t\t\t\t\t\t\t\t\t\tstrSepDec = get(formulario_local+\".hSeparadorDecimalPais\");\n\t\t\t\t\t\t\t\t\t\tstrSepMil = get(formulario_local+\".hSeparadorMilesPais\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase \"Moneda\":\n\t\t\t\t\t\t\t\t\t\tstrCantDec = get(formulario_local+\".hCantidadDecimalesPais\");\n\t\t\t\t\t\t\t\t\t\tstrSepDec = get(formulario_local+\".hSeparadorDecimalPais\");\n\t\t\t\t\t\t\t\t\t\tstrSepMil = get(formulario_local+\".hSeparadorMilesPais\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase \"MonedaAlternativa\":\n\t\t\t\t\t\t\t\t\t\tstrCantDec = get(formulario_local+\".hCantidadDecimalesAlternativos\");\n\t\t\t\t\t\t\t\t\t\tstrSepDec = get(formulario_local+\".hSeparadorDecimalAlternativo\");\n\t\t\t\t\t\t\t\t\t\tstrSepMil = get(formulario_local+\".hSeparadorMilesAlternativo\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t//aca normalizo la cantidad de decimales, ya que nada me asegura\n\t\t\t\t\t\t\t\t//que el formato admita decimales, aunque seria lo logico.\n\t\t\t\t\t\t\t\t//Si la cantidad de decimales no es un numero valido, entonces es cero.\n\t\t\t\t\t\t\t\tif(isNaN(parseInt(strCantDec,10))){\n\t\t\t\t\t\t\t\t\tstrCantDec = 0;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tstrCantDec=parseInt(strCantDec,10);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//Primero me fijo si es un numero, para eso\n\t\t\t\t\t\t\t\t//le saco todos los separadores\n\t\t\t\t\t\t\t\tvar strCleaned = valorTest.split(strSepDec).join(\"\");\n\t\t\t\t\t\t\t\tstrCleaned = strCleaned.split(strSepMil).join(\"\")+\"\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!parseInt(strCleaned.substr(0,1),10) && parseInt(strCleaned.substr(0,1),10)!=0){//si el primero no es un numero, puede ser solo el simbolo negativo\n\t\t\t\t\t\t\t\t\tif(strCleaned.substr(0,1)!=\"-\"){\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000100\" , strMostrar));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}else{//tambien lo saco para testear el numero\n\t\t\t\t\t\t\t\t\t\tstrCleaned = strCleaned.substr(1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar RegInteger = /^\\d+$/; //Solo numeros\n\t\t\t\t\t\t\t\tif(!RegInteger.test(strCleaned)){\n\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\tcdos_mostrarAlert( GestionarMensaje(\"000000000000100\" , strMostrar) );\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Ahora se que es un numero, primero valido los decimales\n\t\t\t\t\t\t\t\t//el ultimo debe ser un numero\n\t\t\t\t\t\t\t\tif(isNaN(parseInt(valorTest.substr(valorTest.length-1),10))){\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000100\" , strMostrar));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//me fijo el largo de los decimales\n\t\t\t\t\t\t\t\tvar arrTest = valorTest.split(strSepDec);\n\t\t\t\t\t\t\t\tif(arrTest.length ==2 && arrTest[1]!=null && arrTest[1]!=\"\"){//si tiene decimales\n\t\t\t\t\t\t\t\t\tif(parseInt(strCantDec,10)==0){\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000104\"));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar strDecimales = arrTest[arrTest.length-1]+\"\";\n\t\t\t\t\t\t\t\t\tif(strDecimales.length > parseInt(strCantDec,10)){//me fijo cuantos son\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000101\" , strMostrar,parseInt(strCantDec,10)));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(arrTest.length > 2){//sino\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000102\" , strMostrar));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//ahora voy por la parte entera\n\n\t\t\t\t\t\t\t\tvar strInteger = arrTest[0]+\"\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(strInteger.indexOf(strSepMil) >- 1){//si tiene separadores de miles\n\t\t\t\t\t\t\t\t\tvar arrInteger = strInteger.split(strSepMil);\n\t\t\t\t\t\t\t\t\t//en todo el array los numero son de a 3 digitos\n\t\t\t\t\t\t\t\t\t//excepto en la primera posicion, \n\t\t\t\t\t\t\t\t\t//donde solo no pueden ser 4 digitos\n\t\t\t\t\t\t\t\t\tfor(var i=0; i < arrInteger.length; i++){\n\t\t\t\t\t\t\t\t\t\tif(i==0){\n\t\t\t\t\t\t\t\t\t\t\tif((arrInteger[i]+\"\").length>3){\n\t\t\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000100\" , strMostrar));\n\t\t\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tif((arrInteger[i]+\"\").length!=3){\n\t\t\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000105\",strSepMil));\n\t\t\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t//por ultimo valido el rango del valor\n\t\t\t\t\t\t\t\t//saco el separador de miles\n\t\t\t\t\t\t\t\tvar strNumeroTest = valorTest.split(strSepMil).join(\"\");\n\t\t\t\t\t\t\t\t//si el separador decimal es el punto, lo dejo, sino, lo reemplazo por el punto\n\t\t\t\t\t\t\t\tif(strSepDec!=\".\"){\n\t\t\t\t\t\t\t\t\tstrNumeroTest = strNumeroTest.split(strSepDec).join(\".\")\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(valorMinimo!=\"\"){\n\t\t\t\t\t\t\t\t\tif(parseFloat(strNumeroTest )<parseFloat(valorMinimo)){\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000103\" , strMostrar,parseFloat(valorMinimo),parseFloat(valorMaximo)));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\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\tif(valorMaximo!=\"\"){\n\t\t\t\t\t\t\t\t\tif(parseFloat(strNumeroTest)>parseFloat(valorMaximo)){\n\t\t\t\t\t\t\t\t\t\tcdos_mostrarAlert(GestionarMensaje(\"000000000000103\" , strMostrar,parseFloat(valorMinimo),parseFloat(valorMaximo)));\n\t\t\t\t\t\t\t\t\t\tsicc_focaliza_componente_LE(strName + \"_\" + contador, listName);\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "7fecf9ca7511fa9adca74f95fff7f0ad", "score": "0.47351053", "text": "function calculateTime(necesario){\r\n\t\tvar tiempo_max = 0;\r\n\t\tvar tiempo = 0;\r\n\r\n\t\tfor (i = 0; i < 4; i++){\r\n\t\t\tvar restante = necesario[i] - actual[i];\t\r\n\t\t\tif (restante > 0){\r\n\t\t\t\ttiempo = Math.round(restante / produccion[i]);\r\n\t\t\t\tif (tiempo > tiempo_max) tiempo_max = tiempo;\r\n\t\t\t\tif (tiempo < 0) tiempo_max = 'Infinity';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tiempo_max > 0 && tiempo_max != 'Infinity') tiempo_max = formatear_tiempo(tiempo_max + 5); // Se introduce un margen de 5 segundos para compensar posibles desviaciones en los temporizadores de javascript\r\n\t\treturn tiempo_max;\r\n\t}", "title": "" }, { "docid": "dee0175423a9fb6c877da5e77bec656e", "score": "0.4734598", "text": "function getPelnas(pajamos, nuostoliai) {\n\n return (pajamos - nuostoliai);\n\n}", "title": "" }, { "docid": "c10b0d017de96f23edda936642ddf0d3", "score": "0.47340924", "text": "function doFormatDateLong(pDate)\n\t\t{\n\t\t\treturn doFormatDate(pDate, 'LLLL');\n\t\t}", "title": "" } ]
49880479f7aff2c49d582560963d8632
Function allowing for the uploading of an image
[ { "docid": "658fb38386b0c454a71dbe95ba932337", "score": "0.0", "text": "function reqUpload(request, response) {\r\n\tconsole.log(\"Request handle 'upload' was called.\");\r\n\t\r\n\tvar form = new formidable.IncomingForm();\r\n\t\r\n\tform.uploadDir = './tmp';\r\n\t\r\n\tconsole.log(\"... about to parse ...\");\r\n\t\r\n\t//PArsing the files information\r\n\tform.parse(request, function(err, field, file) {\r\n\t\tconsole.log(\"Parsing done\");\r\n\t\tfs.rename(file.upload.path,\"./test.png\",function(err) {\r\n\t\t\tif (err) {\r\n\t\t\t\tfs.unlink(\"./test.png\");\r\n\t\t\t\tfs.rename(file.upload.path,\"./test.png\");\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t//Using FS to read html to be displayed to the client\r\n\tfs.readFile(\"./html/reqUpload.html\", function (err, body) {\r\n\t\tif (err) {\r\n\t\t\tresponse.writeHead(404, {'Content-Type':'text/html'});\r\n\t\t\tresponse.write(\"Content not found\");\r\n\t\t\tresponse.end();\r\n\t\t\tthrow err;\r\n\t\t}\r\n\t\t\r\n\t\tresponse.writeHead(200,{'Content-Type':'text/html'});\r\n\t\tresponse.write(body);\r\n\t\tresponse.end();\r\n\t});\r\n}", "title": "" } ]
[ { "docid": "63fcb1b841037cad6a4169d99bee0488", "score": "0.746295", "text": "upload() {\n var params = $('#submitForm').serialize();\n var image_upload = this;\n\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open('POST', '/repository/file/upload?encoding=base64&_token=' + this.apiKey + '&' + params);\n xmlHttp.setRequestHeader('Content-Type', 'application/json');\n xmlHttp.onreadystatechange = () => {\n if (xmlHttp.readyState === XMLHttpRequest.DONE) {\n var response = JSON.parse(xmlHttp.responseText);\n\n if (response.http_code < 400) {\n image_upload.uploadFinished(response.url);\n }\n\n if (response.http_code >= 400) {\n image_upload.validationFailure(response.fields, response.status);\n }\n }\n };\n xmlHttp.send(this.getRawImage());\n }", "title": "" }, { "docid": "e87794bff7175f7c21d290292221e1d2", "score": "0.73739684", "text": "function uploadEquipmentImage() {\r\n let data = new FormData();\r\n data.append('action', 'uploadImage');\r\n data.append('id', getEquipmentID());\r\n data.append('image', $('#imgInp').prop('files')[0]);\r\n\r\n api.post('/upload.php', data, true).then(res => {\r\n // TODO: display newly uploaded image in image picker\r\n }).catch(err => {\r\n snackbar(err.message, 'error');\r\n });\r\n}", "title": "" }, { "docid": "73d95688e9bac9db874d12c4fc17cdc3", "score": "0.7334361", "text": "function uploadImage(file) {\n setImgFile(URL.createObjectURL(file));\n setFormImg(file);\n }", "title": "" }, { "docid": "73d95688e9bac9db874d12c4fc17cdc3", "score": "0.7334361", "text": "function uploadImage(file) {\n setImgFile(URL.createObjectURL(file));\n setFormImg(file);\n }", "title": "" }, { "docid": "a4c7485e729c0f8b7f4f1f4f97d976a7", "score": "0.7269453", "text": "function uploadImg(){\n let file= this.files[0];\n let types = [\"image/jpeg\",\"image/png\"];\n\n if(types.indexOf(file.type) == -1){\n alert(\"file Not Supported\");\n return;\n }\n if(file.size > 2 * 1024 * 1024){\n alert(\"Your File Is So Big , Please Choose Another Photo\");\n return;\n }\n \n getImageBase64(file);\n\n}", "title": "" }, { "docid": "d59ec74687d5b48fb710429ea4a9aa57", "score": "0.7251102", "text": "function DoUpload() {\n const pathBox = document.getElementsByName(\"ImgPath\")[0];\n const textBox = document.getElementsByName(\"MsgTxt\")[0];\n\n let path = pathBox.value;\n if (path == \"\"){\n path = \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRKMIMpGBHavLy1F_6p2sFuN8utQzdJ0ozju8mq0FQQejqVJLjpxA\";\n }\n let text = textBox.value;\n\n //Preview\n let img = document.getElementById('Preview');\n img.src = path;\n\n //Encode\n EncodePicture(path, text, AfterEncoding); //returns Datasource for image as param to AfterEncoding\n }", "title": "" }, { "docid": "d004dcddaac09426f24af41549006613", "score": "0.7159256", "text": "function uploadImage(event) {\n console.log('Uploading an image.');\n getBase64(event.currentTarget.files[0]).then((imageData) => {\n upImage(imageData);\n });\n }", "title": "" }, { "docid": "dad9805face5ec6a9d8142f32755c1b7", "score": "0.7148959", "text": "function onFileInputEvent() {\n if (_fileInput.files.length > 0) {\n var isImgFile = true;\n var isAllowed = false;\n\t\tvar permittedFiles = \"jpeg|jpg|gif|bmp|png\";\n\t\t\n if (_fileInput.files[0].type) {\n isImgFile = _fileInput.files[0].type.substring(0, 5) == \"image\";\n var imgType = _fileInput.files[0].type;\n var imgExt = imgType.substr(imgType.indexOf(\"/\") + 1)\n if (permittedFiles.indexOf(imgExt.toLowerCase()) != -1) {\n isAllowed = true;\n }\n }else{\n\t\t\tvar imgExt = _fileInput.files[0].fileName.split('.').pop();\n\t\t\tif (permittedFiles.indexOf(imgExt.toLowerCase()) != -1) {\n isAllowed = true;\n }\n\t\t}\n\n if (isImgFile && isAllowed) {\n clearSelectedImg();\n loadSelectedImg();\n changeSlide('canvas');\n }\n else {\n showAlertPopup(_errorUploadFormat);\n }\n }\n}", "title": "" }, { "docid": "3e22be06b9d50d4c869873177828eda1", "score": "0.71484977", "text": "function beforeSubmit() {\n //check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n\n if (!$('#imageInput').val()) //check empty input filed\n {\n $(\"#output\").html(\"Input Field is empty. Please upload Image\");\n return false\n }\n\n var fsize = $('#imageInput')[0].files[0].size; //get file size\n var ftype = $('#imageInput')[0].files[0].type; // get file type\n\n //console.log(ftype);\n\n\n //allow only valid image file types \n switch (ftype) {\n case 'image/png':\n case 'image/gif':\n case 'image/jpeg':\n case 'image/pjpeg':\n case 'image/jpg':\n break;\n default:\n $(\"#output\").html(\"<b>\" + ftype + \" is unsupported image type!</b>\");\n return false\n }\n\n //Allowed file size is less than 1 MB (1000000)\n if (fsize > 1000000) {\n $(\"#output\").html(\"<b>\" + fsize + \"</b> Too big Image file! <br />Please reduce the size of your photo using an image editor.\");\n return false\n }\n\n $('button#submit').hide(); //hide submit button\n $('#loading-img').show(); //show loading\n $(\"#output\").html(\"\");\n } else {\n //Output error to older browsers that do not support HTML5 File API\n $(\"#output\").html(\"Please upgrade your browser, because your current browser lacks some new features we need!\");\n return false;\n }\n }", "title": "" }, { "docid": "a8327b13b852e235a50400685a936425", "score": "0.7076014", "text": "function uploadPhoto(){\n alert(\"Upload Image!\");\n}", "title": "" }, { "docid": "69f63d97f70a515d5ff64edc078b5f22", "score": "0.70663035", "text": "function cl_uploadPhoto() {\n\n\tif(!loggedIn){\n\t\tnavigator.notification.alert('Please log in to your account first.', function()\n\t\t\t\t{\n\t\t\t\t\tpushPage('profile', LTR);\n\t\t\t\t}, 'User not found');\n\t\treturn;\n\t}\n \n //selected photo URI is in the src attribute (we set this on getPhoto)\n var imageURI = document.getElementById('cl_picture').getAttribute(\"src\");\n \n //alert(\"imageURI \"+ imageURI);\n if (!imageURI) {\n navigator.notification.alert('Please take a photo first.', null, 'Photo not found');\n return;\n }\n\t\n\twindow.cl_amount = document.getElementById(\"cl_amount\").value;\n\t\n\tif(cl_amount == \"\"){\n\t\tnavigator.notification.alert('Please enter claim amount.', function()\n\t\t{\n\t\t\t$('#claim #cl_amount').focus();\n\t\t}, 'Missing info');\n\t\treturn;\n\t}\n\t\n\tvar categorySelected = document.getElementById(\"cl_category\");\n\twindow.cl_category = categorySelected.options[categorySelected.options.selectedIndex].value;\n\t\n\tif(cl_category == \"\"){\n\t\tnavigator.notification.alert('Please select a claim category.', null, 'Missing info');\n\t\treturn;\n\t}\n\t\n\twindow.cl_description = document.getElementById(\"cl_description\").value;\n\t\n\tif(cl_description == \"\"){\n\t\tnavigator.notification.alert('Please enter claim description.', function()\n\t\t{\n\t\t\t$('#claim #cl_description').focus();\n\t\t}, 'Missing info');\n\t\treturn;\n\t}\n\n\t$('#addclaim').addClass('loading');\n\t$('#addclaim .content').hide();\n\t\n //set upload options\n\tvar options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=userIndex + \"_\" + imageURI.substr(imageURI.lastIndexOf('/')+1);\n options.mimeType=\"image/jpeg\";\n \n\t//alert(\"1 imageURI upload \"+ imageURI);\n\n var params = new Object();\n params.value1 = userIndex;\n params.value2 = cl_amount;\n\t\tparams.value3 = cl_category;\n\t\tparams.value4 = cl_description;\n \n options.params = params;\n options.chunkedMode = false;\n \n var ft = new FileTransfer();\n ft.upload(imageURI, encodeURI (\"http://apemalaysia.net/foxspeed/api/cl_upload.php\"), cl_win, cl_fail, options);\n }", "title": "" }, { "docid": "0c84a0d757536f196ec674a99d895662", "score": "0.7026256", "text": "_handleImageUpload() {\n const preview = document.querySelector('#addBookCoverImage');\n const file = document.querySelector('input[type=file]').files[0];\n const reader = new FileReader();\n\n reader.addEventListener(\"load\", () => {\n preview.src = reader.result;\n }, false);\n\n if (file) {\n return reader.readAsDataURL(file);\n }\n }", "title": "" }, { "docid": "d3d8c58beed23d526b96a3a1888ba8a7", "score": "0.70088047", "text": "function nc_uploadPhoto() {\n\t\n\tif(!loggedIn){\n\t\tnavigator.notification.alert('Please log in to your account first.', function()\n\t\t\t\t{\n\t\t\t\t\tpushPage('profile', LTR);\n\t\t\t\t}, 'User not found');\n\t\treturn;\n\t}\n \n\t//selected photo URI is in the src attribute (we set this on getPhoto)\n var imageURI = document.getElementById('nc_picture').getAttribute(\"src\");\n \n\tif (!imageURI) {\n\t\tnavigator.notification.alert('Please take a photo first.', null, 'Photo not found');\n return;\n }\n\t\n\twindow.nc_name = document.getElementById(\"nc_name\").value;\n\t\n\tif(nc_name == \"\"){\n\t\tnavigator.notification.alert('Please enter the full name.', function()\n\t\t{\n\t\t\t$('#namecard #nc_name').focus();\n\t\t}, 'Missing info');\n\t\treturn;\n\t}\n\t\n\twindow.nc_position = document.getElementById(\"nc_position\").value;\n\t\n\tif(nc_position == \"\"){\n\t\tnavigator.notification.alert('Please enter position of the person.', function()\n\t\t{\n\t\t\t$('#namecard #nc_position').focus();\n\t\t}, 'Missing info');\n\t\treturn;\n\t}\n\t\n\twindow.nc_company = document.getElementById(\"nc_company\").value;\n\t\n\tif(nc_company == \"\"){\n\t\tnavigator.notification.alert('Please enter company name.', function()\n\t\t{\n\t\t\t$('#namecard #nc_company').focus();\n\t\t}, 'Missing info');\n\t\treturn;\n\t}\n\t\n $('#addnamecard').addClass('loading');\n\t$('#addnamecard .content').hide();\n\t\n //set upload options\n\tvar options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=userIndex + \"_\" + imageURI.substr(imageURI.lastIndexOf('/')+1);\n options.mimeType=\"image/jpeg\";\n \n\t//alert(\"1 imageURI upload \"+ imageURI);\n\n var params = new Object();\n params.value1 = userIndex;\n params.value2 = nc_name;\n params.value3 = nc_position;\n params.value4 = nc_company;\n \n options.params = params;\n options.chunkedMode = false;\n \n var ft = new FileTransfer();\n ft.upload(imageURI, encodeURI (\"http://apemalaysia.net/foxspeed/api/nc_upload.php\"), win, fail, options);\n}", "title": "" }, { "docid": "9f168d055f71e652abbd9d252a5bee8e", "score": "0.6967779", "text": "function beforeSubmit() {\r\n //check whether browser fully supports all File API\r\n if (window.File && window.FileReader && window.FileList && window.Blob) {\r\n\r\n if (!jQuery('#imageInput').val()) //check empty input filed\r\n {\r\n jQuery(\"#output\").html(\"Geen foto geselecteerd\");\r\n return false\r\n }\r\n\r\n var fsize = parseInt(jQuery('#imageInput')[0].files[0].size); //get file size\r\n var ftype = jQuery('#imageInput')[0].files[0].type; // get file type\r\n\r\n //allow only valid image file types \r\n switch (ftype) {\r\n case 'image/png':\r\n case 'image/gif':\r\n case 'image/jpeg':\r\n case 'image/pjpeg':\r\n break;\r\n default:\r\n jQuery(\"#output\").html(\"<b>\" + ftype + \"</b> Filetype niet ondersteund!\");\r\n return false\r\n }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif ( fsize < 250000 ) {\r\n\t\t\t\t\r\n jQuery(\".image_upload_warning\").html(\"<b>\" + bytesToSize(fsize) + \"</b> Afbeelding is te klein!\");\r\n }\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tjQuery(\".image_upload_warning\").html(\" \");\r\n\t\t\t}\r\n //Allowed file size is less than 1 MB (1048576)\r\n if (fsize > 20485760) {\r\n jQuery(\"#output\").html(\"<b>\" + bytesToSize(fsize) + \"</b> Afbeelding is te groot!\");\r\n return false\r\n }\r\n\t\t\t\r\n //Progress bar\r\n progressbox.show(); //show progressbar\r\n progressbar.width(completed); //initial value 0% of progressbar\r\n statustxt.html(completed); //set status text\r\n statustxt.css('color', '#000'); //initial color of status text\r\n\r\n\r\n jQuery('#submit-btn').hide(); //hide submit button\r\n jQuery('#loading-img').show(); //hide submit button\r\n jQuery(\"#output\").html(\"\");\r\n } else {\r\n //Output error to older unsupported browsers that doesn't support HTML5 File API\r\n jQuery(\"#output\").html(\"Uw browser ondersteund geen bestanden upload naar onze server, mail aub naar [email protected]\");\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "c8b0f7ceec625af41360ef4ccbfe5528", "score": "0.6967516", "text": "function uploadPhoto()\n{\n var myImg = document.getElementById('myImg');\n var options = new FileUploadOptions();\n options.fileKey = \"image\";\n options.fileName = \"image\" + Math.floor(Math.random()*100001) + \".jpg\";\n options.mimeType = \"image/jpeg\";\n\n var params = new Object();\n params.username = $('#username').val();\n params.pw = $('#pw').val();\n params.email = $('#email').val();\n options.params = params;\n \n if (myImg.src === null){\n var Data = {username: $('#username').val(), pw: $('#pw').val(), email: $('#email').val()};\n $.ajax({\n type: \"POST\",\n url: \"http://frigg.hiof.no/h13d23/Backend/createUser.php\",\n data: Data,\n success: onUploadSuccess,\n error: onUploadFail\n });\n return false;\n } else {\n var ft = new FileTransfer();\n ft.upload(myImg.src, encodeURI(\"http://frigg.hiof.no/h13d23/Backend/createUser.php\"), onUploadSuccess, onUploadFail, options);\n $('#notification').html(\"Uploading...\");\n }\n}", "title": "" }, { "docid": "82db867ed824e8ddee1f944096898e40", "score": "0.6898589", "text": "function upload(input) {\n if (!$upload_active)\n alert('Wait for current upload or filter to finish processing!');\n else {\n if (!input)\n alert('Unable to upload item! Try another upload method.');\n else if (input.files && input.files[0]) {\n // @input is a FileList object obtained from file item\n if (input.files[0].type.indexOf('image') === -1)\n alert('Only image files can be uploaded! Try again.');\n else {\n var reader = new FileReader();\n reader.onload = function() {\n update_images(reader.result);\n };\n /* readAsDataURL represents the image as a base64 encoded string\n that starts with the regexp 'data:image/*;base64,' */\n reader.readAsDataURL(input.files[0]);\n }\n }\n else {\n // @input is a DataTransfer object obtained from remote item\n var text_string = input.getData('text');\n var html_string = '';\n var start_pos;\n if (skel.vars.browser !== 'ie') {\n html_string = input.getData('text/html');\n start_pos = html_string.indexOf('src=\"');\n }\n if (html_string && start_pos !== -1) {\n start_pos += 5;\n var end_pos = html_string.indexOf('\"', start_pos);\n if (end_pos !== -1) {\n var src_string = html_string.substring(start_pos, end_pos);\n text_string = new DOMParser().parseFromString(\n src_string, 'text/html').body.textContent;\n }\n }\n /* Determines if @input is already a valid base64 image\n (e.g. drag and drop from 'After' box) or an image\n from a remote URL, in which case calls url_upload() */\n if (is_valid_b64img(text_string))\n update_images(text_string);\n else if (!text_string || !is_valid_url(text_string))\n alert('Dropped item is not a valid image! Try again.');\n else\n url_upload(text_string);\n }\n }\n}", "title": "" }, { "docid": "1bb284c9badd5ee9be3d1ee7984a7317", "score": "0.68843293", "text": "function handleUploadImage(e) {\n\n setUploadImage(e.target.files[0])\n\n }", "title": "" }, { "docid": "b7b49b559655a20baaae5f758e7362c3", "score": "0.6877737", "text": "function imageUpload(file) {\n img = loadImage(file.data, function () {\n drawOnce();\n makeImagePreview(imgPreview, img);\n });\n}", "title": "" }, { "docid": "ae35adabc039365c887ac8c2e6d17416", "score": "0.68519706", "text": "function _imageUploaded($img) {\n _setProgressMessage(editor.language.translate('Loading image'));\n\n var status = this.status;\n var response = this.response;\n var responseXML = this.responseXML;\n var responseText = this.responseText;\n\n try {\n if (editor.opts.imageUploadToS3) {\n if (status == 201) {\n var link = _parseXMLResponse(responseXML);\n\n if (link) {\n insert(link, false, [], $img, response || responseXML);\n }\n } else {\n _throwError(BAD_RESPONSE, response || responseXML, $img);\n }\n } else {\n if (status >= 200 && status < 300) {\n var resp = _parseResponse(responseText);\n\n if (resp) {\n insert(resp.link, false, resp, $img, response || responseText);\n }\n } else {\n _throwError(ERROR_DURING_UPLOAD, response || responseText, $img);\n }\n }\n } catch (ex) {\n // Bad response.\n _throwError(BAD_RESPONSE, response || responseText, $img);\n }\n }", "title": "" }, { "docid": "c64c64678717e2070d2c404d74a2b57d", "score": "0.68518674", "text": "function validateImage(file_input) {\n // Allowing file type\n let allowedExtensions = /(\\.jpg|\\.jpeg|\\.png|\\.gif)$/i;\n /*console.log(\"file_input.value= \"+file_input.value);\n console.log(\"file_input.files= \"+JSON.stringify(file_input.files));\n console.log(\"file_input.files.name= \"+JSON.stringify(file_input.files.name));\n console.log(\"file_input.files[0]= \"+JSON.stringify(file_input.files[0]));\n console.log(\"file_input.files[0].name= \"+file_input.files[0].name);*/\n\n if (!allowedExtensions.exec(file_input.value)) {\n alert('Type de fichier incorrect');\n file_input.value = '';\n return false;\n }\n else\n {\n // Image preview\n if (file_input.files && file_input.files[0]) {\n const reader = new FileReader();\n reader.onload = function(e) {\n document.getElementById(\n 'imagePreview').innerHTML = '<img id=\"imgPrevTag\" width=\"200\" height=\"100\" src=\"' + e.target.result + '\"/>';\n };\n\n reader.readAsDataURL(file_input.files[0]);\n }\n return true;\n }\n }", "title": "" }, { "docid": "00244fc64a1e80da466395d164d713b5", "score": "0.682642", "text": "function photoUpload(file) {\n const reader = new FileReader();\n // console.log(\"reader\", reader);\n // console.log(\"file\", file);\n if (reader !== undefined && file !== undefined) {\n if (file.type !== \"image/png\" && file.type !== \"image/jpeg\") {\n swal(\"Png/Jpg only\", \"Check the file and try again.\", \"warning\");\n } else if (file.size > 2000000) {\n swal(\"Max size 2MB!\", \"Check the file and try again\", \"warning\");\n } else {\n file.type === \"image/png\" ? setimageType(\"png\") : setimageType(\"jpeg\");\n reader.onloadend = (e) => {\n setBase64(btoa(e.target.result));\n };\n reader.readAsBinaryString(file);\n //This is a key line to update the states while interpreting imgs.\n }\n }\n }", "title": "" }, { "docid": "8000a38ca36fd7d0ffd9350a0f2c414f", "score": "0.6808751", "text": "function fileUpload() {\n const reader = new FileReader();\n reader.onload = function (e1) {\n var image = new Image();\n image.onload = function(e2) {\n setupBlurring(image);\n };\n image.src = reader.result;\n }\n reader.readAsDataURL(this.files[0]);\n}", "title": "" }, { "docid": "b07e6aaaa2da6dd9ab220af7a27a4e7e", "score": "0.6790872", "text": "handleUploadImage(e) {\n e.preventDefault();\n if (this.refs.image.files[0]) {\n console.log(\"Uploading Image \" + this.refs.image.files[0].name + \"\");\n /**\n Handle image Upload\n **/\n }\n }", "title": "" }, { "docid": "89204fdf38906caf513729d33067e065", "score": "0.67812943", "text": "function uploadPhoto(){\n if (isFromCamera == true) {\n var ft = new FileTransfer();\n var options = new FileUploadOptions();\n\n options.fileKey = \"image\";\n // we use the file name to send the username\n options.fileName = \"filename.jpg\"; \n options.mimeType = \"image/jpeg\";\n options.chunkedMode = false;\n options.params = { \n \"username\": username\n };\n\n ft.upload(imageSavedURI, encodeURI(serverURL + \"upload.php\"),\n function (e) {\n alert(\"Image uploaded\");\n },\n function (e) {\n alert(\"Upload failed\");\n }, \n options\n );\n } else {\n var formdata = new FormData();\n formdata.append(\"image\", file);\n formdata.append(\"username\", username);\n var ajax = new XMLHttpRequest();\n ajax.upload.addEventListener(\"progress\", progressHandler, false);\n ajax.addEventListener(\"load\", completeHandler, false);\n ajax.addEventListener(\"error\", errorHandler, false);\n ajax.addEventListener(\"abort\", abortHandler, false);\n ajax.open(\"POST\", serverURL + \"upload.php\");\n ajax.send(formdata);\n }\n}", "title": "" }, { "docid": "35138c983251e2ac96abe8548a5bfadd", "score": "0.6776216", "text": "function beforeSubmit() {\r\n\t //check whether browser fully supports all File API\r\n\t if (window.File && window.FileReader && window.FileList && window.Blob)\r\n\t {\r\n\t if( $(\".photomain_up\").val() ) //check empty input filed\r\n\t {\r\n\t \r\n\t\t var fsize = $(\".photomain_up\")[0].files[0].size; //get file size\r\n\t\t var ftype = $(\".photomain_up\")[0].files[0].type; // get file type\r\n\t\t \r\n\t\t //allow only valid image file types\r\n\t\t switch(ftype)\r\n\t\t {\r\n\t\t case 'image/png': case 'image/jpeg': case 'image/pjpeg':\r\n\t\t break;\r\n\t\t default:\r\n\t\t $(\".error-first-login\").html(photo_ext_error_str).fadeIn();\r\n\t\t $(\".btn-send-and-begin\").html(send_and_begin_str);\r\n\t\t $(\"form .photomain_up\").closest(\".form-group\").addClass(\"has-error\");\r\n\t\t scrollTopToStatus();\r\n\t\t return false;\r\n\t\t }\r\n\t\t \r\n\t\t if(fsize>5242880)\r\n\t\t {\r\n\t\t $(\".error-first-login\").html(photo_weight_error_str).fadeIn();\r\n\t $(\".btn-send-and-begin\").html(send_and_begin_str);\r\n\t $(\"form .photomain_up\").closest(\".form-group\").addClass(\"has-error\");\r\n\t scrollTopToStatus();\r\n\t\t return false;\r\n\t\t }\r\n\t\t \r\n\t } else {\r\n\t\t return true;\r\n\t }\r\n\t \r\n\t }\r\n\t}", "title": "" }, { "docid": "3c0fa9c30188e4e2cf7686e6c9936d47", "score": "0.67740124", "text": "serviceImgBrowse(event){\n\t event.preventDefault();\n\n\t /*--------------Code form Logo Image-----------*/\n\n\t var file = event.target.files[0]; //assuming you have only one file\n\t var render = new FileReader(); //this works only in html5\n\t render.onload =function(event){\n\t var fileData = render.result;\n\t var fileName = file.name;\n\t Session.set(\"serviceImg\",fileData);\n\t // Meteor.call('tempLogoImageUpload', fileName, fileData,function(err,result){\n\t // if(err){\n\t // console.log(err);\n\t // }else{\n\t // console.log('Image Uploaded!');\n\t // }\n\t // });\n\t };\n\n\t render.readAsDataURL(file);\n }", "title": "" }, { "docid": "94d8113e38b053b6931a6a7cfd477668", "score": "0.67730325", "text": "function iInputImageClicked() {\n\tshowDialogScreen(\"Please Wait.\", \"Uploading Image\");\n\n\tlet iInputImage = document.getElementById(\"iInputImage\");\n\n\tlet formData = new FormData();\n\tformData.append(\"inputImage\", iInputImage.files[0]);\n\t\n\txhr = new XMLHttpRequest();\n\txhr.open(\"POST\", \"/upload_image\", true);\n\txhr.onload = function(response) {\n\n\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\taddOption(iInputImage.files[0].name, true);\n\t\t\tloadImage(iInputImage.files[0].name);\n\t\t\t\n\t\t\thideDialogScreen();\n\t\t} else {\n\t\t\tshowErrorMsg(\"Couldn't upload image.\")\n\t\t}\n\n\t}\n\txhr.send(formData);\n}", "title": "" }, { "docid": "324bba2612acd8f2f278ca083771954d", "score": "0.67722666", "text": "function imageUploaded(file){\n\n uploadedImage = loadImage(file.data, drawImg);\n}", "title": "" }, { "docid": "7d3b23769cc2d134898c300fd57a2265", "score": "0.6750535", "text": "function uploadImage(req, res) {\n\n const uid = req.params['uid'];\n const wid = req.params['wid'];\n const pid = req.params['pid'];\n const wgid = req.params['wgid'];\n var myFile = req.file;\n\n widget = widgetModel.findWidgetById(wgid).then(\n \t(widget) => {\n \t\twidget.url = '/assets/uploads/'+myFile.filename;\n \t\twidgetModel.updateWidget(wgid, widget).then(\n \t\t\t(data) => {\n \t\t\t\tvar callbackUrl = req.headers.origin + \"/user/\" + uid + \"/website/\" + wid + \"/page/\" + pid + \"/widget/\" + wgid;\n \t\t\t\tres.redirect(callbackUrl);\n \t\t\t}\n \t\t);\n \t}\n );\n }", "title": "" }, { "docid": "0dff01b02c060923cdd74f9cd07d71fd", "score": "0.6725096", "text": "function uploadImg(elForm, ev) {\n // ev.preventDefault();\n console.log(elForm, 'eldorm');\n\n // Call this function on successful request\n function onSuccess(response) {\n console.log('uploadedImg', response);\n console.log('uploadedImg', response.url);\n }\n\n doUploadImg(elForm, onSuccess);\n}", "title": "" }, { "docid": "a2c98baf04076ed67476a89e4ba2cf6c", "score": "0.6724151", "text": "function uploadPhoto(imageURI) {\n var options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);\n options.mimeType=\"image/jpeg\";\n\n var params = new Object();\n params.value1 = \"test\";\n params.value2 = \"param\";\n\n options.params = params;\n options.chunkedMode = false;\n\n //FileTransfer() object allows you to upload or download files to and from a server.\n var ft = new FileTransfer();\n //If you want to upload set ft.upload, it has 5 parameters.\n //CUANDO ANDEN LAS COOKIES BORRAR MARTIN Y PONER EL USUARIO DE LA COOKIE.\n ft.upload(imageURI, server_host + \"upload.php?usuario=\"+$('input#usuario').val(), win, fail, options);//Put your php file that changes the image to an other folder\n var show_picture = document.getElementById(\"show_picture\");\n show_picture.src = imageURI;\n}", "title": "" }, { "docid": "5bd76f842494f2bec050e5bded6605df", "score": "0.67219335", "text": "function _imgUpload ( /*[Object] event*/ e ) {\n\t\te.preventDefault();\n\t\tif (window.File && window.FileReader && window.FileList && window.Blob) {\n\t\t\tvar reader = new FileReader(),\n\t\t\tfile = this.files[0],\n\t\t\ttempImg = new Image();\n\n\t\t\tif( file && file.type.match('image.*') ) {\n\t\t\t\treader.readAsDataURL(file);\n\t\t\t}\n\n\t\t\treader.onload = function(e) {\n\t\t\t\ttempImg.src = e.target.result;\n\n\t\t\t\ttempImg.onload = function() {\n\t\t\t\t\tif ( tempImg.width > imageMaxSizes.w || tempImg.height > imageMaxSizes.h ) {\n\t\t\t\t\t\tsizesError && sizesError.classList.add('show');\n\t\t\t\t\t\tsizesError && setTimeout(function(){\n\t\t\t\t\t\t\tsizesError.classList.remove('show');\n\t\t\t\t\t\t}, imageMaxSizes.timeout * 1000);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar scale, rotate;\n\t\t\t\t\t\tscale = editImageScale.get();\n\t\t\t\t\t\trotate = editImageRotate.get();\n\t\t\t\t\t\trotate = Number(rotate.substr(0, rotate.length - 12));\n\n\t\t\t\t\t\tif ($imageObjects[0]) {\n\t\t\t\t\t\t\tcnv.remove($imageObjects[0]);\n\t\t\t\t\t\t\tcnv.remove($imageObjects[0]);\n\t\t\t\t\t\t\t$imageObjects = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\timage = new fabric.Image(tempImg);\n\t\t\t\t\t\timage.set({\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\tangle: rotate || 0,\n\t\t\t\t\t\t\tscaleY: (scale / 100) || 1,\n\t\t\t\t\t\t\tscaleX: (scale / 100) || 1,\n\t\t\t\t\t\t\toriginX: 'center',\n\t\t\t\t\t\t\toriginY: 'center',\n\t\t\t\t\t\t\tminScaleLimit: 0.1\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif ( tempImg.width > canvasWidth || tempImg.height > canvasHeight ) {\n\t\t\t\t\t\t\tvar scaleX = canvasWidth / tempImg.width,\n\t\t\t\t\t\t\tscaleY = canvasHeight / tempImg.height;\n\n\t\t\t\t\t\t\tscale = ( scaleX > scaleY )? scaleY: scaleX;\n\t\t\t\t\t\t\timage.set({\n\t\t\t\t\t\t\t\tscaleY: scale * 0.8,\n\t\t\t\t\t\t\t\tscaleX: scale * 0.8,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timage.setControlsVisibility({'mr': false, 'ml': false, 'mt': false, 'mb': false});\n\n\t\t\t\t\t\timage.on('deselected', _editTextBlockApply.bind(cnv));\n\t\t\t\t\t\timage.on('selected', _selected);\n\n\t\t\t\t\t\tcnv.centerObject(image);\n\t\t\t\t\t\tcnv.add(image).setActiveObject(image);\n\t\t\t\t\t\twindow.$imageObjects.push(image);\n\n\t\t\t\t\t\tsetObjectsOrder();\n\t\t\t\t\t\tcnv.renderAll();\n\n\t\t\t\t\t\timage.baseTop = image.top;\n\t\t\t\t\t\timage.baseLeft = image.left;\n\t\t\t\t\t\timage.baseScale = image.scaleX;\n\n\t\t\t\t\t\t// base size parts\n\t\t\t\t\t\timage.size = {\n\t\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\t\theight: image.height,\n\t\t\t\t\t\t\tconversion: function () {\n\t\t\t\t\t\t\t\tvar k = canvasWidth / defaultCanvasWidth;\n\t\t\t\t\t\t\t\timage.width = this.width * k;\n\t\t\t\t\t\t\t\timage.height = this.height * k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// base position parts\n\t\t\t\t\t\timage.position = {\n\t\t\t\t\t\t\t// top\n\t\t\t\t\t\t\toverlayOffsetY: overlay['top'].height(cnv.height),\n\t\t\t\t\t\t\tcanvasOffsetY: image.top - overlay['top'].height(cnv.height),\n\t\t\t\t\t\t\t// left\n\t\t\t\t\t\t\toverlayOffsetX: overlay['left'].width(cnv.width),\n\t\t\t\t\t\t\tcanvasOffsetX: image.left - overlay['left'].width(cnv.width),\n\t\t\t\t\t\t\tscaleOffsetX: function (scale) {\n\t\t\t\t\t\t\t\tthis.canvasOffsetX = this.canvasOffsetX * scale;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tscaleOffsetY: function (scale) {\n\t\t\t\t\t\t\t\tthis.canvasOffsetY = this.canvasOffsetY * scale;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tconversionOffsetX: function () {\n\t\t\t\t\t\t\t\tthis.canvasOffsetX = image.left - overlay['left'].width(cnv.width);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tconversionOffsetY: function () {\n\t\t\t\t\t\t\t\tthis.canvasOffsetY = image.top - overlay['top'].height(cnv.height);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tconversionOverlayOffset: function () {\n\t\t\t\t\t\t\t\tthis.overlayOffsetY = overlay['top'].height(cnv.height);\n\t\t\t\t\t\t\t\tthis.overlayOffsetX = overlay['left'].width(cnv.width);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\t\t} else {\n\t\t\talert('The File APIs are not fully supported in this browser.');\n\t\t}\n\t\tthis.value = null;\n\t\treturn false;\n\t}", "title": "" }, { "docid": "c826d0cfd2e4bbeef893b7c5f8a6ff21", "score": "0.6701024", "text": "function upload(imgURL) {\n\n var ft = new FileTransfer();\n\n var options = new FileUploadOptions();\n var serverURL = \"http://dev.mimosatek.com:5002/\";\n options.fileKey = \"file\";\n options.fileName = 'filename.png';\n options.mimeType = \"image/png\";\n options.chunkedMode = true;\n options.params = {\n \"description\": \"Uploaded from my phone\",\n \"management_unit_id\": 1,\n \"gateway_id\": 1,\n \"node_id\":1,\n \"user_id\": 1,\n \"system_id\":1,\n \"camera_type\": 1\n };\n\n ft.upload(imgURL,encodeURI(serverURL + \"api/addImage\"),\n function (e) {\n alert(\"Cập nhật thành công! \", e);\n var tempParam='url:'+serverURL + \"api/addImage\";\n\n $scope.reddit = new TimelineMore();\n $scope.reddit.nextPage(1,1,1);\n },\n function (e) {\n alert(\"Cập nhật không thành công!\");\n var tempParam='url:'+serverURL + \"api/addImage\";\n }, options);\n }", "title": "" }, { "docid": "a981075f81fff4ea73cef61af4eaade9", "score": "0.6690095", "text": "function uploadPhoto(imageURI, NameImage) {\n \n var options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=NameImage.substr(NameImage.lastIndexOf('/')+1);\n options.mimeType=\"image/jpge\";\n\t\n\n \n var params = new Object();\n params.value1 = \"test\";\n params.value2 = \"param\";\n \n options.params = params;\n options.chunkedMode = false;\n \n var ft = new FileTransfer();\n ft.upload(imageURI, Url+'PHP/FunctionsMobile.php', win, fail, options,true);\n\t\n\n}", "title": "" }, { "docid": "250fe745e8cb2b3158d7d9f07340b4a9", "score": "0.6684311", "text": "function uploadPhoto() {\n var e = _('file').files[0];\n var o = _('cgal').value;\n var t = _('description').value;\n var i = _('p_status');\n var n = _('vupload');\n\n // Check for empty fields\n if (e == '' || o == '') {\n return 'You did not give a gallery or a photo!';\n }\n\n // Check if image file type is supported\n if (e.type != 'image/jpg' && e.type != 'image/jpeg' && e.type != 'image/png' &&\n e.type != 'image/gif') {\n genDialogBox();\n return false;\n }\n\n i.innerHTML = `\n <img src=\"/images/rolling.gif\" width=\"30\" height=\"30\"\n style=\"display: block; margin: 0 auto;\">\n `;\n n.style.display = 'none';\n // _('pbc').style.display = 'block';\n\n // Create a new form data and append photo, gallery and description to it\n var a = new FormData();\n a.append('stPic_photo', e);\n a.append('cgal', o);\n a.append('des', t);\n \n // Handle progress bar\n var p = new XMLHttpRequest();\n\n /*\n TODO: progressHandler is not called for some unknown reasons; solve bug\n p.upload.addEventListener('progress', progressHandler, false);\n */\n\n p.addEventListener('load', completeHandler, false);\n p.addEventListener('error', errorHandler, false);\n p.addEventListener('abort', abortHandler, false);\n p.open('POST', '/php_parsers/photo_system.php');\n p.send(a);\n}", "title": "" }, { "docid": "f3dbed22fc373e53c9d322aab1737d70", "score": "0.6679814", "text": "function para_upload_img(ele, cont_id){\n\tvar input =jQuery(ele);\n\tvar path = jQuery(ele).val().replace('C:\\\\fakepath\\\\','');\n\tvar extention = path.substring(path.lastIndexOf('.') + 1, path.length);\n\tif (extention == 'jpg' || extention == 'png' || extention == 'jpeg' || extention == 'gif' || extention == 'mp3' || extention == 'mp4' || extention == 'mov' || extention == 'avi' || extention == 'pdf'){\n\t\tif(jQuery(\"#up_err_msg\").length>0){\n\t\tjQuery(\"#up_err_msg\").remove();\n\t\t}\n\tjQuery(ele).attr(\"value\",path);\n var formdata = new FormData();\n\t var file;\n file = jQuery(ele).prop(\"files\")[0];\n\t formdata.append(\"images\", file);\n\t\tformdata.append(\"images-name\", file.name);\n\t\tcall_ajax(formdata, cont_id);\n\t}\n\telse{\n\t\tif(jQuery(\"#up_err_msg\").length<=0){\n\t\tvar up_msg = document.createElement('div');\n\t\tup_msg.setAttribute('id', \"up_err_msg\");\n\t\tup_msg.innerHTML = \"Please upload correct file\";\n\t\tup_msg.setAttribute(\"style\", \"color:red;\");\n\t\tjQuery(ele).parent().append(up_msg);\n\t\t}\n\t}\n }", "title": "" }, { "docid": "e192d09a82642280e6c7d74310bdc3bf", "score": "0.6676456", "text": "uploadImage(uriFromCameraRoll, imageName, imageType, processRespTextFunc) {\n var url = this.constructor.HOST + '/image/' + imageType + '/upload'\n var image = {\n uri: uriFromCameraRoll,\n type: 'image/jpeg',\n name: imageName,\n };\n var body = new FormData();\n body.append(imageType, image);\n\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState == XMLHttpRequest.DONE) {\n // responseText is just the image filename. eg: 'profile_yicyahoo.png'.\n console.log('xhr.responseText:', xhr.responseText);\n processRespTextFunc(xhr.responseText);\n }\n }\n xhr.open('POST', url);\n xhr.send(body);\n\n }", "title": "" }, { "docid": "1134292218461c2167cba114c44db4e2", "score": "0.6675405", "text": "image(name, imageUrl, label, accepts = '*') {\r\n return this.file(name, label).data('src', imageUrl).addClass('image-file-input').attr('accept', 'image/' + accepts);\r\n }", "title": "" }, { "docid": "b7e15178bb557a63393b6fcc86824c62", "score": "0.66720456", "text": "function reUpload() {\n vm.galleryAdminService.insertFile(vm.imgUploadItem)\n .then(success).catch(error);\n function success(res) {\n console.log(res.data);\n updateGallery(res.data.item);\n }\n function error(err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "c890ecfe826184a917fe0ccf44c5d783", "score": "0.6652727", "text": "function upload() {\n // get uploaded file's filename and label\n let label = document.getElementsByClassName(\"custom-file-label\")[0];\n let file = document.getElementById(\"file-upload\").files[0];\n\n // verify JPG extension\n if (file.type != \"image/jpeg\") {\n alert(\"Please upload JPG files only.\");\n return;\n }\n\n // change label\n label.innerHTML = file.name;\n\n // preview the image\n let disp_img = document.getElementById(\"display-img\");\n let mod_img = document.getElementById('model-img');\n\n // wipe all child nodes from display container\n while (disp_img.firstChild) {\n disp_img.removeChild(disp_img.firstChild);\n }\n while (mod_img.firstChild) {\n mod_img.removeChild(mod_img.firstChild);\n }\n\n // add header child\n let new_header = document.createElement(\"h4\");\n new_header.innerHTML = \"Image you uploaded:\";\n disp_img.appendChild(new_header);\n\n // display uploaded image\n let new_img = document.createElement(\"IMG\");\n new_img.setAttribute(\"alt\", \"#\");\n new_img.setAttribute(\"src\", URL.createObjectURL(file));\n new_img.setAttribute(\"style\", \"max-width: 100%; max-height: 100%; object-fit: contain;\");\n disp_img.appendChild(new_img);\n}", "title": "" }, { "docid": "970b4c46ce64fe0b15ae4bd8adc0513d", "score": "0.66311145", "text": "function onAddNewImageFormSubmit() {\r\n let form = new FormData(this);\r\n form.append('action', 'addEquipmentImage');\r\n\r\n api.post('/equipment-images.php', form, true)\r\n .then(res => {\r\n snackbar(res.message, 'success');\r\n onUploadImageSuccess(res.content.id);\r\n onProjectImageSelected(res.content.id);\r\n })\r\n .catch(err => {\r\n snackbar(err.message, 'error');\r\n $('#btnUploadImage').attr('disabled', false);\r\n $('#formAddNewImageLoader').hide();\r\n });\r\n\r\n $('#btnUploadImage').attr('disabled', true);\r\n $('#formAddNewImageLoader').show();\r\n\r\n return false;\r\n}", "title": "" }, { "docid": "c79c09c58ef53b51f3dda2b05b33f7c7", "score": "0.6629425", "text": "function uploadFiles (event) {\n event.preventDefault(); // Prevent the default form post\n console.log('Uploading picture...');\n // Grab the file and asynchronously convert to base64.\n var file = $('#fileform [name=fileField]')[0].files[0];\n var reader = new FileReader();\n reader.onloadend = processFile;\n reader.readAsDataURL(file);\n}", "title": "" }, { "docid": "27195f656e67416f98527f55f1e01f1f", "score": "0.6619594", "text": "function uploadImage(filename) {\n \n var req = request.post(config.webhookUrl, function (err, resp, body) {\n if(err) {\n console.log(err);\n }\n // console.log('sent image', fileName);\n });\n \n var form = req.form();\n form.append('file', fs.createReadStream(filename));\n form.append('content', config.username);\n }", "title": "" }, { "docid": "517dfbfc2b64855cfc4846e0e61a7f44", "score": "0.66152555", "text": "handleAddImage(e) {\n e.preventDefault();\n let file = this.refs.image.files[0];\n \n // Validate file is of type Image\n // let fileType = this.refs.image.files[0].type.split(\"/\")[0];\n // if (fileType !== \"image\") {\n // console.log(\"Not an image file\");\n // this.setState({\n // file: null,\n // errorNotification: \"Not an image File\",\n // dragOverClass: \"\"\n // });\n // return setTimeout(() => {\n // this.setState({\n // errorNotification: null\n // });\n // }, 3000);\n // }\n \n this.setState({\n file\n });\n\n this.props.changeFile(file);\n }", "title": "" }, { "docid": "d1a606cb39dd259baaffce9f18c1ea5d", "score": "0.6602122", "text": "function uploadCatHandler(e){\n e.preventDefault()\n //console.log(\"uploadCatHandler Run\")\n const uploadInput = document.getElementById('catImageUpload').files[0];\n // console.log(uploadInput);\n uploadCat(uploadInput)\n}", "title": "" }, { "docid": "fa6efbf46139e87c13045c934ffec3c6", "score": "0.6592067", "text": "function uploadFileInput(x, successFunc, failFunc) {\n x.get(0).files;\n uploadFile(x.get(0).files, 'uploadfile', function(data, textStatus, jqXHR, uploaded_url) {\n uploaded_url = uploaded_url.substring(uploaded_url.indexOf(\"image_\"));\n successFunc(uploaded_url);\n }, function(jqXHR, textStatus, errorThrown) {\n failFunc(uploaded_url);\n });\n}", "title": "" }, { "docid": "a1c0587bc4553a9494a041e34464d17c", "score": "0.6584102", "text": "function processImage() {\n const imageInput = document.getElementById(\"upload-image-input\");\n imageInput.addEventListener('change', function (event) {\n uploadedImageFiles.push(event.target.files[0]);\n storeTemporaryImage(event.target.files[0]);\n addImageNamesToDOM();\n });\n}", "title": "" }, { "docid": "cad600b2326439b7c9145ff2d4b059d5", "score": "0.65815824", "text": "function uploadPhoto(imageURI,params) {\n\n var options = new FileUploadOptions();\n options.fileKey=\"file\";\n options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);\n options.mimeType=\"image/jpeg\";\n\n options.params = params;\n\n var ft = new FileTransfer();\n ft.upload(imageURI, encodeURI(urlUploadImage), win, fail, options);\n\n}", "title": "" }, { "docid": "d456ccd2082bf1460728deab77be61f8", "score": "0.657665", "text": "function beforeSubmit(){\n //check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList && window.Blob)\n {\n\n if( !$('#FileInput').val()) //check empty input filed\n {\n $(\"#output\").html(\"Can't find the cover.\");\n return false\n }\n\n var fsize = $('#FileInput')[0].files[0].size; //get file size\n var ftype = $('#FileInput')[0].files[0].type; // get file type\n\n\n //allow file types\n switch(ftype)\n {\n case 'image/png':\n case 'image/gif':\n case 'image/jpeg':\n case 'image/pjpeg':\n //case 'application/pdf':\n break;\n default:\n $(\"#output\").html(\"<b>\"+ftype+\"</b> Unsupported file type!\");\n return false\n }\n\n //Allowed file size is less than 5 MB (1048576)\n if(fsize>5242880)\n {\n $(\"#output\").html(\"<b>\"+bytesToSize(fsize) +\"</b> Too big file! <br />File is too big, it should be less than 5 MB.\");\n return false\n }\n $(\"#loaded-img\").show();\n $('#submit-btn').hide(); //hide submit button\n $('#loading-img').show(); //hide submit button\n $(\"#output\").html(\"\");\n }\n else\n {\n //Output error to older unsupported browsers that doesn't support HTML5 File API\n $(\"#output\").html(\"Please upgrade your browser, because your current browser lacks some new features we need!\");\n return false;\n }\n }", "title": "" }, { "docid": "0db3d874d3b17e96e17298017b6b19b1", "score": "0.656268", "text": "onUpload() {\n // Assessing the image file and src\n if (this.myImage == '' || this.image == '') {\n alert(\"Please enter a photo\");\n return;\n }\n let townName = this.$route.params.name;\n let userName = this.$root.user.username\n let type = \"image\";\n\n //Using the FormData object to store the file data into our request\n let formData = new FormData();\n \n //Calling the module \n let image = new window.exports.Image(-1, townName, type, userName);\n let json = JSON.parse(image.toJSON());\n\n formData.append('file', this.myImage);\n\n //Appending image data object to the other useful data \n formData.append('data', JSON.stringify(json));\n\n fetch('/addImage/' + townName, {\n method: 'POST',\n headers: new Headers({\n 'Accept': 'application/json, */*'\n }),\n body: formData\n })\n .then(res => {\n //Redisplay the data accordingly\n this.showImages();\n this.setUpEvents();\n formData = '';\n this.image = '';\n this.myImage = '';\n return res.json();\n })\n .catch(err => console.log(\"Error: \" + err));\n }", "title": "" }, { "docid": "af45da43adfcb7a67c857ce45d26b037", "score": "0.65543866", "text": "function beforeUpload(file){\n // const { fileList, imgNum } = store.getState().machine\n // dispatch('UPLOAD_IMG_GET_NUM', imgNum + 1 )\n // if( fileList.length + imgNum >= 8 ) return false\n // else {\n const type = file.type\n let upload = type ==='image/png'|| type ==='image/gif'|| type ==='image/bmp'|| type ==='image/jpeg' || type ==='image/jpg' ||type === 'image/webp'\n if(upload){\n const boolean = file.size/1024 < 10000\n if(!boolean) notification.warning({\n message: '提示',\n description:'图片大于10MB, 不予上传!'})\n return boolean\n }\n else {\n notification.error({\n message: '提示',\n description:'上传图片格式错误!请上传一下几种格式图片image/png、image/gif、image/bmp、image/jpeg、image/jpg、image/webp'\n })\n return false\n}\n // }\n\n\n}", "title": "" }, { "docid": "39c5e556f743a3685168d100cab6d5c2", "score": "0.65533495", "text": "function uploadImage(req, res) {\n var widget = req.body;\n var myFile = req.file;\n var pageId = req.body.pageId;\n widget.pageId = pageId;\n if(widget.widgetId == \"\" && myFile!=null)\n {\n var url = req.protocol + '://' +req.get('host')+\"/uploads/\"+myFile.filename;\n widget.url = url;\n widget.type = \"IMAGE\";\n widgetModel\n .createWidget(pageId,widget)\n .then(function (widget) {\n res.redirect(\"/assignment/index.html#!/user/\" + req.body.userId + \"/website/\" + req.body.websiteId + \"/page/\" + req.body.pageId + \"/widget/\");\n }, function (error) {\n res.sendStatus(500);\n });\n }\n else if(widget.widgetId != \"\" && myFile!=null)\n {\n var url = req.protocol + '://' +req.get('host')+\"/uploads/\"+myFile.filename;\n widget.url = url;\n widgetModel\n .updateWidget(widget.widgetId,widget)\n .then(function (widget) {\n res.redirect(\"/assignment/index.html#!/user/\" + req.body.userId + \"/website/\" + req.body.websiteId + \"/page/\" + req.body.pageId + \"/widget/\");\n }, function (error) {\n res.sendStatus(500);\n });\n }\n else if(myFile == null){\n if(widget.widgetId == \"\"){\n widget.type = \"IMAGE\";\n widgetModel\n .createWidget(pageId,widget)\n .then(function (widget) {\n res.redirect(\"/assignment/index.html#!/user/\" + req.body.userId + \"/website/\" + req.body.websiteId + \"/page/\" + req.body.pageId + \"/widget/\");\n }, function (error) {\n res.sendStatus(500);\n });\n }\n else{\n widgetModel\n .updateWidget(widget.widgetId,widget)\n .then(function (widget) {\n res.redirect(\"/assignment/index.html#!/user/\" + req.body.userId + \"/website/\" + req.body.websiteId + \"/page/\" + req.body.pageId + \"/widget/\");\n }, function (error) {\n res.sendStatus(500);\n });\n }\n\n }\n }", "title": "" }, { "docid": "07e112cdf3c23d59c4b82a2f4185c988", "score": "0.6549788", "text": "function upload_image(){\n\n\t var file_data = $('#user_image').prop('files')[0]; \n\t //Image validation (size not mentioned)\n\t if(file_data.type==\"image/jpeg\" || file_data.type==\"image/jpg\"){\n\t \tvar form_data = new FormData(); \n \tform_data.append('file', file_data);\n \tvar user_mobile_number=$(\"#user_mobile_number\").val();\n\t\tsettingSection(user_mobile_number) \n $.ajax({\n url: 'php_controller/upload.php', // point to server-side PHP script \n dataType: 'text', // what to expect back from the PHP script, if anything\n cache: false,\n contentType: false,\n processData: false,\n data: form_data, \n type: 'post',\n success: function(php_script_response){\n //alert(php_script_response); // display response from the PHP script, if any\n }\n });\n\n\t }else{\n\t \talert(\"invalid file type. Please select .jpg or .jpeg format.\");\n\t }\n \n}", "title": "" }, { "docid": "4603f4397a8ec3a1e49d98c117b038f2", "score": "0.6548035", "text": "function doUploadImage(){\n var formData = new FormData($( \"#editForm\" )[0]);\n var imgPath = $(\"#file\").val();\n if (imgPath == \"\") {\n alert(\"请选择上传图片!\");\n return;\n }\n //判断上传文件的后缀名\n var strExtension = imgPath.substr(imgPath.lastIndexOf('.') + 1);\n if (strExtension != 'jpg' && strExtension != 'gif' && strExtension != 'png' && strExtension != 'bmp' && strExtension != 'JPG' && strExtension != 'GIF' && strExtension != 'PNG' && strExtension != 'BMP') {\n alert(\"请选择图片文件\");\n return;\n }\n $.ajax({\n url: 'http://www.daxi51.com/ssm_file/upload/upImage' ,\n type: 'POST',\n data: formData,\n async: false,\n cache: false,\n contentType: false,\n processData: false,\n dataType:'json',\n success: function (result) {\n //alert(\"success : \" + result.toString());\n //上传完成返回的图片路径\n updateImg = result.url;\n material_id = result.material_id;\n //alert(\"updateImg : \" + updateImg + \" material_id : \" + material_id );\n //获取提交表单的隐藏图片输入框\n var inputImg = document.getElementById(\"inputImg\");\n\n //设置inputImg输入框的值为上传完成返回的图片路径\n var strValue = inputImg.getAttribute(\"value\");\n strValue = strValue + material_id +\",\";\n /** 替换掉 ',,' 为 ',' */\n strValue = strValue.replace(',,', ',');\n inputImg.setAttribute(\"value\", strValue);\n\n //添加 img\n //获取添加图片的div,id为showIma\n var div = document.getElementById(\"showIma\");\n //创建img元素\n var img = document.createElement(\"img\");\n //设置img元素\n img.setAttribute(\"src\", updateImg);\n img.setAttribute(\"id\", material_id);\n img.setAttribute(\"height\", \"120px;\");\n //为img绑定点击事件\n img.onclick = objclick;\n //将img绑定到div中\n div.appendChild(img);\n\n },\n error: function (data) {\n alert(\"图片上传失败,服务器错误!\");\n }\n });\n}", "title": "" }, { "docid": "40450f0357e820ab80a145da6ae2b517", "score": "0.65448636", "text": "uploadImage() {\n this.showUploadBar();\n setTimeout(() => {\n if (this.state.imageToUpload) {\n const url = imageUploader('meal-image');\n if (url) {\n url\n .then((response) => {\n if (typeof (response) === 'string') {\n (this.state.isEdit)\n && this.props.updateMealOnEdit({ image: response });\n return this.setState({\n uploadedImageLink: response,\n disableBtn: false\n }); // enable btn after upload\n }\n\n throw new Error(response.message);\n })\n .catch(err => err);\n }\n }\n }, 100);\n }", "title": "" }, { "docid": "ba63c270c80319d633b1b728956e91e4", "score": "0.6538835", "text": "function uploadImg(elForm, ev) {\r\n ev.preventDefault();\r\n document.getElementById('imgData').value = gCanvas.toDataURL(\"image/jpeg\");\r\n\r\n // A function to be called if request succeeds\r\n function onSuccess(uploadedImgUrl) {\r\n uploadedImgUrl = encodeURIComponent(uploadedImgUrl)\r\n document.querySelector('.share-container').innerHTML = `\r\n <a class=\"btn\" href=\"https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}\" title=\"Share on Facebook\" target=\"_blank\" onclick=\"window.open('https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}'); return false;\">\r\n Share \r\n </a>`\r\n }\r\n\r\n doUploadImg(elForm, onSuccess);\r\n}", "title": "" }, { "docid": "babb1b8e06976c669e98e3059fc0b7ea", "score": "0.6537303", "text": "function uploadImg(elForm, ev) {\n ev.preventDefault();\n document.getElementById('imgData').value = gCanvas.toDataURL(\"image/jpeg\");\n\n // A function to be called if request succeeds\n function onSuccess(uploadedImgUrl) {\n uploadedImgUrl = encodeURIComponent(uploadedImgUrl)\n document.querySelector('.share-container').innerHTML = `\n <a class=\"share-btn-href\" href=\"https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}\" title=\"Share on Facebook\" target=\"_blank\" hidden onclick=\"window.open('https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}'); return false;\">\n Share \n </a>`\n document.querySelector('.share-btn-href').click()\n }\n\n doUploadImg(elForm, onSuccess);\n}", "title": "" }, { "docid": "7038f24bee0c174119e48d5763af0c3b", "score": "0.653376", "text": "onBeforeUpload(file) {\r\n if (file.size <= 10485760 && /png|jpg|jpeg|gif/i.test(file.extension)) return true;\r\n return 'Please upload image, with size equal or less than 10MB';\r\n }", "title": "" }, { "docid": "a66d45eadd92c237bd83fdb02148f36a", "score": "0.6532246", "text": "function onImgInput(ev) {\r\n loadImageFromInput(ev, renderUploadedImg)\r\n}", "title": "" }, { "docid": "c14cbaf014c2006610d8dd185314af86", "score": "0.6527962", "text": "submit() {\n const alert = createAlert('Updating your picture.');\n // Set back to upload mode\n this.setState({\n newPic: false,\n });\n // Send the picture for upload\n this.editor.getImage().toBlob(picture => (\n Mutation({\n mutation,\n variables: { picture },\n success: () => alert.success('Your picture has been updated.'),\n error: () => alert.error(),\n })\n ));\n }", "title": "" }, { "docid": "bdc9fcd00f223aa110a8dd02d4a3c315", "score": "0.65211207", "text": "function uploadImage(req, res, done) {\n Uploader(req, (e, fields, files) => {\n if(e || files.length == 0 )\n return done(new HttpError(400, 'Image is not present'));\n\n var image = files[0];\n\n if(image.buffer.length !== image.length || image.buffer.length == 0)\n return done(new HttpError(400, 'Image is corrupted or it\\'s length is 0'));\n\n var params = {\n userId: req.user._id,\n name: image.name,\n filename: image.filename,\n contentType: image.contentType,\n length: image.length,\n buffer: image.buffer\n };\n\n Image.saveImage(params, (e, r) => {\n res.send();\n params.buffer = [];\n });\n })\n}", "title": "" }, { "docid": "88835fca7c638c53a03948a899c664dd", "score": "0.65022194", "text": "function _startUpload(xhr, form_data, image, $image_placeholder) {\n function _sendRequest() {\n var $img = $(this);\n $img.off('load');\n $img.addClass('fr-uploading');\n\n if ($img.next().is('br')) {\n $img.next().remove();\n }\n\n editor.placeholder.refresh(); // Select the image.\n\n _editImg($img);\n\n _repositionResizer();\n\n showProgressBar();\n editor.edit.off(); // Set upload events.\n\n xhr.onload = function () {\n _imageUploaded.call(xhr, $img);\n };\n\n xhr.onerror = _imageUploadError;\n xhr.upload.onprogress = _imageUploadProgress;\n xhr.onabort = _imageUploadAborted; // Set abort event.\n\n $($img.off('abortUpload')).on('abortUpload', function () {\n if (xhr.readyState != 4) {\n xhr.abort();\n\n if (!$image_placeholder) {\n $img.remove();\n } else {\n $image_placeholder.attr('src', $image_placeholder.data('fr-old-src'));\n $image_placeholder.removeClass('fr-uploading');\n }\n\n _exitEdit(true);\n }\n }); // Send data.\n\n xhr.send(form_data);\n }\n\n var reader = new FileReader();\n\n reader.onload = function () {\n var link = reader.result;\n\n if (reader.result.indexOf('svg+xml') < 0) {\n // Convert image to local blob.\n var binary = atob(reader.result.split(',')[1]);\n var array = [];\n\n for (var i = 0; i < binary.length; i++) {\n array.push(binary.charCodeAt(i));\n } // Get local image link.\n\n\n link = window.URL.createObjectURL(new Blob([new Uint8Array(array)], {\n type: 'image/jpeg'\n }));\n } // No image.\n\n\n if (!$image_placeholder) {\n _addImage(link, null, _sendRequest);\n } else {\n $image_placeholder.on('load', _sendRequest); // Image might be corrupted.\n\n $image_placeholder.on('error', function () {\n _sendRequest();\n\n $(this).off('error');\n });\n editor.edit.on();\n editor.undo.saveStep();\n $image_placeholder.data('fr-old-src', $image_placeholder.attr('src'));\n $image_placeholder.attr('src', link);\n }\n };\n\n reader.readAsDataURL(image);\n }", "title": "" }, { "docid": "bff818fddc70a44550e982b0a1954a4d", "score": "0.6491951", "text": "function image(e, x, successFunc) {\n uploadUrl(e, x.attr('src'), 'uploadurl', function(data, textStatus, jqXHR, uploaded_url) {\n uploaded_url = uploaded_url.substring(uploaded_url.indexOf(\"image_\"));\n successFunc(uploaded_url, x);\n }, function(jqXHR, textStatus, errorThrown) {\n failFunc(uploaded_url);\n });\n}", "title": "" }, { "docid": "b9e2e3fb493ea220bdc26bedacbbcd93", "score": "0.6485654", "text": "function uploadImage(e) {\r\n let file = e.target.files[0];\r\n\r\n firebase\r\n .app()\r\n .storage()\r\n .ref('images')\r\n .child(file.name)\r\n .put(file);\r\n}", "title": "" }, { "docid": "8dba92aae08f46bc826b672eced4f3d0", "score": "0.64828247", "text": "function onCameraSuccess(imgURL){\n upload(imgURL);\n }", "title": "" }, { "docid": "f459276b862cf9fef42c87b2140f4478", "score": "0.6469971", "text": "handleTriggerFileUpload() {\n this.removeImage();\n this.inputElement.click();\n }", "title": "" }, { "docid": "319b1ef4d33e71b25e7d5cb4fd124352", "score": "0.6468969", "text": "function updateMainImg (link) {\n \n if ($(\"#Image\").val() == null || $(\"#Image\").val() == \"\") {\n var msg = \"<span style='color: red'>Please choose an image to upload!</span>\";\n $(\"#sys_message\").html(msg);\n }\n else {\n var fdata = new FormData();\n var files = $(\"#Image\")[0].files[0];\n fdata.append('Image', files);\n $.ajax({\n url: \"includes/upload_img_Products.php?link=\" + link + \"&src=main\",\n type: \"post\",\n data: fdata,\n contentType: false,\n processData: false,\n success: function (data) {\n if (!data) {\n window.location.href = \"Products.html\";\n }\n else {\n $(\"#sys_message\").html(data);\n }\n }\n });\n }\n}", "title": "" }, { "docid": "743ed1c5bb4da1fa1074531dc1fc40a8", "score": "0.6452816", "text": "function submitImage() {\n // action for the submit button\n console.log(\"submit\");\n\n if (!imageDisplay.src || !imageDisplay.src.startsWith(\"data\")) {\n window.alert(\"Please select an image before submit.\");\n return;\n }\n\n loader.classList.remove(\"hidden\");\n imageDisplay.classList.add(\"loading\");\n\n // call the predict function of the backend\n predictImage(imageDisplay.src);\n}", "title": "" }, { "docid": "79a8ef020eab0b8c92535726b165ed2d", "score": "0.6452747", "text": "uploadImage(callback) {\n\n this.imageModel.uploadUserImage({request: this.request}, (err, image) => {\n if (err) return callback(err);\n\n if (this.request.user.image) {\n // Remove old image\n this.imageModel.removeById(this.request.user.image, err => {\n if (err) this.logger.error(err);\n });\n }\n\n this.request.user.image = image._id;\n\n this.request.user.save(err => {\n if (err) return callback(err);\n\n this.terminate();\n\n this.response.send(image);\n\n callback();\n });\n });\n }", "title": "" }, { "docid": "511d4f858f831497feddc7003083939b", "score": "0.64523804", "text": "onFormSubmit(e) {\n e.preventDefault()\n\n if(this.state.ready) {\n this.imageUpload(this.state.file)\n\n this.setState({ready: false})\n }\n }", "title": "" }, { "docid": "e59993b55b42d52bc5dc64cc2764ef70", "score": "0.64501923", "text": "function beforeSubmit(e) {\n\n //check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList && window.Blob)\n {\n\n if (!$('#imageInput').val()) //check empty input filed\n {\n //$(\"#output\").html(\"Por Favor Insira um Arquivo\");\n $(\"#msg\").html(\"Por favor insira um arquivo\");\n $('#myModal').modal('show')\n return false\n }\n\n var fsize = $('#imageInput')[0].files[0].size; //get file size\n var ftype = $('#imageInput')[0].files[0].name; // get file type\n\n //Allowed file size is less than 1 MB (1048576) //arquvio phpinfo 20mb\n if (fsize > 20971520)\n {\n //$(\"#output\").html(\"<b>\" + bytesToSize(fsize) + \"</b> Arquivo muito grande! <br />Tente compacta-lo com o winrar ou winzip\");\n $(\"#msg\").html(\"<b> Arquivo maior que 20MB </b> <br />Tente compacta-lo com o winrar ou winzip\");\n $('#myModal').modal('show')\n return false\n }\n\n\n //Progress bar\n progressbox.show(); //show progressbar\n progressbar.width(completed); //initial value 0% of progressbar\n statustxt.html(completed); //set status text\n statustxt.css('color', '#000'); //initial color of status text\n\n\n $('#submit-btn').hide(); //hide submit button\n $('#loading-img').show(); //hide submit button\n $(\"#output\").html(\"\");\n } else\n {\n //Output error to older unsupported browsers that doesn't support HTML5 File API\n $(\"#output\").html(\"Please upgrade your browser, because your current browser lacks some new features we need!\");\n return false;\n }\n }", "title": "" }, { "docid": "be398c21bc440800d2e6dcd352746f01", "score": "0.64448756", "text": "handle_image_upload(file) {\n let upload = request.post(CLOUDINARY_UPLOAD_URL)\n .field('upload_preset', CLOUDINARY_UPLOAD_PRESET)\n .field('file', file);\n\n upload.end((err, response) => {\n if (err) {\n alert(err);\n }\n\n if (response.body.secure_url !== '') {\n this.setState({\n uploadedFileCloudinaryUrl: response.body.secure_url\n });\n this.setState({\n showImageName: this.state.uploadedFile.name\n })\n }\n });\n }", "title": "" }, { "docid": "c9105c394d702588ccc30b070f344064", "score": "0.6443678", "text": "onBeforeUpload(file) {\n // Allow upload files under 2MB, and only in png/jpg/jpeg formats\n if (file.size <= 2485760 && /png|jpg|jpeg/i.test(file.extension)) {\n return true;\n } else {\n return \"Please upload image, with size equal or less than 2MB\";\n }\n }", "title": "" }, { "docid": "e29195be601a38b9475e07f32fde1909", "score": "0.6442677", "text": "function uploadImage(popupContentDiv, file){\n\tvar removeDiv = popupContentDiv;\n\tvar childrenNodes = removeDiv.childNodes;\n\tvar image = childrenNodes[0];\n\tvar textInput = childrenNodes[1];\n\tif(textInput.value == \"\"){\n\t\talert(\"Put in a description\");\n\t\treturn;\n\t}\n\tif(uploadImageToServer(file, textInput.value)){\n\t\taddRadioMemeButton(file.name, textInput.value);\n\t}\n\telse{\n\t\talert(\"Cannot upload image\");\n\t}\n\tremovePopupContentDiv(removeDiv);\n}", "title": "" }, { "docid": "8980e251599d7c3ea596ddab563957ae", "score": "0.6440129", "text": "function uploadFile(){\n\tvar form = $('form')[1]; \n\tvar formData = new FormData(form);\n\t\t$.ajax({\n\t\t\tdataType: \"jsonp\",\n\t\t\ttimeout: 10000,\n \turl: \"utils/ajaxupload.php?jsoncall=?\",\n\t\t\ttype: \"POST\",\n\t\t\tdata: formData,\n\t\t\tcontentType: false,\n \t cache: false,\n\t\t\tprocessData:false,\n\t\t\tsuccess: function(data)\n\t\t {\n\t\t\t\tvar data2=data.response;\n\t\t\t\tif(data2==2)\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"logoimg\").src=\"utils/emaillogo/emaillogo.jpg?time=\" + new Date();\n\t\t\t\t}\n\t\t\t\telse if(data2==8)\n\t\t\t\t{\n\t\t\t\tswal({title: \"Invalid File!\",text: \"Only .jpg files allowed.\", type: \"error\"});\n\t\t\t\t\t$(\"form\")[1].reset();\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tswal({title: \"Error!\",text: \"An undocumented error has occurred.\", type: \"error\"});\n\t\t\t\t\t$(\"form\")[1].reset();\t\n\t\t\t\t}\n\t\t }\n\t });\n\t}", "title": "" }, { "docid": "63a7b8daf1438973425bce9435e5d363", "score": "0.6439772", "text": "function uploadFile(){\r\n\tvar file = _(\"imageUpload\").files[0];\r\n\tvar formdata = new FormData();\r\n\tformdata.append(\"file\", file);\r\n\t_(\"progress-bar\").setAttribute(\"style\", \"width: 0%;\");\r\n\tvar ajax = new XMLHttpRequest();\r\n\tajax.upload.addEventListener(\"progress\", progressHandler, false);\r\n\tajax.addEventListener(\"load\", completeHandler, false);\r\n\tajax.addEventListener(\"error\", errorHandler, false);\r\n\tajax.addEventListener(\"abort\", abortHandler, false);\r\n\tajax.open(\"POST\", \"controls/FoodControl.php/?uploadImage\");\r\n\tajax.send(formdata);\r\n}", "title": "" }, { "docid": "13e42e8db85a2533ab84aee4a1b0bb02", "score": "0.6437603", "text": "function initImageUpload(box) {\n let uploadField = box.querySelector('.image-upload');\n\n uploadField.addEventListener('change', getFile);\n\n function getFile(e){\n let file = e.currentTarget.files[0];\n checkType(file);\n }\n \n function previewImage(file){\n let thumb = box.querySelector('.js--image-preview'),\n reader = new FileReader();\n\n reader.onload = function() {\n thumb.style.backgroundImage = 'url(' + reader.result + ')';\n }\n reader.readAsDataURL(file);\n thumb.className += ' js--no-default';\n }\n\n function checkType(file){\n let imageType = /image.*/;\n if (!file.type.match(imageType)) {\n throw 'Datei ist kein Bild';\n } else if (!file){\n throw 'Kein Bild gewählt';\n } else {\n previewImage(file);\n }\n }\n \n}", "title": "" }, { "docid": "1e3327fce7f30c58cdbdc9255032966c", "score": "0.64368075", "text": "function ValidateFileUpload() {\n\tvar fuData = document.getElementById('fileChooser');\n var FileUploadPath = fuData.value;\n\n\t//To check if user upload any file\n if (FileUploadPath == '') {\n alert(\"Please upload an image\");\n\n } else {\n var Extension = FileUploadPath.substring(FileUploadPath.lastIndexOf('.') + 1).toLowerCase();\n\n\t//The file uploaded is an image\n\n\tif (Extension == \"gif\" || Extension == \"png\" || Extension == \"bmp\" || Extension == \"jpeg\" || Extension == \"jpg\") {\n\t\t// To Display\n\t\tif (fuData.files && fuData.files[0]) {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {$('#avatar').attr('src', e.target.result);}\n\t\t\treader.readAsDataURL(fuData.files[0]);\n\t\t\t}\n } \n\n\t//The file upload is NOT an image\n\telse {\n\t\t\talert(\"Photo only allows file types of GIF, PNG, JPG, JPEG and BMP. \");\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3e265f540fcfc9d5d1ca09c545a9538b", "score": "0.6431998", "text": "function uploadImg(elForm, ev) {\n ev.preventDefault();\n document.getElementById('imgData').value = gCanvas.toDataURL(\"image/jpeg\");\n\n // A function to be called if request succeeds\n function onSuccess(uploadedImgUrl) {\n uploadedImgUrl = encodeURIComponent(uploadedImgUrl)\n document.querySelector('.share-container').innerHTML = `\n <button><a class=\"btn\" href=\"https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}\" title=\"Share on Facebook\" target=\"_blank\" onclick=\"window.open('https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}'); return false;\">\n Share \n </a></button>`\n }\n\n doUploadImg(elForm, onSuccess);\n}", "title": "" }, { "docid": "1e867a8d4bc5986cca0b0469501b939b", "score": "0.6427764", "text": "function imagePreview(input) {\n if (input.files && input.files[0]) {\n var img = document.getElementById('Image').files[0];\n var imageName = img.name;\n var imageExtension = imageName.split('.').pop().toLowerCase();\n if(jQuery.inArray(imageExtension, ['jpg', 'jpeg', 'png']) == -1) {\n alert(\"Invalid Image Type! Only \\\".jpg & jpeg\\\" file types are allowed!\");\n $(\"#btn-submit\").attr('disabled', 'disabled');\n }\n\n else {\n // $(\"#btn-submit\").removeAttr('disabled');\n var imagePv = new FileReader();\n imagePv.onload = function (e) {\n $(\"#image_preview\").attr('src', e.target.result); \n }; \n }\n\n var imageSize = img.size;\n if (imageSize > 12000000) {\n alert(\"Image is too large!\");\n $(\"#btn-submit\").attr('disabled', 'disabled'); \n } \n imagePv.readAsDataURL(input.files[0]); \n }\n}", "title": "" }, { "docid": "d35ad88d9945e194cf611c645d3f763a", "score": "0.64230776", "text": "function uploadImage(formData) {\n $.ajax({\n url: '/report',\n method: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n }).fail(function (status) {\n alert(status);\n });\n }", "title": "" }, { "docid": "c13f01c9c44e37e1d35fc01c4a5383de", "score": "0.6415", "text": "function onPhotoURISuccess(imageURI) {\n\n /*if(!imageURI.includes(\".jpg\") && !imageURI.includes(\".jpeg\") && !imageURI.includes(\".JPG\") && !imageURI.includes(\".JPEG\")) {\n window.plugins.toast.show('Only jpg files are supported!', 'long', 'center',\n function (a) {\n console.log('toast success: ' + a)\n }, function (b) {\n console.log('toast error: ' + b)\n });\n return;\n }*/\n // Show the selected image\n var smallImage = document.getElementById('smallImage');\n smallImage.style.display = 'block';\n smallImage.src = imageURI;\n\n //uploadPhoto();\n}", "title": "" }, { "docid": "3e04b87e8add79afd780b25fb377c7da", "score": "0.6412937", "text": "function upload_profile_pic(){\n\tvar hidden_file_uploaded = document.getElementById(\"prof_image_uploaded\");\n\thidden_file_uploaded.value = \"true\";\n document.getElementById(\"upload_prof_img\").submit();\n}", "title": "" }, { "docid": "f9df8e5ec7cda58df5da8cdf2c4a817b", "score": "0.6412236", "text": "onBeforeUpload(file) {\n // Allow upload files under 10MB, and only in png/jpg/jpeg formats\n if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {\n return true;\n }\n return \"Please upload image, with size equal or less than 10MB\";\n }", "title": "" }, { "docid": "de01f0b4d5aa1e0e11d561cbfbb8332a", "score": "0.6411768", "text": "function uploadImage() {\n var selectedFile = document.getElementById('fileSelector').files[0];\n\n\n var imageId = imageArray.length;\n imageArray.push({\n id: imageId,\n showFullMenuClicked: 0,\n labels: \"\",\n imageName: selectedFile.name,\n favorite: 0\n });\n\n readFileAndFading(selectedFile, imageId);\n}", "title": "" }, { "docid": "837f4904cad8767e7e15f9cad1fd3a11", "score": "0.641039", "text": "function uploadFile(){\n\t\t\tvar _this = this;\n\t\t\tvar files = _this.options.fileInput.files,formData,xhr;\n\t\t\tif(!files.length){\n\t\t\t\treturn\n\t\t\t}\n\t\t \tformData = new FormData();\n\t\t \tformData.append(\"file\",files[0]);\n\t\t \tformData.append(\"extra_params\",JSON.stringify(_this.options.extraParams))\n\t\t \txhr = new XMLHttpRequest();\n\t\t\txhr.open('POST', this.options.url, true);\n\t\t\txhr.onreadystatechange = function () {\n\t\t\t\t if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {\n\t\t\t\t if(_this.options.onUploadSuccess){\n\t\t\t\t \t_this.options.onUploadSuccess.call(window);\n\t\t\t\t }\n\t\t\t\t alert(xhr.responseText);\n\t\t\t\t _this.options.fileInput.value = null;\n\t\t\t\t _this.options.imgPlaceholder.style.display = \"none\";\n\t\t\t\t _this.options.imgPlaceholder.removeAttribute(\"src\");\n\t\t\t\t }\n\t\t\t\t};\n\t\t\txhr.send(formData);\n\n\t\t}", "title": "" }, { "docid": "5e61304664b620a9d862d681cfc6180a", "score": "0.64094", "text": "function insertImage() {\r\n Insert(MediaType.ImageOrVideo);\r\n}", "title": "" }, { "docid": "06d2457126da822b1a8073b01b8eb44a", "score": "0.640773", "text": "function uploadImage (organization) {\n // CHANGE TO USE ENVIRONMENT - REQUEST FROM SERVER\n AWS.config.update({ accessKeyId: $scope.creds.access_key, secretAccessKey: $scope.creds.secret_key });\n AWS.config.region = 'us-east-1';\n var bucket = new AWS.S3({ params: { Bucket: $scope.creds.bucket } });\n console.log($scope.file);\n\n if ($scope.file) {\n // Perform File Size Check First\n var fileSize = Math.round(parseInt($scope.file.size));\n if (fileSize > $scope.sizeLimit) {\n // toastr.error('Sorry, your attachment is too big. <br/> Maximum ' + $scope.fileSizeLabel() + ' file attachment allowed','File Too Large');\n return false;\n }\n // var newName = $scope.user.verification + '_' +\n // $scope.file.name\n\n // SCOPE.FILE.TYPE IS NOT THE .JPG I THINK IT IS, PULL EVERYTHING AFTER THE DOT OFF THE FILE STRING\n var filepath = organization.filepath + $scope.file.name.substr($scope.file.name.lastIndexOf('.'));\n var params = { Key: 'featuredOrganizations/' + filepath, ContentType: $scope.file.type, Body: $scope.file, ServerSideEncryption: 'AES256' };\n organization.image = $scope.prefix + organization.filepath + $scope.file.name.substr($scope.file.name.lastIndexOf('.'));\n\n bucket.putObject(params, function(err, data) {\n if(err) {\n // toastr.error(err.message,err.code);\n console.log(err);\n return false;\n }\n else {\n // Upload Successfully Finished\n // toastr.success('File Uploaded Successfully', 'Done');\n\n // Reset The Progress Bar\n setTimeout(function() {\n $scope.uploadProgress = 0;\n $scope.$digest();\n }, 4000);\n }\n })\n .on('httpUploadProgress',function(progress) {\n $scope.uploadProgress = Math.round(progress.loaded / progress.total * 100);\n $scope.$digest();\n });\n\n }\n else {\n // No File Selected\n console.log('No file submitted');\n //toastr.error('Please select a file to upload');\n }\n }", "title": "" }, { "docid": "715d311d739d06ac6cc6ce36b5925047", "score": "0.64043105", "text": "ldEvtImgInput() {\n // Event upload image of employee\n let uploadImg = document.querySelector('#upload-img');\n $(this.inputAvatar).on('change', function () {\n if (this.files && this.files[0])\n uploadImg.src = URL.createObjectURL(this.files[0]);\n })\n $(uploadImg).click((e) =>{\n this.inputAvatar.click();\n })\n }", "title": "" }, { "docid": "424c28ef7b9ede463b7d35fef9526a34", "score": "0.6401392", "text": "onBeforeUpload(file) {\n // Allow upload files under 5Gb, and only in png/jpg/jpeg formats\n if (file.size <= 1009120 && /png|jpg|jpeg/i.test(file.extension)) {\n return true;\n }\n return 'Please upload image, with size equal or less than 1MB';\n }", "title": "" }, { "docid": "a653a461c2cbddf7fc5b3021f9f474fb", "score": "0.6396295", "text": "function uploadImg(elForm, ev) {\n ev.preventDefault();\n\n document.getElementById('imgData').value = canvas.toDataURL(\"image/jpeg\");\n\n // A function to be called if request succeeds\n function onSuccess(uploadedImgUrl) {\n console.log('uploadedImgUrl', uploadedImgUrl);\n\n uploadedImgUrl = encodeURIComponent(uploadedImgUrl)\n document.querySelector('.share-container').innerHTML = `\n <a class=\"w-inline-block social-share-btn fb\" href=\"https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}\" title=\"Share on Facebook\" target=\"_blank\" onclick=\"window.open('https://www.facebook.com/sharer/sharer.php?u=${uploadedImgUrl}&t=${uploadedImgUrl}'); return false;\">\n Share \n </a>`\n }\n\n doUploadImg(elForm, onSuccess);\n}", "title": "" }, { "docid": "96d2e1bb2cb2554b437baf688b7051bb", "score": "0.6391689", "text": "function uploadImage(moduleAction)\n{\n var url = 'http://'+location.hostname+'/backend.php/';\n var urlUpload = url + moduleAction;\n var btnUpload = $('#boton_agregar');\n var status = $('#mimeError');\n var fileUpload = $('#fileUpload');\n var errorFileSize = $(\"#sizeError\");\n new AjaxUpload(btnUpload,\n {\n action: urlUpload,\n name: 'uploadfile',\n dataType: 'html',\n onSubmit: function(file,ext){\n //Se ocultan los mensajes de error\n fileUpload.hide();\n status.hide();\n errorFileSize.hide();\n\n $('#preLoad').show();\n //if there is an error\n if(!(ext && /^(jpg|JPG|png|PNG|jpeg|JPEG|gif|GIF)$/.test(ext))){\n status.show();\n status.animate({\n opacity: 5000\n }, 0)\n status.animate({\n opacity: 0\n }, 7000);\n $('#preLoad').hide();\n return false;\n }\n\n btnUpload.css(\"display\",\"none\");\n $('#wait').css(\"display\",\"\");\n $('#wait').html(\"&nbsp;&nbsp;Espere mientras la imagen se carga...\");\n return true;\n },\n onComplete: function(file, response){\n //Si hay error en el tamaño de la imagen se muestra el error\n $('#preLoad').hide();\n if(!response){\n /*errorFileSize.show();\n errorFileSize.animate({opacity: 5000}, 0)\n errorFileSize.animate({opacity: 0}, 7000);*/\n }else{\n $('#contenedorFotos').append(response);\n fileUpload.show();\n //Add uploaded file to list\n $('#preLoad').remove().appendTo(\"#contenedorFotos\");\n }\n //$('#no_foto').fadeOut('');\n btnUpload.css(\"display\",\"\");\n $('#wait').css(\"display\",\"none\");\n }\n });\n}", "title": "" }, { "docid": "93a2400e29df2551f9ddc0324bd5a64a", "score": "0.6388795", "text": "function upload(){\n var c1 = document.getElementById(\"c1\");\n var fi = document.getElementById(\"finput\");\n image = new SimpleImage(fi);\n image.drawTo(c1);\n}", "title": "" }, { "docid": "0fe91e057a84232330846549d8c9ea5f", "score": "0.63850677", "text": "onBeforeUpload(file) {\n // Allow upload files under 10MB, and only in png/jpg/jpeg formats\n if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {\n return true;\n }\n return 'Please upload image, with size equal or less than 10MB';\n }", "title": "" }, { "docid": "a176178d6422fb9dc74d5f36cef82ac4", "score": "0.6376019", "text": "handleSubmit(event) {\n event.preventDefault();\n // give us the object for handling form-data aka files from our computer\n const reader = new FileReader();\n // function .onload reads the file and .result converts it to base64.\n const readImage = (file) =>{\n reader.readAsDataURL(file);\n const allowedFileTypes = ['png', 'jpg', 'jpeg', 'gif' ]\n const fileType = file.name.split('.')[1];\n if(allowedFileTypes.includes(fileType)){\n reader.onload = function(){\n setImage(reader.result, file);\n }\n }else{\n alert(\"we only except images\");\n }\n }\n // Sets base64 to state to be previewed.\n // calls setFormData from EditRoute and sets the formData to state there so it can be sent\n //through redux when the route is posted or edited\n let setImage = (base64, file) => {\n this.setState({\n image: base64,\n })\n let formData = new FormData();\n formData.set('abc', file)\n this.props.setFormData(formData)\n }\n // binds this.state and this.props into setImage.\n setImage = setImage.bind(this);\n\n //invokes readImage and passed in the file object that we get from the form.\n readImage(this.fileInput.files[0]) \n }", "title": "" }, { "docid": "cd44be827d717893509b0564fb7262d3", "score": "0.63724506", "text": "async function uploadImage() {\n const input = document.getElementById('imageUpload');\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n img_url = e.target.result;\n document.getElementById(\"img\").src = img_url;\n }\n reader.readAsDataURL(input.files[0]);\n document.getElementById(\"img-sec\").style.display = \"block\";\n }\n}", "title": "" }, { "docid": "039a4e00d66ebee6794ce614f0785f44", "score": "0.6372278", "text": "uploadImage() {\n const self = this;\n this.setState({\n isLoading: true\n });\n\n const avatarData = ReactDOM.findDOMNode(this.refs.avatarPath).files[0],\n avatarPath = ReactDOM.findDOMNode(this.refs.avatarPath).value,\n data = new FormData(),\n re = /(\\.jpg|\\.jpeg|\\.bmp|\\.gif|\\.png)$/i;\n data.append('avatar', avatarData);\n\n if (!re.exec(avatarPath)) {\n alert('File extension not supported!');\n self.setState({\n isLoading: false\n });\n } else if (avatarData.size > 200000) {\n alert('This board is hosted on a potato! File size must be under 20KB.');\n self.setState({\n isLoading: false\n });\n } else {\n $.ajax({\n url: 'api/v1/avatar',\n data: data,\n processData: false,\n contentType: false,\n type: 'POST',\n success: () => {\n self.setState({\n isLoading: false,\n avatar: '../uploads/avatars/' + window.user\n });\n },\n error: () => {\n self.setState({\n isLoading: false\n });\n }\n });\n }\n }", "title": "" }, { "docid": "8e4ce7658b2e0614a39ac5de875576cb", "score": "0.63719666", "text": "function publishSelectedImage(event) {\n\tevent.preventDefault();\n\tvar name = document.getElementById('claim-name-input').value;\n\tvalidateSubmission(stagedFiles, name)\n\t\t.then(function() {\n\t\t\tuploader.submitFiles(stagedFiles); \n\t\t})\n\t\t.catch(function(error) {\n\t\t\tif (error.name === 'FileError'){\n\t\t\t\tshowError('input-error-file-selection', error.message);\n\t\t\t} else if (error.name === 'NameError') {\n\t\t\t\tshowError('input-error-claim-name', error.message);\n\t\t\t} else {\n\t\t\t\tshowError('input-error-publish-submit', error.message);\n\t\t\t}\n\t\t\treturn;\n\t\t})\n}", "title": "" }, { "docid": "8e4ce7658b2e0614a39ac5de875576cb", "score": "0.63719666", "text": "function publishSelectedImage(event) {\n\tevent.preventDefault();\n\tvar name = document.getElementById('claim-name-input').value;\n\tvalidateSubmission(stagedFiles, name)\n\t\t.then(function() {\n\t\t\tuploader.submitFiles(stagedFiles); \n\t\t})\n\t\t.catch(function(error) {\n\t\t\tif (error.name === 'FileError'){\n\t\t\t\tshowError('input-error-file-selection', error.message);\n\t\t\t} else if (error.name === 'NameError') {\n\t\t\t\tshowError('input-error-claim-name', error.message);\n\t\t\t} else {\n\t\t\t\tshowError('input-error-publish-submit', error.message);\n\t\t\t}\n\t\t\treturn;\n\t\t})\n}", "title": "" }, { "docid": "c10cc8612fb0841d73993c133e5de5b9", "score": "0.6369083", "text": "onFileUploadSubmit(e){\n\t\te.preventDefault();\n\t\tconst self = this,\n\t\t\t files = document.getElementById('olyauth.file').files;\n\n\t\t//Users.User.uploadProfileImage({email:this.state.user.email,files})\n\t\t//\t.then(user=>{\n\t\t//\t\tl(this.state.user,user);\n\t\t//\t\tthis.setState({user});\n\t\t//\t\tthis.toggleProfileUpload();\n\t\t//\t});\n\t}", "title": "" }, { "docid": "2255fd51ee85968e29f2f8d495e63bb1", "score": "0.63668376", "text": "function uploadImage(file) {\n var data = new FormData();\n data.append('file', file);\n\n $.ajax({\n url: '/uploadImage',\n data: data,\n processData: false,\n contentType: false,\n type: 'POST',\n success: function (data) {\n insertImageViaLink(data);\n }\n });\n}", "title": "" } ]
d6b55b05a99388e279c37f1e10a09c1c
promesa para poder animar
[ { "docid": "35b2fd72b8bd2f6d0513a2a22eba90af", "score": "0.0", "text": "function sleep(ms) {\n\treturn new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" } ]
[ { "docid": "278f5216f8d8922dfe11c2b5fc772b38", "score": "0.7430408", "text": "function animate(){\n\t// manda a llamarse a si mismo para reproducirse\n\trequestAnimationName(animate);\n\ttime= new Date().getTime()\n\trender();\n\n}", "title": "" }, { "docid": "827b8e80140f8454d67b7e0de638119a", "score": "0.7370727", "text": "animate() {\n }", "title": "" }, { "docid": "827b8e80140f8454d67b7e0de638119a", "score": "0.7370727", "text": "animate() {\n }", "title": "" }, { "docid": "b097d67f9056d725160c8ce521ac5b3b", "score": "0.71851605", "text": "updateAnimations() {\n\n }", "title": "" }, { "docid": "3819aa46b4159f457b20e51ce95bbb26", "score": "0.7131534", "text": "mudaEstado(novoEstado) {\n // toca animação de loop do estado\n let tocarAnimLoop = function(e) {\n if (!!e) {\n e.target.removeEventListener(e.type, tocarAnimLoop);\n }\n this.defineAnimacao(novoEstado.loop);\n }.bind(this);\n \n let tocarAnimPre = (e) => {\n if (!!e) {\n e.target.removeEventListener(e.type, tocarAnimPre);\n }\n // pode haver uma animação de entrada do novo estado (de transição)\n if (typeof novoEstado.pre !== 'undefined') {\n this.defineAnimacao(novoEstado.pre.anim || novoEstado.pre);\n \n let duracaoAnimacaoPre = novoEstado.pre.duracao;\n if (typeof duracaoAnimacaoPre !== 'undefined') {\n // a animação prévia de transição deste estado tem uma duração definida\n setTimeout(() => {\n tocarAnimLoop();\n }, duracaoAnimacaoPre);\n } else {\n // a animação não é infinita e termina por ela mesma\n this.el.addEventListener('animationend', tocarAnimLoop);\n }\n } else {\n // não há uma animação de entrada, então vamos executar a animação de loop\n tocarAnimLoop();\n }\n };\n \n let tocarAnimPos = () => {\n // pode haver uma animação de saída do estado atual\n let animacaoPos = this.estado.pos;\n if (typeof animacaoPos !== 'undefined') {\n this.defineAnimacao(animacaoPos.anim || animacaoPos);\n \n let duracaoAnimacaoPos = animacaoPos.duracao;\n if (typeof duracaoAnimacaoPos !== 'undefined') {\n setTimeout(() => {\n tocarAnimPre();\n }, duracaoAnimacaoPos);\n } else {\n this.el.addEventListener('animationend', tocarAnimPre);\n }\n } else {\n tocarAnimPre();\n }\n };\n \n tocarAnimPos();\n \n switch (novoEstado) {\n case ESTADOS.despencando:\n this.velocidadeY = 0;\n break;\n }\n \n this.estadosAnteriores.unshift(this.estado);\n while (this.estadosAnteriores.length > 3) {\n this.estadosAnteriores.pop();\n }\n this.estado = novoEstado;\n this.tempoNoEstado = 0;\n }", "title": "" }, { "docid": "dfea3667c75d467824931e5ffdaeba73", "score": "0.71064204", "text": "function animcompleted() {\n\t\t\t\t\t\t}", "title": "" }, { "docid": "97d37b579e510207fbc9188f0d8e6e15", "score": "0.7085294", "text": "animate() {\n for(let i = 0; i < this.animations.length; i++) {\n const animation = this.animations[i];\n const finished = animation();\n\n // Usuń zakończoną animację\n if(finished) {\n this.animations.splice(i, 1);\n i--;\n }\n }\n }", "title": "" }, { "docid": "d0192754102242a7a9995d145b1f888b", "score": "0.7083195", "text": "function animate(){\r\n \r\n}", "title": "" }, { "docid": "a6c424b5f4b49dccb478a971cba08ba1", "score": "0.706629", "text": "createAnims(){\n\n }", "title": "" }, { "docid": "1b0bde93312b23009400d7cbc28fa848", "score": "0.69922924", "text": "function animar() {\n intro.className = 'intro texto_intro animacion_intro';\n historia.className = 'historia texto_historia animacion_historia';\n sonido.play();\n}", "title": "" }, { "docid": "b6a12e91c49a5db29d19b785c681af15", "score": "0.69535166", "text": "function animationSelected(){\n}", "title": "" }, { "docid": "463b4752496a3b376c06e252cafc0dd5", "score": "0.6928964", "text": "animate () {\n\n if(this.options.animation.tween) {\n\n this.tween();\n\n } else {\n\n this.basicAnimate();\n\n }\n\n }", "title": "" }, { "docid": "c221b162506dac82bd7da8b4501f712b", "score": "0.6874083", "text": "function initiateAnimation(){\n //either when a button is clicked or user opens the page for the first time or returns back to start.\n if(appType.indexOf('PRIMEWeb') != -1){\n\t\t$('[animStep-button-click]').prop('disabled', true);\n\t}\n $('[animSel-button-click]').prop('disabled', true);\n //disable also role selection filters\n $('[roleFilter-click]').prop('disabled', true);\n $('[roleList-dropdown-click]').prop('disabled', true);\n $('[randomFlow-click]').prop('disabled', true);\n\n canvas = viewer.get('canvas');\n overlays = viewer.get('overlays');\n //timerCoef = 800;\n //butun elemanlarin uzerinden dolasip And diverging gateway olanlari bulup source seqlari ata\n elementRegistry = viewer.get('elementRegistry');\n var allElements = elementRegistry.getAll();\n setConvergingParallelGatewayArray(allElements);\n markSeqInOrder();\n}", "title": "" }, { "docid": "8e2bb133bbe989b06dc9b627b1404472", "score": "0.6861517", "text": "function animate() {\r\n mainUpdate();\r\n }", "title": "" }, { "docid": "e201fa1b8078c31bf473edc36892aa24", "score": "0.6840317", "text": "animate(){\n\t\ttry{\n\t\t\t//slow down\n\t\t\t//setTimeout(() => {\n\t\t\t\trequestAnimationFrame(this.animate)\n\t\t\t//}, 2000)\n\t\t\tthis.render()\n\t\t}catch(e){\n\t\t\tconsole.error('get error in animate:', e)\n\t\t}\n\t}", "title": "" }, { "docid": "904e3886512ff9a205164fc559cadf42", "score": "0.6837028", "text": "animate(t) { return this.update(t); }", "title": "" }, { "docid": "900fdc2d1d799c5634398b02906cd7a6", "score": "0.6834481", "text": "function animate(){\n\n\ttimeoutid = window.requestAnimFrame(animate);\n\trender(0);\n\n\n}", "title": "" }, { "docid": "e4d1a0fdf3df0707cbcf5466e14169de", "score": "0.68131804", "text": "function animate() {\n\n\t\tif(!close){\n\t\t\tif(mixer.ativo){\n\t\t\t\tmixer.update(clock.getDelta());\n\t\t\t}\n\t\t\tif(mixer2.ativo){\n\t\t\t\tmixer2.update(clock.getDelta());\n\t\t\t}\n\t\t\tif(mixer3.ativo){\n\t\t\t\tmixer3.update(clock.getDelta());\n\t\t\t}\n\t\t\tif(mixer4.ativo){\n\t\t\t\tmixer4.update(clock.getDelta());\n\t\t\t}\n\t\t\tif(mixer5.ativo){\n\t\t\t\tmixer5.update(clock.getDelta());\n\t\t\t}\n\t\t\tif(mixer6.ativo){\n\t\t\t\tmixer6.update(clock.getDelta());\n\t\t\t}\n\t\t\tif(mixer7.ativo){\n\t\t\t\tmixer7.update(clock.getDelta());\n\t\t\t}\n\t\t}\n\n\n\trender();\n\tdetectColision();\n\n\tif(isActiveAuto === true){\n\t\tcrono++;\n\t\tdrawPath();\n\t}else{\n\t\tcrono = 0;\n\t} \n\t// console.log(\"X\" + controls.getObject().position.x);\n\t// console.log(\"Z\" + controls.getObject().position.z);\n\t// console.log('R' + controls.getObject().rotation.y + \"H\");\n\t\n\trequestAnimationFrame( animate );\t\n}", "title": "" }, { "docid": "6757a6254f056351db7d0659e5b3857b", "score": "0.6798864", "text": "changeAnimation() {\n // no animation for now.\n }", "title": "" }, { "docid": "874fd6cfe016bb328947b970d91c70c9", "score": "0.67832804", "text": "onAnimateEnd_() {\n this.stopAnimation_();\n }", "title": "" }, { "docid": "3bc43ae39848f1b79ddfddad91fdc77e", "score": "0.67828137", "text": "_animate() {\r\n this.animations.forEach(( animation ) => {\r\n animation.css.forEach(( cssName ) => {\r\n this._toggleAnimation( animation.element, cssName );\r\n });\r\n });\r\n }", "title": "" }, { "docid": "0801e4e313c802801afde6202a6a0fbd", "score": "0.67764467", "text": "function animate() {\n\treset_single();\n\tshow_metric();\n}", "title": "" }, { "docid": "127447d3c6145e76d7ca24932a624de0", "score": "0.6748973", "text": "notifyAnimationEnd() {}", "title": "" }, { "docid": "d44ebb38d3f23651621154f63a9324e9", "score": "0.67169225", "text": "function animateHopD(){\n animateHop(Date.now(),1);\n }", "title": "" }, { "docid": "c51fc2d1c2d34f8cf726a11ed99b478d", "score": "0.6707824", "text": "static StartAnimationMode() {}", "title": "" }, { "docid": "4364baa756a61e9763ea64df64772e75", "score": "0.6681086", "text": "animate() {\n this.trackItems = false;\n this.animation = () => { this._update() };\n this.scene.registerBeforeRender( this.animation );\n }", "title": "" }, { "docid": "d921503ddd1c173d8c79cb8ab6eb1f8b", "score": "0.66709596", "text": "function agrandarNot(){ //animacion para el boton del carrito al ser vaciado se agrande y se vea rojo\n\n not.animate({\n width: \"80px\",\n height: \"80px\"\n },200).css({backgroundColor: \"red\"})\n\n}", "title": "" }, { "docid": "5b812c6340221a2f94e4077775f628ff", "score": "0.6640494", "text": "function AnimationHelper()\n{\n}", "title": "" }, { "docid": "91000a7d0a5ae607ef7537b66058793e", "score": "0.6609717", "text": "function onAnimateProgress(){\n\t\tg_temp.lastPos = g_parent.getInnerStripPos();\n\t\tg_parent.triggerStripMoveEvent();\n\t}", "title": "" }, { "docid": "ed2b2c997d11c58f4267018873112a03", "score": "0.66052264", "text": "function anim() {\n if (carrox == -40 ) {\n carrox =500;\n anim()\n }else{\n carrox -= 4;\n setTimeout(anim, 25);\n dibujar()\n }\n }", "title": "" }, { "docid": "7211274b9a09b7dc5e76ccd9cf3d3fc7", "score": "0.6599714", "text": "function animate() { engine.driver.update();}", "title": "" }, { "docid": "4a63c8f2f0fcca25781071f58dee4cc7", "score": "0.6592518", "text": "animate () {\n // Zoom v in\n this.zoomIn()\n .then(() => {\n this.shakeAll(0.3, 2)\n this.minisIn() // Send out the minis\n\n return this.spreadOut(0.5, 1)\n })\n .then(() => {\n this.spin(1.3)\n this.scaleOutAll(1)\n .then(() => {\n return this.scaleInAll(0.3)\n })\n\n return this.openV(1)\n .then(() => {\n return this.closeV(0.3)\n .then(() => {\n this.minisOut()\n return this.shakeAll(0.3, 5)\n })\n })\n })\n .then(() => {\n // Animate text in\n this.linkTextFadeIn()\n\n this.slideAllUp()\n this.slideSloganUp()\n\n // Tell localstorage that you watched this already\n localStorage.setItem('didShowIntro', true)\n })\n }", "title": "" }, { "docid": "b503c643be35bdff124c89ee96e04c7b", "score": "0.65880454", "text": "crearAnimacionVerTodo(tiempo = 10000) {\n\t var origen = {x:0};\n\t var destino = {x:1};\n\n\t this.animacionVerTodo = new TWEEN.Tween(origen).to(destino, tiempo);\n\n\t var that = this;\n\t this.animacionVerTodo\n\t .onStart(function(){\n\t\t // that.camino.apariencia.material.transparent = true;\n\t\t that.camino.apariencia.material.opacity = 0.3;\n\t\t that.mensaje = \"Ahora puedes ver el futuro, aprovecha!!\";\n\t })\n\t .onComplete(function(){\n\t\t // that.camino.apariencia.material.transparent = false;\n\t\t that.camino.apariencia.material.opacity = 0.8;\n\t\t that.mensaje = \" \";\n\t });\n }", "title": "" }, { "docid": "10e5b2f2342cab4b826475cf53260407", "score": "0.6581338", "text": "updateAnimation(){\n this.time+= .008;\n if(this.time >=this.duration){\n this.resetAnimation(120,0);\n }else{\n var eyeProgress = this.endPosEye.sub(this.startPosEye).mul(this.time).add(this.startPosEye);\n var centerProgress = this.endPosCenter.sub(this.startPosCenter).mul(this.time).add(this.startPosCenter);\n this.eye = eyeProgress;\n this.center = centerProgress;\n this.updateView();\n }\n\n\n }", "title": "" }, { "docid": "9a431907fea2e69761f2fccaa38e6c58", "score": "0.65783846", "text": "animate(duration) {\n this.redraw = true;\n this.animated = true; //used to set duration as 1000 for animation at default 300\n this.duration = duration ? duration : 1000;\n }", "title": "" }, { "docid": "bc8f4814b691f5e39b40f61f15801caa", "score": "0.65751666", "text": "onAnimate(progress, animation) {\n // Override in derived class to do necessary calculations in drawing providers\n }", "title": "" }, { "docid": "6ec0559c413c46c8014fd8777d64a70d", "score": "0.6573531", "text": "function animationHelper()\n{\n\tcount = 1;\n\tScript.update.connect(play);\n}", "title": "" }, { "docid": "801bfe3c93cf50e96dba343e4d8707ab", "score": "0.6571249", "text": "function endanim(e, index) {\n // Identification de l'objet de donnees\n var data = Data.convertlist[index];\n if (data != null) {\n var a = Boolean(data.parent.getAttribute('data-callback'));\n // Nettoyage des styles CSS de l'animation\n data.container.style.height = '';\n data.content.style.display = '';\n data.content.style.opacity = '';\n data.parent.removeAttribute('data-callback');\n data.parent.removeAttribute('data-noanim');\n // Lancement de l'appel \"callback\" si besoin\n if (a)\n data.callback.afteranim(\n null,\n data,\n !(data.parent.getAttribute('data-expanded') === 'true')\n );\n }\n }", "title": "" }, { "docid": "f614e4390ab38118f9f0945bf03fa0f8", "score": "0.6569632", "text": "function startNewAnimation(){\n animation = setUpAnimation(config, onUpdateCallback, onCompleteCallback, objRef);\n }", "title": "" }, { "docid": "ffe953231ada976c15e63ad08abaae27", "score": "0.65608686", "text": "function animate() {\r\n\t\r\n\tvar anim = new TimelineLite({onStart:showAnim});\r\n\r\n\r\n\t// frame 00\r\n\t// registers frame for clickTags - if single clickTag only use frame00. If multiple, use frame01, frame02 etc as required, with frame00 for endframe\r\n\tanim.call(regFrame, [\"frame00\"]);\r\n\t\t\t\r\n\tanim.to([\"#loader\",\"#blank\"], 0.5, {autoAlpha:0, ease: Quad.easeOut});\r\n\t\r\n\t//anim.staggerFrom([\"#handset-06\",\"#handset-05\",\"#handset-04\",\"#handset-03\",\"#handset-02\",\"#handset-01\"], 0.5, {x:-200, ease:Power2.easeOut}, 0.15);\r\n\r\n\tanim.to(\"#txt-00\", 0.5, {alpha:0, ease: Quad.easeOut},\"+=2.5\");\r\n\r\n\t\r\n\tanim.from(\"#txt-02\", 0.5, {alpha:0, ease: Quad.easeOut},\"+=0\")\r\n\t.to(\"#handset\", 0.5, {x:-100, ease: Quad.easeOut},\"-=0.5\")\r\n\t\t.from(\"#roundel-01\", 0.5, {alpha:0, scale:2, ease: Back.easeOut},\"+=0.5\")\r\n\t\t.from([\"#cta-01\", \"#termsBtn\"], 0.5, {autoAlpha:0, ease:Power2.easeOut},\"+=0.5\");\r\n\t\r\n\tanim.to(\"#cta-01\", 0.15, {x: \"+=10\"}, \"+=0.5\")\r\n\t\t\t.to(\"#cta-01\", 0.15, {x: \"-=10\"})\r\n\t\t\t.to(\"#cta-01\", 0.15, {x: \"+=10\"})\r\n\t\t\t.to(\"#cta-01\", 0.15, {x: \"-=10\"});\r\n\t\r\n\t\r\n\t\r\n\r\n\r\n\t\r\n/*\tanim.from(\"#pig\",1, {x:-180, y:+200, ease: Power1.easeOut},\"+=0.2\")\r\n\t\t.from(\"#sun-01\",0.35, {alpha:0, scale:0, ease: Power1.easeOut},\"-=0.2\")\r\n\t\t.from(\"#sun-02\",0.35, {alpha:0, scale:0, ease: Power1.easeOut},\"+=0.5\")*/\r\n\t\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\t\r\n\r\n\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\r\n}", "title": "" }, { "docid": "3bdf636cab5a2d7cbe920525922c2b38", "score": "0.6555385", "text": "function onTimerTick() {\r\n advanceAnimation();\r\n}", "title": "" }, { "docid": "47724d8e73f0a7981e9d8b81d5dee6bc", "score": "0.65360624", "text": "function doAnimation(e){\n\n\t$('#' + e + ' .fondo').velocity({\n\t\topacity: .3,\n\t},{\n\t\tduration: 500,\n\t\tcomplete: function(){\n\t\t\t$('#' + e + ' .tag').velocity({\n\t\t\t\topacity: 1,\n\t\t\t\ttranslateX: 0 + 'px',\n\t\t\t},{\n\t\t\t\tduration: 500,\n\t\t\t});\n\t\t\t$('#' + e + ' .contenido').velocity({\n\t\t\t\topacity: 1,\n\t\t\t\ttranslateX: 0 + 'px',\n\t\t\t},{\n\t\t\t\tduration: 500,\n\t\t\t\tcomplete: function(){\n\t\t\t\t\tanimating = false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6fdd1f8cac0dc94994243ec41dadad45", "score": "0.653228", "text": "function main_animation () {\n\t \n\t // ƒAƒjƒ[ƒVƒ‡ƒ“‚ð”z—ñ‚É‚·‚é\n\t // animation... ƒAƒjƒ[ƒVƒ‡ƒ“‚̊֐”–¼\n\t // interval... ƒAƒjƒ[ƒVƒ‡ƒ“ŽÀs‚©‚çAŽŸ‚̃Aƒjƒ[ƒVƒ‡ƒ“‚ªŽÀs‚³‚ê‚é‚܂ł̎žŠÔ·iƒ~ƒŠ•bj\n\t\t\tvar timeline = [\n\t\t\t\t{animation:imgEleAnimationStart, interval:2500},\n\t\t\t\t{animation:imgEleMessageAnimationStart, interval:4000},\n\t\t\t\t{animation:imgEleAnimationEnd, interval:500},\n\t\t\t\t{animation:imgNetAnimationStart, interval:2500},\n\t\t\t\t{animation:imganimeNetMessageStart, interval:4000},\n\t\t\t\t{animation:imgNetAnimationEnd, interval:500}, \n\t\t\t\t{animation:imgHumAnimationStart, interval:2500},\n\t\t\t\t{animation:imganimeHumMessageStart, interval:4000},\n\t\t\t\t{animation:imgHumAnimationEnd, interval:500},\n\t\t\t\t{animation:imgWebAnimationStart, interval:2500},\n\t\t\t\t{animation:imganimeWebMessageStart, interval:4000},\n\t\t\t\t{animation:imgWebAnimationEnd, interval:500},\n\t\t\t\t{animation:imgInit, interval:500} /*,\n\t\t\t\t{animation:imgEleTowerAnimation, interval:500},\n\t\t\t\t{animation:imgEleTunderAnimation, interval:500},\n\t\t\t\t{animation:imgEleDenchuAnimation, interval:500},\n\t {animation:show_bg_2, interval:1000},\n\t {animation:show_text_2, interval:9000},\n\t {animation:show_bg_3, interval:1000},\n\t {animation:show_text_3, interval:5000}*/\n\t\t\t];\n\t \n\t\t\t// Å‰‚̃Aƒjƒ[ƒVƒ‡ƒ“‚ªŽn‚Ü‚é‚܂ł̎žŠÔ\n\t\t\tvar interval_sum = 100;\n\t \n\t\t\t// ƒAƒjƒ[ƒVƒ‡ƒ“‚ðã‚©‚珇‚ÉŽÀs‚µ‚Ä‚¢‚­\n\t\t\t// interval‚Ì’l‚͂ǂñ‚Ç‚ñ‰ÁŽZ‚³‚ê‚āA\n\t\t\t// setTimeout()ŠÖ”‚É‚æ‚莞ŠÔ‚ð‚¸‚ç‚µ‚È‚ª‚çŽÀs‚³‚ê‚é\n\t\t\tvar len = timeline.length;\n\t\t\tfor(var i=0; i<len; i++){\n\t\t\t\n\t\t\t\tsetTimeout(timeline[i].animation, interval_sum);\n\t\t\t\tinterval_sum += timeline[i].interval;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8c50e4873a3711ae09bc7d9d4cdddb29", "score": "0.65299994", "text": "crearAnimacionEliminarObstaculos(tiempo = 5000) {\n\t var origen = {x:0};\n\t var destino = {x:1};\n\n\t this.animacionEliminarObstaculos = new TWEEN.Tween(origen).to(destino, tiempo);\n\n\t var that = this;\n\t this.animacionEliminarObstaculos\n\t .onStart(function() {\n\t\t // a partir de ahora se podran clicar los obstaculos\n\t \t\tthat.pickable = that.camino.obstaculosGenerados;\n\t\t\tthat.camino.apariencia.material.color.setHex(0xffff00);\n\t\t\tthat.mensaje = \"Toca los objetos para destruirlos y ganar puntos\";\n\t })\n\t .onComplete(function() {\n\t\t // clicar de nuevo las recompensas\n\t \t \tthat.pickable = that.camino.recompensasGeneradas;\n\t\t\tthat.camino.apariencia.material.color.setHex(0x0000ff);\n\t\t\tthat.mensaje = \" \";\n\t });\n }", "title": "" }, { "docid": "e5ddca0befe63ecdf3794fa5d86ccf8b", "score": "0.6527882", "text": "playIdle(){\nlet index = floor(this.index/2) % this.len_idle;\n\npush();\nscale(this.scale)\nimage(this.animation_idle[index],this.x,this.y); //11\npop();\n }", "title": "" }, { "docid": "0a14dd55b0475263e2e522e293a8b306", "score": "0.6527047", "text": "function seguir(){\n block.style.animationPlayState=\"running\";\n block.style.WebkitAnimationPlayState=\"running\";\n}", "title": "" }, { "docid": "e2197fefcd195126f920d014b224b067", "score": "0.6512528", "text": "animation() {\n\t\tif (control.time % SPEED_ROBOTS === 0) {\n\t\t\tsuper.animation();\n\t\t}\n\t}", "title": "" }, { "docid": "6829d1fc8f6680710d3533cda6a0e89c", "score": "0.65081054", "text": "function animate() {\n\trequestAnimFrame( animate );\n\tgame.anthill.listen();\n\tgame.anthill.antPool.animate();\n\tgame.foods.listen();\n\t//game.jail.checkAnts();\n\tgame.texts.fpsUpdate();\n}", "title": "" }, { "docid": "777f937530d8890a0b8d8cc04d3005fe", "score": "0.64987063", "text": "animate(){\r\n this.speed += 0.05;\r\n }", "title": "" }, { "docid": "c9f129b4d2effb081a8a228fbd700b0c", "score": "0.6489044", "text": "function megaManAnimation() {\n\n if (frames % 20 === 0) {\n if (megaMan.animate === 16) {\n megaMan.animate = 0\n } else {\n megaMan.animate++\n }\n\n console.log(\"frames inicio\", frames)\n \n\n // if(megaMan2.animate > 0){\n // megaMan2.animate = 0\n // }else {\n // frames++\n // }\n }\n \n }", "title": "" }, { "docid": "63633531854cb50ddc2461dae5c8b2a1", "score": "0.64846045", "text": "function animate() {\n //clear\n //update\n //draw\n\n if (playAnimation) {\n requestAnimFrame(animate);\n }\n}", "title": "" }, { "docid": "503676e7d72e1bdcee10ad88dc0ead3a", "score": "0.6484576", "text": "function _animate() {\n\n\t\t\tvar sys = $obj.data('system'),\n\t\t\t\tnext = (sys.idx + 1 > o.images.length - 1 ? 1 : sys.idx + 1),\n\t\t\t\tcurImg = $obj.attr('id') + '_IMG_' + sys.idx,\n\t\t\t\tnextImg = $obj.attr('id') + '_IMG_' + next;\n\n\t\t\t// increase our index\n\t\t\tsys.idx = next;\n\n\t\t\t$obj.find('.cjImageVideoPreviewer img#' + nextImg).css({\n\t\t\t\tdisplay: 'block'\n\t\t\t});\n\t\t\t$obj.find('.cjImageVideoPreviewer img#' + curImg).css({\n\t\t\t\tdisplay: 'none'\n\t\t\t});\n\t\t\t_clear();\n\n\t\t\t// let's make sure that the mouse is still over our element before we set another timer\n\t\t\tif (sys.mouseX >= $obj.offset().left && sys.mouseX <= $obj.offset().left + $obj.width() && sys.mouseY >= $obj.offset().top && sys.mouseY <= $obj.offset().top + $obj.height()) {\n\t\t\t\tsys.timer = window.setTimeout(_animate, o.delay);\n\t\t\t} else {\n\t\t\t\t_stop();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "85fb505d02602196fc30400334b10308", "score": "0.6475801", "text": "function animationComplete() {\n\t\t\n\t}", "title": "" }, { "docid": "4da28b5d8c980c238446f7f100290275", "score": "0.64631784", "text": "animate() {\n\t\tvar drawPart = this.drawSteps[this.sharedUser.lives];\n\t\teval('this.' + drawPart + '()');\n\t}", "title": "" }, { "docid": "9a5522b941e95d05cbd2d536f4a7fcb7", "score": "0.64477986", "text": "function Logoanimation(){\r\n type = 1;\r\n frameNumber = 0;\r\n}", "title": "" }, { "docid": "daffdab575e2aaee41533acbe5a76cdf", "score": "0.6446664", "text": "animate(conf) {\r\n\t let self = this;\r\n\t conf.obj.__animations = conf.obj.__animations || {};\r\n\t // TODO: remove generator function to make code es5 targetable\r\n\t conf.obj.__animations[conf.prop] = (function* () {\r\n\t let time = 0;\r\n\t while (time < conf.duration) {\r\n\t let dt = yield null;\r\n\t time += dt;\r\n\t let new_v = conf.easing(time, conf.start_v, conf.d_v, conf.duration);\r\n\t conf.obj[conf.prop] = new_v;\r\n\t }\r\n\t })();\r\n\t conf.obj[conf.prop] = conf.start_v;\r\n\t this.ticker.add(tick);\r\n\t function tick(dt) {\r\n\t let done = true;\r\n\t let anim = conf.obj.__animations[conf.prop];\r\n\t if (anim) {\r\n\t done = anim.next(dt).done;\r\n\t }\r\n\t if (done) {\r\n\t self.ticker.remove(tick);\r\n\t }\r\n\t }\r\n\t }", "title": "" }, { "docid": "9b8db3c6f7d6ac2f1ed7018d226c4c4a", "score": "0.6439207", "text": "function animate() {\n\t\t\tdelta = clock.getDelta();\n\t\t\t// deltaSum += delta;\n\n\t\t\tif (!paused) {\n\t\t\t\t// console.log(delta);\n\n\t\t\t\tfor (let i = 0; i < points.length; i++) {\n\t\t\t\t\tif (i % 6 == 0) {\n\t\t\t\t\t\tif (flagArray[i] == false) {\n\t\t\t\t\t\t\tstartingAnimation(i);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// mainAnimation(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// console.log(flagArray[i]);\n\n\t\t\t\t\t\topacityAnimation(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tgeometry.attributes.position.needsUpdate = true;\n\t\t\t\tgeometry.verticesNeedUpdate = true;\n\t\t\t\tlines.material.uniforms.uniformsNeedUpdate = true;\n\t\t\t\t// arcMaterial.uniforms.uniformsNeedUpdate = true;\n\t\t\t\t/* ANIMATE CAMERA */\n\t\t\t\tcamera.rotation.x = -mouse.y * 0.00002;\n\t\t\t\tcamera.rotation.y = -mouse.x * 0.00002;\n\t\t\t\trequestAnimationFrame(animate);\n\t\t\t} else {\n\t\t\t\tstop();\n\t\t\t}\n\n\t\t\trender();\n\t\t}", "title": "" }, { "docid": "b69763e784ee431707ea6d5214f70856", "score": "0.64383686", "text": "play(){this.__stopped=!0;this.toggleAnimation()}", "title": "" }, { "docid": "c14aff509559bf7ec1043e8678c16fa6", "score": "0.6434723", "text": "function animatie() {\t\n\tif (stap < 12) {\n\t\ttekenGalgje();\n\t\tsetTimeout(animatie,1000);\n\t\tstap++;\n\t}\n\telse {\n\t\t$('#status').html('Je hangt !!<br><button id=\"start\" onclick=\"galgje();\">Start spel</button>');\n\t}\n}", "title": "" }, { "docid": "058efaf4baeda2cee38c45c3d49c893c", "score": "0.6426866", "text": "addAnimation(anim) {\n this.anim = anim;\n }", "title": "" }, { "docid": "82db64abe1a33ed99b184c1f23f9098d", "score": "0.6423734", "text": "function Myanimation(){\r\n type = 0;\r\n frameNumber = 0;\r\n}", "title": "" }, { "docid": "460662599e276830b6ac2f7c98bc0d9e", "score": "0.6417098", "text": "crearAnimacionRecorrido() {\n\t // origen y destino son realmente simbolicos\n\t var origen = {y: 0.0};\n\t var destino = {y: 1.0};\n\n\t // nos sirve para manejar mejor el tiempo del recorrido\n\t var factor = 1.25;\n\n\t // el tiempo varia en funcion del numero de puntos y la longitud maxima\n\t // se usa el factor para corregir y \"1000\" son los milisegundos por segundo\n\t var tiempoEnMs = 1000 * (this.puntos + this.longitud) * factor;\n\n\t // se crean dos animaciones que se encadenaran mas tarde para poder\n\t // crear un bucle anidado entre ellas que nos permite definir comportamientos\n\t // al finalizar la animacion, qué hacer mientras se está actualizando, etc\n\t this.recorrerCamino = new TWEEN.Tween(origen).to(destino, tiempoEnMs);\n\t this.recorrerSiguiente = new TWEEN.Tween(origen).to(destino, tiempoEnMs);\n\n\t var that = this;\n\n\t this.recorrerCamino\n\t .onStart(function() {\n\t\t origen.y = 0.0;\n\t })\n\t .onUpdate(function(){\n\t\t that.actualizaPosicionEnSpline(that.personaje, that.camino.getSpline(), origen.y);\n\t })\n\t .onComplete(function(){\n\t\t origen.y = 0.0;\n\t\t that.nuevoNivel();\n\n\t\t // cuando se completa un nivel, se suma el bonus\n\t\t this.puntuacion += this.bonusNivel;\n\t })\n\t .chain(this.recorrerSiguiente);\n\n\n\t this.recorrerSiguiente\n\t .onStart(function(){\n\t\t origen.y = 0.0;\n\t })\n\t .onUpdate(function(){\n\t\t that.actualizaPosicionEnSpline(that.personaje, that.camino.getSpline(), origen.y);\n\t })\n\t .onComplete(function(){\n\t\t origen.y = 0.0;\n\t\t that.nuevoNivel();\n\n\t\t // cuando se completa un nivel, se suma el bonus\n\t\t this.puntuacion += this.bonusNivel;\n\t })\n\t .chain(this.recorrerCamino);\n }", "title": "" }, { "docid": "603b7f17fc34124140fc854738e8988f", "score": "0.6414357", "text": "addanimation(val, x, y) {\n this.setState({\n xCor: x,\n yCor: y\n })\n if (val) {\n let animateRow = document.getElementsByClassName(\"animateRow\")\n animateRow[0].classList.add(\"animateRowZIndex\")\n let animation = document.getElementsByClassName(\"animateId\")\n animation[0].classList.add(\"animateWishlistButton\");\n setTimeout(() => {\n animateRow[0].classList.remove(\"animateRowZIndex\")\n animation[0].classList.remove(\"animateWishlistButton\");\n }, 1000)\n\n }\n }", "title": "" }, { "docid": "2c50d1a2c476b18d81717413f0201968", "score": "0.64043695", "text": "function animaminas() {\n //minas 1\n var tod1 = document.getElementsByClassName(\"minas1\")\n for (i = 0; i < tod1.length; i++) {\n numer = tod1[i].anima\n numer += 1\n if (numer > 10) {\n numer = 0\n }\n\n if (numer <= 5) {\n tod1[i].style.backgroundColor = \"rgba(0,255,0,1)\"\n }\n else {\n tod1[i].style.backgroundColor = \"rgba(1,1,1,0)\";\n }\n tod1[i].anima = numer\n }\n\n //minas 2\n var tod2 = document.getElementsByClassName(\"minas2\")\n for (i = 0; i < tod2.length; i++) {\n numer = tod2[i].anima\n numer += 1\n if (numer > 10) {\n numer = 0\n }\n\n if (numer <= 5) {\n tod2[i].style.backgroundColor = \"rgba(255,102,255,1)\"\n }\n else {\n tod2[i].style.backgroundColor = \"rgba(1,1,1,0)\";\n }\n tod2[i].anima = numer\n }\n\n setTimeout(\"animaminas()\", 100)\n}", "title": "" }, { "docid": "103992cc8c43fcadaf1ba5e69632700a", "score": "0.64011556", "text": "function animateMainBanner(){\n \n //「00_gaijin_san_11.psd」を右下に「rotateinUpRight」で登場させ後に(ページが読み込んでから6秒)、「zoomOutRight」で右にはける\n var newLoop = setInterval(function(){\n $(\".position08\").removeClass(\"rotateInUpRight\");\n $(\".position08\").css(\"opacity\", 1);\n $(\".position08\").css(\"animation-delay\", \"0s\");\n $(\".position08\").addClass(\"zoomOutRight\");\n clearInterval(newLoop);\n }, 6000);\n \n // 星のおじさんを一人ずつ飛ぶようにする\n var numberOfStars = $(\".toFly\").length;//星のおじさんの数\n var animationTime = 2;\n var allStarsOver = numberOfStars * animationTime * 1000;//おじさんが全員一回飛び終わった時間\n \n refreshStarsDelay();\n \n // おじさんが全員一回飛び終わった後に、アニメーションを再実行する\n var restartLoop = setInterval(function(){\n refreshStarsDelay();\n }, allStarsOver);\n \n function refreshStarsDelay(){//\n $(\".flyingStar\").removeClass(\"flyingStar\");\n $(\".toFly\")[0].offsetWidth = $(\".toFly\")[0].offsetWidth;\n $(\".toFly\").addClass(\"flyingStar\");\n }\n \n \n}", "title": "" }, { "docid": "165652cd2fff0378441c7d7eb4537d69", "score": "0.6388946", "text": "hikesExtraAnim(){\n gsap.from('.hike-h1', {opacity:0, y:-50, ease: \"power1\", duration: 0.6})\n gsap.from('.filter-menu div', {opacity:0, y:50, ease: \"power1\", duration: 0.6}, \"-=1\")\n gsap.from('.clear-fltr', {opacity:0, y:50, ease: \"power1\", duration: 0.6}, \"-=1\")\n gsap.from('.hike-card', {opacity:0, y:-60, ease: \"slow\", duration: 1, stagger: 0.5})\n }", "title": "" }, { "docid": "688f1cd6dce86868ea2de41aaf5e83e4", "score": "0.6381449", "text": "favExtraAnim(){\n gsap.from('.fav-h1', {opacity:0, y:-50, ease: \"power1\", duration: 0.6})\n //gsap.from('.fav-grid .fav-card', {opacity:0, y:-60, ease: \"back\", duration: 1, stagger: 0.5})\n }", "title": "" }, { "docid": "3a124003b890be1456aeb8adb7cf74ce", "score": "0.6374034", "text": "function mostrarAnimacionBan(){\n let animadoIzquierdaBanner = document.getElementById(\"animadoIzquierdaBanner\");\n animadoIzquierdaBanner.style.opacity = 1;\n animadoIzquierdaBanner.classList.add(\"mostraIzquierda\");\n}", "title": "" }, { "docid": "422151599fea461757b8fe2dfbde872c", "score": "0.6372372", "text": "function animate(){\n /** Get timelapse since last frame in sec. */\n var lapse = Date.now() - previousTime;\n previousTime = previousTime + lapse;\n lapse /= 1000.0;\n\n /** Update physics and views. */\n physicsUpdate(lapse);\n viewUpdateMatrix();\n\n /** Call animate functions. */\n for(var i = 0; i < shaderPrefix.length; i++){\n animateFunctions[shaderPrefix[i]](lapse);\n }\n}", "title": "" }, { "docid": "46858cdcaec92368de558deadd68d552", "score": "0.63635266", "text": "stop(){this.__stopped=!1;this.toggleAnimation()}", "title": "" }, { "docid": "04a0c42ab34a5770f4f1fc73c1a7a115", "score": "0.6362986", "text": "function animate()\n{\n\tif (currentFrame === maxFrames)\n\t{\n\t\tframeIndex++;\n\t\tcurrentFrame = 0;\n\t\tif (frameIndex == 4)\n\t\t{\n\t\t\tif(stageArrival)\n\t\t\t\t{\n\t\t\t\t\tplayer.img = images[0];\n\t\t\t\t\tstageArrival = false;\t\t\t\t\t\n\t\t\t\t}\n\t\t\tframeIndex = 0;\n\t\t}\n\t}\n\tcurrentFrame++;\n}", "title": "" }, { "docid": "a15f2eefd2491129fa666ca412bfb901", "score": "0.63613236", "text": "function animateIn(int){\n if(index == 0){\n animatedItems[index].className += ' moved';\n // int +=1;\n // index = int;\n }\n else{\n console.log('line 237: index= '+int);\n animatedItems[int].className += ' moved';\n animatedItems[int-1].className = 'textItem movedOut';\n // int +=1;\n // index = int;\n }\n }", "title": "" }, { "docid": "9d054750707dd4f4c2aa1d6a66b85e30", "score": "0.6357542", "text": "start_pulsate() {\n this.jel.animate({'background-color': 'yellow'},\n { duration: 400,\n complete: () => {\n this.jel.animate({'background-color': ''},\n { duration: 400,\n complete: () => { this.start_pulsate() } } )\n } } )\n }", "title": "" }, { "docid": "5915b4884ba636134e7ea3a0df89a763", "score": "0.63572323", "text": "function startAnimation() {\n //si es movil\n if ( window.innerWidth < 768 ) {\n setTimeout(function(){\n $('.header-images-wrapper').addClass('header-images-wrapper-open');\n $('.header-wrapper').addClass('header-wrapper-open');\n $('.header-wrapper .sol-movil').addClass('sol-move-up');\n $('.header-wrapper .girl-movil').addClass('girl-fade');\n $('.title-header').addClass('title-header-open');\n loadImage ( $('.title-arrow'), agregaClase($('.title-arrow'),'slide-down') );\n },1000);\n\n } else {\n setTimeout(function(){\n $('.header-images-wrapper').addClass('header-images-wrapper-open');\n $('.header-wrapper').addClass('header-wrapper-open');\n \n $('.header-wrapper .sol').addClass('sol-move-up');\n $('.header-wrapper .girl').addClass('girl-fade');\n $('.title-header').addClass('title-header-open');\n loadImage ( $('.title-arrow'), agregaClase($('.title-arrow'),'slide-down') );\n },1000);\n }\n }", "title": "" }, { "docid": "e17b85daa46455e76f1bdcdf6dd01c15", "score": "0.63555086", "text": "crearAnimacionVidaExtra(tiempo = 1000) {\n\t var origen = {x:0};\n\t var destino = {x:1};\n\n\t this.animacionVidaExtra = new TWEEN.Tween(origen).to(destino, tiempo);\n\n\t var that = this;\n\t this.animacionVidaExtra\n\t .onStart(function() {\n\t\t \t// Cambiar color a verde a modo de notificacion al usuario\n\t\t\tthat.camino.apariencia.material.color.setHex(0x00FF00);\n\t\t\tthat.personaje.vidas++;\t// actualizar numero de vidas\n\t\t\tthat.mensaje = \"Has gando una vida, sigue así!!\";\n\t })\n\t .onComplete(function() {\n\t\t \t// al completar, devolver color original\n\t\t\tthat.camino.apariencia.material.color.setHex(0x0000FF);\n\t });\n }", "title": "" }, { "docid": "1a8445dd61abb93ab26bb0b6efeda6dd", "score": "0.6353967", "text": "function autoAnim(){\r\n\t\t\tv.oldPos=v.currentPos;\r\n\t\t\tv.slideSens = 'right';\r\n\t\t\tif(v.currentPos==v.totSucre-1){ v.currentPos=0; } else { v.currentPos+=1; }\r\n\t\t\tgalerie.animeSlidePulpe(options,v,controleur);\r\n\t\t\ttimeOut = setTimeout(autoAnim,options.time);\r\n\t\t}", "title": "" }, { "docid": "a34927f337acda65f6ec099a6390d83a", "score": "0.63411415", "text": "homeExtraAnim(){\n gsap.from('.home-box', {opacity:0, y:30, ease: \"powerout\", duration: 0.5 } )\n gsap.from('.home-search-hikes', {opacity:0, x:30, ease: \"powerout\", duration: 0.5 }, \"-=0.5\")\n gsap.from('.home-pic-box', {opacity:0, y:50, ease: \"powerout\", duration: 0.6}, \"-=1\")\n gsap.from('.footer-main', {opacity:0, y:-50, ease: \"powerout\", duration: 0.5}, \"-=2\")\n gsap.from('.footer-right sl-icon', {opacity:0, y:-50, ease: \"powerin\", duration: 1, stagger: 0.5})\n }", "title": "" }, { "docid": "a5cccdba0c2ac8a56b3120a64ad4be75", "score": "0.63340306", "text": "function animate_share() {\n step1(0, 500);\n step2(500, 800);\n step3(800, 300);\n step4(1100, 300);\n step5(1400, 400);\n step6(1800, 200);\n }", "title": "" }, { "docid": "f310e7e4e0964f3688670edcb6cc0b8f", "score": "0.6324323", "text": "animationEnded(e){// wipe the slot of our drawer\nthis.title=\"\";while(null!==dom(this).firstChild){dom(this).removeChild(dom(this).firstChild)}if(this.invokedBy){async.microTask.run(()=>{setTimeout(()=>{this.invokedBy.focus()},500)})}}", "title": "" }, { "docid": "b1a3f963ab9498c37533995c997d0bd1", "score": "0.6324226", "text": "changeAnimation() {\n this.animate=!this.animate;\n }", "title": "" }, { "docid": "b1a3f963ab9498c37533995c997d0bd1", "score": "0.6324226", "text": "changeAnimation() {\n this.animate=!this.animate;\n }", "title": "" }, { "docid": "b1a3f963ab9498c37533995c997d0bd1", "score": "0.6324226", "text": "changeAnimation() {\n this.animate=!this.animate;\n }", "title": "" }, { "docid": "b1a3f963ab9498c37533995c997d0bd1", "score": "0.6324226", "text": "changeAnimation() {\n this.animate=!this.animate;\n }", "title": "" }, { "docid": "b1a3f963ab9498c37533995c997d0bd1", "score": "0.6324226", "text": "changeAnimation() {\n this.animate=!this.animate;\n }", "title": "" }, { "docid": "b1a3f963ab9498c37533995c997d0bd1", "score": "0.6324226", "text": "changeAnimation() {\n this.animate=!this.animate;\n }", "title": "" }, { "docid": "cf793f709af3e5a2b5832e7cb5a68234", "score": "0.63102746", "text": "function movingAnimation() {\n const animArray = allAnimation.split(\"=====\\n\");\n animation.innerHTML = animArray[0];\n //render(animArray[0], animation);\n let currentAnim = 0;\n let maxlength = animArray.length;\n moveAnimation = setInterval(() => {\n animation.innerHTML = animArray[currentAnim];\n currentAnim++;\n if (currentAnim === maxlength) {\n currentAnim = 0;\n }\n }, 200);\n}", "title": "" }, { "docid": "6319f41511baf65c063b4cd0c2ee5d98", "score": "0.6307237", "text": "startServeAnimation(newOrder, newMode, validOrder) {\n this.moveIngToPlate(newOrder, newMode, validOrder);\n this.currAnimation = setInterval(() => this.moveIngToPlate(newOrder, newMode, validOrder), 500);\n}", "title": "" }, { "docid": "f676f0f2a26b9bbc4b09890ccdcd4c5d", "score": "0.63044775", "text": "function animFrame() {\n clearLine();\n drawMidiLine();\n updatePosition();\n drawPositionLine();\n}", "title": "" }, { "docid": "31aaaaab58ff1398a139279551631052", "score": "0.63007396", "text": "function AnimationCompleted(sender, eventArgs)\r\n{\r\n refreshScene();\r\n //restart the per frame animation\r\n sender.Begin();\r\n}", "title": "" }, { "docid": "851b9ba3c6b97481f6e53866e2a13ff6", "score": "0.6297691", "text": "function animation(Status){\nconsole.log('Status = '+Status);\nif (Status ==='on'){ //whan auto play is on \nsetTimeout('nextLogo()',logoTime);\n\nlogoContainer.addEventListener('transitionend',() =>{\n\tif(logoStartAnimation<=logoAllSlides-logoItems ){//11-5 = 6 \n\t\tsetTimeout('nextLogo()',logoTime);\n\t\tlogoEndAnimation++;\n\t\tlogoStartAnimation--;\n\t\t\n\t}\n\tif(logoEndAnimation>=logoAllSlides-logoItems){\n\t\tsetTimeout('prevLogo()',logoTime);\n\t\tlogoStartAnimation=logoAllSlides-logoItems+1;//11-5+1=6\n\t\tlogoEndAnimation++;\n\t}\n\tif(logoEndAnimation==(logoAllSlides-logoItems)*2+1){\n\t\tlogoStartAnimation=logoAllSlides-logoItems;\n\t\tlogoEndAnimation=-1;\n\t}\n});\n}else if(logoAutoPlay==='off'){ //when auto play is of work in normal slider\nPcDrag();\nMobileDrag();\nkeyborad();\n}\n}", "title": "" }, { "docid": "ea348039c4f4543cba1d704fa4ea132a", "score": "0.6294447", "text": "animate(direction){\r\n this.animating = direction\r\n setTimeout(function(){\r\n this.animating = false\r\n }.bind(this), this.duration/2)\r\n }", "title": "" }, { "docid": "240352211a03c29e061e5d0bef9245f2", "score": "0.62873733", "text": "function goSectionGoodBye(){\n\n TweenMax.set(content3,{opacity:0,display:\"none\"});\n \n gsap.timeline()\n .to(content2,0.3, {opacity:0,display:\"none\"})\n .to(content3,1, {opacity:1,display:\"flex\",onComplete: finalAnimation()});\n \n}", "title": "" }, { "docid": "bc0a7d4a86e5c18fccb992fc205b922e", "score": "0.6274273", "text": "function animate() {\n if (!params.paused) {\n var change=delta();\n obj.animate({top:(change.y<0 ? \"-=\" : \"+=\")+Math.abs(change.y),left:(change.x<0 ? \"-=\" : \"+=\")+Math.abs(change.x)},1000*Math.floor(Math.sqrt(change.x*change.x+change.y*change.y))/params.speed,\"linear\",animate);\n }\n }", "title": "" }, { "docid": "967083624dc46d35928d8dae29bcb0dd", "score": "0.62723845", "text": "function animate(){\n defAngle= (defAngle+1.0) % 360;\n loadVertices();\n }", "title": "" }, { "docid": "55b6be6be42c37e4c1a6d0a382ac367c", "score": "0.6268435", "text": "function my_time(){\n\n\ttry {\n\n\t\tslide.style.transition = 'transform 0.4s ease-in-out';\n\t\tnum++;\n\t\tslide.style.transform = 'translate(' + (-size * num) + 'px)';\n\t\tcircle_i[num].style.backgroundColor = 'beige';\n\t\tcircle_i[num-1].style.backgroundColor = '';\n\n\t\tif(num === images.length-1){\n\n\t\t\tcircle_i.item(0).remove();\n\t\n\t\t\tsetTimeout(()=>{\n\t\n\t\t\t\tslide.style.transform = 'translate(0px)';\n\t\t\t\tslide.style.transition = 'transform 0s';\n\t\t\t\tnum = 0\n\t\n\t\t\t},1500);\n\t\t}\n\n\t\tif(circle_i.item(num) === circle_i.item(1)){\n\t\n\t\t\tcircle_i[4].style.backgroundColor = '';\t\t\n\t\t}\n\n\t} catch (error) {\n\n\t\tconsole.log('ocurrio un error en la transition')\n\t}\n\t\n}", "title": "" }, { "docid": "6b442db0c5606218979ed19a4c1d4f4d", "score": "0.6265723", "text": "function animloop() {\n render();\n\trequestAnimFrame(animloop);\n}", "title": "" }, { "docid": "79165b13c8111e95fadf3ae4cbf03297", "score": "0.6258299", "text": "function setupAnimation(){\n \n if (counter > svgElements.length-1){\n counter = 0; \n }\n removePrevious(); \n animateElement(svgElements[counter]); \n updateRequiredText(counter);\n counter++; \n\n}", "title": "" }, { "docid": "1493099a72c1b8a549fc9cc0ebc9b4b9", "score": "0.6257651", "text": "function __loadAnima(){\n\tvar elem = document.getElementById(\"barra_progresso\");\n\tif(elem != null){\n\t\tif (_loadPos==0) _loadLen += _loadDir;\n\t\tif (_loadLen>32 || _loadPos>79) _loadPos += _loadDir;\n\t\tif (_loadPos>79) _loadLen -= _loadDir;\n\t\tif (_loadPos>79 && _loadLen==0) _loadPos=0;\n\t\telem.style.left\t\t= _loadPos;\n\t\telem.style.width\t= _loadLen;\n\t}\n}\r\r//Esconde o carregador", "title": "" }, { "docid": "0a55719876d6bf444627a3d23ef5c88d", "score": "0.62539524", "text": "animate(e) { \n e.classList.add(\"flash\");\n setTimeout(() => {\n e.classList.remove(\"flash\");\n }, 500)\n }", "title": "" }, { "docid": "876f22cd9f6911dd82da299e9321628b", "score": "0.62528765", "text": "animate() {\n var render_ok = this.render();\n if (render_ok) {\n var that = this;\n requestAnimationFrame(function () { that.animate(); });\n }\n }", "title": "" }, { "docid": "2a682708157ece46c53e638213dd7e44", "score": "0.62523824", "text": "function doTransitionAnim() {\n\n\n transitionCurrentStep = transitionCurrentStep + 1;\n positionTimelineInTransition(state.currentTimelineID, transitionCurrentStep)\n\n // If this is last step, display the text and stop the timer\n if (transitionCurrentStep == TRANSITIONNUMBEROFSTEPS_SAMESIZE + TRANSITIONNUMBEROFSTEPS_GROWING) {\n\n finishTransitionOfLine(state.currentTimelineID);\n\n }\n\n \n}", "title": "" } ]
72257c7e9acf7657b95d026fcfcebc3c
function to gide notification panel/div
[ { "docid": "828026a0a080a2dca8931ec47e8f0662", "score": "0.6381938", "text": "function hideNotifDiv() {\n $('.notifDiv').css('display', 'none');\n}", "title": "" } ]
[ { "docid": "591aea465abee0e213a795a92d74c881", "score": "0.7084372", "text": "function _displayNotification() {\n \n // If does not exist\n if ($.find(\"#main-window-warning\").length === 0) {\n \n // Get views\n var view = _renderNotificationView(),\n contentDiv = $($($.find(\".main-view\")[0]).find(\".content\")[0]);\n \n // Add notification to content\n contentDiv.first().prepend(view);\n \n // Add listeners\n $(\"#main-window-warning\").click(function () {\n _removeNotification();\n });\n \n // Resize editor to make the status bar reappear\n _resizeEditor(true);\n }\n }", "title": "" }, { "docid": "ee1152f85f530b206c2d18f6b78005ce", "score": "0.7083818", "text": "function addshow_notification(html, expandPanelNow) {\n\t$('#emptyNotifications').hide();\n\t$('#noticeScrollWrap').prepend(html);\n\n\tvar i = 0;\n\t$('.notificationWrap').each(function () {\n\t\ti++;\n\t\tif (i > 10) $(this).remove();\n\t});\n\n\tif (expandPanelNow === true) {\n\t\topenNoticePanel();\n\t\tclearTimeout(autoCloseNoticePanel);\n\t\tautoCloseNoticePanel = setTimeout(function () {\t\t//auto close, xx seconds from now\n\t\t\tcloseNoticePanel();\n\t\t}, 10000);\n\t}\n}", "title": "" }, { "docid": "fd74488962ce7a00f0ae0580d46dd0f2", "score": "0.6993644", "text": "showNotif(text=notif_text) {\r\n Webtwic.adjustSiteContent();\r\n $( 'body' ).prepend(\r\n\t\t\t`<div class=\"notif_vis\" id=\"notifBanner\">${text}${close_button}</div>`\r\n\t\t);\r\n\r\n $( '.close-button' ).on( 'click', e => {\r\n\t\t\te.preventDefault();\r\n\t\t\tWebtwic.undoReset();\r\n\t\t});\r\n }", "title": "" }, { "docid": "4d9d45e3156ec74bf0e9baa5b8d6ea04", "score": "0.6903806", "text": "function showNotifications() {\n document.getElementById(\"container_notification\").style.display = \"block\";\n document.getElementById(\"how_many_notif\").style.display = \"none\";\n notificationIsOpen = 1;\n}", "title": "" }, { "docid": "1774525ac3e55cd35128d28608ea6d18", "score": "0.69021016", "text": "function showNotifDiv() {\n $('.notifDiv').css('display', 'block');\n}", "title": "" }, { "docid": "c48006a69de03216259e5b69f26aa0f3", "score": "0.6813986", "text": "function display_notification(response) {\n $.notify({\n message: response[\"message\"]\n }, {\n type: (response[\"status\"] ? 'success' : 'danger'), \n placement: {\n from: \"bottom\",\n align: \"center\"\n }\n })\n}", "title": "" }, { "docid": "99bc282d7df18a0f133631a23abea12e", "score": "0.6790977", "text": "function showNotificationsTooltip() {\n $('#tooltip_content').show();\n}", "title": "" }, { "docid": "d4e41d89aa9e0962f182f972d2447413", "score": "0.67569524", "text": "function showNotifications(msg, type) {\n $.notify({\n // options\n message: msg\n },{\n // settings\n type: type,\n delay: 1500,\n placement:{from: \"top\",\n align: \"left\"}\n \n });\n}", "title": "" }, { "docid": "fa64a6780438948685e1ebf88387de42", "score": "0.674724", "text": "function showLoadingNotificationCenter(){\n $('.kr-notification-center').html('<div><div class=\"sk-folding-cube sk-folding-cube-orange\"> <div class=\"sk-cube1 sk-cube\"></div> <div class=\"sk-cube2 sk-cube\"></div> <div class=\"sk-cube4 sk-cube\"></div> <div class=\"sk-cube3 sk-cube\"></div> </div></div>');\n}", "title": "" }, { "docid": "95973248f5679e8deaf531c1df94905f", "score": "0.6739127", "text": "function showNotification(header, content) {\r\n $(\"#notificationHeader\").text(header);\r\n $(\"#notificationBody\").text(content);\r\n messageBanner.showBanner();\r\n messageBanner.toggleExpansion();\r\n hideErrorMessage();\r\n}", "title": "" }, { "docid": "5283d3eca651e03b26247a7d50582537", "score": "0.6671458", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n // messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "59c8cb23d35bd5c681a59fd3752e8e7e", "score": "0.6667526", "text": "function showNotification() {\n var notification = $(IDS.NOTIFICATION);\n notification.classList.remove(CLASSES.HIDE_NOTIFICATION);\n notification.classList.remove(CLASSES.DELAYED_HIDE_NOTIFICATION);\n notification.scrollTop;\n notification.classList.add(CLASSES.DELAYED_HIDE_NOTIFICATION);\n}", "title": "" }, { "docid": "0ecd0f6708d0645da1cc76e107339915", "score": "0.66472626", "text": "function notification(title, image, msg) {\n // Assign the notification as active if its not already\n if (!notificationBox.classList.contains(\"visible\")) {\n notificationBox.innerHTML = notificationHTML(title, image, msg);\n notificationBox.classList.toggle(\"visible\");\n\n sleep(4000).then(() => {\n // Remove visible if its still there\n if (notificationBox.classList.contains(\"visible\")) {\n notificationBox.classList.toggle(\"visible\");\n }\n });\n }\n}", "title": "" }, { "docid": "430e007933f154b2b0f85d65bf29d162", "score": "0.664718", "text": "function showNotification( msg, mode ) {\n\n var notify = document.getElementById(\"notify-block\") ;\n\n if( ! notify ) {\n\n notify = document.createElement('p') ;\n notify.id = \"notify-block\" ;\n\n document.body.appendChild( notify ) ;\n\n } else clearTimeout( window.i_event_notify_id ) ; //utile s'il y a eu d'autre notification avant.\n\n notify.style.display = \"none\" ; //on se rassure que la zone sera invisible avant l'affichage du msg\n notify.innerHTML = msg ;\n\n var closeButton = document.createElement(\"button\");\n closeButton.className = \"b-dialog-close\";\n closeButton.innerHTML = \"X\";\n closeButton.onclick = function () {\n\n document.body.removeChild( notify ) ;\n } ;\n notify.appendChild( closeButton ) ;\n\n notify.style.display = \"block\" ; //affiche du msg\n notify.className = \"notify-normal\" ;\n\n //le mode en principe est soit \"normal\" soit \"warring\"\n //cependant n'importe quel valeur sauf \"warring\" peut convernir pour un mode d'affichage normal.\n if( mode === \"warring\") {\n\n notify.className = \"notify-warring\" ;\n window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 20000) ; //on cache la zone après 30s\n\n } else if( mode === \"error\") {\n\n notify.className = \"notify-error\" ;\n window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 25000) ; //on cache la zone après 30s\n\n }\n else if( mode === \"success\") {\n\n notify.className = \"notify-success\" ;\n window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 25000) ; //on cache la zone après 30s\n\n } else window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 15000) ; //on cache la zone après 15s\n\n}", "title": "" }, { "docid": "8f30175af15a9f81f62553ee2f159ac4", "score": "0.6620296", "text": "function showNotification() {\n $(\"#monitoredContent\").children().hide();\n $(\"#notificationContainer\").show();\n $(\".tab button\").css(\"background-color\",\"initial\");\n}", "title": "" }, { "docid": "d2091c1627d7c1e8b1f31c34a7c7c928", "score": "0.6620121", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n}", "title": "" }, { "docid": "5efcd720351f86151de425b77a67e6b7", "score": "0.6606893", "text": "function buildPopup () {\n if (!notifCounter) {\n const divNoNotif = document.createElement('div')\n divNoNotif.id = 'noNotif'\n divNoNotif.innerText = 'Aucune notification'\n contentDiv.appendChild(divNoNotif)\n if (debugMode) console.log(divNoNotif.innerText)\n }\n const body = document.body\n body.appendChild(contentDiv)\n // Remove useless nodes\n while (body.childNodes.length > 2) {\n body.removeChild(body.childNodes[1])\n }\n currentDom = body\n}", "title": "" }, { "docid": "71a933e028c2da4cf9e5b0a5dc9074f1", "score": "0.6600377", "text": "function showNotificationsFumetto() {\n $('#tooltip_arancione').show();\n}", "title": "" }, { "docid": "fafe93cb18e0a9ba3cf3ccd49f1c2196", "score": "0.6593274", "text": "function closeNotificationPanel() {\n $('#notification-center').html(`<p class='text-muted'>{% trans \"Notifications will load here\" %}</p>`);\n}", "title": "" }, { "docid": "b70f5dcd2528cae846aab3d462e9af04", "score": "0.6590036", "text": "function showNotifyBar(text, div_id, delay, speed){\n id = '#' + div_id;\n \n $j.notifyBar({\n html: text, \n delay: delay, \n animationSpeed: speed, \n jqObject: $j(id)\n });\n}", "title": "" }, { "docid": "35f9f35c7a8529306c8383be767bb801", "score": "0.6576694", "text": "function pinfo(x,y){\n new PNotify({\n title: x,\n text: '<hr class=\"notifys\">'+y,\n type: 'info',\n styling: 'bootstrap3',\n delay:2000,\n });\n}", "title": "" }, { "docid": "0c98364580a9e3bf03082f9ead6075de", "score": "0.656971", "text": "function notification(html) {\n\n\t$('.message-ajax #message-here').html(html);\n\t$('.message-ajax').show();\n\t$('.message-ajax').fadeOut(4000);\n}", "title": "" }, { "docid": "ec2fbec6d1a38980310934ad140ae287", "score": "0.65362823", "text": "function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}", "title": "" }, { "docid": "ec2fbec6d1a38980310934ad140ae287", "score": "0.65362823", "text": "function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}", "title": "" }, { "docid": "ec2fbec6d1a38980310934ad140ae287", "score": "0.65362823", "text": "function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}", "title": "" }, { "docid": "15c62984900c31392c5a9705d84294eb", "score": "0.65326905", "text": "function openNoticePanel() {\n\t$('#noticeScrollWrap').slideDown();\n\t$('#notificationHandle').children().removeClass('fa-angle-down').addClass('fa-angle-up');\n}", "title": "" }, { "docid": "bede367e4535587d60c4a1051b30618d", "score": "0.6525704", "text": "show(title, message, topOffset = 0, context = 'info', duration = 3000) {\n // Creating the notification container div\n const containerNode = document.createElement('div');\n containerNode.className = 'notification note note-visible';\n containerNode.style.top = `${topOffset}px`;\n\n\n // Adding the notification title node\n const titleNode = document.createElement('p');\n titleNode.className = 'note-title';\n titleNode.textContent = title;\n\n\n // Adding the notification message content node\n const messageNode = document.createElement('p');\n messageNode.className = 'note-content';\n messageNode.textContent = message;\n\n // Adding a little button on the notification\n const closeButtonNode = document.createElement('button');\n closeButtonNode.className = 'delete';\n closeButtonNode.addEventListener('click', () => {\n this.notificationManager.remove(containerNode);\n });\n\n // Appending the container with all the elements newly created\n containerNode.appendChild(closeButtonNode);\n containerNode.appendChild(titleNode);\n containerNode.appendChild(messageNode);\n containerNode.classList.add(`is-${context}`);\n\n // Inserting the notification to the page body\n document.getElementById(this.containerId).appendChild(containerNode);\n\n // Default duration delay\n if (duration <= 0) {\n duration = 2000;\n }\n setTimeout(() => {\n this.notificationManager.remove(containerNode);\n }, duration);\n return containerNode;\n }", "title": "" }, { "docid": "4a3e17bfe76a48144385f576b4325890", "score": "0.6523328", "text": "function showNotification(header, content) {\r\n $(\"#notificationHeader\").text(header);\r\n $(\"#notificationBody\").text(content);\r\n messageBanner.showBanner();\r\n messageBanner.toggleExpansion();\r\n }", "title": "" }, { "docid": "d513e200fe413e9ca9f4e415edb84afd", "score": "0.652207", "text": "function notificationFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "title": "" }, { "docid": "d513e200fe413e9ca9f4e415edb84afd", "score": "0.652207", "text": "function notificationFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "title": "" }, { "docid": "a02ab607621234c29d8dff4ac731454e", "score": "0.65205544", "text": "function showNotification(header, content) {\n $(\"#notification-body\").text(content);\n $(\"#notification-header\").text(header);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "a06b5bf2b22ee6c9c62248b7b0d64c9b", "score": "0.651813", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.65157205", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "41ed2adc23d687e8aedcf137fd4df25b", "score": "0.65157205", "text": "function showNotification(header, content) {\n $(\"#notification-header\").text(header);\n $(\"#notification-body\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "c35abd6d0c8694d9fe11c085022d1613", "score": "0.6497292", "text": "function shownotification() {\n var element = document.getElementById(\"mynotification\");\n element.classList.add(\"slide-show\");\n element.classList.remove(\"slide-hide\");\n var element1 = document.getElementById(\"novu-body\");\n element1.classList.add(\"blured-bgwhite\");\n }", "title": "" }, { "docid": "ca2b73a026ae7a057e069ede50943e20", "score": "0.6496854", "text": "static domNotificationSuccess(elem1, notifContent, elem2){\n\t\t\t// append to the parent\n $(elem1).html(`${notifContent}`);\n\t\t\n $(elem2).on('click', () => {\n $('.notification').fadeOut(400, \"swing\", () => {\n $('.notification').css(\"display\", \"none\");\n $(elem1).children(`${elem1} > :first-child`).remove();\n })\n $('.notif-container').css(\"transform\", \"scale(0)\");\n })\n\t\t\t\n\t\t\t// $('html').animate({scrollTop: 0}, 200, \"swing\");\n }", "title": "" }, { "docid": "c67369c0dafe1a6bb74444f448c22aa1", "score": "0.6495416", "text": "function show_notif(typ,pos,msg,tim_out)\n {\n new Noty({\n type: typ, //alert (default), success, error, warning\n layout: pos, //top, topLeft, topCenter, topRight (default), center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, bottomRight\n theme: 'bootstrap-v4', //relax, mint (default), metroui \n text: msg, //This string can contain HTML too. But be careful and don't pass user inputs to this parameter.\n timeout: tim_out, // false (default)\n progressBar: true, //Default, progress before fade out is displayed\n }).show();\n }", "title": "" }, { "docid": "a437dfa78cf95478e2dc7ffd6b1c9e3a", "score": "0.64939576", "text": "function showNotif(notif, color) {\n $(\".notification\").text(notif).addClass(\"show\").css(\"background-color\", color);\n setTimeout(function() {\n $(\".notification\").removeClass(\"show\");\n }, 4000);\n }", "title": "" }, { "docid": "7087e66ff45d47458507855b06240ba1", "score": "0.6467623", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "7087e66ff45d47458507855b06240ba1", "score": "0.6467623", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.64666045", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "eea2a7d7160c9039c1b3918e19eab8d6", "score": "0.64666045", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n messageBanner.toggleExpansion();\n }", "title": "" }, { "docid": "16b11b44761bed20fe2dc22371820343", "score": "0.64403087", "text": "function showNotification(header, content) {\n\t\t$(\"#notification-header\").text(header);\n\t\t$(\"#notification-body\").text(content);\n\t\tmessageBanner.showBanner();\n\t\tmessageBanner.toggleExpansion();\n\t}", "title": "" }, { "docid": "c85e6864c1f4567472a39baf4fd7acfc", "score": "0.6439908", "text": "function hideNotifications() {\n document.getElementById(\"container_notification\").style.display = \"none\";\n notificationIsOpen = 0;\n}", "title": "" }, { "docid": "848b05c5b40b3a5ec3a62bb243c1e0d2", "score": "0.64386815", "text": "function toggleNotification() {\n var element = document.getElementById(\"notificationContainer\");\n element.classList.toggle(\"not-show\");\n}", "title": "" }, { "docid": "854943189be76b72cf25a49fc80ab243", "score": "0.6434095", "text": "createNotificationContainer() {\n let message_container = document.createElement(\"div\");\n message_container.id = \"notification_container\";\n message_container.addEventListener(\"notify\", function (event) {\n const {message} = event.detail;\n if (message) {\n this.innerHTML = message;\n }\n setTimeout(function () {\n this.innerHTML = \"\";\n }.bind(this), 2500);\n });\n return message_container;\n }", "title": "" }, { "docid": "dccb5dfd5ff2e4ef278f9f147521c6ee", "score": "0.64251417", "text": "function NotificationPanel() {\n\tthis.isHidden = true;\n\tthis.notifications = new Array();\n\tthis.createPanel();\n\tthis.isHovered = false;\n\tthis.timeout = null;\n}", "title": "" }, { "docid": "505693b8f149a837fecb642f711a57e6", "score": "0.6416581", "text": "function showNotification() {\n notification.classList.remove(CLASSES.HIDE_NOTIFICATION);\n notification.classList.remove(CLASSES.DELAYED_HIDE_NOTIFICATION);\n notification.scrollTop;\n notification.classList.add(CLASSES.DELAYED_HIDE_NOTIFICATION);\n}", "title": "" }, { "docid": "9c1b90415beff393b30fa2c596fa65d5", "score": "0.6409006", "text": "function openStatusMessage(content) {\r\n\t\tsets.element.append('<div id = \"mapStatus\" style = \"display:none\">' + content + '</div>');\t\t\r\n\t\t$('#mapStatus').slideDown(\"slow\");\r\n\t}", "title": "" }, { "docid": "54e39aff443f26d3c1551c72151a490b", "score": "0.63912714", "text": "function alertMsgPopup(status) {\r\n\r\n\t$(\"#chatWindowSection\").hide();\r\n\t$(\"#statusAlertPopUp\")\r\n\t\t\t.html(\r\n\t\t\t\t\t'<img src=\"images/pages/ask_expert/expert_view/icon-alert.png\">'\r\n\t\t\t\t\t\t\t+ '<a href=\"#\" data-rel=\"back\" class=\"ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right\">Close</a> '\r\n\t\t\t\t\t\t\t+ 'Currently expert is ' + status\r\n\t\t\t\t\t\t\t+ ', Please reach out to other experts');\t\t\t\t\r\n }", "title": "" }, { "docid": "8e2cb0f711f6ebaa6581fcd199c7e470", "score": "0.6368838", "text": "function getNotifications(){\n posted_jobs.style.display = 'none';\n negotiation.style.display = 'none';\n jobs_notifications.style.display = 'block';\n}", "title": "" }, { "docid": "650aaa1be7651b9a01dc2f203d451631", "score": "0.63663185", "text": "function notification(target, time) {\n var a = \"#\" + target;\n $(\".notification-box\").removeClass(\"show\");\n setTimeout(() => {\n $(a).addClass(\"show\");\n }, 300);\n if (time) {\n time = time + 300;\n setTimeout(() => {\n $(\".notification-box\").removeClass(\"show\");\n }, time);\n }\n}", "title": "" }, { "docid": "b1f7729cc0c10ee927b15bad87328755", "score": "0.6350373", "text": "function OnNotification(notificationCount,isImportantMessage) {\n var millisecondsToWait = window.external.RetrieveNotificationAutoCloseInterval();\n var cntrl = GetControl('divNotification');\n if (cntrl.style.display == 'block') {\n CloseStatus('notification');\n if (notificationCount > 0) {\n ShowStatus('notification', notificationCount, 'AsNotification',isImportantMessage);\n }\n else {\n cntrl.style.display = 'none';\n }\n }\n else {\n if (notificationCount > 0) {\n ShowStatus('notification', notificationCount, 'AsNotification',isImportantMessage);\n }\n else {\n CloseStatus('notification');\n }\n }\n }", "title": "" }, { "docid": "122900f2a41018b39a9320c45e4fe530", "score": "0.6331399", "text": "function displaynotification(){\n //display the notification\n notificationelement.classList.add('show')\n setTimeout( () => {\n notificationelement.classList.remove('show')\n },1000)\n}", "title": "" }, { "docid": "fa6147555bbcbb1f25054665bb34a353", "score": "0.63295263", "text": "function addNotification(text) {\n var el=document.createElement(\"div\");\n el.innerHTML=text;\n el.setAttribute(\"class\",\"notification\");\n $(\"#notifications\")[0].appendChild(el);\n setTimeout(function() {\n fadeAway(el,0.85);\n },2000);\n}", "title": "" }, { "docid": "1e69216511d2230302d99be8d112764f", "score": "0.6322444", "text": "function showWarningAlert(message) {\r\n $.pnotify({\r\n type: 'info',\r\n text: message,\r\n opacity: 0.9\r\n });\r\n}", "title": "" }, { "docid": "8eef966fef34eae890baa99a5e6d3c04", "score": "0.6320241", "text": "function addNotificationToHTML(result,bool) {\n\n if (result.length>0) {\n var totalUnseen=result[0];\n result=result[1];\n }\n\n if (bool) {\n //ul for notification container\n var ul=document.createElement(\"ul\");\n ul.setAttribute(\"class\",\"collection\");\n }\n else {\n //ul for dropdown notification icon\n var ul=document.getElementById(\"notification\");\n }\n\n if (result.length==0){\n $('#countOfNotification').html('Notification');\n var li=document.createElement(\"li\");\n var a=document.createElement(\"a\");\n var text=document.createTextNode(\"No notification\");\n a.setAttribute(\"href\",\"#!\");\n a.appendChild(text);\n li.appendChild(a);\n ul.appendChild(li);\n }\n else {\n if (totalUnseen!=0) {\n $('.notification-badge').css(\"background-color\",\"#ff0000\");\n $('.notification-badge').html(totalUnseen);\n }\n else {\n $('.notification-badge').css(\"background-color\",\"transparent\");\n $('.notification-badge').empty();\n }\n $('#linkNotification').attr(\"href\",\"javascript:showNotification();\");\n $('#countOfNotification').html('Notification <span style=\"color:red;\">('+totalUnseen+')</span>');\n\n for (var i=0;i<result.length;i++) {\n var li_divider=document.createElement(\"li\");\n li_divider.setAttribute(\"class\",\"divider\");\n li_divider.setAttribute(\"tabindex\",\"-1\");\n var li=document.createElement(\"li\");\n var text=document.createTextNode(result[i][2]);\n var date=document.createTextNode(result[i][1]);\n var a=document.createElement(\"a\");\n a.setAttribute(\"href\",\"javascript:void(0);\");\n a.setAttribute(\"onclick\",\"javascript:openNotification(event,'\"+result[i][3]+\"')\");\n a.setAttribute(\"id\",result[i][0]);\n\n if (result[i][4]==1) {\n li.style.backgroundColor=\"#f3f4f7\";\n }\n\n if (bool) {\n li.setAttribute(\"class\",\"collection-item avatar\");\n var span=document.createElement('span');\n var t=document.createTextNode(\"New notification\");\n var p=document.createElement('p');\n p.appendChild(text);\n p.appendChild(document.createElement('br'));\n p.appendChild(date);\n span.appendChild(t);\n li.appendChild(span);\n li.appendChild(p);\n a.appendChild(li);\n ul.appendChild(a);\n }\n else {\n a.appendChild(text);\n a.appendChild(document.createElement('br'));\n a.appendChild(date);\n li.appendChild(a);\n ul.appendChild(li);\n ul.appendChild(li_divider);\n }\n }\n if (bool) {\n var div=document.getElementById('notificationContainer');\n div.appendChild(ul);\n }\n else {\n var liEnd=document.createElement(\"li\");\n var aEnd=document.createElement(\"a\");\n var textEnd=document.createTextNode(\"See all\");\n aEnd.appendChild(textEnd);\n aEnd.setAttribute(\"id\",\"seeMoreNotif\");\n aEnd.setAttribute(\"href\",\"javascript:showNotification();\");\n liEnd.appendChild(aEnd);\n ul.appendChild(liEnd);\n }\n }\n}", "title": "" }, { "docid": "04e61bcd34ca39adcaa9f3eb7c2d7116", "score": "0.6316328", "text": "function addNotification(message,type){\n var notify = $.notify(message, {\n type: type,\n placement: {\n from: \"top\",\n align: \"center\"\n },\n offset: {\n y: 100\n },\n animate: {\n enter: 'animations scaleIn',\n exit: 'animations scaleOut'\n }\n });\n}", "title": "" }, { "docid": "bc463e0192fac3436ea1feb1e14b5bb4", "score": "0.6315838", "text": "function showNotification(header, content) {\n $(\"#notificationHeader\").text(header);\n $(\"#notificationBody\").text(content);\n messageBanner.showBanner();\n }", "title": "" }, { "docid": "ee55b86fe2e5ac6b43e4b89c2568b108", "score": "0.63038796", "text": "function setVisualNotification(show) {\n var unreadMsgElement = document.getElementById('unreadMessages');\n var unreadMsgBottomElement\n = document.getElementById('bottomUnreadMessages');\n\n var glower = $('#chatButton');\n var bottomGlower = $('#chatBottomButton');\n\n if (unreadMessages) {\n unreadMsgElement.innerHTML = unreadMessages.toString();\n unreadMsgBottomElement.innerHTML = unreadMessages.toString();\n\n ToolbarToggler.dockToolbar(true);\n\n var chatButtonElement\n = document.getElementById('chatButton').parentNode;\n var leftIndent = (UIUtil.getTextWidth(chatButtonElement) -\n UIUtil.getTextWidth(unreadMsgElement)) / 2;\n var topIndent = (UIUtil.getTextHeight(chatButtonElement) -\n UIUtil.getTextHeight(unreadMsgElement)) / 2 - 3;\n\n unreadMsgElement.setAttribute(\n 'style',\n 'top:' + topIndent +\n '; left:' + leftIndent + ';');\n\n var chatBottomButtonElement\n = document.getElementById('chatBottomButton').parentNode;\n var bottomLeftIndent = (UIUtil.getTextWidth(chatBottomButtonElement) -\n UIUtil.getTextWidth(unreadMsgBottomElement)) / 2;\n var bottomTopIndent = (UIUtil.getTextHeight(chatBottomButtonElement) -\n UIUtil.getTextHeight(unreadMsgBottomElement)) / 2 - 2;\n\n unreadMsgBottomElement.setAttribute(\n 'style',\n 'top:' + bottomTopIndent +\n '; left:' + bottomLeftIndent + ';');\n\n\n if (!glower.hasClass('icon-chat-simple')) {\n glower.removeClass('icon-chat');\n glower.addClass('icon-chat-simple');\n }\n }\n else {\n unreadMsgElement.innerHTML = '';\n unreadMsgBottomElement.innerHTML = '';\n glower.removeClass('icon-chat-simple');\n glower.addClass('icon-chat');\n }\n\n if (show && !notificationInterval) {\n notificationInterval = window.setInterval(function () {\n glower.toggleClass('active');\n bottomGlower.toggleClass('active glowing');\n }, 800);\n }\n else if (!show && notificationInterval) {\n window.clearInterval(notificationInterval);\n notificationInterval = false;\n glower.removeClass('active');\n bottomGlower.removeClass('glowing');\n bottomGlower.addClass('active');\n }\n}", "title": "" }, { "docid": "2191728d3f024d33a7135a941dbf575a", "score": "0.62923676", "text": "function drawDiagramNotification(response) {\n if (response != null) {\n \tresponse = response[0] || response;\n // Attach the notification container\n var diagramNode = document.getElementById('simp-bar');\n diagramContainer = document.createElement('div');\n diagramContainer.className = diagramNotificationClassName;\n if(diagramNode.nextSibling){ \n diagramNode.parentNode.insertBefore(diagramContainer, diagramNode.nextSibling); \n } else { \n diagramNode.parentNode.appendChild(diagramContainer); \n }\n // Attach the corresponding CPD elements\n //document.getElementById(\\'cpdsvg\\').style.display = \\\"block\\\";\n var content = '<img ' +\n 'onClick=\"document.getElementById(\\'cpdsvg\\').style.display == \\'none\\' ? document.getElementById(\\'cpdsvg\\').style.display = \\'block\\' : document.getElementById(\\'cpdsvg\\').style.display = \\'none\\'\"' +\n 'src=\"' + diagramNotificationImage + '\" ' +\n 'width=\"40\" ' +\n 'height=\"40\"' +\n 'title=\"' + diagramNotificationText + '\" ' + \n 'alt=\"' + diagramNotificationText + '\" >' +\n '<a href=\"' + response[\"url\"] + '\" target=\"_blank\">' +\n '<img id=\"cpdsvg\" style=\"display:none;\" src=\"' + response[\"svg\"] + '\">' +\n '</a>';\n diagramContainer.innerHTML = content;\n \tdiagramURL = response[\"url\"];\n }\n }", "title": "" }, { "docid": "c42652e11f8807d9df9396128bf91821", "score": "0.6291787", "text": "function slideNotice(text) {\n\t\t\t\t\t\t$('div#statusBar').html('<h3>' + text + '</h3>').slideDown();\n\t\t\t\t\t}", "title": "" }, { "docid": "445ef3c56c13e82718bc3ba6b6adb781", "score": "0.629031", "text": "function notification(message) {\n var x = document.getElementById(\"snackbar\")\n x.className = \"show\";\n x.innerHTML = message;\n setTimeout(function () { x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "title": "" }, { "docid": "6502164f455341e7d6263503f8e3bb65", "score": "0.62840617", "text": "function hideNotification() {\n var notification = $(IDS.NOTIFICATION);\n notification.classList.add(CLASSES.HIDE_NOTIFICATION);\n notification.classList.remove(CLASSES.DELAYED_HIDE_NOTIFICATION);\n}", "title": "" }, { "docid": "baf6c517e25c3d3c3a21b83d77da5e1f", "score": "0.6278606", "text": "function wpsc_fancy_notification( parent_form ) {\n\n\tif ( window.console && window.console.log ) {\n\t\tconsole.log( 'wpsc_fancy_notification() is deprecated. Use WPEC_Fancy_Notifications.fancy_notification() instead.' );\n\t}\n\n\tWPEC_Fancy_Notifications.fancy_notification();\n\n}", "title": "" }, { "docid": "e6044371ef1b0a0c5190ce2849ddf3a5", "score": "0.6275003", "text": "function mostrarAyuda(msg) {\n $.notify({\n message: msg\n }, {\n type: 'info',\n delay: 3000,\n placement: {\n align: 'center'\n },\n z_index: 99999,\n });\n}", "title": "" }, { "docid": "f7e6eba9b40c6208b4cb512843ac161c", "score": "0.62675273", "text": "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}", "title": "" }, { "docid": "8122f9b07db970dc45d6f0b57666f053", "score": "0.6265647", "text": "function userPnotifyDisplay() {\n //console.log(\"user Pnotify Display\");\n if( !$('#pnotify-notice') ) {\n //console.log(\"user Pnotify Display: does not exists\");\n return;\n }\n var text = $('#pnotify-notice').val();\n //console.log(\"user Pnotify Display: text=\"+text);\n if( text ) {\n var type = 'info';\n var hide = false;\n if( $('#pnotify-notice').hasClass('pnotify-notice-success') ) {\n type = 'success';\n }\n if( $('#pnotify-notice').hasClass('pnotify-notice-error') ) {\n type = 'error';\n hide = false;\n }\n new PNotify({\n icon: false,\n //title: 'Regular Notice',\n text: text,\n type: type,\n hide: hide\n });\n }\n}", "title": "" }, { "docid": "820c12cdb426f679d2b44d16ec4c6d8e", "score": "0.6261501", "text": "_createNotifElem(notif) {\n let notifElem = $(`<div id='${this._getNotifElemID(notif.key)}' class='notif'></div>`).data(\"notif\", notif);\n this._getNotifIconElem(notif.knownSeverity).appendTo(notifElem);\n\n if (notif.timestamp) {\n let time = notif.timestamp instanceof Date ? notif.timestamp.toLocaleString() : notif.timestamp;\n $(`<div class='notif-time'>${time}</div>`).appendTo(notifElem);\n }\n\n let messageElem = $(\"<div class='notif-msg'></div>\").appendTo(notifElem);\n\n if (notif.message instanceof jQuery) {\n messageElem.append(notif.message);\n } else if (notif.isHtml) {\n messageElem.html(notif.message);\n } else {\n messageElem.text(notif.message);\n }\n\n notifElem.data(\"notif\", notif);\n return notifElem;\n }", "title": "" }, { "docid": "eb75cb50716e451f7b1cd402e22a1eb6", "score": "0.62567765", "text": "function addNotification() {\n var unread = document.getElementById(\"unread\");\n var newUnread = unread.cloneNode(true);\n var bell = document.getElementById(\"bell\");\n var newBell = bell.cloneNode(true);\n var notification_container = document.getElementById(\"notification_container\");\n newUnread.innerHTML = parseInt(unread.innerHTML);\n unread.parentNode.replaceChild(newUnread, unread);\n bell.parentNode.replaceChild(newBell, bell);\n notification_container.classList.remove(\"seen\");\n notification_container.style.backgroundColor = 'rgba(235, 154, 45, 1)';\n }", "title": "" }, { "docid": "b408d5eef7e1b1f75fa2de9689ad1aee", "score": "0.6248201", "text": "function hideNotification() {\n notification.classList.add(CLASSES.HIDE_NOTIFICATION);\n}", "title": "" }, { "docid": "7a38434c486eb8a89b1cbf2f0eaf0370", "score": "0.62382704", "text": "function displayNotification(type, message) {\n // ensures that the notification will not be cleared if a new notification popped up and the last one has a running timer\n clearTimeout(state.notifTimer);\n\n let notification = document.getElementById(\"notification\");\n let notifText = document.getElementById(\"text-notif\");\n\n notification.classList.add(type);\n notifText.innerHTML = message;\n\n notification.classList.add(\"visible\");\n\n state.notifTimer = setTimeout(hideNotification, 10000);\n}", "title": "" }, { "docid": "d0fcef3fc3d58e30c8a88a76f9b1f7d2", "score": "0.6215436", "text": "function showgroupnotifications(n) {\n $('#group-notification-feed').html(\n '<div style=\"margin-left:25px;\"><div class=\"spinnerLoader\"><div></div><div></div><div></div><div></div></div></div>');\n $.ajax({\n type: \"POST\",\n url: BASE_URL + \"/group/showgroupnotifications\",\n data: {},\n success: function(result) {\n var resultArr = result.split('~#~');\n $('#group-notification-feed').html(resultArr[0]);\n setTimeout(function() {\n $.dbeePopup('resize');\n }, 500);\n }\n });\n}", "title": "" }, { "docid": "2db9b2b737df1b48c6cb1172a164a2af", "score": "0.62101275", "text": "function updateVisualNotification() {\n // XXX The rewrite of the toolbar in React delayed the availability of the\n // element unreadMessages. In order to work around the delay, I introduced\n // and utilized unreadMsgSelector in addition to unreadMsgElement.\n const unreadMsgSelector = $('#unreadMessages');\n const unreadMsgElement\n = unreadMsgSelector.length > 0 ? unreadMsgSelector[0] : undefined;\n\n if (unreadMessages && unreadMsgElement) {\n unreadMsgElement.innerHTML = unreadMessages.toString();\n\n APP.store.dispatch(dockToolbox(true));\n\n const chatButtonElement\n = document.getElementById('toolbar_button_chat');\n const leftIndent\n = (UIUtil.getTextWidth(chatButtonElement)\n - UIUtil.getTextWidth(unreadMsgElement)) / 2;\n const topIndent\n = ((UIUtil.getTextHeight(chatButtonElement)\n - UIUtil.getTextHeight(unreadMsgElement)) / 2) - 5;\n\n unreadMsgElement.setAttribute(\n 'style',\n `top:${topIndent}; left:${leftIndent};`);\n } else {\n unreadMsgSelector.html('');\n }\n\n if (unreadMsgElement) {\n unreadMsgSelector.parent()[unreadMessages > 0 ? 'show' : 'hide']();\n }\n}", "title": "" }, { "docid": "772acd05e9906c70dd321579a8033d1a", "score": "0.6210076", "text": "function showInfo(message)\n{\n newmessage(\"bg-info\", \"<span class='glyphicon glyphicon-exclamation-sign'></span> \"+message, 4000);\n}", "title": "" }, { "docid": "89cba1dff9d35211c70549c8a26c8b85", "score": "0.6202056", "text": "function notify(from, align, icon, type, title, message) {\n $.growl({\n icon: icon,\n title: title,\n message: message,\n url: ''\n },{\n element: 'body',\n type: type,\n allow_dismiss: true,\n placement: {\n from: from,\n align: align\n },\n offset: {\n x: 30,\n y: 30\n },\n spacing: 10,\n z_index: 1031,\n delay: 2500,\n timer: 1000,\n url_target: '_blank',\n mouse_over: false,\n icon_type: 'class',\n template: '<div data-growl=\"container\" class=\"alert\" role=\"alert\">' +\n '<button type=\"button\" class=\"close\" data-growl=\"dismiss\">' +\n '<span aria-hidden=\"true\">&times;</span>' +\n '<span class=\"sr-only\">Close</span>' +\n '</button>' +\n '<span data-growl=\"icon\"></span>' +\n '<span data-growl=\"title\"></span>' +\n '<span data-growl=\"message\"></span>' +\n '<a href=\"#\" data-growl=\"url\"></a>' +\n '</div>'\n });\n}", "title": "" }, { "docid": "4129f11dcb9bb0161a546aedb19b04c8", "score": "0.6190203", "text": "function showNotification(infoType) {\n var notification = document.querySelector(\".notification\");\n notification.className = \"notification\";\n if (infoType == \"Deleting...\") {\n notification.classList.add(\"notification--delete\");\n } else if (infoType == \"Creating...\") {\n notification.classList.add(\"notification--create\");\n } else if (infoType == \"Renaming...\" || infoType == \"Moving...\") {\n notification.classList.add(\"notification--rename\");\n }\n notification.innerHTML = infoType;\n document.querySelector(\".notification-overlay\").classList.remove(\"hidden\");\n}", "title": "" }, { "docid": "2faa4dbbf13ad57d38c9666c2b47b13b", "score": "0.618882", "text": "function socialNotification(id, type, text)\n{\n\tnotificationCount = notificationCount+1;\n\t$('#stackBoxes').append(\"<div class='stackBox \"+type+\"' id='\"+id+\"' style='display:none;'><p>\"+text+\"</p></div>\");\n\t$('#notificationCount').text(notificationCount);\n\t$('#notifications').show();\n\t$('#'+id).slideToggle();\n\t$('#'+id).delay(1000).fadeOut(1000);\n}", "title": "" }, { "docid": "8b568cd607b5cfaad2a9b5ad025ede8c", "score": "0.618641", "text": "function notify(type, message){\n\tlet id = \"notification-\" + notificationCounter++;\n\t\n\t// Insert the notification\n\tdocument.getElementById(\"alertFrame\").innerHTML +=\n\t\t\"<div class=\\\"alert alert-\" + type + \"\\\" role='alert' id=\\\"\" + id + \"\\\">\" +\n\t\t\tmessage + \n\t\t\t\"<button type='button' class='close' data-dismiss='alert' aria-label='Close'>\" +\n\t\t\t\t\"<span aria-hidden='true'>&times;</span>\" +\n\t\t\t\"</button>\" +\n\t\t\"</div>\";\n\t\t\n\t\t$(\"#\" + id).animateCss('zoomInUp');\n\t\t\n\t// Delete the notification after a while\n\twindow.setTimeout(function(){\n\t\t$(\"#\" + id).animateCss('zoomOut', function(){\n\t\t\t$(\"#\" + id).remove();\n\t\t});\n\t}, 5000);\n}", "title": "" }, { "docid": "b8028b22740532bb1c1528f0d603efc1", "score": "0.61835176", "text": "function setNotificationPopupStatus() {\n if (notificationIsOpen == 0) {\n showNotifications();\n } else {\n hideNotifications();\n }\n}", "title": "" }, { "docid": "97b766c292839ca9415f0cb7729a24c3", "score": "0.6182216", "text": "function showNotificationDropdown() {\n if (s.notificationsWrapper.children().length === 0) {\n s.notificationEmpty.removeClass('hide');\n }\n s.notificationDropdown.css({'display': 'none'}).removeClass('hide').velocity(\"slideDown\", { duration: 500 });\n }", "title": "" }, { "docid": "5f44e1a3b8efa28f1778468836cd7154", "score": "0.6178608", "text": "function ShowNotification(s){\n var uniqueId = GenerateUniqueId(10);\n $('#Chatter').append('<div class=\"Note\" id=\"s_'+uniqueId+'\">'+s+'</div>');\n RemoveElement('#s_'+uniqueId, 45000);\n ResizeChatArea(true);\n}", "title": "" }, { "docid": "6287bc746f9cc0e8434f094ce5334478", "score": "0.6175592", "text": "function setProcessing()\n{\n document.getElementById(\"notify\").innerHTML='<div class=\"processing\"><p class=\"processingTitle\">Processing your query ...</p><img src=\"../images/waiting.gif\"/></div>';\n}", "title": "" }, { "docid": "fbbc31b81e25a724eeb8ffbe5ead94ac", "score": "0.61742026", "text": "function MessageDisplayWidget() {}", "title": "" }, { "docid": "a392014e79d83f6fcb86c2a2caca2e04", "score": "0.6173904", "text": "function notify(message) {\n// create the notification\n var notification = new NotificationFx({\n\n // element to which the notification will be appended\n // defaults to the document.body\n wrapper: document.body,\n\n // the message\n message: '<p>'+message+'</p>',\n\n // layout type: growl|attached|bar|other\n layout: 'growl',\n\n // effects for the specified layout:\n // for growl layout: scale|slide|genie|jelly\n // for attached layout: flip|bouncyflip\n // for other layout: boxspinner|cornerexpand|loadingcircle|thumbslider\n // ...\n effect: 'jelly',\n\n // notice, warning, error, success\n // will add class ns-type-warning, ns-type-error or ns-type-success\n type: 'error',\n // if the user doesn´t close the notification then we remove it\n // after the following time\n ttl: 6000,\n\n // callbacks\n onClose: function () {\n return false;\n },\n onOpen: function () {\n return false;\n }\n\n });\n\n// show the notification\n notification.show();\n}", "title": "" }, { "docid": "3a9eb67e210f7a7e8da0f9a4123b19bb", "score": "0.61660427", "text": "function toast_notif(e){\n if( $('#toast-notif').length == 0 ){\n $('body').append('<div id=\"toast-notif\"></div>');\n }\n $('#toast-notif').html(e);\n\n // center taost\n $('#toast-notif').css(\"left\", ( $(window).width() - $('#toast-notif').width() ) / 2 + \"px\");\n\n var $timer = setTimeout(function(){\n if( !$('#toast-notif').hasClass('.active')){\n $('#toast-notif').removeClass('active').hide();\n }\n \n }, 5000);\n\n if( !$('#toast-notif').is(':visible') ){\n $('#toast-notif').show();\n }else{\n $('#toast-notif').addClass('active');\n clearTimeout($timer);\n }\n }", "title": "" }, { "docid": "e81299eacb7173bbe5e939b8cbaea653", "score": "0.6165428", "text": "function Notification() {\n\t\n}", "title": "" }, { "docid": "6d8dcd3771aa11783340b77e534eeed8", "score": "0.6159405", "text": "function showNotificationWhenSuccess(res) {\n iSuccess.css('display', 'inline-block');\n iError.css('display', 'none');\n iMessage.html(res);\n notification.removeClass('error').addClass('success slide-left');\n notification.css('display', 'flex');\n }", "title": "" }, { "docid": "b2763bcb24dd1f2d1d0551724ab4ffea", "score": "0.61422807", "text": "function pushNotification(text,css_class=\"\") {\n $(\"<div class='notification \"+css_class+\"'>\"+text+\"</div>\")\n .appendTo('.push-notifications-container')\n .delay(4000)\n .queue(function() {\n $(this).remove();\n });\n // Scroll to bottom of notifications box\n $('.push-notifications-container').scrollTop($('.push-notifications-container')[0].scrollHeight);\n}", "title": "" }, { "docid": "949957f855b3934858dc352fbe9bd743", "score": "0.61394256", "text": "function showNotification(message) {\n const notification = document.getElementById(\"notification\");\n notification.classList.add(\"notification\");\n notification.textContent = message;\n \n const span = document.createElement(\"span\");\n span.textContent = \"x\";\n span.addEventListener(\"click\", removeClass)\n\n notification.append(span);\n loginForm.prepend(notification);\n}", "title": "" }, { "docid": "14dbe4d8f61183cbf03abb950efda732", "score": "0.61293054", "text": "function showSuccessMessage(message){\r\n\tPNotify.removeAll();\r\n\tvar stack_topleft = {\"dir1\": \"down\", \"dir2\": \"left\", \"push\": \"top\"};\r\n\tnew PNotify({\r\n\t type: 'success',\r\n\t title: 'Success',\r\n\t text: message,\r\n\t addclass: \"stack_topleft\",\r\n\t stack: stack_topleft\r\n\t});\r\n}", "title": "" }, { "docid": "0b6a09d43bdad2c7e99fdecec237d3e5", "score": "0.61290747", "text": "function showNotification(elementId) {\n\n var elem = $(\"#\" + elementId);\n\n elem.show();\n setTimeout(function () { elem.hide(); }, 3000);\n}", "title": "" }, { "docid": "10b6b1d1f7bdf4a09583e95beeb88a28", "score": "0.612828", "text": "function createCommunityDivForPanel(response,flag,extClass){\r\n console.log(response);\r\n var badge = '';\r\n var badge2 = '';\r\n var panelForwarded = 'discussion';\r\n var numberUser = '';\r\n try{\r\n if(flag==0 || flag==2){\r\n\r\n var panelComImage = response.image;\r\n var panelComId = response._id;\r\n var panelComName = response.name;\r\n\r\n if(flag==2)\r\n {\r\n numberUser = 'Request('+response.request.length+')';\r\n numberUser = \"<a class='comnametxt-user' href='/community/manageCommunity/\"+panelComId+\"'>\"+numberUser+\"</a>\";\r\n badge = '<label class=\"label label-success\" style=\"cursor:pointer !important;\"><i class=\"fa fa-cogs\"></i></label>';\r\n }else{\r\n numberUser = 'Members('+response.user.length + response.admin.length+')';\r\n numberUser = \"<a class='comnametxt-user' href='/community/communitymembers/\"+panelComId+\"'>\"+numberUser+\"</a>\";\r\n badge = '<label class=\"label label-success\" style=\"cursor:pointer !important;\"><i class=\"fa fa-cogs\"></i></label>';\r\n }\r\n }else if(flag==1){\r\n var panelComImage = response.image;\r\n var panelComId = response._id;\r\n var panelComName = response.name;\r\n panelForwarded = 'communityprofile';\r\n numberUser = 'Members('+response.request.length+')';\r\n numberUser = \"<a class='comnametxt-user' style='text-decoration:none;color:black;cursor:context-menu'>\"+numberUser+\"</a>\";\r\n badge = '<label class=\"label label-danger\" style=\"cursor:pointer !important;\"><i class=\"fa fa-times\"></i></label>';\r\n badge2 = '<label class=\"label label-danger\">Pending</label>&nbsp;&nbsp;&nbsp;';\r\n }else if(flag==3){\r\n var panelComImage = response.image;\r\n var panelComId = response._id;\r\n var panelComName = response.name;\r\n panelForwarded = 'communityprofile';\r\n numberUser = 'Members('+response.request.length+')';\r\n numberUser = \"<a class='comnametxt-user' style='text-decoration:none;color:black;cursor:context-menu'>\"+numberUser+\"</a>\";\r\n badge = '<label class=\"label label-success\" style=\"cursor:pointer !important;\"><i class=\"fa fa-times\"></i></label>';\r\n badge2 = '<label class=\"label label-success\">Invitation</label>&nbsp;&nbsp;&nbsp;';\r\n }\r\n code=\"<div class='col-sm-12 col-xs-12 \"+extClass+\" community-div' style='margin-top:5px;' id='can\"+panelComId+\"'>\";\r\n code +=\"<div class='col-sm-1 col-xs-3' style='padding:10px;z-index:1'>\";\r\n code +=\"<a href='/community/\"+panelForwarded+\"/\"+panelComId+\"'><img src='/Upload/CommunityProfile/\"+panelComImage+\"' class='cpic'></a>\";\r\n code +=\"</div>\";\r\n code +=\"<div class='col-sm-10 col-xs-7' style='padding-top:25px;padding-bottom:5px;overflow:scroll'>\";\r\n code +=\" <p style='margin:0'><a class='comnametxt' href='/community/\"+panelForwarded+\"/\"+panelComId+\"'>\"+badge2+panelComName+\"</a>&nbsp;&nbsp;&nbsp;\"+numberUser+\"</p>\";\r\n code +=\"</div>\";\r\n code +=\"<div class='col-sm-1 col-xs-2' style='padding:0'>\";\r\n if(flag==1)\r\n {\r\n code +=\"<a class='community-short-btn' onclick='cancelRequest(\\\"\"+panelComId+\"\\\")' style='float:right'>\";\r\n code +=badge+\"</a>\";\r\n } else if(flag==2)\r\n {\r\n code +=\"<a class='community-short-btn' href='/community/manageCommunity/\"+panelComId+\"' style='float:rignt'>\";\r\n code +=badge+\"</a>\";\r\n }else if(flag==3)\r\n {\r\n code +=\"<a class='fa fa-check' onclick='acceptInvitation(\\\"\"+panelComId+\"\\\")' style='float:right'>\";\r\n code +=badge+\"</a>\";\r\n }\r\n code +=\"</div>\";\r\n code +=\"</div>\";\r\n anyCommunity = true;\r\n }catch(err){\r\n code = '';\r\n }\r\n return code;\r\n}", "title": "" }, { "docid": "20ff6e77a209ace0d67f210e7120d3d6", "score": "0.6119271", "text": "addDueDateNotification() {\n this.notificationDOMRef.current.addNotification({\n title: \"Warning\",\n message: \"Project Will Be Overdue\",\n type: \"warning\",\n insert: \"top\",\n container: \"top-right\",\n animationIn: [\"animated\", \"fadeIn\"],\n animationOut: [\"animated\", \"fadeOut\"],\n dismiss: { duration: 5000 },\n dismissable: { click: true }\n });\n }", "title": "" }, { "docid": "dd80c7f99422802d9c770d688cafe736", "score": "0.61181897", "text": "function showNotificationModal(mesgg) {\n\n\n modal = document.getElementById(\"alert_modal\").style.display = \"block\";//opens the modal\n document.getElementById(\"errorMesg_1\").innerHTML = mesgg;\n}", "title": "" }, { "docid": "a286b81aa6d683c6337dd1cccac1e463", "score": "0.61117876", "text": "function addNotification(dismiss, area, text, severity) {\n if(!dismiss) {\n // IF there is already a notification on the screen, get rid of it\n if($(\".alert\").length > 0) {\n $(\".alert\").remove();\n }\n\n var notificationHtml = '<div class=\"alert '+severity+'\">'+\n '<span onclick=\"addNotification(true)\" class=\"closebtn\">&times;</span>'+\n text+\n '</div>';\n\n $(area).prepend(notificationHtml);\n }\n else {\n $(\".alert\").remove();\n }\n}", "title": "" }, { "docid": "5c66036823f08b8cf9849a476fa15e41", "score": "0.6109793", "text": "notify(message, type) {\n const { mario } = this.game;\n document.getElementById('updates-area').innerHTML = `\n <div class=\"update-${type}\">Day ${Math.ceil(mario.day)}: ${message}</div>\n ${document.getElementById('updates-area').innerHTML}\n `;\n }", "title": "" }, { "docid": "beb18d1043e1342ef4ae07686b838beb", "score": "0.6095652", "text": "function ShowNotifications(container, message, type, relatedto){\n var _NotificationTypes = [\"warning\", \"danger\", \"success\", \"info\"];\n \n if (Array.prototype.indexOf(type, _NotificationTypes)){\n container.append(\n '<p role=\"alert\" class=\"notification bg-' + type + '\" id =\"' + relatedto + '-notification\"><strong>' +\n type + '</strong> : <i>' + relatedto + '</i>, ' + message + '!</p>'\n )\n }\n }", "title": "" }, { "docid": "2fa87994facb317fc39359d3233e0f2a", "score": "0.60926956", "text": "function notificationListener() {\n notificationBell.addEventListener(\"click\", () => {\n if(dropDown.style.display !== \"block\"){\n dropDown.style.display = \"block\";\n sizeNotificationContainer();\n }\n });\n}", "title": "" }, { "docid": "9214240fdbc49a362ecb09b644d52c69", "score": "0.6089941", "text": "function gLyphsNoUserWarn(message) {\n var main_div = document.getElementById(\"global_panel_layer\");\n if(!main_div) { return; }\n\n var e = window.event\n moveToMouseLoc(e);\n var ypos = toolTipSTYLE.ypos-35;\n if(ypos < 100) { ypos = 100; }\n\n var divFrame = document.createElement('div');\n main_div.appendChild(divFrame);\n divFrame.setAttribute('style', \"position:absolute; background-color:LightYellow; text-align:left; \"\n +\"border:inset; border-width:1px; padding: 3px 7px 3px 7px; \"\n +\"z-index:1; opacity: 0.95; \"\n +\"left:\" + ((winW/2)-200) +\"px; \"\n +\"top:\"+ypos+\"px; \"\n +\"width:400px;\"\n );\n var tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"font-size:14px; font-weight:bold;\");\n var tspan = tdiv.appendChild(document.createElement('span'));\n tspan.innerHTML = \"Warning: Not logged into the ZENBU system\";\n\n var a1 = tdiv.appendChild(document.createElement('a'));\n a1.setAttribute(\"target\", \"top\");\n a1.setAttribute(\"href\", \"./\");\n a1.setAttribute(\"onclick\", \"gLyphsSaveConfigParam('cancel'); return false;\");\n var img1 = a1.appendChild(document.createElement('img'));\n img1.setAttribute(\"src\", eedbWebRoot+\"/images/close_icon16px_gray.png\");\n img1.setAttribute(\"style\", \"float: right;\");\n img1.setAttribute(\"width\", \"16\");\n img1.setAttribute(\"height\", \"16\");\n img1.setAttribute(\"alt\",\"close\");\n\n var tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"margin-top:10px; font-size:12px;\");\n var tspan = tdiv.appendChild(document.createElement('span'));\n tspan.innerHTML = \"In order to \"+message+\", you must first log into ZENBU.\";\n //tspan.innerHTML += \"<br>Please go to the <a href=\\\"../user/#section=profile\\\">User profile section</a> and either create a profile or login with a previous profile.\";\n eedbLoginAction(\"login\");\n}", "title": "" } ]
773fd27e6d7a31dffbcf563aea1a6b86
Creates a infoPanel Object
[ { "docid": "74e4297e2cb38926769afddbaa68dda1", "score": "0.0", "text": "constructor() {\n }", "title": "" } ]
[ { "docid": "973c8919be97b34b84256d0d6555a602", "score": "0.7583087", "text": "function creatAboutPanel() {\n return new Ext.Panel({\n border : true,\n id : 'infoPanel',\n baseCls : 'md-info',\n autoWidth : true,\n autoLoad : {\n url : catalogue.services.rootUrl + '/about?modal=true',\n callback : loadCallback,\n scope : this,\n loadScripts : true\n }\n });\n }", "title": "" }, { "docid": "5fd1f7b96e590d14ee5c768f01bc0ec7", "score": "0.74007976", "text": "createInfoDiv() {\n this.createInfoDivElements();\n this.setStyleForInfoDiv();\n }", "title": "" }, { "docid": "f8470976d40fa246e14764f38c00acae", "score": "0.7247455", "text": "function InfoPanel() {\n}", "title": "" }, { "docid": "114ba6ff93890f79ead9de5c11a0d439", "score": "0.70447755", "text": "function ObjectPanelInfo(){\n\n\tvar Info = new Object;\n\n\t//static render info\n\tInfo.m_StaticRenderInfo = {\n\t\t'topPad': 3,\n\t\t'bottomPad': 3,\n\t\t'leftPad': 3,\n\t\t'rightPad': 3,\n\n\t\t//pad in a part\n\t\t'withinoriginXPad': 3,\n\t\t'withinoriginYPad': 3,\n\n\t\t//height pad between different parts\n\t\t'titleoriginPad':3,\n\t\t'origindefinedPad': 3\n\t};\n\n\tInfo.m_ObjectRenderInfo = {\n\t\t'ltwidth': 20,\n\t\t'lrwidthgap': 5,\n\t\t'tbheightgap': 5,\n\t\t'ltheight': 10,\n\t\t'fontSize': 10,\n\t\t'bheight': 10\n\t};\n\n\tInfo.m_titleFontSize = 12;\n\n\t/* Geo Info */\n\tInfo.m_ObjectGroupRenderInfo = {};//the whole group panel\n\tInfo.m_mapGroupIdRenderInfo = {};//the map from group id to its render info \n\n\t//left,top,width,height\n\tInfo.m_TitleRenderInfo = {};//the title part\n\tInfo.m_OriginGroupsRenderInfo = {};//the origin group part\t\n\tInfo.m_DefinedGroupsRenderInfo = {};//the defined group part\n\n\t/* Geo Info */\n\t//generate render info\n\tInfo.computeObjectPanelRenderInfo = function(panelWidth){\n\n\t\tvar self = this;\n\n\t\tself.m_ObjectGroupRenderInfo['width'] = panelWidth;\t\n\n\t\t//compute title part\n\t\tself.computeTitleRenderInfo();\n\n\t\t//compute origin part\n\t\tself.computeOriginRenderInfo();\n\n\t\t//compute defined part\n\t\tself.computeDefinedRenderInfo();\n\t\n\t\tself.m_OriginGroupsRenderInfo['height'] = self.m_DefinedGroupsRenderInfo['top'] + self.m_DefinedGroupsRenderInfo['height'] + self.m_StaticRenderInfo['bottomPad'];\n\t}\n\n\t//compute the renderinfo of title\n\tInfo.computeTitleRenderInfo = function(){\n\t\tvar TitleSize = getTextSize(self.m_TitleContent, self.m_titleFontSize + 'px');\n\t\tthis.m_TitleRenderInfo['left'] = this.m_StaticRenderInfo['leftPad'];\n\t\tthis.m_TitleRenderInfo['top'] = this.m_StaticRenderInfo['topPad'];\n\t\tthis.m_TitleRenderInfo['width'] = TitleSize['w'];\n\t\tthis.m_TitleRenderInfo['height'] = TitleSize['h'];\n\t}\n\n\t//compute the renderinfo of origin part\n\tInfo.computeOriginRenderInfo = function(){\n\t\tvar self = this;\n\n\t\t//left-top point\t\n\t\tself.m_OriginGroupsRenderInfo['left'] = self.m_StaticRenderInfo['leftPad'], \n\t\tself.m_OriginGroupsRenderInfo['top'] = self.m_TitleRenderInfo['top'] + self.m_TitleRenderInfo['height'] + self.m_StaticRenderInfo['titleoriginPad'];\n\n\t\t//for the origin group\n\t\tvar ltpos = {\n\t\t\t'x': self.m_OriginGroupsRenderInfo['left'],\n\t\t\t'y': self.m_OriginGroupsRenderInfo['top']\n\t\t};\n\n\t\tvar originGroupHeight = 0;\n\t\tvar originGroupWidth = self.m_ObjectGroupRenderInfo['width'] - self.m_StaticRenderInfo['leftPad'] - self.m_StaticRenderInfo['rightPad'];\n\t\t\n\t\tvar liGroupId = g_ObjectGroupManager.getGroupIdList();\n\t\t$.each(liGroupId, function(i, iGroupId){\n\n\t\t\tvar liEleIds = g_ObjectGroupManager.getEleIdsbyGroupId(iGroupId),\n\t\t\t\tEleNum = liEleIds.length;\n\t\t\tvar sAbstract = g_ObjectGroupManager.getAttrsbyGroupId(iGroupId);\n\t\t\tvar sType = sAbstract['name'];\n\t\t\tvar OGroupRenderSize = self.computeOGroupRenderSize(sType, EleNum); //width, height\n\n\t\t\tvar objectRenderInfo = {};\n\t\t\tobjectRenderInfo['left'] = ltpos['x'];\n\t\t\tobjectRenderInfo['top'] = ltpos['y'];\n\n\t\t\tif (originGroupHeight == 0)\n\t\t\t\toriginGroupHeight += OGroupRenderSize['height'];\n\n\t\t\tif (ltpos['x'] + OGroupRenderSize['width'] >= originGroupWidth) {\n\t\t\t\tvar rowHeight = (OGroupRenderSize['height'] + self.m_StaticRenderInfo['withinoriginYPad']);\n\t\t\t\toriginGroupHeight['height'] += rowHeight;\n\t\t\t\tltpos['x'] = self.m_OriginGroupsRenderInfo['left'];\n\t\t\t\tltpos['y'] += rowHeight;\n\t\t\t} else {\n\t\t\t\tltpos['x'] += OGroupRenderSize['width'] + self.m_StaticRenderInfo['withinoriginXPad'];\n\t\t\t}\n\t\t\tobjectRenderInfo['width'] = OGroupRenderSize['width'];\n\t\t\tobjectRenderInfo['height'] = OGroupRenderSize['height'];\n\t\t\tself.m_mapGroupIdRenderInfo[iGroupId] = objectRenderInfo;\n\t\t});\n\n\t\tself.m_OriginGroupsRenderInfo['width'] = originGroupWidth;\n\t\tself.m_OriginGroupsRenderInfo['height'] = originGroupHeight;\n\t}\n\n\t//compute the renderinfo of defined part\n\tInfo.computeDefinedRenderInfo = function(){\n\t\tvar self = this;\n\t\tself.m_DefinedGroupsRenderInfo['top'] = self.m_OriginGroupsRenderInfo['top'] + self.m_OriginGroupsRenderInfo['height'] + self.m_StaticRenderInfo['origindefinedPad'];\n\t\tself.m_DefinedGroupsRenderInfo['left'] = self.m_StaticRenderInfo['leftPad'];\n\t\tself.m_DefinedGroupsRenderInfo['width'] = 0;\n\t\tself.m_DefinedGroupsRenderInfo['height'] = 0;\n\t}\n\n\t//compute the renderinfo of a group, return {width, height}\n\tInfo.computeOGroupRenderSize = function(sType, EleNum){\n\t\tvar OGroupRenderInfo = {};\n\t\tvar textSize = getTextSize('' + EleNum, this.m_ObjectRenderInfo['fontSize']);\n\t\tOGroupRenderInfo['width'] = this.m_ObjectRenderInfo['ltwidth'] + this.m_ObjectRenderInfo['lrwidthgap'] + textSize['w'];\n\t\tOGroupRenderInfo['height'] = textSize['h'] + this.m_ObjectRenderInfo['tbheightgap'] + this.m_ObjectRenderInfo['bheight'];\n\t\treturn OGroupRenderInfo;\n\t}\n\n\t/*** get info ***/\n\t//get the object-panel width\n\tInfo.getPanelWidth = function(){\n\t\treturn this.m_ObjectGroupRenderInfo['width'];\n\t}\n\t//get the object-panel height\n\tInfo.getPanelHeight = function() {\n\t\treturn this.m_ObjectGroupRenderInfo['height'];\n\t}\n\t//get the renderinfo given a group id\n\tInfo.getGroupRenderInfo = function(iGroupId){\n\t\treturn this.m_mapGroupIdRenderInfo[iGroupId];\n\t}\n\t//get the renderinfo of the original group\n\tInfo.getOriginGroupRenderInfo = function(){\n\t\treturn this.m_OriginGroupsRenderInfo;\n\t}\n\t//get the renderinfo of the defined group\n\tInfo.getDefinedGroupRenderInfo = function(){\n\t\treturn this.m_DefinedGroupsRenderInfo;\n\t}\n\t//clear\n\tInfo.clear = function(){\t\t\n\t\tthis.m_OriginGroupsRenderInfo = {};\n\t\tthis.m_ObjectGroupRenderInfo = {};\n\t\tthis.m_mapGroupIdRenderInfo = {};\n\t\tthis.m_DefinedGroupsRenderInfo = {};\n\t}\n\n\tInfo.__init__();\n\treturn Info;\n}", "title": "" }, { "docid": "f1046be6b968fd971e3da48b4664fc49", "score": "0.6836606", "text": "function makeInfo() {\r\n var info = document.createElement('div');\r\n info.className = 'info';\r\n document.body.appendChild(info);\r\n}", "title": "" }, { "docid": "1394c27997da7642f6e43853022b9347", "score": "0.66347086", "text": "function addInfoWindow(name, tower_info){\n\n\t\treturn new google.maps.InfoWindow({\n\t\t\tname: name,\n\t \tcontent: tower_info\n\t \t});\n\t}", "title": "" }, { "docid": "f809d4a20c3c8bf3868d7f2690122fff", "score": "0.6596932", "text": "function create_info_window(data) {\n // Collecting Data to open it on the infow window on the map \t\n ContentOfInfoUniversityWindow = '<div class=\"info-window-content\" style=\"background-color:orange;\">' +\n '<h3 class=\"title\" style=\"color:blue;\"><b>' + data.name + \"</b></h3>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.county + \" </div>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.country + \"</div>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.label + \"</div>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.region + \"</div>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.region_gid + \"</div>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.country_a + \"</div>\" +\n '<div class=\"content\" style=\"color:green;\">' + data.country_gid + \"</div></div>\";\n //Assigning Data to info window\n return ContentOfInfoUniversityWindow;\n}", "title": "" }, { "docid": "474e3c0e5dde61f5c85723597a8568e5", "score": "0.6508153", "text": "function createInformationBox() {\n if (informationBox === undefined) {\n informationBox = addDiv(body, 'datapoint-infobox');\n informationBox.style('display', 'none')\n .on('mouseover',\n function () {\n preventEventBubbling();\n hideInformationBox();\n });\n informationBoxWidth =\n getNodeDimension(informationBox, 'width')\n + informationBoxOffset;\n informationBoxHeight =\n getNodeDimension(informationBox, 'height')\n + informationBoxOffset;\n }\n }", "title": "" }, { "docid": "5a194e0150e9b56431c86e3508c96d72", "score": "0.64515686", "text": "function initialize_info_box(){\n info = L.control();\n // Prepare Template\n var info_source = $(\"#info_template\").html();\n var info_template = Handlebars.compile(info_source);\n info.onAdd = function (map) {\n this._div = L.DomUtil.create('div', 'info'); // create a div with a class \"info\"\n this.update({});\n return this._div;\n };\n info.update = function (context) {\n this._div.innerHTML = info_template(context);\n };\n info.addTo(map);\n}", "title": "" }, { "docid": "5a194e0150e9b56431c86e3508c96d72", "score": "0.64515686", "text": "function initialize_info_box(){\n info = L.control();\n // Prepare Template\n var info_source = $(\"#info_template\").html();\n var info_template = Handlebars.compile(info_source);\n info.onAdd = function (map) {\n this._div = L.DomUtil.create('div', 'info'); // create a div with a class \"info\"\n this.update({});\n return this._div;\n };\n info.update = function (context) {\n this._div.innerHTML = info_template(context);\n };\n info.addTo(map);\n}", "title": "" }, { "docid": "fa91fba454dfc6381cfbef0a2e823bb9", "score": "0.643036", "text": "function CreateInfoOverlay() { \n CreateOverlayGraphic();\n CreateOverlayCrossButton();\n CreateOverlayHelperText();\n}", "title": "" }, { "docid": "9d50b453644decffcc194a693dd9d392", "score": "0.6428191", "text": "function showInfo(text) {\n var infoPanel = myDocker.addPanel('Info Panel', wcDocker.DOCK.MODAL, null);\n infoPanel.layout().scene().find('span').text(text);\n }", "title": "" }, { "docid": "4968d3933d7be4dc0833e2a09392e2d3", "score": "0.6366477", "text": "function openInfo(panelName) {\n\t\n\t// Show the current panel if display is \"none\", hide if \"block\"\n\tif (document.getElementById(panelName).style.display === \"none\"){\n\t document.getElementById(panelName).style.display = \"block\";\n\t} else {\n\t document.getElementById(panelName).style.display = \"none\";\n\t}\n}", "title": "" }, { "docid": "5e5c7a664f349561f7b076352a251ba5", "score": "0.63575876", "text": "function Infos(obj) {\n this.PADDING = 20;\n this.FONT_FAMILY = 'Arial';\n this.FONT_SIZE = '0.9em';\n this.INDENT_SIZE = 20;\n \n this.indentLevel = 0;\n this.obj = obj;\n this.DOM = $('<div></div>');\n \n this.initDOM();\n }", "title": "" }, { "docid": "a920daa38e8d20627749eed521775356", "score": "0.6356872", "text": "function showInfoPanel() {\n\tdocument.getElementById(\"info-container\").classList.toggle('info-active');\n}", "title": "" }, { "docid": "4ef78cd06caeb877e74eb76ccf9a9968", "score": "0.62824357", "text": "function createInfo(info) {\n google.maps.event.addListener(info, 'click', function() {\n infowindow.setContent(info.title);\n infowindow.open(map, info);\n });\n}", "title": "" }, { "docid": "cbd9d79aabcb1f7b7a867fa527a4b3a4", "score": "0.6277069", "text": "function createInfoWindow(){\n infoWindow = new BrowserWindow({\n width:300,\n height:200,\n title:'Info'\n });\n\n infoWindow.loadURL(url.format({\n pathname: path.join(__dirname, 'infoWindow.html'),\n protocol:'file:',\n slashes:true\n }));\n\n infoWindow.on('close', function(){\n infoWindow = null;\n });\n}", "title": "" }, { "docid": "baea5131d4b56f0ab3e47de469de68a5", "score": "0.6269126", "text": "makeInfoPopup() {\n\t\tthrow new Error('No implementation!');\n\t}", "title": "" }, { "docid": "83b243515cb05d5e3c2fd087e5ab7f74", "score": "0.6236952", "text": "function setInfoHTML(){\n\t\tbottom.add(info);\n\t\tinfo.show();\n\t}", "title": "" }, { "docid": "397c764cd690f0355039651c696f6e54", "score": "0.6193362", "text": "function showPanel(placeResult) {\n // If infoPane is already open, close it\n if (infoPane.classList.contains(\"open\")) {\n infoPane.classList.remove(\"open\");\n }\n // Clear the previous details\n while (infoPane.lastChild) {\n infoPane.removeChild(infoPane.lastChild);\n }\n // Add the primary photo, if there is one\n if (placeResult.photos) {\n let firstPhoto = placeResult.photos[0];\n let photo = document.createElement('img');\n photo.classList.add('pics');\n photo.src = firstPhoto.getUrl();\n infoPane.appendChild(photo);\n }\n // Add place details with text formatting\n let name = document.createElement('h1');\n name.classList.add('place');\n name.textContent = placeResult.name;\n infoPane.appendChild(name);\n if (placeResult.rating) {\n let rating = document.createElement('p');\n rating.classList.add('details');\n rating.textContent = `Rating: ${placeResult.rating} ✮`;\n infoPane.appendChild(rating);\n }\n let address = document.createElement('p');\n address.classList.add('details');\n address.textContent = placeResult.formatted_address;\n infoPane.appendChild(address);\n if (placeResult.website) {\n let websitePara = document.createElement('p');\n let websiteLink = document.createElement('a');\n let websiteUrl = document.createTextNode(placeResult.website);\n websiteLink.appendChild(websiteUrl);\n websiteLink.title = placeResult.website;\n websiteLink.href = placeResult.website;\n websitePara.appendChild(websiteLink);\n infoPane.appendChild(websitePara);\n }\n // Open the infoPane\n infoPane.classList.add(\"open\");\n }", "title": "" }, { "docid": "88f11ac36208f9546bbca5c7865a19e1", "score": "0.6185722", "text": "function showInfo(lyrId){\n\tvar lyr = map.getLayer(lyrId);\n\tvar lyrInfo = document.createElement('div');\n\tlyrInfo.id = \"lyrDialog\";\n\tlyrInfo.title = \"Layer Metadata\"\n\tlyrInfo.innerHTML = lyr.metadata.info;\n\t$(\"#map\").append(lyrInfo);\n\t$(\"#lyrDialog\").dialog({ modal:true,\n\t\tresizeable: false,\n\t\tdraggable: false,\n\t\theight:\"auto\",\n\t\tmaxHeight:450,\n\t\twidth: 480,\n\t\tdialogClass: \"dialogBox\"\n\t});\n\n}", "title": "" }, { "docid": "84555f7a289b3f9e531849ef68ea5e92", "score": "0.61755234", "text": "createWindowInformation() {\n const rect = new Rectangle(330, 100, 285, 350);\n this.windowInformation = new WindowBox(rect.x, rect.y, rect.width, rect.height, {\n padding: WindowBox.SMALL_PADDING_BOX\n });\n }", "title": "" }, { "docid": "8e1e9be2f64f4adcade54c01b2511d1e", "score": "0.61706567", "text": "function create_info_window(id, descp, fn, fnwav, id)\n\t{\n\t\tvar marker_div = '<div class=\"markerDiv\">'+descp+'<br /><audio controls=\"controls\" preload=\"metadata\"><source src=\"'+ fn +'\" type=\"audio/mpeg\" /><source src=\"'+ fnwav +'\" type=\"audio/wav\" /><object type=\"application/x-shockwave-flash\" data=\"js/player.swf\" id=\"audioplayer'+id+'\" height=\"24\" width=\"290\"><param name=\"movie\" value=\"js/player.swf\"><param name=\"FlashVars\" value=\"playerID='+id+'&amp;soundFile='+ fn +'&titles='+descp+'\"><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"></object></audio></div>';\n\t\tvar iw = new google.maps.InfoWindow({\n\t\t\tcontent: marker_div\n\t\t});\n\t\tiw.setZIndex(150);\n\n\t\treturn iw;\n\t}", "title": "" }, { "docid": "5ca48c49c2e094bfe3d6d3e95438c68c", "score": "0.61215615", "text": "function showPanel(placeResult) {\n // If infoPane is already open, close it\n if (info.classList.contains(\"open\")) {\n info.classList.remove(\"open\");\n }\n\n // Clear the previous details\n while (info.lastChild) {\n info.removeChild(info.lastChild);\n }\n\n \n // On click the infoWindown will display a photo with detail of place.\n if (placeResult.photos) {\n let firstPhoto = placeResult.photos[0];\n let photo = document.createElement('img');\n photo.classList.add('hero');\n photo.src = firstPhoto.getUrl();\n info.appendChild(photo);\n }\n\n // Add place details with text formatting\n let name = document.createElement('h1');\n name.classList.add('place');\n name.textContent = placeResult.name;\n info.appendChild(name);\n if (placeResult.rating) {\n let rating = document.createElement('p');\n rating.classList.add('details');\n rating.textContent = `Rating: ${placeResult.rating} \\u272e`;\n info.appendChild(rating);\n }\n let address = document.createElement('p');\n address.classList.add('details');\n address.textContent = placeResult.formatted_address;\n info.appendChild(address);\n if (placeResult.website) {\n let para = document.createElement('p');\n let link = document.createElement('a');\n link.classList.add('link');\n para.classList.add('paragraph');\n link.innerText = 'Link!';\n\n //let Url = document.createTextNode(placeResult.website);\n //link.appendChild(Url);\n link.title = placeResult.website;\n link.href = placeResult.website;\n para.appendChild(link);\n info.appendChild(para); \n }\n\n // Open the infoPane\n info.classList.add(\"open\");\n }", "title": "" }, { "docid": "e240edfb5b3496b6cf0f622cd0e6863e", "score": "0.60914725", "text": "function infoGen(data){\n var infowindow = new google.maps.InfoWindow(data);\n return infowindow;\n }", "title": "" }, { "docid": "a21a1358383e782e3ae39dfc7fc5f31c", "score": "0.60459226", "text": "function writeActiveContent(infoItemData) {\n // create all necessary elements\n let infoBox = document.createElement(\"div\");\n let imgElem = document.createElement(\"div\");\n let infoItem = document.createElement(\"div\");\n let dateElem = document.createElement(\"p\");\n let headingElem = document.createElement(\"h3\");\n let subheadingElem = document.createElement(\"h4\");\n let seeMoreElem = document.createElement(\"a\");\n // add classes\n infoItem.classList.add(\"infoBar__item\");\n imgElem.classList.add(\"infoBar__image\");\n infoBox.classList.add(\"infoBar__details\");\n // add link Url\n seeMoreElem.href = \"#\";\n // set background of container\n imgElem.style.backgroundImage = `url(${infoItemData.img})`;\n // alter inner html\n dateElem.innerHTML = infoItemData.date;\n headingElem.innerHTML = infoItemData.heading;\n subheadingElem.innerHTML = infoItemData.subheading;\n seeMoreElem.innerHTML = settings.seeMoreMsg;\n // build infoItem\n infoItem.appendChild(imgElem);\n infoItem.appendChild(infoBox);\n infoBox.appendChild(dateElem);\n infoBox.appendChild(headingElem);\n infoBox.appendChild(subheadingElem);\n infoBox.appendChild(seeMoreElem);\n // append infoItem\n infoParCont.appendChild(infoItem);\n }", "title": "" }, { "docid": "f0225affac77009a7ed6b91fcf626838", "score": "0.60338545", "text": "function populateInfoPane() {\n var generatedHTML = '<div id =\"InfoPaneEntries\">';\n generatedHTML += '</div>';\n generatedHTML += servingGlobeName;\n document.getElementById('InfoPaneServingGlobe').innerHTML =\n servingGlobeName;\n\n if (descriptionLength > DESCRIPTION_LENGTH) {\n document.getElementById('InfoPaneDescription').innerHTML +=\n newServingGlobeDescription += '... <a href=\"#\"' +\n 'onclick=\"document.getElementById(\\'InfoPaneExpandedDescription\\')' +\n '.style.display=\\'block\\';document.getElementById(' +\n '\\'InfoPaneDescription\\').style.display=\\'none\\';\">more</a>';\n document.getElementById('InfoPaneExpandedDescription').innerHTML +=\n servingGlobeDescription += '&nbsp;&nbsp;<a href=\"#\"' +\n 'onclick=\"document.getElementById(\\'InfoPaneExpandedDescription\\')' +\n '.style.display=\\'none\\';document.getElementById(' +\n '\\'InfoPaneDescription\\').style.display=\\'block\\';\">hide</a>';\n } else {\n document.getElementById('InfoPaneDescription').innerHTML +=\n servingGlobeDescription;\n }\n}", "title": "" }, { "docid": "9edccfa632caddfbc6c92a2e82d181ff", "score": "0.6003802", "text": "function createInfoWindow(Json_stand_info)\n{\n var content=\"\";\n content = content+\"<div>\";\n content = content+\"<header>\";\n content = content+\"<img src='\";\n content = content+ Json_stand_info.title + \"</header>\";\n content = content+\"<section>\";\n content = content+\"<article>\";\n\n}", "title": "" }, { "docid": "7468a8f23ea33f64494ffdfb24da557d", "score": "0.5998834", "text": "function showBaseInfoWin(configOptions, data) {\n\n var attributes = data.attributes,\n attrList = [],\n gridTitle = data.layerLabel,\n fieldMapping = configOptions ? configOptions.fieldMapping : null,\n infoLabelAttr,\n fieldValue;\n\n // costruisco l'array con gli attributi della feature\n for (var attr in attributes) {\n if (attributes.hasOwnProperty(attr)) {\n infoLabelAttr = fieldMapping ? fieldMapping[attr] : attr;\n fieldValue = attributes[attr] || '';\n attrList.push({\"infoLabelAttr\": infoLabelAttr, \"fieldValue\": fieldValue});\n }\n }\n\n // se esiste la finestra la distruggo\n if (me.getBaseInfoWin()) {\n me.getBaseInfoWin().destroy();\n }\n\n var win = Ext.create(\"CWN2.button.InfoWms.baseInfo.Window\", {\n title: data.layerLabel,\n items: [\n Ext.create(\"CWN2.button.InfoWms.baseInfo.GridPanel\", {\n data: attrList\n })\n ]\n });\n\n win.show().alignTo(CWN2.app.layout.mapPanel.body, \"tl-tl\", [500, 10]);\n\n //Ext.WindowManager.register(win);\n //Ext.WindowManager.bringToFront(win);\n\n }", "title": "" }, { "docid": "7edc5ac9629b5b771849a056dc7ea01e", "score": "0.5975899", "text": "function activateInfoPanel(node) {\n nameHeading.innerText = node.data('full_name');\n jobHeading.innerText = node.data('job_title');\n while(jobList.firstChild) {\n jobList.removeChild(jobList.firstChild);\n }\n node.data('season_list').forEach( function(job) {\n let jobCard = document.createElement('li');\n jobCard.classList.add('list-group-item');\n jobCard.innerText = job;\n jobList.appendChild(jobCard);\n });\n infoPanel.classList.add('visible');\n}", "title": "" }, { "docid": "6f08877d6726333e7dac6831b6565b46", "score": "0.5949378", "text": "function createCapaInfo(_idCapa) {\n\tvar divCapa = document.createElement('div');\n\tdivCapa.setAttribute('id', _idCapa);\n\tdivCapa.style.position = \"absolute\";\n\tdivCapa.className = \"capaInfo\";\n\treturn divCapa;\n}", "title": "" }, { "docid": "9c714f88fd9c83978f566d1aee52eff0", "score": "0.59199244", "text": "function createInfo(info) {\n document.getElementById('empty').innerHTML = '';\n\n var header = document.createElement('div');\n var avatar = document.createElement('img');\n var personalInfo = document.createElement('div');\n var username = document.createElement('div');\n var fullname = document.createElement('div');\n var bio = document.createElement('div');\n\n header.setAttribute('class', 'header');\n avatar.setAttribute('src', info.avatar_url);\n avatar.setAttribute('class', 'avatar');\n personalInfo.setAttribute('class', 'personalInfo');\n username.setAttribute('class', 'username');\n fullname.setAttribute('class', 'fullname');\n bio.setAttribute('class', 'bio');\n\n username.innerHTML = '@' + info.login;\n fullname.innerHTML = info.name;\n bio.innerHTML = info.bio;\n\n personalInfo.append(username, fullname, bio);\n header.append(avatar, personalInfo);\n\n document.getElementById('empty').append(header);\n\n validate(info.login, username, '@username');\n validate(info.name, fullname, 'Full Name');\n validate(info.bio, bio, 'This user has no bio...');\n}", "title": "" }, { "docid": "7b13d7d20fbd231a9d564e22f97b1585", "score": "0.59140706", "text": "showPanel() {\n let panel = document.createElement(\"div\");\n panel.classList.add(\"panel\");\n\n let title = document.createElement(\"h2\");\n title.innerHTML = \"La Guerre\";\n\n panel.appendChild(title);\n this.main.appendChild(panel);\n }", "title": "" }, { "docid": "47c7b96c71145bd12a41c6f58580667c", "score": "0.59122527", "text": "setupInfos(){\n // Premier appel set position zone d'info\n let infoPosiLeft = this.mapLeft + this.mapWidth - this.infoWidth - 6;\n let infoPosiTop = this.mapTop + 4;\n // Move and display info table\n this.info.animate({left: infoPosiLeft + 'px'}, \"fast\");\n this.info.animate({top: infoPosiTop + 'px'}, \"fast\");\n this.info.show();\n }", "title": "" }, { "docid": "d798b57f05f998c7af74cb710dd47547", "score": "0.59049165", "text": "function infoData(){\n\tfor(i=0; i<dataInfo.length; i++){\n\n\t\tvar this_content = dataInfo[i];\n\n\t\tvar div = document.createElement(\"div\");\n\t\tvar h3 = document.createElement(\"h3\");\n\t\tvar p = document.createElement(\"p\");\n\n\t\th3.innerHTML = this_content.name;\n\t\tp.innerHTML = this_content.text;\n\n\t\tdiv.className += this_content.class;\n\n\t\t//fills in an Id if one exists\n\t\tif(this_content.id.length >= 2){\n\t\t\tdiv.setAttribute(\"id\", this_content.id);\n\t\t}\n\n\t\tdiv.append(p);\n\n\t\tif(this_content.section == \"iWrapper1\"){\n\t\t\tvar wrapper = \"light-content-wrapper\"\n\t\t}else if(this_content.section == \"iWrapper2\"){\n\t\t\tvar wrapper = \"light-content-wrapper2\"\n\t\t}\n\n\t\tdocument.getElementById(wrapper).appendChild(div);\n\t}\n\tinfoLoaded = true\n}", "title": "" }, { "docid": "d632f939fd4670e6502188dc61af3900", "score": "0.5845628", "text": "function displayInfo() {\n openInfoWindowAndAnimateMarker(this);\n }", "title": "" }, { "docid": "a4970b531f182d01597f9f9479571d30", "score": "0.584154", "text": "function OverlayPanelHolder(opts) {\n this.popupPanel = opts.popup;\n this.divElt = document.createElement('DIV');\n}", "title": "" }, { "docid": "0e0eda6bbf30e9f406bb7358b21d1777", "score": "0.5811416", "text": "function updateInfoPanel() {\n\tdocument.getElementById('level').innerHTML = '<b>Level:</b> ' + level + '';\n\t//document.getElementById('lives').innerHTML = '<b>Lives:</b> ' + lives + '';\n\tdocument.getElementById('points').innerHTML = '<b>Points:</b> ' + points + '';\n\n}", "title": "" }, { "docid": "f2956a7cea73270036f46f188b85eb55", "score": "0.58100337", "text": "function addInfo(data) {\n info.classList.add(\"animate\");\n teamName.innerHTML = `${data.team}`;\n yearsActive.innerHTML = `(${data.years_active})`;\n\n labelsLeft.innerHTML = `\n <p>Games:</p>\n <p>Goals:</p>\n <p>Assists:</p>\n `;\n\n valuesLeft.innerHTML = `\n <p>${data.games}</p>\n <p>${data.goals}</p>\n <p>${data.assists}</p>\n `;\n\n labelsRight.innerHTML = `\n <p>Points:</p>\n <p>+/-:</p>\n <p>PIM:</p>\n `;\n\n valuesRight.innerHTML = `\n <p>${data.points}</p>\n <p>${data.plus_minus}</p>\n <p>${data.pim}</p>\n `;\n\n setTimeout(function(){ info.classList.remove(\"animate\") }, 500)\n }", "title": "" }, { "docid": "d634e9e26b013d349c94c0089462d462", "score": "0.5790553", "text": "function createMakerWithInfoWindow(map, Json_stand_info)\n{\n var point = new BMap.Point(Json_stand_info.postion_x, Json_stand_info.postion_y);\n var marker = new BMap.Marker(point);\n var sContent = createInfoWindow(Json_stand_info);\n var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象\n\n map.addControl(new BMap.ZoomControl()); //添加地图缩放控件\n map.addOverlay(marker);\n marker.addEventListener(\"click\", function(){\n this.openInfoWindow(infoWindow);\n //图片加载完毕重绘infowindow\n map.centerAndZoom(point, 15);\n jQuery('imgDemo').load(function (){\n infoWindow.redraw(); //防止在网速较慢,图片未加载时,生成的信息框高度比图片的总高度小,导致图片部分被隐藏\n });\n });\n\n}", "title": "" }, { "docid": "7977403008036eb06d06f91cbec3d4b2", "score": "0.5789236", "text": "function createInfoWindow (placeInfo) {\n\tvar contentString = '<div id=\"content\">' + '<p><b>Name: </b>' + placeInfo.name + \n\t'</p>' + '<p><b>Phone: </b>' + placeInfo.phone + '</p>' + '<p><b>Address: </b>' + \n\tplaceInfo.address[0] + '</p></div>';\n\n\tvar infoWindow = new google.maps.InfoWindow({\n\t\tcontent: contentString\n\t});\n\n\t// add infowindow to the marker object within a place object\n\tplaceInfo.marker.infoWindow = infoWindow;\n\n\t// add listener to open infowindow on a marker click\n\tgoogle.maps.event.addListener(placeInfo.marker, 'click', function() {\n\t\tplaceInfo.marker.infoWindow.open(map, placeInfo.marker);\n\t});\n}", "title": "" }, { "docid": "74bba5163531e5898f72746a16320717", "score": "0.578832", "text": "function createInfoWindow(mapPoint) {\r\n google.maps.event.addListener(mapPoint.mapMarker(), 'click', function() {\r\n animateMarker(mapPoint.mapMarker());\r\n window.vm.handleInfoRequests(mapPoint);\r\n infoWindow.setContent(setInfoWindowContent(mapPoint.mapLocation(), mapPoint.mapNote(), mapPoint.mapLocationAddress()));\r\n infoWindow.open(map, mapPoint.mapMarker());\r\n });\r\n}", "title": "" }, { "docid": "3884786b8868eec525bb2fee5ecddcf2", "score": "0.57872236", "text": "function createPanel(){\n //file upload\n panel.add(params, 'loadFile').name('Load 3D Model');\n panel.add(params, 'Kinemake');\n panel.add(params, 'export').name('Export to STL');\n\n // modelUI.open();\n}", "title": "" }, { "docid": "3c7dfea769a66f04d055cd1130a5bd41", "score": "0.577952", "text": "constructor(id=\"body\", name=\"usini-panels\"){\n this.nb_panels = 0;\n this.panels = {};\n this.name = name;\n this.id = id;\n this.template = new UsiniTemplate();\n }", "title": "" }, { "docid": "1603d76d7e063411a35ae22c03408009", "score": "0.57771975", "text": "function Info(){\n\t\tthis.titre = \"\";\n\t\tthis.contenu = \"\";\n\t}", "title": "" }, { "docid": "f59aa58f2e7a861b52f3f876ab04f9ae", "score": "0.5770315", "text": "function createInfo(data) {\n var cardList = doc.querySelector('.info-list');\n // Create cards for each of the pieces of information\n data.forEach(function(item) {\n info[item.title] = item;\n });\n\n cardList.appendChild(createInfoCard(aboutCard));\n\n var infoArr = sortItems();\n\n infoArr.forEach(function(item) {\n var card = createInfoCard(item);\n if (!card)\n return;\n cardList.appendChild(card);\n });\n }", "title": "" }, { "docid": "06d543b6512a395c24808cc4f25f9cc9", "score": "0.5757169", "text": "function showInfopanel(version) {\n\n\tlet hasIcon = version.icon !== undefined;\n\tlet hasTitle = version.title !== undefined;\n\tlet hasSubtitle = version.subtitle !== undefined;\n\tlet hasDate = version.date !== undefined;\n\tlet hasPossibleDate = version.possibleDate !== undefined;\n\tlet hasFunFact = version.funFact !== undefined;\n\tlet hasMainFeat = version.mainFeatures !== undefined;\n\tlet hasMinorFeat = version.minorFeatures !== undefined;\n\tlet hasLearnMore = version.learnMore !== undefined;\n\tlet hasVideo = version.video !== undefined;\n\tlet hasLongDesc = version.longDescription !== undefined;\n\n\tif (hasTitle) {\n\t\tinfoTitleDOM.innerText = version.title;\n\t}\n\telse if (hasSubtitle) {\n\t\tinfoTitleDOM.innerText = version.subtitle;\n\t}\n\telse {\n\t\tinfoTitleDOM.innerText = \"Unknown Update\";\n\t}\n\n\tif (hasIcon) {\n\t\tshow(infoIconDOM);\n\t\tinfoIconDOM.src = ICON_VERSION_PATH + version.icon;\n\t}\n\telse {\n\t\thide(infoIconDOM);\n\t}\n\n\tif (hasSubtitle && hasTitle) {\n\t\tinfoSubtitleDOM.innerText = version.subtitle + (hasDate || hasPossibleDate ? \" • \" : \"\");\n\t}\n\telse {\n\t\tinfoSubtitleDOM.innerText = \"\";\n\t}\n\n\tif (hasDate && !hasPossibleDate) {\n\t\tlet date = new Date(parseUTC(version.date));\n\t\tinfoDateDOM.innerText = MONTH_NAMES[date.getMonth()] + \" \" + date.getDate() + \", \" + date.getFullYear();\n\t}\n\telse if (hasPossibleDate) {\n\t\tinfoDateDOM.innerText = version.possibleDate;\n\t}\n\telse {\n\t\tinfoDateDOM.innerText = \"\";\n\t}\n\n\tif (hasFunFact) {\n\t\tshow(infoFunFactDOM);\n\t\tinfoFunFactDOM.innerText = version.funFact;\n\t}\n\telse {\n\t\thide(infoFunFactDOM);\n\t}\n\n\tif (hasMainFeat) {\n\t\tshow(infoMainLabelDOM);\n\t\tdestroyChildren(infoMainFeatsDOM);\n\n\t\tfor (let i = 0; i < version.mainFeatures.length; i++) {\n\n\t\t\tinfoMainFeatsDOM.appendChild(make(\"li\", \"\", version.mainFeatures[i].text));\n\n\t\t}\n\n\t}\n\telse {\n\t\thide(infoMainLabelDOM);\n\t\tdestroyChildren(infoMainFeatsDOM);\n\t}\n\n\tif (hasMinorFeat) {\n\t\tshow(infoMinorLabelDOM);\n\t\tdestroyChildren(infoMinorFeatsDOM);\n\n\t\tfor (let i = 0; i < version.minorFeatures.length; i++) {\n\n\t\t\tinfoMinorFeatsDOM.appendChild(make(\"li\", \"\", version.minorFeatures[i].text));\n\n\t\t}\n\n\t}\n\telse {\n\t\thide(infoMinorLabelDOM);\n\t\tdestroyChildren(infoMinorFeatsDOM);\n\t}\n\n\tif (hasLearnMore) {\n\t\tshow(infoLearnMoreDOM);\n\t\tinfoLearnMoreDOM.href = version.learnMore.startsWith(\"#\") ? WIKI_PATH + version.learnMore.substring(1,version.learnMore.length) : version.learnMore;\n\n\t\tswitch (version.type) {\n\t\t\tcase \"minor\":\n\t\t\tcase \"major\":\n\t\t\t\tinfoLearnMoreDOM.innerText = \"Learn more about this update\";\n\t\t\t\tbreak;\n\t\t\tcase \"event\":\n\t\t\t\tinfoLearnMoreDOM.innerText = \"Learn more about this event\";\n\t\t\t\tbreak;\n\t\t\tcase \"memory\":\n\t\t\t\tinfoLearnMoreDOM.innerText = \"Learn more about this memory\";\n\t\t\t\tbreak\n\t\t}\n\n\t}\n\telse {\n\t\thide(infoLearnMoreDOM);\n\t}\n\t\n\tif (hasVideo) {\n\n\t\tinfoVideoLinkDOM.href = \"https://www.youtube.com/watch?v=\" + version.video;\n\t\tinfoVideoLinkDOM.src = \"https://www.youtube.com/embed/\" + version.video;\n\n\t\tplayer.cueVideoById(version.video);\n\n\t\tshow(infoVideoWrapperDOM);\n\t\tshow(infoVideoLinkWrapperDOM);\n\t} \n\telse {\n\t\thide(infoVideoWrapperDOM);\n\t\thide(infoVideoLinkWrapperDOM)\n\t}\n\n\tif (hasLongDesc) {\n\n\t\tdestroyChildren(infoLongDescriptionDOM);\n\t\tlet desc = typeof (version.longDescription) === \"string\" ? [version.longDescription] : version.longDescription;\n\n\t\tfor (let i = 0; i < desc.length; i++) {\n\n\t\t\tinfoLongDescriptionDOM.appendChild(make(\"p\",undefined,desc[i]));\n\n\t\t}\n\n\t}\n\telse {\n\t\tdestroyChildren(infoLongDescriptionDOM);\n\t}\n\n\tshow(infoWrapperDOM);\n\tinfoScrollerDOM.scrollTop = 0;\n\tlockBody();\n\thideNav();\n\n}", "title": "" }, { "docid": "ce171e1c97733a012090d48ff6eee331", "score": "0.57527065", "text": "function createInfoWindow(markerInfo, innerContent, type, cluster){\n\n var contentString =\n '<div class=\"map-listing-box map-listing-box-list\" style=\"overflow: auto; height: '+infoWindowHeight+'px;\">' +\n innerContent +\n '</div>';\n\n //styles for info box, uses google's infobox.js\n var infoBoxOptions = {\n content: contentString,\n disableAutoPan: true,\n maxWidth: 0,\n pixelOffset: new google.maps.Size(-142, -260),\n zIndex: null,\n boxStyle: {\n position: \"relative\",\n opacity: 1,\n width: 285,\n height: - (infoWindowHeight + 30)\n },\n closeBoxMargin: \"10px 2px 2px 2px\",\n closeBoxURL: \"\",\n infoBoxClearance: new google.maps.Size(1, 1),\n isHidden: false,\n pane: \"floatPane\",\n enableEventPropagation: false\n };\n\n //set info box for each marker depending on which type\n if(type == \"single\"){\n\n //if working with only clusters else single icons - need this for loading the map\n if(cluster != undefined){\n\n //set info box and push into array for single cluster\n var multiStacked = new InfoBox(infoBoxOptions);\n multiStacked.setPosition(cluster.getCenter());\n\n window.multiStackedInfoBoxes.push(multiStacked);\n multiStacked.open(map);\n\n //trigger carousel\n setTimeout(function(){\n window.imgSlider();\n },100)\n\n }else{\n markerInfo.info = new InfoBox(infoBoxOptions);\n }\n\n }else if(type == \"multi\"){\n //set info box and push into array for multi cluster\n var multiStacked = new InfoBox(infoBoxOptions);\n multiStacked.setPosition(cluster.getCenter());\n\n window.multiStackedInfoBoxes.push(multiStacked);\n multiStacked.open(map);\n\n }\n\n } // end createInfoWindow", "title": "" }, { "docid": "522669fcf6e6b31a965ef8665e835f26", "score": "0.5751373", "text": "displayInfo(){\n const infowindow = this.map.infowindow;\n infowindow.open(this.map, this);\n //remove old domready listener if present\n if(this.map.infoWindowReady) this.map.infoWindowReady.remove();\n this.map.infoWindowReady = infowindow.addListener('domready', this.setInfowindowFieldsBound);\n }", "title": "" }, { "docid": "5eeaa57f290dc52a2518b7d8c21951a9", "score": "0.57484597", "text": "function getInfo() {\n\t\tvar canvas = $(\".img-container\");\n\t\tcanvas.each(function(i) {\n\t\t\tvar title = $(this).find(\".title p\").text()\n\t\t\ttitle = $(\"<p>\").text(title);\n\t\t\tvar medSize = $(this).find(\".medium-size\").text();\n\t\t\tmedSize = $(\"<p>\").text(medSize);\n\n\t\t\tvar info = $(\"<div>\").addClass(\"mobInfo\").append(title).append(medSize);\n\t\t\tinfo.prependTo($(this));\n\t\t});\n\n\t}", "title": "" }, { "docid": "2de7914a6c31a84f76eb4cfbfca24cd2", "score": "0.5745568", "text": "function makeInfoWindowContent(siteObject) {\n var info;\n if ((siteObject[\"wasteInPlace\"] !== null) && (siteObject[\"capacity\"] !== null)) {\n info = (\n '<div class=\"window-content\" id='+siteObject[\"siteID\"]+'\">' +\n '<p><b>' + siteObject[\"siteName\"] + '</b></p>' +\n '<p>Waste in place: '+ siteObject[\"wasteInPlace\"] + ' tons (' + siteObject[\"wasteInPlaceYear\"] + ')' + '<br>' +\n 'Capacity: '+ siteObject[\"capacity\"] + '<br>' +\n 'Percent full: ' + siteObject[\"roundedFull\"] + '%' + '<br>' +\n 'Ownership: ' + siteObject[\"ownershipType\"] +\n '</div>');\n } else {\n info = (\n '<div class=\"window-content\">' +\n '<p><b>' + siteObject[\"siteName\"] + '</b></p>' +\n 'Ownership: ' + siteObject[\"ownershipType\"] +\n '</div');\n }\n return info;\n }", "title": "" }, { "docid": "9f2528e23762f5101e6503aefbf7b28c", "score": "0.572877", "text": "function showHtmlPanel(html, configOptions) {\n var width = configOptions.infoWidth || 400,\n height = configOptions.infoHeight || 500;\n\n // se esiste la finestra la distruggo\n if (me.getHtmlWin()) {\n me.getHtmlWin().destroy();\n }\n\n var win = Ext.create('CWN2.button.InfoWms.html.Window', {\n height: height,\n width: width,\n items: [\n {\n xtype: 'panel',\n manageHeight: false,\n border: false,\n title: \"\",\n html: html\n }\n ]\n }).show().alignTo(CWN2.app.layout.mapPanel.body, \"tl-tl\", [20, 20]);\n }", "title": "" }, { "docid": "830c712a2436acddb0919dd3ac1fb76d", "score": "0.5721216", "text": "function showInfo( label, url ){\t\t\n \t var jqModalContent = $('<iframe frameborder=\"0\" style=\"margin: 0; padding: 0; height: 150px; width: 100%\"></iframe>');\n // Open modal dialog and keep the dialog id\n var dialogId = ContentStationSdk.openModalDialog({\n title: label,\n width: 600,\n content: jqModalContent.attr('src', url ),\n contentNoPadding: true,\n buttons: [\n // Button defined as secondary with class 'pale'\n // Has no callback defined - will close the dialog.\n {\n label: 'Close',\n class: 'pale'\n },\n \n ]\n });\t\n }", "title": "" }, { "docid": "95e89a73f311d75d7f1e488c43a35949", "score": "0.57202256", "text": "function createInfoTable() {\n var infoTable = document.createElement(\"div\"); // div for element\n infoTable.className = \"semester-info-table\";\n $(infoTable).append($(\"<span class='course-id'>Course ID</span><span class='course-name'>Course Name</span><span class='course-credit'>Credits</span><span class='semesters-label'>Desired Semesters</span>\")); // all labels\n return infoTable;\n}", "title": "" }, { "docid": "e8dcf098dbbd47f041ef1ce64222e299", "score": "0.5713595", "text": "function infoWindow(imgURL, header, text) {\n this.imgURL = imgURL;\n this.header = header;\n this.text = text;\n }", "title": "" }, { "docid": "b06913f7bc057bd79b3d519b80c70ba7", "score": "0.570639", "text": "function addMyInfo(info) {\n $(\".myInfo\").html(`<span class='displayName'>${info.display_name}</span>`);\n $(\"#loggedInButton\").html(`Log out ${info.email}`);\n buttonToggle();\n }", "title": "" }, { "docid": "175d06cc184a94acc1f68f1107deef6a", "score": "0.5695632", "text": "getInfo(props){\n\n const text = this.props.info\n const jsx = text===\"\"?\"Click a constituency to get information\":text;\n\n\n const MapInfo = L.Control.extend({\n onAdd: map => {\n let div = L.DomUtil.create('div', 'info');\n div.innerHTML= jsx;\n return div;\n }\n });\n return new MapInfo({ position: \"topleft\" });\n\n }", "title": "" }, { "docid": "199ced515dfa8cf1bf01fa80947bc93a", "score": "0.56859463", "text": "function addInfoIcon () {\n\tvar arrDivs = document.getElementsByTagName('div');\n\tfor (var i=0; i<arrDivs.length; i++ ) {\n\t\tvar divItem = arrDivs[i];\n\t\t/* create icon box at corner */\n\t\tdivItem.innerHTML = divItem.innerHTML + '<span class=\"info-icon\"></span>';\n\t}\n }", "title": "" }, { "docid": "17d665df9b84d2840ea2b609cf036dc9", "score": "0.56776834", "text": "openInfoDialog(){\n\t\tthis.openDialog(\"infoDialog\");\n\t}", "title": "" }, { "docid": "1b7125c3efe14834f54550e23bf2a2f9", "score": "0.56672466", "text": "static create(dto) {\n let element = ProjectPanel.element(dto);\n return new ProjectPanel(element);\n }", "title": "" }, { "docid": "ae56d1c7f424d71f136cd335614944c7", "score": "0.565438", "text": "function ToolsPanelPresenter() {\n}", "title": "" }, { "docid": "12e7f37bb112b9880919848e1ce5bb1c", "score": "0.5632945", "text": "function mostrarProyectoMarker( )\n {\n $win_project.addClass('open');\n $win_project.find('.popup-info').html( render_info_project(this.info) );\n }", "title": "" }, { "docid": "76e346ef154959962d8b8f18d47feacf", "score": "0.56291074", "text": "function ciniki_tenants_info() {\n\n //\n // Edit the tenant information\n //\n this.info = new M.panel('Tenant Information', 'ciniki_tenants_info', 'info', 'mc', 'medium', 'sectioned', 'ciniki.tenants.info');\n this.info.sections = {\n 'general':{'label':'General', 'fields':{\n 'tenant.name':{'label':'Name', 'type':'text'},\n 'tenant.category':{'label':'Category', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n 'active':function() { return (M.stMode==null&&(M.userPerms&0x01)==1?'yes':'no');}, \n },\n 'tenant.sitename':{'label':'Sitename', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n// 'active':function() { return (M.modOn('ciniki.web')&&(M.userPerms&0x01)==1?'yes':'no');}, \n },\n 'tenant.tagline':{'label':'Tagline', 'type':'text', 'livesearch':'yes', 'livesearchempty':'yes',\n 'active':function() { return (M.modOn('ciniki.web')?'yes':'no');}, \n },\n }},\n 'contact':{'label':'Contact', \n// 'visible':function() {return M.modOn('ciniki.web') ? 'yes' : 'no'; },\n 'fields':{\n 'contact.person.name':{'label':'Name', 'type':'text'},\n 'contact.phone.number':{'label':'Phone', 'type':'text'},\n 'contact.cell.number':{'label':'Cell', 'type':'text'},\n 'contact.tollfree.number':{'label':'Tollfree', 'type':'text'},\n 'contact.fax.number':{'label':'Fax', 'type':'text'},\n 'contact.email.address':{'label':'Email', 'type':'text'},\n 'contact.website.url':{'label':'Website', 'type':'text'},\n }},\n 'address':{'label':'Address', \n// 'visible':function() {return M.modOn('ciniki.web') ? 'yes' : 'no'; },\n 'fields':{\n 'contact.address.street1':{'label':'Street', 'type':'text'},\n 'contact.address.street2':{'label':'Street', 'type':'text'},\n 'contact.address.city':{'label':'City', 'type':'text'},\n 'contact.address.province':{'label':'Province', 'type':'text'},\n 'contact.address.postal':{'label':'Postal', 'type':'text'},\n 'contact.address.country':{'label':'Country', 'type':'text'},\n }}\n };\n this.info.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.tenants.getDetailHistory', 'args':{'tnid':M.curTenantID, 'field':i}};\n }\n this.info.fieldValue = function(s, i, d) { return this.data[i]; }\n this.info.liveSearchCb = function(s, i, value) {\n if( i == 'tenant.category' ) {\n M.api.getJSONBgCb('ciniki.tenants.searchCategory', {'tnid':M.curTenantID, 'start_needle':value, 'limit':15}, function(rsp) {\n M.ciniki_tenants_info.info.liveSearchShow(s, i, M.gE(M.ciniki_tenants_info.info.panelUID + '_' + i), rsp.results);\n });\n }\n };\n this.info.liveSearchResultValue = function(s, f, i, j, d) {\n if( f == 'tenant.category' && d.result != null ) { return d.result.name; }\n return '';\n };\n this.info.liveSearchResultRowFn = function(s, f, i, j, d) { \n if( f == 'tenant.category' && d.result != null ) {\n return 'M.ciniki_tenants_info.info.updateField(\\'' + s + '\\',\\'' + f + '\\',\\'' + escape(d.result.name) + '\\');';\n }\n };\n this.info.updateField = function(s, fid, result) {\n M.gE(this.panelUID + '_' + fid).value = unescape(result);\n this.removeLiveSearch(s, fid);\n };\n this.info.open = function(cb) {\n if( M.curTenant.hamMode != null && M.curTenant.hamMode == 'yes' ) {\n this.title = 'Station Information';\n } else {\n this.title = 'Tenant Information';\n }\n M.api.getJSONCb('ciniki.tenants.getDetails', {'tnid':M.curTenantID, 'keys':'tenant,contact'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_tenants_info.info;\n p.data = rsp.details;\n p.show(cb);\n });\n }\n this.info.save = function() {\n // Serialize the form data into a string for posting\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('ciniki.tenants.updateDetails', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_tenants_info.info.close();\n });\n } else {\n this.close();\n }\n }\n this.info.addButton('save', 'Save', 'M.ciniki_tenants_info.info.save();');\n this.info.addClose('Cancel');\n\n this.start = function(cb, appPrefix) {\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_tenants_info', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n \n this.info.open(cb);\n }\n}", "title": "" }, { "docid": "71136bb1e0089d84a8b89bc0be067a75", "score": "0.5625147", "text": "function createInfoWindowContent(markerInfo, type){\n\n if (type == \"single\"){\n\n infoWindowHeight = 204;\n\n function imageCarousel(marker){\n html = '<div class=\"img-container resize\"><img src=\"/assets/'+marker+'\"/></div>'\n // var html = \"\";\n // $(marker).each(function(index,value){\n // html += '<div class=\"img-container resize\"><img src=\"/assets/apt/'+value.marker+'\"/></div>'\n // })\n return html;\n }\n\n\n innerContent =\n '<div class=\"listings-img-wrapper infowindow open-modal\" onclick=\"open_modal('+markerInfo.id+')\">'+\n '<button class=\"listings-arrows left-arrow\" onclick=\"carousel_left(this);event.stopPropagation();\"><icon class=\"icon-left-open\"></icon></button>'+\n '<button class=\"listings-arrows right-arrow\" onclick=\"carousel_right(this);event.stopPropagation();\"><icon class=\"icon-right-open\"></icon></button>'+\n '<div class=\"listings-overlay\">'+\n '<icon class=\"icon-map-pin-streamline\"></icon> Madrid'+\n '</div>'+\n '<div class=\"listings-price\">'+\n '<p>' + toCurrency((markerInfo.price != undefined ? markerInfo.price : 0), \"$\") + '</p>'+\n '</div>'+\n '<div class=\"listings-img-container\">'+\n '<div class=\"listings-slide-container\">'+\n imageCarousel(markerInfo.images)+\n '</div>'+\n '</div>'+\n '</div>'+\n '<div class=\"address\" onclick=\"onclick=\"open_modal('+markerInfo.id+')\">'+\n '<p>'+\n markerInfo.address + ', Unit ' + markerInfo.unit +\n '</p>'+\n '</div>'+\n '<div class=\"bed-bath\" onclick=\"onclick=\"open_modal('+markerInfo.id+')\">'+\n '<p>'+\n markerInfo.bed +\n '<span> Bed</span>'+\n ' / '+\n markerInfo.bath +\n '<span> Bath</span>'+\n '</p>'+\n '</div>';\n\n return innerContent;\n\n }else if(type == \"multi\"){\n\n if (infoWindowHeight <= 100){\n infoWindowHeight += 50;\n }\n\n innerContent += '<div class=\"multi-container open-modal\" onclick=\"window.open(\\'listings/'+markerInfo.id+'\\')\">' +\n '<div class=\"multi-img resize\">'+\n '<img src=\"'+ markerInfo.images +'\" style=\"display: none\"/>' +\n '</div>'+\n '<div class=\"multi-content\">' +\n '<p class=\"address\">' + markerInfo.address + ', Unit ' + markerInfo.unit + '</p>' +\n '<p class=\"bed-bath\"><span>' + toCurrency((markerInfo.price != undefined ? markerInfo.price : 0), \"$\")+ '/Mo.</span> / '+ markerInfo.beds + ' Bed / ' + markerInfo.baths + ' Bath </p>' +\n '</div>' +\n '</div><div class=\"clear\"></div>';\n\n return innerContent;\n } //end if/else\n\n } //end createInfoWindowContent", "title": "" }, { "docid": "21e03aa235d3cd3b34f7c436721bffb6", "score": "0.56131893", "text": "moreInfo(name, picture, age, breed, userEmail, specialNeeds) {\n var modal = document.getElementById('infoModal');\n modal.style.display = \"block\";\n this.petName = name;\n this.petPicture = picture;\n this.petAge = age;\n this.petBreed = breed;\n this.petOwnerEmail = userEmail;\n this.petNeeds = specialNeeds;\n }", "title": "" }, { "docid": "3f9ee993fee20ce835d5f7a688e8bd90", "score": "0.5608135", "text": "function addInfoWindow(marker, applicant) {\n\tvar contentString = '<div id=\"info-window\">' +\n\t\t'<div id=\"siteNotice\">' +\n\t\t'</div>' +\n\t\t'<h1 id=\"firstHeading\" class=\"firstHeading\">' + applicant[\"applicant\"] + '</h1>' +\n\t\t'<ul>' +\n\t\t'<li><b>Facility Type:</b> ' + applicant[\"facilitytype\"] + '</li>' +\t\t\n\t\t'<li><b>Location:</b> ' + applicant[\"locationdescription\"] + '</li>' +\n\t\t'<li><b>Food Items:</b> ' + applicant[\"fooditems\"] + '</li>' +\n\t\t'</ul>' +\n\t\t'<center><a href=\"' + applicant[\"schedule\"] + '\"><b>Schedule (pdf)</b></a><br><br>';\n\t\n\tvar infoWindow = new google.maps.InfoWindow({\n\t\tcontent: contentString\n\t});\t\t\n\n\tgoogle.maps.event.addListener(marker, 'click', function () {\n\t\tinfoWindow.open(map, marker);\n\t});\n}", "title": "" }, { "docid": "c53d10ffdb9d641c0e7fbad3edae6331", "score": "0.5606699", "text": "function createPanel(article) { //TODO - verify cb name && change <a> to a button instead\n\n var panel =\n $([ '<div class=\"container article-holder\">',\n '<h3 class=\"article-headline\">',\n article.headline,\n '</h3>',\n '<p>', article.summary,'</p>',\n '<br>',\n '<a class=\"btn btn-delete-article delete\">Delete Article</a>',\n '<a class=\"btn btn-see-article-note notes\">Add / View Note</a>',\n '</div>',\n '<hr>'\n ].join(\"\"));\n\n panel.data('_id', article._id);\n\n return panel;\n\n }", "title": "" }, { "docid": "11b0a337c7f5b2363c552c27ec02d675", "score": "0.55970997", "text": "createMarker() {\n this.marker = new google.maps.Marker({\n position: this.latLng,\n map: this.map,\n title: this.name,\n visible: true,\n animation: google.maps.Animation.DROP,\n icon: marker.orange\n })\n this.infoWindow = new google.maps.InfoWindow({\n content: this.display.infoWindow(this)\n })\n }", "title": "" }, { "docid": "2cab4c9e806886033fcc93479c6592e2", "score": "0.558658", "text": "function loadInfoToPanel(e) {\n loadlist(e,'#panelContent');\n}", "title": "" }, { "docid": "ed630c28c3ad77242fa5b51743ab6054", "score": "0.55797255", "text": "function showInfo(){\n $('#content-slider ul li a.crosshairs').click(function(){\n jQuery(this).parent().find('.info').show();\n return false;\n });\n \n $('#content-slider ul li .close').click(function(){\n jQuery(this).parent().hide();\n return false;\n });\n }", "title": "" }, { "docid": "a4f7134c73dcb6f232f21a30149e8be7", "score": "0.5577414", "text": "function _addInfo(_info) {\n var _infoBody = $(\"<span class='leecard-info'></span>\").html(_info.fieldValue || \"\");\n if(_info.fieldName==\"head\"){\n _infoBody.append(\"<img class='card-head'/>\")\n }\n //handle position\n if (_cardPosition && _info.fieldName && _cardPosition[_info.fieldName]) {\n for (var _attr in _cardPosition[_info.fieldName]) {\n\n _infoBody.css(_attr, _cardPosition[_info.fieldName][_attr]);\n }\n } else if (_info.posX && _info.posY) {\n _infoBody.css(\"left\", _info.posX);\n _infoBody.css(\"top\", _info.posY);\n } else if (_info.style) {\n //handle stylesheet\n for (var _attr in _info.style) {\n _infoBody.css(_attr, _info.style[_attr]);\n }\n }\n //如果没有定义样式,直接返回\n else {\n return undefined;\n }\n //handle style class\n if (_info.cls) {\n _infoBody.addClass(_info.cls);\n }\n if (_cardStyle && _cardStyle[_info.fieldName]) {\n _infoBody.addClass(_cardStyle[_info.fieldName].cls || \"\");\n }\n if (_info.imageUrl) {\n var _background = [];\n _background.push(\"url(\");\n _background.push(_info.imageUrl);\n _background.push(\")\");\n _infoBody.css(\"background-image\", _background.join(\"\")).html(\"\");\n }\n return _infoBody;\n }", "title": "" }, { "docid": "cfcc567eb6cd28d2cf4d26fa25e14a7f", "score": "0.55653226", "text": "function init_infoBox() {\n\n BB.gmap.infobox.prototype = new google.maps.OverlayView();\n BB.gmap.infobox.prototype.remove = function() {\n if (this._div) {\n try {\n this._div.parentNode.removeChild(this._div);\n } catch (err) {\n\n }\n this._div = null;\n }\n };\n\n /**\n * Sets the map for the infobox\n *\n */\n BB.gmap.infobox.prototype.set_position = function(position) {\n if (!position) {\n return this;\n }\n\n if (typeof position === 'string') {\n position = position.split(',');\n }\n\n if (!(position instanceof google.maps.LatLng)) {\n if (typeof position[0] === 'undefined' || typeof position[1] === 'undefined') {\n return this;\n }\n position = new google.maps.LatLng(position[0], position[1]);\n }\n\n this.opts.position = position;\n\n if (this.map) {\n this.draw();\n }\n return this;\n };\n\n\n /**\n * Sets the map for the infobox\n *\n */\n BB.gmap.infobox.prototype.set_map = function(map) {\n this.__MAP = map;\n this.setMap(this.__MAP);\n };\n\n /**\n * @see google.maps.OverlayView\n */\n BB.gmap.infobox.prototype.draw = function() {\n this.createElement();\n\n google.maps.event.trigger(this.__MAP, 'infobox_opened', { elem: this });\n // if (!this._div) return;\n\n var pixPosition = this.getProjection().fromLatLngToDivPixel(this.opts.position);\n if (!pixPosition) return;\n\n this._div.style.width = this._width + \"px\";\n this._div.style.left = (pixPosition.x + this._offsetX) + \"px\";\n this._div.style.height = this._height + \"px\";\n this._div.style.top = (pixPosition.y + this._offsetY) + \"px\";\n this._div.style.display = 'block';\n this._div.style.zIndex = 1;\n };\n\n /**\n *\n */\n BB.gmap.infobox.prototype.createElement = function() {\n // Generate infobox content\n this.generateInfoboxContent();\n\n var panes = this.getPanes();\n var div = this._div;\n\n if (div) {\n if (div.parentNode != panes.floatPane) {\n // The panes have changed. Move the div.\n try {\n div.parentNode.removeChild(div);\n } catch (err) {\n\n }\n }\n }\n\n if (!div) {\n div = this._div = document.createElement(\"div\");\n div.style.border = \"0\";\n div.style.position = \"absolute\";\n }\n\n div.innerHTML = '';\n\n // Add content right on\n div.appendChild(this.__ELEM);\n panes.floatPane.appendChild(div);\n\n // Place content from with and height\n this._height = this.__ELEM.offsetHeight;\n this._width = this.__ELEM.offsetWidth;\n\n div.style.width = this._width + \"px\";\n div.style.height = this._height + \"px\";\n\n var infobox_class = 'gmap_infobox';\n div.setAttribute('class', infobox_class);\n\n // div.style.display = 'none';\n var position = this.opts.placement.split(' ');\n\n switch (position[0]) {\n case 'top':\n this._offsetY = -parseFloat(this.opts.offsetY);\n break;\n case 'over':\n this._offsetY = -parseFloat(this.opts.offsetY) - parseInt(this._height);\n break;\n case 'bottom':\n this._offsetY = - parseFloat(this._height);\n break;\n case 'under':\n this._offsetY = 0;\n break;\n case 'center':\n this._offsetY = -parseFloat(this.opts.offsetY)/2 - parseInt(this._height)/2;\n break;\n }\n switch (position[1]) {\n case 'right':\n this._offsetX = (parseFloat(this.opts.offsetX)) - parseInt(this._width);\n break;\n case 'left':\n this._offsetX = -(parseFloat(this.opts.offsetX));\n break;\n case 'center':\n this._offsetX = - (parseInt(this._width)/2);\n break;\n case 'out-right':\n this._offsetX = (parseFloat(this.opts.offsetX));;\n break;\n case 'out-left':\n this._offsetX = -(parseFloat(this.opts.offsetX))-parseInt(this._width);\n break;\n }\n };\n\n /**\n *\n * @returns {BB.gmap.infobox}\n */\n BB.gmap.infobox.prototype.generateInfoboxContent = function() {\n var elem = this.infoboxContent;\n if (typeof elem === 'function') {\n elem = elem(this.__MARKER.data());\n }\n\n if (typeof elem === 'number') {\n elem = elem.toString();\n }\n\n if (typeof elem === 'string') {\n // Does the infobox exists in the dom already?\n var infobox = document.getElementById(elem);\n\n // If not, create a DIV element with it.\n if (!infobox) {\n infobox = document.createElement('div');\n infobox.style.position = 'absolute'; // Or this wont display corretly\n infobox.innerHTML = elem;\n }\n elem = infobox;\n }\n\n if (typeof jQuery !== 'undefined') {\n // Let's get rid of jQuery for this one\n if (elem instanceof jQuery) {\n // Select DOMElement\n elem = elem.get(0);\n }\n }\n\n this.__ELEM = elem;\n return this;\n };\n\n /**\n *\n */\n BB.gmap.infobox.prototype.refresh = function()\n {\n this.generateInfoboxContent();\n };\n}", "title": "" }, { "docid": "33e98e9f78c3a4d5abd8f339f45d34ea", "score": "0.5560883", "text": "function showStoreInfo(storeInfo){\n\t\tvar info_div = document.getElementById('info_div');\n\t\tinfo_div.innerHTML = 'Class location: '\n\t\t\t+ storeInfo.name\n + '<br>Ability: ' + storeInfo.ability\n + '<br>Hours: ' + storeInfo.hours;\n\t}", "title": "" }, { "docid": "152afc15091b9352fe31dee6030269f9", "score": "0.55532354", "text": "function showInfoDialog() {\n\t\tvex.open({\n\t\t\tcontentClassName: 'infoDialog',\n\t\t\tcontent: \n\t\t\t\t'<h2>Usage</h2>' +\n\t\t\t\t'<ul class=\"instructions\">' +\n\t\t\t\t'<li><p>Type in the stock input field to lookup stock symbols.</p></li>' +\n\t\t\t\t'<li><p>Click on the \"Add to Portfolio\" button to add the stock to the portfolio.</p></li>' +\n\t\t\t\t'<li><p>Click in the \"price\" or \"price change\" field to see more stock information.</p></li>' +\n\t\t\t\t'<li><p>Click in stocks\\' \"# shares\" field to show shares owned.</p></li>' +\n\t\t\t\t'<li><p>Click left of the stock symbol to remove that stock from the portfolio.</p></li>' +\n\t\t\t\t'<li><p>Click on the stock symbol to show the stock\\'s chart.</p></li>' +\n\t\t\t\t'<li><p>Unclick on the stock symbol to remove the stock\\'s chart.</p></li>' +\n\t\t\t\t'<li><p>Click on the \"Update Portfolio\" button to update the sock prices and values during trading periods.</p></li>',\n\t\t\toverlayClassName:'infoDialogOverlay',\n\t\t\tshowCloseButton:false});\n\t}", "title": "" }, { "docid": "d6697c7875bbdbca84f0c55b2a76e4fa", "score": "0.5552408", "text": "function InfoBox(opt_opts){opt_opts=opt_opts||{};google.maps.OverlayView.apply(this,arguments);this.content_=opt_opts.content||\"\";this.disableAutoPan_=opt_opts.disableAutoPan||false;this.maxWidth_=opt_opts.maxWidth||0;this.pixelOffset_=opt_opts.pixelOffset||new google.maps.Size(0,0);this.position_=opt_opts.position||new google.maps.LatLng(0,0);this.zIndex_=opt_opts.zIndex||null;this.boxClass_=opt_opts.boxClass||\"infoBox\";this.boxStyle_=opt_opts.boxStyle||{};this.closeBoxMargin_=opt_opts.closeBoxMargin||\"2px\";this.closeBoxURL_=opt_opts.closeBoxURL||\"http://www.google.com/intl/en_us/mapfiles/close.gif\";if(opt_opts.closeBoxURL===\"\"){this.closeBoxURL_=\"\";}\nthis.infoBoxClearance_=opt_opts.infoBoxClearance||new google.maps.Size(1,1);if(typeof opt_opts.visible===\"undefined\"){if(typeof opt_opts.isHidden===\"undefined\"){opt_opts.visible=true;}else{opt_opts.visible=!opt_opts.isHidden;}}\nthis.isHidden_=!opt_opts.visible;this.alignBottom_=opt_opts.alignBottom||false;this.pane_=opt_opts.pane||\"floatPane\";this.enableEventPropagation_=opt_opts.enableEventPropagation||false;this.div_=null;this.closeListener_=null;this.moveListener_=null;this.contextListener_=null;this.eventListeners_=null;this.fixedWidthSet_=null;}", "title": "" }, { "docid": "c71dece4187c1fdcb68f0b1e9b007c71", "score": "0.55469656", "text": "function info(name,date,moneyInfo){\n // creates the node\n var node = document.createElement(\"div\");\n node.className = \"mainInfo\"\n\n // creates the text name\n var textName = document.createElement(\"div\");\n textName.innerHTML = name;\n textName.className = \"mainName\";\n node.appendChild(textName);\n\n // creates the text money\n var textMoney = document.createElement(\"div\");\n textMoney.innerHTML = moneyInfo;\n textMoney.className = \"mainMoney\";\n node.appendChild(textMoney);\n\n // creates the text date\n var textDate = document.createElement(\"div\");\n textDate.innerHTML = date;\n textDate.className = \"mainDate\";\n node.appendChild(textDate);\n\n // adds the node to the mainElement\n mainElement.insertBefore(node, mainElement.childNodes[0])\n}", "title": "" }, { "docid": "a9625fe29c655d0e5cd3bc73050da38d", "score": "0.5536801", "text": "function createHelpPanel() {\n return new Ext.Panel({\n border : false,\n frame : false,\n bodyStyle : {\n 'background-color' : 'white',\n padding : '5px'\n },\n autoScroll : true,\n baseCls : 'none',\n id : 'helpPanel',\n autoWidth : true,\n autoLoad : {\n url : '../../apps/tabsearch/help_' + catalogue.LANG + '.html',\n callback: initShortcut,\n scope : this,\n loadScripts : false\n }\n });\n }", "title": "" }, { "docid": "1773b51a785b9000c9fbc754bdf13e1c", "score": "0.5535786", "text": "function InfoWin(latlng, html) {\n this.latlng_ = latlng;\n this.html_ = html;\n this.prototype = new GOverlay();\n \n // Creates the DIV representing the infowindow\n this.initialize = function(map) {\n var div = $('<div />');\n div.css({\n position : 'absolute',\n width : 321\n }).appendTo(map.getPane(G_MAP_FLOAT_PANE));\n \n this.map_ = map;\n this.div_ = div;\n \n this.update(html);\n };\n \n this.update = function(html){\n this.html_ = html;\n \n this.div_.empty();\n \n $('<div />').css({\n 'background-image' : 'url(/images/popout_top.png)',\n height : 23,\n padding: '0 0 0 0'\n }).appendTo(this.div_);\n \n var content = $('<div />').addClass('infowin-content').css({\n 'position' : 'relative',\n 'overflow' : 'hidden',\n 'max-height' : 570,\n 'top' : -5\n }).html(html);\n \n $('<div />').css({\n 'background-image' : 'url(/images/popout_bottom.png)',\n 'background-position' : 'bottom left',\n 'padding' : '0 10px 100px 10px'\n }).append(content).appendTo(this.div_);\n \n this.redraw(true);\n };\n \n // Remove the main DIV from the map pane\n this.remove = function() {\n this.div_.remove();\n };\n \n // Copy our data to a new instance\n this.copy = function() {\n return new InfoWin(this.latlng_, this.html_);\n };\n \n // Redraw based on the current projection and zoom level\n this.redraw = function(force) {\n if (!force) return;\n \n var point = this.map_.fromLatLngToDivPixel(this.latlng_);\n \n // Now position our DIV based on the DIV coordinates of our bounds\n this.div_.css({\n left : point.x - 325,\n top : point.y - this.div_.height() - 20\n });\n };\n}", "title": "" }, { "docid": "3797ad234dd4036b6d60178d380dc287", "score": "0.55310345", "text": "function add_info_element(parent, info, content) {\n\n // if undefined nothing has changed so it does not\n // need to be displayed\n if (content != undefined) {\n let elem = document.createElement('p');\n elem.textContent = info + \": \" + content;\n parent.appendChild(elem);\n }\n}", "title": "" }, { "docid": "230c983059ddfc1a64d4fc09d5dadf4f", "score": "0.55288583", "text": "function playerInfo() {\n var _this = this;\n\n // If we have already invoked the plugin, dispose of the previous invocation\n // before re-invoking.\n if (this.playerInfo !== playerInfo) {\n this.playerInfo.modal.dispose();\n }\n\n // Wrap the plugin function with a player instance-specific function. This\n // allows us to attach the modal to it without affecting other players on\n // the page.\n this.playerInfo = function () {\n playerInfo.apply(this, arguments);\n };\n\n this.ready(function () {\n _this.addClass('vjs-player-info');\n\n _this.playerInfo.modal = _this.addChild('playerInfoModal', {\n\n // We want to re-capture player info when the modal is opened.\n fillAlways: true,\n label: _this.localize('Player Information Dialog'),\n temporary: false\n });\n\n // Clean up our references by removing the instance-specific wrapper if\n // the modal is disposed; re-exposing the plugin itself.\n _this.playerInfo.modal.on('dispose', function () {\n delete _this.playerInfo;\n });\n });\n}", "title": "" }, { "docid": "186c0e4f1f5f929f8d74602a1d6c3ce2", "score": "0.5526407", "text": "function InfoBox(opt_opts){opt_opts=opt_opts||{};google.maps.OverlayView.apply(this,arguments);this.content_=opt_opts.content||\"\";this.disableAutoPan_=opt_opts.disableAutoPan||false;this.maxWidth_=opt_opts.maxWidth||0;this.pixelOffset_=opt_opts.pixelOffset||new google.maps.Size(0,0);this.position_=opt_opts.position||new google.maps.LatLng(0,0);this.zIndex_=opt_opts.zIndex||null;this.boxClass_=opt_opts.boxClass||\"infoBox\";this.boxStyle_=opt_opts.boxStyle||{};this.closeBoxMargin_=opt_opts.closeBoxMargin||\"2px\";this.closeBoxURL_=opt_opts.closeBoxURL||\"http://www.google.com/intl/en_us/mapfiles/close.gif\";if(opt_opts.closeBoxURL===\"\"){this.closeBoxURL_=\"\";}\nthis.infoBoxClearance_=opt_opts.infoBoxClearance||new google.maps.Size(1,1);if(typeof opt_opts.visible===\"undefined\"){if(typeof opt_opts.isHidden===\"undefined\"){opt_opts.visible=true;}else{opt_opts.visible=!opt_opts.isHidden;}}\nthis.isHidden_=!opt_opts.visible;this.alignBottom_=opt_opts.alignBottom||false;this.pane_=opt_opts.pane||\"floatPane\";this.enableEventPropagation_=opt_opts.enableEventPropagation||false;this.div_=null;this.closeListener_=null;this.moveListener_=null;this.mapListener_=null;this.contextListener_=null;this.eventListeners_=null;this.fixedWidthSet_=null;}", "title": "" }, { "docid": "e362ce02532210e791350e131d90f25e", "score": "0.5521221", "text": "static create(dto) {\n let element = ConsolePanel.element(dto);\n return new ConsolePanel(element);\n }", "title": "" }, { "docid": "25a22d5d62bdde2cacab075043b2e428", "score": "0.5518981", "text": "function setPanel() {\n var panel = require(\"panel\").Panel({\n width: 340,\n height: 300,\n contentURL: data.url(\"html/popup.html\"),\n contentScriptFile: [\n data.url(\"libs/jquery-1.8.2.js\"),\n data.url(\"libs/underscore.js\"),\n data.url(\"libs/backbone.js\"),\n data.url(\"libs/bootstrap-button.js\"),\n data.url(\"libs/sprintf-0.7-beta1.js\"),\n data.url(\"js/ajaxWrap.js\"),\n data.url('js/popup.js'),\n ], \n });\n\n var widget = widgets.Widget({\n id: \"mozilla-link\",\n label: \"Eyebrowse by CSAIL\",\n contentURL: getWidgetUrl(false),\n panel: panel,\n });\n\n return {\n \"panel\" : panel,\n \"widget\" : widget,\n }\n}", "title": "" }, { "docid": "136bc5fe177df8c2e3392c70893a5cbd", "score": "0.551485", "text": "function createDefaultInfoMarker(){\n infoMarker = document.createElement(\"img\");\n infoMarker.src= infoMarkerPath;\n _hideInfoMarker();\n _addInfoMarker();\n }", "title": "" }, { "docid": "7868765a6f8cd8308894ba35e242be92", "score": "0.5502849", "text": "function ciniki_artclub_info() {\n\tthis.init = function() {\n\t\t//\n\t\t// Setup the main panel to list the collection\n\t\t//\n\t\tthis.menu = new M.panel('Files',\n\t\t\t'ciniki_artclub_info', 'menu',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.menu');\n\t\tthis.menu.data = {};\n\t\tthis.menu.sections = {\n\t\t\t'_menu':{'label':'', 'list':{\n\t\t\t\t'membership':{'label':'Membership', 'fn':'M.ciniki_artclub_info.showMembership(\\'M.ciniki_artclub_info.showMenu();\\');'},\n\t\t\t\t}},\n\t\t\t};\n\t\tthis.menu.addClose('Back');\n\n\t\t//\n\t\t// The panel to display the add form\n\t\t//\n\t\tthis.membership = new M.panel('Membership Details',\n\t\t\t'ciniki_artclub_info', 'membership',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.membership');\n\t\tthis.membership.data = {};\t\n\t\tthis.membership.sections = {\n\t\t\t'membership-details-html':{'label':'Membership Details', 'type':'htmlcontent'},\n\t\t\t'_buttons':{'label':'', 'buttons':{\n\t\t\t\t'edit':{'label':'Edit', 'fn':'M.ciniki_artclub_info.showEditMembership(\\'M.ciniki_artclub_info.showMembership();\\');'},\n\t\t\t\t}},\n\t\t\t'applications':{'label':'Application Forms',\n\t\t\t\t'type':'simplegrid', 'num_cols':1,\n\t\t\t\t'headerValues':null,\n\t\t\t\t'cellClasses':[''],\n\t\t\t\t'addTxt':'Add Application',\n\t\t\t\t'addFn':'M.ciniki_artclub_info.showAddApplication(\\'M.ciniki_artclub_info.showMembership();\\');',\n\t\t\t\t}\n\t\t};\n\t\tthis.membership.cellValue = function(s, i, j, d) {\n\t\t\tif( j == 0 ) { return d.file.name; }\n\t\t};\n\t\tthis.membership.rowFn = function(s, i, d) {\n\t\t\treturn 'M.ciniki_artclub_info.showEditApplication(\\'M.ciniki_artclub_info.showMembership();\\', \\'' + d.file.id + '\\');'; \n\t\t};\n\t\tthis.membership.sectionData = function(s) { \n\t\t\treturn this.data[s];\n\t\t};\n\t\tthis.membership.addClose('Back');\n\n\t\t//\n\t\t// The panel to display the edit membership details form\n\t\t//\n\t\tthis.editmembership = new M.panel('File',\n\t\t\t'ciniki_artclub_info', 'editmembership',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.editmembership');\n\t\tthis.editmembership.file_id = 0;\n\t\tthis.editmembership.data = null;\n\t\tthis.editmembership.sections = {\n\t\t\t'_description':{'label':'Description', 'type':'simpleform', 'fields':{\n\t\t\t\t'membership-details':{'label':'', 'type':'textarea', 'size':'large', 'hidelabel':'yes'},\n\t\t\t}},\n\t\t\t'_save':{'label':'', 'buttons':{\n\t\t\t\t'save':{'label':'Save', 'fn':'M.ciniki_artclub_info.saveMembership();'},\n\t\t\t}},\n\t\t};\n\t\tthis.editmembership.fieldValue = function(s, i, d) { \n\t\t\treturn this.data[i]; \n\t\t}\n\t\tthis.editmembership.fieldHistoryArgs = function(s, i) {\n\t\t\treturn {'method':'ciniki.artclub.settingsHistory', 'args':{'business_id':M.curBusinessID, 'setting':i}};\n\t\t};\n\t\tthis.editmembership.addButton('save', 'Save', 'M.ciniki_artclub_info.saveMembership();');\n\t\tthis.editmembership.addClose('Cancel');\n\n\n\t\t//\n\t\t// The panel to display the add form\n\t\t//\n\t\tthis.addapplication = new M.panel('Add File',\n\t\t\t'ciniki_artclub_info', 'addapplication',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.editapplication');\n\t\tthis.addapplication.default_data = {'type':'2'};\n\t\tthis.addapplication.data = {};\t\n// FIXME:\t\tthis.add.uploadDropFn = function() { return M.ciniki_artclub_info.uploadDropImagesAdd; };\n\t\tthis.addapplication.sections = {\n\t\t\t'_file':{'label':'File', 'fields':{\n\t\t\t\t'uploadfile':{'label':'', 'type':'file', 'hidelabel':'yes'},\n\t\t\t}},\n\t\t\t'info':{'label':'Information', 'type':'simpleform', 'fields':{\n\t\t\t\t'name':{'label':'Title', 'type':'text'},\n\t\t\t}},\n//\t\t\t'_description':{'label':'Description', 'type':'simpleform', 'fields':{\n//\t\t\t\t'description':{'label':'', 'type':'textarea', 'size':'small', 'hidelabel':'yes'},\n//\t\t\t}},\n\t\t\t'_save':{'label':'', 'buttons':{\n\t\t\t\t'save':{'label':'Save', 'fn':'M.ciniki_artclub_info.addApplication();'},\n\t\t\t}},\n\t\t};\n\t\tthis.addapplication.fieldValue = function(s, i, d) { \n\t\t\tif( this.data[i] != null ) {\n\t\t\t\treturn this.data[i]; \n\t\t\t} \n\t\t\treturn ''; \n\t\t};\n\t\tthis.addapplication.addButton('save', 'Save', 'M.ciniki_artclub_info.addApplication();');\n\t\tthis.addapplication.addClose('Cancel');\n\n\t\t//\n\t\t// The panel to display the edit form\n\t\t//\n\t\tthis.editapplication = new M.panel('File',\n\t\t\t'ciniki_artclub_info', 'editapplication',\n\t\t\t'mc', 'medium', 'sectioned', 'ciniki.artclub.info.editapplications');\n\t\tthis.editapplication.file_id = 0;\n\t\tthis.editapplication.data = null;\n\t\tthis.editapplication.sections = {\n\t\t\t'info':{'label':'Details', 'type':'simpleform', 'fields':{\n\t\t\t\t'name':{'label':'Title', 'type':'text'},\n\t\t\t}},\n\t\t\t'_save':{'label':'', 'buttons':{\n\t\t\t\t'save':{'label':'Save', 'fn':'M.ciniki_artclub_info.saveApplication();'},\n\t\t\t\t'download':{'label':'Download', 'fn':'M.ciniki_artclub_info.downloadFile(M.ciniki_artclub_info.editapplication.file_id);'},\n\t\t\t\t'delete':{'label':'Delete', 'fn':'M.ciniki_artclub_info.deleteApplication();'},\n\t\t\t}},\n\t\t};\n\t\tthis.editapplication.fieldValue = function(s, i, d) { \n\t\t\treturn this.data[i]; \n\t\t}\n\t\tthis.editapplication.sectionData = function(s) {\n\t\t\treturn this.data[s];\n\t\t};\n\t\tthis.editapplication.fieldHistoryArgs = function(s, i) {\n\t\t\treturn {'method':'ciniki.artclub.fileHistory', 'args':{'business_id':M.curBusinessID, \n\t\t\t\t'file_id':this.file_id, 'field':i}};\n\t\t};\n\t\tthis.editapplication.addButton('save', 'Save', 'M.ciniki_artclub_info.saveApplication();');\n\t\tthis.editapplication.addClose('Cancel');\n\t}\n\n\tthis.start = function(cb, appPrefix, aG) {\n\t\targs = {};\n\t\tif( aG != null ) {\n\t\t\targs = eval(aG);\n\t\t}\n\n\t\t//\n\t\t// Create container\n\t\t//\n\t\tvar appContainer = M.createContainer(appPrefix, 'ciniki_artclub_info', 'yes');\n\t\tif( appContainer == null ) {\n\t\t\talert('App Error');\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.showMenu(cb);\n\t}\n\n\tthis.showMenu = function(cb) {\n\t\tthis.menu.refresh();\n\t\tthis.menu.show(cb);\n\t};\n\n\tthis.showMembership = function(cb) {\n\t\tthis.membership.data = {};\n\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.settingsGet', \n\t\t\t{'business_id':M.curBusinessID, 'processhtml':'yes'}, function(rsp) {\n\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif( rsp.settings != null && rsp.settings['membership-details'] != null ) {\n\t\t\t\t\tM.ciniki_artclub_info.membership.data['membership-details-html'] = rsp.settings['membership-details-html'];\n\t\t\t\t} else {\n\t\t\t\t\tM.ciniki_artclub_info.membership.data['membership-details-html'] = '';\n\t\t\t\t}\n\t\t\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.fileList', \n\t\t\t\t\t{'business_id':M.curBusinessID, 'type':'1'}, function(rsp) {\n\t\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tM.ciniki_artclub_info.membership.data['applications'] = rsp.files;\n\t\t\t\t\t\tM.ciniki_artclub_info.membership.refresh();\n\t\t\t\t\t\tM.ciniki_artclub_info.membership.show(cb);\n\t\t\t\t\t});\n\t\t\t});\n\t};\n\n\tthis.showEditMembership = function(cb) {\n\t\tthis.editmembership.data = {};\n\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.settingsGet', \n\t\t\t{'business_id':M.curBusinessID}, function(rsp) {\n\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif( rsp.settings != null && rsp.settings['membership-details'] != null ) {\n\t\t\t\t\tM.ciniki_artclub_info.editmembership.data['membership-details'] = rsp.settings['membership-details'];\n\t\t\t\t} else {\n\t\t\t\t\tM.ciniki_artclub_info.editmembership.data['membership-details'] = '';\n\t\t\t\t}\n\t\t\t\tM.ciniki_artclub_info.editmembership.refresh();\n\t\t\t\tM.ciniki_artclub_info.editmembership.show(cb);\n\t\t\t});\n\t};\n\n\tthis.saveMembership = function() {\n\t\tvar c = this.editmembership.serializeFormData('no');\n\t\tif( c != null ) {\n\t\t\tvar rsp = M.api.postJSONFormData('ciniki.artclub.settingsUpdate', \n\t\t\t\t{'business_id':M.curBusinessID}, c,\n\t\t\t\tfunction(rsp) {\n\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tM.ciniki_artclub_info.editmembership.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} else {\n\t\t\tM.ciniki_artclub_info.editmembership.close();\n\t\t}\n\t};\n\n\tthis.showAddApplication = function(cb) {\n\t\tthis.addapplication.reset();\n\t\tthis.addapplication.data = {'type':1};\n\t\tthis.addapplication.refresh();\n\t\tthis.addapplication.show(cb);\n\t};\n\n\tthis.addApplication = function() {\n\t\tvar c = this.addapplication.serializeFormData('yes');\n\n\t\tif( c != '' ) {\n\t\t\tvar rsp = M.api.postJSONFormData('ciniki.artclub.fileAdd', \n\t\t\t\t{'business_id':M.curBusinessID, 'type':1}, c,\n\t\t\t\t\tfunction(rsp) {\n\t\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tM.ciniki_artclub_info.addapplication.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t} else {\n\t\t\tM.ciniki_artclub_info.addapplication.close();\n\t\t}\n\t};\n\n\tthis.showEditApplication = function(cb, fid) {\n\t\tif( fid != null ) {\n\t\t\tthis.editapplication.file_id = fid;\n\t\t}\n\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.fileGet', \n\t\t\t{'business_id':M.curBusinessID, 'file_id':this.editapplication.file_id}, function(rsp) {\n\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tM.ciniki_artclub_info.editapplication.data = rsp.file;\n\t\t\t\tM.ciniki_artclub_info.editapplication.refresh();\n\t\t\t\tM.ciniki_artclub_info.editapplication.show(cb);\n\t\t\t});\n\t};\n\n\tthis.saveApplication = function() {\n\t\tvar c = this.editapplication.serializeFormData('no');\n\n\t\tif( c != '' ) {\n\t\t\tvar rsp = M.api.postJSONFormData('ciniki.artclub.fileUpdate', \n\t\t\t\t{'business_id':M.curBusinessID, 'file_id':this.editapplication.file_id}, c,\n\t\t\t\t\tfunction(rsp) {\n\t\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tM.ciniki_artclub_info.editapplication.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t};\n\n\tthis.deleteApplication = function() {\n\t\tif( confirm('Are you sure you want to delete \\'' + this.editapplication.data.name + '\\'? All information about it will be removed and unrecoverable.') ) {\n\t\t\tvar rsp = M.api.getJSONCb('ciniki.artclub.fileDelete', {'business_id':M.curBusinessID, \n\t\t\t\t'file_id':M.ciniki_artclub_info.editapplication.file_id}, function(rsp) {\n\t\t\t\t\tif( rsp.stat != 'ok' ) {\n\t\t\t\t\t\tM.api.err(rsp);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tM.ciniki_artclub_info.editapplication.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t};\n\n\tthis.downloadFile = function(fid) {\n\t\twindow.open(M.api.getUploadURL('ciniki.artclub.fileDownload', {'business_id':M.curBusinessID, 'file_id':fid}));\n\t};\n}", "title": "" }, { "docid": "139a3b94b63c4e0f2baef1d00c27670a", "score": "0.5495743", "text": "function showInfo(options) {\n\t\tinfo.setOptions(options);\n\t\tinfo.open(map);\n\t\tinfoOpen = true;\n\t}", "title": "" }, { "docid": "455576aef95c4692505b42058a735156", "score": "0.5490067", "text": "function getInfoBoxHtml(){\n\t\t\t\treturn( '<div class=\"infoBoxContent\">\\\n\t\t\t\t\t\t\t<img class=\"thumbImage\" src=\"' + thumbImageUrl + '\"></img> \\\n\t\t\t\t\t\t\t<div class=\"headlineContainer\">\\\n\t\t\t\t\t\t\t<div class=\"headline\">' + markerTitle + '</div>\\\n\t\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\t</div>' );\n\t\t\t}", "title": "" }, { "docid": "5860517601087d9735012ee0ab6c645f", "score": "0.5486738", "text": "function showInfoWindow() {\r\n console.log(this)\r\n var marker = this;\r\n infoWindow.open(map, marker);\r\n $('#iw-name').html(marker.title);\r\n $('#iw-address').html(marker.address);\r\n $('#iw-status').html(marker.status);\r\n\r\n }", "title": "" }, { "docid": "2f32cae1b70802d818aceb723f5c91eb", "score": "0.5484245", "text": "function addPane(obj){\n var elem = D.createElement('div');\n\n for(var prop in obj){\n if(obj.hasOwnProperty(prop)){\n elem[prop] = obj[prop];\n }\n }\n\n body.appendChild(elem);\n return elem;\n }", "title": "" }, { "docid": "583d0f940be8f726dc92995255d5cd37", "score": "0.548417", "text": "static renderInfo(info, details=null, className=\"\") {\n return Message.renderMessage(\"info\", info, details, className);\n }", "title": "" }, { "docid": "e330aaf8036067e460258535e599e8b2", "score": "0.5481126", "text": "function makeInfoWindow(marker, venueIndex) {\n var content;\n let venue = data.results()[venueIndex];\n\n if (infoWindow.marker === marker) {\n data.activeVenue(null);\n infoWindow.marker = null;\n infoWindow.close();\n return;\n }\n\n data.activeVenue(venueIndex);\n infoWindow.marker = marker;\n\n content = \"<div class='iw-content'>\";\n content += '<p><strong>' + venue.name + '</strong></p><p>' + venue.address + '</p>';\n if (typeof(venue.phone) !== 'undefined') {\n content += '<p>' + venue.phone + '</p>';\n }\n if (typeof(venue.description) !== 'undefined') {\n content += '<p><em>' + venue.description + '</em></p>';\n }\n if (typeof(venue.image) !== 'undefined') {\n content += \"<br><img src='\" + venue.image + \"'>\";\n }\n content += '</div>'\n\n infoWindow.setContent(content);\n infoWindow.addListener('closeclick', function(){\n data.activeVenue(null);\n });\n infoWindow.open(map, marker);\n\n google.maps.event.addListener(map, \"click\", function() {\n infoWindow.marker = null;\n data.activeVenue(null);\n infoWindow.close();\n });\n}", "title": "" }, { "docid": "b9f008a0df93b1fb03b0b42428e0bcaa", "score": "0.5479642", "text": "function createTabsInfoMarker(point, infoTabs ,icon) {\n var marker = new GMarker(point,icon);\n GEvent.addListener(marker, \"click\", function() {\n marker.openInfoWindowTabsHtml(infoTabs);\n });\n return marker;\n}", "title": "" }, { "docid": "7016161e22dff2c510db6ffa52375c6d", "score": "0.5475013", "text": "function createPlant(info) {\n const location = [];\n info.location.forEach(el => {\n location.push(<p key={el}>{el}</p>);\n });\n plantEle.push(\n <section className=\"plant\" key={info.name}>\n <h2 onClick={toggle}>{info.name}</h2>\n <div className=\"plant-container-sub hide\">\n <h4>Rarity</h4>\n <h4>Locations</h4>\n <p>{info.rarity}</p>\n <div className=\"plant-container-loc\">{location}</div>\n <ReactMarkdown className=\"plant-desc\" source={info.description} />\n </div>\n </section>\n );\n }", "title": "" }, { "docid": "b36cf6961f3847289cb024b5d472bb9f", "score": "0.54680526", "text": "function INFO$static_(){DisplayFieldSkin.INFO=( new DisplayFieldSkin(com.coremedia.ui.skins.LabelableSkin.INFO.getSkin()));}", "title": "" }, { "docid": "ebbce6aca3a1aa027eeae0054c48f3fc", "score": "0.5466613", "text": "createTextAreaElement() {\n const textAreaElement = document.createElement('div');\n textAreaElement.classList.add('info');\n this.textAreaElement = textAreaElement;\n const childElements = [];\n if (this.settingsService.showTitle) {\n const titleElement = document.createElement('div');\n titleElement.classList.add('title');\n this.titleElement = titleElement;\n childElements.push(titleElement);\n }\n if (this.settingsService.showArtist) {\n const artistElement = document.createElement('div');\n artistElement.classList.add('artist');\n this.artistElement = artistElement;\n childElements.push(artistElement);\n }\n if (this.settingsService.showAlbum) {\n const albumElement = document.createElement('div');\n albumElement.classList.add('album');\n this.albumElement = albumElement;\n childElements.push(albumElement);\n }\n childElements.forEach((x) => this.textAreaElement.appendChild(x));\n }", "title": "" }, { "docid": "9f904443f785f33436755ea59d1c3032", "score": "0.5461789", "text": "function createInfoElement() {\n console.info(document.getElementById('console-error').value);\n }", "title": "" }, { "docid": "23bc3010e90d30273cd13f4c38f04ebc", "score": "0.54452926", "text": "function gameInfo() {\n\tvar url = curActive + \"Info.action\";\n\t_id.o(\"topId\").style.display = \"block\";\n\trunAccordion(\"5\");\n\t_id.o(\"info5Div\").style.display = \"block\";\n\t_id.i(\"info5Div\", \"<iframe src=\\\"\" + url + \"\\\" id=\\\"tktFrame\\\" style=\\\"width:100%;height:100%\\\" frameborder=\\\"0\\\"></iframe>\");\n\t_id.o(\"info5Div\").style.marginLeft = \"30px\";\n\t_id.o(\"info5Div\").style.marginTop = \"60px\";\n}", "title": "" }, { "docid": "812a43ed95e4c19aabad3b5fd6b804a5", "score": "0.5443464", "text": "function CreateInfoTemplateContents(MapMarkerAsJSON) {\r\n // console.log(\"CreateInfoTemplateContents()\");\r\n var nxtDep = MapMarkerAsJSON.nextdep;\r\n var actDep = MapMarkerAsJSON.leftdock;\r\n var leftdockAMPM = MapMarkerAsJSON.leftdockAMPM;\r\n var nextdepAMPM = MapMarkerAsJSON.nextdepAMPM;\r\n var addstyle = \"\";\r\n var eta = MapMarkerAsJSON.eta;\r\n\r\n if (eta.length > 0)\r\n { eta = eta + \" *\"; }\r\n\r\n if (actDep.length == 0)\r\n { actDep = \"--:--\"; }\r\n\r\n // if the vessel is at the dock, and there is no departure time, then it is probaly tied up for the night, or till the next service day, or in layup if it isn't in service.\r\n if (nxtDep.length < 1 && MapMarkerAsJSON.headtxt == \"Stopped\") {\r\n if (MapMarkerAsJSON.inservice == \"True\") nxtDep = \"<i>docked</i>\";\r\n else nxtDep = \"<i>layup</i>\";\r\n }\r\n\r\n if (nxtDep.length == 0) nxtDep = \"--:--\";\r\n\r\n if (it == 0) var addstyle = \" style=\\\"display: none;\\\"\";\r\n\r\n // adjust eta display\r\n if (eta == \"Calculating\") {\r\n if (MapMarkerAsJSON.headtxt == \"Stopped\") eta = \"<em>At Dock</em> *\";\r\n else eta = \" <img src=\\\"../images/vesselwatch/calculatingiiii.gif\\\" style=\\\"top: 3px;\\\"> *\";\r\n }\r\n\r\n // bold PM time values\r\n if (leftdockAMPM == \"PM\") actDep = \"<strong>\" + actDep + \"</strong>\";\r\n\r\n if (nextdepAMPM == \"PM\") nxtDep = \"<strong>\" + nxtDep + \"</strong>\";\r\n\r\n InfoTemplateContents = (\r\n \"<div id='vslPopContainer'>\" +\r\n \"<div class='vslPopModRow'><div>\" + MapMarkerAsJSON.route + \"</div><b>Route:</b></div>\" +\r\n \"<div><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td><b>Sched Depart:</b>&nbsp;\" + nxtDep + \"</td><td align='right'><b>Actual Depart&dagger;:</b>&nbsp;\" + actDep + \"<td></tr></table></div>\" +\r\n \"<div class='vslPopModRow'><div> \" + eta + \"</div><b>Est. Arrival:</b></div>\" +\r\n \"<div><div class='vslPopLat'\" + addstyle + \">\" + MapMarkerAsJSON.lat + \" *</div><b>Latitude:</b></div>\" +\r\n \"<div class='vslPopModRow'><div class='vslPopLon'\" + addstyle + \">\" + MapMarkerAsJSON.lon + \" *</div><b>Longitude:</b></div>\" +\r\n \"<div><div>\" + MapMarkerAsJSON.head + \"&deg; \" + MapMarkerAsJSON.headtxt + \"</div><b>Heading:</b></div>\" +\r\n \"<div class='vslPopModRow'><div>\" + MapMarkerAsJSON.speed + \" knots</div><b>Speed:</b></div>\" +\r\n \"<div><a href='VesselDetail.aspx?vessel_id=\" + MapMarkerAsJSON.vesselID + \"'>\" + MapMarkerAsJSON.name + \" Webpage</a></div>\" +\r\n \"</div>\"\r\n );\r\n\r\n return InfoTemplateContents;\r\n}", "title": "" }, { "docid": "87f233521afdbfb8fab47330e962efe6", "score": "0.5441759", "text": "function createInfoWindow(poly, content) {\n google.maps.event.addListener(poly, 'mouseover', function(event) {\n infowindow.setContent(content);\n infowindow.setPosition(event.latLng);\n infowindow.open(mappings);\n });\n google.maps.event.addListener(poly, 'mouseout', function(event) {\n infowindow.close();\n });\n }", "title": "" }, { "docid": "7c77eb7a64405468aa8998b13b137983", "score": "0.54381293", "text": "function InfoPage() {\n return (\n <div className=\"container\">\n <p>\n Most concrete foundations are made by assembling large aluminum form\n panels. Calculating how many are needed for a job, and keeping track of\n how many are in the yard, are two challenges any company using this\n build method will face. Planel is an application that provides a means\n of documenting and sharing how many panels will be needed for a job, as\n well as tracking how many are in use.\n </p>\n </div>\n );\n}", "title": "" }, { "docid": "0f694c76ce278bfd5261284a87466688", "score": "0.54368466", "text": "function createJPanel(panelTarget, jOptions) {\r\n\t\r\n\tvar JPanel = {\r\n\t\t\r\n\t\tpanel: panelTarget,\r\n\t\t\r\n\t\tvisible: false,\r\n\t\t\r\n\t\tinitialHtml: panelTarget.html(),\r\n\t\t\r\n\t\tblackscreen: jOptions.blackScreen | false,\r\n\t\t\r\n\t\tdraggable: jOptions.draggable | false,\r\n\t\t\r\n\t\tonCloseCallback: function() { if(jOptions.onCloseCallback) {jOptions.onCloseCallback();}; },\t\t\r\n\t\t\r\n\t\tonBeforeShow: function() { if(jOptions.onBeforeShow) {jOptions.onBeforeShow();}; },\r\n\t\t\r\n\t\tshow: function() { //start of show method\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar _this = this;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t_this.panel.css({'zIndex': '999'});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//creating the blackscreen\r\n\t\t\t\t\t\t\tif(_this.blackscreen) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar bs = \"<div id='dumpener'>&nbsp;</div>\";\r\n\t\t\t\t\t\t\t\t$(bs).insertAfter(\"body\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(\"#dumpener\").css({\r\n\t\t\t\t\t\t\t\t\t'userSelect': 'none',\r\n\t\t\t\t\t\t\t\t\t'display': 'none',\r\n\t\t\t\t\t\t\t\t\t'zIndex': '900',\r\n\t\t\t\t\t\t\t\t\t'width': $(document).width(),\r\n\t\t\t\t\t\t\t\t\t'height': $(document).height(),\r\n\t\t\t\t\t\t\t\t\t'position': 'absolute',\r\n\t\t\t\t\t\t\t\t\t'top': '0',\r\n\t\t\t\t\t\t\t\t\t'left': '0',\r\n\t\t\t\t\t\t\t\t\t'background': 'rgba(0, 0, 0, 0.75)'\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\t$(\"#dumpener\").fadeIn(200, 'swing');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} //end of blackscreen creation\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar topPos = 150;\r\n\t\t\t\t\t\t\tvar leftPos = ($(document).width()/2 - _this.panel.width()/2);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t_this.panel.css({ top: topPos,\r\n\t\t\t\t\t\t\t\t\t\t\t left: leftPos\r\n\t\t\t\t\t\t\t\t\t\t\t });\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t_this.onBeforeShow();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t_this.panel.fadeIn(300, 'swing', function() {\r\n\t\t\t\t\t\t\t\t_this.panel.draggable();\r\n\t\t\t\t\t\t\t\t_this.visible = true;\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//setting the close panel triggers\r\n\t\t\t\t\t\t\t_this.panel.find(\".panel-header .close-panel-icon\").click(function() {\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t_this.hide();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}, //end of show method\r\n\t\t\r\n\t\thide: function() { //start of hide method\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar _this = this;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(_this.blackscreen) {\r\n\t\t\t\t\t\t\t\t$(\"#dumpener\").fadeOut(200).remove();\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.panel.fadeOut(200, 'swing', function() {\r\n\t\t\t\t\t\t\t\t_this.panel.removeAttr(\"style\").hide();\r\n\t\t\t\t\t\t\t\t_this.panel.html(_this.initialHtml);\r\n\t\t\t\t\t\t\t\t_this.onCloseCallback();\r\n\t\t\t\t\t\t\t\t_this.panel.find(\"img\").each(function() {\r\n\t\t\t\t\t\t\t\t\t$(this).attr(\"src\", $(this).attr(\"src\") + \"?\" + new Date().getTime());\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\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t_this.visible = false;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}, // end of hide method\r\n\t\t\t\t\t\t\r\n\t\ttoggle: function() { //start of toggle method\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar _this = this;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(_this.visible) {\r\n\t\t\t\t\t\t\t\t_this.hide();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t_this.show();\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} // end of toggle method\r\n\t\t\r\n\t}\r\n\t\r\n\treturn JPanel;\r\n\t\r\n}", "title": "" } ]
504c6ed6bb1c3a375de01bfab2aa0779
We need to both load the config and resolve the paths it references based on where the file is located.
[ { "docid": "e3bcf2d7ffbe4afa8a62dbe239c1bfb4", "score": "0.59962016", "text": "function loadAndResolveConfig(pathName: string): Config {\n debug('resolve', pathName);\n let loadedConfig = requireConfig(pathName);\n let config = {};\n\n // Resolve the plugin require paths...\n config.plugins = (loadedConfig.plugins || []).reduce((list, entry) => {\n // Check if the plugin is referencing a path or a plugin name. If this is a\n // plugin name prefix it.\n if (entry.indexOf('/') === -1) {\n entry = `${PLUGIN_PREFIX}${entry}`;\n }\n\n try {\n debug('resolve module', entry);\n list.push(resolve.sync(entry, {\n basedir: path.dirname(pathName),\n }));\n } catch (err) {\n log.warn(err.message);\n }\n\n return list;\n }, []);\n\n return config;\n}", "title": "" } ]
[ { "docid": "7ed95dc85afea02cb065b162e94ac629", "score": "0.6787081", "text": "loadConfig() {\n try {\n let configData = fs.readFileSync(this.dir + '/' + this.configFile);\n // this is the main yaml configuration\n this.config = yaml.safeLoad(configData.toString());\n if(this.config.base && this.config.base[0] != '/') {\n // if base is not fully qualified, add it to this.dir\n this.config.base = this.dir + '/' + this.config.base;\n }\n if(this.config.source && this.config.source[0] != '/') {\n this.config.source = this.dir + '/' + this.config.source;\n }\n } catch(e) {\n throw 'Error: objects file not found or is not valid YAML';\n }\n // If there are middlewares available, include them\n if(this.config.middleware) {\n for(let type in this.config.middleware) {\n for(let file of this.config.middleware[type]) {\n this.middleware(type, file.substr(0,2) == './' ? requireCWD(file.substr(2)) : require(file)); // for globals\n }\n }\n }\n }", "title": "" }, { "docid": "1f4bfbe4d9e1b1e08b4beed971272caf", "score": "0.6528684", "text": "resolve() {\n let resolvedPath = '';\n let resolvedLookup;\n this.lookups.some(lookup => {\n // Check that the file exists on the file system.\n if (lookup.type === types_1.LookupType.FILE_SYSTEM) {\n if (lookup.path.exists()) {\n resolvedPath = lookup.path;\n resolvedLookup = lookup;\n }\n else {\n return false;\n }\n // Check that the module path exists using Node's module resolution.\n // The `require.resolve` function will throw an error if not found.\n }\n else if (lookup.type === types_1.LookupType.NODE_MODULE) {\n try {\n resolvedPath = require.resolve(lookup.path.path());\n resolvedLookup = lookup;\n }\n catch (error) {\n return false;\n }\n }\n return true;\n });\n if (!resolvedPath || !resolvedLookup) {\n throw new internal_1.RuntimeError('common', 'CM_PATH_RESOLVE_LOOKUPS', [\n this.lookups.map(lookup => ` - ${lookup.path} (${lookup.type})`).join('\\n'),\n ]);\n }\n return {\n originalPath: resolvedLookup.raw,\n resolvedPath: Path_1.default.create(resolvedPath),\n type: resolvedLookup.type,\n };\n }", "title": "" }, { "docid": "df463ff782eac8cb3c15e53fe02dc012", "score": "0.6399206", "text": "async loadConfigFile() {\n\t\tlet filePath;\n\t\t// Env vars have priority over the flags\n\t\tconst configPath = process.env[\"MOLECULER_CONFIG\"] || this.flags.config;\n\n\t\tif (configPath != null) {\n\t\t\tif (path.isAbsolute(configPath)) {\n\t\t\t\tfilePath = this.tryConfigPath(configPath);\n\t\t\t} else {\n\t\t\t\tfilePath = this.tryConfigPath(path.resolve(process.cwd(), configPath));\n\n\t\t\t\tif (filePath == null) {\n\t\t\t\t\tfilePath = this.tryConfigPath(configPath, true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (filePath == null) {\n\t\t\t\treturn Promise.reject(new Error(`Config file not found: ${configPath}`));\n\t\t\t}\n\t\t}\n\n\t\tif (filePath == null) {\n\t\t\tfilePath = this.tryConfigPath(path.resolve(process.cwd(), \"moleculer.config.mjs\"));\n\t\t}\n\t\tif (filePath == null) {\n\t\t\tfilePath = this.tryConfigPath(path.resolve(process.cwd(), \"moleculer.config.js\"));\n\t\t}\n\t\tif (filePath == null) {\n\t\t\tfilePath = this.tryConfigPath(path.resolve(process.cwd(), \"moleculer.config.json\"));\n\t\t}\n\n\t\tif (filePath != null) {\n\t\t\tconst ext = path.extname(filePath);\n\t\t\tswitch (ext) {\n\t\t\t\tcase \".json\":\n\t\t\t\tcase \".js\":\n\t\t\t\tcase \".mjs\":\n\t\t\t\tcase \".ts\": {\n\t\t\t\t\tconst mod = await import(filePath.startsWith(\"/\") ? filePath : \"/\" + filePath);\n\t\t\t\t\tlet content = mod.default;\n\n\t\t\t\t\tif (utils.isFunction(content)) content = await content.call(this);\n\t\t\t\t\tthis.configFile = content;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn Promise.reject(new Error(`Not supported file extension: ${ext}`));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a2f6bdc5e94d41c1e449f5e9dc6d9792", "score": "0.63631666", "text": "load() {\n const configFile = `${this.app.cwd}/config.json`;\n if (fs.pathExistsSync(configFile)) {\n this.timer.start();\n try {\n const loaded = JSON.parse(fs.readFileSync(configFile).toString());\n this.app.config = _.merge(this.defaultConfig, loaded);\n } catch (error) {\n Errors.configParsingError(error);\n if (this.app.config) {\n Errors.configHasValidPrevious();\n return;\n }\n process.exit();\n }\n this.timer.finish();\n Log.success('Configuration Loaded', this.timer.getFormattedLapse());\n } else {\n Log.info('This is not a NPrezz project or there is something wrong in the config.json file.');\n process.exit();\n }\n }", "title": "" }, { "docid": "0f5d6b8f427ce66dc541480cbe66a59d", "score": "0.6321298", "text": "load() {\n let fileContent;\n try {\n fileContent = fs.readFileSync(\"config.json\", \"utf8\")\n } catch (e) {\n console.info(\"Configuration file not found, falling back to default\")\n return\n }\n\n try {\n this._config = JSON.parse(fileContent)\n } catch (e) {\n console.error(\"Error parsing configuration file\")\n process.exit(1)\n }\n }", "title": "" }, { "docid": "b4f149d6d1f13943e40c12fdc5da8bc1", "score": "0.6301237", "text": "load() {\n var data = fs.readFileSync(this.configPath, {\n encoding: 'utf-8'\n });\n this.config = ini.parse(data);\n }", "title": "" }, { "docid": "7fe22760cbe504a4cd0d9f01aba07e49", "score": "0.6242265", "text": "function loadConfig() {\n if (fs.existsSync(__dirname + \"/./config.js\")) {\n config = {};\n config = require(\"./config\");\n }\n\n return config;\n}", "title": "" }, { "docid": "3e9fa138372f484dd343eb9e30adfc24", "score": "0.6162581", "text": "function getConfigFile() {\n\tvar filepath;\n\n\tfor(var i = 0; i < CONFIG_LOCATIONS.length; i++) {\n\t\tfilepath = path.join(path.resolve(CONFIG_LOCATIONS[i]), DEFAULT_CONFIG_FNAME);\n\t\tif( !exists(filepath) ) continue;\n\t\treturn require(filepath).config;\n\t}\n}", "title": "" }, { "docid": "aa36b4cb54cc126092625f4301982293", "score": "0.6157317", "text": "load() {\n // Set properties to default\n this.updateShell(DEFAULT_SHELL);\n this.updateNPMAlias(DEFAULT_NPM_ALIAS);\n this.removeAllScriptNames();\n this.removeAllScripts();\n\n if (fse.pathExistsSync(CONFIG_FILE_PATH)) {\n const { shell, npmAlias, scriptNames } = loadConfigJson();\n this.updateShell(shell);\n this.updateNPMAlias(npmAlias);\n scriptNames.forEach(scriptName => this.addScriptName(scriptName));\n scriptNames\n // Map saved script name to yaml or json file path\n .map(scriptName => {\n let fileName = '';\n SCRIPT_EXTENSIONS.forEach(scriptExtension => {\n const potentialScriptFileName = `${SCRIPTS_DIRECTORY_PATH}/${scriptName}${scriptExtension}`;\n if (fse.pathExistsSync(potentialScriptFileName)) {\n fileName = potentialScriptFileName;\n }\n });\n if (isEmptyString(fileName)) {\n this.removeScriptName(scriptName);\n }\n return fileName;\n })\n .filter(fileName => !isEmptyString(fileName))\n .map(fileName => {\n if (isValidYamlFileName(fileName)) {\n return Parser.getScriptFromYamlFile(fileName);\n }\n return Parser.getScriptFromJsonFile({ fileName });\n })\n .forEach(script => this.addScript(script));\n } else {\n // Save default config\n this.save();\n }\n }", "title": "" }, { "docid": "34fbade22e29a46602527b4e13d0d38a", "score": "0.6050286", "text": "function loadConfig() {\n\tconfigFile = 'apiConfigs.json';\n\tconfig = JSON.parse(\n\t\tfs.readFileSync(configFile)\n\t);\n}", "title": "" }, { "docid": "5c6e02333ac487156e9b605d27f3f1e0", "score": "0.60483295", "text": "function loadConfig(config, path) {\n require('glob').sync('*', {cwd: path}).forEach(function(option) {\n var key = option.replace(/\\.js$/,'');\n // If key already exists, extend it. It is your responsibility to avoid naming collisions\n config[key] = config[key] || {};\n grunt.util._.extend(config[key], require(path + option)(config,grunt));\n });\n // technically not required\n return config;\n }", "title": "" }, { "docid": "0e57a235ee39e87640acb24e6303922c", "score": "0.6037328", "text": "loadLocalConfigFile() {\n let configData = {};\n try {\n configData = this.readFileSync(this.configFilePath);\n\n // validate based on config file version\n if (configData.version > 0) {\n configData = _main_Validator__WEBPACK_IMPORTED_MODULE_3__[\"validateV1ConfigData\"](configData);\n } else {\n configData = _main_Validator__WEBPACK_IMPORTED_MODULE_3__[\"validateV0ConfigData\"](configData);\n }\n if (!configData) {\n throw new Error('Provided configuration file does not validate, using defaults instead.');\n }\n } catch (e) {\n console.log('Failed to load configuration file from the filesystem. Using defaults.');\n configData = this.copy(this.defaultConfigData);\n\n // add default team to teams if one exists and there arent currently any teams\n if (!configData.teams.length && this.defaultConfigData.defaultTeam) {\n configData.teams.push(this.defaultConfigData.defaultTeam);\n }\n delete configData.defaultTeam;\n\n this.writeFileSync(this.configFilePath, configData);\n }\n return configData;\n }", "title": "" }, { "docid": "f48bf1d6a4ebce41dd0eefa704d813b5", "score": "0.6018207", "text": "function loadConfig() {\n config = JSON.parse(fs.readFileSync(\"configfiles/config.json\"));\n console.log(localDateString() + \" | \" + colors.green(\"[LOAD]\") + \" Config file has been loaded!\");\n}", "title": "" }, { "docid": "8c49865b7318ed02e1480af0f8b1964e", "score": "0.6017339", "text": "static parseConfig() {\n\t\tlet globalConfig;\n\t\tlet localConfig;\n\t\tlet mergedConfig;\n\t\tconst globalPath = path.join(userHome, '.jimrc.js');\n\t\tif (fs.existsSync(globalPath)) {\n\t\t\tglobalConfig = require(globalPath);\n\t\t} else {\n\t\t\tfs.copyFileSync(\n\t\t\t\tpath.join(__dirname, 'boilerplate', 'jimrc.example.js'),\n\t\t\t\tglobalPath\n\t\t\t);\n\t\t\tglobalConfig = require(globalPath);\n\t\t}\n\t\tconst localPath = path.join(process.cwd(), '.jimrc.js');\n\t\tif (fs.existsSync(localPath)) {\n\t\t\tlocalConfig = require(localPath);\n\t\t}\n\t\tif (globalConfig) {\n\t\t\tmergedConfig = merge.recursive(globalConfig, localConfig);\n\t\t} else {\n\t\t\tmergedConfig = localConfig;\n\t\t}\n\n\t\treturn mergedConfig;\n\t}", "title": "" }, { "docid": "3c74a6ed63bc11fe7d529914ce169fd0", "score": "0.60170627", "text": "_parseConfigDir() {\n // We will be cautious and won't auto-make any directories other than ~/.wafflebot.\n // TODO: Possibly change this behaviour\n\n if (!this._configDir) {\n this.resolvedConfigDirectory = this.path.join(this.os.homedir(), '.wafflebot');\n this.canCreateDir = true;\n } else if (!this.path.isAbsolute(this._configDir)) {\n this.resolvedConfigDirectory = this.path.join(this.process.cwd(), this._configDir);\n } else {\n this.resolvedConfigDirectory = this._configDir;\n }\n\n this.logger.debug(`Resolved config dir as ${this.resolvedConfigDirectory}.`);\n }", "title": "" }, { "docid": "acc01a6cfe7914636cf24c5e59d4b0be", "score": "0.59878975", "text": "loadConfig() {\n // TODO: Make Private\n const configPath = path.join(__dirname, '../config.yml');\n return yaml.safeLoad(fs.readFileSync(configPath));\n }", "title": "" }, { "docid": "96703e3990acc37e20b9f22d2ad74229", "score": "0.59598815", "text": "resolveAsPath() { }", "title": "" }, { "docid": "e8850ece76bfe2acc5e769ee55c02246", "score": "0.59563035", "text": "getConfig() {\n try {\n let contents = fs.readFileSync(this.getFilePath(), 'utf8');\n return yaml.load(contents);\n }\n catch (err) {\n console.log(err.stack || String(err));\n }\n }", "title": "" }, { "docid": "1e20243915e330efc704361e9b7ac909", "score": "0.59365386", "text": "_loadConfiguration() {\n storage.get(this.storageFile, (err, data) => {\n if (err) {\n debug('error loading', err);\n throw err;\n }\n\n // merge config data\n Object.assign(this.config, data)\n debug('Configuration loaded', this.config)\n\n // emit event when data is loaded\n this.emit('initialized')\n });\n }", "title": "" }, { "docid": "0061ba47360f1784c5fc824b7a68a2f7", "score": "0.5917876", "text": "function resolveConfigFilePath(project_dir, platform, file) {\n var filepath = path.join(project_dir, file);\n if (file.indexOf('*') > -1) {\n // handle wildcards in targets using glob.\n var matches = glob.sync(path.join(project_dir, '**', file));\n if (matches.length) filepath = matches[0];\n } else {\n // special-case config.xml target that is just \"config.xml\". this should be resolved to the real location of the file.\n if (file == 'config.xml') {\n if (platform == 'android') {\n filepath = path.join(project_dir, 'res', 'xml', 'config.xml');\n } else {\n var matches = glob.sync(path.join(project_dir, '**', 'config.xml'));\n if (matches.length) filepath = matches[0];\n }\n }\n }\n return filepath;\n}", "title": "" }, { "docid": "fde695d27d10826c2695710458491ed4", "score": "0.5917669", "text": "function loadConfig(configFile) {\n const configFileNames = [\n 'graph-wrangle.config.json',\n 'graph-wrangle.config.js',\n ];\n\n let config;\n\n // if provided a filename explicitly, use it\n if (configFile) {\n debug('Load config ' + configFile);\n config = require(path.resolve(configFile));\n } else {\n // otherwise, try to load a default filename\n for (const filename of configFileNames) {\n try {\n debug('Attempt to load config ' + filename);\n config = require(path.resolve(filename));\n debug('Successfully loaded config from ' + filename);\n if (config) {\n break;\n }\n } catch (e) {\n /* ignore failing to load files */\n }\n }\n }\n\n return config;\n}", "title": "" }, { "docid": "6ef33e8c315828a961570842e375df81", "score": "0.59035045", "text": "getConfigFor(filename, configOverride) {\n /* special case when the overridden configuration is marked as root, should\n * not try to load any more configuration files */\n const override = this.loadFromObject(configOverride || {});\n if (override.isRootFound()) {\n override.init();\n return override;\n }\n /* special case when the global configuration is marked as root, should not\n * try to load and more configuration files */\n if (this.globalConfig.isRootFound()) {\n const merged = this.globalConfig.merge(override);\n merged.init();\n return merged;\n }\n const config = this.fromFilename(filename);\n const merged = config ? config.merge(override) : this.globalConfig.merge(override);\n merged.init();\n return merged;\n }", "title": "" }, { "docid": "c3f68ad60df8326f5cf98c4a2a2ed7a6", "score": "0.58839923", "text": "function loadConfig() {\n // Load the config\n try {\n config = JSON.parse(fs.readFileSync( __dirname + '/config.json', 'utf8'));\n } catch (err) {\n throw err;\n }\n\n console.log(config);\n console.log('Config successfully loaded');\n}", "title": "" }, { "docid": "fd275a14d96f1b09b754f5112ffa9a22", "score": "0.5845734", "text": "function loadTestConfig(configPath) {\n var configBaseDir = path_1.dirname(configPath);\n var resolveRelativePath = function (relativePath) { return path_1.resolve(configBaseDir, relativePath); };\n try {\n var config = require(configPath);\n if (!path_1.isAbsolute(config.baseDir)) {\n config.baseDir = resolveRelativePath(config.baseDir);\n }\n if (!path_1.isAbsolute(config.goldenFile)) {\n config.goldenFile = resolveRelativePath(config.goldenFile);\n }\n if (!path_1.isAbsolute(config.glob)) {\n config.glob = resolveRelativePath(config.glob);\n }\n return config;\n }\n catch (e) {\n console_1.error('Could not load test configuration file at: ' + configPath);\n console_1.error(\"Failed with: \" + e.message);\n process.exit(1);\n }\n }", "title": "" }, { "docid": "ce666949355c4d2b1ab5c1cca2ca1f02", "score": "0.58447105", "text": "function getPathMappingsFromTsConfig(fs, tsConfig, projectPath) {\n if (tsConfig !== null && tsConfig.options.baseUrl !== undefined &&\n tsConfig.options.paths !== undefined) {\n return {\n baseUrl: fs.resolve(projectPath, tsConfig.options.baseUrl),\n paths: tsConfig.options.paths,\n };\n }\n }", "title": "" }, { "docid": "828a8cb0a778218cd1a0c3d0b12df6a1", "score": "0.5838752", "text": "loadCustomConfig() {\n try {\n const config = require(`${process.cwd()}/config/server.js`) || {};\n\n this._config = merge.all([this._config, config]);\n } catch (err) {\n if (!err.code || err.code !== 'MODULE_NOT_FOUND') {\n throw err;\n }\n }\n }", "title": "" }, { "docid": "323c50c958125a49da84da29249d47a2", "score": "0.5835098", "text": "static loadConfig(appHook) {\n const configPath = `${appHook.getPath('home')}/.fermion/fermion.config.json`;\n\n const config = fs.readFileSync(configPath, 'utf8');\n return config;\n }", "title": "" }, { "docid": "75f866592ee204f7659a7476598f408a", "score": "0.58340526", "text": "function computeConfig() {\n return new Promise(function(resolve, reject){\n config.blogPath = __dirname +'\\\\' + config.blogPath;\n resolve();\n });\n}", "title": "" }, { "docid": "bb33ccffbc7ba9d30c4e9d0a025b9f76", "score": "0.5831687", "text": "function resolve (config) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar configHashPath = API.PATH.join(API.getTargetPath(), \".pinf.config.hash\");\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NOTE: We ALWAYS resolve the config on every turn.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Each module should cache its responses on subsequent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// calls if nothing has changed in the input!\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar defaultResolve = function (resolver, config, previousResolvedConfig) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t API.console.verbose(\"Call default resolver for:\", API.getRootPath());\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn resolver({});\n\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\t\t\t\t\t\t\t\t\t\tvar resolver = function (resolverApi) {\n\t\t\t\t\t\t\t\t\t\t\t\t \tAPI.console.debug(\"Resolve config using API:\", resolverApi);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn config.resolve(resolverApi).fail(function (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terr.message += \" (while resolving parsed config using resolverApi for node '\" + parsedConfig.id + \"')\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terr.stack += \"\\n(while resolving parsed config using resolverApi for node '\" + parsedConfig.id + \"')\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthrow err;\n\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\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar previousResolvedSectionConfig = null;\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (alias in runtimeDescriptor) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (runtimeDescriptor[alias].$context === API.getContextId()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpreviousResolvedSectionConfig = runtimeDescriptor[alias];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\t\t\t\n\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\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI.console.debug(\"Previous resolved config for '\" + API.getTargetPath() + \"':\", previousResolvedSectionConfig);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!api) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI.console.debug(\"No plugin code loaded for '\" + parsedConfig.id + \"'!\", parsedConfig);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t \tAPI.console.verbose(\"Call resolve() on '\" + parsedConfig.id + \"' implemented by '\" + parsedConfig.$context + \"' for program:\", API.getRootPath());\n\n\t\t\t\t\t\t\t\t\t\t\t \treturn config.unfreeze().then(function (config) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t \tvar resolving = null;\n\t\t\t\t\t\t\t\t\t\t\t\t \ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t \t\tresolving = (\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tapi &&\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tapi.resolve &&\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tapi.resolve(resolver, config, previousResolvedSectionConfig)\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t) ||\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tdefaultResolve(resolver, config, previousResolvedSectionConfig)\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t \t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t \t\terr.message += \" (while calling resolve for '\" + parsedConfig.id + \"')\";\n\t\t\t\t\t\t\t\t\t\t\t\t \t\terr.stack += \"\\n(while calling resolve for '\" + parsedConfig.id + \"')\";\n\t\t\t\t\t\t\t\t\t\t\t\t \t\tthrow err;\n\t\t\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn API.Q.when(resolving).then(function (resolvedSectionConfig) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar changed = true;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO: Make this a proper JSON-LD context.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tresolvedSectionConfig.$context = API.getContextId();\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO: Use sorted JSON.\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar configHash = API.CRYPTO.createHash(\"sha1\").update(JSON.stringify(config)).digest(\"hex\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar previousConfigHash = JSON.stringify(previousResolvedSectionConfig, null, 4);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar configHash = JSON.stringify(resolvedSectionConfig, null, 4);\n\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI.console.debug(\"New resolved config for '\" + API.getTargetPath() + \"':\", resolvedSectionConfig);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn Q.denodeify(function (callback) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction remove (reason, callback) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn API.FS.exists(API.getTargetPath(), function (exists) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!exists) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Nothing to remove because it does not yet exit.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn callback(null);\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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI.console.debug(\"Removing '\" + API.getTargetPath() + \"' due to \" + reason + \"!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn API.FS.remove(API.getTargetPath(), callback);\n\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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (configHash === previousConfigHash) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchanged = false;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI.console.debug(\"Resolved config for '\" + API.getTargetPath() + \"' has not changed!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn callback(null);\n\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\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn remove(\"config hash having changed from '\" + previousConfigHash + \"' to '\" + configHash, callback);\n\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn remove(\"config hash having changed\", callback);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})().then(function () {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tresolvedConfig[resolvedSectionConfig.$to] = resolvedSectionConfig;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn API.Q.denodeify(API.FS.outputFile)(configHashPath, configHash, \"utf8\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}).then(function () {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAPI.console.debug(\"Resolved config changed: \" + changed);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!changed) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (action === \"turn\") {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!API.FS.existsSync(API.PATH.join(API.getTargetPath(), \".pinf.turn.done\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchanged = true;\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\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\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn [resolvedSectionConfig, changed];\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\t\t\t\t\t\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\t\t\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "ef6d61f5e8efc4f2324dc9c2987438e7", "score": "0.58297384", "text": "getPaths () {\n if (this._paths) {\n return this._paths\n }\n\n const paths = []\n\n let proto = this\n\n // 1. should has a own property `configFileName`\n // 2. this.configFileName should be a string\n // 3. has a own property `nodePath` or not\n\n // Loop back for the prototype chain\n while (proto) {\n proto = Object.getPrototypeOf(proto)\n\n // There is no caviar.config.js in caviar,\n // So just stop\n if (proto === ConfigLoader.prototype) {\n break\n }\n\n if (!hasOwnProperty(proto, 'configFile')) {\n throw error('CONFIG_FILE_GETTER_REQUIRED')\n }\n\n const {\n configFile\n } = proto\n\n if (!isString(configFile)) {\n throw error('INVALID_CONFIG_FILE', configFile)\n }\n\n const nodePath = hasOwnProperty(proto, 'nodePath')\n ? checkNodePath(proto.nodePath)\n : UNDEFINED\n\n paths.push({\n nodePath: nodePath && realNodePath(nodePath),\n configFile: realConfigFile(configFile)\n })\n }\n\n log('config-loader: paths: %s', inspect(paths))\n\n return this._paths = paths\n }", "title": "" }, { "docid": "27d60a6fec7b7b5247f88d3c0c99e1cf", "score": "0.582417", "text": "fromFilename(filename) {\n var _a;\n if (filename === \"inline\") {\n return null;\n }\n if (this.cache.has(filename)) {\n return (_a = this.cache.get(filename)) !== null && _a !== void 0 ? _a : null;\n }\n let found = false;\n let current = path__default[\"default\"].resolve(path__default[\"default\"].dirname(filename));\n let config = this.empty();\n // eslint-disable-next-line no-constant-condition\n while (true) {\n /* search configuration files in current directory */\n for (const configFile of findConfigurationFiles(current)) {\n const local = this.loadFromFile(configFile);\n found = true;\n config = local.merge(config);\n }\n /* stop if a configuration with \"root\" is set to true */\n if (config.isRootFound()) {\n break;\n }\n /* get the parent directory */\n const child = current;\n current = path__default[\"default\"].dirname(current);\n /* stop if this is the root directory */\n if (current === child) {\n break;\n }\n }\n /* no config was found by loader, return null and let caller decide what to do */\n if (!found) {\n this.cache.set(filename, null);\n return null;\n }\n this.cache.set(filename, config);\n return config;\n }", "title": "" }, { "docid": "7408f212a882156424eb901089779a63", "score": "0.5768568", "text": "function loadConfigs() {\n grunt.file.expandMapping(settings.configs, '', {\n flatten: true,\n ext: ''\n }).forEach(function(configFile) {\n var config = {};\n config[configFile.dest] = grunt.file.readJSON(configFile.src[0]);\n grunt.config.merge(config);\n });\n}", "title": "" }, { "docid": "2037498abc80bbe5f99e17dbb3538cfc", "score": "0.5766386", "text": "readLocalConfigFile() {\n if (fs.existsSync(configFilePath)){\n let configFileRaw = fs.readFileSync(configFilePath);\n this.config = JSON.parse(configFileRaw);\n return true;\n }\n // Config file doesn't exist locally\n return false;\n }", "title": "" }, { "docid": "950eed4bf6726ea965585f6041619553", "score": "0.57580215", "text": "function loadConfiguration() {\n if (isProdEnvironment()) {\n appConfiguration = require('./production/productionConfiguration.json');\n } else if (isQAEnvironment()) {\n appConfiguration = require('./sandbox/sandboxConfiguration.json');\n } else if (isDevEnvironment()) {\n appConfiguration = require('./development/devConfiguration.json');\n } else {\n appConfiguration = require('./local/localConfiguration.json');\n }\n console.log(\n '******************** Environment detected ********************',\n process.env.NODE_ENV,\n );\n console.log('appConfiguration loaded ', appConfiguration);\n}", "title": "" }, { "docid": "f748487c9306ac45ab3fe3e63a7f91b5", "score": "0.57516134", "text": "async loadRegisterCenterConfig() {\n LoggerCore.majorinfo(`Reading constants from a config file`);\n this.config = await loadConfigObjFromToml(\n path.join(__dirname, \"config.toml\")\n );\n }", "title": "" }, { "docid": "a3148a401caae1ee9ebc27c433b089a0", "score": "0.57428735", "text": "read() {\n this.exists()\n if (!this.validate()) {\n }\n const config = JSON.parse(fs.readFileSync(this.configPath))\n return config\n }", "title": "" }, { "docid": "23d065f52f154472c68cfdf6033960ab", "score": "0.57342285", "text": "onBeginResolve(context) {\n this.basePath = fs_1.getCommonDirectory([...this.fileNames]);\n for (const file of context.project.files) {\n const fileName = (file.fileName = fs_1.normalizePath(path_1.relative(this.basePath, file.fileName)));\n this.fileMappings[fileName] = file;\n }\n }", "title": "" }, { "docid": "793eafc9b16265c5579a95a08e8318d0", "score": "0.57143795", "text": "lookupFilePath(filePath, cwd) {\n this.lookups.push({\n path: Path_1.default.resolve(filePath, cwd),\n raw: Path_1.default.create(filePath),\n type: types_1.LookupType.FILE_SYSTEM,\n });\n return this;\n }", "title": "" }, { "docid": "67c786ee3124e7e9ec27b47cfd7a2c24", "score": "0.57095397", "text": "getConfigFor(filename, configOverride) {\n return this.configLoader.getConfigFor(filename, configOverride);\n }", "title": "" }, { "docid": "97466ba50fda7338459eeef66792bce0", "score": "0.56877536", "text": "function manageConfiguration(configFile) {\n try {\n // check if the config file exists or not\n if (fs.existsSync(configFile)) {\n // check if the user provide absolute path or not\n if (path.isAbsolute(configFile)) {\n config = require(configFile);\n } else {\n // get the absolute path of that config file\n const filePath = path.resolve(configFile);\n config = require(filePath);\n }\n } else {\n console.log(\n chalk.bgMagentaBright.bold(' Config file does not exist; Using default config. ')\n );\n setDefaultConfig();\n }\n } catch (err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "3c9d1cb896db173dc9db4974fabb0580", "score": "0.5665179", "text": "_loadFileConfig() {\n try {\n let lines = fs.readFileSync(this._LOGLOVE_CONFIG).toString().split('\\n');\n for (let line of lines) {\n let levelPattern = line.split('=');\n this._setLevelAndPatterns(levelPattern[0], levelPattern[1]);\n }\n } catch (err) {\n // console.log('_loadFileConfig', err);\n }\n }", "title": "" }, { "docid": "3639631ffb2bdd3dab367f8699b63422", "score": "0.5628541", "text": "function config () {\n\n if (cache) {\n return cache;\n }\n\n var path = process.cwd() + '/config.json'\n , content;\n\n //load and merge object\n content = fs.readFileSync(path, 'utf-8');\n\n try {\n cache = JSON.parse(content);\n log.info('config file ' + path + ' loaded.');\n } catch(e) {\n log.error('could not parse config file: ' + path);\n throw e;\n }\n\n return cache;\n\n}", "title": "" }, { "docid": "2257d62d1db2ad10aea699549564bd1f", "score": "0.56270796", "text": "function resolveFile (file) {\n return path.join(APP_ROOT, file)\n}", "title": "" }, { "docid": "ada84e6f51a6757639301dc476183679", "score": "0.5601494", "text": "function loadFile() //loads settings on first load of app\n{\n\ttry {\n\t\tlet rawdata = fs.readFileSync(configFile);\n\t\tlet myJson = JSON.parse(rawdata);\n\n\t\tif (myJson.port_udp)\n\t\t{\n\t\t\tconfig.port_udp = myJson.port_udp;\n\t\t}\n\t\n\t\tif (myJson.port_serial)\n\t\t{\n\t\t\tconfig.port_serial = myJson.port_serial;\n\t\t}\n\n\t\tif (myJson.baudRate) {\n\t\t\tconfig.baudRate = myJson.baudRate;\n\t\t}\n\t}\n\tcatch(error) {\n\t\tconsole.log('Error parsing config file:');\n\t\tconsole.log(error);\n\t}\n}", "title": "" }, { "docid": "1134d773ef029565cdabdc5f55d63a04", "score": "0.5598546", "text": "function resolveFiles() {\n ResolverFactory.getInstance('css').resolve();\n ResolverFactory.getInstance('js').resolve();\n}", "title": "" }, { "docid": "2bdb019fa367233bde1492c47f4f9bd2", "score": "0.55979186", "text": "function loadPath(pathStr, basePathStr) {\n var path = pathStr\n , match;\n //if the path begins with a dot, it's relitive to the current project\n if (pathStr[0] === \".\") {\n path = node_path.join(\n basePathStr\n , pathStr.substring(1)\n );\n }\n //otherwise, if the path has a project path in it, create the project path\n else if ((match = pathStr.match(PROJ_PATH_PATT))) {\n path = node_path.join(\n workspacePath\n , defaults.sourceDirectory\n , match[1].replace(DOT_PATT, \"/\")\n , match[2]\n );\n }\n\n return fs_fileLoader(\n path\n )\n .then(function thenParseData(data) {\n return parseData(data);\n });\n }", "title": "" }, { "docid": "476e01aae340fda82843de18425f7b06", "score": "0.55838615", "text": "function loadTestWithConfig(path, config) {\n\n}", "title": "" }, { "docid": "9f797dbc6d8c11c656aed4bd61a31762", "score": "0.55663526", "text": "function Config()\n{\nvar self = this;\n\n//console.log(\"in Config::Config()\");\n\nvar baseConfig = null;\nvar overridingConfig = null;\nvar config = null;\nvar path = null;\n\n// Hack to use real require in webpack\nvar doRequire = function(module)\n\t{\n\treturn eval(\"require\")(module);\n\t};\n\n// Load the default speconfig.js file and apply overrides in the order:\n// 1. make base config global\n// 2. module.parent.speconfig\n// 3. \"speconfig.js\"\n// 4. process.cwd()/speconfig.js\n\nvar globalObj = (typeof(window) === \"undefined\" ? global : window);\n\nif (typeof globalObj.speBaseConfig_)\n\t{\n\tbaseConfig = globalObj.speBaseConfig_;\n\t}\n\nif (typeof window === \"undefined\") //in node.js\n\t{\n\tpath = require('path');\n\n\tif (!baseConfig)\n\t\t{\n\t\ttry\t{\n\t\t\tvar apipath = \"/var/lib/spaceify/code/\";\n\t\t\tbaseConfig = doRequire(path.resolve(apipath, \"spebaseconfig.js\"));\n\n\t\t\t//console.log(\"Loaded base config from /var/lib/spaceify/code/\");\n\t\t\t}\n\t\tcatch (e)\n\t\t\t{\n\t\t\tbaseConfig = require(\"./spebaseconfig.js\");\n\n\t\t\t//console.log(\"Loaded base config from the spaceifyedge package\");\n\t\t\t}\n\t\t}\n\n\tif (!baseConfig)\n\t\t{\n\t\t//console.log(\"Error loading base config, exiting\");\n\n\t\tprocess.exit(1);\n\t\t}\n\n\t// load and apply the overriding configs\n\n\ttry\t{\n\t\toverridingConfig = doRequire(module.parent.speconfig);\n\t\tConfig.overrideConfigValues(baseConfig, overridingConfig);\n\n\t\t//console.log(\"Loaded overriding config from module.parent.speconfig\");\n\t\t}\n\tcatch (e)\n\t\t{}\n\tfinally\n\t\t{\n\t\ttry\n\t\t\t{\n\t\t\toverridingConfig = doRequire(\"speconfig\");\n\t\t\tConfig.overrideConfigValues(baseConfig, overridingConfig);\n\n\t\t\t//console.log(\"Loaded overriding config from \\\"speconfig\\\"\");\n\t\t\t}\n\t\tcatch (e)\n\t\t\t{}\n\t\tfinally\n\t\t\t{\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\t//console.log(\"Trying to load overriding config from working directory \"+process.cwd());\n\n\t\t\t\toverridingConfig = doRequire(path.resolve(process.cwd(), \"speconfig.js\"));\n\t\t\t\tConfig.overrideConfigValues(baseConfig, overridingConfig);\n\n\t\t\t\t//console.log(\"Loaded overriding config from working directory\");\n\t\t\t\t}\n\t\t\tcatch (e)\n\t\t\t\t{\n\t\t\t\t//console.log(e);\n\t\t\t\t}\n\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t//console.log(\"Loading config files completed\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\nelse if (typeof window !== \"undefined\")\t//in browser\n\t{\n\tvar lib = window;\n\n\tif (window.WEBPACK_MAIN_LIBRARY)\t// browser using a bundled spaceifyedge\n\t\t{\n\t\tlib = window.WEBPACK_MAIN_LIBRARY;\n\t\t}\n\n\tif (!baseConfig)\n\t\tbaseConfig = lib.SpeBaseConfig;\n\n\tif (lib.SpeConfig)\n\t\tConfig.overrideConfigValues(baseConfig, lib.SpeConfig);\n\t\n\tif (lib !== window && window.SpConfig)\n\t\tConfig.overrideConfigValues(baseConfig, window.SpConfig);\n\t\t\n\t}\n\n/*\nif (!baseConfig)\t\t\t\t\t\t// Default configuration not found\n\t{\n\tconfig = {};\n\t}\nelse\n\t{\n\tconfig = {};\n\n\t// Apply configuration from webpack or window or nodejs config\n\tif(ConfigClass[\"defaultConfig\"])\t\t\t\t\t\t\t// Set defaultConfig as base\n\t\tconfig = ConfigLoader.overrideConfigValues(config, ConfigClass.defaultConfig);\n\n\tif (ConfigClass[class_])\t\t\t\t\t\t\t\t\t\t// Class found\n\t\tconfig = ConfigLoader.overrideConfigValues(config, ConfigClass[class_]);\n\n\tif (ConfigClass[\"globalConfigOverride\"])\t\t\t\t\t\t// Global override\n\t\tconfig = ConfigLoader.overrideConfigValues(config, ConfigClass[\"globalConfigOverride\"]);\n\n\tif(override_)\t\t\t\t\t\t\t\t\t\t\t\t// User override (when calling this function)\n\t\tconfig = ConfigLoader.overrideConfigValues(config, override_);\n\t}\n*/\n//console.log(\"Config::Config() \"+JSON.stringify(baseConfig));\n\nglobalObj.speBaseConfig_ = baseConfig;\n\nself.getConfig = function()\n\t{\n\treturn baseConfig;\n\t}\n\n}", "title": "" }, { "docid": "6a6a9da9535a102de8ff1ef4bd9a3ef0", "score": "0.55450344", "text": "_configure() {\n super._configure();\n Object.assign(this.path, {\n root: 'dist',\n 'package-a': TargetConfigA.packagePath,\n });\n Object.assign(this, { // dependent on this.path\n });\n }", "title": "" }, { "docid": "1986e24c1058641121651c62c701613b", "score": "0.5541323", "text": "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}", "title": "" }, { "docid": "e6af386eb92b3bb19a079f4013b33a31", "score": "0.55261517", "text": "function concatUserDefinedConfigFile() {\n var userDefinedConfigFilePath = path.join(exports.homedir, USER_DEFINED_CONFIG_FILE_NAME);\n \n if (!fs.existsSync(userDefinedConfigFilePath)) {\n return;\n }\n\n var userConfig;\n try {\n userConfig = JSON.parse(fs.readFileSync(userDefinedConfigFilePath));\n } catch (err) {\n console.log(\"ERROR: empty or malformed configuration file at '\" + userDefinedConfigFilePath +\n \"'. Config file must be in JSON format.\");\n throw err;\n }\n\n if (!userConfig.pluginDirPaths || userConfig.pluginDirPaths.length === 0) {\n return;\n }\n\n exports.config.pluginDirPaths = exports.config.pluginDirPaths.concat(userConfig.pluginDirPaths);\n exports.config.pluginInterfaceDirPaths = exports.config.pluginInterfaceDirPaths.concat(userConfig.pluginInterfaceDirPaths);\n}", "title": "" }, { "docid": "233a8f504029d4fcf2f7f50be0789131", "score": "0.55177355", "text": "constructor() {\n this.config = require(\"./Config/config.json\");\n }", "title": "" }, { "docid": "a1d34b28a266bc849e85b73dd7ab594c", "score": "0.55084723", "text": "function loadConfiguration(callback) {\n whenConfigurationAvailable(function() {\n console.log(\"Loading config\");\n require([\"./goto\", \"./project\"], function(goto, project) {\n if (goto.getFileCache().indexOf(\"/zedconfig.json\") !== -1) {\n project.readFile(\"/zedconfig.json\", function(err, text) {\n var base = {};\n try {\n base = JSON.parse(text);\n } catch (e) {\n console.error(e);\n }\n loadUserConfiguration(base, callback);\n });\n } else {\n loadUserConfiguration({}, callback);\n }\n });\n });\n }", "title": "" }, { "docid": "1cc98d738f773af0599590d8257a8d15", "score": "0.54780066", "text": "loadConfiguration() {\n // load general server configuration\n let configurationFilePath = filePath.join(__dirname, '/../' + 'configuration.json');\n this.configurationStorage = JSON.parse(fileSystem.readFileSync(configurationFilePath));\n\n // done\n return true;\n }", "title": "" }, { "docid": "e576d88045c2c9f68a6b95db444c9aaa", "score": "0.5469885", "text": "function readConfig(resolve, reject) {\n fs.readFile(CONFIGPATH, {flag: 'r', encoding: 'utf8'}, function(err, data) {\n if(err) {\n reject(err);\n } else {\n config = JSON.parse(data);\n resolve();\n }\n });\n}", "title": "" }, { "docid": "50692c4e6354e02737cff0c77692fc23", "score": "0.54671806", "text": "function config() {\n global.config.build.rootDirectory = path.join('../EquiTrack/assets/frontend/', global.config.appName);\n global.config.build.templateDirectory = path.join('../EquiTrack/templates/frontend/', global.config.appName);\n global.config.build.bundledDirectory = '.';\n indexPath = path.join(global.config.build.rootDirectory, 'index.html');\n bowerPath = path.join(global.config.build.rootDirectory, 'bower.json');\n templatePath = global.config.build.templateDirectory;\n}", "title": "" }, { "docid": "e37970ffd75b2750bd21b5dc314ad53c", "score": "0.5465037", "text": "function readConfig() {\r\n\t\tvar deferred = new $.Deferred(),\r\n activeDocument = DocumentManager.getCurrentDocument(),\r\n\t\t\tcurrentPath = activeDocument.file._parentPath,\r\n \tactiveDocumentDir = FileSystem.getDirectoryForPath(currentPath),\r\n\t\t\trootDir = ProjectManager.getProjectRoot(),\r\n\r\n\t\t\tfilesArr = [], // Holds the files names as we loop through.\r\n\t\t\tnewPath, // Holds the path to which we look up for the config file.\r\n\t\t\tjshintContent, // Holds the contents of the \".jshintrc\" file.\r\n\t\t\tdirectiveFromConfig; // Holds the final directive string.\r\n\r\n /**\r\n * Loops through files of a directory looking for \".jshintrc\" file.\r\n * @param dir {Object} The directory to loop through its contents.\r\n * @param callback {Function} A callback function to execute when finished.\r\n */\r\n\t\tfunction loopFiles(dir, callback) {\r\n // Loop dir's diles until we reach the project's root.\r\n\t\t\tif (dir._path !== rootDir._parentPath) {\r\n dir._contents.forEach(function (f) {\r\n // Store files names in array for later use.\r\n\t\t\t\t\tfilesArr.push(f._name);\r\n\r\n // If filename is \".jshintrc\", store its contents\r\n // in a variable for later use.\r\n\t\t\t\t\tif (f._name === '.jshintrc') {\r\n\t\t\t\t\t\tjshintContent = f._contents;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n // Execute the callback function.\r\n if (typeof callback === 'function' && typeof callback !== 'undefined') {\r\n\t\t\t\t callback(dir, callback);\r\n }\r\n\t\t\t}\r\n\t\t}\r\n\r\n // Loop through files beginning from the current document's\r\n // directory until we find \".jshintrc\" configuration file.\r\n\t\tloopFiles(activeDocumentDir, function (dir, callback) {\r\n\t\t\tif (filesArr.indexOf('.jshintrc') === -1) {\r\n\t\t\t\t// File is not found, so continue lookup.\r\n filesArr = [];\r\n\t\t\t\tnewPath = dir._parentPath;\r\n\t\t\t\tloopFiles(FileSystem.getDirectoryForPath(newPath), callback);\r\n\t\t\t} else {\r\n // File is found, so read its contents,\r\n // generate the JSHint directive\r\n // and return a promise.\r\n\t\t\t\tjshintContent = $.parseJSON(jshintContent);\r\n\r\n\t\t\t\tvar directive = '/*jshint ';\r\n\r\n\t\t\t\tfor (var prop in jshintContent) {\r\n\t\t\t\t\tif (jshintContent.hasOwnProperty(prop)) {\r\n\t\t\t\t\t\tdirective += prop + ': ' + jshintContent[prop] + ', ';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdirective = directive.substring(0, directive.length - 2);\r\n\t\t\t\tdirective += '*/';\r\n\r\n\t\t\t\tdirectiveFromConfig = directive;\r\n deferred.resolve(directiveFromConfig);\r\n\t\t\t}\r\n\t\t});\r\n\r\n return deferred.promise();\r\n }", "title": "" }, { "docid": "688049061cede2e725da21bed3d47827", "score": "0.5463827", "text": "function loadConfig(cb) {\n var configFilename = DEFAULT_CONFIG_FILE,\n file,\n config;\n\n if (args.length === 2) {\n configFilename = args[1];\n }\n\n if (fs.exists(configFilename)) {\n config = JSON.parse(fs.read(configFilename));\n addSharedConfigToSets(config);\n cb(null, config);\n } else {\n cb(new Error('Could not load config file: ' + configFilename));\n }\n}", "title": "" }, { "docid": "203703c76f930c74a386f75f0a80c24f", "score": "0.54571724", "text": "function loadConfig() {\n var config = JSON.parse(fs.readFileSync(__dirname+ '/config.json', 'utf-8'));\n for (var i in config) {\n config[i] = process.env[i.toUpperCase()] || config[i];\n }\n console.log('Configuration');\n console.log(config);\n return config;\n}", "title": "" }, { "docid": "fdc17ee562877050684a1b42141be07d", "score": "0.54567283", "text": "function loadConfig(configPath) {\n return readJSONFile(configPath) || null;\n}", "title": "" }, { "docid": "fe4ef8411adc19aa6080719fcaac83fb", "score": "0.54484993", "text": "function parseConfig() {\n var p = this.path + '/config/',\n files = framework.util.getFiles(p),\n mainPos = files.indexOf('main.js'),\n jsExt = framework.regex.jsFile,\n config = require(this.path + '/config/main.js');\n\n for (var file,key,cfg,i=0; i < files.length; i++) {\n if (i==mainPos) continue;\n file = files[i];\n key = file.replace(jsExt, '');\n cfg = require(this.path + '/config/' + file);\n if (typeof config[key] == 'object') _.extend(config[key], cfg); \n else config[key] = cfg;\n }\n\n return config;\n}", "title": "" }, { "docid": "1ce6dcd9a93898c96a16dcd47d72421d", "score": "0.54460174", "text": "async function resolveInfUri (baseDir, uri) {\n\n if (\n /^\\//.test(uri) &&\n await INF.LIB.FS.exists(uri)\n ) {\n return INF.LIB.PATH.relative(baseDir, uri.replace(/inf\\.json$/, ''));\n }\n\n async function resolveRelative (uri) {\n uri = uri.replace(/inf\\.json$/, '');\n\n let path = INF.LIB.PATH.resolve(baseDir, uri);\n if (await INF.LIB.FS.existsAsync(path)) {\n const stat = await INF.LIB.FS.statAsync(path);\n if (stat.isDirectory()) { \n path = INF.LIB.PATH.join(baseDir, uri);\n\n if (await INF.LIB.FS.existsAsync(INF.LIB.PATH.join(path, '#!/gi0.PINF.it/#!inf.json'))) {\n return INF.LIB.PATH.join(uri, '/#!/gi0.PINF.it/#!');\n }\n if (await INF.LIB.FS.existsAsync(INF.LIB.PATH.join(path, '#!/#!inf.json'))) {\n return INF.LIB.PATH.join(uri, '#!/#!');\n }\n if (await INF.LIB.FS.existsAsync(INF.LIB.PATH.join(path, '#!inf.json'))) {\n return INF.LIB.PATH.join(uri, '#!');\n }\n if (await INF.LIB.FS.existsAsync(`${path}inf.json`)) {\n return uri;\n }\n }\n } else {\n path = `${path}inf.json`;\n if (await INF.LIB.FS.existsAsync(path)) {\n uri = `${uri}inf.json`;\n\n return uri;\n }\n }\n return null;\n }\n\n const resolvedCachePath = INF.LIB.PATH.join(baseDir, '.~', 'gi0.PINF.it', 'resolveInfUriCache', hash(uri));\n\n if (\n // We ignore the cache when running with --verbose or --debug as it is a handy way to clear the cache.\n options.verbose ||\n options.debug ||\n !(await INF.LIB.FS.exists(resolvedCachePath))\n ) {\n const lookupUri = uri;\n LIB.console.debug(`Resolving uri '${lookupUri}' from baseDir '${baseDir}'`);\n\n if (/^\\./.test(uri)) {\n uri = (await resolveRelative(uri)) || uri;\n } else {\n let {\n path,\n libAlias\n } = await getLibForUri(baseDir, uri);\n\n if (!path) {\n throw new Error(`Could not resolve uri '${uri}' to path!`);\n }\n\n if (await INF.LIB.FS.existsAsync(path)) {\n uri = INF.LIB.PATH.relative(baseDir, path);\n } else {\n path = INF.LIB.PATH.relative(baseDir, path);\n if (uri.indexOf('/') !== -1) {\n path = path.substring(0, path.indexOf(libAlias));\n path = INF.LIB.PATH.join(path, uri);\n uri = (await resolveRelative(path)) || uri;\n } else {\n uri = path;\n }\n }\n }\n\n uri = uri.replace(/inf\\.json$/, '');\n\n LIB.console.debug(`Resolved uri '${lookupUri}' from baseDir '${baseDir}' to '${uri}'`);\n\n await INF.LIB.FS.outputFile(resolvedCachePath, uri, 'utf8'); \n }\n\n return INF.LIB.FS.readFile(resolvedCachePath, 'utf8'); \n }", "title": "" }, { "docid": "2a44eb7e50ddb403e2743bc3ec34d884", "score": "0.54395485", "text": "function loadConfig () {\n const sdkConfigPath = '/data/config/raneto.config.json'\n\n // 检查文件是否存在\n try {\n const stats = fs.statSync(sdkConfigPath)\n\n if (!stats.isFile()) {\n console.log(`${sdkConfigPath} 不存在,将使用 config.js 中的配置`)\n return {}\n }\n } catch (e) {\n // console.log(e)\n console.log('cannot find the give file:' + sdkConfigPath)\n return {}\n }\n // 返回配置信息\n try {\n const content = fs.readFileSync(sdkConfigPath, 'utf8')\n return JSON.parse(content)\n } catch (e) {\n // 如果配置读取错误或者 JSON 解析错误,则输出空配置项\n console.log(`${sdkConfigPath} 解析错误,不是 JSON 字符串`)\n return {}\n }\n}", "title": "" }, { "docid": "b024c3bc911bcdecb8e7c256e48edb8a", "score": "0.54384243", "text": "function loadConfig( path, config ) {\n var glob = require( 'glob' )\n , object = {}\n , key;\n\n glob.sync('*', { cwd: path })\n .forEach(function( option ) {\n key = option.replace( /\\.js$/, '' );\n object[key] = require( path + option )( config );\n });\n\n return object;\n }", "title": "" }, { "docid": "4309ac17dc7450181aaa0a2fb55d0968", "score": "0.5432706", "text": "function loadConfig(path) {\n\t\tvar glob = require('glob');\n\t\tvar object = {};\n\t\tvar key;\n\t\t\n\t\tglob.sync('*', {cwd: path}).forEach(function(option) {\n\t\t\tkey = option.replace(/\\.js$/,'');\n\t\t\tobject[key] = require(path + option);\n\t\t});\n\t\t\n\t\treturn object;\n\t}", "title": "" }, { "docid": "f2c81c8b8b1633cd1da9d962ddd50db4", "score": "0.5423488", "text": "function findConfigFile(compiler, searchPath, configFileName) {\n while (true) {\n var fileName = path.join(searchPath, configFileName);\n if (compiler.sys.fileExists(fileName)) {\n return fileName;\n }\n var parentPath = path.dirname(searchPath);\n if (parentPath === searchPath) {\n break;\n }\n searchPath = parentPath;\n }\n return undefined;\n}", "title": "" }, { "docid": "51c2606f9eaa4e0d621bd4722a93cfec", "score": "0.540971", "text": "configLocator (options = {}) {\n let goinstallation = atom.config.get('go-config.goinstallation')\n let stat = this.statishSync(goinstallation)\n if (isTruthy(stat)) {\n let d = goinstallation\n if (stat.isFile()) {\n d = path.dirname(goinstallation)\n }\n return this.findExecutablesInPath(d, this.executables, options)\n }\n\n return []\n }", "title": "" }, { "docid": "6a81f20076d6979b30eb1ac7041af8de", "score": "0.5409545", "text": "function loadConfig() {\n try {\n appConfig = require(\"./config/app-config.json\");\n if (typeof appConfig.token === \"undefined\" || appConfig.token === \"\") {\n Logger.log(\"Missing **token** in **app-config.json**.\", \"err\");\n process.exit();\n }\n if (typeof appConfig.applicationId === \"undefined\" || appConfig.applicationId === \"\") {\n Logger.log(\"Missing **applicationId** in **app-config.json**.\", \"err\");\n process.exit();\n }\n if (typeof appConfig.oauth2Secret === \"undefined\" || appConfig.oauth2Secret === \"\") {\n Logger.log(\"Missing **oauth2Secret** in **app-config.json**.\", \"err\");\n process.exit();\n }\n if (typeof appConfig.redirectURI === \"undefined\" || appConfig.redirectURI === \"\") {\n Logger.log(\"Missing **redirectURI** in **app-config.json**.\", \"err\");\n process.exit();\n }\n } catch (err) {\n Logger.log(\"Please run **npm install** and set up the application config.\", \"err\");\n process.exit();\n return;\n }\n\n}", "title": "" }, { "docid": "57118f0872e27b9d5f4ccb7eda727c30", "score": "0.5404124", "text": "function getConfigPath(cwd) {\n return path__default[\"default\"].join(cwd, 'keystone');\n}", "title": "" }, { "docid": "317d03610226bafaaa17dce24346ad04", "score": "0.5393269", "text": "function loadConfig(path) {\n\t\tvar glob = require('glob');\n\n\t\tvar object = {};\n\t\tvar key;\n\n\t\tglob.sync('*', {cwd: path}).forEach(function(option) {\n\t\t\tkey = option.replace(/\\.js$/,'');\n\t\t\tobject[key] = require(path + option);\n\t\t});\n\n\t\treturn object;\n\t}", "title": "" }, { "docid": "f5520f52e518ccba857e90bf8e4d5060", "score": "0.53807795", "text": "function get_config(name) {\n\n var host_filename = __dirname + '/config/'+name+'.'+os.hostname()+'.cfg';\n var filename = __dirname + '/config/'+name+'.cfg';\n var data = undefined;\n if(fs.existsSync(host_filename)) {\n data = fs.readFileSync(host_filename);\n console.log(\"Reading config:\",host_filename);\n }\n else {\n data = fs.readFileSync(filename);\n console.log(\"Reading config:\",filename);\n }\n\n return eval('('+data.toString('utf-8')+')');\n}", "title": "" }, { "docid": "383ee70587eee7483b022c00088d5392", "score": "0.53805906", "text": "function readConfigFile(f) {\n if (fs.existsSync(f)) {\n config = JSON.parse(fs.readFileSync(f, 'utf8'))\n }\n}", "title": "" }, { "docid": "7d4fa73cfa4d2f1d7ef32ce829932f7e", "score": "0.5377292", "text": "function resolveToInversifyPath(file) {\n switch (file) {\n case 'config':\n return path.join(rootDir, 'src', 'inversify.config.ts');\n break;\n case 'types':\n return path.join(rootDir, 'src', 'inversify.types.ts');\n break;\n default:\n throw new Error(`Cannot find inversify type ${file}, must be config or types`);\n }\n}", "title": "" }, { "docid": "bd20a77a0573bb970a0b7e3629dbf9ea", "score": "0.5367527", "text": "extraPaths() {\n const base = path.resolve(this.config.getPath('data'), '..');\n const userdata = path.resolve(base, 'userdata');\n const ext = path.resolve(base, 'ext');\n const plugins = path.resolve(ext, 'plugins');\n const themes = path.resolve(ext, 'themes');\n const modules = path.resolve(ext, 'modules');\n const userfiles = path.resolve(userdata, 'files');\n const snippets = path.resolve(userdata, 'snippets.json');\n\n this.config.addPath('base', base);\n this.config.addPath('ext', ext);\n this.config.addPath('plugins', plugins);\n this.config.addPath('themes', themes);\n this.config.addPath('modules', modules);\n this.config.addPath('userdata', userdata);\n this.config.addPath('userfiles', userfiles);\n this.config.addPath('snippets', snippets);\n if (!this.config.getPath('editor')) this.config.addPath('editor', path.resolve(base, 'editor'));\n }", "title": "" }, { "docid": "1eba4b9f0ba97aac65ee65d52f217de6", "score": "0.53613037", "text": "function __loadConfig(){\n if($rootScope.config === void 0 || typeof $rootScope.config == 'undefined'){\n //@todo test if we can get config from localStorage\n $http({url:'config/parrametters.json', method:'GET'})\n .then(function successCallback(response) {\n $rootScope.config = response.data;\n $rootScope.$emit('configurationFileLoaded');\n });\n }\n }", "title": "" }, { "docid": "9ad05a4f80841098c8dd0cae7dcf39e3", "score": "0.5360176", "text": "function resolve(relatedPath) {\n return path.join(__dirname, relatedPath)\n}", "title": "" }, { "docid": "8fa3238cde96d8db6fe49a7c562130b0", "score": "0.5357943", "text": "function loadConfig(path) {\n var glob = require('glob'),\n obj = {},\n key;\n\n glob.sync('*', { cwd: path }).forEach(function(option) {\n key = option.replace(/\\.js$/, '');\n obj[key] = require(path + option);\n });\n\n return obj;\n}", "title": "" }, { "docid": "602864bf961a5ac41f16bbee105a6e6c", "score": "0.5345389", "text": "function findFile (filename) {\n const file = configDirectory + '/' + filename\n if (fs.existsSync(file)) return file\n const defaultFile = defaultDirectory + '/' + filename\n if (fs.existsSync(defaultFile)) return defaultFile\n return null\n }", "title": "" }, { "docid": "6013093b63e6f96b186e61d13d33ead6", "score": "0.5343458", "text": "function loadAppSettings() {\n 'use strict';\n \n var _filePath = path.normalize('./config/settings.json');\n var _configAppString = '';\n \n switch(process.env.NODE_ENV) {\n case 'production':\n\t _filePath = path.normalize('./config/production.json');\n\t break;\n case 'test':\n\t _filePath = path.normalize('./config/test.json');\n\t break;\n case 'development':\n\t _filePath = path.normalize('./config/development.json');\n\t break;\n\tdefault:\n\t _filePath = path.normalize('./config/settings.json');\n\t break;\n }\n \n try {\n _configAppString = fs.readFileSync(_filePath, 'utf8');\n _configApp = JSON.parse(_configAppString);\n } catch(e) {\n _configApp = {};\n }\n}", "title": "" }, { "docid": "cc8ac8eb3ea431dc88e4b7af2a9ff729", "score": "0.53369737", "text": "loadAppConfiguration(filePath) {\n \n return $.ajax({\n url: filePath,\n type: 'GET',\n dataType: 'json',\n cache: false\n })\n .catch(xhr => {\n let errorText = ErrorHandler.ajaxErrorToString(xhr, filePath);\n return Promise.reject(errorText);\n });\n }", "title": "" }, { "docid": "a86651953531c514208d8d2c954d7989", "score": "0.5335825", "text": "function loadConfig(path) {\n\t\tvar glob = require('glob');\n\t\tvar object = {};\n\t\tvar key;\n\n\t\tglob.sync('*', {\n\t\t\tcwd: path\n\t\t}).forEach(function(option) {\n\t\t\tkey = option.replace(/\\.js$/, '');\n\t\t\tobject[key] = require(path + option);\n\t\t});\n\n\t\treturn object;\n\t}", "title": "" }, { "docid": "a829691f64d1911e46a3f203aaa83c8e", "score": "0.5326185", "text": "function createImportResolver({\n fileLoc,\n webModulesPath,\n dependencyImportMap,\n isDev,\n isBundled,\n config\n}) {\n return function importResolver(spec) {\n if (URL_HAS_PROTOCOL_REGEX.test(spec)) {\n return spec;\n }\n\n let mountScript = findMatchingMountScript(config.scripts, spec);\n\n if (mountScript) {\n let {\n fromDisk,\n toUrl\n } = mountScript.args;\n const importStats = getImportStats(cwd, spec);\n spec = resolveSourceSpecifier(spec, importStats, isBundled);\n spec = spec.replace(fromDisk, toUrl);\n return spec;\n }\n\n if (spec.startsWith('/') || spec.startsWith('./') || spec.startsWith('../')) {\n const importStats = getImportStats(path.dirname(fileLoc), spec);\n spec = resolveSourceSpecifier(spec, importStats, isBundled);\n return spec;\n }\n\n if (dependencyImportMap && dependencyImportMap.imports[spec]) {\n // if baseURL is remote, handle that outside of path.posix.join()\n const protocolMatch = config.buildOptions.baseUrl.match(URL_HAS_PROTOCOL_REGEX);\n const protocol = protocolMatch && protocolMatch[0] || '';\n const baseUrl = config.buildOptions.baseUrl.replace(URL_HAS_PROTOCOL_REGEX, '');\n let resolvedImport = isDev ? path.posix.resolve(webModulesPath, dependencyImportMap.imports[spec]) : `${protocol}${path.posix.join(baseUrl, webModulesPath, dependencyImportMap.imports[spec])}`;\n const extName = path.extname(resolvedImport);\n\n if (!isBundled && extName && extName !== '.js') {\n resolvedImport = resolvedImport + '.proxy.js';\n }\n\n return resolvedImport;\n }\n\n return false;\n };\n}", "title": "" }, { "docid": "e692f31025b09a84e16d8ab40d5ded74", "score": "0.5315395", "text": "function loadFromIndividualConfigFile(key) {\n key = _.replace(key, /\\/|\\\\/g, ''); //forward and backslashes are unsafe when resolving filenames\n\n if (individualKeyCache[key]) {\n return individualKeyCache[key];\n } else {\n var toLoad = path.resolve(global.__appDir, 'config/' + key + '.json');\n\n var content = '{}';\n try {\n content = fs.readFileSync(toLoad);\n } catch (err) {\n //file must not exists\n }\n\n var json = {};\n try {\n json = JSON.parse(stripJsonComments(content.toString()));\n } catch (err) {\n console.warn('Error parsing JSON for %s', toLoad);\n }\n\n security.decryptObject(json, function (str) {\n //Decryption function\n return security.decrypt(str, process.env.decryptionKey);\n });\n individualKeyCache[key] = json;\n\n return individualKeyCache[key];\n }\n}", "title": "" }, { "docid": "ac9d539911ebf80d173390a6de2d2793", "score": "0.5314381", "text": "function loadRawConfig(configType) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n FileSystem.readFile('./config.json', (err, data) => {\n if (err) {\n reject(err);\n }\n else {\n //Parse the file to json\n let jsonString = data.toString();\n let raw = JSON.parse(jsonString);\n //Does it have the config we want?\n let rawConfig = raw[configtype_1.ConfigType[configType].toLowerCase()];\n if (rawConfig) {\n resolve(rawConfig);\n }\n else {\n reject('Failed to find config of type: ' + configtype_1.ConfigType[configType]);\n }\n }\n });\n });\n });\n }", "title": "" }, { "docid": "6b2b954449d644afe2e7446b5d9a1427", "score": "0.5311461", "text": "function tryLookup() {\n var i, fn, data;\n\n for (i = 0; i < _this.directories.length; i++) {\n fn = path.join(_this.directories[i], fileName);\n if (fs.existsSync(fn) && fs.lstatSync(fn).isFile()) {\n data = fs.readFileSync(fn); // Raw bytes\n return decodeAndNormalizeSource(data); // Unicode string\n }\n }\n return null;\n }", "title": "" }, { "docid": "358d9adef03ff8534642284ecc96af48", "score": "0.5307029", "text": "_loadInfo() {\n\t\tthis.taskConfig = JSON.parse(jetpack.read(this.taskData.configPath))\n\n\t\tlibrary.urlExists(this.taskData.serverHome, (err, exists) => {\n\t\t\tif (exists) {\n\t\t\t\tconsole.log(['\\'', this._parseUrl(this.taskData.serverHome), '\\' exist, starting testing...'].join(''))\n\t\t\t\tthis._startJob()\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(['\\'', this._parseUrl(this.taskData.serverHome), '\\' doesn\\'t exist, ending testing...'].join(''))\n\t\t\t\tthis._shutDown()\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "1db43061a28fe6ff1780bb967fb4a0ca", "score": "0.5302404", "text": "updateConfigPath(configPath, manual = true) {\n // store the absolute value of project root\n let pawConfig = configPath;\n if (!path.isAbsolute(configPath)) {\n pawConfig = path.resolve(processDir, configPath);\n }\n let pathStats = fs.lstatSync(pawConfig);\n if(!pathStats.isFile()) {\n // eslint-disable-next-line\n console.warn(`WARNING:: Invalid config file path specified ${configPath}, using ${process.env.PAW_CONFIG_PATH} instead`);\n return;\n }\n if (manual) {\n this.pawConfigManualPath = true;\n }\n \n process.env.PAW_CONFIG_PATH = pawConfig;\n \n }", "title": "" }, { "docid": "78a8103ebffb2e86e9c7e6d5de9a450e", "score": "0.5298236", "text": "function readConfigFile(configPath, returnEmptyObjectOnError) {\n if (returnEmptyObjectOnError === void 0) { returnEmptyObjectOnError = false; }\n // If the `.ts` extension has not been set up already, and a TypeScript based\n // version of the given configuration seems to exist, set up `ts-node` if available.\n if (require.extensions['.ts'] === undefined && fs.existsSync(configPath + \".ts\") &&\n isTsNodeAvailable()) {\n // Ensure the module target is set to `commonjs`. This is necessary because the\n // dev-infra tool runs in NodeJS which does not support ES modules by default.\n // Additionally, set the `dir` option to the directory that contains the configuration\n // file. This allows for custom compiler options (such as `--strict`).\n require('ts-node').register({ dir: path.dirname(configPath), transpileOnly: true, compilerOptions: { module: 'commonjs' } });\n }\n try {\n return require(configPath);\n }\n catch (e) {\n if (returnEmptyObjectOnError) {\n debug(\"Could not read configuration file at \" + configPath + \", returning empty object instead.\");\n debug(e);\n return {};\n }\n error(\"Could not read configuration file at \" + configPath + \".\");\n error(e);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "78a8103ebffb2e86e9c7e6d5de9a450e", "score": "0.5298236", "text": "function readConfigFile(configPath, returnEmptyObjectOnError) {\n if (returnEmptyObjectOnError === void 0) { returnEmptyObjectOnError = false; }\n // If the `.ts` extension has not been set up already, and a TypeScript based\n // version of the given configuration seems to exist, set up `ts-node` if available.\n if (require.extensions['.ts'] === undefined && fs.existsSync(configPath + \".ts\") &&\n isTsNodeAvailable()) {\n // Ensure the module target is set to `commonjs`. This is necessary because the\n // dev-infra tool runs in NodeJS which does not support ES modules by default.\n // Additionally, set the `dir` option to the directory that contains the configuration\n // file. This allows for custom compiler options (such as `--strict`).\n require('ts-node').register({ dir: path.dirname(configPath), transpileOnly: true, compilerOptions: { module: 'commonjs' } });\n }\n try {\n return require(configPath);\n }\n catch (e) {\n if (returnEmptyObjectOnError) {\n debug(\"Could not read configuration file at \" + configPath + \", returning empty object instead.\");\n debug(e);\n return {};\n }\n error(\"Could not read configuration file at \" + configPath + \".\");\n error(e);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "0288899aa43161714fb6adfa245efd5a", "score": "0.52806425", "text": "async function getConfigFiles(octokit, {\n owner,\n repo,\n path,\n branch\n}) {\n const requestedRepoFile = await getConfigFile(octokit, {\n owner,\n repo,\n path,\n ref: branch\n });\n const files = [requestedRepoFile]; // if no configuration file present in selected repository,\n // try to load it from the `.github` repository\n\n if (!requestedRepoFile.config) {\n if (repo === \".github\") {\n return files;\n }\n\n const defaultRepoConfig = await getConfigFile(octokit, {\n owner,\n repo: \".github\",\n path\n });\n files.push(defaultRepoConfig);\n }\n\n const file = files[files.length - 1]; // if the configuration has no `_extends` key, we are done here.\n\n if (!file.config || !file.config._extends) {\n return files;\n } // parse the value of `_extends` into request parameters to\n // retrieve the new configuration file\n\n\n let extendConfigOptions = extendsToGetContentParams({\n owner,\n path,\n url: file.url,\n extendsValue: file.config._extends\n }); // remove the `_extends` key from the configuration that is returned\n\n delete file.config._extends; // now load the configuration linked from the `_extends` key. If that\n // configuration also includes an `_extends` key, then load that configuration\n // as well, until the target configuration has no `_extends` key\n\n do {\n const extendRepoConfig = await getConfigFile(octokit, extendConfigOptions);\n files.push(extendRepoConfig);\n\n if (!extendRepoConfig.config || !extendRepoConfig.config._extends) {\n return files;\n }\n\n extendConfigOptions = extendsToGetContentParams({\n owner,\n path,\n url: extendRepoConfig.url,\n extendsValue: extendRepoConfig.config._extends\n });\n delete extendRepoConfig.config._extends; // Avoid loops\n\n const alreadyLoaded = files.find(file => file.owner === extendConfigOptions.owner && file.repo === extendConfigOptions.repo && file.path === extendConfigOptions.path);\n\n if (alreadyLoaded) {\n throw new Error(`[@probot/octokit-plugin-config] Recursion detected. Ignoring \"_extends: ${extendRepoConfig.config._extends}\" from ${extendRepoConfig.url} because ${alreadyLoaded.url} was already loaded.`);\n }\n } while (true);\n}", "title": "" }, { "docid": "33977f594792f750fa79b59680cf9a44", "score": "0.5273992", "text": "function loadConfig(promptConfigPath) {\n try {\n return require(promptConfigPath);\n } catch(e) {\n return {};\n }\n}", "title": "" }, { "docid": "33977f594792f750fa79b59680cf9a44", "score": "0.5273992", "text": "function loadConfig(promptConfigPath) {\n try {\n return require(promptConfigPath);\n } catch(e) {\n return {};\n }\n}", "title": "" }, { "docid": "f75ed90aef9e54117273c11d47f201c5", "score": "0.52714527", "text": "function readConfig() {\n var result = new $.Deferred();\n var root = ProjectManager.getProjectRoot(),\n configEntry = new NativeFileSystem.FileEntry(root.fullPath + \"config.js\");\n FileUtils.readAsText(configEntry).done(function (text, timestamp) {\n try {\n var config = JSON.parse(text);\n if (config.hasOwnProperty('brackets-xunit') && config['brackets-xunit'] === 'disable') {\n result.reject('disabled');\n }\n } catch (e) {\n console.log(\"[brackets-xunit] reading \" + root.fullPath + \"config.js Error \" + e);\n } finally {\n return result.resolve('ok');\n }\n }).fail(function (error) {\n return result.resolve('ok');\n });\n return result.promise();\n }", "title": "" }, { "docid": "776198e5a32d2cbae8ce5c3de15638c9", "score": "0.5265387", "text": "function findConfigFile(compiler, requestDirPath, configFile) {\n // If `configFile` is an absolute path, return it right away\n if (path.isAbsolute(configFile)) {\n return compiler.sys.fileExists(configFile) ? configFile : undefined;\n }\n // If `configFile` is a relative path, resolve it.\n // We define a relative path as: starts with\n // one or two dots + a common directory delimiter\n if (configFile.match(/^\\.\\.?(\\/|\\\\)/) !== null) {\n const resolvedPath = path.resolve(requestDirPath, configFile);\n return compiler.sys.fileExists(resolvedPath) ? resolvedPath : undefined;\n // If `configFile` is a file name, find it in the directory tree\n }\n else {\n while (true) {\n const fileName = path.join(requestDirPath, configFile);\n if (compiler.sys.fileExists(fileName)) {\n return fileName;\n }\n const parentPath = path.dirname(requestDirPath);\n if (parentPath === requestDirPath) {\n break;\n }\n requestDirPath = parentPath;\n }\n return undefined;\n }\n}", "title": "" }, { "docid": "fa8c4cd6179adcad526d953111e469d2", "score": "0.5261614", "text": "function loadConfigs (script) {\n var crawlerId = script.split('/').reverse()[0].replace('.js', '')\n\n var configs\n var scriptObj = require(path.join(projectRootDir, script))\n if (scriptObj.configs && scriptObj.configs.constructor === Array) {\n configs = scriptObj.configs\n } else if (scriptObj.config && scriptObj.config.constructor === Object) {\n configs = [scriptObj.config]\n } else if (Object.keys(scriptObj).filter((key) => key.match(/^cinema/)).length > 0) {\n configs = [scriptObj]\n } else {\n throw new Error(`no config found in ${script}`)\n }\n\n configs.forEach((config) => {\n config.crawler = config.crawler || {}\n config.crawler.id = crawlerId\n })\n\n return configs\n}", "title": "" }, { "docid": "d29e1c9d2aff6d95cc6208931f15ff6c", "score": "0.52495134", "text": "function getKibanaPath(config, file, rootPath) {\n const inConfig = config != null && config.kibanaPath;\n\n const kibanaPath = (inConfig)\n ? path.resolve(config.kibanaPath)\n : path.resolve(rootPath, defaults.kibanaPath);\n\n debug(`resolved kibana path: ${kibanaPath}`);\n return kibanaPath;\n}", "title": "" }, { "docid": "ea2e9a42bf826618dc533195d354d646", "score": "0.52494454", "text": "function loadConfig() {\n\tpahub.api.log.addLogMessage(\"verb\", \"Loading PAHUB config file\");\n\tvar configJSON = readJSONfromFile(constant.PAHUB_CONFIG_FILE);\n\t\n\tif (configJSON != false) {\n\t\tpahubConfig = configJSON;\n\t\tcheckForUpdates();\n\t\tloadCorePlugins();\n\t} else {\n\t\t//error\n\t}\n}", "title": "" }, { "docid": "10ef0b2bdd148d644ba6673beffb2a20", "score": "0.5245036", "text": "function getConfigPath(cwd) {\n return path__default.join(cwd, 'keystone');\n}", "title": "" }, { "docid": "2a2b878bcaced26b4ad9442941ba9fd2", "score": "0.52445847", "text": "function resolveToSrc() {\n return path.join(rootDir, 'src');\n}", "title": "" }, { "docid": "3e2e9e9ad8c5188e08109ace2280569d", "score": "0.52311844", "text": "resolve(modulePath) {\n let filePath\n let moduleFilePath = modulePath\n\n if (['/', '.'].indexOf(modulePath.substr(0, 1)) >= 0) {\n // ./src/test => /path/to/src/test\n moduleFilePath = path.resolve(path.dirname(this.currentModulePath), modulePath)\n }\n if (typeof this.modules[moduleFilePath] !== 'undefined') {\n return moduleFilePath\n }\n if (fs.existsSync(moduleFilePath)) {\n if (fs.lstatSync(moduleFilePath).isFile()) {\n return moduleFilePath\n }\n // /path/to/src/test => /path/to/src/test/index\n filePath = path.join(moduleFilePath, 'index')\n }\n\n const ext = this.options.resolve.extensions.find((ext) => {\n filePath = `${moduleFilePath}${ext}`\n if (typeof this.modules[filePath] !== 'undefined') {\n return true\n }\n return fs.existsSync(filePath) && fs.lstatSync(filePath).isFile()\n })\n\n if (typeof ext !== 'undefined') {\n return `${moduleFilePath}${ext}`\n }\n return null\n }", "title": "" } ]
bda7fa519640a8fc71ca96b8e03f1973
the current player function
[ { "docid": "c11260596330d1e8ea6cbd28d6d766ab", "score": "0.67307526", "text": "function currentPlayer() {\n if (activePlayer === 0) {\n // update the current score\n roundScore = roundScore + randomTotal;\n console.log(\"Player 1 round score is \" + roundScore);\n current0.textContent = roundScore;\n } else {\n roundScore = roundScore + randomTotal;\n current1.textContent = roundScore;\n console.log(\"Player 2 round score is \" + roundScore);\n }\n}", "title": "" } ]
[ { "docid": "228749ce3a9c99f867e17fe08bccb010", "score": "0.79165214", "text": "function player(){\n\t\t\n}", "title": "" }, { "docid": "360baa688bb1197f387a41c288bbbd11", "score": "0.7595862", "text": "function player() {\n\treturn CURRENT_PLAYERS_TURN;\n}", "title": "" }, { "docid": "f5fe4c14afaf27a08cf8f209a548b366", "score": "0.759364", "text": "function ratscrew_currentPlayer() {\n return ratscrew_getPlayerByIndex(\n ratscrew_currentPlayerIndex()\n );\n}", "title": "" }, { "docid": "52b1d87a4128fba2b23f3a49f8e4f718", "score": "0.7420005", "text": "function getActivePlayer() {\n return activePlayer;\n }", "title": "" }, { "docid": "76e202e13cfac81d29a20ccc2ccfab88", "score": "0.727411", "text": "getCurrentPlayer () {\n return this.players[this.turn]\n }", "title": "" }, { "docid": "c4ed0308dff766b7f17eec2dcbdc581c", "score": "0.7254229", "text": "getCurrent(){\n return this.players[this.current];\n }", "title": "" }, { "docid": "e1aa15056a6d05bf87ec61f36be92788", "score": "0.7248397", "text": "function getPlayer() {\n\treturn player;\n}", "title": "" }, { "docid": "49dc755feb9cd7cccc019540a9910b9e", "score": "0.7186753", "text": "function ratscrew_currentPlayerIndex() {\n return game.getCurrentState().globalStates.currentPlayer;\n}", "title": "" }, { "docid": "e0bd71e5a40986a7367a10e5b23a600f", "score": "0.7177365", "text": "function displayCurrent(player){\r\n\t\t$(`#currentPlayer`).html(`<p>MOVE: <span>Player ${player.id}</span></p>`);\r\n}", "title": "" }, { "docid": "793c225066dbec01e3c289bd10bda9c9", "score": "0.71253425", "text": "function currentPlayer() {\n return state.symbols[state.currentPlayer]\n }", "title": "" }, { "docid": "c0c539f8d8f83fada3dc522af3f9afaf", "score": "0.7096185", "text": "function HandleCurrentPlayerChange(){\n PM.ChangeCurrentPlayer();\n // Mark the correct player\n UI.ShowPlayerTurn(PM.GetCurrentPlayer().id);\n // Check if it's the AI's turn to play\n if(singlePlayer && aiWrapper.Turn(PM.GetCurrentPlayer().input)){\n HandleAi();\n } \n }", "title": "" }, { "docid": "3022754745e00e1ea5d1a158055f3f48", "score": "0.70905846", "text": "get currentPlayer() {\n\t\treturn this._players[this._currentPlayer];\n\t}", "title": "" }, { "docid": "bf7215cc99db3f60c07bf39eec2576c7", "score": "0.6959506", "text": "function initPlayerDefault() {\n player1(); \n }", "title": "" }, { "docid": "0a60df8aaf4caeb9bb81c2d5720a4117", "score": "0.69150656", "text": "function player(){\n\tvar sprite;\n\tvar interacting;\n\tvar levelone = 'false';\n}", "title": "" }, { "docid": "196b2458a06b2ad6b75eb59c5d118f6a", "score": "0.68502307", "text": "playerStateChanged(playerCurrentState) {\n console.log('player current update state', playerCurrentState)\n }", "title": "" }, { "docid": "46f4f33b535e1a5f1e5af3de1c90cc74", "score": "0.67732936", "text": "switchPlayer() {\n var current;\n if (this.currentPlayer == 0) {\n current = 1;\n } else {\n current = 0;\n }\n this.currentPlayer = current;\n }", "title": "" }, { "docid": "c6b6dd7b23d94449a756c075509d21c5", "score": "0.67487675", "text": "updateCurrentPlayer(player) {\n this.props.updateCurrentPlayer(player);\n }", "title": "" }, { "docid": "ab40980016cc796defc5d00557e1fe48", "score": "0.67326444", "text": "switchCurrentPlayer() {\n this.currentPlayer = (this.currentPlayer === PLAYERS[0] ? PLAYERS[1] : PLAYERS[0]);\n return this.currentPlayer;\n }", "title": "" }, { "docid": "420cb4b3e0501925425db6885d8461fa", "score": "0.67304325", "text": "changeCurrentPlayer() {\n\t\tthis.currentPlayer = \n\t\t\t(this.currentPlayer == this.player1) ?\n\t\t\t\tthis.player2 : this.player1;\n\n\t\t//Update the movement tip\n\t\tthis.tip.text = this.currentPlayer.name+' moves';\n\n\t\t//Start AI movement\n\t\tif(!this.currentPlayer.human) {\n\t\t\tlet bestCol = this.AI.findBestCol();\n\n\t\t\t//Add some delay for end the animations\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.dropToken(bestCol);\n\t\t\t}, 1000);\n\t\t}\n\t}", "title": "" }, { "docid": "fd2d8e37785d7cd82148a79e1d191e79", "score": "0.6719887", "text": "function detectPlayer() {\n if (player === 0) {\n redPlayerMove();\n }else if (player===1) {\n bluePlayerMove();\n }\n}", "title": "" }, { "docid": "05774d11d7d98aee6bedec523300bdfe", "score": "0.6704896", "text": "function controlPlay(){\n var rooms = getRooms();\n rooms.forEach(room=> playercontrol(room) )\n//Create function for getting info from the key and sending it to each user\n//THen on the main.js add function for comparing the time and updating the\n//current play position if it is off by more than 5 seconds. Gets the current\n// video to insure everyone is on the same video.\n function playercontrol(room){\n var user = getRoomKey(room)\n io.to(user.id).emit(\"getCurrentTime\")\n }\n}", "title": "" }, { "docid": "0d562465036698911eb88b357c64202e", "score": "0.6692286", "text": "serverWhoIsNext(nextPlayer){\n console.log(\"serverWhoIsNext\", nextPlayer);\n\n var _currPlayer = null;\n\n //Deactivate all Players before activating only the current playing\n for(var player in this.players){\n this.players[player].setIsPlaying(false);\n }\n\n //Find next player and activate it\n for(var player in this.players){\n if(this.players[player].name === nextPlayer){\n _currPlayer = this.players[player];\n break; //stops loop since player was found\n }\n }\n\n //do things with the map and the player if player is not null\n if(_currPlayer !== null){\n if(localPlayer.name === _currPlayer.name){\n _currPlayer.setIsPlaying(true); //Set the player to playing mode\n }\n\n\n //Set camera to current player position\n this.game.add.tween(this.game.camera).to({\n x: _currPlayer.player.x - 100,\n y: _currPlayer.player.y - 100\n }, 300, Phaser.Easing.Quadratic.InOut, true, 0, 0, false);\n\n }\n }", "title": "" }, { "docid": "eba0616504da0000ed58bdbe06dfedcf", "score": "0.6673332", "text": "function whoIsActive() {\r\n if (player1Active) {\r\n GetPlayerActive(player1, player2, '#player-1', '#player-2', player2Activity.active, player1Activity.notActive);\r\n } else {\r\n GetPlayerActive(player2, player1, '#player-2', '#player-1', player1Activity.active, player2Activity.notActive);\r\n }\r\n}", "title": "" }, { "docid": "25275a150622e21ab5209b331f637817", "score": "0.66512084", "text": "getPlayer(){\n\t\treturn this.videojs;\n\t}", "title": "" }, { "docid": "dd15fce504fe093bf8db3cabe89b30a6", "score": "0.66405106", "text": "function GamePlayMachine_GetCurrentPlayer() {\n\n return app.Proxies.GetPlayerProxy(this.currentTurnPlayer.data);\n }", "title": "" }, { "docid": "004cb4b3c5ec0e472629bef51720fed8", "score": "0.6640282", "text": "getCurrentPlayerSymbol() {\n return this.currentPlayer;\n }", "title": "" }, { "docid": "569c29966e11ac651d41b37864234b58", "score": "0.6628055", "text": "function changePlayer() {\n currentPlayer = (currentPlayer == \"x\") ? \"o\" : \"x\";\n}", "title": "" }, { "docid": "43c059695b35006c593a7f7bd1ba9ddd", "score": "0.66150784", "text": "playMove() {\n\t\t\t\n\t\t}", "title": "" }, { "docid": "904234158df5c861477210d6c27609c3", "score": "0.6605708", "text": "function changePlayer( currentPlayer )\n{\n\tdimPlayer(currentPlayer);\n\tplayerGo();\n\tvar nextPlayer = players.players[players.current];\n\t// checkCheckout(0, nextPlayer);\n\thighlightPlayer(nextPlayer);\n}", "title": "" }, { "docid": "5f6ae34b1bc346ff0c32fd1d6583555b", "score": "0.6582579", "text": "currentPlayerData() {\n return this.getPlayerDataForHandIdx(this.currentHandIdx)\n }", "title": "" }, { "docid": "52c827f691878c785035feda4ecb015a", "score": "0.65656185", "text": "function nextPlayer() {\n currentPlayer = (currentPlayer == \"x\") ? \"o\" : \"x\";\n}", "title": "" }, { "docid": "d5a1730c07be7f450d34602025a260c6", "score": "0.6563304", "text": "play() {\n if (player.vhs &&\n player.currentSource().src === player.vhs.source_.src) {\n player.vhs.setCurrentTime(player.tech_.currentTime());\n }\n }", "title": "" }, { "docid": "c813e33bb8e1c08f5c6e22603971b267", "score": "0.6552714", "text": "async getCurrentPlayer() {\n return await (await fetch(\"/players\")).json();\n }", "title": "" }, { "docid": "a058e5866fac4d9a5c823f0a5d96f20f", "score": "0.6523591", "text": "get activePlayer(){\r\n\t\treturn this.players.find(player => player.active);\r\n\t}", "title": "" }, { "docid": "7e1a20af521ddedc017696b0b6490168", "score": "0.651529", "text": "function stats() {\n\tbasicEcho(player.playerStats());\n}", "title": "" }, { "docid": "0da57fe92a5ef42f7d085611c0c867b1", "score": "0.65091366", "text": "function inactive(){\n if(ActiveName=='Player 1'){\n return 'Player 2';\n }else{\n return 'Player 1';\n }\n}", "title": "" }, { "docid": "067d42afbf1dad9eaeac5fc87b79e7ba", "score": "0.650398", "text": "function onPlayer1Ready(e) {}", "title": "" }, { "docid": "a243981dbf1b5bbdeeb35c4bb4dbc052", "score": "0.65039665", "text": "static checkCurrentGameStatus(){\n // \n if(this.checkAnybodyWon(currentPlayer)){\n isGameOver = true;\n\n let currentplaytext = (currentPlayer == 'player1')? \"Player 1\":\"Player 2\";\n displayMsg.text = currentplaytext+' is the winner.';\n\n }else if(this.checkIfTie()){\n isGameOver = true;\n\n currentPlayer = 'Game is Tie.';\n }\n }", "title": "" }, { "docid": "f5764d19b488431a29a5791caf46f52d", "score": "0.6500229", "text": "function play() {\n\n\n}", "title": "" }, { "docid": "6c143e52894936e478bf399d662d0850", "score": "0.6494447", "text": "isCurrentTurnFor(player) {\n return player.data.handIdx === this.currentHandIdx\n }", "title": "" }, { "docid": "6fbc35046530bfa5bf4d40d93fd77d0f", "score": "0.648175", "text": "function playerGo() {\n playerTurn = true;\n}", "title": "" }, { "docid": "2a87a37a4475ba5e58c93ed9ed383baf", "score": "0.64782685", "text": "function playercontrol(room){\n var user = getRoomKey(room)\n io.to(user.id).emit(\"getCurrentTime\")\n }", "title": "" }, { "docid": "61413f6ffeab155dd103bfb7ec3f15db", "score": "0.64681834", "text": "function getPlayerchoice(user){\n\n}", "title": "" }, { "docid": "63f7eafd4f0a7ff61bcd077b8f1eb59a", "score": "0.6455524", "text": "function Player() {}", "title": "" }, { "docid": "75d48b0f380dd9ed756e957ac4b0283e", "score": "0.6445485", "text": "function currentPlayer(player) {\n var currentPlayer = new Image();\n\n if (player.getElementsByTagName(\"img\").length < 1) {\n player.firstChild.style.position = \"relative\";\n\n currentPlayer.src = \"images/current_player.png\";\n currentPlayer.setAttribute(\"class\", player.getAttribute(\"id\"));\n\n currentPlayer.style.position = \"absolute\";\n currentPlayer.style.minWidth = \"30px\";\n currentPlayer.style.height = \"30px\";\n currentPlayer.style.marginLeft = \"2%\";\n\n player.firstChild.appendChild(currentPlayer);\n player.getElementsByTagName(\"img\")[0].style.visibility = \"visible\";\n } else {\n player.getElementsByTagName(\"img\")[0].style.visibility = \"visible\";\n } \n\n launch.addEventListener(\"click\", resetGame); \n }", "title": "" }, { "docid": "490c6cecc8a8eea69f501f350f120ac4", "score": "0.64337474", "text": "function playerChange() {\r\n currentPlayer = currentPlayer === \"X\" ? \"O\" : \"X\";\r\n gameStatus.innerHTML = currentPlayerTurn();\r\n}", "title": "" }, { "docid": "09d99be9b0e32e309906958c36a2bf96", "score": "0.6429518", "text": "getActivePlayer() {\n return this.playerMarks[(this.moveCount + 1) % 2];\n }", "title": "" }, { "docid": "9477c769f3f1a676088cb01a0548d12a", "score": "0.6428665", "text": "function play() {\n\t\t//myGame.functionkey();\n\t\tmyGame.userChoice = this.id;\n\t\tmyGame.computerInput();\n\t\tmyGame.compare();\n\t\tmyGame.display();\n\t}", "title": "" }, { "docid": "2bfdc70e08845742b699ad7e26348b1e", "score": "0.64037323", "text": "_playerOneInitiate () {\n this._choosenPlayer = 'Mario'\n this._startGame()\n }", "title": "" }, { "docid": "ac87cc307165d44571535c97b5c5e983", "score": "0.64022136", "text": "function switchPlayer(){\n if(currentPlayer==1){\n hideElement(\"player1_highlight\");\n currentPlayer=2;\n showElement(\"player2_highlight\");\n } else {\n hideElement(\"player2_highlight\");\n currentPlayer=1;\n showElement(\"player1_highlight\");\n }\n console.log(\"current player is: \"+currentPlayer);\n}", "title": "" }, { "docid": "22b48b92d4674c3407f442f16b7a8a9d", "score": "0.6387137", "text": "function changePlayers() {\nif (currentPlayer == 'playerX') {currentPlayer = 'playerO'}\nelse {currentPlayer = 'playerX'}\n}", "title": "" }, { "docid": "44a8f80b27727eab4b3569eab3b5dc20", "score": "0.6378801", "text": "function nextPlayer() {\n if (currentPlayer.id === 1) {\n currentPlayer = playerTwo;\n } else {\n currentPlayer = playerOne;\n }\n console.log(currentPlayer.name);\n $('#player').removeClass().addClass(currentPlayer.id).text(currentPlayer.name);\n return currentPlayer;\n}", "title": "" }, { "docid": "285f70c44e865800ab1c1d4f262b1bb3", "score": "0.63653046", "text": "function gamePlay() {\n\n\n}", "title": "" }, { "docid": "0caf185ffec0fb6406c2c765f78ab2f4", "score": "0.6364175", "text": "play()\r\n {\r\n form.hide();\r\n textSize(30);\r\n text(\"Game Start\", 120, 100);\r\n Player.getPlayerInfo();\r\n console.log (allPlayers);\r\n\r\n if (allPlayers!== undefined)\r\n {\r\n var display_position=130;\r\n for(var plr in allPlayers)\r\n {\r\n if (plr===\"player\"+player.index)\r\n {\r\n fill(\"red\")\r\n }\r\n else \r\n {\r\n fill(\"black\")\r\n }\r\n display_position+=20;\r\n textSize(15);\r\n text(allPlayers[plr].name+\" : \"+allPlayers[plr].distance,120,display_position)\r\n }\r\n }\r\n if (keyIsDown(UP_ARROW)&& player.index!== null)\r\n {\r\n player.distance+=50;\r\n player.update();\r\n \r\n }\r\n }", "title": "" }, { "docid": "65531401ff008fee2cf5dec8b4024fd8", "score": "0.6363285", "text": "function onPlayerReady(event) {\r\n\r\n}", "title": "" }, { "docid": "3bb12fab7461a2a0c1ed158e58a2fa83", "score": "0.6357887", "text": "function active() {\n if (activePlayer === 0 && unactivePlayer === 1) {\n activePlayer = 1;\n unactivePlayer = 0;\n } else if (activePlayer === 1 && unactivePlayer === 0) {\n activePlayer = 0;\n unactivePlayer = 1;\n }\n}", "title": "" }, { "docid": "91624c5f6a122b754215ec367e59bc7a", "score": "0.63555527", "text": "function onNewPlayer (data) {\n // Create a new player\n \n}", "title": "" }, { "docid": "ca974cb418a5ec3519aae8d74b128864", "score": "0.63439393", "text": "function playerStatus() {\n player.on('playing', isPlaying);\n\n player.on('stalled', isStalled);\n }", "title": "" }, { "docid": "bbd56df82f09e8e446ef49905dcdac15", "score": "0.63368374", "text": "function onPlayerReady(event) {\n \n}", "title": "" }, { "docid": "c04a3c34d69282b4f58a865d16507a32", "score": "0.63323075", "text": "function ChangeThePlayer() {\n // change Player\n if (currentPlayer === \"X\") {\n currentPlayer = \"O\";\n } else {\n currentPlayer = \"X\";\n }\n}", "title": "" }, { "docid": "a95a07346e2f64a209333954c0f98c68", "score": "0.63278204", "text": "play()\r\n {\r\n form.hide(); // will hide form and its details \r\n player.getrank();\r\n textSize(30);\r\n text(\"Game Start\",120,100); // to print message in play stage \r\n // call player class get playerinfo () to get all players info\r\n Player.getPlayerInfo();\r\n if(allPlayers != undefined )\r\n {\r\n //to set background\r\n background(\"yellow\");\r\n // to apply track\r\n image(Trackimg,0,-displayHeight*4,displayWidth,displayHeight*5)\r\n var index=0; //cars index\r\n var x=170; // car x and y position\r\n var y;\r\n for(var i in allPlayers)\r\n { \r\n index=index+1;\r\n \r\n x=x+250;\r\n y=displayHeight-allPlayers[i].distance;\r\n cars[index-1].x=x;\r\n cars[index-1].y=y;\r\n\r\n if(index==player.index){\r\n cars[index-1].shapeColor=\"red\";\r\n camera.position.x=displayWidth/2;\r\n camera.position.y= cars[index-1].y\r\n }\r\n \r\n }\r\n \r\n\r\n }\r\n\r\n if(keyIsDown(UP_ARROW) && player.index !=null){\r\n player.distance +=50;\r\n player.update();\r\n }\r\n\r\n if(player.distance>4000){\r\n gameState=2;\r\n player.rank+=1\r\n Player.updaterank(player.rank);\r\n }\r\n drawSprites();\r\n }", "title": "" }, { "docid": "48075e64afcc5589bf5056a5691b2b1d", "score": "0.63257474", "text": "function changePlayer() {\n currPlayer = currPlayer === 1 ? 2 : 1;\n}", "title": "" }, { "docid": "5b326c21d5587daf97e1cc6c30c05b30", "score": "0.6325136", "text": "function playMain() {\n\n}", "title": "" }, { "docid": "1765b67cf8d1fce1633d164630d2711f", "score": "0.63246596", "text": "pushPlayerWonText(){this.pushText(\"WON\");}", "title": "" }, { "docid": "812da1dbb779cf689db94be373bfe8ae", "score": "0.6324386", "text": "function onePlayerGame() {\n if(currentPlayer === playerOne) {\n if(gameIsRunning) {\n humanMove();\n setTimeout(() => {\n $QS(\".playertwo.name\").classList.remove(\"active-player\");\n $QS(\".playerone.name\").classList.add(\"active-player\");\n }, 500);\n }\n } else {\n if(gameIsRunning) {\n setTimeout(() => computerMove(), 500);\n $QS(\".playerone.name\").classList.remove(\"active-player\");\n $QS(\".playertwo.name\").classList.add(\"active-player\");\n }\n }\n }", "title": "" }, { "docid": "f47dd7cde25429008dd9a4deed3820f7", "score": "0.6322917", "text": "switchPlayer() {\n this.actualPlayer = this.actualPlayer === 'x' ? 'o' : 'x';\n }", "title": "" }, { "docid": "7d5d9e1d65a8297a2dd2b80e45ed900d", "score": "0.63169247", "text": "function handlePlayerChange() {\r\n if (currentPlayer == human) {\r\n currentPlayer = computer;\r\n moveComputer();\r\n } else {\r\n currentPlayer = human;\r\n }\r\n displayController.displayStatus(currentPlayer, gameResult);\r\n }", "title": "" }, { "docid": "40f8556f198ad627cf98e026ee06e6d1", "score": "0.63085073", "text": "function changePlayer(){\n gameData.index ? (gameData.index=0) : (gameData.index=1);\n players[gameData.index].className = \"player currentPlayer\";\n players[Math.abs(1-gameData.index)].className = \"player pausedPlayer\";\n }", "title": "" }, { "docid": "37544abac13307be27f39248c28d5258", "score": "0.63066775", "text": "activePlayer () { \r\n $('div.score-board').removeClass('active'); \r\n const oPlayer = game.players[game.playersTurn-1];\r\n if (oPlayer) {\r\n $(`#player-${oPlayer.playerNumber}-${oPlayer.playerName}`).addClass('active');\r\n }\r\n }", "title": "" }, { "docid": "c602809b5b812587217262b2dd2db89d", "score": "0.6306452", "text": "function playerTurn() {\r\n $('#interactionPause').css('display', 'none');\r\n setInitialPlayerMenu();\r\n setPlayerTurnStats();\r\n\r\n}", "title": "" }, { "docid": "0f8be45681f8a1fa93f1c37499336609", "score": "0.6301189", "text": "togglePlayer() {\r\n this._currentPlayer = Number(!Boolean(this._currentPlayer));\r\n this.updatePlayerListeners();\r\n }", "title": "" }, { "docid": "117b923d715bdc20ec874787bc5de46b", "score": "0.62963057", "text": "addLocalPlayer() {\n const char = window.app.model.characterSelected;\n if (char) {\n this.me = new LocalPlayer(\n this.game,\n char === 'human' ? 500 : 100,\n char === 'human' ? 500: 100,\n 'left',\n char,\n char === 'human',\n 'me',\n 0\n );\n\n if (char === 'human') {\n this.generateSilver();\n }\n }\n }", "title": "" }, { "docid": "b4f5ee194d32a2c17f2d1b6dcf12920f", "score": "0.62926906", "text": "function getCurrentState() {\n var playing;\n if ($(\".spoticon-play-16\").length > 0) {\n playing = false;\n\n } else {\n playing = true;\n }\n\n return playing;\n\n }", "title": "" }, { "docid": "15971426b84fd06890ff7ea7df014485", "score": "0.6292539", "text": "play () {\r\n form.hide();\r\n\r\n textSize (30) ;\r\n text (\"Game Start\", 120,100);\r\n Player.getPlayerInfo ();\r\n\r\n if (allPlayers != undefined) {\r\n var display_position = 130;\r\n // display all players\r\n for (var plr in allPlayers){\r\n /*\r\n if (plr == \"player\"+player.index)\r\n fill(\"red\");\r\n else\r\n fill (\"black\");\r\n */\r\n display_position+=20;\r\n textSize (15) ;\r\n text (allPlayers[plr].name+\": \" + allPlayers[plr].distance, 120, display_position);\r\n }\r\n \r\n }\r\n \r\n if (keyIsDown (UP_ARROW) && player.index != null) {\r\n \r\n player.distance= player.distance + 50; // increment player distance\r\n player.updatePlayerNameAndDistance ();\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "1a190064b88432d6b5694cf3d87828b0", "score": "0.62861174", "text": "switch_players() {\n if(this.currPlayer == this.player.white_player){\n this.currPlayer = this.player.black_player;\n }\n else {\n this.currPlayer = this.player.white_player;\n }\n this.scene.changeCamera();\n }", "title": "" }, { "docid": "444ead700a9513fbb50fc474f3efdc29", "score": "0.6277059", "text": "function updatePlayerInfo() {\n\t//if game is running, display current player color in span\n\tif (gameRunning) {\n\t\tdocument.getElementById('gameInfo').innerHTML = \"Current Player: Player \" + (currentPlayer+1) + \"<span class='player\" + currentPlayer + \"'>\" + playerColor[currentPlayer] + \"</span>\";\n\t}//end if\n}// end updatePlayerInfo", "title": "" }, { "docid": "c986041edfb8cad89a2950bcc5e3426d", "score": "0.62765074", "text": "playerControl() {\n // Player movement\n // Check keys\n this.player.step(DT);\n\n if (this.keyboard.keyPressedOnce(\"Enter\")) {\n this.RELOAD = 1;\n }\n }", "title": "" }, { "docid": "e9ab21a831e9d9ed759817ab5783cd3d", "score": "0.6270469", "text": "function playerGo() \n{\n\tif ( players.current >= ( players.players.length - 1 ) ) \n\t{\n\t\tplayers.current = 0;\n\t} \n\telse \n\t{\n\t\tplayers.current++;\n\t}\n}", "title": "" }, { "docid": "f669d8f23f8463adae4bceee772399d2", "score": "0.62665445", "text": "play() {\n\n\t\t// Mute?\n\t\tif(window.mute){\n\t\t\tthis.player.volume = 0;\n\t\t}\n\n\t\t// Looping things\n\t\tif(this.loop){\n\t\t\tthis.current_player = \"a\";\n\t\t\tthis.play_loop();\n\t\t} else {\n\t\t\tthis.player.play();\n\t\t}\n\t}", "title": "" }, { "docid": "7fe692ac8bf91f1ccb6cfe6a56135cc8", "score": "0.6260404", "text": "function setPlayer() {\n\tGame.player = this.id;\n\t// assigns other piece to the ai\n\tGame.ai = Game.player === 'X' ? 'O' : 'X';\n\tminPlayer = Game.player === 'X' ? 1 : 2;\n\tmaxPlayer = Game.ai === 'O' ? 2 : 1;\n\t// alerts user who goes first\n\t$alert.text(Game.player + ' goes first!');\n\tconsole.log('This is the player piece: ' + Game.player + ' and this is the minPlayer: ' + minPlayer);\n\tconsole.log('This is the ai piece: ' + Game.ai + ' and this is the maxPlayer: ' + maxPlayer);\n}", "title": "" }, { "docid": "b0af738439afc27cff4a7d8cb777a42d", "score": "0.6250038", "text": "function onPlayerReady(event) {\n}", "title": "" }, { "docid": "b0af738439afc27cff4a7d8cb777a42d", "score": "0.6250038", "text": "function onPlayerReady(event) {\n}", "title": "" }, { "docid": "1fbe7e0053f8bb947135e83460e51040", "score": "0.62353826", "text": "play(){//Set up for playing crazy eights\n this.jview.displayComputerHand(this.dealer.getHandCopy());\n this.jview.displayHumanHand(this.jplayer.getHandCopy());\n //this.jplayer.findValue();\n //this.dealer.findValue();\n return;\n }", "title": "" }, { "docid": "c173a513f3ca6c4f04e66a6dd77f3901", "score": "0.62322235", "text": "function main() {\n //currentPlayerTrun mostramos el turno del jugador actual\n handleStatusDisplay(currentPlayerTrun())\n listeners()\n}", "title": "" }, { "docid": "94424d991b33b797dffd84931ded2635", "score": "0.6231594", "text": "play() {}", "title": "" }, { "docid": "723c56e1578d6b2ac48ecab8ecee225c", "score": "0.6210486", "text": "function updatePlayerInfo() {\r\n // Also check that at least one function exists since when IE unloads the\r\n // page, it will destroy the SWF before clearing the interval.\r\n if (player && player.getDuration) {\r\n $(\"#slider\").slider('value', Math.round(player.getCurrentTime() / player.getDuration() * 100));\r\n }\r\n }", "title": "" }, { "docid": "772dcdbd90e7d0fc66c804a8caccad58", "score": "0.6204946", "text": "function playGame(){\n\n}", "title": "" }, { "docid": "98ad78e9cf74831c6c35cbd2878d11c1", "score": "0.62013733", "text": "function getNowPlaying() {\n return now_playing_obj;\n}", "title": "" }, { "docid": "f60e2f2b453542f1dd05706dc0266f66", "score": "0.6199072", "text": "function Player(name) {\r\n}", "title": "" }, { "docid": "0916081ae48a570e851f491f3f0c6412", "score": "0.6193205", "text": "function updatePlayerName() {\r\n $currentPlayerName.innerHTML = getCurrentPlayerName();\r\n}", "title": "" }, { "docid": "355897fc8f88b7afddd13338332efc3f", "score": "0.6179295", "text": "function switch_player() {\n if(current_player == COLOR_PLAYER_ONE) {\n current_player = COLOR_PLAYER_TWO;\n } else {\n current_player = COLOR_PLAYER_ONE;\n }\n}", "title": "" }, { "docid": "07c8c350f041f072bd0f346c7644aa6f", "score": "0.61755383", "text": "nextPlayer() {\n\t\tif (!this.hasWon(this.currentPlayer)) {\n\t\t\tthis._currentPlayer = 1 - this._currentPlayer;\n\t\t}\n\t}", "title": "" }, { "docid": "0c9926f1e6deec0fed05cd038b52c462", "score": "0.61718196", "text": "function whoToPlay(){\n if(whichPlayer === \"playerOne\"){\n showWhichPlayer.textContent = \"Player Two's turn\"\n gameBorder.setAttribute(\"style\", \"border: 4px solid red\")\n return whichPlayer = \"playerTwo\";\n }else if(whichPlayer === \"playerTwo\"){\n showWhichPlayer.textContent = \"Player One's turn\"\n gameBorder.setAttribute(\"style\", \"border: 4px solid black\")\n return whichPlayer = \"playerOne\"\n }\n}", "title": "" }, { "docid": "d5890768fb0971cdcb327d855fa67dc5", "score": "0.6170596", "text": "playerBuild(){\n\n }", "title": "" }, { "docid": "ac4692ddfeb90e5f852976dbc8116dd1", "score": "0.6165935", "text": "function currentVideo (video, init) {\n if (!init) ytplayer.loadVideoById(video.VideoID, 0);\n\t$('#currentVideoTitle').html(video.VideoTitle);\n\t$('#playlist a').css('color', '#464646');\n\t$('#'+video.VideoID).css('color', '#940500');\n}", "title": "" }, { "docid": "3b5f59adb7738b0d821598d0e87f7a15", "score": "0.6165778", "text": "function showNextPlayer(currentPlayer, player) {\n currentPlayer.replaceWith('Joueur ' + player);\n }", "title": "" }, { "docid": "bc9f9a792ff87b5e352bf39f1897229b", "score": "0.6165227", "text": "getActivePlayer() {\n // Get the first player by default.\n let activePlayer = (Object.keys(this.players).length > 0 ? this.players[Object.keys(this.players)[0]] : null);\n\n // Loop through the users and find the active one.\n for (let player in this.players) {\n if (this.players[player].isActive) {\n activePlayer = this.players[player];\n break;\n }\n }\n return activePlayer;\n }", "title": "" }, { "docid": "e84fc8332bf782cb736d96b035d9bd68", "score": "0.6163543", "text": "function letsPlay() {\n thePoints.text('0')\n inGameInfo.inPlay = true\n setFieldCards()\n setHeadCards()\n }", "title": "" }, { "docid": "3a70a6db276227336af0e67bc1e1a96d", "score": "0.6155548", "text": "function handlePlayer() {\n\n\t/* update & draw */\n\tplayer.update(true);\n\tif (drawit)\n\t\tplayer.draw();\n\n\t/* constrain the player */\n\tif (player.isOffscreen()) {\n\t\tendGame();\n\t}\n}", "title": "" }, { "docid": "cf4d3152fd8a2dc54aea6c50b23b4587", "score": "0.6143228", "text": "function nextPlayer() {\n currentPlayer === 0 ? currentPlayer = 1 : currentPlayer = 0;\n roundScore = 0;\n currentScoreP1.innerHTML = 0;\n currentScoreP2.innerHTML = 0;\n document.querySelector('.player-0-panel').classList.toggle('active');\n document.querySelector('.player-1-panel').classList.toggle('active');\n}", "title": "" } ]
3f696b2aa736b0cbb2b5cdf142a585f4
Equivalent of `typeof` but with special handling for array and regexp.
[ { "docid": "85a595f9ff92b9f8c5e80136c2ff9911", "score": "0.0", "text": "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "title": "" } ]
[ { "docid": "3f2ac15dd615c579cf7b7232e8df6cd1", "score": "0.745297", "text": "function typeOf(t){var e={}.toString.call(t);return\"[object Object]\"===e?\"object\":\"[object Array]\"===e?\"array\":\"[object String]\"===e?\"string\":\"[object Number]\"===e?\"number\":\"[object Function]\"===e?\"function\":\"[object Null]\"===e?\"null\":\"undefined\"}", "title": "" }, { "docid": "33bdc9ae793cf9a9fc85779eca604f59", "score": "0.6609952", "text": "function AsYouType_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { AsYouType_typeof = function _typeof(obj) { return typeof obj; }; } else { AsYouType_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return AsYouType_typeof(obj); }", "title": "" }, { "docid": "33bdc9ae793cf9a9fc85779eca604f59", "score": "0.6609952", "text": "function AsYouType_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { AsYouType_typeof = function _typeof(obj) { return typeof obj; }; } else { AsYouType_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return AsYouType_typeof(obj); }", "title": "" }, { "docid": "33bdc9ae793cf9a9fc85779eca604f59", "score": "0.6609952", "text": "function AsYouType_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { AsYouType_typeof = function _typeof(obj) { return typeof obj; }; } else { AsYouType_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return AsYouType_typeof(obj); }", "title": "" }, { "docid": "36055cd3f07ac5b7c13ab675a4905383", "score": "0.6512246", "text": "function getType(arg){\n return typeof arg;\n}", "title": "" }, { "docid": "435317fa1fe0d389bb354abe045396d5", "score": "0.6501802", "text": "function typeOf(value) {\n var t = typeof value;\n if (value === null)\n t = 'null'; //null表示什么都没有,只有null===null才返回true\n if (t === 'object' && value.constructor === Array)\n t = 'array'; //如果type确实为'object',后面才会执行\n return t;\n}", "title": "" }, { "docid": "efacecfb6723a9b3ac9c4265119c23ac", "score": "0.6490504", "text": "function _typeOf ( value )\n\t{\n\t\tvar type;\n\n\t\ttype = typeof value;\n\t\tif ( type === \"number\" )\n\t\t{\n\t\t\tif ( isNaN( value ) )\n\t\t\t{\n\t\t\t\ttype = \"NaN\";\n\t\t\t}\n\t\t}\n\t\telse if ( type === \"object\" )\n\t\t{\n\t\t\tif ( value )\n\t\t\t{\n\t\t\t\tif ( value instanceof Array )\n\t\t\t\t{\n\t\t\t\t\ttype = \"array\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttype = \"null\";\n\t\t\t}\n\t\t}\n\n\t\treturn type;\n\t}", "title": "" }, { "docid": "4cedf4968b0580b5033daae6ae9d707c", "score": "0.6488086", "text": "function _typeof$2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof$2(obj); }", "title": "" }, { "docid": "39a9e847bd9e3fc2971c05ee1c14f150", "score": "0.6484131", "text": "function typeOf(arg) {\n return typeof(arg);\n}", "title": "" }, { "docid": "2aa8d594a5ed0da9ae8368708c5bbb37", "score": "0.64188063", "text": "function typeStr(obj) {\n return isArray(obj) ? 'array' : _typeof$1(obj);\n }", "title": "" }, { "docid": "997f6bbc4238524ca243ce45b8c3d5bd", "score": "0.64052975", "text": "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "title": "" }, { "docid": "997f6bbc4238524ca243ce45b8c3d5bd", "score": "0.64052975", "text": "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "title": "" }, { "docid": "997f6bbc4238524ca243ce45b8c3d5bd", "score": "0.64052975", "text": "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "36f52f50bdc3c2b67d471939aa4a1a11", "score": "0.6397319", "text": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "de339ed75a7b26d50f53ef6844c00f9a", "score": "0.6364667", "text": "function realType(a){\r\n if(a===null)\r\n {\r\n return \"null\";\r\n }\r\n else if((typeof a) === \"object\")\r\n {\r\n return \"array\";\r\n }\r\n else{\r\n return typeof a;\r\n }\r\n}", "title": "" }, { "docid": "3604c364fc0c449c4c0995b376a0f84a", "score": "0.6363672", "text": "function typeOf(value) {\n\t var s = typeof value;\n\t if (s == 'object') {\n\t if (!value) {\n\t return 'null';\n\t } else if (value instanceof Array) {\n\t return 'array';\n\t }\n\t }\n\t return s;\n\t}", "title": "" }, { "docid": "8acc4b7e1f47f3fefec50b80e058f701", "score": "0.6344213", "text": "function typeOf(value) {\n var t = typeof value;\n if (t === 'object') {\n if (value === null) return 'null';\n var k = klass(value);\n \n if (k === '[object Array]') return 'array';\n if (k === '[object Date]') return 'date';\n if (k === '[object RegExp]') return 'regex';\n \n return 'object';\n }\n return t;\n }", "title": "" }, { "docid": "70bb9fb964c910d103c41c74b8f3919a", "score": "0.63362396", "text": "function arrayType(item){\n var value = Object.prototype.toString.call(item); \n if(\"[object Array]\" == value){\n return \"Array\";\n }else if(\"[object Object]\" == value){\n return \"List\";\n }\n}", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.63084114", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.63084114", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.63084114", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.63084114", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.63084114", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.63084114", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "12050a71f76f6686d1d13f2578042b0f", "score": "0.62893647", "text": "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function t(e){return typeof e}:function t(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(t)}", "title": "" }, { "docid": "44eb59d18f3e7e6d47f6bc0803eb446e", "score": "0.6273949", "text": "function typeStr(obj) {\n\t\treturn isArray(obj) ? \"array\" : typeof obj;\n\t}", "title": "" }, { "docid": "0cc6a4a96f61aa8f2abd8adb4f1f7276", "score": "0.6264537", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "734b7c4f9afffda664a6864c3112da19", "score": "0.62575597", "text": "_type(v) {\n if (typeof v === 'number') {\n return 1;\n }\n\n if (typeof v === 'string') {\n return 2;\n }\n\n if (typeof v === 'boolean') {\n return 8;\n }\n\n if (Array.isArray(v)) {\n return 4;\n }\n\n if (v === null) {\n return 10;\n } // note that typeof(/x/) === \"object\"\n\n\n if (v instanceof RegExp) {\n return 11;\n }\n\n if (typeof v === 'function') {\n return 13;\n }\n\n if (v instanceof Date) {\n return 9;\n }\n\n if (EJSON.isBinary(v)) {\n return 5;\n }\n\n if (v instanceof MongoID.ObjectID) {\n return 7;\n } // object\n\n\n return 3; // XXX support some/all of these:\n // 14, symbol\n // 15, javascript code with scope\n // 16, 18: 32-bit/64-bit integer\n // 17, timestamp\n // 255, minkey\n // 127, maxkey\n }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "7561b0c7d22726ca6e49bead67a318ae", "score": "0.62553424", "text": "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.62325335", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.62325335", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.62325335", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "13ca666280c02be9865724e068f0afcc", "score": "0.62129635", "text": "function typeStr(obj) {\r\n return isArray(obj) ? 'array' : typeof obj;\r\n }", "title": "" }, { "docid": "e035fb8a200a45cd2ef4f9f363937210", "score": "0.62076366", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n}", "title": "" }, { "docid": "73248d6124be77dced3d2f359ac3d1c2", "score": "0.61889005", "text": "function typeOf(value) {\n if (value === undefined) {\n return 'undefined';\n }\n if (value === null) {\n return 'null';\n }\n var type = internalType(value);\n if (!arrayIncludes(baseTypes, type)) {\n type = typeof value;\n }\n return type;\n}", "title": "" }, { "docid": "f00878a2fb076baf1a91b451ac52d9ce", "score": "0.6182298", "text": "function logArrTypes(arr){\n\tforEachElem(arr, (elem) => (console.log(elem + ' is a ' + typeof elem)));\n}", "title": "" }, { "docid": "e145d30078bbcd5f6f4d5ed5edeba499", "score": "0.617081", "text": "function typeOf(value) {\n\t\t\t\tvar s = typeof value;\n\t\t\t\tif (s === 'object') {\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\tif (value instanceof Array) {\n\t\t\t\t\t\t\ts = 'array';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ts = 'null';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn s;\n\t\t\t}", "title": "" }, { "docid": "26f017d2bd2d86ef1778237f6b55c671", "score": "0.6169651", "text": "function _typeof(obj){\"@babel/helpers - typeof\";return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&\"function\"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?\"symbol\":typeof obj},_typeof(obj)}", "title": "" }, { "docid": "26f017d2bd2d86ef1778237f6b55c671", "score": "0.6169651", "text": "function _typeof(obj){\"@babel/helpers - typeof\";return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&\"function\"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?\"symbol\":typeof obj},_typeof(obj)}", "title": "" }, { "docid": "efe79cfaa78642c1f4bf6aa3d1f03a0e", "score": "0.616634", "text": "function h$typeOf(o) {\n if (!(o instanceof Object)) {\n if (o == null) {\n return 0;\n } else if (typeof o == 'number') {\n if (h$isInteger(o)) {\n return 1;\n } else {\n return 2;\n }\n } else if (typeof o == 'boolean') {\n return 3;\n } else {\n return 4;\n }\n } else {\n if (Object.prototype.toString.call(o) == '[object Array]') {\n // it's an array\n return 5;\n } else if (!o) {\n // null \n return 0;\n } else {\n // it's an object\n return 6;\n }\n }\n}", "title": "" }, { "docid": "efe79cfaa78642c1f4bf6aa3d1f03a0e", "score": "0.616634", "text": "function h$typeOf(o) {\n if (!(o instanceof Object)) {\n if (o == null) {\n return 0;\n } else if (typeof o == 'number') {\n if (h$isInteger(o)) {\n return 1;\n } else {\n return 2;\n }\n } else if (typeof o == 'boolean') {\n return 3;\n } else {\n return 4;\n }\n } else {\n if (Object.prototype.toString.call(o) == '[object Array]') {\n // it's an array\n return 5;\n } else if (!o) {\n // null \n return 0;\n } else {\n // it's an object\n return 6;\n }\n }\n}", "title": "" }, { "docid": "efe79cfaa78642c1f4bf6aa3d1f03a0e", "score": "0.616634", "text": "function h$typeOf(o) {\n if (!(o instanceof Object)) {\n if (o == null) {\n return 0;\n } else if (typeof o == 'number') {\n if (h$isInteger(o)) {\n return 1;\n } else {\n return 2;\n }\n } else if (typeof o == 'boolean') {\n return 3;\n } else {\n return 4;\n }\n } else {\n if (Object.prototype.toString.call(o) == '[object Array]') {\n // it's an array\n return 5;\n } else if (!o) {\n // null \n return 0;\n } else {\n // it's an object\n return 6;\n }\n }\n}", "title": "" }, { "docid": "efe79cfaa78642c1f4bf6aa3d1f03a0e", "score": "0.616634", "text": "function h$typeOf(o) {\n if (!(o instanceof Object)) {\n if (o == null) {\n return 0;\n } else if (typeof o == 'number') {\n if (h$isInteger(o)) {\n return 1;\n } else {\n return 2;\n }\n } else if (typeof o == 'boolean') {\n return 3;\n } else {\n return 4;\n }\n } else {\n if (Object.prototype.toString.call(o) == '[object Array]') {\n // it's an array\n return 5;\n } else if (!o) {\n // null \n return 0;\n } else {\n // it's an object\n return 6;\n }\n }\n}", "title": "" }, { "docid": "efe79cfaa78642c1f4bf6aa3d1f03a0e", "score": "0.616634", "text": "function h$typeOf(o) {\n if (!(o instanceof Object)) {\n if (o == null) {\n return 0;\n } else if (typeof o == 'number') {\n if (h$isInteger(o)) {\n return 1;\n } else {\n return 2;\n }\n } else if (typeof o == 'boolean') {\n return 3;\n } else {\n return 4;\n }\n } else {\n if (Object.prototype.toString.call(o) == '[object Array]') {\n // it's an array\n return 5;\n } else if (!o) {\n // null \n return 0;\n } else {\n // it's an object\n return 6;\n }\n }\n}", "title": "" }, { "docid": "b133ce887b95d5f371972023af095402", "score": "0.6159609", "text": "function typeStr(obj) {\n\t return isArray(obj) ? 'array' : typeof obj === 'undefined' ? 'undefined' : _typeof(obj);\n\t }", "title": "" }, { "docid": "94f618371bdd53d4323e8010bcb51e9f", "score": "0.6142195", "text": "function getTypeOf(value) {\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n return 'array';\n }\n return typeof value;\n}", "title": "" }, { "docid": "07a06fbd6a13c7c9603af51bfa530a92", "score": "0.61371046", "text": "function type( obj ){\n var t = typeof obj\n if( t === \"object\") {\n if( obj === null) return \"null\"\n if( obj.classLabel )return obj.classLabel\n if( obj.constructor === (new Array).constructor )return \"Array\"\n if( obj.constructor === (new Date).constructor )return \"Date\"\n if( obj.constructor === (new RegExp).constructor )return \"RegExp\"\n if( obj.constructor === (new String).constructor )return \"String\"\n if( obj.constructor === (new Function).constructor )return \"Function\"\n try{ return /(\\w+)\\(/.exec( obj.constructor.toString())[1] // ) scite issue\n }catch( err ){ return \"object\" }\n }\n return t\n }", "title": "" }, { "docid": "7d06fa3c3b24e2b6d17d4e14c09968e5", "score": "0.6134348", "text": "function GetType(val) {\n return typeof (val);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "d54c65c1f7ed569346359c2fd4391950", "score": "0.6124879", "text": "function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}", "title": "" }, { "docid": "22e4dddeb44e08b736cd12b1f802aa30", "score": "0.6116992", "text": "function v(e){var t=typeof e;return Array.isArray(e)?\"array\":e instanceof RegExp?\"object\":j(t,e)?\"symbol\":t}", "title": "" }, { "docid": "fcdc3a9de9462c6a961a6194f8103bd9", "score": "0.611552", "text": "function typeOf(input) {\r\n\r\n\t\treturn ({}).toString.call(input).slice(8, -1).toLowerCase();\r\n\r\n\t}", "title": "" } ]
4f4c4f47b1b6aa36f464127d032b5701
Resets the cache key.
[ { "docid": "265d0c97c3c92c99b55e639ad878254d", "score": "0.8047636", "text": "function resetCacheKey() {\n cacheKey = '';\n }", "title": "" } ]
[ { "docid": "15bee08d79e919ec533c25c6ff85f776", "score": "0.71994966", "text": "function resetKey(){//reseting key variable after update is done\n\t\tkey = '';\n\t}", "title": "" }, { "docid": "8f8c52990c943b34025a04a4030edd59", "score": "0.7169539", "text": "reset() {\r\n this._hasher.reset();\r\n this._hasher.update(this._iKey);\r\n }", "title": "" }, { "docid": "a758dd298c6c45a3d3ffc951109d4fed", "score": "0.70647264", "text": "reset() {\n this.cache.clear();\n }", "title": "" }, { "docid": "cf6d5c87d6a0d4dcf894265029e0a528", "score": "0.702982", "text": "reset() {\n _.each(caches, function(cache, key) {\n // console.log(`Reset ${key} cache`, cache);\n cache.reset();\n })\n }", "title": "" }, { "docid": "e50df9abc35a67e1b4c08f89aae64e4b", "score": "0.6750066", "text": "function reset() {\n remoteCache = {};\n localCacheById = {};\n localCache = {};\n }", "title": "" }, { "docid": "730a5d06a1a9720ad73834b69af3d890", "score": "0.674212", "text": "clearCache() {\n\t\tcache.reset();\n\t}", "title": "" }, { "docid": "8ebe56edf40884bf2357d612c168235b", "score": "0.67220134", "text": "resetCache() {\n if (this.cacheEnabled) {\n this.cached();\n }\n }", "title": "" }, { "docid": "a02c5f5f8c01625b5b7bdb1d0213abd4", "score": "0.656915", "text": "clearCache() {\n EnigmailLog.DEBUG(\"keyRing.jsm: EnigmailKeyRing.clearCache\\n\");\n gKeyListObj = {\n keyList: [],\n keySortList: [],\n };\n\n gKeyIndex = [];\n gSubkeyIndex = [];\n }", "title": "" }, { "docid": "d5cf69b16e1b102e6a2f461f7c490575", "score": "0.648617", "text": "function cacheClear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6444986", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6444986", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "e2f90396b86f7510e41a9227bf61d70f", "score": "0.6444986", "text": "function clear() {\n cache = {};\n}", "title": "" }, { "docid": "b9e41a226276107eeea69ef8b3673ac1", "score": "0.6431305", "text": "function unset(key){\n delete cache[key]; \n}", "title": "" }, { "docid": "843fc1b61d052f5fb962cf1941162cfa", "score": "0.63829875", "text": "function clearCache() {\n _cache = {};\n }", "title": "" }, { "docid": "9e05f3805f191273ef1ef324fe93cfd6", "score": "0.63796544", "text": "clear() {\n this.cache_ = {};\n this.cacheSize_ = 0;\n }", "title": "" }, { "docid": "a3e51b91311ac4d269e7ac99a33bf904", "score": "0.63180107", "text": "clear() {\n this._cache.clear();\n }", "title": "" }, { "docid": "de82c48320b8aef182fb47c8a6abda73", "score": "0.62863696", "text": "clearCache() {\n this._cache = {};\n this._lru = new LinkedList(this._maxSize);\n }", "title": "" }, { "docid": "2412e170838217d288ef6d5b946489e9", "score": "0.62862813", "text": "clear() {\n this.cache_ = {};\n if (Store.isSupported_()) {\n try {\n Store.clear_(this.key_);\n } catch(err) {\n // Do nothing.\n }\n }\n }", "title": "" }, { "docid": "943ccdbb2d36951385b244ab43f7e497", "score": "0.627227", "text": "function clearCache() {\n cache = null;\n }", "title": "" }, { "docid": "1948fb725752c2b16b55950879e76820", "score": "0.62490433", "text": "clear() {\n [...this._cache.keys].forEach(key => this.remove(key));\n }", "title": "" }, { "docid": "e222b20a8caa6914baa6d5027485d21d", "score": "0.62117386", "text": "clear() { this.cache = {}; }", "title": "" }, { "docid": "b288af40e2232b8b53733dba85a1eda3", "score": "0.62090045", "text": "reset(){\n this.deletePrivateKey();\n }", "title": "" }, { "docid": "fceef34f9b9446267636b718e077763a", "score": "0.6154291", "text": "_resetCached() {\n\n var node = this._rules.head;\n while (node) {\n node.data.reset();\n node = node.next;\n }\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.6126778", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.6126778", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.6126778", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.6126778", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.6126778", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.6126778", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "961c2586291528b88602e7ad84a77cde", "score": "0.6098165", "text": "reset() {\n this._idsToKeys = {};\n this._keysToIds = {};\n }", "title": "" }, { "docid": "90facd2ee78223e5333f39ca6bcd9fb5", "score": "0.6066365", "text": "clearKeys()\n\t{\n\t\tthis._keyBuffer = [];\n\t}", "title": "" }, { "docid": "a7dec37f383e31c75319e7b4204604c1", "score": "0.60642445", "text": "reset () {\n // this.keys = this.keys.forEach(key => this.keys[key] = false)\n for (let key in this.keys) {\n this.keys[key] = false;\n }\n }", "title": "" }, { "docid": "c2a75663556123a5ae84e4c569029031", "score": "0.6041924", "text": "reset_key() {\n this.setState({resetKey: Date.now()})\n }", "title": "" }, { "docid": "9a9c935f6617ea2ec48cb2a78e768608", "score": "0.6022252", "text": "function clearCache() {\n cache.caches = {}\n}", "title": "" }, { "docid": "a1f5321f630463f8c5d7deabc0256ba6", "score": "0.60055524", "text": "reset() {\n this.clear();\n\n Object.keys(this).forEach(key => this[key] = '');\n }", "title": "" }, { "docid": "9c83414a8d8b439ad10064428ca031e6", "score": "0.5986522", "text": "reset() {\n this._q = []\n this._keys = {}\n }", "title": "" }, { "docid": "74d8aab60219020e497d4780ccab3413", "score": "0.5973021", "text": "function clearCache() {\n Object.keys(cache).forEach(function (key) {\n delete cache[key];\n });\n\n}", "title": "" }, { "docid": "a6a5905c9e906b355951d9bb97d5a860", "score": "0.5953536", "text": "reset() {\n super.reset();\n this._expired = true;\n }", "title": "" }, { "docid": "f066730d6d0338a511e10862de1edae8", "score": "0.59453905", "text": "_resetCache() {\n fsscanner.scan(this.cacheFolder, [], (err, res) => {\n if (err || res.length === 0) return;\n res.forEach(file => {\n fs.unlinkSync(file);\n });\n });\n }", "title": "" }, { "docid": "dcdee677573eed7157b521613f5c3e98", "score": "0.59300053", "text": "clearCache() {\n Object.keys(cache).forEach(key => {\n if ( cache.hasOwnProperty(key) ) delete cache[key];\n });\n }", "title": "" }, { "docid": "36ef4ea8bff1ac4a8283b4b8963ea911", "score": "0.59177995", "text": "close() {\n this.cache.reset();\n }", "title": "" }, { "docid": "611cc088d81a30c37ac022f2426551f8", "score": "0.5903914", "text": "resetCache_() {\n this.cache_ = {\n // Right now, the currentTime is not _really_ cached because it is always\n // retrieved from the tech (see: currentTime). However, for completeness,\n // we set it to zero here to ensure that if we do start actually caching\n // it, we reset it along with everything else.\n currentTime: 0,\n initTime: 0,\n inactivityTimeout: this.options_.inactivityTimeout,\n duration: NaN,\n lastVolume: 1,\n lastPlaybackRate: this.defaultPlaybackRate(),\n media: null,\n src: '',\n source: {},\n sources: [],\n playbackRates: [],\n volume: 1\n };\n }", "title": "" }, { "docid": "d1705d43ee8e707e72d250e6eea0b5a2", "score": "0.59024704", "text": "function reset() {\n delete require.cache[\n require.resolve('../../../app/scripts/persistence/datastore')\n ];\n datastore = require('../../../app/scripts/persistence/datastore');\n}", "title": "" }, { "docid": "d6bc66cdd6174c47bbdc93298044327a", "score": "0.5878765", "text": "clearCache() {\n\t\tthis.builder.clearCache();\n\t}", "title": "" }, { "docid": "53712d12608b632b4a4caeadc6ab0028", "score": "0.5867006", "text": "function resetMemoization() {\n memoizeStore = new WeakMap();\n}", "title": "" }, { "docid": "060bdfbf16d217c4bdcb344f4d2ae6a0", "score": "0.5864742", "text": "function resetState() {\n\thypixelCached.usernameCache.flushAll()\n\thypixelCached.basicProfilesCache.flushAll()\n\thypixelCached.playerCache.flushAll()\n\thypixelCached.basicPlayerCache.reset()\n\thypixelCached.profileCache.flushAll()\n\thypixelCached.profileNameCache.flushAll()\n\trequestsSent = 0\n}", "title": "" }, { "docid": "ba90ef4eccc15e98659493373e7cbdef", "score": "0.58637184", "text": "function __resetCache() {\n services.clear();\n serviceSizeMap.clear();\n}", "title": "" }, { "docid": "d2cb273a8b09bd4b1a693b8baf18785d", "score": "0.5862102", "text": "clear() {\n while (this.cacheIndexes.length) {\n const remove = this.cacheIndexes.shift();\n this.cache[remove] = null;\n delete this.cache[remove];\n }\n }", "title": "" }, { "docid": "1bccd360d15a2ca841e5827c6613ca90", "score": "0.5855065", "text": "invalidate() {\n this._sourceCode = null;\n\n // TODO: T26134860 Caches present in Module are not used with experimental\n // caches, except for the one related to source code.\n if (this._experimentalCaches) {\n return;\n }\n\n this._readPromises.clear();\n this._readResultsByOptionsKey.clear();\n this._docBlock = null;\n this._hasteNameCache = null;\n }", "title": "" }, { "docid": "616c37592ee8ac837a5aa36920bc57f4", "score": "0.58486927", "text": "clear() {\n Storage.remove(key)\n }", "title": "" }, { "docid": "64e6ab88fd3e33932d6576e1342d5972", "score": "0.5847438", "text": "resetBatchKey() {\n this._batchKey = _doNotBatchKey;\n }", "title": "" }, { "docid": "5bd1aa2a479e7e5eea941a6fc1fed1c6", "score": "0.58453107", "text": "clearCache(cacheKey) {\n if (cacheKey in this.cache) {\n const prev = this.cache[cacheKey];\n this.cache[cacheKey] = DEFAULT_INITIAL_CACHE_STATE[cacheKey];\n return prev;\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "5bd1aa2a479e7e5eea941a6fc1fed1c6", "score": "0.58453107", "text": "clearCache(cacheKey) {\n if (cacheKey in this.cache) {\n const prev = this.cache[cacheKey];\n this.cache[cacheKey] = DEFAULT_INITIAL_CACHE_STATE[cacheKey];\n return prev;\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "99d4b866af3ea6934533178770ec8062", "score": "0.5837415", "text": "function _keyReset ()\n\t{\n\t\tvar i;\n\n\t\t_holding.length = 0;\n\t\t_holdShift = false;\n\t\t_holdCtrl = false;\n\t\t_holdAlt = false;\n\t\tfor ( i = 0; i < 256; i += 1 )\n\t\t{\n\t\t\t_pressed[ i ] = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "1ecf57939e0ef5a33b731955262a7689", "score": "0.58316267", "text": "function clearLocalStorage(key) {\n localStorage[key] = null;\n}", "title": "" }, { "docid": "f1e2d5490e9d10dbf804e55b0620de5c", "score": "0.58278143", "text": "clearCache() {\n this.cache = [];\n localStorage.removeItem(`state_${this.name}`);\n }", "title": "" }, { "docid": "b3d409b5efab07fe360ab48f709a97e8", "score": "0.58221495", "text": "function Reset () {}", "title": "" }, { "docid": "6cfa40974ae70c0c8b08d112155f139d", "score": "0.5812112", "text": "function clearCache() {\r\n clearCache = true;\r\n PersistentStorage.clear();\r\n}", "title": "" }, { "docid": "910cadd0503b4c08b9ab4fc04ba5c13b", "score": "0.5807939", "text": "reset() {\n this.lastFetchedVersion = 0;\n this.targetVersion = -1;\n this._resetPendingStateBundles();\n this.softReset();\n }", "title": "" }, { "docid": "b057d4a055ff62a5632c68ee64ec9ef2", "score": "0.58055496", "text": "clear() {\n this.logger.verbose(\"Clearing cache entries created by MSAL\"); // read inMemoryCache\n\n const cacheKeys = this.getKeys(); // delete each element\n\n cacheKeys.forEach(key => {\n this.removeItem(key);\n });\n this.emitChange();\n }", "title": "" }, { "docid": "3a23b84875ff98e37b2b95177dab0d92", "score": "0.57912326", "text": "function _reset() {\n var i;\n log.trace(\"-> reset\");\n log.debug(\"Resetting...\");\n window.clearTimeout(_timeout_id);\n window.clearTimeout(_keepalive_id);\n _request_queue = [];\n mc.replstore.clear_storage_queue();\n isReplicatingNow = false;\n _session_ended = true;\n _session_running = false;\n _calls_made = 0;\n _acked_calls = 0;\n _max_queue_length = 0;\n _waiting_on_storage = 0;\n _download_queue = [];\n _waiting_on_download = 0;\n _second_stage = false;\n _single_item = false;\n _have_restarted = false;\n _fast_lookup = false;\n _request_more = 0;\n _total_subjects = 0;\n _stored_items_count = 0;\n _send_only_part = false;\n for (i = 0; i < _outstanding_requests.length; i++) {\n _outstanding_requests[0].abort();\n }\n _outstanding_requests = [];\n _sync_database && _sync_database.refresh();\n _stop_keepalive();\n\n log.info(\"Reset.\");\n log.trace(\"<- reset\");\n }", "title": "" }, { "docid": "02a69f71bd12701bb32221c05d46911c", "score": "0.57910293", "text": "reset() {\n this._nextId = 1;\n this._ids = {};\n }", "title": "" }, { "docid": "02a69f71bd12701bb32221c05d46911c", "score": "0.57910293", "text": "reset() {\n this._nextId = 1;\n this._ids = {};\n }", "title": "" }, { "docid": "a8544f179dff58f716d0c680d70a648c", "score": "0.578251", "text": "clearCacheRestart() {\n\t\tFSBL.Clients.StorageClient.clearCache(function () {\n\t\t\tFSBL.restartApplication({ forceRestart: true });\n\t\t});\n\t}", "title": "" }, { "docid": "333cca6329d3bd1161f4be2dfb2a633a", "score": "0.5759591", "text": "function purgeEntireCache() {\n nodeCache = {};\n}", "title": "" }, { "docid": "7d27576d48d58c3dfde3e98a01c2b782", "score": "0.5749249", "text": "function reset() {\n resetRequests();\n}", "title": "" }, { "docid": "b8965b94ca22f42d615aa19dcfc5e045", "score": "0.574264", "text": "function reset()\n {\n localStorage.clear();\n }", "title": "" }, { "docid": "a217127fee373ea396c83d58fdc42a1c", "score": "0.5740966", "text": "function reset() {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "title": "" }, { "docid": "860a4fbd09de2a9718ce08a180e5b326", "score": "0.57403916", "text": "resetCache() {\n this._cache.inputs = {};\n this._cache.procedureParamNames = {};\n this._cache.procedureDefinitions = {};\n this._cache._executeCached = {};\n this._cache._monitored = null;\n this._cache.scripts = {};\n this._cache.compiledScripts = {};\n this._cache.compiledProcedures = {};\n this._cache.proceduresPopulated = false;\n }", "title": "" }, { "docid": "683426b8a47b6def41b6cf4edd42bd25", "score": "0.57360494", "text": "reset(){}", "title": "" }, { "docid": "c3fb35685889db9ca24a5e0b6d2c9142", "score": "0.57344854", "text": "static clearCache() {\n simpleCache.forEach((v, k) => {\n if (v.expires < +new Date()) {\n simpleCache.delete(k);\n }\n });\n }", "title": "" }, { "docid": "cef5b300d13f319fd9d4749c6f949c6b", "score": "0.57243353", "text": "function reset(){\n startTime = new Date();\n savedTime = 0;\n updateWatch(0,0,0);\n}", "title": "" }, { "docid": "d200744b0cbd372e33ff7415e0b94aae", "score": "0.57026285", "text": "function reset() {\n save(null);\n }", "title": "" }, { "docid": "e0a2e7be2ffcc66771cfc8fb6f8f1877", "score": "0.56997645", "text": "clear() {\n this[CACHE] = {};\n return this;\n }", "title": "" }, { "docid": "5d4ccdc75e9985887cb3dbb233807695", "score": "0.5676861", "text": "reset() {\n this.resetAccount();\n this.resetAuthentication();\n this.resetLocationData();\n }", "title": "" }, { "docid": "5f1153dd56bc64cce56d4c4540e527af", "score": "0.567094", "text": "reset() {\n let i, key;\n for (i = localStorage.length - 1; i >= 0; i--) {\n key = localStorage.key(i);\n if (key.indexOf(this.id + '.') !== -1) {localStorage.removeItem(key);}\n }\n }", "title": "" }, { "docid": "60e6bdd3ec2362158ce65350bf83914f", "score": "0.56697106", "text": "clear() {\n try {\n window.localStorage.removeItem(this.key);\n } catch(err) {\n // Do nothing.\n }\n }", "title": "" }, { "docid": "81388f6f5b11750532177c628c99baca", "score": "0.56671613", "text": "reset() {\n this.lastCalled = new Date().getTime();\n }", "title": "" }, { "docid": "81388f6f5b11750532177c628c99baca", "score": "0.56671613", "text": "reset() {\n this.lastCalled = new Date().getTime();\n }", "title": "" }, { "docid": "3b34257f622e78d911f77d6879efb6e7", "score": "0.56645656", "text": "function resetKeyGenerator() {\n n = 0;\n generate = function generate() {\n return \"\" + n++;\n };\n}", "title": "" }, { "docid": "d422d0331f66f18e34406a3252e5cf09", "score": "0.5657458", "text": "async clearKeyrings () {\n // clear keyrings from memory\n this.keyrings = []\n this.memStore.updateState({\n keyrings: [],\n })\n }", "title": "" }, { "docid": "48f0bc4a1e998d52063cfcdcfb0362bd", "score": "0.5644409", "text": "clear() {\n this[CACHE] = {};\n return this;\n }", "title": "" }, { "docid": "48f0bc4a1e998d52063cfcdcfb0362bd", "score": "0.5644409", "text": "clear() {\n this[CACHE] = {};\n return this;\n }", "title": "" }, { "docid": "0f1720ace3d0f801b7aa0289dc769a2c", "score": "0.5641897", "text": "function reset( ){\n\t}", "title": "" }, { "docid": "55231c7f16d16d06d66a9c9022d4b3e7", "score": "0.56414795", "text": "reset() {\n this._.number = null;\n this.isMine = false;\n this.state = CellState.unrevealed;\n }", "title": "" }, { "docid": "3a3f92402622461b969b63c15d69393c", "score": "0.5631705", "text": "reload() {\n this.clear();\n this.lastKey = 1;\n this.load();\n }", "title": "" }, { "docid": "931a8c4bc72a2ee7e0021e8dd2a102c5", "score": "0.5624708", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "5fb1f99b07b7bb3792a554067bd5c858", "score": "0.56236863", "text": "function reset() {\n kisses = 0;\n happiness = 0;\n money = 0;\n love = 0;\n girlfriends = 0;\n updateKisses();\n updateHappiness();\n updateMoney();\n updateLove();\n updateGirlfriends();\n resetDateChance();\n localStorage.removeItem(\"kisses\");\n localStorage.removeItem(\"happiness\");\n localStorage.removeItem(\"money\");\n localStorage.removeItem(\"love\");\n localStorage.removeItem(\"girlfriends\");\n localStorage.removeItem(\"dateChance\");\n}", "title": "" }, { "docid": "875afbdfdb2bad73b88bdc8ba5c35846", "score": "0.56200165", "text": "function mapCacheClear() {\n this.__data__ = {\n hash: new Hash(),\n map: new (Map || ListCache)(),\n string: new Hash(),\n };\n }", "title": "" }, { "docid": "875afbdfdb2bad73b88bdc8ba5c35846", "score": "0.56200165", "text": "function mapCacheClear() {\n this.__data__ = {\n hash: new Hash(),\n map: new (Map || ListCache)(),\n string: new Hash(),\n };\n }", "title": "" }, { "docid": "bb9a29a6a1610e50c8e3ac0cc9bd3427", "score": "0.561953", "text": "reset() {\n firstTime = -1;\n previousTime = -1;\n }", "title": "" }, { "docid": "7390261772898beaf5df2586321c0709", "score": "0.56142867", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "title": "" }, { "docid": "11dd47f2f4443e11d9457e1819fa7d52", "score": "0.5611698", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n hash: new Hash(),\n map: new (Map || ListCache)(),\n string: new Hash(),\n };\n }", "title": "" }, { "docid": "ab6b4d051158191b3464310cf72b54ee", "score": "0.5609791", "text": "reset() {\n if (this.resetTimeout) {\n clearTimeout(this.resetTimeout);\n }\n\n this.clearTimeout = null;\n this.buffer = [];\n }", "title": "" }, { "docid": "9d77c44536ae18479d8d8b4eff07ee96", "score": "0.5598046", "text": "function resetTimer()\n {\n clearInterval(_intervalID);\n _currentTime = seed;\n }", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.55954456", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.55954456", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.55954456", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.55954456", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.55954456", "text": "reset() {}", "title": "" } ]
333b60d47a34383e578bedb3e42fadd6
as original (it will have external links to the Dervent Monastery website)
[ { "docid": "3fc15af821b4df46b081e998d660d4ed", "score": "0.0", "text": "function Note(chapterId, versetNumber, letter, text)\n{\n\tthis.chapterId = chapterId;\n\tthis.versetNumber = versetNumber;\n\tthis.letter = letter;\n\tthis.text = text;\n}", "title": "" } ]
[ { "docid": "77a1194ff0cb4748de13826d1877d2b1", "score": "0.6123412", "text": "function convert_urls(){\n\t\t\n\t\tdescriptions = $(document).find('.description').each(function(){\n\t\t\t\n\t\t\t$this = $(this);\n\t\t\t\n\t\t\t\n\t\t\tif($this.is(':input')){\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\ttext = $this.text().replace(/\\(?(?:(http|https|ftp):\\/\\/)?(?:((?:[^\\W\\s]|\\.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\\W\\s]|\\.|-)+[\\.][^\\W\\s]{2,4}|localhost(?=\\/)|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})(?::(\\d*))?([\\/]?[^\\s\\?]*[\\/]{1})*(?:\\/?([^\\s\\n\\?\\[\\]\\{\\}\\#]*(?:(?=\\.)){1}|[^\\s\\n\\?\\[\\]\\{\\}\\.\\#]*)?([\\.]{1}[^\\s\\?\\#]*)?)?(?:\\?{1}([^\\s\\n\\#\\[\\]]*))?([\\#][^\\s\\n]*)?\\)?/gi, function(url){\n\t\t\t\t\t\t\t\t\t\n\t\t var full_url = url;\n\t\t if (!full_url.match('^https?:\\/\\/')) {\n\t\t full_url = 'http://' + full_url;\n\t\t }\n\t\t return '<a href=\"' + full_url + '\">' + url + '</a>';\n\t\t }\n\t\t ); \n\t\t\t$this.html(text);\t\n\t\t\t}\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "645c67f1489a3f91bbda1a1882c64dde", "score": "0.6114462", "text": "function sanearEnlaces(){\r\n\t\tvar a = find(\"//a[@href='#']\", XPList);\r\n\t\tfor (var i = 0; i < a.snapshotLength; i++) a.snapshotItem(i).href = 'javascript:void(0)';\r\n\t}", "title": "" }, { "docid": "a592bd614bec580bf607c7067c5aef58", "score": "0.6075502", "text": "function ajdustLinks(){\r\n\t\tvar a = find(\"//a[@href='#']\", XPList);\r\n\t\tfor (var i = 0; i < a.snapshotLength; i++) a.snapshotItem(i).href = 'javascript:void(0)';\r\n\t}", "title": "" }, { "docid": "73c1a5355697851193075875ad14101f", "score": "0.601731", "text": "function /** string */ getOriginalLink(/** string */ html) {\r\n const [, link] = html.match(/<!-- saved from url=\\(\\d+\\)(.+?) -->/) || [];\r\n return link? link : '';\r\n}", "title": "" }, { "docid": "c7f0b02622bece5452c3309094077b5e", "score": "0.60163766", "text": "function FixWikiLinks()\r\n{\r\n var links = document.getElementsByTagName(\"a\");\r\n var reu = /^http:\\/\\/wiki.erepublik.com\\/index.php\\/(Citizen|Company|Country|Newspaper|Party|Region)_/;\r\n for (x in links)\r\n {\r\n if (!reu.test(links[x].href)) continue;\r\n var newhref;\r\n if (/\\/Region_/.test(links[x].href)) newhref = \"http://wiki.erepublik.com/index.php/\" + document.title.replace(\"eRepublik Region | \",\"\");\r\n else newhref = links[x].href.replace(reu,\"http://wiki.erepublik.com/index.php/\");\r\n links[x].href = newhref.replace(/\\s|%20/g,\"_\").replace(/^\\s*|\\s*$/g,\"\"); //clean up the wiki link\r\n }\r\n}", "title": "" }, { "docid": "cdab4c6fd80b8058578d1f26f7116d62", "score": "0.5995034", "text": "function captureLinkHref(){var lc=new Image;this.parent=this.parentNode;lc.src=cu+\"&v_externalLinkClick=\"+escape(this.href)+\"&v_fromLocation=\"+escape(document.location)+\"&cd=\"+new Date().getTime();return true}", "title": "" }, { "docid": "3b7c7395552b4d539e8d310606a6df1a", "score": "0.5924552", "text": "function shortenUrl(url){\n\tif (url.indexOf('ttp:'))\n\t\turl = url.replace(\"http://www.genscript.com\",\"\");\n\tif (url.indexOf('ttps:'))\n\t\turl = url.replace(\"https://www.genscript.com\",\"\");\n\treturn url;\n\n}", "title": "" }, { "docid": "01bbefca3f6072113618f7909b218c72", "score": "0.5910106", "text": "function Site(v){\r\n v=v.replace(/^http:\\/\\/?/,\"\")\r\n dominio=v\r\n caminho=\"\"\r\n if(v.indexOf(\"/\")>-1)\r\n dominio=v.split(\"/\")[0]\r\n caminho=v.replace(/[^\\/]*/,\"\")\r\n dominio=dominio.replace(/[^\\w\\.\\+-:@]/g,\"\")\r\n caminho=caminho.replace(/[^\\w\\d\\+-@:\\?&=%\\(\\)\\.]/g,\"\")\r\n caminho=caminho.replace(/([\\?&])=/,\"$1\")\r\n if(caminho!=\"\")dominio=dominio.replace(/\\.+$/,\"\")\r\n v=\"http://\"+dominio+caminho\r\n return v\r\n}", "title": "" }, { "docid": "b2c5104abd7af70baf1f499f64b899d3", "score": "0.58638996", "text": "function immatureUrl() {\n\t\t\tif(this.nodeType==3) {\n\t\t\t\tvar text = $(this).text();\n\t\t\t\ttext = text.replace(regex_part_url, function(match, p1, p2, p3) {\n\t\t\t\t\tvar url = 'ht'+p1+p2+p3;\n\t\t\t\t\treturn '<a href=\"'+url+'\" title=\"'+url+'\">'+match+'</a>';\n\t\t\t\t});\n\t\t\t\t$(this).before(text);\n\t\t\t\t$(this).remove();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "d4b3d892013e32ec883951f916f9771d", "score": "0.58617145", "text": "function simpleUrlWrapper(content){\n\t\n\tvar urlList = parseMoreInfoUrl(content);\n\t\n\tvar url = urlList[0];\n\tvar aliasName= content.indexOf(\";\")!=-1 ? urlList[1] : urlList[0];\n\t\n\treturn \"<a href=\"+url+\" target='_blank'>\"+aliasName+\"</a>\";\n}", "title": "" }, { "docid": "8e261a6da496f960802f6c4e16b68dac", "score": "0.5825181", "text": "function userLinksMod(){\n userLinks=userLinks.replace(\"https://\", \"\");\n userLinks=userLinks.replace(\"http://\", \"\");\n userLinks=userLinks.replace(\"www.\", \"\");\n site=userLinks; \n//replace dots\n if(userLinks.includes(\".\")){\n userLinks=userLinks.replace(/\\./g, \"\\\\.\");\n userLinks=userLinks.replace(/\\//g, \"\\\\/?\");\n}\n}", "title": "" }, { "docid": "cbf10ef2025533f59a32b95f424dbe4f", "score": "0.5824986", "text": "function getOriginalLink() {\n var originalLink = $('.originallink a').attr('href'),\n pos = originalLink.lastIndexOf('/');\n\n return originalLink.substr(0, pos);\n }", "title": "" }, { "docid": "9afdd6c6a0675e067095dc6a733a0ab3", "score": "0.5823928", "text": "function urls2links(element) {\n var re = /((http|https|ftp):\\/\\/[\\w?=&.\\/-;#@~%+-]+(?![\\w\\s?&.\\/;#~%\"=-]*>))/ig;\n element.html(element.html().replace(re,'<a href=\"$1\" rel=\"nofollow\">$1</a>'));\n var re = /((magnet):[\\w?=&.\\/-;#@~%+-]+)/ig;\n element.html(element.html().replace(re,'<a href=\"$1\">$1</a>'));\n}", "title": "" }, { "docid": "c8b63c3d57ae1b747c064421678eb6db", "score": "0.5821897", "text": "static makeURL (text) {\n if (!ESV.isApocryphal(text)) {\n var shortener = /†.*$/\n var shortenedText = text.replace(shortener, '').trim()\n var link = 'http://esv.to/' + shortenedText\n return link\n }\n return ''\n }", "title": "" }, { "docid": "e00c8ab709753e0b661c41a7e49b65be", "score": "0.5784995", "text": "function replaceRepoImageLink(text) {\n var prefix = '';\n if(gtpb.site_app.baseurl && gtpb.site_app.baseurl.replace(/\\/$/,'') !== location.origin){\n prefix = gtpb.site_app.baseurl;\n }\n\t this.input.value = encodeURI(prefix + '/' + text);\n }", "title": "" }, { "docid": "7c6653e80a373305f365365cdf0893ab", "score": "0.57688993", "text": "function fixLink(s) {\n if (s.substr(0, 19) != \"https://blackboard.\")\n s = bbDomain + s;\n return s;\n}", "title": "" }, { "docid": "cd2c6a6145fec39914900f1f9a0ff5a6", "score": "0.57611525", "text": "function changeSrc()\r\n{\r\n\tif (document.layers)\r\n\t{\r\n\t\tfor (i=0;i<document.links.length;i++)\r\n\t\t{\r\n\t\t\tisHelpLink = (-1 != document.links[i].href.indexOf(\"help\"));\r\n\t\t\tif (isHelpLink)\r\n\t\t\t\tdocument.links[i].href = slink;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3e06f0ae38f3d6d689af84fa5f944b42", "score": "0.5750727", "text": "function ld(a,b){s(\"jilion.sublime.video.sites\",r(this.uh,this));this.Re=location.hostname;this.mf=location.pathname;this.G=b;var c=this.G.Ed,d=document.getElementsByTagName(\"head\")[0];this.Gc=document.createElement(\"script\");this.Gc.type=\"text/javascript\";this.Gc.src=c+\"/l/\"+a+\".js\";d.appendChild(this.Gc)}", "title": "" }, { "docid": "cc8989edf077a765054891a456323b48", "score": "0.5739651", "text": "html(html){\n return html\n .replace(\"<!-- more -->\", \"<hr class='more' />\")\n .replace(/https?:\\/\\/[0-9\\.]+media\\.tumblr\\.com\\/[^ \\\"]+/g, this.replaceFile.bind(this));\n }", "title": "" }, { "docid": "86ab0fd681cb6aafd4416ad31f7351a8", "score": "0.5704156", "text": "function replaceUrls(){\t\r\n\tlinks = document.getElementsByTagName(\"A\");\t\r\n\tif(links!=null){\r\n\t\tfor(i=0;i<links.length;i++){\r\n\t\t\ta = links[i]; \r\n\t\t\turl = a.href;\r\n\t\t\ta.href = url.replace(/.+?(\\?|\\&)(url|u)=(.+)/g, \"$3\");\r\n\t\t}\t\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "3d49737c78bf769c06e79b770b232a18", "score": "0.56980884", "text": "static getLink(link) {\n\t\tif (!SmartWidgets.isNewSite() || !link || link == '') {\n\t\t\treturn link;\n\t\t}\n\t\treturn window.location.pathname + link.replace('/grapher.cgi?', '?');\n\t}", "title": "" }, { "docid": "11f2653e65c9471b9939b4fb4275fbe8", "score": "0.5683892", "text": "function getFromWebtoons(url){\n \n}", "title": "" }, { "docid": "51f8b341d6cd4ee42151204435865424", "score": "0.5680764", "text": "function proxify() {\r\n\t// proxifies all links\r\n\tproxifyCollection('//a[contains(@href, \"mangareader.net\")]', 'href');\r\n\t// proxifies all images\r\n\tproxifyCollection('//img[contains(@src, \"mangareader.net\")]', 'src');\r\n}", "title": "" }, { "docid": "fa1ab431ba93b4e89d57c82134dc50c9", "score": "0.5664671", "text": "function changeHtmlLinks() {\n /* Get the target attribute for each <a></a> tag */\n var $ = cheerio.load(item.techops.getHTML(item));\n var links = $('a').get();\n\n /* If there aren't any links in the item then return */\n if (links.length === 0) {\n callback(null, course, item);\n return;\n }\n\n links.forEach(link => {\n var oldUrl = '';\n /* Assign the oldUrl name for logging purposes */\n if ($(link).attr('href')) {\n oldUrl = $(link).attr('href');\n }\n\n /* Check if the link has an href, and if it is already the correct href */\n if ($(link).attr('href') &&\n $(link).attr('href').includes('content.byui.edu/file/') &&\n !$(link).attr('href').includes('content.byui.edu/integ/gen/')) {\n var tempUrl = $(link).attr('href');\n tempUrl = tempUrl.replace(/\\/file\\//i, '/integ/gen/');\n tempUrl = tempUrl.replace(/\\/\\d+\\//i, '/0/');\n\n /* Set new href to the new URL */\n $(link).attr('href', tempUrl);\n\n /* Log it to the console and our report */\n item.techops.log(`${item.techops.type} - Equella link updated to /integ/gen/`, {\n 'Title': item.techops.getTitle(item),\n 'ID': item.techops.getID(item),\n 'URL': tempUrl,\n 'Old URL': oldUrl,\n });\n }\n });\n\n /* Set the new html of the put item */\n item.techops.setHTML(item, $.html());\n\n /* Next item or grandchild module */\n callback(null, course, item);\n }", "title": "" }, { "docid": "c284fd12246c703db5fced6ab521ee6c", "score": "0.566447", "text": "localReferenceLinks() {\n // map over all items\n return [...this.content.matchAll(LOCAL_REFERENCE_LINK_REGEX)]\n // get the actual captured part (the url)\n .map(link => link[1])\n // get the full name for that file\n .map(link => ({\n original: link, \n resolved: path.join(this.dirname, link)\n }))\n }", "title": "" }, { "docid": "4224d5093a27962d4585006550cb762f", "score": "0.5662709", "text": "function yaploud_new_url(evt) {\r\n\r\n\tvar winWrapper = new XPCNativeWrapper(content, \"doc\");\r\n\tvar mainDocument = new XPCNativeWrapper(winWrapper.document, \"top\");\r\n\tif (mainDocument.location != \"\" && mainDocument.location != \"about:blank\") {\r\n\t\tyaploud_enableButtons();\r\n\t\tyaploud_getYappers();\r\n\t} else {\r\n\t\tyaploud_disableButtons();\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "196376e2ede15d987240af359106a6ed", "score": "0.56615055", "text": "function JavaScript_Embed()\n {\n $hostUrl = localStorage.getItem('hostURL');\n $subSiteUrl = localStorage.getItem('subSiteURL');\n if($hostUrl !== $subSiteUrl)\n $currentUrl = $subSiteUrl;\n else\n $currentUrl = $hostUrl;\n\n // console.log($currentUrl);\n getClassifier();\n }", "title": "" }, { "docid": "c4008f2e394a366a71d0636a63ae06a2", "score": "0.56486", "text": "function analyseLink(url) {\n\tif(url.indexOf(\"www.yourfanfiction.com\") != -1)\n\t\tthis.websiteName = \"YourFanfiction\";\n\treturn this.websiteName;\n}", "title": "" }, { "docid": "7d2e3417e00563aee488480f1c424342", "score": "0.56434065", "text": "function fixRelativeLinks($node) {\r\n\t$node.find(\"a, img, imghidden\").each(function() {\r\n\t\tvar href = $(this).attr(\"href\");\r\n\t\tvar src = $(this).attr(\"src\");\r\n\t\tif (href && href.indexOf(\"/\") == 0) {\r\n\t\t\t$(this).attr(\"href\", \"https://mail.google.com\" + href);\r\n\t\t\t// these are hosted on mail.google.com so the are safe to show\r\n\t\t\tif ($(this).get(0).tagName == \"IMGHIDDEN\") {\r\n\t\t\t\t$(this).changeNode(\"img\");\r\n\t\t\t}\r\n\t\t} else if (src && src.indexOf(\"/\") == 0) {\r\n\t\t\t$(this).attr(\"src\", \"https://mail.google.com\" + src);\r\n\t\t\t// these are hosted on mail.google.com so the are safe to show\r\n\t\t\tif ($(this).get(0).tagName == \"IMGHIDDEN\") {\r\n\t\t\t\t$(this).changeNode(\"img\");\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "a944fc67a96d8031a4a882a9d5a5e3a9", "score": "0.5635551", "text": "getURL() {}", "title": "" }, { "docid": "a2e00635e3655da906c263c827e831b4", "score": "0.5635157", "text": "function get_main_url() {\n // static website\n return 'http://localhost/quark';\n // return 'https://quark.cloud9gaminghub.com';\n // return 'http://cloud9quark-env.eba-itzikvx2.us-east-2.elasticbeanstalk.com';\n}", "title": "" }, { "docid": "bf245546c0a8ef4f2bb8b52908b043f9", "score": "0.5631261", "text": "link () {\n\t this._attachments = this._sbolDocument.lookupURIs(this._attachments);\n\t this._wasGeneratedBys = this._sbolDocument.lookupURIs(this._wasGeneratedBys);\n\t}", "title": "" }, { "docid": "eff187e92977e05c9c01a817b743cdf1", "score": "0.56288797", "text": "function linkURL(photo) {\t\n \treturn \"http://www.flickr.com/photos/\" + photo.owner + \"/\" + photo.id;\n}", "title": "" }, { "docid": "0ddfe5129ce5a7a6a276e9775140d8fc", "score": "0.5623925", "text": "localLinks() {\n // map over all items\n return [...this.content.matchAll(LOCAL_LINK_REGEX)]\n // get the actual captured part (the url)\n .map(link => link[1])\n // get the full name for that file\n .map(link => ({\n original: link, \n resolved: path.join(this.dirname, link)\n }))\n }", "title": "" }, { "docid": "abd22ed663ad46275c8be8e0c6fc0776", "score": "0.5616573", "text": "function tooYoung() {\n window.location.replace('https://disneyland.disney.go.com/');\n}", "title": "" }, { "docid": "0ce8b875519a61fb7c71079b181a22d4", "score": "0.56164724", "text": "function link_helper(){\n\t\t\tvar domain = document.domain;\n\t\t\t$('a').each(function(){\n\t\t\t\tvar link = $(this);\n\t\t\t\tvar href = link.attr('href'); \n\t\t\t\tif ( href && href.indexOf(domain) == -1 && href.indexOf('/') != 0 && href.indexOf('//') != 0 && href.indexOf('#') != 0 ) {\n\t\t\t\t\tlink.attr('target',(link.attr('target')||'_blank'));\n\t\t\t\t\tlink.attr('rel',(link.attr('rel')||'nofollow'));\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "53e59fe5a601cf9f27c402dd805425dd", "score": "0.5615143", "text": "function replaceLinks() //This will find Wikia links and 'Archive.org'-ify them\r\n{\r\nvar Links = document.getElementsByTagName(\"a\"); //'Links' is now an array of all link elements on the page\r\n for (var i = 0; i < Links.length; i++) //for all the items in the array ...\r\n { \r\n if (Links[i].hasAttribute(\"href\")) //and if it has such an 'href' attribute to later change ...\r\n {\r\n var hrefValue = Links[i].getAttribute(\"href\"); //Let 'hrefValue' be what 'href' contains\r\n if (hrefValue.contains(\"wikia.\")) //if it has this string in it, it's probably a link to a wikia page, so...\r\n {\r\n if (hrefValue.contains(\"web.archive.org/web/\") == false) //if it has this string in it, it has already been 'Archive.org'-ified\r\n {\r\n //alert(hrefValue) //CHECK THE LINKS THAT ARE BEING CHANGED\r\n Links[i].setAttribute(\"href\", \"http://web.archive.org/web/\" + hrefValue)\r\n //alert(hrefValue)//CHECK THE LINKS AFTER CHANGE\r\n }\r\n }\r\n }\r\n }\r\n}//closefunction", "title": "" }, { "docid": "be17f834127bff9b418351a695a31977", "score": "0.56134427", "text": "function addlinks(data) {\n\t\t\t\t\t\t//Add link to all http:// links within tweets\n\t\t\t\t\t\t data = data.replace(/((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g, function(url) {\n\t\t\t\t\t\t\treturn '<a target=\"_blank\" href=\"'+url+'\" >'+url+'</a>';\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t//Add link to @usernames used within tweets\n\t\t\t\t\t\tdata = data.replace(/\\B@([_a-z0-9]+)/ig, function(reply) {\n\t\t\t\t\t\t\treturn '<a href=\"http://twitter.com/'+reply.substring(1)+'\" style=\"font-weight:lighter;\" target=\"_blank\">'+reply.charAt(0)+reply.substring(1)+'</a>';\n\t\t\t\t\t\t});\n\t\t\t\t\t\t//Add link to #hastags used within tweets\n\t\t\t\t\t\tdata = data.replace(/\\B#([_a-z0-9]+)/ig, function(reply) {\n\t\t\t\t\t\t\treturn '<a href=\"https://twitter.com/search?q='+reply.substring(1)+'\" style=\"font-weight:lighter;\" target=\"_blank\">'+reply.charAt(0)+reply.substring(1)+'</a>';\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}", "title": "" }, { "docid": "366e89945718bc24647929be5bc84104", "score": "0.5592191", "text": "function gettechURL(contentTitle) {\r\n var str = formatURL();\r\n var newTitle = encodeURIComponent(contentTitle != \"\"? contentTitle : document.title.toString());\r\n news1 = \"http://technorati.com/search/\"+'\"'+newTitle+'\"';\r\n\t window.open(news1,\"_blank\");\r\n return true; \r\n}", "title": "" }, { "docid": "454c3e40e7f3fe237421fce75404ccc1", "score": "0.55842125", "text": "function print_SRClink(object){\n if (version >= 3)\n {\n var unpCookie = '/cgi-bin/srclink?object=' + escape(object);\n var url = unpCookie;\n document.write ('<li><font face=\"Arial, Helvetica\" size=2>Find other ');\n document.write (anchor2.link(url));\n document.write (' for this article.</font></li>');\n }\n else\n {\n document.writeln();\n } \n}", "title": "" }, { "docid": "f681f834fd66f734bf6e9b3a2f434d49", "score": "0.55788445", "text": "function displayURL() {\n displayMain(sURL());\n}", "title": "" }, { "docid": "ac25074cbaabcfa4bdb828edb84119cd", "score": "0.557753", "text": "function getFullURL(){return /https?:\\/\\/([^\\/]+)/i.exec(document.URL)[1];}", "title": "" }, { "docid": "f07bb4d4d77156c18e0c7e5fe3bb4f78", "score": "0.55744785", "text": "static get web() { return \"https://gofile.io/\"; }", "title": "" }, { "docid": "c002c0f23c6caf982288af98df587789", "score": "0.5573136", "text": "function fixUrl( inUrl ) \n\t{\n\t\tif(inUrl.indexOf(\"http\")<0)\n\t\t{\n\t\t\treturn base+inUrl; // omarsh\n\t\t}\n\t\treturn inUrl;\n\t\t\n\t}", "title": "" }, { "docid": "757e5c4b99fe222f543154944ff94479", "score": "0.55728716", "text": "function updateHref(){\n\tif(page.url.indexOf('?from=') != -1) window.history.replaceState(null, 'ushio', page.url.substr(0, page.url.indexOf('?from=')));\n\tif(page.url.indexOf('&from=') != -1) window.history.replaceState(null, 'ushio', page.url.substr(0, page.url.indexOf('&from=')));\n\tvar links = $(document).find(\"a\");\n\tfor(var index in links) {\n\n\t\tvar _href = links.eq(index).attr(\"href\");\n\t\tvar _id = (links.eq(index).attr(\"id\"));\n\n\t\tif(_id) _id = _id.substr(0, 5);\n\n\t\tif(_href != null) {\n\t\t\tif(_href.indexOf(\"?\") == -1 && _id == \"ushio\") links.eq(index).attr(\"href\",_href + ((page.host) ? (\"?from=https://\"+page.host) : \"\"));\n\t\t\telse if(_id == \"ushio\") links.eq(index).attr(\"href\",_href + ((page.host) ? (\"&from=https://\"+page.host) : \"\"));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "144d39a496df4e7bd53858b7d3321385", "score": "0.55657995", "text": "putWebsite() {\n if (this.props.project.website) {\n return <span><a href={this.props.project.website} target=\"_blank\" rel=\"noopener noreferrer\">Website</a> ◆ </span>;\n }\n }", "title": "" }, { "docid": "b97bb62ff8ae6f81e983e1e534461300", "score": "0.5555996", "text": "function deliciousgoogle_addLink(link, rebuild) {\r\n var u = encodeURIComponent(link.href);\r\n var srcLink = $(link);\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: 'https://'+username+'@api.del.icio.us/v1/posts/'+\r\n 'get?url='+u,\r\n onload: function(response) {\r\n var parser = new DOMParser();\r\n var doc = parser.parseFromString(response.responseText,\r\n 'text/xml');\r\n var posts = doc.getElementsByTagName(\"post\");\r\n // go down so the first result is first after srcLink\r\n for (var j = posts.length - 1; j >= 0; j--) {\r\n var hash = posts[j].attributes.getNamedItem('hash').value;\r\n srcLink.after(\"<a href='http://delicious.com/url/\"+hash+\r\n \"'><img src='http://delicious.com/favicon.ico' \"+\r\n 'style=\"padding: 3px; margin-bottom: -5px;\" border=\"0\"'+\r\n '/></a>');\r\n }\r\n\r\n if (rebuild) {\r\n $('a.l').each(function (i) {\r\n if (i > 0) {\r\n deliciousgoogle_addLink(this, false);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "91b1478490d80a317ea527ce8ead2a88", "score": "0.55554247", "text": "function fixRelativeLinks($node) {\r\n\t$node.find(\"a, img, imghidden\").each(function() {\r\n\t\tvar href = $(this).attr(\"href\");\r\n\t\tvar src = $(this).attr(\"src\");\r\n\t\tif (href && href.indexOf(\"/\") == 0) {\r\n\t\t\t$(this).attr(\"href\", MAIL_DOMAIN + href);\r\n\t\t\t// these are hosted on mail.google.com so the are safe to show\r\n\t\t\tif ($(this)[0].tagName == \"IMGHIDDEN\") {\r\n\t\t\t\t$(this).changeNode(\"img\");\r\n\t\t\t}\r\n\t\t} else if (src && src.indexOf(\"/\") == 0) {\r\n\t\t\t$(this).attr(\"src\", MAIL_DOMAIN + src);\r\n\t\t\t// these are hosted on mail.google.com so the are safe to show\r\n\t\t\tif ($(this)[0].tagName == \"IMGHIDDEN\") {\r\n\t\t\t\t$(this).changeNode(\"img\");\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "b2993c5cde339b3ee947b1b203a60116", "score": "0.55436605", "text": "function externalLinks(){\n\t $('a.ext, .ext a').each(function() {\n if ($(this).attr('title') !== undefined && $(this).attr('title') !== \"\") {\n var extTitle = $(this).attr('title');\n $(this).attr('title', extTitle + ' (opens in a new window)');\n } else {\n $(this).attr('title', 'This link will open in a new window');\n }\n }).bind({\n 'click':function() { window.open($(this).attr('href')); return false; },\n 'keypress':function(e) { if (e.keyCode == 13){window.open($(this).attr('href')); return false;} }\n });\n}", "title": "" }, { "docid": "02d6ff2f689d7a0024de408ce536af7f", "score": "0.5542344", "text": "function _findCanonical() {\n var tiny, link, doc;\n doc = jetpack.tabs.focused.contentDocument;\n if(tiny = $(\"link[rev='canonical']\", doc).attr(\"href\"))\n link = tiny;\n else if(tiny = $(\"link[rel='shorturl']\", doc).attr(\"href\"))\n link = tiny;\n else if(_links[jetpack.tabs.focused.url])\n link = _links[jetpack.tabs.focused.url]; // We've already fetched this url once\n else\n link = _defaultMessage;\n\n $(_domLink).text(link);\n}", "title": "" }, { "docid": "dafc3efdedcd1eec1c48bdd959e70fae", "score": "0.5532674", "text": "function mdlinks() {\n mdlinks = mdlinks\n}", "title": "" }, { "docid": "5c2ff9526ad97c0a3d9235d438c1b27e", "score": "0.5526352", "text": "function collectWebItemData() {\n var linkTitle = (document.title);\n var linkLocation = (window.location);\n var selectedText = '';\n\n if (window.getSelection) {\n selectedText = window.getSelection();\n } else if (document.getSelection) {\n selectedText = document.getSelection();\n } else if (document.selection) {\n selectedText = document.selection.createRange().text;\n }\n webItem.url = linkLocation.toString();\n webItem.title = linkTitle.toString();\n webItem.content = selectedText.toString();\n }", "title": "" }, { "docid": "f90fc7cf4d8ac28aee2887597dbff509", "score": "0.5514682", "text": "function convertToGeoRiotLinks(tsid) {\n var numberOfLinks = document.links.length;\n var currentLinkIndex = 0;\n\n for (currentLinkIndex = 0; currentLinkIndex < numberOfLinks; currentLinkIndex++) {\n var currentLink = document.links[currentLinkIndex];\n var linkType = getLinkType(currentLink.href);\n\n if (linkType == \"amazon\") {\n currentLink.href = \"http://target.georiot.com/Proxy.ashx?TSID=\" + tsid + \"&GR_URL=\" + encodeURIComponent(currentLink.href);\n } else continue;\n }\n }", "title": "" }, { "docid": "ad42c6e09109edba044eab42c6ffc77b", "score": "0.55135906", "text": "function google_search_fix(){\n jQuery('#txnEdit-toggle').on('click', function(){\n // get the text; don't try decoding the partial original search link\n plain_search = jQuery('a.desc_link strong var').text();\n\n // proper encoding\n new_search = encodeURIComponent(plain_search);\n\n // encoding changes spaces to %20, but that is deprecated now. urls take '+' instead.\n new_search = new_search.replace(/%20/gi, '+');\n\n // replace old url with new\n jQuery('a.desc_link').attr('href', 'https://www.google.com/#q=' + new_search);\n });\n }", "title": "" }, { "docid": "12087892595eb8303a1f17e83057f6f6", "score": "0.55080134", "text": "function addlinks(data) {\n //Add link to all http:// links within tweets\n data = data.replace(/((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g, function(url) {\n return '<a href=\"'+url+'\" >'+url+'</a>';\n });\n \n //Add link to @usernames used within tweets\n data = data.replace(/\\B@([_a-z0-9]+)/ig, function(reply) {\n return '<a href=\"http://twitter.com/'+reply.substring(1)+'\" style=\"font-weight:lighter;\" >'+reply.charAt(0)+reply.substring(1)+'</a>';\n });\n return data;\n }", "title": "" }, { "docid": "7797bd0ed12e56db0d87afab0b19fbf6", "score": "0.5497628", "text": "function updatePage() {\n var links = document.querySelectorAll(\"a\");\n\n for (var i = 0; i < links.length; ++i) {\n var link = links[i].getAttribute('href');\n\n // check if each link is a commentface\n if (link != null && link[0] == '#') {\n var source = checkLink(link);\n\n if (source != null) {\n // create an element to display the source\n var div = document.createElement(\"div\");\n div.className = \"tooltip-content\";\n\n div.innerHTML = source;\n\n // add the sites that are available\n var sites = getSites(source);\n if (sites != null) {\n var sitesDiv = createSitesDiv(sites);\n div.appendChild(sitesDiv);\n }\n\n // appends the element to the parent of the image and\n // updates the class so that it displays the source when hovered\n var parent = links[i].parentNode;\n parent.className += \" tooltip-wrap\";\n parent.appendChild(div);\n }\n }\n }\n}", "title": "" }, { "docid": "6def31d5f0d5655788b09ff106215c10", "score": "0.5497272", "text": "function tweakURL(){\n\tif(this.value.indexOf('http') != 0 && this.value != '')\n\t\tthis.value = 'http://' + this.value;\n}", "title": "" }, { "docid": "ecf0c493e9944fa194680eac362133b9", "score": "0.5488231", "text": "function webpagelink(text) {\n results = text.split(\"|\");\n size = results.length;\n if (size == 0)\n return text;\n\n // page link\n src = results[0];\n\n // link text\n desc = \"\";\n if (size > 1)\n desc = results[1];\n else\n desc = src;\n // is our text an image?\n patterns = \"/{{(.^{*)}}/\";\n replacements = \"\\\"+image( \\\"$1\\\" )+\\\"\";\n cmd = (\" \\desc = \\\"\" + desc.preg_replace(patterns, replacements) + \"\\\";\");\n eval(cmd);\n\n // link target \n window = \"\";\n if (size > 2)\n window = results[2];\n else\n if (config.MISC.EXTERNALLINKS_NEWWINDOW)\n window = \"_blank\";\n else\n window = \"_self\";\n\n // see whether it is a Wiki Link or not\n prefix = src.split(\"/\");\n if ((prefix.length == 1)) // looks like a local file, an anchor link or a wikipage\n {\n if (pageExists(src)) // is it a wiki page\n {\n src = _SERVER.SCRIPT_NAME + \"?page=\" + src;\n window = \"_self\";\n resultstr = \"<a href=\\\"\" + src + \"\\\" onclick=\\\"target='\" + window + \"';\\\">\" + desc + \"</a>\";\n }\n else if (src[0] == \"#\") // maybe its an anchor link\n {\n window = \"_self\";\n resultstr = \"<a href=\\\"\" + src + \"\\\" onclick=\\\"target='\" + window + \"';\\\">\" + desc + \"</a>\";\n }\n else if (config.SYNTAX.AUTOCREATE) // maybe autolink\n {\n search_for_dot = src.indexOf(\".\"); // don't support names with dots in - prevents creating executable scripts\n if (search_for_dot < 0)\n resultstr = (src + \"<a href=\\\"\" + _SERVER.SCRIPT_NAME + \"?page=\" + src + \"\\\" onclick=\\\"target='\" + window + \"';\\\">?</a>\");\n else\n resultstr = src;\n }\n else\n resultstr = desc;\n }\n else {\n resultstr = \"<a href=\\\"\" + src + \"\\\" onclick=\\\"target='\" + window + \"';\\\">\" + desc + \"</a>\";\n }\n return verbatim(resultstr);\n}", "title": "" }, { "docid": "4e61c8dc0059cb215087fa5bf46a8046", "score": "0.54860353", "text": "function autoLinkUrls(txt) {\n return txt.replace(/(^|\\s)(https?|ftp)(:[^'\">\\s]+)/gi,\n \"$1<a target=\\\"_blank\\\" href=\\\"$2$3\\\">$2$3</a>\");\n }", "title": "" }, { "docid": "252d5136544d30b9ae4b66e1a4426200", "score": "0.5484901", "text": "function externalLinks() {\n for (let c = document.getElementsByTagName(\"a\"), a = 0; a < c.length; a++) {\n let b = c[a];\n\n // all links open in new browser tag, except the link is the same hostname\n // b.getAttribute(\"href\") && b.hostname !== location.hostname && (b.target = \"_blank\");\n\n // all links open in new browser tag, except the link is a bookmark\n b.getAttribute(\"href\") && b.getAttribute(\"href\").search(/#/i) !== 0 && (b.target = \"_blank\");\n }\n }", "title": "" }, { "docid": "4b3b088b7d6f8e7f886f04b4f819a017", "score": "0.547335", "text": "function UrlShortener() {\n this.urlAllowedChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +\n 'abcdefghijklmnopqrstuvwxyz' +\n \"0123456789-_.~!*'();:@&=+$,/?#[]\";\n this.aliases = {\n 'https://': '~',\n '.com': '@',\n '.wikipedia.org/wiki/': 'wk',\n '.org': '*',\n 'JavaScript': '!',\n 'Reference' : 'rf',\n 'Object': 'obj',\n '/en': '[',\n 'price': '$'\n\n };\n}", "title": "" }, { "docid": "a19d6ab0b39964aa9e4a2c3a24977bb1", "score": "0.5468303", "text": "function shortenUrls(str) {\r\n\treturn Autolinker.link(str, {\r\n\t\ttruncate: {length: 30},\r\n\t replaceFn : function( autolinker, match ) {\r\n\t switch( match.getType() ) {\r\n\t case 'url' :\r\n\t var tag = autolinker.getTagBuilder().build( match ); \r\n\t \t\treturn tag.innerHtml;\r\n\t }\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "b664b9ed612515618ebe1a4c60660cb6", "score": "0.5464767", "text": "function preparePostWithPostUrl() {\r\n\t\t//printToSearchQuery('');\r\n\t\tvar f = focusedStreamItem() || openAndHoveredStreamItem();\r\n\t\tif (!f) return false;\r\n\r\n\t\tvar l = location;\r\n\t\tvar u = 'http://twitter.com/share?text= :: https://twitter.com'+encodeURIComponent(streamItemData(f).permalink.attr('href'));\r\n\t\tif (!window.open(u,'t','toolbar=0,resizable=0,status=1,width=540,height=440')) l.href = u;\r\n\t\tvoid(0);\r\n\t}", "title": "" }, { "docid": "af6ea8b7e57d3ddb67f8cd180e95c57b", "score": "0.5463563", "text": "function sniffLoadUrl(){\n\tvar fobj = this;\n\tif(fobj.href.indexOf('#') > -1){\n\t\tvar thehref = fobj.href.split('#')[0];\n\t\tvar id = fobj.href.split('#')[1];\n\t\tgetfile(thehref,function(rdata,objs){\n\t\t\tif(objs[0]){\n\t\t\t\trdata = getRequestObject(objs[0],rdata);\n\t\t\t\tvar wclass = rdata.className;\n\t\t\t\trdata = rdata.innerHTML;\n\t\t\t}\n\t\t\tif(objs[1].parentNode.className.indexOf('g32auto') > -1 && objs[0]){\n\t\t\t\tobjs[1].parentNode.className = wclass;\n\t\t\t\tobjs[1].parentNode.innerHTML = rdata;\n\t\t\t}else{\n\t\t\t\tvar insertDIV = elem('div');\n\t\t\t\tobjs[1].parentNode.insertBefore(insertDIV, objs[1]);\n\t\t\t\tinsertDIV.innerHTML = rdata;\n\t\t\t\treg.rerun(insertDIV);\n\t\t\t\tobjs[1].parentNode.removeChild(objs[1]);\n\t\t\t}\n\t\t},[id,fobj]);\n\t}\n}", "title": "" }, { "docid": "d36228bd32ebf2c44b3da84026232712", "score": "0.54499876", "text": "function replaceRelativeLinksWithStaticGitHubUrl() {\n var relativePath = \"../../../..\";\n var gitHubPath = \"https://cromwell.readthedocs.io/en/\" + determineSelectedBranch();\n var gitHubLinks = $(\"a[href^='\" + relativePath + \"']\").each(function (index) {\n var url = $(this).attr('href');\n $(this).attr('href', url.replace(relativePath, gitHubPath));\n });\n }", "title": "" }, { "docid": "3923b5f2a96b1465be47ae15555f184e", "score": "0.54483116", "text": "function updateBrowserURL() {\n var publisherOrPartner = (type === 'secure') ? '?partner=' + partner : '?publisher=' + publisher;\n widget_url = (type == 'secure') ? widget_url : publisher\n window.history.replaceState(\n null,\n null,\n publisherOrPartner +\n '&listings=' + listings +\n '&width=' + width+\n '&height=' + height +\n \"&categoryId=\" + filterCategory +\n \"&categoryName=\" + filterCategoryName +\n \"&activity=\" + filterActivity +\n \"&activityName=\" + filterActivityName +\n \"&backgroundColor=\" + backgroundColor +\n \"&backgroundOpacity=\" + backgroundOpacity +\n \"&title=\" + title +\n \"&showLocation=\" + showLocation +\n \"&filterFeatureLevel=\" + filterFeatureLevel +\n \"&showPhone=\" + showPhone +\n \"&showIcon=\" + showIcon +\n \"&originalParent=\" + originalParent +\n \"&showLogo=\" + showLogo\n // \"&daysAgo=\" + daysAgo +\n );\n}", "title": "" }, { "docid": "30a4547f7b704af4a618df19b72741ec", "score": "0.5436421", "text": "function Site(v) {\n\tv = v.replace(/^http:\\/\\/?/, \"\")\n\tdominio = v\n\tcaminho = \"\"\n\tif (v.indexOf(\"/\") > -1)\n\t\tdominio = v.split(\"/\")[0]\n\tcaminho = v.replace(/[^\\/]*/, \"\")\n\tdominio = dominio.replace(/[^\\w\\.\\+-:@]/g, \"\")\n\tcaminho = caminho.replace(/[^\\w\\d\\+-@:\\?&=%\\(\\)\\.]/g, \"\")\n\tcaminho = caminho.replace(/([\\?&])=/, \"$1\")\n\tif (caminho != \"\")\n\t\tdominio = dominio.replace(/\\.+$/, \"\")\n\tv = \"http://\" + dominio + caminho\n\treturn v\n}", "title": "" }, { "docid": "f691e38921ea93f47fa9eab6635612c3", "score": "0.5427524", "text": "function howToMagicalSelector() {\n window.open(proxyPath + \"img/magicalselector.webm\", '_blank');\n }", "title": "" }, { "docid": "9b83d1782ac25088f7d22f7929183f11", "score": "0.5427086", "text": "function getMusicDealsUrl(){\n self.location = \"/promos/dc/music_deals.html\";\n}", "title": "" }, { "docid": "f28d2c4c71114883fde2bc63d90f126c", "score": "0.54200107", "text": "static getCanonicalUrl(url, {\n // If false, we'll leave the search page and current image in the URL so the data\n // source will start where it left off.\n startAtBeginning=true\n }={})\n {\n // Make a copy of the URL.\n url = new URL(url);\n\n // Remove /en from the URL if it's present.\n url = helpers.pixiv.getUrlWithoutLanguage(url);\n\n \n let args = new helpers.args(url);\n\n // Remove parts of the URL that don't affect which data source instance is used.\n //\n // If p=1 is in the query, it's the page number, which doesn't affect the data source.\n if(startAtBeginning)\n args.query.delete(\"p\");\n\n // The manga page doesn't affect the data source.\n args.hash.delete(\"page\");\n\n // #view=thumbs controls which view is active.\n args.hash.delete(\"view\");\n\n // illust_id in the hash is always just telling us which image within the current\n // data source to view. data_sources.current_illust is different and is handled in\n // the subclass.\n if(startAtBeginning)\n args.hash.delete(\"illust_id\");\n\n // These are for temp view and don't affect the data source.\n args.hash.delete(\"virtual\");\n args.hash.delete(\"temp-view\");\n\n // This is for overriding muting.\n args.hash.delete(\"view-muted\");\n\n // Ignore filenames for local IDs.\n if(startAtBeginning)\n args.hash.delete(\"file\");\n\n // slideshow is used by the viewer and doesn't affect the data source.\n args.hash.delete(\"slideshow\");\n\n // Sort query and hash parameters.\n args.query = helpers.other.sortQueryParameters(args.query);\n args.hash = helpers.other.sortQueryParameters(args.hash);\n\n return args;\n }", "title": "" }, { "docid": "6fafaf6b1ed51a613a60155222499ff3", "score": "0.5419411", "text": "function urlExpander(aTag, longurl) {\n aTag.href = longurl;\n aTag.title = \"Click to open \" + longurl;\n \n if (longurl.length > 30)\n aTag.innerHTML = longurl.substring(0,15) + '...' + longurl.substring(longurl.length-15, longurl.length );\n else\n aTag.innerHTML = longurl;\n}", "title": "" }, { "docid": "e456257c51ffcaf8f612ee277bb93521", "score": "0.5416099", "text": "function get_raw_url() {\n return location.href.replace(location.hash, \"\");\n}", "title": "" }, { "docid": "2d6b6e77e15702fb4622bc47848adfbb", "score": "0.54079807", "text": "function initNewWinLinks() {\n\tjQuery('#phpbb .postbody .content a').each(function() {\n\t\tjQuery(this).attr('target', '_blank');\n\t});\n}", "title": "" }, { "docid": "649dbf377282cfc54ce6ad54301a732a", "score": "0.54011405", "text": "function displayLink(link) {\n return link.replace('https://', '')\n}", "title": "" }, { "docid": "f701d9a375669ed23951ca5784479b8d", "score": "0.5395794", "text": "function getHostUrl() {\n return \"http://ytinstant.com/#\";\n}", "title": "" }, { "docid": "b8475c16504acfe694a995111735d864", "score": "0.5394056", "text": "function replaceLinks(){\n let bodyContent = document.getElementById('mw-content-text');\n let links = bodyContent.querySelectorAll('a:not(.image)');\n for (let l of links) {\n let p = document.createElement('span');\n p.innerText = l.innerText;\n l.parentNode.replaceChild(p, l);\n }\n}", "title": "" }, { "docid": "0c1a6a795062a69d5dbd18721416e582", "score": "0.5384587", "text": "function addURLblogs() {\n for (var key in blogs) {\n if (blogs.hasOwnProperty(key)) {\n var blogBodyHTML = JSON.stringify(blogs[key].articleBodyHTML);\n var url = \"https://www.sunwarrior.com\";\n var position = blogBodyHTML.indexOf(\"/uploads\");\n var output = [\n blogBodyHTML.slice(0, position),\n url,\n blogBodyHTML.slice(position)\n ].join(\"\");\n finalOutput = output\n .replace(/[\\\"][/]uploads/g, \"https://www.sunwarrior.com/uploads\")\n .replace(/[\\\\]/g, \"\")\n .replace(/rnrn/g, \"\")\n .replace(/>rn/g, \">\")\n .replace(/[\\\"][/]store[/]product[/]warrior-.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/warrior-blend\\\"\")\n .replace(/com[/]store[/]product[/]warrior-.*?[\\\"]/g, \"com/collections/all/products/warrior-blend\\\"\")\n .replace(/[\\\"][/]store[/]product[/]classic-protein.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/classic-protein\\\"\")\n .replace(/com[/]store[/]product[/]classic-protein.*?[\\\"]/g, \"com/collections/all/products/classic-protein\\\"\")\n .replace(/[\\\"][/]store[/]product[/]classic-plus.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/classic-plus\\\"\")\n .replace(/com[/]store[/]product[/]classic-plus.*?[\\\"]/g, \"com/collections/all/products/classic-plus\\\"\")\n .replace(/com[/]store[/]product[/]illumin8.*?[\\\"]/g, \"com/collections/all/products/illumin8\\\"\")\n .replace(/[\\\"][/]store[/]product[/]liquid-light.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/us-liquid-light-946-4-ml-32-fl-oz-bottle\\\"\")\n .replace(/com[/]store[/]product[/]liquid-light.*?[\\\"]/g, \"com/collections/all/products/us-liquid-light-946-4-ml-32-fl-oz-bottle\\\"\")\n .replace(/[\\\"][/]store[/]product[/]ormus-.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/ormus-super-greens\\\"\")\n .replace(/com[/]store[/]product[/]ormus-.*?[\\\"]/g, \"com/collections/all/products/ormus-super-greens\\\"\")\n .replace(/[\\\"][/]store[/]product[/]vitamin-mineral-rush.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/us-vmr-236-5-ml-8-fl-oz\\\"\")\n .replace(/com[/]store[/]product[/]vitamin-mineral-rush.*?[\\\"]/g, \"com/collections/all/products/us-vmr-236-5-ml-8-fl-oz\\\"\")\n .replace(/[\\\"][/]store[/]product[/]vitamins-for-her.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/us-raw-vitamins-for-her-90-capsules-bottle\\\"\")\n .replace(/com[/]store[/]product[/]vitamins-for-her.*?[\\\"]/g, \"com/collections/all/products/us-raw-vitamins-for-her-90-capsules-bottle\\\"\")\n .replace(/[\\\"][/]store[/]product[/]vitamins-for-him.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/us-raw-vitamins-for-him-90-capsules-bottle\\\"\")\n .replace(/com[/]store[/]product[/]vitamins-for-him.*?[\\\"]/g, \"com/collections/all/products/us-raw-vitamins-for-him-90-capsules-bottle\\\"\")\n .replace(/[\\\"][/]store[/]product[/]immune-shield.*?[\\\"]/g, \"\\\"https://www.sunwarrior.com/collections/all/products/us-immune-shield-236-5-ml-8-fl-oz-bottle\\\"\")\n .replace(/com[/]store[/]product[/]immune-shield.*?[\\\"]/g, \"com/collections/all/products/us-immune-shield-236-5-ml-8-fl-oz-bottle\\\"\")\n .replace(/com[/]store[/]product[/]cplus-.*?[\\\"]/g, \"com/collections/all/products/classic-plus\\\"\")\n .replace(/com[/]store[/]product[/]sol-.*?[\\\"]/g, \"com/collections/all/products/sol-good-protein-bars\\\"\")\n .replace(/com[/]store[/]product[/]wb-.*?[\\\"]/g, \"com/collections/all/products/warrior-blend\\\"\")\n .replace(/com[/]store[/]product[/]enzorb.*?[\\\"]/g, \"com/collections/all/products/us-enzorb-90-count-capsules-bottle\\\"\")\n .replace(/com[/]store[/]product[/]classic-.*?-sm[\\\"]/g, \"com/collections/all/products/classic-protein\\\"\")\n .replace(/com[/]store[/]product[/]eco-.*?[\\\"]/g, \"com/collections/all/products/ecovessel-boulder-24-oz\\\"\")\n .replace(/com[/]healthhub[/]/g, \"com/blogs/health-hub/\")\n .replace(/[\\\"][/]healthhub[/]/g, \"\\\"https://www.sunwarrior.com/blogs/health-hub/\")\n .replace(/=https:/g, \"=\\\"https:\");\n blogs[key].articleBodyHTML = finalOutput;\n }\n }\n}", "title": "" }, { "docid": "290329af1514846f0478daa06eca332c", "score": "0.53773284", "text": "function getHomePage() {\n // Controls where all links redirect to\n return \"https://amastin-devicepitstop.github.io/IMS/\"; \n}", "title": "" }, { "docid": "4510b58e727db634459095c2f1e67d4c", "score": "0.53586286", "text": "function formatWebsite(input){\n if (!input) return '';\n\n output = input.replace(/.*?:\\/\\//g, \"\");\n return output;\n}", "title": "" }, { "docid": "8beae3501592a6a841f5e4ff654018a5", "score": "0.5356853", "text": "function replaceLocalURLS(HTML) {\n\n let baseURL = chrome.extension.getURL(\"/\");\n let regX = /((href)|(src))=\"(?!(http|chrome))/;\n\n while (HTML.match(regX)) {\n HTML = HTML.replace(\n regX,\n (prefix) => {\n return prefix + baseURL;\n }\n );\n }\n\n return HTML;\n}", "title": "" }, { "docid": "82612e99b2115b6aea4a113c22a335e4", "score": "0.53549594", "text": "function classyLinks() {\n console.log('classyLinks');\n\n // This script adds the classes \"a-extern\" and \"a-intern\" to the designated links\n $('.answer-item p a, .overlay p a, .network-list a, .aside-info a').each(function(){\n if ( $(this).attr('href') && $(this).attr('href').match(/https?:\\/\\/(?!localhost)/) ) { // external links\n $(this).attr('target','_blank').addClass('a-extern').removeClass('a-intern');\n } else if ( $(this).attr('href') && $(this).attr('href').includes( 'mailto' ) ) { // mailto links\n $(this).addClass('a-extern').removeClass('a-intern');\n } else { // internal links\n $(this).attr('target','_self').removeClass('a-extern').addClass('a-intern');\n }\n });\n\n // This script removes \"http(s)://\" in front of the link in the interview aside figcaption\n $('.aside-info a').each(function(){\n var myText = $( this ).html();\n myText = myText\n .replace(/(https*\\:\\/\\/)/g, \"\") // find \"http://\" or \"https://\"\n .replace(/(\\/$)/g, \"\"); // find \"slash\" at end of string\n $( this ).html(myText);\n });\n\n // This script emphasizes the initials in front of an answer\n $( '.i-answer p, .answer-item p' ).each(function(){\n console.log('get initials');\n var myText = $( this ).html();\n myText = myText\n .replace(/([A-Z]{2}\\:)/g, '<span class=\\'extended\\'>$1</span>'); //([A-Z]{2}\\:)\n $( this ).html(myText);\n });\n\n // This script solves a wording conflict related to the interview place \"via Email\"\n $( '.aside-info li' ).each(function(){\n console.log('via Email');\n var myText = $( this ).html();\n myText = myText\n .replace(/in (via)/g, '$1');\n $( this ).html(myText);\n });\n\n}", "title": "" }, { "docid": "6a429987de2cb83875d21a75eac9f4dc", "score": "0.5351581", "text": "function addTargelink() {\r\n $('#content-preview').find('a').attr('target', '_blank');\r\n}", "title": "" }, { "docid": "4ea614691dc99cd0c56d7f9300b2b859", "score": "0.53422654", "text": "function addLinks(text){\n\t\ttext = text.replace(/[a-z]+:\\/\\/([a-z0-9-_]+\\.[a-z0-9-_:~\\+#%&\\?\\/.=]+[^:\\.,\\)\\s*$])/ig, function(m, link) {\n return '<a title=\"' + m + '\" href=\"' + m + '\">' + ((link.length > 36) ? link.substr(0, 35) + '&hellip;' : link) + '</a>';\n })\n\t \treturn text;\n\t}", "title": "" }, { "docid": "5be7b7e02ed0e256b44f8d4f06c42574", "score": "0.5339208", "text": "function link_replace( string )\r\n{\r\n\tlinks = string.match( /(http:&#x2F;&#x2F;\\S*)/g );\r\n\tif (links)\r\n\t{\r\n\t\tfor( var i = 0; i < links.length; i++ )\r\n\t\t{\t\r\n\t\t\tvar replacement = links[i]\r\n\t\t\tif (replacement.length > 100)\r\n\t\t\t{\r\n\t\t\t\treplacement = links[i].substring(0,100) + \"...\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstring = string.replace( links[i], \"<a href='\"+links[i]+\"'>\"+replacement+\"</a>\");\r\n\t\t}\r\n\t}\r\n\treturn string;\r\n}", "title": "" }, { "docid": "363292709d7f370770442cd85430fb9a", "score": "0.5338639", "text": "function getUrl(data) {\n let live = data.goLive\n return (\n `## Go Live ` + '\\n' + live\n\n )\n}", "title": "" }, { "docid": "e993c79b418b98d470ef5c95eac0920e", "score": "0.5337732", "text": "function getYTURL($embedVideo) {\r\r\n\t\treturn $embedVideo.attr('data-href');\r\r\n\t}", "title": "" }, { "docid": "3596f228eef007816ae246694d20e2c8", "score": "0.5332555", "text": "function getURL() {\n\treturn \"http://giv-gwot-va.uni-muenster.de:3000\";\n}", "title": "" }, { "docid": "fe2a5ac3bc6df43b961199b224f62b08", "score": "0.53258944", "text": "function replaceHtmlImgURL(txt) {\n return txt.replace(\"\\\"/backend/\", \"\\\"\" + REMOTE_SERVER_ROOT + \"/backend/\");\n}", "title": "" }, { "docid": "3d122802cf78a221e59ea95c7c1c04d0", "score": "0.53239733", "text": "function url ()\n\t\t\t{\n\t\t\t\treturn 'http://' + addParam( location.host + hash().replace(/#/,'') , d.param);\n\t\t\t}", "title": "" }, { "docid": "d8980914cfb2dccdfc2ccfe1fda3f81a", "score": "0.5321173", "text": "function replaceURLs(text) {\r\n var exp = /(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&@#\\/%?=~_|!:,.;]*[-A-Z0-9+&@#\\/%=~_|])/ig;\r\n return text.replace(exp,\"<a href='$1' class='tweet_link'>$1</a>\"); \r\n }", "title": "" }, { "docid": "d4de9e3642bc703d84e4b8930fc3ce17", "score": "0.5317447", "text": "function scanforlinks() {\n // first make external links open in a new window, afterwards do the\n // normal plone link wrapping in only the content area\n var elonw,\n mslinks,\n url,\n protocols,\n contentarea,\n res;\n\n if (typeof external_links_open_new_window === 'string') {\n elonw = external_links_open_new_window.toLowerCase() === 'true';\n } else {\n elonw = false;\n }\n\n if (typeof mark_special_links === 'string') {\n mslinks = mark_special_links.toLowerCase() === 'true';\n } else {mslinks = false;}\n\n url = window.location.protocol + '//' + window.location.host;\n\n if (elonw) {\n // all http links (without the link-plain class), not within this site\n jQuery('a[href^=\"http\"]:not(.link-plain):not([href^=\"' + url + '\"])')\n .attr('target', '_blank');\n }\n\n if (mslinks) {\n protocols = /^(mailto|ftp|news|irc|h323|sip|callto|https|feed|webcal)/;\n contentarea = jQuery('#region-content,#content');\n\n // All links with an http href (without the link-plain class), not within this site,\n // and no img children should be wrapped in a link-external span\n contentarea.find(\n 'a[href^=\"http\"]:not(.link-plain):not([href^=\"' + url + '\"]):not(:has(img))')\n .wrap('<span></span>').parent().addClass('link-external');\n // All links without an http href (without the link-plain class), not within this site,\n // and no img children should be wrapped in a link-[protocol] span\n contentarea.find(\n 'a[href]:not([href^=\"http\"]):not(.link-plain):not([href^=\"' + url + '\"]):not(:has(img))')\n .each(function() {\n // those without a http link may have another interesting protocol\n // wrap these in a link-[protocol] span\n res = protocols.exec(this.href);\n if (res) {\n jQuery(this).wrap('<span></span>').parent().addClass('link-' + res[0]);\n }\n });\n }\n}", "title": "" }, { "docid": "fecc606ec3d3c5f654c189d2f25a6715", "score": "0.531565", "text": "function collectLinks(source) {\n /* Constants. */\n var pre = \"https://chord.cs.uchicago.edu/\";\n\n /* Fetches project links and initiates JSON recovery for each. */\n var doc = document.createElement( 'html' );\n doc.innerHTML = source;\n var thumb_items = doc.getElementsByClassName('project thumb item');\n project_count += [...thumb_items].length;\n \n [...thumb_items].forEach(function(item){\n var id = item.getAttribute('data-id');\n var ret_val = pre + id;\n var name;\n try {\n name = item.getElementsByClassName(\"owner\")[0].children[0].innerHTML;\n }\n catch(err) {\n name = '[undefined]';\n }\n getJSON(ret_val,analyze,[name,id]);\n });\n}", "title": "" }, { "docid": "0c41d85d8a7c9bf7d9c5c771358a2ff8", "score": "0.5311806", "text": "function convert(url){\n\t\t\treturn url.replace('watch?v=','embed/')\n\t\t}", "title": "" }, { "docid": "99b9e9de683ae38560e886d71073a31c", "score": "0.53088707", "text": "function buildFlickerUrl(p){\n\t\tvar url = \"https://farm\";\n\t\turl += p.farm;\n\t\turl += \".staticflickr.com/\";\n\t\turl += p.server;\n\t\turl += \"/\";\n\t\turl += p.id;\n\t\turl += \"_\";\n\t\turl += p.secret;\n\t\turl += \".jpg\";\n\t\treturn url;\n\t}", "title": "" }, { "docid": "80a3ca4807bdb556e9a119ffa13d0697", "score": "0.5307202", "text": "function setDcsHref(location) {\n\n var href;\n\n if (myRepoName && myOwner)\n href = 'https://content.bibletranslationtools.org/' + myOwner + '/' + myRepoName;\n else\n href = getDcsLink(location.pathname);\n\n $('#see-on-dcs').attr('href', href);\n}", "title": "" }, { "docid": "ead79bcd04eb1b6399e484b024b8560b", "score": "0.53008443", "text": "function fixTargets() {\n\tfor (i=0;i<Composition.document.links.length;i++ )\n\t{\n\t\tComposition.document.links[i].target = \"_new\";\n\t}\n}", "title": "" }, { "docid": "485388de57f7a22acf9f10edf8d54090", "score": "0.5300246", "text": "function showResult_webUrl(originalRequest)\r\n{\r\n\tvar response = originalRequest.responseText;\r\n\t$('webUrl').innerHTML = response;\r\n}", "title": "" }, { "docid": "e999fd18672b227572761cb612148631", "score": "0.52887326", "text": "function wrapMe(){ //this gets called by each content page to check if it is wrapped or not.\r\n\t\t\tif (self.location.href == top.location.href){\r\n\t\t\t top.location.href = 'index.htm?zurl=' + self.location.href;\t\t\t \r\n\t\t\t}\r\n }", "title": "" }, { "docid": "ab1d80301e1208bae03a381584f7bee8", "score": "0.5288576", "text": "function URLUtils() { }", "title": "" }, { "docid": "72f29fce5aea2b6e5cbe0d953338724e", "score": "0.5288352", "text": "function getWebUrl(){\n\t\treturn webURL;\n\t}", "title": "" }, { "docid": "f731cad202152708ab1d32712e00b336", "score": "0.52875435", "text": "function irPagina(urlArchivoHTML) {\n location.href = urlArchivoHTML ;\n}", "title": "" } ]
a7d37d7e904ec7d6d03d6a37225b0a2f
endregion region Location ComplexType
[ { "docid": "799a8dea99074c9a6ad9254db8f525f6", "score": "0.718051", "text": "function addLocationComplexType(store) {\n var et = {\n shortName: \"Location\",\n isComplexType: true,\n\n dataProperties: {\n address: { maxLength: 60 },\n city: { maxLength: 15 },\n region: { maxLength: 15 },\n postalCode: { maxLength: 10 },\n country: { maxLength: 15 },\n }\n };\n\n return addTypeToStore(store, et);\n }", "title": "" } ]
[ { "docid": "3ee03764b07c24228841ed06c7c663c1", "score": "0.59141594", "text": "static get __resourceType() {\n\t\treturn 'LocationPosition';\n\t}", "title": "" }, { "docid": "005ab7c7532dedd35dda85817986c263", "score": "0.5783918", "text": "function specifyLocation(dataType, location) {\n if (isReferenceType(dataType)) {\n switch (dataType.typeClass) {\n case \"string\":\n case \"bytes\":\n return Object.assign(Object.assign({}, dataType), { location });\n case \"array\":\n return Object.assign(Object.assign({}, dataType), { location, baseType: specifyLocation(dataType.baseType, location) });\n case \"mapping\":\n let newLocation = location === \"storage\" ? \"storage\" : undefined;\n return Object.assign(Object.assign({}, dataType), { location: newLocation, valueType: specifyLocation(dataType.valueType, newLocation) });\n case \"struct\":\n let returnType = Object.assign(Object.assign({}, dataType), { location });\n if (returnType.memberTypes) {\n returnType.memberTypes = returnType.memberTypes.map(({ name: memberName, type: memberType }) => ({\n name: memberName,\n type: specifyLocation(memberType, location)\n }));\n }\n return returnType;\n }\n }\n else {\n return dataType;\n }\n}", "title": "" }, { "docid": "005ab7c7532dedd35dda85817986c263", "score": "0.5783918", "text": "function specifyLocation(dataType, location) {\n if (isReferenceType(dataType)) {\n switch (dataType.typeClass) {\n case \"string\":\n case \"bytes\":\n return Object.assign(Object.assign({}, dataType), { location });\n case \"array\":\n return Object.assign(Object.assign({}, dataType), { location, baseType: specifyLocation(dataType.baseType, location) });\n case \"mapping\":\n let newLocation = location === \"storage\" ? \"storage\" : undefined;\n return Object.assign(Object.assign({}, dataType), { location: newLocation, valueType: specifyLocation(dataType.valueType, newLocation) });\n case \"struct\":\n let returnType = Object.assign(Object.assign({}, dataType), { location });\n if (returnType.memberTypes) {\n returnType.memberTypes = returnType.memberTypes.map(({ name: memberName, type: memberType }) => ({\n name: memberName,\n type: specifyLocation(memberType, location)\n }));\n }\n return returnType;\n }\n }\n else {\n return dataType;\n }\n}", "title": "" }, { "docid": "455c52ac7a79b2dc41a8208453684520", "score": "0.54718614", "text": "function StructType() {}", "title": "" }, { "docid": "90c5e2d703927c9d8c770b643d40d029", "score": "0.53853106", "text": "get elementType() {\n return this._objType.elementType;\n }", "title": "" }, { "docid": "9547566cbd3bcfadf3dfc46386cb23aa", "score": "0.5263805", "text": "function Location(x, y) {\n this.x = x;\n this.y = y;\n}", "title": "" }, { "docid": "80ab19d1034b7d12a82cb072e16ec235", "score": "0.5227459", "text": "isLocation(value) {\n return Path.isPath(value) || Point.isPoint(value) || Range.isRange(value);\n }", "title": "" }, { "docid": "8c4c2bdd65292e05fc2cd8e6a1636394", "score": "0.52193743", "text": "function CoordMapType() {}", "title": "" }, { "docid": "6c52438bc24d5ad70a019c8aaba6dcba", "score": "0.51742864", "text": "function LocationModel(location) {\n\n var instance = this;\n\n /**\n Returns a human-readable address for the location. Detailed address components such as streets and house\n numbers are ommitted.\n @returns {string} Human readable address.\n */\n LocationModel.prototype.get_city = function() {\n\n return location.address_components.filter( function(component) {\n return _.intersection(config.irrelevant_address_components, component.types).length === 0;\n\n }).map( function(component) {\n return component.long_name;\n\n }).join(' ');\n };\n\n /**\n @typedef coordinates\n @type {Object}\n @property {number} longitude - The longitude coordinate.\n @property {number} latitude - The latitude coordinate.\n */\n\n /**\n Returns the latitude and longitude for the location.\n @returns {coordinates} The latitude and longitude of the location\n */\n LocationModel.prototype.get_coordinates = function() {\n return {\n latitude: location.geometry.location.lat,\n longitude: location.geometry.location.lng,\n };\n };\n\n /**\n @typedef location\n @type {Object}\n @property {string} address - The address of the location\n @property {coordinates} coordinates - The coordinates of the location\n */\n\n /**\n Returns a JSON serializable object containing all of the current location's available information\n @returns {location}\n */\n LocationModel.prototype.serialize = function() {\n return {\n address: instance.get_city(),\n coordinates: instance.get_coordinates(),\n };\n };\n }", "title": "" }, { "docid": "a3a9da8db407714760d63474177efa61", "score": "0.51606554", "text": "function Location(lat, lon) {\n this.lat = lat;\n this.lon = lon;\n}", "title": "" }, { "docid": "5e265d985ad42637afb472742f2ffd88", "score": "0.51510817", "text": "function Location (locationObj, city) {\n this.search_query = city;\n this.formatted_query = locationObj.display_name;\n this.latitude = locationObj.lat;\n this.longitude = locationObj.lon;\n this.formatted_query = locationObj.display_name;\n this.latitude = locationObj.lat;\n this.longitude = locationObj.lon;\n}", "title": "" }, { "docid": "f87459f0f4f3dca59e200914f53a6ec4", "score": "0.51453567", "text": "function Location() {}", "title": "" }, { "docid": "66fb17112664b1135bb892659c86c8f7", "score": "0.50984615", "text": "get locationTypeInput() {\n return this._locationType;\n }", "title": "" }, { "docid": "52dbb360b05d43fc87e485fb90d1c5f6", "score": "0.5062219", "text": "function Location(searchQuery, obj) {\n this.search_query = searchQuery;\n this.formatted_query = obj.display_name;\n this.latitude = obj.lat;\n this.longitude = obj.lon;\n}", "title": "" }, { "docid": "ccd9971290e567aa599def42e9df2aca", "score": "0.50389", "text": "function Location(data){\n this.formatted_query = data.formatted_address;\n this.latitude = data.geometry.location.lat;\n this.longitude = data.geometry.location.lng;\n}", "title": "" }, { "docid": "159dc973c25c39d72e3a2c375c6a7aff", "score": "0.50280195", "text": "function Location(searchQuery, obj){\n this.search_query = searchQuery;\n this.formatted_query = obj.display_name;\n this.latitude = obj.lat;\n this.longitude = obj.lon;\n}", "title": "" }, { "docid": "207a8706f9c642b3553b4c814ff83f18", "score": "0.49678442", "text": "constructor(restrictionType, locations) {\n this.restrictionType = restrictionType;\n this.locations = locations;\n }", "title": "" }, { "docid": "d7e26d653373ee84143f743a68dee9a3", "score": "0.49618924", "text": "function Location(geoData, city) {\n this.search_query = city;\n this.formatted_query = geoData.display_name;\n this.latitude = geoData.lat;\n this.longitude = geoData.lon;\n}", "title": "" }, { "docid": "2d5c0e4387b697140722142be24e51d8", "score": "0.49511713", "text": "function storedLocation(o) {\n\n var me = storedLocation;\n\n if (o.begin) {\n delete o.begin;\n me.stored = {};\n me.stored.element = o.element;\n me.stored.location = $(o.element).data('location');\n me.stored.ContactId = me.stored.location.ContactId;\n me.stored.personName = o.element.children[1].innerText;\n return $.extend({}, me.stored);\n }\n if ('location' in o) {\n me.stored.location = o.location;\n }\n if ('personName' in o) {\n me.stored.personName = o.personName;\n }\n\n if (o.update) {\n $(me.stored.element).data('location', me.stored.location);\n if (me.stored.ContactId) {\n PersonApp.changePersonAssigned(me.stored.ContactId, 0); // old no longer assigned to location \n }\n if (me.stored.location.ContactId) {\n PersonApp.changePersonAssigned(me.stored.location.ContactId, me.stored.location.Id);\n }\n me.stored.element.children[1].innerText = me.stored.personName;\n delete me.stored;\n return;\n }\n return $.extend({}, me.stored);\n }", "title": "" }, { "docid": "446dade1ba959ab5af708a0377e4da26", "score": "0.49470693", "text": "get elementType() {\n return this._elementType;\n }", "title": "" }, { "docid": "4539aa198a90e4e21234a9fca69c8161", "score": "0.493824", "text": "function MapObject(objType, area) {\r\n\tvar _self = this;\r\n\r\n\tthis._type \t= objType;\r\n\r\n\tthis._area = area; // array of objects like {sX: 30, sY: 30, fX: 50, fY: 50} WHERE coordinates of objects detail location\r\n}", "title": "" }, { "docid": "dd296752892b5cfb2b7c6e9c488b4293", "score": "0.49189603", "text": "get elementTypeClass() {\n return this._objType.elementTypeClass;\n }", "title": "" }, { "docid": "052254270e03281158a0b92cdd5335d0", "score": "0.49143466", "text": "function Position(id, memberId, type, lat, lng, date, comment, visibleToOwner){\n this.id=id;\n this.memberId=memberId;\n this.type=type;\n this.lat=lat;\n this.lng=lng;\n this.date=date;\n this.comment=comment;\n this.visible=visibleToOwner;\n}", "title": "" }, { "docid": "beb64d1e725b9ad1e6864ff8344e968d", "score": "0.48999232", "text": "function c(e,t,r,o){a=a||n(15);const i=Object.keys(e),c=i.length;let l,p;for(let n=0;n<c;++n){l=e[p=i[n]],u(p,s.isPOJO(l)&&Object.keys(l).length&&(!l[o.typeKey]||\"type\"===o.typeKey&&l.type.type)?l:null,t,r,i,o)}}", "title": "" }, { "docid": "8bb1be76b374cce98b1d49c9f7affa39", "score": "0.48962414", "text": "toJSON() {\n return {\n id: this.id,\n selfUrl: this.selfUrl,\n description: this.description,\n name: this.name,\n historicalLocationsLink: this.historicalLocationsLink,\n thingsLink: this.thingsLink,\n location: this.location,\n \"@type\": \"Location\"\n };\n }", "title": "" }, { "docid": "a0d863de152411f425f4188fa2c34b4a", "score": "0.4893632", "text": "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.rawType = true;\n }", "title": "" }, { "docid": "a5addc1b4b7f9c3cec1176aed4db89b4", "score": "0.4882953", "text": "function City(location, data) {\n\n this.search_query = location;\n this.formatted_query = data.results[0].formatted_address;\n this.latitude = data.results[0].geometry.location.lat;\n this.longitude = data.results[0].geometry.location.lng;\n\n}", "title": "" }, { "docid": "79bd45dae13e9a371a355e18bfa015cb", "score": "0.48811048", "text": "constructor(value: DataBlock, allowed_types: set<int>, apiname: string, uiname: string, description, flag) {\r\n super(PropTypes.DATAREF, apiname, uiname, description, flag);\r\n\r\n if (allowed_types === undefined)\r\n allowed_types = new set();\r\n\r\n if (!(allowed_types instanceof set)) {\r\n if (allowed_types instanceof Array)\r\n allowed_types = new set(allowed_types);\r\n else\r\n allowed_types = new set([allowed_types]);\r\n }\r\n\r\n this.types = new set();\r\n\r\n /* ensure this.types stores integer type ids, not type classes */\r\n for (let val of allowed_types) {\r\n if (typeof val === \"object\") {\r\n val = new val().lib_type;\r\n }\r\n\r\n this.types.add(val);\r\n }\r\n\r\n if (value !== undefined)\r\n this.setValue(value);\r\n }", "title": "" }, { "docid": "86c37b36330236f39a35e3977eea1ebf", "score": "0.48670202", "text": "function moRef(type, id) {\n\t\t\n\t\tif (type && id) {\n\t\t\treturn {\n\t\t\t\tattributes: {\n\t\t\t\t\ttype: type\n\t\t\t\t},\n\t\t\t\t\"$value\": id\n\t\t\t};\n\t\t}\n\t\telse if (typeof(type) === 'object') {\n\t\t\treturn {\n\t\t\t\tid: _.get(type, '$value'),\n\t\t\t\ttype: _.get(type, 'attributes.type') || _.get(type, 'attributes.xsi:type')\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "aa56b726d19e3e46a67902a767716507", "score": "0.48571917", "text": "function toObject(location) {\n var uri = location.uri, type = location.type;\n var context = (function () {\n if (CursorLocation.is(location)) {\n return CursorLocation.toObject(location.context);\n }\n if (SelectionLocation.is(location)) {\n return SelectionLocation.toObject(location.context);\n }\n if (ContentChangeLocation.is(location)) {\n return ContentChangeLocation.toObject(location.context);\n }\n })();\n return {\n uri: uri.toString(),\n type: type,\n context: context\n };\n }", "title": "" }, { "docid": "a182d84a6033eb176463edf64b9fcb09", "score": "0.4852137", "text": "parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: _kinds_mjs__WEBPACK_IMPORTED_MODULE_3__[\"Kind\"].OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }", "title": "" }, { "docid": "a21f10653899366515118f853bf006b8", "score": "0.48288065", "text": "function getPropertyOfObjectType(type,name){if(type.flags&524288/* Object */){var resolved=resolveStructuredTypeMembers(type);var symbol=resolved.members.get(name);if(symbol&&symbolIsValue(symbol)){return symbol;}}}", "title": "" }, { "docid": "92940917910ab11b9c4ff63ceaef6061", "score": "0.48274767", "text": "function getIndexTypeOfType(type,kind){return getIndexTypeOfStructuredType(getReducedApparentType(type),kind);}", "title": "" }, { "docid": "08d536372639d16f86e53bd1f403460c", "score": "0.48210767", "text": "docType(name, publicId, systemId) { }", "title": "" }, { "docid": "8f9ef276c344c08abe9afb2160a9860d", "score": "0.4819595", "text": "function testLocType( tc_base, loctype, callstack )\n{\n\tvar fName = testHelperfName( callstack );\n\ttc_base = testCaseName( tc_base, \"LocType\" );\n\tvar test_result = g_FAIL;\n\tvar test_extra = \"\";\n\t//tc_base = tc_base + \"-LocType\";\n\n\t\n if( loctype == \"coords only\" || loctype == \"Coordinates only\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"Coordinates only (e.g., 27\\u00b034'23.4\\\" N, 121\\u00b056'42.3\\\" W)\", fName ) \n\t}\n\telse if( loctype == \"named place\" || loctype == \"Named place\" || loctype == \"Named place only\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"Named place only (e.g., Bakersfield)\", fName ) \n\t}\n\telse if( loctype == \"dist only\" || loctype == \"Distance only\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"Distance only (e.g., 5 mi from Bakersfield)\", fName ) \n\t}\n\telse if( loctype == \"dist path\" || loctype == \"Distance along path\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"Distance along path (e.g., 13 mi E (by road) Bakersfield)\", fName ) \n\t}\n\telse if( loctype == \"dist ortho\" || loctype == \"Distance along orthogonal directions\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"Distance along orthogonal directions (e.g., 2 mi E and 3 mi N of Bakersfield)\", fName ) \n\t}\n\telse if( loctype == \"dist at\" || loctype == \"Distance at a heading\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"Distance at a heading (e.g., 10 mi E (by air) Bakersfield)\", fName ) \n\t}\n\telse if( loctype == \"\" || loctype == \"empty\" )\n\t{\n\t\ttest_result = testChooseSelectValue( tc_base, \"ChoiceModel\", \"\", fName ) \n\t}\n\telse\n\t{\n\t\ttest_extra = \" calcctype \" + loctype + \" not found in if else\"\n\t}\n\t\n\tlog_test_result(tc_base, fName, test_result, test_extra );\n\treturn test_result;\n}", "title": "" }, { "docid": "05e926bf3b8f52a89e217d61d4407424", "score": "0.48137853", "text": "function processComplex(arElement,vo) {\n vo.children = []; //these will be the child extensions\n var child = {}; //this is a single child element\n\n arElement.forEach(function (element) {\n if (element.path) {\n var arPath = element.path.split('.');\n if (arPath.length == 2) {\n //this is defining the start of a new child. create a new object and add it to the children array\n child = {min: element.min, max: element.max};\n child.ed = element; //Hopefully this is the representative ED\n child.ed.myMeta = {};\n\n vo.children.push(child);\n } else if (arPath.length > 2) {\n //this will be the definition of the child. we're only interested in the code and the datatype/s\n var e = arPath[2];\n if (e.indexOf('value') > -1) {\n //this is the value definition - ie what types\n child.ed.type = element.type;\n child.ed.binding = element.binding; //the child.ed was set by the 'parent' and won't have the binding...\n\n\n //pull the bound ValueSet out for convenience...\n if (element.binding) {\n if (element.binding.valueSetReference) {\n //we may need to check whether this is a relative reference...\n child.boundValueSet = element.binding.valueSetReference.reference;\n }\n if (element.binding.valueSetUri) {\n child.boundValueSet = element.binding.valueSetUri;\n }\n child.bindingStrength = element.binding.strength;\n\n }\n\n\n //see if this is a complex dataType (so we can set the icon correctly)\n if (element.type) {\n element.type.forEach(function (typ) {\n var code = typ.code; //the datatype code\n if (code) {\n //if (/[A-Z]/.test(code)) { aug2017 - don't know why there is a caps check here...\n child.ed.myMeta.isComplex = true;\n // }\n }\n })\n }\n\n }\n\n if (e.indexOf('url') > -1) {\n //this is the code of the child\n child.code = element.fixedUri\n }\n\n }\n }\n\n\n });\n\n\n }", "title": "" }, { "docid": "d49fde2a51545c510addcb72d4aefdfd", "score": "0.48035875", "text": "function Location(requestCity, geoData) {\n this.search_query = requestCity;\n this.formatted_query = geoData[0].display_name;\n this.latitude = geoData[0].lat;\n this.longitude = geoData[0].lon;\n}", "title": "" }, { "docid": "32eefabd00b44664cdd9810ea4d6e33f", "score": "0.48001638", "text": "function Location(name, CoL, weather, geo){\n\tthis.name = name;\n\tthis.CoL = CoL;\n\tthis.weather = weather;\n\tthis.geo = geo;\n}", "title": "" }, { "docid": "e275b1052b2a401cfaf5cc22f408dcef", "score": "0.47946125", "text": "function c(e,t,i,r){a=a||n(23);const o=Object.keys(e),c=o.length;let u,p;for(let n=0;n<c;++n){p=o[n],u=e[p],l(p,s.isPOJO(u)&&Object.keys(u).length&&(!u[r.typeKey]||\"type\"===r.typeKey&&u.type.type)?u:null,t,i,o,r)}}", "title": "" }, { "docid": "4fdeb6adcae54cbde840e2df1b8bfdd3", "score": "0.47930863", "text": "toJSON() {\n return {\n type: \"Point\",\n coordinates: [this.longitude, this.latitude],\n crs: { type: \"name\", properties: { name: WorldGeodeticSystem1984 } }\n };\n }", "title": "" }, { "docid": "5e67287453f88a866daa90f781dea8d4", "score": "0.4782133", "text": "function Type(type) { this.type = type; }", "title": "" }, { "docid": "87f9c90f5401620014b398e7c76128b8", "score": "0.4781252", "text": "function Photo(name, location){\n this.name = name;\n this.location = location;\n}", "title": "" }, { "docid": "036dead7f9de0a3f82e163cdfeea136b", "score": "0.477672", "text": "function o(o,i){const{spatialReference:m}=i,r=[i.x,i.y];let s=Number.POSITIVE_INFINITY,x=0,c=0;const a=[0,0],f=\"extent\"===o.type?[[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]]]:o.rings;for(const t of f)for(let o=0;o<t.length-1;o++){Object(_coordsUtils_js__WEBPACK_IMPORTED_MODULE_1__[\"projectPointOnLine\"])(a,r,t,o);const i=Object(_chunks_vec2_js__WEBPACK_IMPORTED_MODULE_3__[\"i\"])(r,a);i<s&&(s=i,x=a[0],c=a[1])}return{coordinate:new _Point_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({x:x,y:c,spatialReference:m}),distance:s}}", "title": "" }, { "docid": "1546cc19c7064bcbadaf35b0015c1f7c", "score": "0.47744447", "text": "get location() { return this[LOCATION]; }", "title": "" }, { "docid": "7e18f0cb5b61204f97baa662a244d472", "score": "0.47735393", "text": "function changeTypeLocation(city, idType, typeID)\r\n{\r\n\tvar options = new Object();\r\n\toptions.city = city;\r\n\toptions.typeID = typeID;\r\n\toptions.idType = idType;\r\n\r\n\tchangeTypeAttribs(options);\r\n}", "title": "" }, { "docid": "ee30a3e8db929a80896d8f97511d0b62", "score": "0.47631449", "text": "function Shape(type) {\r\n this.type = type;\r\n this.getType = function () {\r\n return this.type;\r\n }\r\n}", "title": "" }, { "docid": "8a09f04adc0c5ae583da30f77792c45b", "score": "0.47614428", "text": "function Location() {\n this.isShip = whetherShip;\n this.isHit = false;\n this.display = \"~\";\n}", "title": "" }, { "docid": "ee4dc06d3b29bb7024520340d8517fa6", "score": "0.47484243", "text": "constructor ([x, y], type) {\n this.pos = [x, y]\n this.type = type\n }", "title": "" }, { "docid": "1ffb706c48b3985f6fec1b535fad3bc0", "score": "0.47435182", "text": "function locationTest (place, date, notes) {\n this.place = place;\n this.date = date;\n this.notes = notes;\n}", "title": "" }, { "docid": "109651437b7efd489f696507ee6d8ff2", "score": "0.47395644", "text": "constructor(longitude, latitude, name, address, url) {\n super('location');\n this.longitude = longitude;\n this.latitude = latitude;\n this.name = name;\n this.address = address;\n this.url = url;\n }", "title": "" }, { "docid": "fcbd3d4129f4248cd9c090b4633acf2b", "score": "0.4736694", "text": "function Loci(structure, elements) {\n return { kind: 'element-loci', structure: structure, elements: elements };\n}", "title": "" }, { "docid": "14a89e6663c24cd45bca6a5b813faaa8", "score": "0.47363517", "text": "function fullType(basicType, userDefinedTypes) {\n if (!isUserDefinedType(basicType)) {\n return basicType;\n }\n let id = basicType.id;\n let storedType = userDefinedTypes[id];\n if (!storedType) {\n return basicType;\n }\n let returnType = Object.assign(Object.assign({}, basicType), storedType);\n if (isReferenceType(basicType) && basicType.location !== undefined) {\n returnType = specifyLocation(returnType, basicType.location);\n }\n return returnType;\n}", "title": "" }, { "docid": "14a89e6663c24cd45bca6a5b813faaa8", "score": "0.47363517", "text": "function fullType(basicType, userDefinedTypes) {\n if (!isUserDefinedType(basicType)) {\n return basicType;\n }\n let id = basicType.id;\n let storedType = userDefinedTypes[id];\n if (!storedType) {\n return basicType;\n }\n let returnType = Object.assign(Object.assign({}, basicType), storedType);\n if (isReferenceType(basicType) && basicType.location !== undefined) {\n returnType = specifyLocation(returnType, basicType.location);\n }\n return returnType;\n}", "title": "" }, { "docid": "81d1516093ae09f06be7f98d5e1f829c", "score": "0.47297326", "text": "constructor() {\n super();\n this.elementType = 'circle';\n }", "title": "" }, { "docid": "498c863e26a6be5147d3b0a4d62fb1b4", "score": "0.472257", "text": "isPoint(value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__[\"a\" /* default */])(value) && typeof value.offset === 'number' && Path.isPath(value.path);\n }", "title": "" }, { "docid": "7def76c9f2ed2c71ca4655e60d8ab89c", "score": "0.46984297", "text": "get location() {\n return new Point(this.x, this.y);\n }", "title": "" }, { "docid": "6368b8b3cb2483c899820b5bdee5bd25", "score": "0.4691953", "text": "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.number='number';\n\t\t}", "title": "" }, { "docid": "6368b8b3cb2483c899820b5bdee5bd25", "score": "0.4691953", "text": "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.number='number';\n\t\t}", "title": "" }, { "docid": "757d0bedd01e1392254ba734db6759f3", "score": "0.46894738", "text": "function locationTypeText(locTypeId) {\n /* Legend: (1-9 and 1008 = poi, 10 = stop, 900 = address) */\n if (locTypeId == 10) return qsTr(\"Stop\")\n else if (locTypeId == 900) return qsTr(\"Address\")\n else return qsTr(\"Place of interest\")\n }", "title": "" }, { "docid": "8033599a0e9d9e3f3ad0210eaec961a4", "score": "0.46805814", "text": "setLocation(lat,lon){\n return new Microsoft.Maps.Location(lat,lon);\n }", "title": "" }, { "docid": "ef47cd2329c5a48d4fcb842daba72434", "score": "0.46745822", "text": "set elementType(type) {\n this._elementType = type;\n }", "title": "" }, { "docid": "396cc7f540f0a88c02e15bad261df581", "score": "0.4667093", "text": "function Photo(name,location){ // create Photo object with name and location arguments\n this.name = name;\n this.location = location;\n}", "title": "" }, { "docid": "5cfb5fc12f256f1f81650d6647e1a5c5", "score": "0.4661042", "text": "function Type() { }", "title": "" }, { "docid": "65114bdf6e750ff4e0828fae92da643d", "score": "0.46429878", "text": "constructor() {\n /**\n *\n * @member {Number} latitude\n */\n this.latitude = undefined\n /**\n *\n * @member {Number} longitude\n */\n this.longitude = undefined\n }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.46361566", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.46361566", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.46361566", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.46361566", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.46361566", "text": "get type() { return this._type; }", "title": "" }, { "docid": "398326c1cadcf553c2a50af49fd1bba8", "score": "0.46361566", "text": "get type() { return this._type; }", "title": "" }, { "docid": "5603f1c084c15d72daa27e5fff6c0a59", "score": "0.46351418", "text": "function Location(query, location) {\n this.search_query = query;\n this.formatted_query = location.formatted_address;\n this.latitude = location.geometry.location.lat;\n this.longitude = location.geometry.location.lng;\n}", "title": "" }, { "docid": "2c32670ac3544abe8e15b76f0cb39285", "score": "0.46345207", "text": "function complexArray( node ) {\n\n // generate a special type for arrays\n const dimensions = getDimensions( node.type );\n const args = [{\n type: 'Literal',\n value: dimensions,\n raw: dimensions.toString()\n }];\n\n if ( node.initializer ) {\n args.push(transformAST( node.initializer ));\n }\n\n return {\n type: 'ExpressionStatement',\n expression: {\n type: 'NewExpression',\n callee: {\n type: 'Identifier',\n name: 'ComplexArray'\n },\n 'arguments': args\n }\n };\n}", "title": "" }, { "docid": "8bf3ee78d31aa2368a140cc8a70403a5", "score": "0.4632404", "text": "static validateLocation (location) {\n\t\tif (!(location instanceof Array)) {\n\t\t\treturn 'location must be an array';\n\t\t}\n\t\telse if (location.length < 4) {\n\t\t\treturn 'location array must have at least 4 elements';\n\t\t}\n\t\telse if (location.length > 5) {\n\t\t\treturn 'location array is too long';\n\t\t}\n\t\tlet firstFour = location.slice(0, 4);\n\t\tif (firstFour.find(coordinate => typeof coordinate !== 'number')) {\n\t\t\treturn 'first four coordinations of location array must be numbers';\n\t\t}\n\t\tif (location.length === 5 && typeof location[4] !== 'object') {\n\t\t\treturn 'fifth element of location must be an object';\n\t\t}\n\t}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "c768d127e6d98c438051673ce1e71b83", "score": "0.46259388", "text": "function ContentType (type) {\n this.parameters = Object.create(null)\n this.type = type\n}", "title": "" }, { "docid": "9753b8bf491e080b05edcb24465d7c15", "score": "0.4625314", "text": "function objetAreaCircle(nom, typeAire = 'circle', objetPoint, radius){\n let circle = {};\n circle.id = objectAreaIndex++;\n circle.nom = nom;\n circle.typeAire = typeAire;\n circle.objetPoint = objetPoint;\n circle.radius = radius;\n\n circle.getCoords = function(){\n return objetPoint.x + ',' + objetPoint.y + ',' + circle.radius;\n }\n circle.getX = function(){\n return circle.objetPoint.x;\n }\n circle.getY = function(){\n return circle.objetPoint.y;\n }\n\n circle.setXY = function(x,y){\n circle.objetPoint.x = x;\n circle.objetPoint.y = y;\n }\n\n circle.setRadius = function(radius){\n circle.radius = radius;\n }\n\n return circle;\n}", "title": "" }, { "docid": "4611e4f4e71f727ccfc900a4b9851ddb", "score": "0.46241143", "text": "function t(t,o,r){if(!r||!r.features||!r.hasZ)return;const f=t$1(r.geometryType,o,t.outSpatialReference);if(f)for(const e of r.features)f(e.geometry);}", "title": "" }, { "docid": "29d7a59aca8f93da78ee92bd2cac4198", "score": "0.46194872", "text": "function LocationConstructor(geoData, searchLocation) {\n this.search_input = searchLocation;\n this.search_query = searchLocation;\n this.formatted_query = geoData.results[0].formatted_address;\n this.latitude = geoData.results[0].geometry.location.lat;\n this.longitude = geoData.results[0].geometry.location.lng;\n}", "title": "" }, { "docid": "113b483c5737b42e7ef90434d931dfac", "score": "0.46181443", "text": "get type() {\n return 'Map';\n }", "title": "" }, { "docid": "63de5c3fc8bdaa7d2bdb5988c406d449", "score": "0.46140254", "text": "get type() {\n return this.info.type;\n }", "title": "" }, { "docid": "b0a5ba56785b2bd71859480fd77f9e33", "score": "0.46109158", "text": "function isSimple(p){\n\t\t\t\t\t\treturn p.type === 'param' || p.type === 'value' ||\n\t\t\t\t\t\t\t(p.type === 'view' && p.view === 'property' && isSimple(p.params[1]))\n\t\t\t\t\t}", "title": "" }, { "docid": "d0ee89bd6507a865be8c0250bc579496", "score": "0.46071938", "text": "constructor (location, earliestDepartTime) {\n super (location);\n this.earliestDepartTime = earliestDepartTime;\n this.type = 'origin';\n }", "title": "" }, { "docid": "a41a142370af06699ff2002e3e6a48b2", "score": "0.4602382", "text": "makeComplexComponentTensorInfo(complexTensor, complexPart) {\n return {\n dataId: complexPart.dataId,\n dtype: complexPart.dtype,\n shape: complexTensor.shape\n };\n }", "title": "" }, { "docid": "105938b070a85df98c1a860af1782f56", "score": "0.46018934", "text": "function ComplexPropertySetter(name, type)\r\n\t{\r\n\t\tfunction setter(value)\r\n\t\t{\r\n\t\t\tif (arguments.length === 0)\r\n\t\t\t{\r\n\t\t\t\tif (! this[name])\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.update(name, new type());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthis.update(name, value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn setter;\r\n\t}", "title": "" }, { "docid": "6b38fa2afe4384acff38239fd318fef7", "score": "0.45960626", "text": "function e(n){var t;return Array.isArray(n)?null==(t=n[0])?void 0:t.spatialReference:null==n?void 0:n.spatialReference}", "title": "" }, { "docid": "6b38fa2afe4384acff38239fd318fef7", "score": "0.45960626", "text": "function e(n){var t;return Array.isArray(n)?null==(t=n[0])?void 0:t.spatialReference:null==n?void 0:n.spatialReference}", "title": "" }, { "docid": "6b38fa2afe4384acff38239fd318fef7", "score": "0.45960626", "text": "function e(n){var t;return Array.isArray(n)?null==(t=n[0])?void 0:t.spatialReference:null==n?void 0:n.spatialReference}", "title": "" } ]
971eba9cc4fe1737cbf4f6571116f808
new Renderer() Creates new [[Renderer]] instance and fill [[Rendererrules]] with defaults.
[ { "docid": "9da75f1a768948c86ba66607ca756d09", "score": "0.70101464", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independed static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" } ]
[ { "docid": "92bec97102cef2332f25044e6eb62205", "score": "0.76004124", "text": "function Renderer() {\n this.rules = assign$1({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.7546629", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.7546629", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.7546629", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.7546629", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.7546629", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "5057fbbaefd880eeb55b8ae40d91a360", "score": "0.7546629", "text": "function Renderer() {\n this.rules = utils.assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "09f86756fc774653fcbdf2d389d8020b", "score": "0.74820673", "text": "function Renderer() {\n this.rules = assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "09f86756fc774653fcbdf2d389d8020b", "score": "0.74820673", "text": "function Renderer() {\n this.rules = assign({}, rules);\n\n // exported helper, for custom rules only\n this.getBreak = rules.getBreak;\n}", "title": "" }, { "docid": "87bbc1f5b0dabd3481db99c185ee0c7d", "score": "0.74196196", "text": "function Renderer() {}", "title": "" }, { "docid": "c290c70c821eaf1bc4774d8d4f9da4df", "score": "0.7405848", "text": "function Renderer(){}", "title": "" }, { "docid": "f4e63a8152bc364ad62002544f44e70e", "score": "0.7355483", "text": "function _buildRenderer () {\n var Renderer = renderers[this.options.get('format')];\n if (!Renderer) {\n throw new Error(\"Don't know how to render \" + fmt);\n }\n return new Renderer({\n width: parseInt(this.options.get('numCols'), 10),\n addBaseClass: !!this.options.get('colouredBases'),\n initToolTip: this._initToolTip,\n onMouseEnter: this._baseMousedOver,\n onChangeSelection: this._registerSelectionHandler\n });\n}", "title": "" }, { "docid": "8490ce3b13a303a19184211b5a93c373", "score": "0.7203175", "text": "function Renderer() {\n\t\n\t /**\n\t * Renderer#rules -> Object\n\t *\n\t * Contains render rules for tokens. Can be updated and extended.\n\t *\n\t * ##### Example\n\t *\n\t * ```javascript\n\t * var md = require('markdown-it')();\n\t *\n\t * md.renderer.rules.strong_open = function () { return '<b>'; };\n\t * md.renderer.rules.strong_close = function () { return '</b>'; };\n\t *\n\t * var result = md.renderInline(...);\n\t * ```\n\t *\n\t * Each rule is called as independed static function with fixed signature:\n\t *\n\t * ```javascript\n\t * function my_token_render(tokens, idx, options, env, renderer) {\n\t * // ...\n\t * return renderedHTML;\n\t * }\n\t * ```\n\t *\n\t * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n\t * for more details and examples.\n\t **/\n\t this.rules = assign({}, default_rules);\n\t}", "title": "" }, { "docid": "a4f4ea6d1fe1a59745dcb168045b21fd", "score": "0.71072704", "text": "function Renderer() {\r\n }", "title": "" }, { "docid": "a4f4ea6d1fe1a59745dcb168045b21fd", "score": "0.71072704", "text": "function Renderer() {\r\n }", "title": "" }, { "docid": "38d8abd2c5c30334674b372abf0f27c5", "score": "0.7078711", "text": "function Renderer() {\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "09839f356fbcd58f07bd9e7cb5b74bc9", "score": "0.7057069", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n }", "title": "" }, { "docid": "a492fcaeb302e198c33688d1ccab9ea9", "score": "0.70567995", "text": "function Renderer() {\n }", "title": "" }, { "docid": "a492fcaeb302e198c33688d1ccab9ea9", "score": "0.70567995", "text": "function Renderer() {\n }", "title": "" }, { "docid": "a492fcaeb302e198c33688d1ccab9ea9", "score": "0.70567995", "text": "function Renderer() {\n }", "title": "" }, { "docid": "a492fcaeb302e198c33688d1ccab9ea9", "score": "0.70567995", "text": "function Renderer() {\n }", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "fbfb7f3c7dd6a1ed57c3c517495885e0", "score": "0.7014332", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "b97f1dcabb348eebcccab1bcc82765cb", "score": "0.69921416", "text": "function Renderer$1() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return '<b>'; };\n * md.renderer.rules.strong_close = function () { return '</b>'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign$2({}, default_rules$1);\n }", "title": "" }, { "docid": "54a2b6e9679028b4aca6a285258d0deb", "score": "0.69742316", "text": "function Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { this.tags.add('b'); return 'b({},'; };\n * md.renderer.rules.strong_close = function () { return ')'; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independed static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedJSX;\n * }\n * ```\n *\n * Any factory functions you use should be added to the tags set, so they'll\n * made available in your JSX's execution context:\n *\n * ```javascript\n * this.tags.add('strong')\n * ```\n **/\n this.rules = assign({}, default_rules);\n}", "title": "" }, { "docid": "72020427a54d852529f9a43ff2df9332", "score": "0.68983555", "text": "function BaseRenderer() {}", "title": "" }, { "docid": "0d1ca2d70e08e7800ff3ab2ca8a142ba", "score": "0.6888454", "text": "getRenderer() {\n if (!this.renderer) {\n this.renderer = new Console_1.ConsoleRenderer();\n }\n return this.renderer;\n }", "title": "" }, { "docid": "3edbbc0f0ce0196f30ce293052f4bfac", "score": "0.6810122", "text": "useRenderer(renderer) {\n this.renderer = renderer;\n return this;\n }", "title": "" }, { "docid": "f36514c4bdaea4896a2fe10453ac8e92", "score": "0.6649998", "text": "makeRenderer () {\n const renderer = new THREE.WebGLRenderer();\n renderer.setClearColor(0xFFFFFF);\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(this.container.scrollWidth, this.container.scrollHeight);\n return renderer;\n }", "title": "" }, { "docid": "50edbee7064cf20426e0fb6342784bd5", "score": "0.6591234", "text": "setRenderer(newRenderer) {\n\t this.elem.innerHTML = \"\";\n\t if (newRenderer === \"auto\" || newRenderer === \"webgl\") {\n\t try {\n\t this.renderer = new webglRenderer_1.WebGLRenderer(this);\n\t }\n\t catch (e) {\n\t console.error(e);\n\t newRenderer = \"canvas\";\n\t this.elem.innerHTML = \"\";\n\t }\n\t }\n\t if (newRenderer === \"canvas\") {\n\t try {\n\t this.renderer = new canvasRenderer_1.CanvasRenderer(this);\n\t }\n\t catch (e) {\n\t console.error(e);\n\t newRenderer = \"dom\";\n\t this.elem.innerHTML = \"\";\n\t }\n\t }\n\t if (newRenderer === \"dom\") {\n\t this.renderer = new domRenderer_1.DOMRenderer(this);\n\t }\n\t this.updateStyle(false);\n\t }", "title": "" }, { "docid": "dc40d3debe58261026cc14f56039fcb9", "score": "0.65305805", "text": "_initRenderer() {\n this.renderer = new Renderer({\n alpha: this.alpha,\n antialias: this.antialias,\n premultipliedAlpha: this.premultipliedAlpha,\n depth: this.depth,\n failIfMajorPerformanceCaveat: this.failIfMajorPerformanceCaveat,\n preserveDrawingBuffer: this.preserveDrawingBuffer,\n stencil: this.stencil,\n\n container: this.container,\n pixelRatio: this.pixelRatio,\n renderingScale: this._renderingScale,\n\n production: this.production,\n\n onError: () => this._onRendererError(),\n onSuccess: () => this._onRendererSuccess(),\n onContextLost: () => this._onRendererContextLost(),\n onContextRestored: () => this._onRendererContextRestored(),\n onDisposed: () => this._onRendererDisposed(),\n // keep sync between renderer planes, shader passes and render targets arrays and the Curtains ones\n onSceneChange: () => this._keepSync(),\n });\n\n this.gl = this.renderer.gl;\n this.canvas = this.renderer.canvas;\n }", "title": "" }, { "docid": "2fafc008358ca7d12060e45e28ac78f3", "score": "0.6435322", "text": "function Renderer(templates) {\n this.templates = templates;\n this.listener = undefined;\n this.started = false;\n\n return this;\n }", "title": "" }, { "docid": "280e446636c8116be82fddd3d6ffe2ad", "score": "0.6391868", "text": "function Renderer(options) {\n console.log('constructor', options);\n\n const cy = options.cy;\n const container = cy.container();\n\n const data = this.data = {};\n\n const canvas = data.canvas = document.createElement('canvas'); \n canvas.width = cy.width();\n canvas.height = cy.height();\n\n const context = data.context = canvas.getContext('2d');\n\n container.appendChild(canvas);\n}", "title": "" }, { "docid": "1140277ef8e78867b3d162d654bf9f70", "score": "0.638473", "text": "_initRenderer () {\n const { width, height } = this._canvas\n this._renderer = autoDetectRenderer({\n width,\n height,\n view: this._canvas,\n backgroundColor: 0x000000\n })\n }", "title": "" }, { "docid": "e37f737e4e4916461d067b2a393474a8", "score": "0.63702184", "text": "setUpRenderer_() {\n\t\tthis.renderer_ = getStaticProperty(this.constructor, 'RENDERER');\n\t\tthis.renderer_.setUp(this);\n\t}", "title": "" }, { "docid": "8a7cb7facfd175f67decc7ccbced3fbb", "score": "0.6340183", "text": "createRenderer(mimeType) {\n // Throw an error if no factory exists for the mime type.\n if (!(mimeType in this._factories)) {\n throw new Error(`No factory for mime type: '${mimeType}'`);\n }\n // Invoke the best factory for the given mime type.\n return this._factories[mimeType].createRenderer({\n mimeType,\n resolver: this.resolver,\n sanitizer: this.sanitizer,\n linkHandler: this.linkHandler,\n latexTypesetter: this.latexTypesetter\n });\n }", "title": "" }, { "docid": "6166bd490318ddb1c66e82fde9c96631", "score": "0.6327773", "text": "function ShallowRenderer() {\n this._renderer = TestUtils.createRenderer();\n}", "title": "" }, { "docid": "843da16fc5817ab06573dce31c2f0eb0", "score": "0.6322325", "text": "function createRenderer () {\n var renderer = new THREE.WebGLRenderer();\n renderer.setClearColor(new THREE.Color(0xEEEEEE), 1.0);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.shadowMap.enabled = true;\n this.crono_start();\n return renderer;\n}", "title": "" }, { "docid": "9e9c90b1a7e21b940f35e704ef4d8aca", "score": "0.62828124", "text": "function Renderer (ctx) {\n\t\tthis._ctx = ctx;\n\t\tthis.clearColor(\"cornflowerBlue\");\n\t}", "title": "" }, { "docid": "7f4193b7b5da3f3a7555eeecb0200947", "score": "0.6227083", "text": "createRenderable(/* renderer */) {\n\t\treturn null;\n\t}", "title": "" }, { "docid": "ecfe9e1bb65c817672c375b6d2729f6d", "score": "0.6222584", "text": "_createRenderer () {\n\t\t// create separate pane for canvas renderer\n\t\tthis._pane = this._map.createPane('particle-dispersion');\n\t\tthis._renderer = L.canvas({ pane: 'particle-dispersion' });\n\t}", "title": "" }, { "docid": "2726608dd0af177050ad8a192452268c", "score": "0.6193265", "text": "function CanvasRenderer() {}", "title": "" }, { "docid": "1e74eee235fd9b2da4f285c0787ee986", "score": "0.6169733", "text": "initializeRenderer () {\n const { width, height } = this.screenDimensions;\n this.renderer = new THREE.WebGLRenderer({\n canvas: this.canvas,\n antialias: true\n });\n this.renderer.setPixelRatio(1);\n this.renderer.setSize(width, height);\n }", "title": "" }, { "docid": "bf535dcef916ff1d3897801104f9fd0d", "score": "0.6119572", "text": "function createRenderer() {\n var renderer = new THREE.WebGLRenderer();\n renderer.setClearColor(new THREE.Color(0xCCEEFF ), 1.0);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.shadowMap.enabled = true;\n return renderer;\n}", "title": "" }, { "docid": "2ff6b12bbff7c822dff89f498a35aa48", "score": "0.6116728", "text": "function createRenderer () {\n var renderer = new THREE.WebGLRenderer();\n renderer.setClearColor(new THREE.Color(0xEEEEEE), 1.0);\n renderer.setSize(window.innerWidth, window.innerHeight);\n return renderer; \n}", "title": "" }, { "docid": "c3bff3648ff31e20bc41f52b9c4b8ceb", "score": "0.60672116", "text": "init() {\n // initiate the renderer if not done\n this.renderer.init({\n width: this.dimensions.width,\n height: this.dimensions.height,\n useOffscreenCanvas: true\n })\n }", "title": "" }, { "docid": "759cfa04f888e2536d8da94f2bcecada", "score": "0.600461", "text": "function createRenderer(){\r\n // set antialiasing on to remove jagged edges\r\n renderer = new THREE.WebGLRenderer( { antialias: true } );\r\n renderer.setSize(mainContainer.clientWidth, mainContainer.clientHeight);\r\n renderer.setPixelRatio( window.devicePixelRatio );\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = THREE.PCFSoftShadowMap; //THREE.BasicShadowMap | THREE.PCFShadowMap | THREE.PCFSoftShadowMap\r\n mainContainer.appendChild( renderer.domElement );\r\n}", "title": "" }, { "docid": "d3c3a322da07497a3959324ecc9bb9d3", "score": "0.598865", "text": "function initRenderer(additionalProperties) {\n\n\tvar props = ( typeof additionalProperties !== 'undefined' && additionalProperties) ? additionalProperties : {};\n\tvar renderer = new THREE.WebGLRenderer(props);\n\n\trenderer.setClearColor(new THREE.Color(0x000000));\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n\trenderer.shadowMap.enabled = true;\n\trenderer.shadowMapType = THREE.PCFSoftShadowMap;\n\tdocument.getElementById(\"container\").appendChild(renderer.domElement);\n\n\treturn renderer;\n}", "title": "" }, { "docid": "c6e46b4294c3a3fc15b2935d4d8bf449", "score": "0.597075", "text": "function Renderer(templates) {\n this.templates = templates;\n this.listener = [];\n this.started = false;\n this.varRegex = new RegExp(this.templates\n .var_brace_left +\n '[ ]?([A-Za-z0-9$\\\\._\\\\[\\\\]]*?)([ ]?\\\\|[ ]?.*?)?[ ]?' +\n this.templates.var_brace_right, 'g'\n );\n this.tagRegex = new RegExp(this.templates\n .tag_brace_left +\n '[ ]?([\\\\s\\\\S]*?)( [\\\\s\\\\S]*?)?[ ]?' +\n this.templates\n .tag_brace_right +\n '(([\\\\s\\\\S]*?)(?=' + this.templates\n .tag_brace_left + '[ ]?end\\\\1[ ]?' +\n this.templates\n .tag_brace_right + '))?', 'g');\n this.filterSplitter = new RegExp(\n '\\\\|[ ]?(?=' + utils.memberRegex(\n this.filters) + ')', 'g');\n this.errorHandler = null;\n return this;\n }", "title": "" }, { "docid": "10d08137ceb30791d0d4a889fcbc8076", "score": "0.5969582", "text": "function Renderer(templates) {\n this.templates = templates;\n this.listener = [];\n this.started = false;\n this.varRegex = new RegExp(this.templates.var_brace_left +\n '[ ]?([A-Za-z0-9$\\\\._\\\\[\\\\]]*?)([ ]?\\\\|[ ]?.*?)?[ ]?' +\n this.templates.var_brace_right, 'g');\n this.tagRegex = new RegExp(this.templates.tag_brace_left +\n '[ ]?([\\\\s\\\\S]*?)( [\\\\s\\\\S]*?)?[ ]?' + this\n .templates.tag_brace_right +\n '(([\\\\s\\\\S]*?)(?=' + this.templates.tag_brace_left +\n '[ ]?end\\\\1[ ]?' + this.templates.tag_brace_right +\n '))?', 'g');\n this.filterSplitter = new RegExp('\\\\|[ ]?(?=' +\n utils.memberRegex(this.filters) + ')', 'g');\n this.errorHandler = null;\n return this;\n }", "title": "" }, { "docid": "4e477e42840fd0fbdff02c3922902ba5", "score": "0.5950209", "text": "get renderer() {\n return this._renderer;\n }", "title": "" }, { "docid": "3b9ef02eee15e529bbbf5c286e2b22ef", "score": "0.59449345", "text": "function createRenderer () {\n var renderer = new THREE.WebGLRenderer();\n renderer.setClearColor(new THREE.Color(0x000000), 1.0);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = THREE.PCFSoftShadowMap;\n return renderer; \n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "f1775cf720390ed1de704e1744b618ac", "score": "0.5873363", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}", "title": "" }, { "docid": "b7edb1765907673cd2c0faad62811fd4", "score": "0.5868947", "text": "function initRenderer() {\n var oldYaw = 0;\n\n window.gl = null;\n\n if (bitcoinRenderer) {\n bitcoinRenderer.resetLoaded();\n oldYaw = bitcoinRenderer.angleYaw;\n }\n\n bitcoinRenderer = new BitcoinRenderer();\n\n bitcoinRenderer.coinModelType = config['model'];\n bitcoinRenderer.coinNormalType = config['normal'];\n bitcoinRenderer.coinSphericalMap = config['spherical'];\n bitcoinRenderer.tableTextureType = config['table'];\n\n bitcoinRenderer.init('canvasGL');\n bitcoinRenderer.angleYaw = oldYaw;\n }", "title": "" }, { "docid": "f60bf4df91da3073950dc43993587466", "score": "0.5833792", "text": "function createRendererType2(values) {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n }", "title": "" }, { "docid": "eb303a8d1b53ce24e1dbcffd82ea8379", "score": "0.578575", "text": "function initRenderer()\n{\n\trenderer = new THREE.WebGLRenderer({ antialias: true });\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n}", "title": "" }, { "docid": "619fa8ce5797f5b41b8b489f452a1e37", "score": "0.5768694", "text": "function createRenderer() {\n renderer = new THREE.WebGLRenderer({ antialias: true });\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.shadowMap.enabled = true;\n document.body.style.margin = 0;\n document.body.style.padding = 0;\n document.body.style.overflow = 'hidden';\n document.body.style.position = 'fixed';\n container.appendChild(renderer.domElement);\n window.addEventListener('resize', onWindowResize, false);\n}", "title": "" }, { "docid": "7fec36c06ff6d67ee5c4ee09d796a4a8", "score": "0.5745715", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n} // implementation", "title": "" }, { "docid": "7fec36c06ff6d67ee5c4ee09d796a4a8", "score": "0.5745715", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n} // implementation", "title": "" }, { "docid": "2644dfd2ad225e561fbb627e6aa0e528", "score": "0.57423234", "text": "function createMainRenderer() {\n // renderer\n renderer = new THREE.WebGLRenderer({\n antialias: true,\n \n });\n \n\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth, window.innerHeight);\n \n\n// // set the gamma correction so that output colors look\n // correct on our screens\n renderer.physicallyCorrectLights = true;\n // tone mapping\n renderer.toneMapping = THREE.NoToneMapping;\n renderer.outputEncoding =THREE.GammaEncoding;\n\n\n //adding shadow capabilities to the renderer\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = THREE.PCFSoftShadowMap;\n\n\n // add the output of the renderer to the html element\n container.appendChild(renderer.domElement);\n\n\n //make the pmrem generator if we need it\n pmremGenerator = new THREE.PMREMGenerator(renderer);\n pmremGenerator.compileCubemapShader();\n\n\n }", "title": "" }, { "docid": "1426bb0aa03abebc3ec8d9184bc6fe60", "score": "0.57408094", "text": "function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n var _ref = this.sheet ? this.sheet.options : {}, media = _ref.media, meta = _ref.meta, element = _ref.element;\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }", "title": "" }, { "docid": "3efdec0ff453c103de334058d1253bca", "score": "0.57345855", "text": "ClearRenderer()\n {\n if ( this.renderer == null )\n return;\n\n this.renderer.Clear();\n\n }", "title": "" }, { "docid": "6ef130929fc07a538c5e4a4592f04212", "score": "0.57247376", "text": "function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = []; // There is no sheet when the renderer is used from a standalone StyleRule.\n\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }", "title": "" }, { "docid": "6ef130929fc07a538c5e4a4592f04212", "score": "0.57247376", "text": "function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = []; // There is no sheet when the renderer is used from a standalone StyleRule.\n\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }", "title": "" }, { "docid": "6ef130929fc07a538c5e4a4592f04212", "score": "0.57247376", "text": "function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = []; // There is no sheet when the renderer is used from a standalone StyleRule.\n\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }", "title": "" }, { "docid": "741e08092578295e40f08d3341567737", "score": "0.57236487", "text": "createRenderer(options) {\n switch (options.mode) {\n case EnzymeAdapter.MODES.MOUNT: return this.createMountRenderer(options);\n case EnzymeAdapter.MODES.SHALLOW: return this.createShallowRenderer(options);\n case EnzymeAdapter.MODES.STRING: return this.createStringRenderer(options);\n default:\n throw new Error(`Enzyme Internal Error: Unrecognized mode: ${options.mode}`);\n }\n }", "title": "" }, { "docid": "e4555d8a0fe91472a416b54a1205b080", "score": "0.57163125", "text": "function createHydrationRenderer(options) {\r\n return baseCreateRenderer(options, createHydrationFunctions);\r\n}", "title": "" }, { "docid": "864ccfdc1eff42607513d82b0e9df6ac", "score": "0.5704636", "text": "newRender() {\n this.algHierarchy.clearRenderer()\n switch (this.viewMode) {\n case ViewModes.METASYSTEM:\n this.algHierarchy.renderMetasystem()\n break\n case ViewModes.XRAY:\n this.algHierarchy.render()\n break\n }\n }", "title": "" }, { "docid": "92f53c70814db8f18a37590ea5fc8c8c", "score": "0.56949896", "text": "function Renderer() {\n /**\n * A selector which matches the close icon node in a tab.\n */\n this.closeIconSelector = '.p-TabBar-tabCloseIcon';\n this._tabID = 0;\n this._tabKeys = new WeakMap();\n }", "title": "" }, { "docid": "92f53c70814db8f18a37590ea5fc8c8c", "score": "0.56949896", "text": "function Renderer() {\n /**\n * A selector which matches the close icon node in a tab.\n */\n this.closeIconSelector = '.p-TabBar-tabCloseIcon';\n this._tabID = 0;\n this._tabKeys = new WeakMap();\n }", "title": "" }, { "docid": "13223fc1266b855ce410933d9745eaab", "score": "0.5691836", "text": "function CanvasRenderer() {\n\n}", "title": "" }, { "docid": "149b14d3fa9478bd8194002e166cf70b", "score": "0.5687249", "text": "function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.hasInsertedRules = false;\n this.cssRules = []; // There is no sheet when the renderer is used from a standalone StyleRule.\n\n if (sheet) sheets.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" }, { "docid": "2077404b707cfe02a14ea2a731866779", "score": "0.5675488", "text": "function createHydrationRenderer(options) {\n return baseCreateRenderer(options, createHydrationFunctions);\n}", "title": "" } ]
cafbe292b514aa4612cde6edfd6669f4
Starts stop watch timer with a predefined start time.
[ { "docid": "3166416a24dad9856bd65b860f61e33b", "score": "0.0", "text": "function updateTimer(startTime) {\n et = elapsedTime(startTime, Date.now());\n $(\"#start\").text(et.hours+\":\"+et.minutes+\":\"+et.seconds);\n}", "title": "" } ]
[ { "docid": "4f4613cf0279c9b351ef31d1160d1a97", "score": "0.7388306", "text": "function startStopwatch() {\n if (stop) {\n stop = false;\n stopwatch();\n }\n}", "title": "" }, { "docid": "04568eb615f374a91d60c2346223bd5d", "score": "0.7245525", "text": "function start() {\n \n timer = true;\n stopwatch();\n}", "title": "" }, { "docid": "5f4c0b60dfd5882a2918e4792f704c4b", "score": "0.7238075", "text": "function startTime() {\n /* check if seconds, minutes, and hours are equal to zero and start the stop watch */\n if (seconds == 0 && minutes == 0 && hours == 0) {\n startWatch();\n }\n}", "title": "" }, { "docid": "83101ba1be73633d80fd32a66c4cbbc8", "score": "0.7092052", "text": "function startStopwatch(){\n // Prevent multiple intervals going on at the same time.\n clearInterval(stopwatchInterval);\n var startTimestamp = new Date().getTime(),\n runningTime = 0;\n localStorage.stopwatchBeginingTimestamp = startTimestamp;\n\n // The app remembers for how long the previous session was running.\n if(Number(localStorage.stopwatchRunningTime)){\n runningTime = Number(localStorage.stopwatchRunningTime);\n }\n else{\n localStorage.stopwatchRunningTime = 1;\n }\n\n // Every 100ms recalculate the running time, the formula is:\n // time = now - when you last started the clock + the previous running time\n stopwatchInterval = setInterval(function () {\n var stopwatchTime = (new Date().getTime() - startTimestamp + runningTime);\n\n stopwatchDigits.text(returnFormattedToMilliseconds(stopwatchTime));\n }, 100);\n\n stopwatchClock.removeClass('inactive');\n}", "title": "" }, { "docid": "c2125b0b711804481efc81d827c6abe5", "score": "0.7056587", "text": "function start_stop_timer () {\n if (start == false) {\n start = true;\n tick_down = setInterval(countdown, 1000);\n }\n else if (start == true) {\n start = false;\n clearInterval(tick_down);\n }\n }", "title": "" }, { "docid": "8198ad1cbcdc94265223ceee0d164269", "score": "0.69756836", "text": "function stopwatchStart(event){\n event.preventDefault();\n console.log('started');\n\n //every 10ms, update the stopwatch\n intervalId = setInterval(stopwatchUpdate, intervalRate)\n}", "title": "" }, { "docid": "3ac48b10f488a48b3fa7b72bbc68d254", "score": "0.6945845", "text": "function startStopwatch() {\n flag = true;\n initialDate = new Date;\n}", "title": "" }, { "docid": "e17e3c0e2b331566595e2ee81e6b891b", "score": "0.68940204", "text": "function startStop() {\n if (running) { // user wants to Stop\n clearInterval(running);\n setRunning(false);\n } else { // user wants to Start or Resume\n const start = new Date(new Date() - time); // start time is current time on the clock\n setRunning(setInterval(() => {\n setTime((new Date() - start))\n }, 10));\n }\n }", "title": "" }, { "docid": "389f877a0c4bccd17c2263a76cfb7a4d", "score": "0.6881228", "text": "_startTimer(start_time) {\n this.start_time = start_time // || Date.now()\n this.time = 0\n this.go = true\n this._tick()\n }", "title": "" }, { "docid": "b9fc63169d2d2c69f027f1e860c08d92", "score": "0.68735576", "text": "function startTimer(){\n clearInterval(interval);\n runClock();\n \n //console.log(\"timing\");\n }", "title": "" }, { "docid": "158b932d2e0d56ae52b579fc39f74f86", "score": "0.68014306", "text": "function startTimer () {\n timer.start();\n setTimeout(stopTimer,2000);\n}", "title": "" }, { "docid": "a08ed2b1583e24d35da5862e2b394584", "score": "0.67732006", "text": "function runTimer() {\n // Using ES5 Date.now() to get current timestamp \n var startTime = Date.now();\n var prevMinutes = minutes;\n var prevSeconds = seconds;\n\n timer = setInterval(function () {\n var timeElapsed = Date.now() - startTime;\n\n minutes = ((timeElapsed / 60000) + prevMinutes) % 60;\n seconds = ((timeElapsed / 1000) + prevSeconds) % 60;\n\n setStopwatch(minutes, seconds);\n }, 25);\n }", "title": "" }, { "docid": "f9ad7e3065b2da46c8ee48f5029c108c", "score": "0.6643581", "text": "function startWatch()\r\n{\r\n t=setInterval(stopWatch,1000);\r\n stopWatch();\r\n}", "title": "" }, { "docid": "d8454a24bf8e091ff4107b70ba841cb3", "score": "0.6630576", "text": "function startTimer(_timer){\n _timer.start({\n countdown: true,\n startValues: {\n seconds: 60\n }\n });\n}", "title": "" }, { "docid": "2b538bc0d6f7e4b4d77ba4c87fb0ce00", "score": "0.6628837", "text": "function start() {\n $('.stopwatch').show();\n elapsedTime = 0;\n startTime = Date.now() - elapsedTime;\n timerInterval = setInterval(function printTime() {\n elapsedTime = Date.now() - startTime;\n print(timeToString(elapsedTime));\n }, 1000);\n}", "title": "" }, { "docid": "750712d4d73ed98676f80e9c4c6082c4", "score": "0.6594784", "text": "function countdown(){ //displays the time left\r\n\tif(resuming)\r\n\t{\r\n\t\tresuming = false;\r\n\t\twatchRun = setInterval(countdown , 1000);\r\n\t}\r\n\tif(startIsClicked){\r\n\ttime--;\r\n\t}\t\r\n\t\tif(time >= 3600){\r\n\t\t\tif(Math.floor(time/3600) < 10) { //if the hours hand is less than 10 \r\n\t\t\t\tif(Math.floor(time/60)%60 >= 10){ //if the minute hand is greater than 10 \r\n\t\t\t\t\tif(time%60 >= 10){ //if the seconds hand is greater than 10\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"0\" + Math.floor(time/3600) + ':' + Math.floor(time/60)%60 + ':' + time%60 ; \t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"0\" + Math.floor(time/3600) + ':' + Math.floor(time/60)%60 + ':' + \"0\" + time%60 ;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{ //if the minute hand is less than 10 \r\n\t\t\t\t\tif(time%60 >= 10){\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"0\" + Math.floor(time/3600) + ':' + '0' + Math.floor(time/60)%60 + ':' + time%60 ; \t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"0\" + Math.floor(time/3600) + ':' + '0' + Math.floor(time/60)%60 + ':' + \"0\" + time%60;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{ //if the hours hand is greater than 10 \r\n\t\t\t\tif(Math.floor(time/60)%60 >= 10){ //if the minute hand is greater than 10 \r\n\t\t\t\t\tif(time%60 >= 10){ //if the seconds hand is greater than 10\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = Math.floor(time/3600) + ':' + Math.floor(time/60)%60 + ':' + time%60 ; \t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = Math.floor(time/3600) + ':' + Math.floor(time/60)%60 + ':' + \"0\" + time%60 ;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{ //if the minute hand is less than 10 \r\n\t\t\t\t\tif(time%60 >= 10){\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = Math.floor(time/3600) + ':' + '0' + Math.floor(time/60)%60 + ':' + time%60 ; \t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdocument.getElementById('stopwatch').innerHTML = Math.floor(time/3600) + ':' + '0' + Math.floor(time/60)%60 + ':' + \"0\" + time%60;\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\tif(time >= 60 && time < 3600){\r\n\t\t\tif(Math.floor(time/60) < 10 && time%60 < 10){\r\n\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"00:0\" + Math.floor(time/60) + ':' + \"0\" + time%60;\r\n\t\t\t}\r\n\t\t\telse if(Math.floor(time/60) < 10 && time%60 >= 10){\r\n\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"00:0\" + Math.floor(time/60) + ':' + time%60;\r\n\t\t\t}\r\n\t\t\telse if(Math.floor(time/60) >= 10 && time%60 < 10){\r\n\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"00:\" + Math.floor(time/60) + ':' + \"0\" + time%60;\r\n\t\t\t}\r\n\t\t\telse if(Math.floor(time/60) >= 10 && time%60 >= 10){\r\n\t\t\t\tdocument.getElementById('stopwatch').innerHTML = \"00:\" + Math.floor(time/60) + ':' + time%60;\r\n\t\t}\r\n\r\n\t\t}\r\n\t\tif(time >= 10 && time < 60){\r\n\t\t\tdocument.getElementById('stopwatch').innerHTML = \"00:\" + \"00:\" + time;\r\n\t\t}\r\n\t\telse if(time < 10 && time < 60) {\r\n\t\t\tdocument.getElementById('stopwatch').innerHTML = \"00:\" + \"00:\" + \"0\" + time;\r\n\t\t}\r\n\tif(time == 0 && startIsClicked === true) //checks if the time is up -- it is at the bottom, because we want the watch to update to 0 before stopping completely\r\n\t{\r\n\t\tclearInterval(watchRun);\r\n\t\twindow.alert(\"nice\");\r\n\t\tstartIsClicked = false;\r\n\t}\r\n}", "title": "" }, { "docid": "5c3d862ac588b0dbacddd5b7ef697af8", "score": "0.6589421", "text": "function startTimer (){\n var d = new Date();\n startTime = d.toLocaleTimeString(); //starts when start button is pushed\n elapsedTimeSec = 0;\n}", "title": "" }, { "docid": "228fcc33d7c7651d6ae28d03751fd70f", "score": "0.6584284", "text": "function timeStart() {\n\tif (!running) {\n\t\tintervalId = setInterval(timeDecrease, 1000);\n\t\trunning = true;\n\t}\n}", "title": "" }, { "docid": "772b6fa3b91a1fbe818d8a52c33ce53b", "score": "0.6554933", "text": "function startTiming() {\n started = true;\n timer = setInterval(timerFunc, 1000);\n}", "title": "" }, { "docid": "dd9168e1fc3140652a47ffbefe976b02", "score": "0.6504834", "text": "_startTimer() {\n const timerRunning = timer.intervalExists('countdownTimer');\n\n if (timerRunning) {\n return;\n }\n\n this._startTime = Date.now();\n timer.setInterval('countdownTimer', this._tick.bind(this), 1000);\n this._tick();\n }", "title": "" }, { "docid": "09581bf0f7ca967e503cfc5bd64825ea", "score": "0.6504414", "text": "function handleTimer(start) {\n\t\tif (start) {\n\t\t\ttimer = setInterval(function() {\n\t\t\t\tvar timeElapsed = new Date().getTime() - startTime;\n\t\t\t\t$('.time-text').html('Time: ' + timeElapsed);\n\t\t\t}, 1);\n\t\t} else {\n\t\t\tclearInterval(timer);\n\t\t}\n\t}", "title": "" }, { "docid": "31d81647b362afe9472f3cbab2dd8818", "score": "0.65036315", "text": "function start(){\n\tif(status === \"stopped\"){\n\t\tinterval = window.setInterval(stopWatch,1000);\n\t\tstatus = \"started\";\n\t}\n\n\n}", "title": "" }, { "docid": "233712ddc6af6fff018be092d6dcc5e9", "score": "0.6489352", "text": "function startTimer() {\r\n const seconds = parseInt(this.dataset.time);\r\n timer(seconds);\r\n}", "title": "" }, { "docid": "86ddc8a4f580157ef622449fe139aec3", "score": "0.64863", "text": "function start_stop() {\n\tvar btn = document.getElementById('start_stop_btn');\n\tvar start_date = new Date();\n\tvar start_time = start_date.getTime();\n\tif(running == 0) {\n\t\tbtn.value = 'Stop';\n\t\trunning = 1;\n\t\tcounter(start_time);\n\t}\n\telse {\n\t\tbtn.value = 'Start';\n\t\trunning = 0;\n\t\tflag_stop = 1;\n\t}\n}", "title": "" }, { "docid": "a49958a0ca6d40918f006c45548cc74a", "score": "0.6478661", "text": "function startStopWatch() {\n if (!running) {\n startTime = new Date().getTime();\n tableSize++;\n newRow = historyTable.insertRow(tableSize);\n \n newStart = newRow.insertCell(0);\n startLatitude = newRow.insertCell(1);\n startLongitude = newRow.insertCell(2);\n newStop = newRow.insertCell(3);\n stopLatitude = newRow.insertCell(4);\n stopLongitude = newRow.insertCell(5);\n elapsedTime = newRow.insertCell(6);\n newStart.innerHTML = Date(startTime);\n if (\"geolocation\" in navigator){\n navigator.geolocation.getCurrentPosition(startCoor);}\n else {\n startLatitude.innerHTML = \"N/A\";\n startLongitude.innerHTML = \"N/A\";\n }\n timeInterval = setInterval(getDisplayTime, 10);\n running = 1;\n paused = 0;\n saveToLocalStorage();\n }\n}", "title": "" }, { "docid": "43aa675db3c6035ad9c5ec44cdf64033", "score": "0.64678687", "text": "function startTimer() {\n if (stoptime == true) {\n stoptime = false;\n timerCycle();\n }\n}", "title": "" }, { "docid": "225579f61c120a775b8bae149c1d52b7", "score": "0.64644086", "text": "function onStart() {\n\tif (start) {\n\t\telem.textContent = 'STOPWATCH has already started.';\n\t}\n\t// Clear exiting interval\n\tif (intv) {\n\t\tclearInterval(intv);\n\t}\n\tintv = setInterval(function() {\n\t\telem.textContent = duration++ + ' seconds';\n\t}, 1000);\n\tstart = true;\n}", "title": "" }, { "docid": "873ca3eb2f2fefbba48e40ff04acf896", "score": "0.64606124", "text": "function startTimer() {\n second = 0, minute = 0;\n clearInterval(interval);\n interval = setInterval(timer, 1000);\n }", "title": "" }, { "docid": "d093ad8f643f6ca60d8e19787e493078", "score": "0.6432753", "text": "function startStop(){\n\t!interval ? startTimer() : stopTimer()\n}", "title": "" }, { "docid": "8b55f3722247e999785ac37c17b9e338", "score": "0.64173466", "text": "_startStopWatch() {\n let timer = TimerMixin.setInterval(() => {\n var seconds = (Number(this.state.seconds) + 1).toString(),\n minutes = this.state.minutes,\n hours = this.state.hours;\n\n if (Number(this.state.seconds) === 59) {\n minutes = (Number(this.state.minutes) + 1).toString();\n seconds = '00';\n }\n\n if (Number(this.state.minutes) === 59) {\n hours = (Number(this.state.hours) + 1).toString();\n minutes = '00';\n seconds = '00';\n }\n\n this.setState({\n hours: hours.length === 1 ? '0' + hours : hours,\n minutes: minutes.length === 1 ? '0' + minutes : minutes,\n seconds: seconds.length === 1 ? '0' + seconds : seconds,\n });\n }, 1000);\n this.setState({\n timer: timer,\n recordStartTimeInMillis: new Date().getTime(),\n });\n }", "title": "" }, { "docid": "b86311e004501fcb2544abe4c84ae9eb", "score": "0.64146537", "text": "stopTimer() {\n if (this.start) {\n this.totalTime = new Date().getTime() - this.start;\n }\n }", "title": "" }, { "docid": "28e2f216730adec40df24a07d98f7f72", "score": "0.6408678", "text": "function startStopTimer() {\n if (!running) {\n running = true;\n $('#timer').css('color', '#0f0');\n interval = setInterval(function() {\n time += 0.01;\n $('#timer').html(time.toFixed(2));\n }, 10);\n } else {\n $('#timer').css('color', 'yellow');\n clearInterval(interval);\n running = false;\n }\n\n }", "title": "" }, { "docid": "83cfda3e4dcbb9e8824dfb3e9567c2d1", "score": "0.6400747", "text": "function startTimer() {\n if (!timerStarted) {\n var timeArray = timeString.split(':');\n var totalMilliseconds = ((parseInt(timeArray[0]) * 60) + (parseInt(timeArray[1]))) * 1000;\n setupTimer(0, totalMilliseconds);\n }\n}", "title": "" }, { "docid": "bcc569f3cdb4a72fd742d3d11170a700", "score": "0.63704264", "text": "function startTimer() {\n if (stoptime == true) {\n stoptime = false;\n timerCycle();\n }\n}", "title": "" }, { "docid": "02b12caf4c6e9894f1f0ef734923dad4", "score": "0.6359387", "text": "function startTimer() {\n var min,\n sec;\n\n min = Math.floor(time / 60);\n sec = time - (min * 60);\n sec = (sec < 10) ? '0' + sec : sec;\n\n elements.timeDisplay.innerHTML = min + ':' + sec;\n\n timer = setInterval(function () {\n var min,\n sec;\n\n time += 1;\n\n min = Math.floor(time / 60);\n sec = time - (min * 60);\n sec = (sec < 10) ? '0' + sec : sec;\n\n elements.timeDisplay.innerHTML = min + ':' + sec;\n }, 1000);\n }", "title": "" }, { "docid": "c971ad76eb12df835f97a3cde2f4c2c0", "score": "0.6329251", "text": "function manageTimer(state) {\n console.log(\"begin manageTimer -- state= \" + state + \" STOPWATCHTIMER= \" + STOPWATCHTIMER);\n\n if(state === \"start\") {\n STOPWATCHTIMER = setInterval('runStopwatch(\"run\")',1000);\n } else { // if (state == \"stop\") { any param value other than start should get rid of timer\n clearTimeout(STOPWATCHTIMER);\n }\n\n console.log(\"end manageTimer -- state= \" + state + \" STOPWATCHTIMER= \" + STOPWATCHTIMER);\n}", "title": "" }, { "docid": "3be73085ef40b28c5c8d2a6f69a57e13", "score": "0.6314704", "text": "function timerStarter() {\n var start = new Date().getTime(); // keeps the start time for calculations\n\n // updates the timer every second\n clearInterval(timer);\n timer = setInterval(function(){\n var time = new Date().getTime() - start; // gets the elapsed time since start\n var seconds = Math.floor((time % (1000 * 60)) / 1000);\n var minutes = Math.floor((time % (1000 * 60 * 60)) / (1000 * 60));\n var hours = Math.floor((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n\n // Display the result in the element with id=\"timer\"\n if (seconds < 10) { seconds = \"0\"+seconds}\n if (minutes < 10) { minutes = \"0\"+minutes}\n $('#timer').text(hours + \":\" + minutes + \":\" + seconds);\n }, 1000);\n }", "title": "" }, { "docid": "ea173e8ca2657aa588c1e9de25d1cc3d", "score": "0.63025576", "text": "function alfred_stopwatch() {\n\t\tvar stopwatch_end = $( '#_log_duration' ).val();\n\t\tif ( stopwatch_end != \"\" ) {\n\t\t\tstopwatch_end = $( '#_log_duration' ).val().split( ':' );\n\t\t\t\n\t\t\t$( '#stopwatch-clock .display .sec' ).html( stopwatch_end[2] );\n\t\t\t$( '#stopwatch-clock .display .min' ).html( stopwatch_end[1] );\n\t\t\t$( '#stopwatch-clock .display .hr' ).html( stopwatch_end[0] );\n\t\t}\n\t\t\n\t\t$( '#stopwatch-clock .start' ).click(function() {\n\t\t\talfred_update_stopwatch( 'start' );\n\t\t});\n\t\t\n\t\t$( '#stopwatch-clock .stop' ).click(function() {\n\t\t\talfred_update_stopwatch( 'end' );\n\t\t});\n\t\t\n\t\t$( '#stopwatch-clock .reset' ).click(function() {\n\t\t\talfred_update_stopwatch( 'reset' );\n\t\t});\n\t}", "title": "" }, { "docid": "1092f21d2cbdd1165ecad106c8974452", "score": "0.62996286", "text": "startTimer() {\n this.timer.start = new Date();\n }", "title": "" }, { "docid": "3180086995acd80691d25778d09ef1f3", "score": "0.629513", "text": "startTimer() {\n this.start = new Date().getTime();\n }", "title": "" }, { "docid": "fbc136d088305f69ede4d880353f0cc3", "score": "0.629292", "text": "function startTimer(){\n buttonManager([\"start\",false],[\"stop\",true],[\"pause\",true]);\n freezeInput();\n\n timerObj.timerId=setInterval(function(){\n timerObj.second--;\n if(timerObj.second<0)\n {\n if(timerObj.minute==0)\n {\n soundAlarm();;\n return stopTimer();\n }\n timerObj.second=59;\n timerObj.minute--;\n }\n updateValue(\"minute\",timerObj.minute);\n updateValue(\"second\",timerObj.second);\n },1000);\n}", "title": "" }, { "docid": "3f626af582ba8cd2bf71567fef6f9b38", "score": "0.62834567", "text": "function startTimer(){\n startTime = Date.now();\n interval = window.setInterval(printTime, 20);\n}", "title": "" }, { "docid": "f9e09ca2217f67210105a2f9ed97045e", "score": "0.6276786", "text": "function stopTimer(){\n clearInterval(start);\n }", "title": "" }, { "docid": "81928a8d0c93b44b7cd628f1a3067385", "score": "0.6268333", "text": "function startTheClock() {\n\t// Reset running timer\n\tstopTimer();\n\trunningTimer = setInterval(function(){\n\t\ttimePlayed(runTime, \"\");\n\t}, 500);\n\t// Record restarting/starting time\n\tstartTime = Date.now();\n}", "title": "" }, { "docid": "3f824bef944179b33e5ad11af1996aa5", "score": "0.62678814", "text": "function startTimer() {\n\tif (running) {\n\t\treturn;\n\t}\n\tstartTime = new Date();\n\trunning = true;\n\tinterval = setInterval(\"count()\", 1);\n\n\tvar button = document.getElementById(\"startstop\");\n\tbutton.innerHTML = \"Stop\";\n\tbutton.setAttribute(\"onclick\", \"stopTimer()\");\n\tbutton.style.backgroundColor = \"#f44336\";\n\n\tvar table = document.getElementById(\"tbody\");\n\tvar newRow = table.insertRow(table.rows.length);\n\tfor (i = 0; i < 5; i++) {\n\t\tnewRow.insertCell(i);\n\t}\n\n\tinsertTimeEntry(startTime, 0);\n\tinsertLocationEntry(1);\n}", "title": "" }, { "docid": "419d22c090287f90f6cc5bb3cc59ecb2", "score": "0.62517816", "text": "function startTimeCounter() {\n\tclearInterval(interval);\n\tinterval = setInterval(startTimer, 10);\n}", "title": "" }, { "docid": "1d3559cca0a189f11cc03911988d2228", "score": "0.62475336", "text": "function stopWatch(clock) {\n let time;\n\n if (start === true) {\n time = setTimeout(adjustClock, 1000, clock);\n }\n else {\n clearTimeout(time);\n }\n }", "title": "" }, { "docid": "62bddb4920f0e324e0aa1f6a463153ed", "score": "0.62438184", "text": "function startTimer () {\n\t\ttrigger = setInterval(timeCounter,1000);\n}", "title": "" }, { "docid": "ced6153feb25d364256c2216aedb2eb7", "score": "0.62245655", "text": "function startTimer() {\n timer = setTimeout(startTimer, 1000);\n if (min === 0 && sec === 0) { // countdown is still running\n formatTime(min, sec);\n clearTimeout(timer);\n sessionOn = false;\n } else {\n if (min > 0 && sec === 0) {\n min--;\n sec = 59;\n formatTime(min, sec); // updates the display\n } else {\n sec--;\n formatTime(min, sec);\n }\n }\n }", "title": "" }, { "docid": "0b5ed08561e605c2eb7907394b834f5f", "score": "0.62183094", "text": "function startTimer() {\n p.timeOfStart = p.millis();\n p.timeOut1 = setTimeout(() => {\n p.ready = true;\n }, p.props.startTime * 1000);\n }", "title": "" }, { "docid": "b95025b0f280a2ceca91e58197799d8c", "score": "0.6218077", "text": "start() {\n if(this._timer !== null) {\n throw \"Timer already running!\";\n }\n this.counter = this.options.time;\n this._timer = setInterval(this._countDown.bind(this), 1000);\n if(this.onStart) {\n this.options.onStart(this);\n }\n }", "title": "" }, { "docid": "7fd8f4bcd6295dcc902e4fe4d46b5972", "score": "0.62159777", "text": "function start_timer() {\n effort_start = Date.now();\n timer_running = true;\n\n update_time();\n}", "title": "" }, { "docid": "b590dac1c939be2f83c915eae400c5a0", "score": "0.62063617", "text": "start () {\n if (this.isRunning()) {\n this.stop();\n }\n this._started = getNow();\n this._startTimer();\n this._config.on_start();\n }", "title": "" }, { "docid": "471d17c6b2a8ccb048c9d4bcb627e256", "score": "0.6188038", "text": "function starttimer(){\n var timeInMinutes = 10;\n var currentTime = Date.parse(new Date());\n var deadline = new Date(currentTime + timeInMinutes*60*1000);\n endtime = deadline\n initializeClock('clockDiv', deadline) \n}", "title": "" }, { "docid": "5ff36982f65098d7882dc8747259a723", "score": "0.6165262", "text": "function timerStart(){\r\n if(isRunningTime === false){\r\n // setInterval(timer, 1000);\r\n isRunningTime = true;\r\n }\r\n}", "title": "" }, { "docid": "996df35c584e1792d0bff3d480a90276", "score": "0.616391", "text": "function setTimer() {\n stop = setInterval(myTimer, 1000);\n}", "title": "" }, { "docid": "950611167712d228d8a8f38944c6ed51", "score": "0.61613643", "text": "startTimer() {\n if (!this.paused) {\n this.resetTime();\n }\n this.time = window.setInterval(this.updateTimer.bind(this), 1000);\n this.paused = false;\n }", "title": "" }, { "docid": "4c4ca1a2cadc9b8d42eb514caa29617e", "score": "0.6154479", "text": "function startTimer(cmd) {\n switch (cmd) {\n case 'start':\n gameTimer = setInterval(timer, 1000);\n break;\n case 'stop':\n clearInterval(gameTimer);\n break;\n case 'reset':\n clearInterval(gameTimer);\n seconds = 0;\n minutes = 0;\n tseconds = `00`;\n tminutes = `00`;\n spanTimer.innerText = `${tminutes}:${tseconds}`;\n break;\n }\n}", "title": "" }, { "docid": "2c5000c456cd1003721d637aeae9f382", "score": "0.614956", "text": "function startTimer() {\n console.log('start timer')\n startTime = new Date()\n\n setInterval(() => {\n let currentTime = new Date() - startTime\n clock.innerText = currentTime\n },1000) \n // start the visible clock\n}", "title": "" }, { "docid": "d7e0efe81f9bc4bc141015578ec616d8", "score": "0.6148713", "text": "function start()\n{\n\trunning = true;\n\tdocument.getElementById('stop').disabled = false;\n\tdocument.getElementById('start').disabled = true;\n\t//esto ejecuta update() cada 0.2 segundos.\n\tclock = setInterval(function()\n\t{\n\t\tupdate();\n\t}, delay);\n}", "title": "" }, { "docid": "2f7160474f06e6a5ec2d031660080b1e", "score": "0.61427826", "text": "function startTimer() {\n if (!clockRunning) {\n intervalId = setInterval(count, 1000);\n clockRunning = true;\n }\n}", "title": "" }, { "docid": "b98fa184b375390bbdf5519d675d5c63", "score": "0.61427605", "text": "function onStop() {\n\tif (!start) {\n\t\telem.textContent = \"STOPWATCH hasn't started yet.\";\n\t}\n\tclearInterval(intv);\n\tduration = 0;\n\tstart = false;\n\telem.textContent = duration + ' seconds';\n}", "title": "" }, { "docid": "28a822147b418348f2480ba99b312daf", "score": "0.6132816", "text": "function start()\n{\n if (!clockRunning)\n {\n intervalId = setInterval(countDown, 1000);\n clockRunning = true;\n }\n}", "title": "" }, { "docid": "110f7fe65c2f4584c8daba48f7ebcb33", "score": "0.61232", "text": "start() {\n\t\tthis.timer = -1;\n\t\tthis.timer = this.ticker.timeout(function(dt) {\n\t\t\tthis.tick(dt);\n\t\t\tif (this.timer)\n\t\t\t\tthis.start();\n\t\t}.bind(this), this.timeStep);\n\t}", "title": "" }, { "docid": "c851684cf0400ab12bccf069bbe4a9e0", "score": "0.61113006", "text": "start() {\n this.times = [...this.schedule.keys()].sort((a, b) => a - b);\n this.startTime = new Date().getTime();\n this.tick();\n }", "title": "" }, { "docid": "8686e5fb69a0ea3348ce72a172b8796b", "score": "0.6111189", "text": "function start() {\n x = setInterval(timer, 1000);\n }", "title": "" }, { "docid": "b7518244a704765da657242fc28337b4", "score": "0.61009425", "text": "function startTimer() {\n timeValue = 0;\n window.clearInterval(time);\n time = window.setInterval(onTimerTick, 1000);\n}", "title": "" }, { "docid": "78e79a199c0a6e578f9e72b80154374d", "score": "0.6100637", "text": "function startTimer(){\n calculateTime(true)\n}", "title": "" }, { "docid": "1e796effe60a93125e5c85fd3beb3473", "score": "0.609034", "text": "function timecounter(starttime)\n{\n currentdate = new Date();\n lapdetails = document.getElementById('lapdetails');\n stopwatch = document.getElementById('stopwatch');\n \n var timediff = currentdate.getTime() - starttime;\n if(runningstate == 0)\n {\n timediff = timediff + stoptime //stoptime=0\n }\n if(runningstate == 1)\n {\n\t\t\tmFormattedDuration = formattedtime(timediff);\n\t\t\t\n stopwatch.value = mFormattedDuration;\n\t\t\tstopwatch.innerHTML = mFormattedDuration;\n refresh = setTimeout('timecounter(' + starttime + ');',10); \n }\n else\n {\n window.clearTimeout(refresh);\n stoptime = timediff;\n }\n}", "title": "" }, { "docid": "07141e8a0c37f7124cb9144027194dae", "score": "0.6067337", "text": "start() {\n this.startTime = this.nowObj.now();\n }", "title": "" }, { "docid": "f8d9021cc49fb24d019c35c8baf58d65", "score": "0.60655105", "text": "start(t) {\n this.timerHandle = setTimeout(() => this.handleDelayElapsed(), t);\n }", "title": "" }, { "docid": "953fcf4a857f884e1254d8b2e42dfdb5", "score": "0.6058939", "text": "function startStop() { /* Toggle StartStop */\n startstop = startstop + 1;\n //chrome.browserAction.setBadgeText({text: '00:00'});\n if (startstop === 1) {\n //reset();\n start();\n }\n else if (startstop === 2) {\n startstop = 0;\n stop();\n //loadData();\n }\n}", "title": "" }, { "docid": "2b66163aa9d1fa70133ea37c67dcb5a5", "score": "0.6058269", "text": "start() {\n this._timer.start();\n }", "title": "" }, { "docid": "610c4400def0c3e120561c3460569121", "score": "0.60575014", "text": "function start() {\n\n //current time status\n getCurrentTime();\n onStart = millisec;\n // console.log(onStart);\n\n\n // capture startTime and save it to log\n var start = document.getElementById(\"Start\").innerHTML;\n if(start === \"Start\"){\n startTime = document.getElementById(\"timer\").innerHTML;\n localStorage.setItem(\"startTime\", startTime);\n var table = document.getElementById(\"log-display\");\n var row = table.insertRow(-1);\n var cell1 = row.insertCell(0);\n cell1.innerHTML = startTime;\n }\n\n\n //if clock is stop i.e when start \n if (!isRunning) {\n isRunning = true;\n increment();\n document.getElementById(\"Start\").innerText = \"Resume\"; \n } \n}", "title": "" }, { "docid": "87b7299f73c80a5f8fe3823587b7888b", "score": "0.60354394", "text": "function startTimer() {\n if (!timerRunning) {\n intervalId = setInterval(countdown, 1000);\n timerRunning = true;\n };\n }", "title": "" }, { "docid": "9b75ac69b80d4052a26847ba85f28a4c", "score": "0.6031396", "text": "function StopWatch(){\r\n // btnlap.addEventListener('click',function(){\r\n // return\r\n // })\r\n start_btn.addEventListener('click',function(e){\r\n e.preventDefault();\r\n if(is_on==true){\r\n start_btn.src='img/play.png'\r\n inter_time=time;\r\n clearInterval(EL);\r\n time=inter_time;\r\n is_on=false;\r\n }\r\n else{\r\n\r\n console.log(time)\r\n EL=setInterval(() => {\r\n seconds=parseInt(p_sec.textContent)\r\n minutes=parseInt(p_min.textContent)\r\n milisecond=parseInt(p_mili.textContent)+1;\r\n\r\n if(milisecond==99) {\r\n time++;\r\n p_sec.textContent=`${seconds+1}`.padStart(2,0);\r\n time=0;\r\n p_mili.textContent=`${time}`.padStart(2,0);\r\n \r\n }\r\n else if( seconds==59){\r\n \r\n seconds=0;\r\n p_sec.textContent=`${seconds}`.padStart(2,0);\r\n p_min.textContent=`${minutes+1}`.padStart(2,0); \r\n }\r\n else {\r\n p_mili.textContent=`${time}`.padStart(2,0);\r\n time++\r\n }\r\n \r\n }, interval);\r\n start_btn.src='img/pause.png'\r\n is_on=true;\r\n }\r\n \r\n })\r\n stop_btn.addEventListener('click',function(){\r\n clearInterval(EL)\r\n p_min.textContent='00';\r\n p_sec.textContent='00';\r\n p_mili.textContent='00';\r\n start_btn.src='img/play.png'\r\n LapSection.innerHTML=\"\"\r\n is_on=false;\r\n })\r\n}", "title": "" }, { "docid": "8957ae1e02d571f7b01e914264ad8c36", "score": "0.6023785", "text": "function startTimer(sec) {\n if (!isTimerRunning){\n intervalId = setInterval(function() {countdown(sec);}, 1000);\n isTimerRunning = true;\n }\n}", "title": "" }, { "docid": "818bba3d8119badb19d352c52f436821", "score": "0.60209423", "text": "function start_timer() {\n set_timer(10);\n timer_id = setInterval(function() {\n decrement_time()\n }, 1000);\n}", "title": "" }, { "docid": "d8aac4c147e5de31ffd94ba7a171d69d", "score": "0.6020892", "text": "function startTimer() {\n\t$stopBtn.removeAttr('disabled');\n\tvar minutes = $minutes.val();\n\tvar secs = $secs.val();\n\tif (/[e.+-]/.test(minutes) || /[e.+-]/.test(secs) || '' === secs || '' === minutes) {\n\t\tmodal.style.display = \"block\";\n\t}\n $startBtn.attr('disabled', 'true');\n $minutes.attr('disabled', 'true');\n $secs.attr('disabled', 'true');\n if (firstClick) {\n\t\tworkTime = timeInSecs(minutes, secs);\n\t\tif (workTime <= 0) {\n \t\t\tmodal.style.display = \"block\";\n\t\t}\n\t\tfirstClick = false;\n }\n timeLeft = timeInSecs(minutes, secs);\n\n interval = setInterval(display, 1000);\n\n}", "title": "" }, { "docid": "fa2fff6ebf8c3e915c83460e5160143f", "score": "0.6020815", "text": "function Stopwatch() {\n //\n var _startTime = 0; // Time of last start / resume. (0 if not running)\n var _baseTime = 0; // Time on the clock when last stopped in milliseconds\n\n //\n // Properties.\n //\n Object.defineProperty(this, 'isRunning', {\n get: function() { return (_startTime !== 0) ? true: false; }\n });\n\n Object.defineProperty(this, 'elapsedMilliseconds', {\n //\n get: function() {\n //\n return (\n _baseTime +\n (this.isRunning===true) ? now()-_startTime : 0\n ); \n }\n });\n\n //\n // Private methods.\n //\n // var now = function() {\n // return (new Date()).getTime();\n // }; \n function now() {\n return (new Date()).getTime();\n }\n\n //\n // Privileged methods.\n //\n // Start or resume\n this.start = function() {\n //_startAt = _startAt ? _startAt : now();\n _startTime = (this.isRunning===true) ? _startTime : now();\n };\n\n // Stop or pause\n this.stop = function() {\n // If running, update elapsed time otherwise keep it\n //_lastDuration = _startAt ? _lastDuration + now() - _startAt : _lastDuration;\n _baseTime = (\n (this.isRunning === true) ?\n _baseTime + (now() - _startTime) :\n _baseTime\n );\n\n _startTime = 0; // Paused\n };\n\n // Reset\n this.reset = function() {\n _startTime = 0;\n _baseTime = 0;\n };\n\n // // Duration\n // this.elapsedMilliseconds = function() {\n // //\n // return (\n // _baseTime +\n // (this.isRunning===true) ? now()-_startTime : 0\n // ); \n // }\n}", "title": "" }, { "docid": "857d3a4737e25cec8600a6e30cdc3e19", "score": "0.60105276", "text": "function startStopTimer(){\r\n if (checker){\r\n clearInterval(newInterval);\r\n checker = false;\r\n document.getElementById(\"startBtn\").innerHTML = \"Start\";\r\n }else {\r\n newInterval = setInterval(timer, 10);\r\n checker = true;\r\n document.getElementById(\"startBtn\").innerHTML = \"Stop\";\r\n }\r\n}", "title": "" }, { "docid": "80724e503da39dbe05ce92caa96d92b2", "score": "0.6002361", "text": "function do_start(){\n\t\t\tif( active ==0)\n\t\t\t\treturn;\n\t\t timeObject.timer = setInterval(do_time, 100);\n\t\t}", "title": "" }, { "docid": "f153ccd3b4ac5cdc054efe2dfe825df8", "score": "0.5983493", "text": "function Stopwatch() {\n let startTime,\n endTime,\n running,\n duration = 0;\n this.start = function () {\n if (running) {\n throw new Error(\"Stopwatch already started\");\n }\n running = true;\n startTime = new Date();\n };\n this.stop = function () {\n if (!running) {\n throw new Error(\"Stopwatch not started\");\n }\n running = false;\n endTime = new Date();\n const seconds = (endTime.getTime() - startTime.getTime()) / 1000;\n duration += seconds;\n };\n this.reset = function () {\n startTime = null;\n endTime = null;\n duration = 0;\n running = false;\n };\n Object.defineProperty(this, \"duration\", {\n get: function () {\n return duration;\n },\n });\n}", "title": "" }, { "docid": "d2de9c5c8ac0a7c3661ce0c2f254e82c", "score": "0.59794295", "text": "function start(){\n console.log('started');\n document.getElementById('start-button').style.display = \"none\";\n document.getElementById('stop-button').style.display = \"block\";\n timer();\n}", "title": "" }, { "docid": "75231b387ecec79f24bd9ff561b55f49", "score": "0.5979297", "text": "function start_stop(id){\r\n\tvar btn=document.getElementById((\"btn\"+id));\r\n\tif(btn.innerHTML==\"Stop\")//Stop\r\n\t\tpausetimer(btn,id);\r\n\telse//Start\r\n\t\tresumetimer(btn,id);\r\n}", "title": "" }, { "docid": "5371add966d8a77a4a782a06a138b2be", "score": "0.5979264", "text": "function timer(start, array, stop) {\n if (start) {\n if (!array.timer) {\n array.timer = true;\n array.start = new Date().getTime();\n return Math.ceil((new Date().getTime() - array.start)/1000)\n }\n else {\n // returns time since start\n return Math.ceil((new Date().getTime() - array.start)/1000);\n }\n }\n if (stop) {\n array.timer = false;\n // stop timer\n clearInterval(array.clock);\n return Math.floor((new Date().getTime() - array.start)/1000);\n }\n }", "title": "" }, { "docid": "c6e4bd6ee5d5091943616b91eac050ad", "score": "0.5974653", "text": "start() \n { \n this.setState({ start: new Date() })\n this.timer = setInterval(() => {\n // this.setState MUST be used to make changes (otherwise, the component won't rerender)\n this.setState({\n time: new Date()\n });\n }, 10);\n }", "title": "" }, { "docid": "7067d9416ba8a2776c8a71295cd6da57", "score": "0.59707475", "text": "function start() {\n startTime = Date.now() - elapsedTime;\n timerInterval = setInterval(function printTime() {\n elapsedTime = Date.now() - startTime;\n print(timeToString(elapsedTime));\n }, 10);\n}", "title": "" }, { "docid": "454ec0cdfe97b4985125246de1e932bd", "score": "0.595102", "text": "function start() {\n // clear interval if already running\n clearInterval(timeInterval);\n\t// get an absolute date based on remaining time\n\tdeadline = new Date(Date.parse(new Date()) + remainingTime * 1000);\n\t// change state and timer background color\n\tstate = \"start\";\n\tbgColor = bgGreen;\n\t// start the intervals for the work session\n\tinitializeClock(deadline);\n}", "title": "" }, { "docid": "71c27f28616ae4444920523bd75e66d8", "score": "0.59496504", "text": "function startTimer() {\n\t$(\"#myButton\").html(\"Stop!\");\n\t$(\".timerName\").html(\"Timer name: \" + $(\"#myTimer\").val());\n\tvar startTime = new Date;\n\tvar timerId = setInterval(function() {\n\t\t$(\".timerDisplay\").text(\"Current active timer: \" + (new Date - startTime) / 1000);\n\t}, 50);\n\tdocument.getElementById(\"myButton\").onclick = function() { stopTimer(timerId); };\n\t$.ajax({\n\t\turl: \"/start\",\n\t\tdata: JSON.stringify({timerName: $(\"#myTimer\").val(), startTime: startTime, isNew: false}),\n\t\tdataType: \"json\",\n\t\ttype: \"POST\"\n\t}).done(function(data) {\n\t});\n}", "title": "" }, { "docid": "777712e2b947e1c09f978e46052d7084", "score": "0.59462607", "text": "function startTimer() {\n\t\tonTimerTicked();\n\t}", "title": "" }, { "docid": "9930f72d6f3ad8053e03b931caf2e555", "score": "0.5941001", "text": "TimerStart() {\n if (this.state.timerStopped) {\n setInterval(() => {\n this.setState({ timerStarted: true, timerStopped: false })\n if (this.state.timerStarted) {\n if (this.state.seconds >= 60) {\n this.setState((prevState) => ({ minutes: prevState.minutes + 1, seconds: 0 }))\n }\n this.setState((prevState) => ({ seconds: prevState.seconds + 1 }))\n }\n }, 1000)\n }\n }", "title": "" }, { "docid": "1daf6bc4d6b1d8fa2cc7b67967d2a332", "score": "0.59402055", "text": "function Stopwatch(){\n var startTime, endTime, instance = this;\n\n this.start = function (){\n startTime = new Date();\n };\n\n this.stop = function (){\n endTime = new Date();\n }\n\n this.clear = function (){\n startTime = null;\n endTime = null;\n }\n\n this.getSeconds = function(){\n if (!endTime){\n return 0;\n }\n return (endTime.getTime() - startTime.getTime()) / 1000;\n }\n\n this.getMinutes = function(){\n return instance.getSeconds() / 60;\n } \n this.getHours = function(){\n return instance.getSeconds() / 60 / 60;\n } \n this.getDays = function(){\n return instance.getHours() / 24;\n } \n}", "title": "" }, { "docid": "968ddefad9e6ed33f5b4934c277901b1", "score": "0.5934912", "text": "function start_time() {\n tick();\n setInterval(tick, 1000);\n}", "title": "" }, { "docid": "6af65607282885623da7f7482e1d39c9", "score": "0.59334624", "text": "function startTimer() {\n intervalId = setInterval(counter, 1000);\n clearTimeout(timeoutId);\n}", "title": "" }, { "docid": "e618f4174d335ce78c2afaf221f57ffd", "score": "0.5930878", "text": "startTimer() {\n if (this.timer === 0) {\n this.timer = setInterval(this.countDown, 1000);\n }\n }", "title": "" }, { "docid": "7ec1da7958346031c85219140eaba520", "score": "0.5921638", "text": "function startTimer() {\n \n if (!interval) {\n offset = Date.now();\n interval = setInterval(update, options.delay);\n }\n }", "title": "" }, { "docid": "7130576c6cf0f31807a64a92705a2678", "score": "0.5912455", "text": "function startTimer(duration, display, isReverse) {\n var timer = duration, hours, minutes, seconds;\n\n if (isReverse) {\n $interval.cancel(cqVm.timerObj.time_taken);\n cqVm.timerObj.time_taken = $interval(\n function foo() {\n manipulateTime(timer, display);\n cqVm.timerObj.time_elapsed = timer++;\n },\n 1000\n );\n } else {\n cqVm.timerObj.time_left = $interval(\n function() {\n manipulateTime(timer, display, true);\n if (--timer < 0) {\n stopTimer();\n }\n },\n 1000\n );\n }\n\n if (cqVm.quizEnded) {\n clearAllTimers();\n }\n }", "title": "" }, { "docid": "1cc40cb98d5c7b822d608aba6b2d21db", "score": "0.59093523", "text": "function startTimer(ms, label, callOnEnd) {\n stopTimer();\n \n $('#timerLabel').text(label);\n \n timer.rate = 30; //update rate (ms), just over 30FPS\n timer.zeroTime = $.now() + ms;\n timer.endFunction = callOnEnd; //called when timer reaches zeroTime\n timer.intervalId = setInterval(timer, timer.rate);\n}", "title": "" }, { "docid": "60e62f7c1cb224ef1f1a2b18a5df4fbc", "score": "0.59047353", "text": "function startTimer(){\n startingMinutes = 1;\n time = startingMinutes * 60;\n myTimer = setInterval(updateCountDown, 1000);\n}", "title": "" }, { "docid": "28eecd962c9be165f6fa3683681aa158", "score": "0.5901762", "text": "function setupTimer() {\n\tstartTime = Date.now();\n\ttimerID = setInterval(\"updateTimer()\", 1000);\n}", "title": "" } ]
324104174b3e50f750a5728401c86aaa
check mail to. This is where receipient filtering occurs, not parsemessage
[ { "docid": "4f4184b0d392cb5d4e2764e7c2ac1607", "score": "0.6130201", "text": "onRcptTo(address, session, callback) {\n \n var users = self.config.auth[self.config.mailServer.useAuthStore];\n \n var mailTo = address;\n\t\t\t\t// check if user is defined at all \n\t\t\t\tif (users !== undefined) {\n\t\t\t\t\t// assumes no entry means send to any\n\t\t\t\t\tif (users[session.user].allowedTo !== undefined) {\n\t\t\t\t\t\t// may not need to loop here\n\t\t\t\t\t\t//TODO: possible wildcard addresses?\n\t\t\t\t\t\tfor (var i = 0; i < mailTo.length; i++) {\n\t\t\t\t\t\t\tif (!users[session.user].allowedTo.includes(mailTo[i].address)) {\n\t\t\t\t\t\t\t\tlogger.log('warn', 'Invalid to address: %s', mailFrom.address);\n\t\t\t\t\t\t\t\t return callback(new Error('Not allowed to send to address: '));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t} \n\t\t\t\t}\n \n return callback(); // accept rcptTo\n }", "title": "" } ]
[ { "docid": "0b0f2aa22d4fb7f3d902632465b82366", "score": "0.64637405", "text": "function checkfield_mail(id_pers , value) {\r\n\r\n var regex = /^[-\\w.]+[@]{1}[a-zA-Z0-9\\-.]+[.]{1}[-a-zA-Z0-9]+$/;\r\n\r\n if (value != null)\r\n if(regex.test(value) || value == \"\")\r\n\t\t\t{\r\n document.getElementById(id_pers).className = 'balise_spoiler';\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n else\r\n document.getElementById(id_pers).className = '';\r\n\r\n\t\treturn false;\r\n }", "title": "" }, { "docid": "5b9b2fc6c12f164f9aea7460479d481d", "score": "0.63243186", "text": "function valid(mail) {\n /* First check existence */\n if(!mail) {\n return false;\n }\n if(mail.isReminder){\n /* if the mail is a reminder, this is all the checks we need to do */\n return true;\n }\n if(!mail.to || typeof mail.to !== 'string') {\n return false;\n }\n var c, hasOne = false, validTo = '';\n var toArr = mail.to.split(' ');\n for(var i = 0; i < toArr.length; i++) {\n c = toArr[i];\n if (validEmailRE.test(c)) {\n /* src: http://stackoverflow.com/questions/46155/validate-email-address-in-javascript\n * #standards */\n hasOne = true;\n validTo = validTo + c + ', ';\n }\n }\n if(!hasOne) {\n return false;\n }\n /* All checks passed, fix values as needed, and return true */\n mail.to = validTo.slice(0, -2); /* trailing space and comma */\n if(!mail.subject || typeof mail.subject !== 'string') {\n mail.subject = '';\n }\n if(!mail.body || typeof mail.body !== 'string') {\n mail.body = '';\n }\n return true;\n }", "title": "" }, { "docid": "af4416d508fe1b1b330069c9dcc464a8", "score": "0.6270966", "text": "function email (thing) {\n return unemptyString(thing) && /\\S+@\\S+/.test(thing);\n }", "title": "" }, { "docid": "6ef23b8522f14cd8b4babaf6ff10103d", "score": "0.6207248", "text": "validateReceiver (message) {\n\t\tlet personalization = message.personalizations[0];\n\t\tlet to = personalization.to[0];\n\t\tconst receiverName = this.getUserName(this.currentUser);\n\t\tAssert.equal(to.email, this.currentUser.email, 'incorrect to address');\n\t\tAssert.equal(to.name, receiverName, 'incorrect to name');\n\t}", "title": "" }, { "docid": "c492e7aa326eeb6d21e69c938d66b2d3", "score": "0.60865015", "text": "function testMail (input) {\n return /^[\\w-\\\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$/.test(input.value)\n }", "title": "" }, { "docid": "64028a7a3b5eabff9297bbe73a3d81b8", "score": "0.6077979", "text": "function isEMail(data)\n{\n\tvar pattern=/^\\b[A-Za-z]+[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}\\b$/;\n\treturn (data.search(pattern)>=0);\n}", "title": "" }, { "docid": "34a9a4b6d582b65cefe1f2977ccffc0c", "score": "0.60405874", "text": "function validMail(elem) {\n let regular = /^[\\w-\\.]+@[\\w-]+\\.[a-z]{2,4}$/i;\n let myMail = elem.value;\n let valid = regular.test(myMail);\n let noValue = '';\n if (valid || myMail == noValue) {\n elem.classList.remove('invalid_mail');\n } else {\n elem.classList.add('invalid_mail');\n }\n }", "title": "" }, { "docid": "cb236366190ad79bf2e7f4d7cef42909", "score": "0.60044724", "text": "function checkDomain(to, from, cc) {\n var wso2Emails = new Array();\n var externalEmails = new Array();\n\n var allAddresses = to + \",\" + from + \",\" + cc;\n var tempArray = allAddresses.split(\",\");\n\n for each (var item in tempArray) {\n var check = item.split('<').pop().split('>')[0];\n var regExp = new RegExp(\"^[a-zA-Z0-9_.+-]+@(?:(?:[a-zA-Z0-9-]+\\.)?[a-zA-Z]+\\.)?(wso2)\\.com$\");\n\n if (regExp.test(check) == true) {\n // Checks whther the domain is equal to wso2.com\n wso2Emails.push(item);\n } else {\n externalEmails.push(item);\n }\n }\n return wso2Emails;\n}", "title": "" }, { "docid": "cd06b37683d687ada32182e74d9caa76", "score": "0.6003695", "text": "onMailFrom (address, session, cb) {\n if (address.address === session.user.address) {\n return cb()\n }\n\n cb(new Error('Bad Address'))\n }", "title": "" }, { "docid": "5a33cb01b7e0671edbf93aea3520faee", "score": "0.5992726", "text": "getMail(folder) {\n if (folder.isServer && folder.server.type != \"none\") {\n return true;\n }\n if (folder.server.type == \"nntp\" || folder.server.type == \"rss\") {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "690eefe66636dc317e391b14e174c70a", "score": "0.59384", "text": "function checkMailInfo(userId, messageId) {\n var headers = Gmail.Users.Messages.get(userId, messageId).payload.headers;\n var isWso2 = new Array();\n\n for each (var obj in headers) {\n if (obj[\"name\"] == \"Subject\") {\n var subject = obj[\"value\"];\n } else if (obj[\"name\"] == \"To\") {\n var to = obj[\"value\"];\n } else if (obj[\"name\"] == \"From\") {\n var from = obj[\"value\"];\n }\n\n if (obj[\"name\"] == \"Cc\") {\n var cc = obj[\"value\"];\n var mailInfo = Object.create(null, {\n subject:{\n value: subject\n },\n from:{\n value: from\n },\n cc:{\n value: isWso2\n }\n });\n return mailInfo;\n } else {\n cc = defaultCC; // If the CC section is null, sets a default cc to security@\n var mailInfo = Object.create(null, {\n subject:{\n value: subject\n },\n from:{\n value: from\n },\n cc:{\n value: cc\n }\n });\n return mailInfo;\n }\n }\n}", "title": "" }, { "docid": "2274b4b9c56429ce8c5b3c65e8ca14cc", "score": "0.5918594", "text": "function checkMail(field)\n{\n const regexMail = /^[a-zA-Z0-9._-]+@[a-z0-9._-]{2,}\\.[a-z]{2,4}$/;\n if(!regexMail.test(field.value))\n {\n highlight(field, true);\n return false;\n }\n else\n {\n highlight(field, false);\n return true;\n }\n}", "title": "" }, { "docid": "4148a1fa9731ccb3ed83d4cce3f1dc7b", "score": "0.59095436", "text": "function checkMail(s) {\n regex = new RegExp(\"^[a-z0-9_]([.-]?[a-z0-9_]+)+@[a-z0-9_]([.-]?[a-z0-9_]+)+\\.([a-z]{2,4}|[a-z]{6})$\", \"gi\");\n return regex.exec(s);\n}", "title": "" }, { "docid": "61079fbdaea24dac37406f2defb06570", "score": "0.58849967", "text": "function checkMail() {\n let mail = document.getElementById('email');\n if (mail.value || mail.value.length >= 7) {\n if (EMAIL_REGEXP.test(mail.value)) {\n return mail.value;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "121df0e79fec6c3a39b1499986d6c89f", "score": "0.5882402", "text": "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "title": "" }, { "docid": "0efcf3e134b1b00a87202f6cad3b7785", "score": "0.5836148", "text": "function controlloEmail(email) {\n \"use strict\";\n var espressione = /\\S+@\\S+\\.\\S+/;\n return espressione.test(email);\n}", "title": "" }, { "docid": "9c1b9eeebe1924aa7f5170d5a704966d", "score": "0.5834763", "text": "function check_mail(field) {\n var regex = /^[a-zA-Z0-9._\\-]+@[a-z0-9._\\-]{2,}\\.[a-z]{2,4}$/;\n if (field.value.length === 0) {\n highlight(field, true);\n error = true;\n } else if (!regex.test(field.value)) {\n field.value = \"Mail errone\";\n highlight(field, false);\n error = true;\n } else {\n highlight(field, false);\n }\n}", "title": "" }, { "docid": "891055ac726d0fa8ae33ec1cf1640370", "score": "0.5832762", "text": "function flagInvoice() {\n\n var cerca='in:inbox subject:(ACCETTAZIONE: OR CONSEGNA:) -label:processed ';\n\n var msgs=TrovaMails(cerca, [\"processed\"], null, [\"archive\",\"read\"]); var resp='';\n Logger.log(' messaggi trovati '+msgs.length); resp+='Ricevute trovate '+msgs.length;\n\n for (var i = 0 ; i < msgs.length; i++) {\n /* Cerca la mail corrispondente */\n var newcerca='is:sent subject:'+msgs[i].getSubject().replace('ACCETTAZIONE: ','').replace('CONSEGNA: ','');\n var matchmsg=TrovaMails(newcerca, [ \"accettate\"],[ \"inAttesa\"], [\"star\"]); resp+=' - Messaggi corrispondenti trovati '+matchmsg.length;\n }\n return resp;\n}", "title": "" }, { "docid": "946203ade87dde932968d2b3fa8baada", "score": "0.5769921", "text": "function validar_correo_electronico2(){\n\tvar mail=$(\"#mail\").val();\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\t\n if ( !expr.test(mail) ){\n \t$(\"#error_mail_formato\").slideDown();\n \t$(\"#mail\").focus();\n \treturn false;\n }else {\t\n\t\t$(\"#error_mail_formato\").slideUp();\n\t\t$(\"#error_mail\").slideUp(\"slow\");\n\t\t$(\"#valida_minimo_mail\").slideUp(\"slow\");\n\t\t$(\"#valida_maximo_mail\").slideUp(\"slow\");\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "6acffb896b46f4523860ae2b7f684a16", "score": "0.5762098", "text": "function mailOk() {\n\tvar reg = new RegExp('^[a-z0-9]+([_|\\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\\.|-]{1}[a-z0-9]+)*[\\.]{1}[a-z]{2,6}$', 'i');\n\tif (reg.test(document.getElementById(\"mail\").value)) {\n\t\t\tdocument.getElementById(\"val2\").src=imgV;\n\t\tbmail = true;\n\t} else {\n\t\tdocument.getElementById(\"val2\").src=imgA;\n\t\tbmail = false;\n\t}\n\t// maj etat bouton modifier\n\ttoutOk();\n}", "title": "" }, { "docid": "c92f6182e4f6cfdf0e847695a0d26809", "score": "0.57396495", "text": "function ynfr_checkEmails(aName)\n{\n var sEmails = $(aName).val();\n if(sEmails.length == 0)\n {\n $('#ynfr_edit_campaign_form_msg').message(oTranslations['fundraising.provide_a_valid_email_address'], 'error');\n $(aName).addClass('alert_input');\n $('html, body').animate({scrollTop:0},0);\n return false;\n }\n var aEmails = sEmails.split(',');\n\n if(aEmails.length == 0)\n {\n $('html, body').animate({scrollTop:0}, 0);\n return false;\n }\n for (var i = 0; i < aEmails.length; i++)\n {\n if ($.trim(aEmails[i]).search(/^[0-9a-zA-Z]([\\-.\\w]*[0-9a-zA-Z]?)*@([0-9a-zA-Z][\\-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,}$/) == -1)\n {\n bIsValid = false;\n $('#ynfr_edit_campaign_form_msg').message(oTranslations['fundraising.provide_a_valid_email_address'], 'error');\n $(aName).addClass('alert_input');\n $('html, body').animate({scrollTop:0},0);\n return false;\n }\n\n }\n\n return true;\n}", "title": "" }, { "docid": "7d8a5e56cdb2c1e90cb9b1dd44b51223", "score": "0.57363796", "text": "function esEmail(cadena){\n var filter=/^.+@.+\\..{2,3}$/;\n\n return filter.test(cadena);\n}", "title": "" }, { "docid": "81144181fbe28f3f06a473dc37e44b23", "score": "0.57314473", "text": "function hideMail(mail) {\n var res = mail.split(\"@\");\n var length = Math.floor(res[0].length/2);\n res[0] = res[0].slice(0, length) + \"...\" ;\n res = res.join(\"@\");\n return res;\n}", "title": "" }, { "docid": "942a8484d500c8cb1bc3448ff0819986", "score": "0.5730312", "text": "function mailValidation(mail){\n var x = /\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*/;\n if(!x.test(mail)){\n alert(\"Invalid email address\");\n return false;\n }return true;\n}", "title": "" }, { "docid": "553baac55acf6458b806648c50c7a813", "score": "0.5719578", "text": "function getUserByMail(dominio){ \n let userFilter = users.filter((user)=>{\n let emailPosition = user.email.indexOf(\"@\")\n let emailDominioValue = user.email.substr(emailPosition+1)\n // console.log(emailPosition)\n // console.log(emailDominioValue)\n return emailDominioValue === dominio\n })\n console.log(userFilter)\n}", "title": "" }, { "docid": "24a095a9c7d359917412f656a331a228", "score": "0.5713279", "text": "function verifyEmail() {\n const emailField = document.querySelector('#mail');\n // regular text, then an @ sign, then regular text, then a . sign, then regular text.\n const regexFull = /^\\w+\\@\\w+\\.\\w+$/;\n //Checks to see if no @ sign is present\n const regexNoAtSign = /^[^\\@]+$/\n // Checks to see if no . is present\n const regexNoDot = /^[^\\.]+$/\n //Check to see if it is blank then return contextual message if so\n if (emailField.value == \"\"){\n processError(emailField.previousElementSibling, 'email-error', 'Email Field cannot be blank', emailField);\n return false;\n }\n // Checks to see if there is no @ sign\n else if (regexNoAtSign.test(emailField.value)){\n processError(emailField.previousElementSibling, 'email-error', 'Email must contain an @ sign', emailField);\n return false;\n }\n // Checks to see if there is no . sign\n else if (regexNoDot.test(emailField.value)){\n processError(emailField.previousElementSibling, 'email-error', 'Email Field must contain a . extension', emailField);\n return false;\n }\n //Finally check to make sure it is a valid email as a \"catch all\"\n else if (regexFull.test(emailField.value)) {\n clearError(emailField.previousElementSibling, 'email-error', emailField)\n return true;\n } else {\n processError(emailField.previousElementSibling, 'email-error', 'Email is invalid, please ensure it follows the format \"[email protected]', emailField);\n return false;\n }\n}", "title": "" }, { "docid": "d9f3b8369bb9e221c58ba2a266a9443b", "score": "0.57000667", "text": "function valida_correo(correo) {\n\t\t if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(correo)){\n\t\t\t\n\t\t return (true)\n\t\t } else {\n\t\t \n\t\t return (false);\n\t\t }\n\t\t }", "title": "" }, { "docid": "e51b880f56fdffab605adbb61cdb5840", "score": "0.569833", "text": "function emailcheck(contact){\n // regex makes alpha1 or more>>with an @ sign>> with another 1 or more alpha//a dot//and another 1 or more alpha\n var re= (/\\w+@\\w+\\.\\w+/g);\n var contact_value= contact;\n if (contact_value.match(re)){\n console.log(\"email looks great!\");\n return true;}\n else {\n return false;\n }\n }", "title": "" }, { "docid": "d8e154db7146f892ac7f8f20da7ea262", "score": "0.5677765", "text": "function testEmail(id) {\n return (!(getElement(id).value.match(/.ca$|.com$|.org$/i)));\n }", "title": "" }, { "docid": "ab529b23aa36e9aedf74c8935c392815", "score": "0.56583244", "text": "function checkEmail(mail)\r\n{\r\n\t//using a regular expression to check\r\n\tvar positionOfAt=mail.indexOf(\"@\");\r\n\tvar positionOfPeriod=mail.lastIndexOf(\".\");\r\n\t\r\n\tif(positionOfAt < 1 || positionOfPeriod < positionOfAt + 2 || positionOfPeriod + 2 >= mail.length)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}", "title": "" }, { "docid": "32bb4671b7e86f96405da987ee5ceabd", "score": "0.5658271", "text": "function verificarCorreo(correo) {\n if (correo == '') {\n return false;\n }\n var checkTLD = 1;\n var knownDomsPat = /^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;\n var emailPat = /^(.+)@(.+)$/;\n var specialChars = \"\\\\(\\\\)><@,;:\\\\\\\\\\\\\\\"\\\\.\\\\[\\\\]\";\n var validChars = \"\\[^\\\\s\" + specialChars + \"\\]\";\n var quotedUser = \"(\\\"[^\\\"]*\\\")\";\n var ipDomainPat = /^\\[(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\]$/;\n var atom = validChars + '+';\n var word = \"(\" + atom + \"|\" + quotedUser + \")\";\n var userPat = new RegExp(\"^\" + word + \"(\\\\.\" + word + \")*$\");\n var domainPat = new RegExp(\"^\" + atom + \"(\\\\.\" + atom +\")*$\");\n var matchArray = correo.match(emailPat);\n if (matchArray == null) {\n return false;\n }\n var user = matchArray[1];\n var domain = matchArray[2];\n for (i = 0; i < user.length; i++) {\n if (user.charCodeAt(i) > 127) {\n return false;\n }\n }\n for (i = 0; i < domain.length; i++) {\n if (domain.charCodeAt(i) > 127) {\n return false;\n }\n }\n if (user.match(userPat) == null) {\n return false;\n }\n var IPArray = domain.match(ipDomainPat);\n if (IPArray != null) {\n for (var i = 1; i <= 4; i++) {\n if (IPArray[i] > 255) {\n return false;\n }\n }\n return true;\n }\n var atomPat = new RegExp(\"^\" + atom + \"$\");\n var domArr = domain.split(\".\");\n var len = domArr.length;\n for (i = 0; i < len; i++) {\n if (domArr[i].search(atomPat) == -1) {\n return false;\n }\n }\n if (checkTLD && domArr[domArr.length-1].length != 2 && domArr[domArr.length-1].search(knownDomsPat) == -1) {\n return false;\n }\n if (len < 2) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "5646b758adb04bf26790125e1151ada6", "score": "0.56526834", "text": "function checkMail(mail) {\n var r = /[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,5}$/;\n var check = true;\n if(!r.test(mail)) {\n check = false;\n }\n return check;\n}", "title": "" }, { "docid": "772ad77a5b94294d8d5b3f93a6c36553", "score": "0.5636939", "text": "function emailvalidation(email) {\n var e_mail = email;\n var part = e_mail.split('@');\n\n var msg =\"Invalid email\"\n var atSymbol = e_mail.indexOf('@');\n var dot = atSymbol + part[1].indexOf('.');\n\n if(atSymbol < 1){\n document.querySelector(\".emailmessage\").innerHTML = msg;\n return false;\n }\n\n if( dot <= atSymbol + 2){\n document.querySelector(\".passmessage\").innerHTML = msg;\n return false;\n }\n\n if(dot === email.length - 1){\n document.querySelector(\".passmessage\").innerHTML = msg;\n return false;\n }\n return true;\n\n }", "title": "" }, { "docid": "3447b74da37142deefda396c1ab99755", "score": "0.56308484", "text": "function send( msg ) { console.log( \"email.send(): %O\", msg.to ); }", "title": "" }, { "docid": "69a29d0a6232b5302de043b266bfbbb2", "score": "0.5626618", "text": "function verifyInputMail(target_val,target_tip){\r\n\t\tvar _ruleMail = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/,\r\n\t\t\t_tipA = '请输入邮箱',\r\n\t\t\t_tipB = '邮箱格式错误';\r\n\t\tif(target_val == ''){\r\n\t\t\ttarget_tip.html(_tipA);\r\n\t\t\treturn false;\r\n\t\t};\t\r\n\t\tif(!(_ruleMail.test($.trim(target_val)))){\r\n\t\t\ttarget_tip.html(_tipB);\r\n\t\t\treturn false;\r\n\t\t};\r\n\t\ttarget_tip.empty();\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "d2d59515739a3ccaa6e0e1ad3ae1d086", "score": "0.561267", "text": "function getMailtoUrl(to, subject, body) {\n\tif (typeof to === 'undefined' || to == '') return false;\n\tvar args = [];\n\tif (typeof subject !== 'undefined') {\n\t\targs.push('subject=' + encodeURIComponent(subject));\n\t}\n\tif (typeof body !== 'undefined') {\n\t\targs.push('body=' + encodeURIComponent(body))\n\t}\n\n\tvar url = 'mailto:' + encodeURIComponent(to);\n\tif (args.length > 0) {\n\t\turl += '?' + args.join('&');\n\t}\n\treturn url;\n}", "title": "" }, { "docid": "633972302bea0ab835fec6d601a4cf9a", "score": "0.5603431", "text": "function checkEmail(mail){\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail) && mail.length > 5)\n return (true);\n else\n return false;\n}", "title": "" }, { "docid": "f0527ccfe0cb870b2e6bc05a1ef0d4ef", "score": "0.56021065", "text": "checkMessagesForErrors(messages) {\n return messages.map(msg => {\n console.log(msg);\n if (msg.indexOf(\"Delivery to the following recipient failed permanently\") !== -1\n && msg.indexOf(this.daemonName) !== -1) {\n console.log(\"> failed permanently\");\n console.log(\"> contains daemon name\");\n let index = msg.indexOf(\"To: \") + 4;\n let counter = 0;\n let address = \"\";\n let next = msg.charAt(index);\n while (next !== \"\\n\" && counter !== 300) {\n address += next;\n index++;\n next = msg.charAt(index);\n counter++;\n }\n console.log(\"address on:\" + address);\n return address;\n }\n });\n }", "title": "" }, { "docid": "953adf532d5be52bfacb965cc4990afe", "score": "0.5589512", "text": "function validarEmail ( aMail) {\r\n var tfld = trim(aMail); \r\n var email = /^[^@]+@[^@.]+\\.[^@]*\\w\\w$/ ;\r\n if (!email.test(tfld)) { return false; }\r\n return true;\r\n}", "title": "" }, { "docid": "87c87d0970337b8f23e6ac0db4469b01", "score": "0.55859", "text": "function validateRecipient(field) {\n if (field.value !== \"\" && !validateMultipleEmails(field.value)) {\n field.parentNode.className = 'col-sm-12 has-error';\n return 0;\n } else if (field.value === \"\") {\n field.parentNode.className = 'col-sm-12';\n return 2;\n } else {\n field.parentNode.className = 'col-sm-12 has-success';\n return 1;\n }\n}", "title": "" }, { "docid": "cf5426729d6c104f1d2408a97b1cb9df", "score": "0.55558836", "text": "function validateEmail(mail) {\n if (/^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i.test(mail)){\n return true;\n } \n else return false; \n}", "title": "" }, { "docid": "cf9046be4d6ce04f5a78ed61a4e18c01", "score": "0.55503744", "text": "function emailCheck(emailStr,emailid) {\n var checkTLD = 1;\n var knownDomsPat = /^(com|net|org|edu|int|mil|gov|gob|arpa|biz|aero|name|coop|info|pro|museum|COM|NET|ORG|EDU|INT|MIL|GOV|GOB|ARPA|BIZ|AERO|NAME|COOP|INFO|PRO|MUSEUM)$/;\n var emailPat = /^(.+)@(.+)$/;\n var specialChars = \"\\\\(\\\\)><@,;:\\\\\\\\\\\\\\\"\\\\.\\\\[\\\\]\";\n var validChars = \"\\[^\\\\s\" + specialChars + \"\\]\";\n var quotedUser = \"(\\\"[^\\\"]*\\\")\";\n var ipDomainPat = /^\\[(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\]$/;\n var atom = validChars + '+';\n var word = \"(\" + atom + \"|\" + quotedUser + \")\";\n var userPat = new RegExp(\"^\" + word + \"(\\\\.\" + word + \")*$\");\n var domainPat = new RegExp(\"^\" + atom + \"(\\\\.\" + atom + \")*$\");\n var matchArray = emailStr.match(emailPat);\n if (matchArray == null) {\n \n bootbox.alert(\"El Formato del Correo Electronico es Incorrecto.\\n \\n\\\n El formato Correcto es: [email protected]\");\n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */\n\n \n return false;\n }\n var user = matchArray[1];\n var domain = matchArray[2];\n for (i = 0; i < user.length; i++) {\n if (user.charCodeAt(i) > 127) {\n bootbox.alert(\"El nombre de usuario contiene caracteres inv\\u00e1lidos.\");\n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */\n return false;\n }\n }\n for (i = 0; i < domain.length; i++) {\n if (domain.charCodeAt(i) > 127) {\n bootbox.alert(\"El nombre de dominio contiene caracteres inv\\u00e1lidos.\");\n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */ \n return false;\n }\n }\n if (user.match(userPat) == null) {\n alert(\" El Formato del Correo Electronico es Incorrecto\\n \\n\\\n El formato Correcto es [email protected]\");\n /* * -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */ \n return false;\n }\n var IPArray = domain.match(ipDomainPat);\n if (IPArray != null) {\n for (var i = 1; i <= 4; i++) {\n if (IPArray[i] > 255) {\n bootbox.alert(\"La direcci\\u00f3n IP es inv\\u00e1lida!\");\n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */\n return false;\n }\n }\n return true;\n }\n var atomPat = new RegExp(\"^\" + atom + \"$\");\n var domArr = domain.split(\".\");\n var len = domArr.length;\n for (i = 0; i < len; i++) {\n if (domArr[i].search(atomPat) == -1) {\n alert(\"El nombre de dominio no parece ser v\\u00e1lido.\");\n \n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */\n \n return false;\n }\n }\n if (checkTLD && domArr[domArr.length - 1].length != 2 &&\n domArr[domArr.length - 1].search(knownDomsPat) == -1) {\n alert(\"La direcci\\u00f3n debe terminar en un dominio conocido\\no c\\u00f3digo de pa\\u00eds de dos letras.\");\n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */\n return false;\n }\n if (len < 2) {\n alert(\"Esta direcci\\u00f3n no tiene un nombre de host!\");\n /* -*********** *************- */\n var datos = String($('#'+emailid).select2(\"val\"));\n var arredato = datos.split(',');\n var dato_final = [];\n if(arredato.length-1){\n for(var cont=0;cont < arredato.length-1 ;cont++)\n dato_final[cont] = arredato[cont]; \n }else dato_final =\"\";\n \n $('#'+emailid).select2(\"val\", dato_final); \n /* -****************************- */\n return false;\n } \n return true;\n \n}", "title": "" }, { "docid": "8de47bc021dd54e501368addb9ae4bd2", "score": "0.55482113", "text": "function verifyEmail(lineInfo, index) {\n if (lineInfo[index].search(/[\\w\\d]+@[\\w\\d]+.[\\w\\d]+/i) > -1) return true;\n return false;\n}", "title": "" }, { "docid": "f718f369f001cfa713695b9807d7749a", "score": "0.5536993", "text": "function checkMail(stringifiedEmail) {\n // retrieve the encoded email\n var email = JSON.parse(unescape(stringifiedEmail));\n\n // switch the isChecked value of the email object\n // server io is string only => saving as boolean is silly\n if (email.isChecked == null) {\n email.isChecked = true;\n } else {\n email.isChecked = !(email.isChecked == \"true\");\n }\n\n // get the account and modify the proper email\n getServerAccount(email.owner, function (account) {\n if (email.isInbox == \"true\") {\n for (var i = 0; i < account.inboxMail.length; i++) {\n if (account.inboxMail[i].date == email.date) {\n account.inboxMail[i] = email;\n }\n }\n } else {\n for (var i = 0; i < account.sentMail.length; i++) {\n if (account.sentMail[i].date == email.date) {\n account.sentMail[i] = email;\n }\n }\n }\n\n // save the modified account object\n saveServerAccount(account);\n });\n}", "title": "" }, { "docid": "eae20f82bab85e6c7f0d1f841c7380ed", "score": "0.5525265", "text": "function validar_modif_email2(){\n\tvar mod_mail=$(\"#mod_mail\").val();\n\t\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\t\n if ( !expr.test(mod_mail) ){\n \t$(\"#error_mod_mail_formato\").slideDown();\n \t$(\"#mod_mail\").focus();\n \treturn false;\n }else {\t\n\t\t$(\"#error_mod_mail_formato\").slideUp();\n\t\t$(\"#error_mod_mail\").slideUp(\"slow\");\n\t\t$(\"#valida_minimo_mod_mail\").slideUp(\"slow\");\n\t\t$(\"#valida_maximo_mod_mail\").slideUp(\"slow\");\n\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "3ee45df5674506a9e2e416211c476a34", "score": "0.55243564", "text": "function MailTo(){\n const subject = document.querySelector(\"#subject\").value.trim(); //assigning the subject value of the subject input\n const message = document.querySelector(\"#message\").value.trim(); //assigning the message the input value of message\n window.location.href = \"mailto:[email protected]?subject=\" + subject + \"&body=\" + message ;\n \n}", "title": "" }, { "docid": "0b0044538a23f8cf8a6480e2c90038ca", "score": "0.55209404", "text": "addAddress(id, address, name, email, phone) {\n if (address.length > 0) {\n const updatedMessage = { ...this.props.editedMessage };\n const recipientRepeats = updatedMessage.to.some(data => {\n return (data.address === address); \n });\n \n if(!recipientRepeats){\n this.validateAddress(updatedMessage, id, address, name, email, phone);\n }\n \n }\n }", "title": "" }, { "docid": "db64d9f38557f98f7e9aaadbb08dcfb1", "score": "0.5514889", "text": "function cheackEmail() {\n\t\tvar pattern = /^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i;\n\n\t\tvar emailData = $(\"#frm_email\").val();\n\n\t\tif (emailData != '' && pattern.test(emailData)) {\n\n\t\t\t$(\"#frm_email\").css(\"border\", \"2px solid #226308\");\n\t\t\t$(\"#email_error_message\").hide();\n\t\t}\n\t\telse {\n\t\t\tif (pattern.test(emailData)) {\n\t\t\t\t$(\"#email_error_message\").html(\"email is invalid\");\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$(\"#email_error_message\").html(\"* email should not be empty\");\n\t\t\t}\n\n\t\t\t$(\"#email_error_message\").css(\"color\", \"#c41f3b\");\n\t\t\t$(\"#email_error_message\").show();\n\t\t\t$(\"#frm_email\").css(\"border\", \"2px solid #F90A0A\");\n\n\t\t}\n\t}", "title": "" }, { "docid": "c7167d76ce18f5ae016d541fd21fb96d", "score": "0.55101234", "text": "onMailFrom(address, session, callback) {\n if(!(utility._validateEmail(address.address))){\n return callback(new Error('Invalid address type.'));\n }\n callback(); \n }", "title": "" }, { "docid": "504c54309e9b642428b03ee2446833d0", "score": "0.5508585", "text": "function isValidEmail(obj, message){\r\n\t\tif(obj.value.charAt(0) == \".\" ||\r\n\t\t obj.value.charAt(0) == \"@\" ||\r\n\t\t obj.value.indexOf('@', 0) == -1 ||\r\n\t\t obj.value.indexOf('.', 0) == -1 ||\r\n\t\t obj.value.lastIndexOf(\"@\") == obj.value.length -1 ||\r\n\t\t obj.value.lastIndexOf(\".\") == obj.value.length -1){\r\n\t \t \r\n\t \t \talert(message);\r\n\t\t\tobj.focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "0498d6a61e292f38f3574ffd06bc64f2", "score": "0.55039513", "text": "function validEmail(e) {\n var userEmail=$('input[name=email]').val();\n userEmail=userEmail.split('@');\n userEmail=userEmail[1].split('.');\n userEmail=userEmail[1].toLowerCase().toString();\n var fullEmail = $('input[name=email]').val();\n var domainEmail = $('input[name=email]').val();\n domainEmail = domainEmail.split('@');\n domainEmail = domainEmail[1].split('.');\n domainEmail = domainEmail[0].toLowerCase().toString();\n if(userEmail!='ru' && userEmail!='ua' && userEmail!='ml' && userEmail!='tst' && userEmail!='top' && userEmail!='xyz' && userEmail!='info' && domainEmail!='glmux') {\n console.log('pass'+userEmail);\n return true;\n } else {\n console.log('bad email');\n console.log('email:'+userEmail+' '+domainEmail);\n badActor(e);\n }\n }", "title": "" }, { "docid": "90fa0994e453fee396504e4efc08e704", "score": "0.5492581", "text": "function proper_email(email) {\n\t\t\t\n\t\t\tchar_regex = \"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\";\n\t\t\tfilter = new RegExp(char_regex,'i');\n\t\t\t\n\t\t\tif (filter.test(email)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "f5f455d9a6e770aba1a019e442ad29ef", "score": "0.5482073", "text": "function decodeMailAddresses() {\n const a =\n \"dre:[email protected]_qfntigue6los5zar7b:y4dp8v3m9h2.x1w@k0jcq-_\";\n\n let i, h, j, k, l, m, n, s;\n for (i = 0; i < document.links.length; i += 1) {\n h = document.links[i].hash;\n if (h.substring(0, 3) == \"#sd\") {\n k = \"\";\n l = h.substring(3, 5);\n m = h.lastIndexOf(\"?subject=\");\n if (m == -1) {\n s = document.links[i].href;\n } else {\n s = h.substring(m);\n h = h.substring(0, m);\n }\n for (j = 5; j < h.length; j += 2) {\n k += a.charAt(h.substring(j, j + 2) - l - 1);\n }\n m = s.lastIndexOf(\"?subject=\");\n if (m == -1) {\n document.links[i].href = k;\n } else {\n document.links[i].href = k + s.substring(m);\n }\n n = document.links[i].innerHTML;\n if (n == \"address\") {\n document.links[i].innerHTML = k.substring(7);\n } else {\n document.links[i].title = k.substring(7);\n }\n }\n }\n }", "title": "" }, { "docid": "f5f455d9a6e770aba1a019e442ad29ef", "score": "0.5482073", "text": "function decodeMailAddresses() {\n const a =\n \"dre:[email protected]_qfntigue6los5zar7b:y4dp8v3m9h2.x1w@k0jcq-_\";\n\n let i, h, j, k, l, m, n, s;\n for (i = 0; i < document.links.length; i += 1) {\n h = document.links[i].hash;\n if (h.substring(0, 3) == \"#sd\") {\n k = \"\";\n l = h.substring(3, 5);\n m = h.lastIndexOf(\"?subject=\");\n if (m == -1) {\n s = document.links[i].href;\n } else {\n s = h.substring(m);\n h = h.substring(0, m);\n }\n for (j = 5; j < h.length; j += 2) {\n k += a.charAt(h.substring(j, j + 2) - l - 1);\n }\n m = s.lastIndexOf(\"?subject=\");\n if (m == -1) {\n document.links[i].href = k;\n } else {\n document.links[i].href = k + s.substring(m);\n }\n n = document.links[i].innerHTML;\n if (n == \"address\") {\n document.links[i].innerHTML = k.substring(7);\n } else {\n document.links[i].title = k.substring(7);\n }\n }\n }\n }", "title": "" }, { "docid": "e4213738b382990b1435f3bffe7fc86b", "score": "0.5477708", "text": "function mightBeEmail(s) {\n\t // There's no point trying to validate rfc822 fully, just look for ...@...\n\t return (/[^@]+@[^@]+/.test(s)\n\t );\n\t}", "title": "" }, { "docid": "9b56d2bf7d129016f612b6feb9dc7b83", "score": "0.5473196", "text": "function correoValido() {\n var correo = $(\"#email\").val();\n\n if (/^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i.test(correo)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "c8f346b3d98adc10e59e1127520d9b44", "score": "0.54718584", "text": "function checkEmail(e)\n{\n var seenAt = false;\n\n for(var j = 0; j < e.value.length; j++)\n {\n var c = e.value.charAt(j);\n\n if ((c == ' ') || (c == '\\n') || (c == '\\t'))\n {\n alert(e.description + \n \" must not contain spaces, tabs, or newlines\");\n return false;\n }\n\n if ((c == '@') && (seenAt == true))\n {\n alert(e.description + \" must contain only one @\");\n return false;\n }\n\n if ((c == '@'))\n seenAt = true;\n }\n\n if (seenAt == false)\n {\n alert(e.description + \" must contain one @\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "805a9ab5b6948dffb909ab157678b841", "score": "0.5471684", "text": "validateReplyTo (message) {\n\t\t// it should be set to the stream ID ... this is how we identify where the reply\n\t\t// goes if the user replies to the email\n\t\tlet replyTo = `${this.stream.id}.${this.team.id}@${this.apiConfig.email.replyToDomain}`;\n\t\tAssert.equal(message.reply_to.email, replyTo, 'incorrect reply_to');\n\t\tAssert.equal(message.reply_to.name, 'CodeStream', 'incorrect reply_to name');\n\t}", "title": "" }, { "docid": "9b3b667bf727cc3480d9dcb31d5aa4ac", "score": "0.54625815", "text": "check_email() {\n const reg_email = /^[^@\\s]+@[^@.\\s]+.[A-Za-z]{2,3}$/;\n return reg_email.test(this.email);\n }", "title": "" }, { "docid": "aa95d8db028033d8a917d3dbe398c976", "score": "0.546026", "text": "async sendMail(request, response) {\n const {email, url} = request.body;\n const isValidEmailadresse = userSendMailValidation(email);\n const notNullableValues = isValidEmailadresse.value.filter(item => item)\n\n if (!isValidEmailadresse.error ) {\n const result = await this.userService.sendMail(email, url);\n response.json({result});\n } else if (isValidEmailadresse && notNullableValues.length) {\n const result = await this.userService.sendMail(notNullableValues, url);\n response.json({result, message: 'You have some false email Adress format'});\n } else {\n response.status(402).send({sueccess: 'not valid email adresses'})\n }\n }", "title": "" }, { "docid": "e74890fa952662ad5221791af6d07931", "score": "0.54536545", "text": "messagesFilter(payload, args, ctx) {\n return true;\n }", "title": "" }, { "docid": "514d8026c89651bc5cc08cf2ac869df5", "score": "0.54532236", "text": "function checkIsEmail(target) {\n if (isEmail(target)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "69db30dbd759a52deaac49b723afe280", "score": "0.5439263", "text": "function mailVerify(){\n let boleano = false;\n // si esta en blanc\n if (inpMail.value == \"\") {\n Invalidar(email);\n email_error.textContent = \"No es pot deixar en blanc.\";\n } else if (!cumpleixEmail(inpMail.value)) {\n Invalidar(email);\n email_error.textContent = \"No cumpleix format standard.\";\n } else {\n email.style.border = \"1px solid #5e6e66\";\n document.getElementById('divMail').style.color = \"#0ec771\";\n email_error.textContent = \"\"; \n boleano = true;\n Validar(email);\n }\n return boleano;\n}", "title": "" }, { "docid": "d519c5d0dbab180275ef3d673cbb5f94", "score": "0.54301876", "text": "function validaCorreo(email_id) {\n //Expresion regular que comprueba el matcheo del patron con el del email\n var regex = /^(([^<>()[\\]\\\\.,;:\\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 return regex.test(email_id);\n}", "title": "" }, { "docid": "e8ab3a15fb73d0fc67ba47ec03d8354f", "score": "0.5429482", "text": "function showMailNotification (){\n\tvar from = $xml.find('from').text();\n\tvar href = $xml.find('nextevent').attr('href');\n\tshowMsg('Info', 'New mail from ' + from);\n\t$('.mainLocationButton').removeClass('menu-active');\n\tgetXml(href);\n}", "title": "" }, { "docid": "138c2c2b0959e11009180fc34e23ecc2", "score": "0.5418493", "text": "function isEmail (s)\n{ if (isEmpty(s)) \n if (isEmail.arguments.length == 1) return defaultEmptyOK;\n else return (isEmail.arguments[1] == true);\n \n else {\n return reEmail.test(s)\n }\n}", "title": "" }, { "docid": "287a2d5ca6d96b34c84367664b5327b3", "score": "0.5392797", "text": "filterMessages(messages, item) {\n\t\treturn _.filter(messages, message => {\n\t\t\treturn (message.userTo === item.postedBy \n\t\t\t\t\t\t\t|| message.userFrom === item.postedBy) \n\t\t\t\t\t\t\t&& message.itemID === item._id;\n\t\t});\n\t}", "title": "" }, { "docid": "1e380672b19df35b107ceacb539f7bc0", "score": "0.539231", "text": "function emailValueChecker(email) {\r\n var regex = /\\S+@\\S+\\.\\S+/;\r\n if (regex.test(email)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "fd4f0950e3a229b1bba7fed4afeb571e", "score": "0.5391978", "text": "function isSMTP2Web(contentType) {\r\n return contentType && strings.startsWith(\r\n String(contentType).toLowerCase(), \"message/rfc822\");\r\n}", "title": "" }, { "docid": "fa4f8942327c90d2897dc7868f4bb6b2", "score": "0.5390292", "text": "function nospam (name, domain, subject) {\n location.href = \"mailto:\"+name+\"@\"+domain+subject;\n}", "title": "" }, { "docid": "0e2cfd079b36c2d4e42cd64db80e5b0d", "score": "0.53803307", "text": "function redirectMail(user, mail) {\n window.location.href = \"mailto:\" + mail + \"?subject=Notre site Allo_jati souhaite correspondre avec vous&body=Bonjour, \" + user;\n}", "title": "" }, { "docid": "64e05f0fb09041150990546eec7eabbb", "score": "0.5376495", "text": "function CheckMailFormat(emailValue) {\n var pattern = /^(?:\\w+\\.?)*\\w+@(?:\\w+\\.)+\\w+$/;\n if (pattern.test(emailValue)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "d7bf0dce681fd2f10cf42a31e96db270", "score": "0.5372651", "text": "function checkEmail(myEml)\n\t{\n\t\tif (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(myEml))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "b6b905e506fd1e812fe6ffab8bd66c7a", "score": "0.53715205", "text": "function check_mail_address_types() {\n check_address_types_state([\"addr_to\", \"addr_cc\", \"addr_reply\", \"addr_bcc\"]);\n}", "title": "" }, { "docid": "e73e5551611656ece70e29b859f43d18", "score": "0.5370724", "text": "function isSameEmail(paths)\n{\n\tvar from = [], date = [];\n\n\tfor (var i = 0; i < 2; i++) {\n\t\tfrom[i] = getEmailPropVal(paths[i], \"From\");\n\t\tdate[i] = getOutlookEmailDate(paths[i]);\n\n\t\t// Make the date comparable\n\t\tif (!date[i])\n\t\t\treturn false;\n\t\tdate[i] = date[i].getTime();\n\t}\n\n\tif (from[0] && from[1])\n\t\treturn from[0] === from[1] && date[0] === date[1];\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "05a8c55cbe64705310cc9e5d6d38a3da", "score": "0.5369187", "text": "function decodeMailAddresses() {\n var a = 'dre:[email protected]_qfntigue6los5zar7b:y4dp8v3m9h2.x1w@k0jcq-_';\n var i, h, j, k, l, m, n, s;\n\n for (i = 0; i < document.links.length; i += 1) {\n h = document.links[i].hash;\n\n if (h.substring(0, 3) == '#sd') {\n k = '';\n l = h.substring(3, 5);\n m = h.lastIndexOf('?subject=');\n\n if (m == -1) {\n s = document.links[i].href;\n } else {\n s = h.substring(m);\n h = h.substring(0, m);\n }\n\n ;\n\n for (j = 5; j < h.length; j += 2) {\n k = k + a.charAt(h.substring(j, j + 2) - l - 1);\n }\n\n ;\n m = s.lastIndexOf('?subject=');\n\n if (m == -1) {\n document.links[i].href = k;\n } else {\n document.links[i].href = k + s.substring(m);\n }\n\n ;\n n = document.links[i].innerHTML;\n\n if (n == 'address') {\n document.links[i].innerHTML = k.substring(7);\n } else {\n document.links[i].title = k.substring(7);\n }\n\n ;\n }\n\n ;\n }\n\n ;\n}", "title": "" }, { "docid": "e2173ce2bed171561aea443aa566b9a8", "score": "0.536792", "text": "function mightBeEmail(s) {\n\t // There's no point trying to validate rfc822 fully, just look for ...@...\n\t return (/[^@]+@[^@]+/).test(s);\n\t}", "title": "" }, { "docid": "8f154a8f76cec5f26a5d3102518933e0", "score": "0.5365336", "text": "function valider_email(){\n const re = /\\S+@\\S+\\.\\S+/;\n const mail = $('#email').val();\n if (re.test(mail) === false) {\n $('#email').addClass('error')\n bool_verif_email=false\n }else{\n $('#email').removeClass('error')\n bool_verif_email=true\n }\n}", "title": "" }, { "docid": "727fd53e11aae213912ff62d86634dc8", "score": "0.53624123", "text": "function checkEmail() {\n let mailFormat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n if (!emailInput.value.match(mailFormat)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "5f68d92b18def94a778f77568bccd6af", "score": "0.5347779", "text": "function getMailtoUrl(to, subject, body) {\r\n var args = [];\r\n if (typeof subject !== 'undefined') {\r\n args.push('subject=' + encodeURIComponent(subject));\r\n }\r\n if (typeof body !== 'undefined') {\r\n args.push('body=' + encodeURIComponent(body))\r\n }\r\n\r\n var url = 'mailto:' + encodeURIComponent(to);\r\n if (args.length > 0) {\r\n url += '?' + args.join('&');\r\n }\r\n return url;\r\n}", "title": "" }, { "docid": "12e4ab983fa3e01e0acf0bf8e6be5dd9", "score": "0.534772", "text": "function formValidation(){\nlet uname = document.contact.name;\nlet uemail = document.contact.email;\nlet umessage = document.contact.message;\n\n\nif(allLetter(uname))\n{\n if(ValidateEmail(uemail))\n{\nif(IsEmpty(umessage)){\n\n}\n}\n}\nreturn false;\n}", "title": "" }, { "docid": "625d00d1c59af85ea04e6cee9aba5a05", "score": "0.5341944", "text": "findMail()\n {\n let mail = '';\n let lStat = '';\n let loginEmail = Cookie.load('email');\n let uname = document.getElementById('users');\n // let uname = '';\n if(uname.value === '')\n {\n this.inviteAlert(uname.value);\n }\n else {\n let userNames = this.state.userNames;\n // console.log(userNames.length);\n for (let i = 0; i < userNames.length; i = i + 1) {\n if (userNames[i].name === uname.value && userNames[i].email !== loginEmail) {\n mail = userNames[i].email;\n lStat = userNames[i].lStatus;\n break;\n }\n }\n // console.log(mail);\n this.sendInvite(mail, lStat);\n }\n }", "title": "" }, { "docid": "43b744f8aac4da852d82ea8a394e066f", "score": "0.53329355", "text": "sendEmailToMarked() {\n var sendString = '';\n this.props.employees.marked.map((employee) => {\n sendString += employee.email + \";\";\n });\n\n if (sendString.length > 0) {\n\n var link = \"mailto:\" + sendString\n + \"[email protected]\"\n + \"&subject=\" + escape(\"Hei\");\n\n window.location.href = link;\n }\n }", "title": "" }, { "docid": "dabbe200ae85c39f87f2d888d2cd2281", "score": "0.53316253", "text": "function checkNUMEmail(entry, error, pattern) {\n if (entry.match(pattern)) {\n if (error.style.display = 'block') {\n error.style.display = 'none';\n }\n } else {error.style.display = 'block'}\n}", "title": "" }, { "docid": "017be8757a28804fe006b19267b7bb18", "score": "0.53304046", "text": "testEmail(input_value) { \n const mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n if(input_value.match(mailformat) === null) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" }, { "docid": "d7f7482c97fc1855d2e5bf4f41ab730b", "score": "0.53272796", "text": "function multiEmailCheck(email_field) \n\t{\n\t\tif(document.getElementById('external').checked==true){\n\t\tif(email_field.value.length)\n\t\t{\n\t\t\tvar src=email_field.value;\n\t\t\tif(src!=\"\")\n\t\t\t{\n\t\t\t\tvar comma=src.split(\",\");\n\t\t\t}\n\t\t\tfor (var i = 0; i < comma.length; i++) \n\t\t\t{\n\t\t\t\tvar semicolon=comma[i].split(\";\");\n\t\t\t\tfor (var j = 0; j < semicolon.length; j++) \n\t\t\t\t{\n\t\t\t\t\tvar space=semicolon[j].split(\" \");\n\t\t\t\t\tfor (var k = 0; k < space.length; k++) \n\t\t\t\t\t{\n\t\t\t\t\t\tif (!chkEmail(space[k]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert(mesg[86]); /*Invalid Email Id*/\n\t\t\t\t\t\t\temail_field.select();\t\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\treturn true;\n}", "title": "" }, { "docid": "757e65e4aa6d76b7114215f71dcfed52", "score": "0.53264564", "text": "function checkEmail(){\r\n let email =$(\"#mail\").val();\r\n let emailFromat= /[^@\\s]+@[^@\\s]+\\.[^@\\s]+/\r\n $(\"#mail\").removeClass('correctlyFilled');\r\n $(\"#mail\").removeClass('error_color');\r\n\r\n if( emailFromat.test(email)) {\r\n \r\n $('#emailLabel').html('<span> Email :</span> <br><div style=\"color:dark green\"> Great ! Vaild Email Address Entered </div>');\r\n $(\"#mail\").addClass('correctlyFilled');\r\n return true;}\r\n else{\r\n $(\"#mail\").addClass('error_color');\r\n $('#emailLabel').html('<span> Email :</span> <br><div style=\"color:red\"> please enter a Vaild Email address </div>');\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "1e43ca3a4cf5e423bae8bdf64719bab2", "score": "0.5319632", "text": "function ValidateEmail(uemail)\n{\nlet mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\nif(uemail.value.match(mailformat))\n{\nreturn true;\n}\nelse\n{\nalert(\"You have entered an invalid email address!\");\nuemail.focus();\nreturn false;\n}\n}", "title": "" }, { "docid": "7e98d6e412a507376a527f03e13f1d9b", "score": "0.53191966", "text": "function ValidMail() {\r\n\tmail=document.getElementById(\"mail_txt\").value;\r\n\tif ((replaceCharacters(mail,' ','')=='') || (!checkEmail(mail))) {\r\n\t\t//alert(\"Saississez un mail valide !!\");\r\n\t\t$('#DIVshake').effect('pulsate', { times:3 }, 500);\r\n\t\tdocument.getElementById(\"mail_txt\").focus();\r\n\t\treturn false;\r\n\t}\r\n\tvar arguments = \"mail=\" + mail;\r\n\trequest(\"POST\", \"presentation.php\", true, setPresentationData, arguments);\r\n}", "title": "" }, { "docid": "96002cfa64e31e71e114c370402a3952", "score": "0.531159", "text": "function validateMail() {\n // Declaration du regEx de controle\n var emailRGEX = /^[\\w!#$%&'*+/=?`{|}~^-]+(?:\\.[\\w!#$%&'*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$/;\n // Test que la saisie correspond a ce qui est demande\n var emailResult = emailRGEX.test(emailField.value);\n\n if (emailResult) {\n\treturn true;\n }\n else {\n\talert(\"Veuillez saisir une adresse email valide...\");\n\treturn false;\n }\n}", "title": "" }, { "docid": "d511d1581079f0af854a6f7c0badb8e6", "score": "0.53103924", "text": "function check_collapsed_pop_recipient(cwc) {\n Assert.ok(cwc.e(\"addressRowTo\").classList.contains(\"hidden\"));\n}", "title": "" }, { "docid": "db6dc947b27260a3c3b7ec075e8aa335", "score": "0.5309104", "text": "validateMessage (message) {\n\t\tmessage = message.message;\n\t\tif (!message.from && !message.to) { return false; }\t// ignore anything not matching\n\t\tthis.validateTemplateId(message);\n\t\tthis.validateCreator(message);\n\t\tthis.validateReceiver(message);\n\t\tthis.validateReplyTo(message);\n\t\tthis.validateSubstitutions(message);\n\t\treturn true;\n\t}", "title": "" }, { "docid": "027c8a089a41efab49e45f1786bad815", "score": "0.5308988", "text": "function isValidMailInBase(inputVal) {\n\t\trequest = new XMLHttpRequest();\n\t\temailString = inputVal;\n\t\temailStringToArray = emailString.split(/[@.%]/);\n\t\turl = 'https://aqueous-reaches-8130.herokuapp.com/check-email/?email=' + emailStringToArray[0] + '%40' + emailStringToArray[1] + '.' + emailStringToArray[2];\n\t\trequest.open('get', url, true);\n\t\trequest.onreadystatechange = function() {\n\t\t\tif (request.readyState === STATE_READY) {\n\t\t\t\tanswerObj = JSON.parse(request.responseText);\n\t\t\t\tconsole.log(request.responseText);\n\t\t\t\tconsole.log(answerObj);\n\t\t\t\tif (answerObj.used) {\n\t\t\t\t\tmassageNode.css('display', 'block');\n\t\t\t\t\tmassageNode.text('This email is already registered. Please fill out enother email.');\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\trequest.send();\n\t}", "title": "" }, { "docid": "21bcc914b519c5de014a4ddaa4c3090c", "score": "0.5307004", "text": "function CheckMailFormat(emailValue) {\n var pattern = /^([a-zA-Z][a-zA-Z0-9\\_\\-\\.]*\\@[a-zA-Z0-9\\-]*\\.[a-zA-Z]{2,4})?$/i\n if (pattern.test(emailValue)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "3467733c987a20e3c267fd71f57de513", "score": "0.5305585", "text": "function mightBeEmail(s) {\n // There's no point trying to validate rfc822 fully, just look for ...@...\n return (/[^@]+@[^@]+/).test(s);\n }", "title": "" }, { "docid": "fb6cb630efc5fbe30a45ebc0f982df55", "score": "0.53044087", "text": "function validateCorreo(correo) {\n var regExp = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/\n return regExp.test(correo);\n}", "title": "" }, { "docid": "380695f092204d9b31ce37389f76bcc2", "score": "0.5299081", "text": "function parseMail(accountId) {\n\t//document.getElementById('mailBox_' + accountId).innerHTML = \"\";\n\tvar mailArray = mailAccounts[accountId].getMail();\n\t$.each(mailArray, function(i, mail) {\n\t\tallMail[mail.id] = mail;\n\t\tmailCount++;\n\t\t\t\t \n\t\tif(mail.title.length > 70)\n\t\t\tmail.title = mail.title.substr(0, 65) + \"...\";\n \n\t\tvar i = mailArray.indexOf(mail);\t\t\t\n\t\tvar issued = (new Date()).setISO8601(mail.issued);\n\t\tvar today = new Date();\n\t\tvar datetime;\n\t\tvar fullDateTime = issued.toLocaleString();\n\t\t\t\t\t\t\n\t\tif(issued.getFullYear() == today.getFullYear() &&\n\t\t\tissued.getMonth() == today.getMonth() &&\n\t\t\tissued.getDate() == today.getDate()) {\n\t\t\t// Mail was issued today, display time\n\t\t\tvar hour = issued.getHours();\n\t\t\tvar min = issued.getMinutes();\n\t\t\tvar datetime = ((hour < 10) ? \"0\" : \"\") + hour + \":\" + ((min < 10) ? \"0\" : \"\") + min;\n\t\t} else {\n\t\t\t// Old mail, only display date\n\t\t\t//datetime = dateFormat(issued, \"d mmm\");\n\t\t\tdatetime = issued.getDate() + ' ' + i18n.selected_lang.months[issued.getMonth()];\n\t\t}\n\t\t\n//\t\tvar mailElement = \n//\t\t\t\"<div class=\\\"mailEntry vbox\\\" id=\\\"\" + mail.id + \"\\\">\" +\n//\t\t\t\t\"<div class=\\\"mailHeader hbox\\\">\" + \n//\t\t\t\t\t\"<span class=\\\"authorName\\\">&bull;&nbsp;<a class=\\\"tooltip nohover\\\" title=\\\"\" + mail.authorMail + \"\\\">\" + mail.authorName + \"</a></span>\" + \n//\t\t\t\t\t\"<span class=\\\"actions\\\">\" + \n//\t\t\t\t\t\t\"<span class=\\\"read\\\"><a id=\\\"\" + mail.id + \"_read-link\\\" href=\\\"javascript:readThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('readLinkTitle') + \"\\\">\" + i18n.get('readLink') + \"</a></span>\" +\n//\t\t\t\t\t\t\"<span class=\\\"delete\\\"><a href=\\\"javascript:deleteThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('deleteLinkTitle') + \"\\\">\" + i18n.get('deleteLink') + \"</a></span>\" + \n//\t\t\t\t\t\t\"<span class=\\\"spam\\\"><a href=\\\"javascript:spamThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('spamLinkTitle') + \"\\\">\" + i18n.get('spamLink') + \"</a></span>\" +\n//\t\t\t\t\t\t\"<span class=\\\"archive\\\"><a href=\\\"javascript:archiveThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('archiveLinkTitle') + \"\\\">\" + i18n.get('archiveLink') + \"</a></span>\" +\n//\t\t\t\t\t\"</span>\" + \n//\t\t\t\t\t\"<span class=\\\"issued\\\" title=\\\"\" + fullDateTime + \"\\\">\" + datetime + \"&nbsp;&nbsp;<img src=\\\"img/datetime.gif\\\" /></span>\" +\n//\t\t\t\t\"</div>\" +\n//\t\t\t\t\"<div class=\\\"mailContainer vbox\\\">\" +\n//\t\t\t\t\t\"<div class=\\\"mailBody vbox\\\">\";\n//\t\t\t\t\t\tif(mail.summary != null && mail.summary.length > 0) {\n//\t\t\t\t\t\t\tmailElement +=\n//\t\t\t\t\t\t\t\"<div class=\\\"title hbox\\\">\" + \n//\t\t\t\t\t\t\t\t\"<span><a href=\\\"javascript:starThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('starLinkTitle') + \"\\\" class=\\\"star-link\\\" id=\\\"\" + mail.id + \"_star-link\\\"><img src=\\\"img/star_hover.png\\\" alt=\\\"\" + i18n.get('starLinkTitle') + \"\\\" class=\\\"hidden\\\"/></a><a href=\\\"javascript:openMail('\" + accountId + \"','\" + mail.id + \"');\\\" class=\\\"title-link\\\" title=\\\"\" + i18n.get('openLinkTitle') + \"\\\">\" + mail.title + \"</a></span>\" +\n//\t\t\t\t\t\t\t\t\"<span class=\\\"lowerright\\\"><a href=\\\"javascript:replyTo('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('replyLinkTitle') + \"\\\" class=\\\"reply-link\\\"><img src=\\\"img/reply.png\\\" alt=\\\"\" + i18n.get('replyLinkTitle') + \"\\\" class=\\\"hidden\\\" /></a></span>\" +\n//\t\t\t\t\t\t\t\t\"<span class=\\\"lowerright hidden\\\" id=\\\"\" + mail.id + \"_less-link\\\"><a href=\\\"javascript:hideBody('\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('summaryLinkTitle') + \"\\\" class=\\\"less-link\\\"><img src=\\\"img/less_hover.png\\\" class=\\\"hidden\\\" /></a></span>\" +\n//\t\t\t\t\t\t\t\t\"<span class=\\\"lowerright\\\" id=\\\"\" + mail.id + \"_more-link\\\"><a href=\\\"javascript:getThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('fullLinkTitle') + \"\\\" class=\\\"more-link\\\"><img src=\\\"img/more_hover.png\\\" class=\\\"hidden\\\" /></a></span>\" +\n//\t\t\t\t\t\t\t\"</div>\" +\n//\t\t\t\t\t\t\t\"<div class=\\\"summary collapsed\" + ((mail.summary == null || mail.summary.length == 0)?\" hidden\":\"\") + \"\\\"><div id=\\\"\" + mail.id + \"_summary\\\" style=\\\"cursor: default\\\" onclick=\\\"getThread('\" + accountId + \"','\" + mail.id + \"')\\\">\" + mail.summary + \"</div></div>\";\n//\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\tmailElement +=\n//\t\t\t\t\t\t\t\"<div class=\\\"title hbox\\\">\" + \n//\t\t\t\t\t\t\t\t\"<span><a href=\\\"javascript:starThread('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('starLinkTitle') + \"\\\" class=\\\"star-link\\\" id=\\\"\" + mail.id + \"_star-link\\\"><img src=\\\"img/star_hover.png\\\" alt=\\\"\" + i18n.get('starLinkTitle') + \"\\\" class=\\\"hidden\\\"/></a><a href=\\\"javascript:openMail('\" + accountId + \"','\" + mail.id + \"');\\\" class=\\\"title-link\\\" title=\\\"\" + i18n.get('openLinkTitle') + \"\\\">\" + mail.title + \"</a></span>\" +\n//\t\t\t\t\t\t\t\t\"<span class=\\\"lowerright\\\"><a href=\\\"javascript:replyTo('\" + accountId + \"','\" + mail.id + \"');\\\" title=\\\"\" + i18n.get('replyLinkTitle') + \"\\\" class=\\\"reply-link\\\"><img src=\\\"img/reply.png\\\" alt=\\\"\" + i18n.get('replyLinkTitle') + \"\\\" class=\\\"hidden\\\" /></a></span>\" +\n//\t\t\t\t\t\t\t\"</div>\";\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t/*\"<span class=\\\"lowerright hidden\\\" id=\\\"\" + mail.id + \"_reply-link\\\">[<a href=\\\"javascript:showReply('\" + mail.id + \"');\\\" title=\\\"Write quick reply\\\">reply</a>]</span>\" + */\n//\t\t\t\t\t\t/*\"<div class=\\\"mailReply hidden\\\" id=\\\"\" + mail.id + \"_reply\\\">\" +\n//\t\t\t\t\t\t\t\"<textarea id=\\\"\" + mail.id + \"_replytext\\\" rows=\\\"5\\\" onKeyPress=\\\"replyTextKeyPress(event, '\" + mail.id + \"')\\\"></textarea>\" +\n//\t\t\t\t\t\t\t\"<span class=\\\"lowerright\\\"><a href=\\\"javascript:sendReply('\" + mail.id + \"');\\\" title=\\\"Send quick reply\\\">&raquo;&nbsp;Send (shift-enter)</a></span>\" + \n//\t\t\t\t\t\t\"</div>\" +*/\n//\t\t\t\t\tmailElement +=\n//\t\t\t\t\t\"</div>\" +\n//\t\t\t\t\"</div>\" +\n//\t\t\t\"</div>\";\n//\t\t\n//\t\tdocument.getElementById('mailBox_' + accountId).innerHTML += mailElement;\n\t});\n}", "title": "" }, { "docid": "dc2a9b7bd362f5ab3374a921e0d2fca3", "score": "0.52990717", "text": "function validateEmail(addr,man,db) {\n if (addr == '' && man) {\n if (db) alert('email address is mandatory');\n return false;\n }\n var invalidChars = '\\/\\'\\\\ \";:?!()[]\\{\\}^|';\n for (i=0; i<invalidChars.length; i++) {\n if (addr.indexOf(invalidChars.charAt(i),0) > -1) {\n if (db) alert('<MT_TRANS phrase=\"email address contains invalid characters\">');\n return false;\n }\n }\n for (i=0; i<addr.length; i++) {\n if (addr.charCodeAt(i)>127) {\n if (db) alert('<MT_TRANS phrase=\"email address contains non-ascii characters\">');\n return false;\n }\n }\n\n var atPos = addr.indexOf('@',0);\n if (atPos == -1) {\n if (db) alert('<MT_TRANS phrase=\"email address must contain an @\">');\n return false;\n }\n if (atPos == 0) {\n if (db) alert('<MT_TRANS phrase=\"email address must not start with @\">');\n return false;\n }\n if (addr.indexOf('@', atPos + 1) > - 1) {\n if (db) alert('<MT_TRANS phrase=\"email address must contain only one @\">');\n return false;\n }\n if (addr.indexOf('.', atPos) == -1) {\n if (db) alert('<MT_TRANS phrase=\"email address must contain a period in the domain name\">');\n return false;\n }\n if (addr.indexOf('@.',0) != -1) {\n if (db) alert('<MT_TRANS phrase=\"period must not immediately follow @ in email address\">');\n return false;\n }\n if (addr.indexOf('.@',0) != -1){\n if (db) alert('<MT_TRANS phrase=\"period must not immediately precede @ in email address\">');\n return false;\n }\n if (addr.indexOf('..',0) != -1) {\n if (db) alert('<MT_TRANS phrase=\"two periods must not be adjacent in email address\">');\n return false;\n }\n var suffix = addr.substring(addr.lastIndexOf('.')+1);\n if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {\n if (db) alert('<MT_TRANS phrase=\"invalid primary domain in email address\">');\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "b3a65ffc66e897a844222b5304560580", "score": "0.5294545", "text": "checkForEmail(value) {\n if (!value) {\n return false;\n }\n\n const pattern = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if (!value.match(pattern)) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "af81ff9e31930a8ef60dea21ddd5896c", "score": "0.52910936", "text": "function checkEmail(str)\r\n{\r\nif (isWhiteSpace(str))\r\nalert(\"Podaj właściwy e-mail\")\r\nelse\r\n{\r\nat = str.indexOf(\"@\")\r\nif (at < 1)\r\n{\r\nalert(\"Nieprawidłowy e-mail\")\r\nreturn false\r\n}\r\nelse\r\n{\r\nvar l = -1\r\nfor (var i = 0; i < str.length; i++)\r\n{\r\nvar c = str.charAt(i)\r\nif ( c == \".\")\r\nl = i\r\n}\r\nif ( (l < (at+2) ) || (l == str.length-1) )\r\nalert(\"Nieprawidłowy e-mail\")\r\n}\r\nreturn true\r\n}\r\n}", "title": "" } ]
b6ab60c8e363cfedd250cf9e0298bdf6
Standard/simple iteration through an event's collected dispatches.
[ { "docid": "5a0e5e2f6567aaadb0f7a8774db91710", "score": "0.0", "text": "function executeDispatchesInOrder(event, simulated) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and Instances are two parallel arrays that are always in sync.\n executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, simulated, dispatchListeners, dispatchInstances);\n }\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n }", "title": "" } ]
[ { "docid": "18d4a2e52328ecb1a16e4fb9e4acfff0", "score": "0.62271047", "text": "_dispatchEvents() {\n //todo: this doesnt let us specify order that events are disptached\n //so we will probably have to check each one\n //info here: https://stackoverflow.com/a/37694450/10232\n for (let handler of this._eventHandlers.values()) {\n handler.dispatch();\n }\n }", "title": "" }, { "docid": "37632cca86fce9722228a8a16617b829", "score": "0.6129449", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.612286", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "944dea55b1b5462e6c9b1529779e156e", "score": "0.6101899", "text": "onIteration() {}", "title": "" }, { "docid": "a8be72f914395ef70816cc786bf60ea1", "score": "0.6098464", "text": "dispatch(eventName, eventArgs){\n\n const cbs = this.events.get(eventName).callbacks;\n let l = cbs.length;\n while(l--){\n cbs[l](eventArgs);\n }\n\n }", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60787064", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60787064", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60787064", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.60787064", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "fe48860456d491e0672dbe055b25e520", "score": "0.6073375", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if ('production' !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.60730547", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "ad5530791382f1c97211cd32678d5b8b", "score": "0.60498387", "text": "* events() {\n for (let i = 0; i < this.size(); i++) {\n yield this.at(i);\n }\n }", "title": "" }, { "docid": "c8930c0ae9ee23f160f70a6b31124b8d", "score": "0.60363275", "text": "dispatch(event) {\n for (let handler of this._handlers) {\n handler(event);\n }\n }", "title": "" }, { "docid": "a0bb9f0d7a4f30c15cc085172fac2613", "score": "0.57880557", "text": "static runEvents()\n {\n for (const [name, func] of Object.entries(EventManager.events))\n {\n func.call();\n }\n }", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.57660097", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.57660097", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "7c9e16f64c9356a33c8312d67ecc1880", "score": "0.57660097", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "eb04add915f9d6859b6e8bccb9dce53a", "score": "0.5721001", "text": "function patchViaCapturingAllTheEvents() {\n\t var _loop_1 = function (i) {\n\t var property = eventNames[i];\n\t var onproperty = 'on' + property;\n\t self.addEventListener(property, function (event) {\n\t var elt = event.target, bound, source;\n\t if (elt) {\n\t source = elt.constructor['name'] + '.' + onproperty;\n\t }\n\t else {\n\t source = 'unknown.' + onproperty;\n\t }\n\t while (elt) {\n\t if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n\t bound = Zone.current.wrap(elt[onproperty], source);\n\t bound[unboundKey] = elt[onproperty];\n\t elt[onproperty] = bound;\n\t }\n\t elt = elt.parentElement;\n\t }\n\t }, true);\n\t };\n\t for (var i = 0; i < eventNames.length; i++) {\n\t _loop_1(i);\n\t }\n\t \n\t}", "title": "" }, { "docid": "eb994eace423800b5ca2604ff3337dd7", "score": "0.5707448", "text": "function eventFunction(e){\n\t getSlot([q.id], allEvents).push(e);\n\t eventDurForeach(e, drawfn);\n\t}", "title": "" }, { "docid": "062607b74643c406d4195a1fc046c61d", "score": "0.56664014", "text": "function callAllEventListeners() {\n\t\t\t pendingPromises.forEach(function (pendingPromise) {\n\t\t\t callCapturedEventListeners(pendingPromise.eventArguments);\n\t\t\t });\n\t\t\t callCapturedEventListeners(eventArguments);\n\t\t\t }", "title": "" }, { "docid": "59a4a3f668d05b034199450dc617ae71", "score": "0.5651419", "text": "async send (event) {\n const promises = []\n\n for (const listener of this.listeners.values())\n if (listener.predicate(event))\n promises.push(listener.send(event))\n\n return p.all(promises)\n }", "title": "" }, { "docid": "4763025877fd51208c099f5eef7f53ec", "score": "0.56237584", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "title": "" }, { "docid": "21ef8a4d4a960104bf15a866baed368b", "score": "0.5539424", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\r\n if (inst && event && event.dispatchConfig.registrationName) {\r\n var registrationName = event.dispatchConfig.registrationName\r\n var listener = getListener(inst, registrationName)\r\n\r\n if (listener) {\r\n event._dispatchListeners = accumulateInto(\r\n event._dispatchListeners,\r\n listener\r\n )\r\n event._dispatchInstances = accumulateInto(\r\n event._dispatchInstances,\r\n inst\r\n )\r\n }\r\n }\r\n }", "title": "" }, { "docid": "bcc1e71105389cd39e8a3eb38ddcfb10", "score": "0.55280924", "text": "function dispatch() {\n for (var i = 0; i < dispatches; i++) {\n instance.dispatchEvent({ type: type });\n }\n }", "title": "" }, { "docid": "f9078fee84b438b55da2001062c1efeb", "score": "0.55267274", "text": "function patchViaCapturingAllTheEvents() {\n\t var _loop_1 = function(i) {\n\t var property = eventNames[i];\n\t var onproperty = 'on' + property;\n\t document.addEventListener(property, function (event) {\n\t var elt = event.target, bound;\n\t var source = elt.constructor['name'] + '.' + onproperty;\n\t while (elt) {\n\t if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n\t bound = Zone.current.wrap(elt[onproperty], source);\n\t bound[unboundKey] = elt[onproperty];\n\t elt[onproperty] = bound;\n\t }\n\t elt = elt.parentElement;\n\t }\n\t }, true);\n\t };\n\t for (var i = 0; i < eventNames.length; i++) {\n\t _loop_1(i);\n\t }\n\t ;\n\t}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.5502775", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.5502775", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.5502775", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "b1839ed8534ab6c9c9d039afee9d9e18", "score": "0.5502775", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "84b7c5baf8f919f6db3a997ad4a34f8d", "score": "0.55005217", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "84b7c5baf8f919f6db3a997ad4a34f8d", "score": "0.55005217", "text": "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.54912597", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.54912597", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.54912597", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "9eddddbb6b7c292afa1df844e0319db6", "score": "0.54912597", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "93e17b0c355ae0b4625834d5ddfacb89", "score": "0.5485647", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName,listener=getListener(inst,registrationName);listener&&(event._dispatchListeners=accumulateInto(event._dispatchListeners,listener),event._dispatchInstances=accumulateInto(event._dispatchInstances,inst))}}", "title": "" }, { "docid": "5642efe067245e6f46263d087db9b4a8", "score": "0.5471175", "text": "fireEvents() {\n const events = this.$$eventListeners.$$global\n , hasEvents = !!events\n ;\n\n if ( hasEvents ) {\n events.forEach( callback => {\n callback( this );\n } );\n }\n }", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "321f39326c3da1074e18387d56f8772b", "score": "0.54694533", "text": "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "24a9387d8b7898397c431f7feae0f2eb", "score": "0.5468192", "text": "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "title": "" } ]
a1ec51363a61592d8ee96038ef1a3368
Method animates sidenav and itemlist so that the open and close transition is smooth
[ { "docid": "8899096a4d6807b89cabf3bec4af94e0", "score": "0.68326926", "text": "toggle() {\n const el = angular.element('item-list');\n const el2 = angular.element('md-sidenav');\n\n if(!this.open) {\n this.animate.addClass(el, 'md-opened-custom');\n this.animate.addClass(el2, 'md-opened-custom');\n } else{\n this.animate.removeClass(el, 'md-opened-custom');\n this.animate.removeClass(el2, 'md-opened-custom');\n }\n this.open = !this.open;\n }", "title": "" } ]
[ { "docid": "4d3b9768ebd85857c602063cd20557f7", "score": "0.6488755", "text": "function slideInNav() {\n $mainNavContainer.toggleClass('visible'); \n $contentContainer.toggleClass('main-nav-showing');\n $breadcrumb.toggleClass('push-over');\n //stick navigation if necessary\n stickyMainNav.stickNav(); \n $hamburger.toggleClass('is-active'); \n }", "title": "" }, { "docid": "44370dc1123da07ae6356c2970856f4f", "score": "0.6455954", "text": "function menuslidein(){\n $('#yearbooktoggle').removeClass('open').addClass('closed');\n $('#yearbook-nav').animate({\"left\":\"-200px\"},500);\n $('body').animate({left:\"0\"},500);\n }", "title": "" }, { "docid": "a3d2c7cf955064ab53901deae0245b62", "score": "0.6403766", "text": "function open_close_nav(){\r\n //When open or closed, change width and animate hamburguer menu\r\n if (document.querySelector(\".sidenav\").style.width === \"0px\"){\r\n //hamburger animation\r\n document.querySelector(\".top\").style.transform = (\"rotate(39.55deg)\")\r\n document.querySelector(\".middle\").style.opacity = \"0\"\r\n document.querySelector(\".bottom\").style.transform = (\"rotate(-38deg)\")\r\n //side menu width\r\n document.querySelector(\".sidenav\").style.width = \"5.9vw\"\r\n document.querySelector(\".sidenav-content\").style.display = \"flex\"\r\n }\r\n else{\r\n //hamburger animation\r\n document.querySelector(\".top\").style.transform = (\"rotate(0deg)\")\r\n document.querySelector(\".middle\").style.opacity = \"100\"\r\n document.querySelector(\".bottom\").style.transform = (\"rotate(0deg)\")\r\n //side menu width\r\n document.querySelector(\".sidenav\").style.width = \"0\"\r\n document.querySelector(\".sidenav-content\").style.display = \"none\"\r\n }\r\n}", "title": "" }, { "docid": "454920d55db7da7d05494ee03cf3bd97", "score": "0.63399583", "text": "function navInnerShow() {\n $nav.show();\n $navInner.animate({\n width: '65%'\n }, animationSpeed);\n }", "title": "" }, { "docid": "8242e3a88f2eaef76e32d93240119678", "score": "0.6280194", "text": "function hideSidenav() {\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}", "title": "" }, { "docid": "9e782e3d30bb2b50141dd396edb9162c", "score": "0.6202849", "text": "_expandedState() {\r\n this.tag('SideNavBg').w = 400\r\n this.tag('SideNavBg').clipping = false\r\n this.tag('MenuList')\r\n .element.tag('HighLight')\r\n .patch({\r\n src: Utils.asset(ImageConstants.SIDEBAR_SELECTION_GRADIENT)\r\n })\r\n }", "title": "" }, { "docid": "a7aea70ffb229e04ed422947549f3399", "score": "0.6178926", "text": "function closeNav() {\n document.getElementById(\"myNav\").style.width = \"0%\";\n document.getElementById(\"sidemenue\").style.opacity= \"1.0\";\n document.getElementById(\"myNav\").style.opacity=\"0.0\";\n document.getElementById(\"cont\").style.transition=\"0.2s\";\n \n }", "title": "" }, { "docid": "10fa4f0581d7ef8d3655d30c89866f6d", "score": "0.6178307", "text": "function toggleNav() {\n let sidebarWidth = document.getElementById(\"sidebar\");\n if (sidebarWidth.style.width == \"\" || sidebarWidth.style.width == \"0px\") {\n $(sidebarWidth).animate(\n { width: '+=240px' }, { duration: 200, queue: false }\n );\n $(document.getElementsByClassName(\"sidenav-btn\")[0]).animate(\n { left: '+=240px' }, { duration: 200, queue: false }\n );\n $(document.getElementById(\"mapid\")).animate(\n { left: '+=12.5vw', width: '-=12.5vw'}, { duration: 200, queue: false }\n );\n } else {\n //sidebarWidth.style.width = \"\";\n $(sidebarWidth).animate(\n { width: '-=240px' }, { duration: 200, queue: false }\n );\n $(document.getElementsByClassName(\"sidenav-btn\")[0]).animate(\n { left: '-=240px' }, { duration: 200, queue: false }\n );\n $(document.getElementById(\"mapid\")).animate(\n { left: '-=12.5vw', width: '+=12.5vw'}, { duration: 200, queue: false }\n );\n } \n}", "title": "" }, { "docid": "5d9e05486bc9d31d5256b3ccbb3604ca", "score": "0.61755675", "text": "function openNav()\t{\n\t\tconsole.log('Open');\n\t\t$('#sidenav').addClass('open');\n\t\t$('#sidenav').removeClass('closed');\n\t\t$('#sidenav').css('width',\t'250px');\n\t\t//\n\t\t$('#main').css('transform',\t'translateX(250px)');\n\t\t$('#header_content').css('transform',\t'translateX(250px)');\n\t\t$('#about').css('transform',\t'translateX(250px)');\n\t}", "title": "" }, { "docid": "7ae34a5c7f352d1015bd216ed7c99dea", "score": "0.61309904", "text": "function openNav() {\r\n sidebarContainer.classList.toggle(\"shown\");\r\n body.classList.toggle(\"slide-in\");\r\n setTimeout(function() {\r\n sidebarContainer.classList.toggle(\"slide-in\");\r\n }, 1);\r\n setTimeout(scrollDelay, 600);\r\n body.style.overflow = 'hidden';\r\n hamburger.classList.add(\"is-active\");\r\n hamburgerXs.classList.add(\"is-active\");\r\n}", "title": "" }, { "docid": "536619899683ef07a1edf51db7988548", "score": "0.61276644", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n document.getElementById(\"huyconcac\").style.opacity = 1;\n document.getElementById(\"huyconcac\").style.transition = \"0.4s\";\n document.getElementById(\"main\").style.transition = \"0.6s\";\n}", "title": "" }, { "docid": "4946eb1095a7f7c3bfce76e86b3cc926", "score": "0.610628", "text": "function OpenNav(){\r\n document.getElementById(\"sidenav\").style.width = \"210px\"; \r\n document.getElementById(\"main\").style.marginLeft = \"210px\"; \r\n document.getElementById(\"sidenav\").style.backgroundColor = \"#404040\"; \r\n document.getElementById(\"b\").classList.add(\"hide\");\r\n document.getElementById(\"a\").classList.remove(\"hide\");\r\n }", "title": "" }, { "docid": "59565d98d910e9ee41e24674375885c0", "score": "0.6088824", "text": "function showSideMenu() {\n $(\"overlay\").style.display = \"block\";\n // Change the sidenav maxWidth for animation\n $(\"sidenav\").style.maxWidth = \"250px\";\n}", "title": "" }, { "docid": "6bce8dc3639b22799d0bc3a5fe2f6b4b", "score": "0.60726064", "text": "function menuAnimation() {\n if (document.querySelector('.menu--open')) {\n console.log('performing close animation'); \n gsap.from(\".menu\", { duration: 1, x: 0});\n gsap.to(\".menu\", { duration: 1, x: -50});\n }else if (document.querySelector('.menu--close')){\n console.log('performing open animation'); \n gsap.from(\".menu\", { duration: 1, x: -50});\n gsap.to(\".menu\", { duration: 1, x: 0}); \n }\n \n\n document.querySelector('.articles').addEventListener(\"click\",\n () => {\n gsap.from(\".menu\", { duration: 1, x: 0});\n gsap.to(\".menu\", { duration: 1, x: -50 });\n document.querySelector('.menu').classList.add('menu--close');\n document.querySelector('.menu').classList.remove('menu--open');\n }\n );\n }", "title": "" }, { "docid": "4a716e6f227b6ce59a2730ddacb852f6", "score": "0.60517895", "text": "function barshow()\r\n{\r\n const navigationbar=document.querySelector('#menuicon');\r\n const links=document.querySelectorAll('.nav-links li');\r\n const linksbar=document.querySelector('.nav-links');\r\n navigationbar.addEventListener('click',()=>\r\n {\r\n if(counter%2==0)\r\n {\r\n linksbar.style.transition='transform 0.6s ease-in-out';\r\n linksbar.style.transform='translateX(0%)';\r\n }\r\n else\r\n {\r\n linksbar.style.transition='transform 0.6s ease-in-out';\r\n linksbar.style.transform='translateX(100%)';\r\n }\r\n counter++;\r\n navigationbar.classList.toggle(\"toggle\");\r\n links.forEach((link,index)=>{\r\n if(link.style.animation)\r\n {\r\n link.style.animation='';\r\n }\r\n else{\r\n link.style.animation=\"linkanimation 0.5s ease-in-out forwards \"+((index/5)+0.3)+\"s\";\r\n }\r\n \r\n });\r\n });\r\n}", "title": "" }, { "docid": "868c1747f5180f2c797fc040a67c4d39", "score": "0.602829", "text": "function openNav() {\n $(\"body\").css(\"overflow\", \"hidden\");\n $(\".sidenav\").css(\"opacity\", \"1\");\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.body.style.backgroundColor = \"rgba(0,0,0,0.5)\";\n}", "title": "" }, { "docid": "4c35c9916c32d8986978bfe68efabe02", "score": "0.6019256", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"300px\";\n document.getElementById(\"main\").style.marginLeft = \"300px\";\n document.getElementById(\"mySidenav\").getElementsByClassName(\"closebtn\")[0].style.display = \"block\";\n document.getElementById(\"mySidenav\").getElementsByClassName(\"openbtn\")[0].style.display = \"none\";\n document.getElementById(\"mySidenav\").getElementsByClassName(\"links\")[0].style.display = \"block\";\n}", "title": "" }, { "docid": "7e170910893074bee610ffa653de9a89", "score": "0.60138816", "text": "function openSideNav() {\n var expandIcons = document.getElementsByClassName(\"more\");\n document.getElementById(\"sidenav\").style.left = 0;\n document.getElementById(\"screen-dim\").style.opacity = 1;\n document.getElementById(\"screen-dim\").style.visibility = \"visible\";\n for (var i = 0; i < expandIcons.length; i++) {\n expandIcons[i].style.transform = \"rotate(0deg)\";\n }\n}", "title": "" }, { "docid": "79b8866b558f879fd946202af3d6c3e0", "score": "0.60087776", "text": "function toggleNav() {\n //Toggle menu bars open/close\n menuBars.classList.toggle('change');\n //toggle navigation active\n overlay.classList.toggle('overlay-active');\n if(overlay.classList.contains('overlay-active')) {\n //animate navigation overlay in \n overlay.classList.replace('overlay-slide-left', 'overlay-slide-right');\n //animate in navigation items with delay (css animation)\n navAnimation('out', 'in');\n } else {\n //animate navigation overlay out\n overlay.classList.replace('overlay-slide-right', 'overlay-slide-left');\n //animate out navigation items with delay (css animation)\n navAnimation('in', 'out');\n }\n}", "title": "" }, { "docid": "a48b7a14b54d9da85bb43bd2c8373231", "score": "0.5990784", "text": "function openNav() {\n \n \n document.getElementById(\"mySidenav\").style.width = \"250px\";\n setTimeout(function(){\n divsToHide = document.querySelectorAll(\"#mySidenav a\");\n for(var i = 0; i < divsToHide.length; i++){\n divsToHide[i].classList.remove(\"hide\");\n }\n }, 300);\n}", "title": "" }, { "docid": "ed40765880ae5626bdb90319490780a8", "score": "0.59835255", "text": "function navigation () {\n\n $(document).on('click', function(e) {\n if ( $(e.target).closest('.categoriebutton').length ) {\n $('.sidenav').animate({\"left\": '0%'},500);\n $(\".overlay\").fadeIn('slow');\n }else if ( ! $(e.target).closest('.sidenav').length ) {\n $(\".overlay\").fadeOut('slow');\n $('.sidenav').animate({\"left\": '-90%'},500);\n }\n });\n}", "title": "" }, { "docid": "00d6db8a2e8d6673f7a62fd292e9885d", "score": "0.59661317", "text": "function animateItems() {\n\t\tisVisible(items);\n\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\tvar itemFirstChildren = items[i].firstElementChild.children;\n\t\t\tvisibleFadeInUp(items[i], itemFirstChildren, 0);\n\t\t}\n\t}", "title": "" }, { "docid": "001a64244d14dd5294c79be66c7a280c", "score": "0.5965971", "text": "update () {\n\t\tif(!this.touchingSidenav) return;\n\n\t\trequestAnimationFrame(this.update);\n\n\n\t\t// Use Math.min to assure that the translate will never be negative\n\t\tconst translateX = Math.min(0, this.currentX - this.startX);\n\n\n\t\t// @see {@link https://developers.google.com/web/updates/2015/01/ES6-Template-Strings}\n\t\tthis.sidenavUl.style.transform = `translateX(${translateX}px)`;\n\t}", "title": "" }, { "docid": "d95bf27a940ea836c346a9e285379c24", "score": "0.5951174", "text": "function menuOpen() { \n\t$('nav').show();\n\t$('#content').animate({ \n\t\tleft: '200px' \n\t}, 400, 'easeOutBack'); \n}", "title": "" }, { "docid": "630f1cf067a4b17fbe2acfd118270c7e", "score": "0.5940649", "text": "function animateMenuItems() {\n for (var i = 0; i < menuItems.length; i++) {\n var item = menuItems[i];\n // Stagger transition with transitionDelay\n item.style[transitionProp + 'Delay'] = (i * 75) + 'ms';\n item.classList.toggle('is--moved');\n }\n}", "title": "" }, { "docid": "9e661f2ddefe39c78b860d2a5143b949", "score": "0.5921191", "text": "function navSlide() {\n const burger = document.querySelector(\".burger\");\n const nav = document.querySelector(\".nav-links\");\n const navLinks = document.querySelectorAll(\".nav-links li\");\n\n burger.addEventListener(\"click\", () => {\n //Toggle Nav\n nav.classList.toggle(\"nav-active\");\n\n //Animate Links\n navLinks.forEach((link, index) => {\n if (link.style.animation) {\n link.style.animation = \"\"\n } else {\n link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 0.5}s`;\n }\n });\n //Burger Animation\n burger.classList.toggle(\"toggle\");\n });\n\n}", "title": "" }, { "docid": "09cd0e432e25234c1f8c5542f51657e5", "score": "0.5918169", "text": "function buttonSlideIn() {\n var child = menuNav.querySelectorAll(\".nav-item\");\n\n child[0].style.transitionDelay = \"0.12s\"; //Home\n child[1].style.transitionDelay = \"0.24s\"; //About Us\n child[2].style.transitionDelay = \"0.36s\"; //Our Services\n child[3].style.transitionDelay = \"0.48s\"; //Working With Us\n child[4].style.transitionDelay = \"0.60s\"; //Contact Us\n}", "title": "" }, { "docid": "fdd54c362c1b1c2c3351bfb2a7ecd4ed", "score": "0.5911896", "text": "animateSuForms(){\n\t\tthis.setState({\n\t\t\thidesuform: !this.state.hidesuform\n\t\t})\n\t\tif (!this.state.hidesiform){\n\t\t\tthis.setState({\n\t\t\t\thidesiform: !this.state.hidesiform\n\t\t\t})\n\t\t}\n\t}", "title": "" }, { "docid": "488123ab4d8ea3a869f5dfddb55ba0d9", "score": "0.5907884", "text": "function openMenu(){\n $(\"#icon_menu\").removeClass(\"close_menu\").addClass(\"open_menu\");\n $(\"#ul_nav li\").css(\"visibility\",\"visible\");\n $(\"#ul_nav\").animate({\n height: 150\n }, 350).addClass(\"bg-grey\");\n}", "title": "" }, { "docid": "ae864d463a1ddd9e74c5643547e64b63", "score": "0.5878601", "text": "function closeNav() {\n navElements.animate({\n left: '100px',\n opacity: 0,\n }, 400);\n nav.animate({\n right: '-280px',\n }, 500);\n }", "title": "" }, { "docid": "6ccbff517ff2f15bca63a42f89894886", "score": "0.58752483", "text": "function navOpen() {\n // add active class and scaledown\n navCircle.addClass(\"active navCircleScaleDown\"); \n $(\".navContainer\").css(\"width\", \"100%\");\n $(\".navLink\").show().css(\"opacity\", \"1\");\n // animate the width\n $(\".redBar\").animate({\n width: \"100%\"\n }, 300, \"easeOutQuint\");\n // add any opacity the nav has lost\n $(\".nav\").css(\"opacity\", \"1\");\n //adding other listeners with slight delay so it\n //doesnt fire right away\n setTimeout(function() {\n $(\"body\").on(\"click\", navClose);\n $(window).on(\"scroll\", navClose);\n }, 1);\n }", "title": "" }, { "docid": "8574baeddea71990bd1265b3d52f4f83", "score": "0.5866287", "text": "function openNav() {\n document.getElementById(\"right-bar-sorting-container\").style.height = \"370px\";\n document.getElementById(\"right-bar-characters\").style.marginTop = \"370px\";\n\t$(\".slide-button-open\").fadeToggle(\"slow\");\n\t$(\".slide-button-close\").fadeToggle(\"slow\");\n}", "title": "" }, { "docid": "70e4d8cffc7927534c61f0c5ccb86112", "score": "0.5858436", "text": "function toggleItemssList() {\n var pending = $mdBottomSheet.hide() || $q.when(true);\n\n pending.then(function(){\n $mdSidenav('left').toggle();\n });\n }", "title": "" }, { "docid": "b63d21787f5121cfefc77775f9a91f9a", "score": "0.58527994", "text": "function openNav() {\n document.getElementById(\"rightSideNav\").style.width = \"175px\";\n // $('.topLeft, .leftSide, .rightSide').css('filter','blur(5px)');\n $('.topLeft, .leftSide, .rightSide, footer').css('-webkit-animation', 'image_blur 1s');\n $('.topLeft, .leftSide, .rightSide, footer').css('filter', 'blur(10px)');\n}", "title": "" }, { "docid": "3cdd7af9828805c9ae868da1a18d4a75", "score": "0.5833295", "text": "function openNav() {\n\t$(\"#mySidenav\").css({\"box-shadow\": \"250px 0px 150px 300px rgba(0, 0, 0, 1)\", \"width\": \"50%\"});\n}", "title": "" }, { "docid": "eda6dcc7c358b777259666987eaed9c4", "score": "0.58322245", "text": "function animateHamburger() {\n if (!hamburgerActive) {\n document.getElementsByClassName(\"hamburger\")[0].className=\"hamburger_active\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.transition = \"all .25s ease-in\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.opacity = \"1\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.height = \"auto\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.visibility = \"visible\";\n } else {\n document.getElementsByClassName(\"hamburger_active\")[0].className=\"hamburger\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.transition = \"none\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.opacity = \"0\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.height = \"0\";\n document.getElementsByClassName(\"dropdown_container\")[0].style.visibility = \"hidden\";\n }\n hamburgerActive = !hamburgerActive;\n}", "title": "" }, { "docid": "e3e813a84f24a05ea5cccbcd4f93ca36", "score": "0.58264333", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"list\").style.display = \"inline\";\n document.getElementById(\"mySidenav\").style.padding = \"0\"; \n\n}", "title": "" }, { "docid": "1889ec9a290399b77226c9087464bffc", "score": "0.58184975", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"25%\";\r\n document.getElementById(\"push-content\").style.marginLeft = \"25%\";\r\n}", "title": "" }, { "docid": "1889ec9a290399b77226c9087464bffc", "score": "0.58184975", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"25%\";\r\n document.getElementById(\"push-content\").style.marginLeft = \"25%\";\r\n}", "title": "" }, { "docid": "ca8439b6001b512bef8b925a46030f18", "score": "0.5814855", "text": "function openNav() {\ndocument.getElementById(\"mySidenav\").style.width = \"250px\";\ndocument.getElementById(\"main\").style.marginLeft = \"250px\";\n/* makes the right side fade to a dark gray */\ndocument.body.style.backgroundColor = \"rgba(0,0,0,0.25)\";\n}", "title": "" }, { "docid": "fd733cf93074e29ebb4742a937880551", "score": "0.581381", "text": "function closeNav(){\r\n document.getElementById(\"sidenav\").style.width = \"0\"; \r\n document.getElementById(\"main\").style.marginLeft = \"0\"; \r\n document.getElementById(\"b\").classList.remove(\"hide\");\r\n document.getElementById(\"a\").classList.add(\"hide\");\r\n }", "title": "" }, { "docid": "9d1bfed85fc2f3e9b85839e6d3dd1049", "score": "0.5812616", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"300px\";\n document.getElementById(\"list\").style.display = \"none\";\n document.getElementById(\"mySidenav\").style.padding = \"10px 17px\"; \n}", "title": "" }, { "docid": "1ccbc4199d1b3c4ff1add7a0f563f0e7", "score": "0.58114165", "text": "function openNav() {\n document.getElementById(\"side\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n setTimeout(() => {document.getElementById(\"smallSide\").style.display = \"none\";}, 100)\n}", "title": "" }, { "docid": "e2a4849d8c61bfc3d444c87018f72cbc", "score": "0.58007294", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n navbarStatus = true;\n}", "title": "" }, { "docid": "4f99f5e2ca14adea329f51e41e479bbe", "score": "0.57977426", "text": "_openChanged() {\n if (this.open) {\n this.style.display = 'block';\n this.playAnimation('entry');\n }\n else {\n this.playAnimation('exit');\n }\n }", "title": "" }, { "docid": "c9f3a90a70a299edff113a38aba23960", "score": "0.57919717", "text": "function forMenu() {\n navItemContainer.classList.toggle(\"open-nav-items\")\n}", "title": "" }, { "docid": "4352150c8dbf44c138d9309cc52e8100", "score": "0.5785849", "text": "function closeItem () {\n\tdocument.getElementById(\"mySidenav\").style.width = \"0\";\n}", "title": "" }, { "docid": "fc063ae444f373475e979767907a2ca8", "score": "0.5785764", "text": "function showNav(method, duration) {\n\t\t\n var headerHeight = $('header').height();\n var headerBarHeight = $('#navbar').height();\n if (method === 'slide-up') {\n $(\"header\").transition({ opacity: 1, top: -headerHeight, }, duration, 'snap');\n } else if (method === 'slide-down') {\n $(\"header\").transition({ opacity: 1, top: 0, }, duration, 'snap');\n }\n }", "title": "" }, { "docid": "a65aad2af5e54d6c2dcdec203448bb06", "score": "0.57833636", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "title": "" }, { "docid": "a65aad2af5e54d6c2dcdec203448bb06", "score": "0.57833636", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"250px\";\n document.getElementById(\"main\").style.marginLeft = \"250px\";\n }", "title": "" }, { "docid": "27086ba3650037e9be72bd61f91fdb09", "score": "0.57820094", "text": "function navExpand() {\n\t//Expand the condensed navigation bar\n\tdocument.getElementById(\"navMobileExpand\").style.visibility = \"visible\";\n\tdocument.getElementById(\"navMobileExpand\").style.opacity = \"1\";\n\tdocument.getElementById(\"navMobileExpand\").style.backgroundColor = \"white\";\n\tdocument.getElementById(\"navMobileExpand\").style.height = \"auto\";\n\n\t//Changes the button of \"MENU\" to \"CLOSE\"\n\t//Make the word \"MENU\" to become invisible\n\tdocument.getElementById(\"nav-mobile-menu-open\").style.display = \"none\";\n\n\t//Make the word \"CLOSE\" to become visible\n\tdocument.getElementById(\"nav-mobile-menu-close\").style.display = \"block\";\n\tdocument.getElementById(\"nav-mobile-menu-close\").style.color = \"black\";\n\n\t//Changes the elements on navigation bar to black color\n\tdocument.getElementById(\"menu-cart-mobile\").style.color = \"black\";\n\tdocument.getElementById(\"menu-cart-img-mobile\").src = \"sources/cart-black.png\";\n\tdocument.getElementById(\"nav-logo-mobile\").src = \"sources/logo.png\";\n\n\t//Changes the entire condensed navigation bar into white with slight animation\n\tdocument.getElementById(\"nav-mobile\").style.backgroundColor = \"white\";\n\tdocument.getElementById(\"nav-mobile\").style.transition = \"all 0.2s linear\";\n}", "title": "" }, { "docid": "586122a03e413bce64d3449d93b8d728", "score": "0.5776127", "text": "function updateFrame(){\n var index = $('.project_selectors li').index(this);\n //if user clicks on selector and project is currently open, do not re-trigger animation\n if (index === current_selector){\n return;\n }\n switch (index){\n case 0:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n case 1:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n case 2:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n case 3:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n case 4:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n case 5:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n case 6:\n current_slide = index;\n current_selector = index;\n setFrame();\n break;\n }\n}", "title": "" }, { "docid": "19ed6c31f7d2e767c465e1bf40b34b1f", "score": "0.5756784", "text": "function menuSlide() {\n $(\"#burger\").click(function () {\n $(\".nav-menu\").animate({\n width: \"toggle\"\n }, 175);\n $(\".nav-item\").fadeToggle(350);\n $(\".hr-menu\").fadeToggle(350);\n });\n}", "title": "" }, { "docid": "e5500eae9f01e1967ec5cb72842fe4f6", "score": "0.5753408", "text": "function openNav() {\r\n sideNav.style.width = \"250px\";\r\n // mainNav.style.marginLeft = \"250px\";\r\n showSocialIcons.style.width = \"250px\";\r\n document.body.style.backgroundColor = \"rgba(0,0,0,0.4)\";\r\n showSocialIcons.classList.add(\"show-social-icons\");\r\n showSocialIcons.classList.remove(\"social-icons\");\r\n}", "title": "" }, { "docid": "6b48c5c67ed2d1bec9f44c92f983d017", "score": "0.57512164", "text": "handleNavToggle() {\n this.view.nav.classList.toggle('nav--hidden');\n this.view.main.classList.toggle('main--hidden');\n }", "title": "" }, { "docid": "ed403d14ee62f4039deeabc296c87d52", "score": "0.5750831", "text": "function smoothExpandToggle()\r\n{\r\n\tthis.direction = -this.direction;\r\n\tthis.expanded = (this.direction==1 ? P_EXPANDING : P_COLLAPSING);\r\n\tif(this.animation==null)\r\n\t{\r\n\t\tthis.animation = setInterval(\"animateExpandingObject('\"+this.id+\"')\", 10);\r\n\t}\r\n}", "title": "" }, { "docid": "0c4993e4251f858de73dee7a3a45b842", "score": "0.5738872", "text": "function toggleMenu() {\n //make sure this animation only works if the browser is mobile or tablet\n if(window.innerWidth < 1200) {\n if(mainNav.style.height===\"0vh\") {\n TweenMax.to(mainNav, 2, {height:\"40vh\", ease:Elastic.easeOut});\n }else if(mainNav.style.height>\"0vh\") {\n TweenMax.to(mainNav, 1, {height:\"0vh\", ease:Back.easeIn});\n }\n for(var i=0;i<hamburgerBars.length;i++) {\n hamburgerBars[i].classList.toggle(\"barOpen\");\n }\n }\n }", "title": "" }, { "docid": "5d4873c0eeb977c6cd76cb95c9e7498a", "score": "0.5734861", "text": "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"push-content\").style.marginLeft = \"0\";\r\n}", "title": "" }, { "docid": "5d4873c0eeb977c6cd76cb95c9e7498a", "score": "0.5734861", "text": "function closeNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"0\";\r\n document.getElementById(\"push-content\").style.marginLeft = \"0\";\r\n}", "title": "" }, { "docid": "67e13530695186188a1ace5b9d16bb41", "score": "0.57323027", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"225px\";\r\n document.getElementById(\"main\").style.marginLeft = \"225px\";\r\n}", "title": "" }, { "docid": "d0a92cad1c9d6adbae07b04666d1a4ed", "score": "0.5732186", "text": "function menuAnimation() {\n if (!menuOpen) {\n menuOpen = true;\n headerTl.play();\n }\n else {\n menuOpen = false;\n headerTl.reverse();\n }\n}", "title": "" }, { "docid": "032e21b45f3e1a605d8b12af20e7aba5", "score": "0.5732151", "text": "function smoothCollapse()\r\n{\r\n\tif(this.expanded==P_COLLAPSING || this.expanded==P_COLLAPSED)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\tthis.expanded = P_COLLAPSING;\r\n\tthis.direction = -1;\r\n\tif(this.animation==null)\r\n\t{\r\n\t\tthis.animation = setInterval(\"animateExpandingObject('\"+this.id+\"')\", 10);\r\n\t}\r\n}", "title": "" }, { "docid": "6bfa1e1a4901de273e3bba2be53e40f7", "score": "0.5726339", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"100%\";\n document.getElementById(\"zindex\").style.zIndex = \"-1\";\n document.getElementById(\"zindex1\").style.zIndex = \"-1\";\n document.getElementById(\"zindex2\").style.zIndex = \"-1\";\n }", "title": "" }, { "docid": "c8a8188048973b70f6c7af0f10503587", "score": "0.5725702", "text": "function toggleNav() {\n if (!isOpen) {\n var openFn = setInterval(function () {\n if (vpWidth > 767) {\n if (count < 70) {\n openNavDesk(navLnks);\n }\n else {\n clearInterval(openFn);\n }\n }\n else {\n if (count < 55) {\n openNavMob(navLnks);\n }\n else {\n clearInterval(openFn);\n }\n }\n }, 1);\n isOpen = true;\n }\n else {\n var closeFn = setInterval(function () {\n if (vpWidth > 767) {\n if (count > -300) {\n closeNavDesk(navLnks);\n }\n else {\n clearInterval(closeFn);\n }\n }\n else {\n if (count > -225) {\n closeNavMob(navLnks);\n }\n else {\n clearInterval(closeFn);\n }\n }\n }, 1);\n isOpen = false;\n }\n }", "title": "" }, { "docid": "b0c7d20f1352082f28b5fda7c46a57dd", "score": "0.57206714", "text": "function closeNav() \n{\n document.getElementById(\"mySidenav\").style.left = \"100vw\";\n \n}", "title": "" }, { "docid": "a8f8cd34d9bf0613d84bd94976cc6ffb", "score": "0.57119906", "text": "function openNav() {\n $('#nav-list li').removeClass('treelisthidden');\n storage.setItem(treesettings, '1');\n $('#sideNavigation').css('display', 'block');\n\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('.cover').css('display', 'none');\n $('body.support_kb').find('#sidefoot').css({\n 'width': '300px',\n 'margin-left': ''\n });\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '300px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '0');\n $('body').find('main').css('width', 'calc(100% - 350px)');\n\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"enable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n\n $('#side-toggle').attr('class', 'fa fa-angle-double-left');\n\n }", "title": "" }, { "docid": "5245b1c49ee183aeb9fae8af4a7bef7f", "score": "0.5706825", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"80px\";\n document.getElementById(\"main\").style.marginLeft = \"80px\";\n document.getElementById(\"mySidenav\").getElementsByClassName(\"closebtn\")[0].style.display = \"none\";\n document.getElementById(\"mySidenav\").getElementsByClassName(\"openbtn\")[0].style.display = \"block\";\n document.getElementById(\"mySidenav\").getElementsByClassName(\"links\")[0].style.display = \"none\";\n}", "title": "" }, { "docid": "e2fe9ee35f8257c4d0ee7e2c1c8453ec", "score": "0.57015026", "text": "toggleToc() {\n if ( this.isTocOpen ) {\n this.DOM.chapter.style.opacity = 1;\n this.DOM.nav.classList.remove('nav--open');\n TweenMax.set(this.DOM.tocItems, {opacity: 0});\n }\n else {\n this.DOM.chapter.style.opacity = 0;\n this.DOM.nav.classList.add('nav--open');\n TweenMax.staggerTo(this.DOM.tocItems, 1, {\n ease: Expo.easeOut,\n startAt: {opacity: 0, y: 10},\n opacity: 1,\n y: 0\n }, 0.02);\n }\n this.isTocOpen = !this.isTocOpen;\n }", "title": "" }, { "docid": "035aac9700719eb0368cfc6a9327c81f", "score": "0.5700339", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "title": "" }, { "docid": "0b31b16ff8f9d9106004f2da902da2ef", "score": "0.56999177", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main1\").style.marginLeft = \"0\";\n document.getElementById(\"main2\").style.marginLeft = \"0\";\n\n}", "title": "" }, { "docid": "9e1394b663294d3b5d57de51b51cfd75", "score": "0.5697985", "text": "function closeNav() {\n document.getElementById(\"sidenav\").style.left = \"-270px\";\n document.getElementById(\"sidenavclose\").style.left = \"-40px\";\n // document.getElementById(\"years\").style.left = \"20px\";\n // document.getElementById(\"map\").style.left = \"0px\";\n}", "title": "" }, { "docid": "f4950bb7526902e87f06e5d0c7f32483", "score": "0.5695284", "text": "function openSidepage() {\n $('#mainpage').animate({\n left: '45%'\n }, 400, 'easeOutBack'); \n }", "title": "" }, { "docid": "c7460abd58b10b3ae9b58efc8232e106", "score": "0.56898123", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.width = \"350px\";\n document.getElementById(\"main\").style.marginLeft = \"350px\";\n document.getElementById(\"nav_btn\").style.display = \"none\";\n }", "title": "" }, { "docid": "5aedff7c596a6dc6e52996633adb227a", "score": "0.5682906", "text": "function animateShowMore() {\n document.addEventListener(\"click\", (event) => {\n if (event.target.classList.contains(\"nav-show\")) {\n event.preventDefault();\n if (!linksList.classList.contains(\"show\")) {\n linksList.classList.add(\"show\");\n } else {\n linksList.classList.remove(\"show\");\n }\n } else if (\n linksList.classList.contains(\"show\") &&\n !event.target.classList.contains(\"nav-link\")\n ) {\n linksList.classList.remove(\"show\");\n }\n });\n }", "title": "" }, { "docid": "7a0c95a3209c0e584a04a14d0adc919d", "score": "0.5682291", "text": "function openNav() {\n sideNav.style.width = \"200px\";\n mainDiv.style.marginLeft = \"200px\";\n mainDiv.style.opacity = \".7\";\n mobileHamburger.style.visibility = \"hidden\";\n setTimeout(function () {\n menuStatus = \"open\";\n }, 100);\n}", "title": "" }, { "docid": "320cb922b00fed0e402205a3f98dce27", "score": "0.5681218", "text": "function opennav()\n{\n\t{\n\t\tdocument.getElementById('sidenav').style.width='100%';\n\t}\n}", "title": "" }, { "docid": "22135410c4d4db8c60177133743dcb3c", "score": "0.5679339", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"70px\";\n }", "title": "" }, { "docid": "22135410c4d4db8c60177133743dcb3c", "score": "0.5679339", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"70px\";\n }", "title": "" }, { "docid": "a15f3f29bcdc8adeeede0830d2f14ead", "score": "0.5679224", "text": "function slideOpen(el){\nvar elem = document.getElementById(el);\n\telem.style.transition = \"height 0.5s linear 0s\";\n\telem.style.height = '100px';\n}", "title": "" }, { "docid": "698f6c3b5c23bcb50a1ec277bf9514e3", "score": "0.56778455", "text": "function animateSkillsSection() {\n $(\"#ep-skills #wrench\").toggle('slide', {'direction':'up','easing': 'easeOutBounce', 'duration': 1000});\n $(\"#ep-skills #flashlight\").toggle('slide', {'direction':'right','easing': 'linear', 'duration': 1000},function(){\n $('#ep-skills .title').fadeIn();\n $('#ep-skills .skill-list-row').toggle('slide', {'direction':'left','easing': 'easeInOutBack', 'duration': 1000});\n $('#ep-skills .skill-img-row').toggle('slide', {'direction':'right','easing': 'easeInOutBack', 'duration': 1000});\n });\n mattsEP.animatitonOn['skills'] = true;\n }", "title": "" }, { "docid": "889f2795c27540a187d28834f672a36a", "score": "0.56756073", "text": "function openMenu() {\n document.getElementById(\"menuGal\").style.left = \"0\";\n document.getElementById(\"menuGalBurger\").classList.toggle('hide');\n document.getElementById(\"menuGalCross\").classList.toggle('hide');\n}", "title": "" }, { "docid": "c85fd41d891e2a640f8cfd0156eb0f20", "score": "0.56743747", "text": "function openNav() {\n slide = document.getElementById(\"mySidenav\")\n slide.style.width = \"250px\";\n $( \"#custom-nav\" ).hide();\n}", "title": "" }, { "docid": "7a84c64c0bbf33e9ef04057bbbfb6cdf", "score": "0.5671141", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").style.width = \"160px\";\r\n document.getElementById(\"mySidenav\").style.visibility = \"visible\";\r\n [].forEach.call(document.querySelectorAll('.closebtn'), function (el) {\r\n el.style.visibility = 'visible';\r\n});\r\n}", "title": "" }, { "docid": "b6857ac1fb63efc9ed7c3d4f013ab5ac", "score": "0.5670607", "text": "function openNav() {\n document.getElementById(\"mySidenav\").style.left = \"0\";\n}", "title": "" }, { "docid": "83753f6dec756bb6b671bc7ac9feefca", "score": "0.5670485", "text": "function w3_open() {\n if (mySidenav.style.display === 'block') {\n mySidenav.style.display = 'none';\n overlayBg.style.display = \"none\";\n solutions.style.display = \"none\";\n } else {\n mySidenav.style.display = 'block';\n overlayBg.style.display = \"block\";\n solutions.style.display = \"block\";\n \n }\n }", "title": "" }, { "docid": "d3bffd2aadd3945c64debb15b022438a", "score": "0.56667924", "text": "function openNav() {\n sidepanel.classList.toggle('open');\n}", "title": "" }, { "docid": "dcd0ad2c34634d8573ef6d290200021d", "score": "0.5660857", "text": "function tglSideBar(){\r\n var sideBarOffset = $('.sideBar').offset().top;\r\n \r\n document.body.onscroll = function(){\r\n if(document.body.scrollTop > sideBarOffset\r\n && $('.sideBar').hasClass('open')){\r\n $('.sideBar').css({\r\n 'position':'fixed',\r\n 'top':'0'\r\n });\r\n }else{\r\n $('.sideBar').css({\r\n 'position':'absolute',\r\n 'top':'auto'\r\n });\r\n }////END ifelse\r\n }////END fn \r\n \r\n if($('.sideBar').hasClass('open')){\r\n $('.sideBar').animate({right:'100%',left:'-150px'} ,'fast', function(){\r\n $(this).removeClass('open');\r\n }); \r\n }else{ \r\n $('.sideBar').animate({left:'0'} ,'fast', function(){\r\n $(this).addClass('open'); \r\n }); \r\n }///END ifelse\r\n document.body.onclick = function(){\r\n if($('.sideBar').hasClass('open')){\r\n if(event.target.id !== 'sideBr' \r\n && event.target.className !== 'btn btn-lg btn-link'\r\n && event.target.className !== 'list-group-item list-group-item'){\r\n $('.sideBar').animate({right:'100%',left:'-150px'} ,'fast', function(){\r\n $(this).removeClass('open');\r\n }); \r\n }////END EVENT \r\n }///END if\r\n }///END fn\r\n}////END fn ", "title": "" }, { "docid": "b5947933cab63907f520fb471622e2ba", "score": "0.5657268", "text": "function showAlbum() {\n let nav = document.querySelector(\".absolute-nav\");\n let button1 = document.querySelector(\".trigger\");\n if (nav.style.display === \"none\") {\n nav.style.display = \"block\";\n button1.innerHTML = \"Hide Albums <i class='fa fa-close'></i> \";\n } else {\n animateCSS(\".absolute-nav\", \"zoomInDown\");\n nav.style.display = \"none\";\n button1.innerHTML = \"Show Albums <i class='fa fa-expand'></i>\";\n }\n}", "title": "" }, { "docid": "6f2b57772cf0a4b7b67f1f4d1bd7cc26", "score": "0.5654729", "text": "function openNav() {\n //move ContainerContent with css-translate\n $('#ContainerContent').css({\n 'transform': 'translate3d(300px,0,0)'\n });\n\n // add class open & set visible\n $('#navWrapper').delay(350)\n .addClass('open')\n .queue(function (openNavWr) {\n $(this).css({\n 'visibility': 'visible'\n });\n openNavWr();\n }\n );\n\n // open the navigation content after delay\n $('#navContent').delay(300)\n .queue(function (gonext) {\n $(this).css({\n 'opacity': '1',\n 'transform': \"translate3d(0,0,0)\"\n });\n gonext()\n }\n );\n animateMenuHeader();\n useless();\n }", "title": "" }, { "docid": "8556c7899748aeaeb918f5d27cec2b2e", "score": "0.5653989", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "title": "" }, { "docid": "8556c7899748aeaeb918f5d27cec2b2e", "score": "0.5653989", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "title": "" }, { "docid": "8556c7899748aeaeb918f5d27cec2b2e", "score": "0.5653989", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"main\").style.marginLeft = \"0\";\n }", "title": "" }, { "docid": "6a78cfc745ea2867106d3a55edd7a556", "score": "0.56531864", "text": "function showMobileNav() {\n\n $('.icon__hamburger').addClass('active');\n $('body').toggleClass('menu-open');\n $('.mobile-nav').toggleClass('active');\n $('.mobile-nav').removeClass('animate-outToLeft');\n $('.mobile-nav').addClass('animate-inFromRight');\n\n // List of nav items in the mobile nav - switch to dynamic list in future\n var classes = [\n 'nav__item--1',\n 'nav__item--2',\n 'nav__item--3',\n 'nav__item--4',\n 'nav__item--5',\n 'nav__item--6',\n 'nav__item--7',\n 'nav__item--8',\n 'nav__item--9'\n ];\n\n $('.nav__level .nav__item').each(function(index, element){\n $(element).addClass(classes[index]);\n });\n\n }", "title": "" }, { "docid": "12c47dc300cf4822c8acdfbd8c365b0c", "score": "0.5652429", "text": "function animateSidebar() {\r\n $(\"#sidebar\").animate({\r\n width: \"toggle\"\r\n }, 350, function() {\r\n map.invalidateSize();\r\n });\r\n}", "title": "" }, { "docid": "974a6707a8153e9b78c192b920fb2aeb", "score": "0.5652251", "text": "function openlist() {\n const openList = document.querySelector(\".fa-bars.open-icon\");\n const closeNavbar = document.querySelector(\".close-icon\");\n navbar.style.left = \"0%\";\n openList.style.display = \"none\";\n closeNavbar.style.display = \"block\";\n }", "title": "" }, { "docid": "63fb492063c43614455056ab8b9d98c3", "score": "0.56494325", "text": "function openNav() {\r\n document.getElementById(\"mySidenav\").classList.add(\"opened\");\r\n document.getElementById(\"content\").style.display = \"block\";\r\n}", "title": "" }, { "docid": "b8734ef37ab1da8ae9b92ca11f5c0df6", "score": "0.56434965", "text": "openNav() {\n document.getElementById(\"mySidenav\").style.width = \"200px\";\n }", "title": "" }, { "docid": "3e0e9f4c77c387e18d0f657445109a3e", "score": "0.5642267", "text": "function animateServicesList() {\n\t\tisVisible(services);\n\t\tconst serviceItems = servicesList.children;\n\t\tTweenMax.staggerTo(singleFernLeaves, 1, {fill:'#fff'}, .1);\n\t\tvisibleFadeInUp(services[0], serviceItems, 0);\n\t}", "title": "" }, { "docid": "d34ea62b9dbc313e82c34449beb6fa46", "score": "0.5641944", "text": "function openNav() {\n\tdocument.getElementById(\"mySidenav\").style.width = \"250px\";\n\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\n}", "title": "" }, { "docid": "f3b4165d6c918b5dd0249a2a349290f1", "score": "0.5641585", "text": "function closeNav() {\n document.getElementById(\"mySidenav\").style.width = \"0\";\n document.getElementById(\"myOpenBtn\").style.opacity = \"1\";\n}", "title": "" } ]